git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@598
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
m_idleTag = 0;
m_topWindow = NULL;
m_exitOnFrameDelete = TRUE;
m_idleTag = 0;
m_topWindow = NULL;
m_exitOnFrameDelete = TRUE;
}
bool wxApp::OnInitGui(void)
}
bool wxApp::OnInitGui(void)
m_idleTag = gtk_idle_add( wxapp_idle_callback, NULL );
m_idleTag = gtk_idle_add( wxapp_idle_callback, NULL );
-int wxApp::OnRun(void)
-{
- return MainLoop();
+int wxApp::OnRun(void)
+{
+ return MainLoop();
}
bool wxApp::ProcessIdle(void)
}
bool wxApp::ProcessIdle(void)
wxIdleEvent event;
event.SetEventObject( this );
ProcessEvent( event );
wxIdleEvent event;
event.SetEventObject( this );
ProcessEvent( event );
return event.MoreRequested();
}
return event.MoreRequested();
}
-bool wxApp::Pending(void)
+bool wxApp::Pending(void)
-void wxApp::Dispatch(void)
+void wxApp::Dispatch(void)
while (node)
{
wxObject *obj = (wxObject *)node->Data();
while (node)
{
wxObject *obj = (wxObject *)node->Data();
delete obj;
if (wxPendingDelete.Member(obj))
delete obj;
if (wxPendingDelete.Member(obj))
wxInitializeStockObjects();
wxInitializeResourceSystem();
wxInitializeStockObjects();
wxInitializeResourceSystem();
// For PostScript printing
#if USE_POSTSCRIPT
wxInitializePrintSetupData();
// For PostScript printing
#if USE_POSTSCRIPT
wxInitializePrintSetupData();
wxDELETE(wxThePrintSetupData);
wxDELETE(wxTheFontNameDirectory);
wxDeleteStockObjects();
wxDELETE(wxThePrintSetupData);
wxDELETE(wxTheFontNameDirectory);
wxDeleteStockObjects();
wxFlushResources();
wxDELETE(wxTheResourceCache);
wxFlushResources();
wxDELETE(wxTheResourceCache);
wxDeleteStockLists();
wxCleanUpResourceSystem();
wxDeleteStockLists();
wxCleanUpResourceSystem();
wxSystemSettings::Done();
}
wxSystemSettings::Done();
}
wxLog *wxApp::CreateLogTarget()
{
return new wxLogGui;
wxLog *wxApp::CreateLogTarget()
{
return new wxLogGui;
wxBuffer = new char[BUFSIZ + 512];
wxClassInfo::InitializeClasses();
wxBuffer = new char[BUFSIZ + 512];
wxClassInfo::InitializeClasses();
#if (WXDEBUG && USE_MEMORY_TRACING) || USE_DEBUG_CONTEXT
#if !defined(_WINDLL)
#if (WXDEBUG && USE_MEMORY_TRACING) || USE_DEBUG_CONTEXT
#if !defined(_WINDLL)
wxDebugContext::SetStream(oStr, sBuf);
#endif
wxDebugContext::SetStream(oStr, sBuf);
#endif
if (!wxTheApp)
{
if (!wxApp::GetInitializerFunction())
if (!wxTheApp)
{
if (!wxApp::GetInitializerFunction())
printf( _("wxWindows error: No initializer - use IMPLEMENT_APP macro.\n") );
return 0;
}
printf( _("wxWindows error: No initializer - use IMPLEMENT_APP macro.\n") );
return 0;
}
wxAppInitializerFunction app_ini = wxApp::GetInitializerFunction();
wxAppInitializerFunction app_ini = wxApp::GetInitializerFunction();
wxObject *test_app = app_ini();
wxObject *test_app = app_ini();
wxTheApp = (wxApp*) test_app;
}
wxTheApp = (wxApp*) test_app;
}
{
printf( _("wxWindows error: wxTheApp == NULL\n") );
return 0;
{
printf( _("wxWindows error: wxTheApp == NULL\n") );
return 0;
wxTheApp->argc = argc;
wxTheApp->argv = argv;
wxTheApp->argc = argc;
wxTheApp->argv = argv;
gtk_init( &argc, &argv );
#ifdef USE_GDK_IMLIB
gdk_imlib_init();
gtk_init( &argc, &argv );
#ifdef USE_GDK_IMLIB
gdk_imlib_init();
gtk_widget_push_visual(gdk_imlib_get_visual());
gtk_widget_push_visual(gdk_imlib_get_visual());
gtk_widget_push_colormap(gdk_imlib_get_colormap());
gtk_widget_push_colormap(gdk_imlib_get_colormap());
wxApp::CommonInit();
wxTheApp->OnInitGui();
wxApp::CommonInit();
wxTheApp->OnInitGui();
// Here frames insert themselves automatically
// into wxTopLevelWindows by getting created
// in OnInit().
// Here frames insert themselves automatically
// into wxTopLevelWindows by getting created
// in OnInit().
if (!wxTheApp->OnInit()) return 0;
wxTheApp->m_initialized = (wxTopLevelWindows.Number() > 0);
if (!wxTheApp->OnInit()) return 0;
wxTheApp->m_initialized = (wxTopLevelWindows.Number() > 0);
if (wxTheApp->Initialized()) retValue = wxTheApp->OnRun();
if (wxTheApp->Initialized()) retValue = wxTheApp->OnRun();
-
- wxTheApp->DeletePendingObjects();
-
+
+ wxTheApp->DeletePendingObjects();
+
wxApp::CommonCleanUp();
wxDELETE(wxTheApp);
wxApp::CommonCleanUp();
wxDELETE(wxTheApp);
#if (WXDEBUG && USE_MEMORY_TRACING) || USE_DEBUG_CONTEXT
// At this point we want to check if there are any memory
// blocks that aren't part of the wxDebugContext itself,
#if (WXDEBUG && USE_MEMORY_TRACING) || USE_DEBUG_CONTEXT
// At this point we want to check if there are any memory
// blocks that aren't part of the wxDebugContext itself,
}
wxDebugContext::SetStream(NULL, NULL);
#endif
}
wxDebugContext::SetStream(NULL, NULL);
#endif
// main()
//-----------------------------------------------------------------------------
// main()
//-----------------------------------------------------------------------------
-#if defined(AIX) || defined(AIX4) || defined(____HPUX__)
+#if defined(AIX) || defined(AIX4) || defined(____HPUX__) || defined(NOMAIN)
// main in IMPLEMENT_WX_MAIN in IMPLEMENT_APP in app.h
// main in IMPLEMENT_WX_MAIN in IMPLEMENT_APP in app.h
m_idleTag = 0;
m_topWindow = NULL;
m_exitOnFrameDelete = TRUE;
m_idleTag = 0;
m_topWindow = NULL;
m_exitOnFrameDelete = TRUE;
}
bool wxApp::OnInitGui(void)
}
bool wxApp::OnInitGui(void)
m_idleTag = gtk_idle_add( wxapp_idle_callback, NULL );
m_idleTag = gtk_idle_add( wxapp_idle_callback, NULL );
-int wxApp::OnRun(void)
-{
- return MainLoop();
+int wxApp::OnRun(void)
+{
+ return MainLoop();
}
bool wxApp::ProcessIdle(void)
}
bool wxApp::ProcessIdle(void)
wxIdleEvent event;
event.SetEventObject( this );
ProcessEvent( event );
wxIdleEvent event;
event.SetEventObject( this );
ProcessEvent( event );
return event.MoreRequested();
}
return event.MoreRequested();
}
-bool wxApp::Pending(void)
+bool wxApp::Pending(void)
-void wxApp::Dispatch(void)
+void wxApp::Dispatch(void)
while (node)
{
wxObject *obj = (wxObject *)node->Data();
while (node)
{
wxObject *obj = (wxObject *)node->Data();
delete obj;
if (wxPendingDelete.Member(obj))
delete obj;
if (wxPendingDelete.Member(obj))
wxInitializeStockObjects();
wxInitializeResourceSystem();
wxInitializeStockObjects();
wxInitializeResourceSystem();
// For PostScript printing
#if USE_POSTSCRIPT
wxInitializePrintSetupData();
// For PostScript printing
#if USE_POSTSCRIPT
wxInitializePrintSetupData();
wxDELETE(wxThePrintSetupData);
wxDELETE(wxTheFontNameDirectory);
wxDeleteStockObjects();
wxDELETE(wxThePrintSetupData);
wxDELETE(wxTheFontNameDirectory);
wxDeleteStockObjects();
wxFlushResources();
wxDELETE(wxTheResourceCache);
wxFlushResources();
wxDELETE(wxTheResourceCache);
wxDeleteStockLists();
wxCleanUpResourceSystem();
wxDeleteStockLists();
wxCleanUpResourceSystem();
wxSystemSettings::Done();
}
wxSystemSettings::Done();
}
wxLog *wxApp::CreateLogTarget()
{
return new wxLogGui;
wxLog *wxApp::CreateLogTarget()
{
return new wxLogGui;
wxBuffer = new char[BUFSIZ + 512];
wxClassInfo::InitializeClasses();
wxBuffer = new char[BUFSIZ + 512];
wxClassInfo::InitializeClasses();
#if (WXDEBUG && USE_MEMORY_TRACING) || USE_DEBUG_CONTEXT
#if !defined(_WINDLL)
#if (WXDEBUG && USE_MEMORY_TRACING) || USE_DEBUG_CONTEXT
#if !defined(_WINDLL)
wxDebugContext::SetStream(oStr, sBuf);
#endif
wxDebugContext::SetStream(oStr, sBuf);
#endif
if (!wxTheApp)
{
if (!wxApp::GetInitializerFunction())
if (!wxTheApp)
{
if (!wxApp::GetInitializerFunction())
printf( _("wxWindows error: No initializer - use IMPLEMENT_APP macro.\n") );
return 0;
}
printf( _("wxWindows error: No initializer - use IMPLEMENT_APP macro.\n") );
return 0;
}
wxAppInitializerFunction app_ini = wxApp::GetInitializerFunction();
wxAppInitializerFunction app_ini = wxApp::GetInitializerFunction();
wxObject *test_app = app_ini();
wxObject *test_app = app_ini();
wxTheApp = (wxApp*) test_app;
}
wxTheApp = (wxApp*) test_app;
}
{
printf( _("wxWindows error: wxTheApp == NULL\n") );
return 0;
{
printf( _("wxWindows error: wxTheApp == NULL\n") );
return 0;
wxTheApp->argc = argc;
wxTheApp->argv = argv;
wxTheApp->argc = argc;
wxTheApp->argv = argv;
gtk_init( &argc, &argv );
#ifdef USE_GDK_IMLIB
gdk_imlib_init();
gtk_init( &argc, &argv );
#ifdef USE_GDK_IMLIB
gdk_imlib_init();
gtk_widget_push_visual(gdk_imlib_get_visual());
gtk_widget_push_visual(gdk_imlib_get_visual());
gtk_widget_push_colormap(gdk_imlib_get_colormap());
gtk_widget_push_colormap(gdk_imlib_get_colormap());
wxApp::CommonInit();
wxTheApp->OnInitGui();
wxApp::CommonInit();
wxTheApp->OnInitGui();
// Here frames insert themselves automatically
// into wxTopLevelWindows by getting created
// in OnInit().
// Here frames insert themselves automatically
// into wxTopLevelWindows by getting created
// in OnInit().
if (!wxTheApp->OnInit()) return 0;
wxTheApp->m_initialized = (wxTopLevelWindows.Number() > 0);
if (!wxTheApp->OnInit()) return 0;
wxTheApp->m_initialized = (wxTopLevelWindows.Number() > 0);
if (wxTheApp->Initialized()) retValue = wxTheApp->OnRun();
if (wxTheApp->Initialized()) retValue = wxTheApp->OnRun();
-
- wxTheApp->DeletePendingObjects();
-
+
+ wxTheApp->DeletePendingObjects();
+
wxApp::CommonCleanUp();
wxDELETE(wxTheApp);
wxApp::CommonCleanUp();
wxDELETE(wxTheApp);
#if (WXDEBUG && USE_MEMORY_TRACING) || USE_DEBUG_CONTEXT
// At this point we want to check if there are any memory
// blocks that aren't part of the wxDebugContext itself,
#if (WXDEBUG && USE_MEMORY_TRACING) || USE_DEBUG_CONTEXT
// At this point we want to check if there are any memory
// blocks that aren't part of the wxDebugContext itself,
}
wxDebugContext::SetStream(NULL, NULL);
#endif
}
wxDebugContext::SetStream(NULL, NULL);
#endif
// main()
//-----------------------------------------------------------------------------
// main()
//-----------------------------------------------------------------------------
-#if defined(AIX) || defined(AIX4) || defined(____HPUX__)
+#if defined(AIX) || defined(AIX4) || defined(____HPUX__) || defined(NOMAIN)
// main in IMPLEMENT_WX_MAIN in IMPLEMENT_APP in app.h
// main in IMPLEMENT_WX_MAIN in IMPLEMENT_APP in app.h