X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6670f56440ae9209b3e2e51e06acf3bc5aaf1905..fab0d366b115c474f38f517e0575253189d7cd5d:/src/os2/app.cpp diff --git a/src/os2/app.cpp b/src/os2/app.cpp index 7ea40472f2..65b080d5e9 100644 --- a/src/os2/app.cpp +++ b/src/os2/app.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: app.cpp +// Name: src/os2/app.cpp // Purpose: wxApp // Author: David Webster // Modified by: @@ -9,16 +9,14 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ - #pragma implementation "app.h" -#endif - // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" +#include "wx/app.h" + #ifndef WX_PRECOMP + #include "wx/dynarray.h" #include "wx/frame.h" - #include "wx/app.h" #include "wx/utils.h" #include "wx/gdicmn.h" #include "wx/pen.h" @@ -30,15 +28,13 @@ #include "wx/dialog.h" #include "wx/msgdlg.h" #include "wx/intl.h" - #include "wx/dynarray.h" #include "wx/wxchar.h" - #include "wx/icon.h" - #include "wx/stdpaths.h" - #include "wx/filename.h" + #include "wx/log.h" + #include "wx/module.h" #endif -#include "wx/log.h" -#include "wx/module.h" +#include "wx/stdpaths.h" +#include "wx/filename.h" #include "wx/os2/private.h" @@ -85,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; @@ -126,7 +121,7 @@ struct GsocketCallbackInfo{ void wxApp::HandleSockets() { - bool pendingEvent = FALSE; + bool pendingEvent = false; // Check whether it's time for Gsocket operation if (m_maxSocketHandles > 0 && m_maxSocketNr > 0) @@ -155,7 +150,7 @@ void wxApp::HandleSockets() if (r < m_maxSocketHandles) { CallbackInfo[r].proc(CallbackInfo[r].gsock); - pendingEvent = TRUE; + pendingEvent = true; } } if (FD_ISSET(i, &writefds)) @@ -168,7 +163,7 @@ void wxApp::HandleSockets() if (r < m_maxSocketHandles) { CallbackInfo[r].proc(CallbackInfo[r].gsock); - pendingEvent = TRUE; + pendingEvent = true; } } } @@ -232,7 +227,7 @@ bool wxApp::Initialize(int& argc, wxChar **argv) // TODO: at least give some error message here... wxAppBase::CleanUp(); - return FALSE; + return false; } wxBuffer = new wxChar[1500]; // FIXME; why? @@ -256,7 +251,7 @@ bool wxApp::Initialize(int& argc, wxChar **argv) RegisterWindowClasses(vHabmain); - return TRUE; + return true; } // end of wxApp::Initialize const char* CANTREGISTERCLASS = " Can't register Class "; @@ -264,12 +259,10 @@ const char* CANTREGISTERCLASS = " Can't register Class " // RegisterWindowClasses // --------------------------------------------------------------------------- -bool wxApp::RegisterWindowClasses( - HAB vHab -) +bool wxApp::RegisterWindowClasses( HAB vHab ) { - ERRORID vError = 0L; - wxString sError; + ERRORID vError = 0L; + wxString sError; if (!::WinRegisterClass( vHab ,(PSZ)wxFrameClassName @@ -281,7 +274,7 @@ bool wxApp::RegisterWindowClasses( vError = ::WinGetLastError(vHab); sError = wxPMErrorToStr(vError); wxLogLastError(sError.c_str()); - return FALSE; + return false; } if (!::WinRegisterClass( vHab @@ -294,7 +287,7 @@ bool wxApp::RegisterWindowClasses( vError = ::WinGetLastError(vHab); sError = wxPMErrorToStr(vError); wxLogLastError(sError.c_str()); - return FALSE; + return false; } if (!::WinRegisterClass( vHab @@ -307,7 +300,7 @@ bool wxApp::RegisterWindowClasses( vError = ::WinGetLastError(vHab); sError = wxPMErrorToStr(vError); wxLogLastError(sError.c_str()); - return FALSE; + return false; } if (!::WinRegisterClass( vHab @@ -320,7 +313,7 @@ bool wxApp::RegisterWindowClasses( vError = ::WinGetLastError(vHab); sError = wxPMErrorToStr(vError); wxLogLastError(sError.c_str()); - return FALSE; + return false; } if (!::WinRegisterClass( vHab @@ -333,7 +326,7 @@ bool wxApp::RegisterWindowClasses( vError = ::WinGetLastError(vHab); sError = wxPMErrorToStr(vError); wxLogLastError(sError.c_str()); - return FALSE; + return false; } if (!::WinRegisterClass( vHab @@ -346,7 +339,7 @@ bool wxApp::RegisterWindowClasses( vError = ::WinGetLastError(vHab); sError = wxPMErrorToStr(vError); wxLogLastError(sError.c_str()); - return FALSE; + return false; } if (!::WinRegisterClass( vHab @@ -359,7 +352,7 @@ bool wxApp::RegisterWindowClasses( vError = ::WinGetLastError(vHab); sError = wxPMErrorToStr(vError); wxLogLastError(sError.c_str()); - return FALSE; + return false; } if (!::WinRegisterClass( vHab @@ -372,7 +365,7 @@ bool wxApp::RegisterWindowClasses( vError = ::WinGetLastError(vHab); sError = wxPMErrorToStr(vError); wxLogLastError(sError.c_str()); - return FALSE; + return false; } if (!::WinRegisterClass( vHab ,(PSZ)wxCanvasClassNameNR @@ -384,9 +377,9 @@ bool wxApp::RegisterWindowClasses( vError = ::WinGetLastError(vHab); sError = wxPMErrorToStr(vError); wxLogLastError(sError.c_str()); - return FALSE; + return false; } - return TRUE; + return true; } // end of wxApp::RegisterWindowClasses // @@ -401,7 +394,7 @@ void wxApp::CleanUp() // PM-SPECIFIC CLEANUP // - // wxSetKeyboardHook(FALSE); + // wxSetKeyboardHook(false); if (wxSTD_FRAME_ICON) ::WinFreeFileIcon(wxSTD_FRAME_ICON); @@ -434,11 +427,11 @@ void wxApp::CleanUp() bool wxApp::OnInitGui() { - ERRORID vError; - wxString sError; + ERRORID vError; + wxString sError; if (!wxAppBase::OnInitGui()) - return FALSE; + return false; m_hMq = ::WinCreateMsgQueue(vHabmain, 0); if (!m_hMq) @@ -446,10 +439,10 @@ bool wxApp::OnInitGui() vError = ::WinGetLastError(vHabmain); sError = wxPMErrorToStr(vError); wxLogDebug(sError); - return FALSE; + return false; } - return TRUE; + return true; } // end of wxApp::OnInitGui wxApp::wxApp() @@ -479,13 +472,10 @@ wxApp::~wxApp() #endif } // end of wxApp::~wxApp -bool gbInOnIdle = FALSE; +bool gbInOnIdle = false; -void wxApp::OnIdle( - wxIdleEvent& rEvent -) +void wxApp::OnIdle( wxIdleEvent& rEvent ) { - // // Avoid recursion (via ProcessEvent default case) // @@ -506,28 +496,26 @@ void wxApp::OnIdle( wxDC::ClearCache(); #endif // wxUSE_DC_CACHEING - gbInOnIdle = FALSE; + gbInOnIdle = false; } // end of wxApp::OnIdle void wxApp::OnEndSession( wxCloseEvent& WXUNUSED(rEvent)) { if (GetTopWindow()) - GetTopWindow()->Close(TRUE); + GetTopWindow()->Close(true); } // end of wxApp::OnEndSession // // Default behaviour: close the application with prompts. The // user can veto the close, and therefore the end session. // -void wxApp::OnQueryEndSession( - wxCloseEvent& rEvent -) +void wxApp::OnQueryEndSession( wxCloseEvent& rEvent ) { if (GetTopWindow()) { if (!GetTopWindow()->Close(!rEvent.CanVeto())) - rEvent.Veto(TRUE); + rEvent.Veto(true); } } // end of wxApp::OnQueryEndSession @@ -536,7 +524,7 @@ void wxApp::OnQueryEndSession( // bool wxApp::Yield(bool onlyIfNeeded) { - static bool s_inYield = FALSE; + static bool s_inYield = false; if ( s_inYield ) { @@ -545,11 +533,11 @@ bool wxApp::Yield(bool onlyIfNeeded) wxFAIL_MSG( _T("wxYield() called recursively") ); } - return FALSE; + return false; } - HAB vHab = 0; - QMSG vMsg; + HAB vHab = 0; + QMSG vMsg; // // Disable log flushing from here because a call to wxYield() shouldn't @@ -557,7 +545,7 @@ bool wxApp::Yield(bool onlyIfNeeded) // wxLog::Suspend(); - s_inYield = TRUE; + s_inYield = true; // // We want to go back to the main message loop @@ -582,8 +570,8 @@ bool wxApp::Yield(bool onlyIfNeeded) // Let the logs be flashed again // wxLog::Resume(); - s_inYield = FALSE; - return TRUE; + s_inYield = false; + return true; } // end of wxYield int wxApp::AddSocketHandler(int handle, int mask,