]> git.saurik.com Git - wxWidgets.git/blobdiff - src/os2/app.cpp
new dependency tracking from bakefile cvs
[wxWidgets.git] / src / os2 / app.cpp
index f48fa2d453b4f459ba7543495927d80dee385483..5db7a6bcfcbebf9d842d2f9ad9e7b96a08537adb 100644 (file)
@@ -9,6 +9,10 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
+#ifdef __GNUG__
+    #pragma implementation "app.h"
+#endif
+
 // For compilers that support precompilation, includes "wx.h".
 #include "wx/wxprec.h"
 
@@ -72,10 +76,6 @@ extern "C" int _System bsdselect(int,
     WX_DEFINE_OBJARRAY(wxMsgArray);
 #endif // wxUSE_THREADS
 
-#if wxUSE_WX_RESOURCES
-    #include "wx/resource.h"
-#endif
-
 #if wxUSE_TOOLTIPS
     #include "wx/tooltip.h"
 #endif // wxUSE_TOOLTIPS
@@ -94,7 +94,6 @@ extern wxCursor*                    g_globalCursor;
 
 HAB                                 vHabmain = NULLHANDLE;
 QMSG                                svCurrentMsg;
-wxApp*                              wxTheApp = NULL;
 
 
 HICON wxSTD_FRAME_ICON          = (HICON) NULL;
@@ -267,10 +266,6 @@ bool wxApp::Initialize(
     wxInitializeStockLists();
     wxInitializeStockObjects();
 
-#if wxUSE_WX_RESOURCES
-    wxInitializeResourceSystem();
-#endif
-
     wxBitmap::InitStandardHandlers();
 
     //
@@ -422,6 +417,18 @@ bool wxApp::RegisterWindowClasses(
         wxLogLastError(sError);
         return FALSE;
     }
+    if (!::WinRegisterClass( vHab
+                            ,wxCanvasClassNameNR
+                            ,wxWndProc
+                            ,CS_HITTEST | CS_SYNCPAINT
+                            ,sizeof(ULONG)
+                           ))
+    {
+        vError = ::WinGetLastError(vHab);
+        sError = wxPMErrorToStr(vError);
+        wxLogLastError(sError);
+        return FALSE;
+    }
     return TRUE;
 } // end of wxApp::RegisterWindowClasses
 
@@ -457,10 +464,6 @@ void wxApp::CleanUp()
 
     wxModule::CleanUpModules();
 
-#if wxUSE_WX_RESOURCES
-    wxCleanUpResourceSystem();
-#endif
-
     wxDeleteStockObjects();
 
     //
@@ -597,7 +600,7 @@ int wxEntry(
     {
         if (wxTheApp->OnInit())
         {
-            nRetValue = wxTheApp->OnRun();
+            wxTheApp->OnRun();
         }
         // Normal exit
         wxWindow*                   pTopWindow = wxTheApp->GetTopWindow();
@@ -625,7 +628,7 @@ int wxEntry(
     printf("wxTheApp->OnExit ");
     fflush(stdout);
 #endif
-    wxTheApp->OnExit();
+    nRetValue = wxTheApp->OnExit();
 #if wxUSE_CONSOLEDEBUG
     printf("wxApp::CleanUp ");
     fflush(stdout);
@@ -658,11 +661,6 @@ bool wxApp::OnInitGui()
     return TRUE;
 } // end of wxApp::OnInitGui
 
-//
-// Static member initialization
-//
-wxAppInitializerFunction wxAppBase::m_appInitFn = (wxAppInitializerFunction) NULL;
-
 wxApp::wxApp()
 {
     m_topWindow = NULL;
@@ -671,7 +669,6 @@ wxApp::wxApp()
     argc = 0;
     argv = NULL;
     m_nPrintMode = wxPRINT_WINDOWS;
-    m_exitOnFrameDelete = TRUE;
     m_bAuto3D = TRUE;
     m_hMq = 0;
     m_maxSocketHandles = 0;
@@ -769,10 +766,7 @@ bool wxApp::DoMessage()
                 {
                     QMSG            vMsg = svSavedMessages[n];
 
-                    if ( !ProcessMessage((WXMSG *)&vMsg) )
-                    {
-                        ::WinDispatchMsg(vHabmain, &vMsg);
-                    }
+                    DoMessage((WXMSG*)&vMsg);
                 }
                 svSavedMessages.Empty();
             }
@@ -850,13 +844,13 @@ bool wxApp::ProcessIdle()
 
 void wxApp::ExitMainLoop()
 {
-    m_bKeepGoing = FALSE;
-}
+    ::WinPostMsg(NULL, WM_QUIT, 0, 0);
+} // end of wxApp::ExitMainLoop
 
 bool wxApp::Pending()
 {
     return (::WinPeekMsg(vHabmain, (PQMSG)&svCurrentMsg, (HWND)NULL, 0, 0, PM_NOREMOVE) != 0);
-}
+} // end of wxApp::Pending
 
 void wxApp::Dispatch()
 {
@@ -879,21 +873,6 @@ bool wxApp::ProcessMessage(
     wxWindow*                       pWndThis = wxFindWinFromHandle((WXHWND)hWnd);
     wxWindow*                       pWnd;
 
-#if wxUSE_TOOLTIPS
-    //
-    // We must relay WM_MOUSEMOVE events to the tooltip ctrl if we want it to
-    // popup the tooltip bubbles
-    //
-    if (pWndThis && (pMsg->msg == WM_MOUSEMOVE))
-    {
-        wxToolTip*                  pToolTip = pWndThis->GetToolTip();
-        if (pToolTip)
-        {
-            pToolTip->RelayEvent(pWxmsg);
-        }
-    }
-#endif // wxUSE_TOOLTIPS
-
     //
     // Pass non-system timer messages to the wxTimerProc
     //
@@ -968,19 +947,20 @@ bool wxApp::ProcessMessage(
     return FALSE;
 } // end of wxApp::ProcessMessage
 
+bool                                gbInOnIdle = FALSE;
+
 void wxApp::OnIdle(
   wxIdleEvent&                      rEvent
 )
 {
-    static bool                     sbInOnIdle = FALSE;
 
     //
     // Avoid recursion (via ProcessEvent default case)
     //
-    if (sbInOnIdle)
+    if (gbInOnIdle)
         return;
 
-    sbInOnIdle = TRUE;
+    gbInOnIdle = TRUE;
 
     //
     // If there are pending events, we must process them: pending events
@@ -1022,7 +1002,7 @@ void wxApp::OnIdle(
         //
         rEvent.RequestMore(TRUE);
     }
-    sbInOnIdle = FALSE;
+    gbInOnIdle = FALSE;
 } // end of wxApp::OnIdle
 
 // Send idle event to all top-level windows
@@ -1114,11 +1094,12 @@ void wxApp::OnQueryEndSession(
     }
 } // end of wxApp::OnQueryEndSession
 
-void wxExit()
+void wxApp::Exit()
 {
-    wxLogError(_("Fatal error: exiting"));
-
     wxApp::CleanUp();
+
+    // VZ: must really exit somehow, insert appropriate OS/2 syscall (FIXME)
+    wxAppConsole::Exit();
 } // end of wxExit
 
 //
@@ -1227,7 +1208,7 @@ void wxApp::RemoveSocketHandler(int handle)
 // wxWakeUpIdle
 //-----------------------------------------------------------------------------
 
-void wxWakeUpIdle()
+void wxApp::WakeUpIdle()
 {
     //
     // Send the top window a dummy message so idle handler processing will