]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/app.cpp
Applied patch [ 1312729 ] fix for wxMac Carbon spin control on EVT_TEXT emitter
[wxWidgets.git] / src / mac / carbon / app.cpp
index 6c327441c279adfbeac37e499a53c4d4f45a9de1..49c9ce465520218315d99232543c396451eb5209 100644 (file)
 
 extern wxList wxPendingDelete;
 
-// set wxMAC_USE_RAEL to 1 if RunApplicationEventLoop should be used
-// if 0 the lower level CarbonEventLoop will be used
-// on the long run RAEL should replace the low level event loop
-// we will have to clean up event handling to make sure we don't
-// miss handling of things like pending events etc
-// perhaps we will also have to pipe events through an ueber-event-handler
-// to make sure we have one place to do all these house-keeping functions
-
-#define wxMAC_USE_RAEL 0
-
 #if wxUSE_THREADS
 extern size_t g_numberOfThreads;
 #endif
@@ -1108,50 +1098,6 @@ wxApp::wxApp()
 #endif
 }
 
-int wxApp::MainLoop()
-{
-    m_keepGoing = true;
-
-#if wxMAC_USE_RAEL
-    RunApplicationEventLoop() ;
-#else
-    while (m_keepGoing)
-    {
-        MacDoOneEvent() ;
-    }
-#endif
-
-    return 0;
-}
-
-void wxApp::ExitMainLoop()
-{
-    m_keepGoing = false;
-
-#if wxMAC_USE_RAEL
-    QuitApplicationEventLoop() ;
-#endif
-}
-
-// Is a message/event pending?
-bool wxApp::Pending()
-{
-    // without the receive event (with pull param = false ) nothing is ever reported
-    EventRef theEvent;
-
-    ReceiveNextEvent(0, NULL, kEventDurationNoWait, false, &theEvent);
-
-    return GetNumEventsInQueue( GetMainEventQueue() ) > 0 ;
-}
-
-// Dispatch a message.
-bool wxApp::Dispatch()
-{
-    MacDoOneEvent() ;
-
-    return true;
-}
-
 void wxApp::OnIdle(wxIdleEvent& event)
 {
     wxAppBase::OnIdle(event);
@@ -1177,12 +1123,6 @@ void wxApp::WakeUpIdle()
     wxMacWakeUp() ;
 }
 
-void wxApp::Exit()
-{
-    wxApp::CleanUp();
-    ::ExitToShell() ;
-}
-
 void wxApp::OnEndSession(wxCloseEvent& WXUNUSED(event))
 {
     if (GetTopWindow())
@@ -1267,14 +1207,14 @@ void wxApp::MacDoOneEvent()
 
     switch (status)
     {
-       case eventLoopTimedOutErr :
+        case eventLoopTimedOutErr :
             if ( wxTheApp->ProcessIdle() )
                 sleepTime = kEventDurationNoWait ;
             else
                 sleepTime = kEventDurationSecond;
             break;
 
-       case eventLoopQuitErr :
+        case eventLoopQuitErr :
             // according to QA1061 this may also occur
             // when a WakeUp Process is executed
             break;
@@ -1499,6 +1439,29 @@ bool wxGetKeyState(wxKeyCode key) //virtual key code if < 10.2.x, else see below
 #endif
 
 
+wxMouseState wxGetMouseState()
+{
+    wxMouseState ms;
+
+    wxPoint pt = wxGetMousePosition();
+    ms.SetX(pt.x);
+    ms.SetY(pt.y);
+
+    UInt32 buttons = GetCurrentButtonState();
+    ms.SetLeftDown( (buttons & 0x01) != 0 );
+    ms.SetMiddleDown( (buttons & 0x04) != 0 );
+    ms.SetRightDown( (buttons & 0x02) != 0 );
+    
+    UInt32 modifiers = GetCurrentKeyModifiers();
+    ms.SetControlDown(modifiers & controlKey);
+    ms.SetShiftDown(modifiers & shiftKey);
+    ms.SetAltDown(modifiers & optionKey);
+    ms.SetMetaDown(modifiers & cmdKey);
+
+    return ms;
+}
+
+
 bool wxApp::MacSendKeyDownEvent( wxWindow* focus , long keymessage , long modifiers , long when , short wherex , short wherey , wxChar uniChar )
 {
     if ( !focus )