X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2439f1d96880ed2fd1551b85795ccee1704dc29c..8a1459665d29fb62f9a89571bd6e0a2d27b05cf0:/src/osx/iphone/evtloop.mm?ds=sidebyside diff --git a/src/osx/iphone/evtloop.mm b/src/osx/iphone/evtloop.mm index 38a786578f..2a78c68178 100644 --- a/src/osx/iphone/evtloop.mm +++ b/src/osx/iphone/evtloop.mm @@ -79,28 +79,6 @@ 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() { } @@ -119,12 +97,41 @@ void wxGUIEventLoop::DoRun() } } -wxModalEventLoop::wxModalEventLoop(wxWindow *winModal) +int wxGUIEventLoop::DoDispatchTimeout(unsigned long timeout) +{ + return wxCFEventLoop::DoDispatchTimeout(timeout); +} + +void wxGUIEventLoop::DoStop() { - m_modalWindow = dynamic_cast (winModal); + return wxCFEventLoop::DoStop(); +} + +CFRunLoopRef wxGUIEventLoop::CFGetCurrentRunLoop() const +{ + return wxCFEventLoop::CFGetCurrentRunLoop(); +} + + +// 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(); +} + +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::DoRun() { // presentModalViewController:animated: