Did splitting of wxEntry for wxMSW. Not nearly as complex as wxGTK
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6612 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -577,6 +577,27 @@ void wxApp::CleanUp()
|
|||||||
#endif // wxUSE_LOG
|
#endif // wxUSE_LOG
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
// Entry point helpers, used by wxPython
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
|
||||||
|
int WXDLLEXPORT wxEntryStart( int WXUNUSED(argc), char** WXUNUSED(argv) )
|
||||||
|
{
|
||||||
|
return wxApp::Initialize();
|
||||||
|
}
|
||||||
|
|
||||||
|
int WXDLLEXPORT wxEntryInitGui()
|
||||||
|
{
|
||||||
|
wxTheApp->OnInitGui();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void WXDLLEXPORT wxEntryCleanup()
|
||||||
|
{
|
||||||
|
wxApp::CleanUp();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#if !defined(_WINDLL) || (defined(_WINDLL) && defined(WXMAKINGDLL))
|
#if !defined(_WINDLL) || (defined(_WINDLL) && defined(WXMAKINGDLL))
|
||||||
|
|
||||||
// temporarily disable this warning which would be generated in release builds
|
// temporarily disable this warning which would be generated in release builds
|
||||||
@@ -585,7 +606,9 @@ void wxApp::CleanUp()
|
|||||||
#pragma warning(disable: 4715) // not all control paths return a value
|
#pragma warning(disable: 4715) // not all control paths return a value
|
||||||
#endif // Visual C++
|
#endif // Visual C++
|
||||||
|
|
||||||
//// Main wxWindows entry point
|
//----------------------------------------------------------------------
|
||||||
|
// Main wxWindows entry point
|
||||||
|
//----------------------------------------------------------------------
|
||||||
int wxEntry(WXHINSTANCE hInstance,
|
int wxEntry(WXHINSTANCE hInstance,
|
||||||
WXHINSTANCE WXUNUSED(hPrevInstance),
|
WXHINSTANCE WXUNUSED(hPrevInstance),
|
||||||
char *lpCmdLine,
|
char *lpCmdLine,
|
||||||
@@ -620,7 +643,7 @@ int wxEntry(WXHINSTANCE hInstance,
|
|||||||
#endif
|
#endif
|
||||||
wxhInstance = (HINSTANCE) hInstance;
|
wxhInstance = (HINSTANCE) hInstance;
|
||||||
|
|
||||||
if (!wxApp::Initialize())
|
if (!wxEntryStart(0,0))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
// create the application object or ensure that one already exists
|
// create the application object or ensure that one already exists
|
||||||
@@ -643,7 +666,7 @@ int wxEntry(WXHINSTANCE hInstance,
|
|||||||
|
|
||||||
// GUI-specific initialisation. In fact on Windows we don't have any,
|
// GUI-specific initialisation. In fact on Windows we don't have any,
|
||||||
// but this call is provided for compatibility across platforms.
|
// but this call is provided for compatibility across platforms.
|
||||||
wxTheApp->OnInitGui();
|
wxEntryInitGui();
|
||||||
|
|
||||||
// We really don't want timestamps by default, because it means
|
// We really don't want timestamps by default, because it means
|
||||||
// we can't simply double-click on the error message and get to that
|
// we can't simply double-click on the error message and get to that
|
||||||
@@ -685,7 +708,7 @@ int wxEntry(WXHINSTANCE hInstance,
|
|||||||
|
|
||||||
wxTheApp->OnExit();
|
wxTheApp->OnExit();
|
||||||
|
|
||||||
wxApp::CleanUp();
|
wxEntryCleanup();
|
||||||
|
|
||||||
return retValue;
|
return retValue;
|
||||||
|
|
||||||
@@ -718,12 +741,14 @@ int wxEntry(WXHINSTANCE hInstance,
|
|||||||
|
|
||||||
#else /* _WINDLL */
|
#else /* _WINDLL */
|
||||||
|
|
||||||
//// Entry point for DLLs
|
//----------------------------------------------------------------------
|
||||||
|
// Entry point for wxWindows + the App in a DLL
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
|
||||||
int wxEntry(WXHINSTANCE hInstance)
|
int wxEntry(WXHINSTANCE hInstance)
|
||||||
{
|
{
|
||||||
wxhInstance = (HINSTANCE) hInstance;
|
wxhInstance = (HINSTANCE) hInstance;
|
||||||
wxApp::Initialize();
|
wxEntryStart(0, 0);
|
||||||
|
|
||||||
// The app may have declared a global application object, but we recommend
|
// The app may have declared a global application object, but we recommend
|
||||||
// the IMPLEMENT_APP macro is used instead, which sets an initializer function
|
// the IMPLEMENT_APP macro is used instead, which sets an initializer function
|
||||||
@@ -741,7 +766,7 @@ int wxEntry(WXHINSTANCE hInstance)
|
|||||||
wxTheApp->argc = 0;
|
wxTheApp->argc = 0;
|
||||||
wxTheApp->argv = NULL;
|
wxTheApp->argv = NULL;
|
||||||
|
|
||||||
wxTheApp->OnInitGui();
|
wxEntryInitGui();
|
||||||
|
|
||||||
wxTheApp->OnInit();
|
wxTheApp->OnInit();
|
||||||
|
|
||||||
|
@@ -105,9 +105,9 @@ int wxPyApp::MainLoop(void) {
|
|||||||
//---------------------------------------------------------------------
|
//---------------------------------------------------------------------
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
||||||
int wxEntryStart( int argc, char *argv[] );
|
int WXDLLEXPORT wxEntryStart( int argc, char** argv );
|
||||||
int wxEntryInitGui();
|
int WXDLLEXPORT wxEntryInitGui();
|
||||||
void wxEntryCleanup();
|
void WXDLLEXPORT wxEntryCleanup();
|
||||||
|
|
||||||
|
|
||||||
// This is where we pick up the first part of the wxEntry functionality...
|
// This is where we pick up the first part of the wxEntry functionality...
|
||||||
@@ -125,55 +125,6 @@ void __wxPreStart()
|
|||||||
if (wxTopLevelWindows.Number() > 0)
|
if (wxTopLevelWindows.Number() > 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#if 0
|
|
||||||
|
|
||||||
#ifdef __WXMSW__
|
|
||||||
wxApp::Initialize();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __WXGTK__
|
|
||||||
PyObject* sysargv = PySys_GetObject("argv");
|
|
||||||
int argc = PyList_Size(sysargv);
|
|
||||||
char** argv = new char*[argc+1];
|
|
||||||
int x;
|
|
||||||
for(x=0; x<argc; x++)
|
|
||||||
argv[x] = PyString_AsString(PyList_GetItem(sysargv, x));
|
|
||||||
argv[argc] = NULL;
|
|
||||||
|
|
||||||
#if wxUSE_THREADS
|
|
||||||
/* GTK 1.2 up to version 1.2.3 has broken threads */
|
|
||||||
if ((gtk_major_version == 1) &&
|
|
||||||
(gtk_minor_version == 2) &&
|
|
||||||
(gtk_micro_version < 4))
|
|
||||||
{
|
|
||||||
printf( "wxWindows warning: GUI threading disabled due to outdated GTK version\n" );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
g_thread_init(NULL);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
gtk_set_locale();
|
|
||||||
|
|
||||||
#if wxUSE_WCHAR_T
|
|
||||||
if (!wxOKlibc()) wxConvCurrent = &wxConvLocal;
|
|
||||||
#else
|
|
||||||
if (!wxOKlibc()) wxConvCurrent = (wxMBConv*) NULL;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
gdk_threads_enter();
|
|
||||||
gtk_init( &argc, &argv );
|
|
||||||
wxSetDetectableAutoRepeat( TRUE );
|
|
||||||
delete [] argv;
|
|
||||||
|
|
||||||
if (!wxApp::Initialize())
|
|
||||||
{
|
|
||||||
gdk_threads_leave();
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#endif // 0
|
|
||||||
|
|
||||||
|
|
||||||
PyObject* sysargv = PySys_GetObject("argv");
|
PyObject* sysargv = PySys_GetObject("argv");
|
||||||
int argc = PyList_Size(sysargv);
|
int argc = PyList_Size(sysargv);
|
||||||
|
@@ -615,7 +615,7 @@ PyObject *ptrfree(PyObject *_PTRVALUE) {
|
|||||||
|
|
||||||
|
|
||||||
void wxApp_CleanUp() {
|
void wxApp_CleanUp() {
|
||||||
wxApp::CleanUp();
|
__wxCleanup();
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" SWIGEXPORT(void) initwindowsc();
|
extern "C" SWIGEXPORT(void) initwindowsc();
|
||||||
|
Reference in New Issue
Block a user