1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: c++ wrapper for wxApp
4 // Author: Mattia Barbon
7 // RCS-ID: $Id: app.h 2057 2007-06-18 23:03:00Z mbarbon $
8 // Copyright: (c) 2000-2006 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 /////////////////////////////////////////////////////////////////////////////
17 class wxPliApp:public wxApp
19 WXPLI_DECLARE_DYNAMIC_CLASS( wxPliApp );
20 WXPLI_DECLARE_V_CBACK();
22 wxPliApp( const char* package = "Wx::App" );
27 void CleanUp() { DeletePendingObjects( this ); wxApp::CleanUp(); }
29 #if defined( __WXMSW__ ) && WXPERL_W_VERSION_LT( 2, 5, 0 )
30 static void SetKeepGoing(wxPliApp* app, bool value)
32 app->m_keepGoing = value;
36 void DeletePendingObjects() {
37 wxApp::DeletePendingObjects();
40 static void DeletePendingObjects(wxApp* app)
42 ((wxPliApp*) app)->DeletePendingObjects();
45 DEC_V_CBACK_INT__VOID( OnExit );
46 DEC_V_CBACK_BOOL__BOOL( Yield );
49 inline wxPliApp::wxPliApp( const char* package )
50 :m_callback( "Wx::App" )
52 m_callback.SetSelf( wxPli_make_object( this, package ), true );
60 delete GetTopWindow();
64 DeletePendingObjects();
68 #if WXPERL_W_VERSION_LE( 2, 5, 1 )
69 wxPli_delete_argv( (void***) &argv, 1 );
76 inline bool wxPliApp::OnInit()
83 inline int wxPliApp::MainLoop() {
86 DeletePendingObjects();
87 #if defined( __WXGTK__ ) && WXPERL_W_VERSION_LT( 2, 5, 1 )
88 m_initialized = wxTopLevelWindows.GetCount() != 0;
91 if( m_exitOnFrameDelete == Later )
92 m_exitOnFrameDelete = Yes;
93 retval = wxApp::MainLoop();
99 DEF_V_CBACK_INT__VOID( wxPliApp, wxApp, OnExit );
100 DEF_V_CBACK_BOOL__BOOL( wxPliApp, wxApp, Yield );
102 WXPLI_IMPLEMENT_DYNAMIC_CLASS( wxPliApp, wxApp );
104 // Local variables: //