X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e4db172a3b318df9aff178eb6c5da149d56e0859..5278469615164a60b22435aae4734e106aba540d:/src/os2/app.cpp?ds=sidebyside diff --git a/src/os2/app.cpp b/src/os2/app.cpp index 7cf9125bc2..002cf73d77 100644 --- a/src/os2/app.cpp +++ b/src/os2/app.cpp @@ -4,7 +4,6 @@ // Author: David Webster // Modified by: // Created: 10/13/99 -// RCS-ID: $Id$ // Copyright: (c) David Webster // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -28,14 +27,14 @@ #include "wx/dialog.h" #include "wx/msgdlg.h" #include "wx/intl.h" - #include "wx/wxchar.h" - #include "wx/icon.h" - #include "wx/stdpaths.h" - #include "wx/filename.h" + #include "wx/crt.h" #include "wx/log.h" + #include "wx/module.h" #endif -#include "wx/module.h" +#include "wx/stdpaths.h" +#include "wx/filename.h" +#include "wx/evtloop.h" #include "wx/os2/private.h" @@ -82,8 +81,7 @@ extern "C" int _System bsdselect(int, // global variables // --------------------------------------------------------------------------- -extern wxChar* wxBuffer; -extern wxList WXDLLEXPORT wxPendingDelete; +WXDLLEXPORT_DATA(wxChar*) wxBuffer; extern wxCursor* g_globalCursor; HAB vHabmain = NULLHANDLE; @@ -236,9 +234,7 @@ bool wxApp::Initialize(int& argc, wxChar **argv) // Some people may wish to use this, but // probably it shouldn't be here by default. -#ifdef __WXDEBUG__ // wxRedirectIOToConsole(); -#endif wxWinHandleHash = new wxWinHashTable(wxKEY_INTEGER, 100); @@ -389,8 +385,7 @@ bool wxApp::RegisterWindowClasses( HAB vHab ) // void wxApp::CleanUp() { - delete[] wxBuffer; - wxBuffer = NULL; + wxDELETEA(wxBuffer); // // PM-SPECIFIC CLEANUP @@ -417,8 +412,7 @@ void wxApp::CleanUp() // TODO: ::DeleteObject( wxDisableButtonBrush ); } - delete wxWinHandleHash; - wxWinHandleHash = NULL; + wxDELETE(wxWinHandleHash); // Delete Message queue if (wxTheApp->m_hMq) @@ -449,8 +443,6 @@ bool wxApp::OnInitGui() wxApp::wxApp() { - argc = 0; - argv = NULL; m_nPrintMode = wxPRINT_WINDOWS; m_hMq = 0; m_maxSocketHandles = 0; @@ -460,23 +452,11 @@ wxApp::wxApp() wxApp::~wxApp() { - // - // Delete command-line args - // -#if wxUSE_UNICODE - int i; - - for (i = 0; i < argc; i++) - { - delete[] argv[i]; - } - delete[] argv; -#endif } // end of wxApp::~wxApp bool gbInOnIdle = false; -void wxApp::OnIdle( wxIdleEvent& rEvent ) +void wxApp::OnIdle( wxIdleEvent& WXUNUSED(rEvent) ) { // // Avoid recursion (via ProcessEvent default case) @@ -486,8 +466,6 @@ void wxApp::OnIdle( wxIdleEvent& rEvent ) gbInOnIdle = true; - wxAppBase::OnIdle(rEvent); - #if wxUSE_DC_CACHEING // automated DC cache management: clear the cached DCs and bitmap // if it's likely that the app has finished with them, that is, we @@ -521,61 +499,6 @@ void wxApp::OnQueryEndSession( wxCloseEvent& rEvent ) } } // end of wxApp::OnQueryEndSession -// -// Yield to incoming messages -// -bool wxApp::Yield(bool onlyIfNeeded) -{ - static bool s_inYield = false; - - if ( s_inYield ) - { - if ( !onlyIfNeeded ) - { - wxFAIL_MSG( _T("wxYield() called recursively") ); - } - - return false; - } - - HAB vHab = 0; - QMSG vMsg; - - // - // Disable log flushing from here because a call to wxYield() shouldn't - // normally result in message boxes popping up &c - // - wxLog::Suspend(); - - s_inYield = true; - - // - // We want to go back to the main message loop - // if we see a WM_QUIT. (?) - // - while (::WinPeekMsg(vHab, &vMsg, (HWND)NULL, 0, 0, PM_NOREMOVE) && vMsg.msg != WM_QUIT) - { -#if wxUSE_THREADS - wxMutexGuiLeaveOrEnter(); -#endif // wxUSE_THREADS - if (!wxTheApp->Dispatch()) - break; - } - // - // If they are pending events, we must process them. - // - if (wxTheApp) - wxTheApp->ProcessPendingEvents(); - - HandleSockets(); - // - // Let the logs be flashed again - // - wxLog::Resume(); - s_inYield = false; - return true; -} // end of wxYield - int wxApp::AddSocketHandler(int handle, int mask, void (*callback)(void*), void * gsock) {