removed wxApp::Initialized() (replaced with a dummy version in wxApp itself); wxApp in wxGTK now uses wxEvtLoop too

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23965 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2003-09-27 13:47:46 +00:00
parent 080a7b206c
commit dd435a79ed
22 changed files with 6 additions and 188 deletions

View File

@@ -196,17 +196,6 @@ You should normally exit the main loop (and the application) by deleting
the top window. the top window.
\membersection{wxApp::Initialized}\label{wxappinitialized}
\func{bool}{Initialized}{\void}
Returns true if the application has been initialized (i.e. if\rtfsp
\helpref{wxApp::OnInit}{wxapponinit} has returned successfully). This can be useful for error
message routines to determine which method of output is best for the
current state of the program (some windowing systems may not like
dialogs to pop up before the main loop has been entered).
\membersection{wxApp::MainLoop}\label{wxappmainloop} \membersection{wxApp::MainLoop}\label{wxappmainloop}
\func{int}{MainLoop}{\void} \func{int}{MainLoop}{\void}

View File

@@ -380,10 +380,6 @@ public:
// stop the program immediately!) // stop the program immediately!)
virtual void ExitMainLoop(); virtual void ExitMainLoop();
// returns true if the program is initialized, i.e. OnInit() has been
// completed successfully
virtual bool Initialized() = 0;
// returns TRUE if there are unprocessed events in the event queue // returns TRUE if there are unprocessed events in the event queue
virtual bool Pending(); virtual bool Pending();
@@ -491,6 +487,11 @@ public:
// deactivated // deactivated
virtual void SetActive(bool isActive, wxWindow *lastFocus); virtual void SetActive(bool isActive, wxWindow *lastFocus);
// OBSOLETE: don't use, always returns true
//
// returns true if the program is successfully initialized
bool Initialized() { return true; }
protected: protected:
// delete all objects in wxPendingDelete list // delete all objects in wxPendingDelete list

View File

@@ -48,7 +48,6 @@ public:
// Implement wxAppBase pure virtuals // Implement wxAppBase pure virtuals
virtual int MainLoop(); virtual int MainLoop();
virtual void ExitMainLoop(); virtual void ExitMainLoop();
virtual bool Initialized();
virtual bool Pending(); virtual bool Pending();
virtual bool Dispatch(); virtual bool Dispatch();

View File

@@ -41,13 +41,7 @@ public:
virtual bool OnInitGui(); virtual bool OnInitGui();
// override base class (pure) virtuals // override base class (pure) virtuals
virtual int MainLoop();
virtual void ExitMainLoop();
virtual bool Initialized(); virtual bool Initialized();
virtual bool Pending();
virtual bool Dispatch();
virtual void Exit();
virtual bool Yield(bool onlyIfNeeded = FALSE); virtual bool Yield(bool onlyIfNeeded = FALSE);
virtual void WakeUpIdle(); virtual void WakeUpIdle();
@@ -63,8 +57,6 @@ public:
bool IsInAssert() const { return m_isInAssert; } bool IsInAssert() const { return m_isInAssert; }
#endif // __WXDEBUG__ #endif // __WXDEBUG__
bool m_initialized;
gint m_idleTag; gint m_idleTag;
#if wxUSE_THREADS #if wxUSE_THREADS
gint m_wakeUpTimerTag; gint m_wakeUpTimerTag;

View File

@@ -41,13 +41,7 @@ public:
virtual bool OnInitGui(); virtual bool OnInitGui();
// override base class (pure) virtuals // override base class (pure) virtuals
virtual int MainLoop();
virtual void ExitMainLoop();
virtual bool Initialized(); virtual bool Initialized();
virtual bool Pending();
virtual bool Dispatch();
virtual void Exit();
virtual bool Yield(bool onlyIfNeeded = FALSE); virtual bool Yield(bool onlyIfNeeded = FALSE);
virtual void WakeUpIdle(); virtual void WakeUpIdle();
@@ -63,8 +57,6 @@ public:
bool IsInAssert() const { return m_isInAssert; } bool IsInAssert() const { return m_isInAssert; }
#endif // __WXDEBUG__ #endif // __WXDEBUG__
bool m_initialized;
gint m_idleTag; gint m_idleTag;
#if wxUSE_THREADS #if wxUSE_THREADS
gint m_wakeUpTimerTag; gint m_wakeUpTimerTag;

View File

@@ -49,7 +49,6 @@ class WXDLLEXPORT wxApp: public wxAppBase
virtual int MainLoop(); virtual int MainLoop();
virtual void ExitMainLoop(); virtual void ExitMainLoop();
virtual bool Initialized();
virtual bool Pending() ; virtual bool Pending() ;
virtual bool Dispatch() ; virtual bool Dispatch() ;

View File

@@ -42,8 +42,6 @@ public:
virtual bool OnInitGui(); virtual bool OnInitGui();
// override base class (pure) virtuals // override base class (pure) virtuals
virtual bool Initialized();
virtual bool Initialize(int& argc, wxChar **argv); virtual bool Initialize(int& argc, wxChar **argv);
virtual void CleanUp(); virtual void CleanUp();

View File

@@ -51,8 +51,6 @@ public:
// ----------------------------------- // -----------------------------------
virtual int MainLoop(); virtual int MainLoop();
virtual void ExitMainLoop();
virtual bool Initialized();
virtual void Exit(); virtual void Exit();

View File

@@ -39,8 +39,6 @@ public:
virtual bool Initialize(int& argc, wxChar **argv); virtual bool Initialize(int& argc, wxChar **argv);
virtual void CleanUp(); virtual void CleanUp();
virtual bool Initialized();
virtual bool Yield(bool onlyIfNeeded = FALSE); virtual bool Yield(bool onlyIfNeeded = FALSE);
virtual void WakeUpIdle(); virtual void WakeUpIdle();

View File

@@ -72,7 +72,6 @@ public:
virtual bool Initialize(int& argc, wxChar **argv); virtual bool Initialize(int& argc, wxChar **argv);
virtual void CleanUp(void); virtual void CleanUp(void);
virtual bool Initialized(void);
virtual bool OnInitGui(void); virtual bool OnInitGui(void);
virtual bool Yield(bool onlyIfNeeded = FALSE); virtual bool Yield(bool onlyIfNeeded = FALSE);

View File

@@ -49,8 +49,6 @@ public:
// override base class (pure) virtuals // override base class (pure) virtuals
// ----------------------------------- // -----------------------------------
virtual bool Initialized();
virtual void Exit(); virtual void Exit();
virtual bool Yield(bool onlyIfNeeded = FALSE); virtual bool Yield(bool onlyIfNeeded = FALSE);

View File

@@ -230,14 +230,6 @@ bool wxApp::OnInit()
return TRUE; return TRUE;
} }
bool wxApp::Initialized()
{
if (GetTopWindow())
return TRUE;
else
return FALSE;
}
void wxApp::Exit() void wxApp::Exit()
{ {
wxApp::CleanUp(); wxApp::CleanUp();

View File

@@ -270,7 +270,7 @@ void wxAppBase::ExitMainLoop()
#if wxUSE_EVTLOOP_IN_APP #if wxUSE_EVTLOOP_IN_APP
// we should exit from the main event loop, not just any currently active // we should exit from the main event loop, not just any currently active
// (e.g. modal dialog) event loop // (e.g. modal dialog) event loop
if ( m_mainLoop ) if ( m_mainLoop && m_mainLoop->IsRunning() )
{ {
m_mainLoop->Exit(0); m_mainLoop->Exit(0);
} }

View File

@@ -399,7 +399,6 @@ END_EVENT_TABLE()
wxApp::wxApp() wxApp::wxApp()
{ {
m_initialized = FALSE;
#ifdef __WXDEBUG__ #ifdef __WXDEBUG__
m_isInAssert = FALSE; m_isInAssert = FALSE;
#endif // __WXDEBUG__ #endif // __WXDEBUG__
@@ -538,42 +537,6 @@ GdkVisual *wxApp::GetGdkVisual()
return visual; return visual;
} }
int wxApp::MainLoop()
{
gtk_main();
return 0;
}
void wxApp::Exit()
{
// VZ: no idea why is it different from ExitMainLoop() but this is what
// wxExit() used to do
gtk_main_quit();
}
void wxApp::ExitMainLoop()
{
if (gtk_main_level() > 0)
gtk_main_quit();
}
bool wxApp::Initialized()
{
return m_initialized;
}
bool wxApp::Pending()
{
return (gtk_events_pending() > 0);
}
bool wxApp::Dispatch()
{
gtk_main_iteration();
return true;
}
bool wxApp::Initialize(int& argc, wxChar **argv) bool wxApp::Initialize(int& argc, wxChar **argv)
{ {
#if wxUSE_THREADS #if wxUSE_THREADS

View File

@@ -399,7 +399,6 @@ END_EVENT_TABLE()
wxApp::wxApp() wxApp::wxApp()
{ {
m_initialized = FALSE;
#ifdef __WXDEBUG__ #ifdef __WXDEBUG__
m_isInAssert = FALSE; m_isInAssert = FALSE;
#endif // __WXDEBUG__ #endif // __WXDEBUG__
@@ -538,42 +537,6 @@ GdkVisual *wxApp::GetGdkVisual()
return visual; return visual;
} }
int wxApp::MainLoop()
{
gtk_main();
return 0;
}
void wxApp::Exit()
{
// VZ: no idea why is it different from ExitMainLoop() but this is what
// wxExit() used to do
gtk_main_quit();
}
void wxApp::ExitMainLoop()
{
if (gtk_main_level() > 0)
gtk_main_quit();
}
bool wxApp::Initialized()
{
return m_initialized;
}
bool wxApp::Pending()
{
return (gtk_events_pending() > 0);
}
bool wxApp::Dispatch()
{
gtk_main_iteration();
return true;
}
bool wxApp::Initialize(int& argc, wxChar **argv) bool wxApp::Initialize(int& argc, wxChar **argv)
{ {
#if wxUSE_THREADS #if wxUSE_THREADS

View File

@@ -1010,14 +1010,6 @@ wxApp::wxApp()
#endif #endif
} }
bool wxApp::Initialized()
{
if (GetTopWindow())
return TRUE;
else
return FALSE;
}
int wxApp::MainLoop() int wxApp::MainLoop()
{ {
m_keepGoing = TRUE; m_keepGoing = TRUE;

View File

@@ -1010,14 +1010,6 @@ wxApp::wxApp()
#endif #endif
} }
bool wxApp::Initialized()
{
if (GetTopWindow())
return TRUE;
else
return FALSE;
}
int wxApp::MainLoop() int wxApp::MainLoop()
{ {
m_keepGoing = TRUE; m_keepGoing = TRUE;

View File

@@ -272,11 +272,6 @@ bool wxApp::OnInitGui()
return TRUE; return TRUE;
} }
bool wxApp::Initialized()
{
return wxTopLevelWindows.GetCount() != 0;
}
bool wxApp::Initialize(int& argc, wxChar **argv) bool wxApp::Initialize(int& argc, wxChar **argv)
{ {
#ifdef __DJGPP__ #ifdef __DJGPP__

View File

@@ -144,14 +144,6 @@ wxApp::~wxApp()
wxApp::SetInstance(NULL); wxApp::SetInstance(NULL);
} }
bool wxApp::Initialized()
{
if (GetTopWindow())
return TRUE;
else
return FALSE;
}
int wxApp::MainLoop() int wxApp::MainLoop()
{ {
/* /*
@@ -170,12 +162,6 @@ int wxApp::MainLoop()
return 0; return 0;
} }
void wxApp::ExitMainLoop()
{
if( m_eventLoop->IsRunning() )
m_eventLoop->Exit();
}
// This should be redefined in a derived class for // This should be redefined in a derived class for
// handling property change events for XAtom IPC. // handling property change events for XAtom IPC.
void wxApp::HandlePropertyChange(WXEvent *event) void wxApp::HandlePropertyChange(WXEvent *event)

View File

@@ -549,18 +549,6 @@ wxApp::~wxApp()
delete [] argv; delete [] argv;
} }
bool wxApp::Initialized()
{
#ifndef _WINDLL
if (GetTopWindow())
return TRUE;
else
return FALSE;
#else // Assume initialized if DLL (no way of telling)
return TRUE;
#endif
}
void wxApp::OnIdle(wxIdleEvent& event) void wxApp::OnIdle(wxIdleEvent& event)
{ {
wxAppBase::OnIdle(event); wxAppBase::OnIdle(event);

View File

@@ -497,14 +497,6 @@ wxApp::~wxApp()
#endif #endif
} // end of wxApp::~wxApp } // end of wxApp::~wxApp
bool wxApp::Initialized()
{
if (GetTopWindow())
return TRUE;
else
return FALSE;
} // end of wxApp::Initialized
bool gbInOnIdle = FALSE; bool gbInOnIdle = FALSE;
void wxApp::OnIdle( void wxApp::OnIdle(

View File

@@ -243,14 +243,6 @@ wxApp::~wxApp()
#endif #endif
} }
bool wxApp::Initialized()
{
if (GetTopWindow())
return TRUE;
else
return FALSE;
}
#if !wxUSE_NANOX #if !wxUSE_NANOX
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
// X11 predicate function for exposure compression // X11 predicate function for exposure compression