1 /*****************************************************************************
2 * beos_init.cpp: Initialization for BeOS specific features
3 *****************************************************************************
4 * Copyright (C) 1999, 2000 VideoLAN
5 * $Id: beos_specific.cpp,v 1.7 2001/04/12 01:52:45 sam Exp $
7 * Authors: Jean-Marc Dressler <polux@via.ecp.fr>
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
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
22 *****************************************************************************/
25 #include <Application.h>
37 #include "beos_specific.h"
41 /*****************************************************************************
43 *****************************************************************************/
44 static vlc_thread_t beos_app_thread;
45 static char * psz_program_path;
51 void system_AppThread( void * args )
53 BApplication * BeApp = new BApplication("application/x-VLC");
58 void system_Create( int *pi_argc, char *ppsz_argv[], char *ppsz_env[] )
65 vlc_thread_create( &beos_app_thread, "app thread", (vlc_thread_func_t)beos_AppThread, 0 );
66 while( be_app == NULL )
69 be_app->GetAppInfo(&info);
70 BEntry entry(&info.ref);
72 path.GetParent(&path);
73 i_lenght = strlen( path.Path() );
74 psz_program_path = (char*) malloc( i_lenght+1 ); /* XXX */
75 strcpy( psz_program_path, path.Path() );
78 void system_Destroy( void )
80 free( psz_program_path ); /* XXX */
81 be_app->PostMessage( B_QUIT_REQUESTED );
82 vlc_thread_join( beos_app_thread );
85 char * system_GetProgramPath( void )
87 return( psz_program_path );