1 /*****************************************************************************
2 * beos_init.cpp: Initialization for BeOS specific features
3 *****************************************************************************
4 * Copyright (C) 1999, 2000 VideoLAN
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * General Public License for more details.
19 * You should have received a copy of the GNU General Public
20 * License along with this program; if not, write to the
21 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
22 * Boston, MA 02111-1307, USA.
23 *****************************************************************************/
26 #include <Application.h>
38 #include "beos_specific.h"
42 /*****************************************************************************
44 *****************************************************************************/
45 static vlc_thread_t beos_app_thread;
46 static char * psz_beos_program_path;
52 void beos_AppThread( void * args )
54 BApplication * BeApp = new BApplication("application/x-VLC");
59 void beos_Init( void )
65 vlc_thread_create( &beos_app_thread, "app thread", (vlc_thread_func_t)beos_AppThread, 0 );
67 // FIXME: we need to verify that be_app is initialized and the msleep is not enough
68 // but the following code does not work as it should and I have no good
69 // solution at the moment.
70 //while( be_app == NULL )
73 be_app->GetAppInfo(&info);
74 BEntry entry(&info.ref);
76 path.GetParent(&path);
77 i_lenght = strlen( path.Path() );
78 psz_beos_program_path = (char*) malloc( i_lenght+1 ); /* XXX */
79 strcpy( psz_beos_program_path, path.Path() );
82 void beos_Clean( void )
84 free( psz_beos_program_path ); /* XXX */
85 be_app->PostMessage( B_QUIT_REQUESTED );
86 vlc_thread_join( beos_app_thread );
89 char * beos_GetProgramPath( void )
91 return( psz_beos_program_path );