1 #############################################################################
3 ## Purpose: XS for Wx::_App and Wx::App
4 ## Author: Mattia Barbon
7 ## RCS-ID: $Id: App.xs 2303 2007-12-24 17:25:05Z mbarbon $
8 ## Copyright: (c) 2000-2007 Mattia Barbon
9 ## Licence: This program is free software; you can redistribute it and/or
10 ## modify it under the same terms as Perl itself
11 #############################################################################
16 #include <wx/artprov.h>
18 MODULE=Wx PACKAGE=Wx PREFIX=wx
21 wxPostEvent( evthnd, event )
25 wxPostEvent( evthnd, *event );
30 MODULE=Wx PACKAGE=Wx::_App
37 // for Wx::Perl::SplashFast
38 if( !SvROK( sub ) || SvTYPE( SvRV( sub ) ) != SVt_PVCV )
39 croak( "sub must be a CODE reference" );
40 #if WXPERL_W_VERSION_LE( 2, 5, 1 )
41 app->argc = wxPli_get_args_argc_argv( (void***) &app->argv, 1 );
44 app->SetClassName( app->argv[0] );
45 app->SetAppName( app->argv[0] );
47 #if WXPERL_W_VERSION_LE( 2, 5, 0 )
48 if( !wxPerlAppCreated )
53 RETVAL = call_oninit( aTHX_ ST(0), sub );
62 #if WXPERL_W_VERSION_LT( 2, 5, 1 )
63 wxTheApp = new wxPliApp();
65 wxAppConsole::SetInstance( new wxPliApp() );
71 MODULE=Wx PACKAGE=Wx::App
74 # virtual void OnFatalException() # too low level
82 #if WXPERL_W_VERSION_GE( 2, 9, 0 )
85 wxApp::GetAppDisplayName()
89 #if defined( __WXMSW__ ) && WXPERL_W_VERSION_LT( 2, 5, 1 )
100 wxApp::GetExitOnFrameDelete()
103 wxApp::GetStdIcon( which )
109 case wxICON_EXCLAMATION:
115 case wxICON_QUESTION:
118 case wxICON_INFORMATION:
119 id = wxART_INFORMATION;
123 RETVAL = new wxIcon( wxArtProvider::GetIcon( id, wxART_MESSAGE_BOX ) );
128 wxApp::GetTopWindow()
131 wxApp::GetUseBestVisual()
134 wxApp::GetVendorName()
136 #if WXPERL_W_VERSION_GE( 2, 9, 0 )
139 wxApp::GetVendorDisplayName()
144 wxApp::ExitMainLoop()
146 #if WXPERL_W_VERSION_LT( 2, 7, 0 )
156 RETVAL = THIS->MainLoop();
157 // hack for embedded case...
158 #if defined( __WXMSW__ ) && WXPERL_W_VERSION_LT( 2, 5, 0 )
159 wxPliApp::SetKeepGoing( (wxPliApp*) THIS, true );
161 wxPliApp::DeletePendingObjects( THIS );
168 wxApp::ProcessPendingEvents()
171 wxApp::SetAppName( name )
174 #if WXPERL_W_VERSION_GE( 2, 9, 0 )
177 wxApp::SetAppDisplayName( name )
182 #if defined( __WXMSW__ ) && WXPERL_W_VERSION_LT( 2, 5, 0 )
185 wxApp::SetAuto3D( auto3d )
191 wxApp::SetClassName( name )
195 wxApp::SetExitOnFrameDelete( flag )
199 wxApp::SetTopWindow( window )
203 wxApp::SetVendorName( name )
206 #if WXPERL_W_VERSION_GE( 2, 9, 0 )
209 wxApp::SetVendorDisplayName( name )
215 wxApp::SetUseBestVisual( flag )
221 THIS->wxApp::Yield();
223 #if defined( __WXMSW__ ) && WXPERL_W_VERSION_GE( 2, 5, 0 )
228 RETVAL = wxApp::GetComCtl32Version();
234 #if WXPERL_W_VERSION_GE( 2, 5, 2 )
243 wxApp::SendIdleEvents( window, event )
246 C_ARGS: window, *event
253 #if WXPERL_W_VERSION_GE( 2, 7, 1 )
256 wxApp::GetLayoutDirection()
263 RETVAL = (wxApp*)wxApp::GetInstance();
270 wxApp::SetInstance( app );
273 wxApp::IsMainLoopRunning()