1 /*****************************************************************************
2 * beos_init.cpp: Initialization for BeOS specific features
3 *****************************************************************************
4 * Copyright (C) 1999, 2000 VideoLAN
6 * Authors: Jean-Marc Dressler <polux@via.ecp.fr>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
21 *****************************************************************************/
24 #include <Application.h>
36 #include "beos_specific.h"
40 /*****************************************************************************
42 *****************************************************************************/
43 static vlc_thread_t beos_app_thread;
44 static char * psz_beos_program_path;
50 void beos_AppThread( void * args )
52 BApplication * BeApp = new BApplication("application/x-VLC");
57 void beos_Create( void )
63 vlc_thread_create( &beos_app_thread, "app thread", (vlc_thread_func_t)beos_AppThread, 0 );
65 // FIXME: we need to verify that be_app is initialized and the msleep is not enough
66 // but the following code does not work as it should and I have no good
67 // solution at the moment.
68 //while( be_app == NULL )
71 be_app->GetAppInfo(&info);
72 BEntry entry(&info.ref);
74 path.GetParent(&path);
75 i_lenght = strlen( path.Path() );
76 psz_beos_program_path = (char*) malloc( i_lenght+1 ); /* XXX */
77 strcpy( psz_beos_program_path, path.Path() );
80 void beos_Destroy( void )
82 free( psz_beos_program_path ); /* XXX */
83 be_app->PostMessage( B_QUIT_REQUESTED );
84 vlc_thread_join( beos_app_thread );
87 char * beos_GetProgramPath( void )
89 return( psz_beos_program_path );