// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma implementation "app.h"
#endif
// MGL initialization
//-----------------------------------------------------------------------------
-static bool wxCreateMGL_WM(const wxDisplayModeInfo& displayMode)
+static bool wxCreateMGL_WM(const wxVideoMode& displayMode)
{
int mode;
int refresh = MGL_DEFAULT_REFRESH;
IMPLEMENT_DYNAMIC_CLASS(wxApp,wxEvtHandler)
BEGIN_EVENT_TABLE(wxApp, wxEvtHandler)
- EVT_IDLE(wxApp::OnIdle)
+ EVT_IDLE(wxAppBase::OnIdle)
END_EVENT_TABLE()
-wxApp::wxApp() : m_mainLoop(NULL)
+wxApp::wxApp()
{
}
{
}
-wxDisplayModeInfo wxGetDefaultDisplayMode()
+wxVideoMode wxGetDefaultDisplayMode()
{
wxString mode;
unsigned w, h, bpp;
w = 640, h = 480, bpp = 16;
}
- return wxDisplayModeInfo(w, h, bpp);
+ return wxVideoMode(w, h, bpp);
}
-bool wxApp::SetDisplayMode(const wxDisplayModeInfo& mode)
+bool wxApp::SetDisplayMode(const wxVideoMode& mode)
{
if ( !mode.IsOk() )
{
return TRUE;
}
-void wxApp::OnIdle(wxIdleEvent &event)
-{
- static bool s_inOnIdle = FALSE;
-
- /* Avoid recursion (via ProcessEvent default case) */
- if (s_inOnIdle)
- return;
-
- s_inOnIdle = TRUE;
-
- /* Resend in the main thread events which have been prepared in other
- threads */
- ProcessPendingEvents();
-
- // 'Garbage' collection of windows deleted with Close().
- DeletePendingObjects();
-
-#if wxUSE_LOG
- // flush the logged messages if any
- wxLog::FlushActive();
-#endif // wxUSE_LOG
-
- // Send OnIdle events to all windows
- if ( SendIdleEvents() )
- event.RequestMore(TRUE);
-
- s_inOnIdle = FALSE;
-}
-
-int wxApp::MainLoop()
-{
- int rt;
- m_mainLoop = new wxEventLoop;
-
- rt = m_mainLoop->Run();
-
- delete m_mainLoop;
- m_mainLoop = NULL;
- return rt;
-}
-
-void wxApp::ExitMainLoop()
-{
- if ( m_mainLoop )
- m_mainLoop->Exit(0);
-}
-
-bool wxApp::Initialized()
-{
- return (wxTopLevelWindows.GetCount() != 0);
-}
-
-bool wxApp::Pending()
-{
- return wxEventLoop::GetActive()->Pending();
-}
-
-void wxApp::Dispatch()
-{
- wxEventLoop::GetActive()->Dispatch();
-}
-
bool wxApp::Initialize(int& argc, wxChar **argv)
{
#ifdef __DJGPP__