X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2439f1d96880ed2fd1551b85795ccee1704dc29c..9e9574fe45b176ee74bba8fad7574cf9906145d1:/src/osx/iphone/evtloop.mm?ds=sidebyside diff --git a/src/osx/iphone/evtloop.mm b/src/osx/iphone/evtloop.mm index 38a786578f..f928274e41 100644 --- a/src/osx/iphone/evtloop.mm +++ b/src/osx/iphone/evtloop.mm @@ -4,7 +4,6 @@ // Author: Vadim Zeitlin, Stefan Csomor // Modified by: // Created: 2006-01-12 -// RCS-ID: $Id: evtloop.cpp 54845 2008-07-30 14:52:41Z SC $ // Copyright: (c) 2006 Vadim Zeitlin // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// @@ -79,33 +78,11 @@ static int CalculateUIEventMaskFromEventCategory(wxEventCategory cat) } */ -@interface wxAppDelegate : NSObject { -} - -@end - -@implementation wxAppDelegate - -- (void)applicationDidFinishLaunching:(UIApplication *)application { - wxTheApp->OnInit(); -} - -- (void)applicationWillTerminate:(UIApplication *)application { - wxCloseEvent event; - wxTheApp->OnEndSession(event); -} - -- (void)dealloc { - [super dealloc]; -} - -@end - wxGUIEventLoop::wxGUIEventLoop() { } -void wxGUIEventLoop::DoRun() +void wxGUIEventLoop::OSXDoRun() { if ( IsMain() ) { @@ -115,22 +92,55 @@ void wxGUIEventLoop::DoRun() } else { - wxCFEventLoop::DoRun(); + wxCFEventLoop::OSXDoRun(); } } -wxModalEventLoop::wxModalEventLoop(wxWindow *winModal) +int wxGUIEventLoop::DoDispatchTimeout(unsigned long timeout) { - m_modalWindow = dynamic_cast (winModal); + return wxCFEventLoop::DoDispatchTimeout(timeout); +} + +void wxGUIEventLoop::OSXDoStop() +{ + return wxCFEventLoop::OSXDoStop(); +} + +CFRunLoopRef wxGUIEventLoop::CFGetCurrentRunLoop() const +{ + return wxCFEventLoop::CFGetCurrentRunLoop(); +} + +void wxGUIEventLoop::WakeUp() +{ + return wxCFEventLoop::WakeUp(); +} + +// TODO move into a evtloop_osx.cpp + +wxModalEventLoop::wxModalEventLoop(wxWindow *modalWindow) +{ + m_modalWindow = dynamic_cast (modalWindow); wxASSERT_MSG( m_modalWindow != NULL, "must pass in a toplevel window for modal event loop" ); + m_modalNativeWindow = m_modalWindow->GetWXWindow(); } -void wxModalEventLoop::DoRun() +wxModalEventLoop::wxModalEventLoop(WXWindow modalNativeWindow) +{ + m_modalWindow = NULL; + wxASSERT_MSG( modalNativeWindow != NULL, "must pass in a toplevel window for modal event loop" ); + m_modalNativeWindow = modalNativeWindow; +} + +// END move into a evtloop_osx.cpp + + +void wxModalEventLoop::OSXDoRun() { // presentModalViewController:animated: } -void wxModalEventLoop::DoStop() +void wxModalEventLoop::OSXDoStop() { // (void)dismissModalViewControllerAnimated:(BOOL)animated }