Moved the main funtion into its own source file.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1257 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -96,6 +96,7 @@ LIB_CPP_SRC=\
|
|||||||
gtk/gdiobj.cpp \
|
gtk/gdiobj.cpp \
|
||||||
gtk/icon.cpp \
|
gtk/icon.cpp \
|
||||||
gtk/listbox.cpp \
|
gtk/listbox.cpp \
|
||||||
|
gtk/main.cpp \
|
||||||
gtk/mdi.cpp \
|
gtk/mdi.cpp \
|
||||||
gtk/menu.cpp \
|
gtk/menu.cpp \
|
||||||
gtk/minifram.cpp \
|
gtk/minifram.cpp \
|
||||||
|
@@ -85,12 +85,12 @@ unsigned char g_palette[64*3] =
|
|||||||
0x75, 0x93, 0x4f,
|
0x75, 0x93, 0x4f,
|
||||||
0x91, 0xae, 0x64,
|
0x91, 0xae, 0x64,
|
||||||
0xad, 0xc8, 0x7a,
|
0xad, 0xc8, 0x7a,
|
||||||
0xf0, 0xa8, 0xef,
|
0xf0, 0xa8, 0xef,
|
||||||
0xd0, 0x88, 0xd0,
|
0xd0, 0x88, 0xd0,
|
||||||
0xaf, 0x66, 0xaf,
|
0xaf, 0x66, 0xaf,
|
||||||
0x8e, 0x44, 0x8e,
|
0x8e, 0x44, 0x8e,
|
||||||
0x6d, 0x22, 0x6d,
|
0x6d, 0x22, 0x6d,
|
||||||
0x4b, 0x0, 0x4b,
|
0x4b, 0x0, 0x4b,
|
||||||
0xff, 0xc0, 0xbc,
|
0xff, 0xc0, 0xbc,
|
||||||
0xff, 0x93, 0x91,
|
0xff, 0x93, 0x91,
|
||||||
0xff, 0x66, 0x67,
|
0xff, 0x66, 0x67,
|
||||||
@@ -209,7 +209,7 @@ void wxApp::OnIdle( wxIdleEvent &event )
|
|||||||
bool wxApp::SendIdleEvents(void)
|
bool wxApp::SendIdleEvents(void)
|
||||||
{
|
{
|
||||||
bool needMore = FALSE;
|
bool needMore = FALSE;
|
||||||
|
|
||||||
wxNode* node = wxTopLevelWindows.First();
|
wxNode* node = wxTopLevelWindows.First();
|
||||||
while (node)
|
while (node)
|
||||||
{
|
{
|
||||||
@@ -326,7 +326,7 @@ void wxApp::CommonInit(void)
|
|||||||
wxInitializeResourceSystem();
|
wxInitializeResourceSystem();
|
||||||
|
|
||||||
wxImage::InitStandardHandlers();
|
wxImage::InitStandardHandlers();
|
||||||
|
|
||||||
// g_globalCursor = new wxCursor;
|
// g_globalCursor = new wxCursor;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -343,7 +343,7 @@ void wxApp::CommonCleanUp(void)
|
|||||||
wxDeleteStockLists();
|
wxDeleteStockLists();
|
||||||
|
|
||||||
wxCleanUpResourceSystem();
|
wxCleanUpResourceSystem();
|
||||||
|
|
||||||
wxImage::CleanUpHandlers();
|
wxImage::CleanUpHandlers();
|
||||||
|
|
||||||
wxSystemSettings::Done();
|
wxSystemSettings::Done();
|
||||||
@@ -402,9 +402,9 @@ int wxEntry( int argc, char *argv[] )
|
|||||||
strcpy( name, wxFileNameFromPath(name) );
|
strcpy( name, wxFileNameFromPath(name) );
|
||||||
wxStripExtension( name );
|
wxStripExtension( name );
|
||||||
wxTheApp->SetAppName( name );
|
wxTheApp->SetAppName( name );
|
||||||
|
|
||||||
gtk_set_locale();
|
gtk_set_locale();
|
||||||
|
|
||||||
gtk_init( &argc, &argv );
|
gtk_init( &argc, &argv );
|
||||||
|
|
||||||
GdkColormap *cmap = gdk_colormap_new( gdk_visual_get_system(), TRUE );
|
GdkColormap *cmap = gdk_colormap_new( gdk_visual_get_system(), TRUE );
|
||||||
@@ -416,19 +416,19 @@ int wxEntry( int argc, char *argv[] )
|
|||||||
col.green = g_palette[i*3 + 1] << 8;
|
col.green = g_palette[i*3 + 1] << 8;
|
||||||
col.blue = g_palette[i*3 + 2] << 8;
|
col.blue = g_palette[i*3 + 2] << 8;
|
||||||
col.pixel = 0;
|
col.pixel = 0;
|
||||||
|
|
||||||
gdk_color_alloc( cmap, &col );
|
gdk_color_alloc( cmap, &col );
|
||||||
}
|
}
|
||||||
|
|
||||||
gtk_widget_push_colormap( cmap );
|
gtk_widget_push_colormap( cmap );
|
||||||
|
|
||||||
gtk_widget_set_default_colormap( cmap );
|
gtk_widget_set_default_colormap( cmap );
|
||||||
|
|
||||||
wxApp::CommonInit();
|
wxApp::CommonInit();
|
||||||
|
|
||||||
wxModule::RegisterModules();
|
wxModule::RegisterModules();
|
||||||
if (!wxModule::InitializeModules()) return FALSE;
|
if (!wxModule::InitializeModules()) return FALSE;
|
||||||
|
|
||||||
wxTheApp->OnInitGui();
|
wxTheApp->OnInitGui();
|
||||||
|
|
||||||
// Here frames insert themselves automatically
|
// Here frames insert themselves automatically
|
||||||
@@ -448,18 +448,18 @@ int wxEntry( int argc, char *argv[] )
|
|||||||
wxTheApp->OnExit();
|
wxTheApp->OnExit();
|
||||||
|
|
||||||
wxModule::CleanUpModules();
|
wxModule::CleanUpModules();
|
||||||
|
|
||||||
wxApp::CommonCleanUp();
|
wxApp::CommonCleanUp();
|
||||||
|
|
||||||
delete wxTheApp;
|
delete wxTheApp;
|
||||||
wxTheApp = (wxApp*) NULL;
|
wxTheApp = (wxApp*) NULL;
|
||||||
|
|
||||||
wxClassInfo::CleanUpClasses();
|
wxClassInfo::CleanUpClasses();
|
||||||
|
|
||||||
delete[] wxBuffer;
|
delete[] wxBuffer;
|
||||||
|
|
||||||
#if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
|
#if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
|
||||||
|
|
||||||
if (wxDebugContext::CountObjectsLeft() > 0)
|
if (wxDebugContext::CountObjectsLeft() > 0)
|
||||||
{
|
{
|
||||||
wxLogDebug("There were memory leaks.\n");
|
wxLogDebug("There were memory leaks.\n");
|
||||||
@@ -467,7 +467,7 @@ int wxEntry( int argc, char *argv[] )
|
|||||||
wxDebugContext::PrintStatistics();
|
wxDebugContext::PrintStatistics();
|
||||||
}
|
}
|
||||||
// wxDebugContext::SetStream(NULL, NULL);
|
// wxDebugContext::SetStream(NULL, NULL);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
wxLog *oldLog = wxLog::SetActiveTarget( NULL );
|
wxLog *oldLog = wxLog::SetActiveTarget( NULL );
|
||||||
@@ -477,17 +477,7 @@ int wxEntry( int argc, char *argv[] )
|
|||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// main()
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
#if defined(AIX) || defined(AIX4) || defined(____HPUX__) || defined(NOMAIN)
|
|
||||||
|
|
||||||
// main in IMPLEMENT_WX_MAIN in IMPLEMENT_APP in app.h
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
int main(int argc, char *argv[]) { return wxEntry(argc, argv); }
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
|
29
src/gtk/main.cpp
Normal file
29
src/gtk/main.cpp
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: main.cpp
|
||||||
|
// Purpose: Entry point
|
||||||
|
// Author: Julian Smart
|
||||||
|
// Modified by:
|
||||||
|
// Created: 17/09/98
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) Julian Smart
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#include "wx/app.h"
|
||||||
|
|
||||||
|
int wxEntry(int argc, char *argv[]);
|
||||||
|
|
||||||
|
|
||||||
|
#if defined(AIX) || defined(AIX4) || defined(____HPUX__) || defined(NOMAIN)
|
||||||
|
|
||||||
|
// main in IMPLEMENT_WX_MAIN in IMPLEMENT_APP in app.h
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
|
||||||
|
int main(int argc, char* argv[])
|
||||||
|
{
|
||||||
|
return wxEntry(argc, argv);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
@@ -85,12 +85,12 @@ unsigned char g_palette[64*3] =
|
|||||||
0x75, 0x93, 0x4f,
|
0x75, 0x93, 0x4f,
|
||||||
0x91, 0xae, 0x64,
|
0x91, 0xae, 0x64,
|
||||||
0xad, 0xc8, 0x7a,
|
0xad, 0xc8, 0x7a,
|
||||||
0xf0, 0xa8, 0xef,
|
0xf0, 0xa8, 0xef,
|
||||||
0xd0, 0x88, 0xd0,
|
0xd0, 0x88, 0xd0,
|
||||||
0xaf, 0x66, 0xaf,
|
0xaf, 0x66, 0xaf,
|
||||||
0x8e, 0x44, 0x8e,
|
0x8e, 0x44, 0x8e,
|
||||||
0x6d, 0x22, 0x6d,
|
0x6d, 0x22, 0x6d,
|
||||||
0x4b, 0x0, 0x4b,
|
0x4b, 0x0, 0x4b,
|
||||||
0xff, 0xc0, 0xbc,
|
0xff, 0xc0, 0xbc,
|
||||||
0xff, 0x93, 0x91,
|
0xff, 0x93, 0x91,
|
||||||
0xff, 0x66, 0x67,
|
0xff, 0x66, 0x67,
|
||||||
@@ -209,7 +209,7 @@ void wxApp::OnIdle( wxIdleEvent &event )
|
|||||||
bool wxApp::SendIdleEvents(void)
|
bool wxApp::SendIdleEvents(void)
|
||||||
{
|
{
|
||||||
bool needMore = FALSE;
|
bool needMore = FALSE;
|
||||||
|
|
||||||
wxNode* node = wxTopLevelWindows.First();
|
wxNode* node = wxTopLevelWindows.First();
|
||||||
while (node)
|
while (node)
|
||||||
{
|
{
|
||||||
@@ -326,7 +326,7 @@ void wxApp::CommonInit(void)
|
|||||||
wxInitializeResourceSystem();
|
wxInitializeResourceSystem();
|
||||||
|
|
||||||
wxImage::InitStandardHandlers();
|
wxImage::InitStandardHandlers();
|
||||||
|
|
||||||
// g_globalCursor = new wxCursor;
|
// g_globalCursor = new wxCursor;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -343,7 +343,7 @@ void wxApp::CommonCleanUp(void)
|
|||||||
wxDeleteStockLists();
|
wxDeleteStockLists();
|
||||||
|
|
||||||
wxCleanUpResourceSystem();
|
wxCleanUpResourceSystem();
|
||||||
|
|
||||||
wxImage::CleanUpHandlers();
|
wxImage::CleanUpHandlers();
|
||||||
|
|
||||||
wxSystemSettings::Done();
|
wxSystemSettings::Done();
|
||||||
@@ -402,9 +402,9 @@ int wxEntry( int argc, char *argv[] )
|
|||||||
strcpy( name, wxFileNameFromPath(name) );
|
strcpy( name, wxFileNameFromPath(name) );
|
||||||
wxStripExtension( name );
|
wxStripExtension( name );
|
||||||
wxTheApp->SetAppName( name );
|
wxTheApp->SetAppName( name );
|
||||||
|
|
||||||
gtk_set_locale();
|
gtk_set_locale();
|
||||||
|
|
||||||
gtk_init( &argc, &argv );
|
gtk_init( &argc, &argv );
|
||||||
|
|
||||||
GdkColormap *cmap = gdk_colormap_new( gdk_visual_get_system(), TRUE );
|
GdkColormap *cmap = gdk_colormap_new( gdk_visual_get_system(), TRUE );
|
||||||
@@ -416,19 +416,19 @@ int wxEntry( int argc, char *argv[] )
|
|||||||
col.green = g_palette[i*3 + 1] << 8;
|
col.green = g_palette[i*3 + 1] << 8;
|
||||||
col.blue = g_palette[i*3 + 2] << 8;
|
col.blue = g_palette[i*3 + 2] << 8;
|
||||||
col.pixel = 0;
|
col.pixel = 0;
|
||||||
|
|
||||||
gdk_color_alloc( cmap, &col );
|
gdk_color_alloc( cmap, &col );
|
||||||
}
|
}
|
||||||
|
|
||||||
gtk_widget_push_colormap( cmap );
|
gtk_widget_push_colormap( cmap );
|
||||||
|
|
||||||
gtk_widget_set_default_colormap( cmap );
|
gtk_widget_set_default_colormap( cmap );
|
||||||
|
|
||||||
wxApp::CommonInit();
|
wxApp::CommonInit();
|
||||||
|
|
||||||
wxModule::RegisterModules();
|
wxModule::RegisterModules();
|
||||||
if (!wxModule::InitializeModules()) return FALSE;
|
if (!wxModule::InitializeModules()) return FALSE;
|
||||||
|
|
||||||
wxTheApp->OnInitGui();
|
wxTheApp->OnInitGui();
|
||||||
|
|
||||||
// Here frames insert themselves automatically
|
// Here frames insert themselves automatically
|
||||||
@@ -448,18 +448,18 @@ int wxEntry( int argc, char *argv[] )
|
|||||||
wxTheApp->OnExit();
|
wxTheApp->OnExit();
|
||||||
|
|
||||||
wxModule::CleanUpModules();
|
wxModule::CleanUpModules();
|
||||||
|
|
||||||
wxApp::CommonCleanUp();
|
wxApp::CommonCleanUp();
|
||||||
|
|
||||||
delete wxTheApp;
|
delete wxTheApp;
|
||||||
wxTheApp = (wxApp*) NULL;
|
wxTheApp = (wxApp*) NULL;
|
||||||
|
|
||||||
wxClassInfo::CleanUpClasses();
|
wxClassInfo::CleanUpClasses();
|
||||||
|
|
||||||
delete[] wxBuffer;
|
delete[] wxBuffer;
|
||||||
|
|
||||||
#if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
|
#if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
|
||||||
|
|
||||||
if (wxDebugContext::CountObjectsLeft() > 0)
|
if (wxDebugContext::CountObjectsLeft() > 0)
|
||||||
{
|
{
|
||||||
wxLogDebug("There were memory leaks.\n");
|
wxLogDebug("There were memory leaks.\n");
|
||||||
@@ -467,7 +467,7 @@ int wxEntry( int argc, char *argv[] )
|
|||||||
wxDebugContext::PrintStatistics();
|
wxDebugContext::PrintStatistics();
|
||||||
}
|
}
|
||||||
// wxDebugContext::SetStream(NULL, NULL);
|
// wxDebugContext::SetStream(NULL, NULL);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
wxLog *oldLog = wxLog::SetActiveTarget( NULL );
|
wxLog *oldLog = wxLog::SetActiveTarget( NULL );
|
||||||
@@ -477,17 +477,7 @@ int wxEntry( int argc, char *argv[] )
|
|||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// main()
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
#if defined(AIX) || defined(AIX4) || defined(____HPUX__) || defined(NOMAIN)
|
|
||||||
|
|
||||||
// main in IMPLEMENT_WX_MAIN in IMPLEMENT_APP in app.h
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
int main(int argc, char *argv[]) { return wxEntry(argc, argv); }
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
|
29
src/gtk1/main.cpp
Normal file
29
src/gtk1/main.cpp
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: main.cpp
|
||||||
|
// Purpose: Entry point
|
||||||
|
// Author: Julian Smart
|
||||||
|
// Modified by:
|
||||||
|
// Created: 17/09/98
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) Julian Smart
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#include "wx/app.h"
|
||||||
|
|
||||||
|
int wxEntry(int argc, char *argv[]);
|
||||||
|
|
||||||
|
|
||||||
|
#if defined(AIX) || defined(AIX4) || defined(____HPUX__) || defined(NOMAIN)
|
||||||
|
|
||||||
|
// main in IMPLEMENT_WX_MAIN in IMPLEMENT_APP in app.h
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
|
||||||
|
int main(int argc, char* argv[])
|
||||||
|
{
|
||||||
|
return wxEntry(argc, argv);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
Reference in New Issue
Block a user