X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7422ea95b84a05aab7744010b320317707a7d934..0e4a6d339ad982453af57a590c3bf08f70dbd165:/src/osx/carbon/app.cpp diff --git a/src/osx/carbon/app.cpp b/src/osx/carbon/app.cpp index f33ac195cc..c8e358c185 100644 --- a/src/osx/carbon/app.cpp +++ b/src/osx/carbon/app.cpp @@ -4,7 +4,6 @@ // Author: Stefan Csomor // Modified by: // Created: 1998-01-01 -// RCS-ID: $Id$ // Copyright: (c) Stefan Csomor // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -401,6 +400,40 @@ void wxApp::MacReopenApp() } } +#if wxOSX_USE_COCOA_OR_IPHONE +void wxApp::OSXOnWillFinishLaunching() +{ + wxTheApp->OnInit(); +} + +void wxApp::OSXOnDidFinishLaunching() +{ + wxTheApp->OnLaunched(); + wxEventLoopBase::SetActive(GetMainLoop()); +} + +void wxApp::OSXOnWillTerminate() +{ + wxCloseEvent event; + event.SetCanVeto(false); + wxTheApp->OnEndSession(event); + + wxGUIEventLoop* mainloop = dynamic_cast(GetMainLoop()); + if ( mainloop ) + mainloop->OSXOnWillTerminate(); + wxEventLoopBase::SetActive(NULL); + + wxTheApp->OnExit(); +} + +bool wxApp::OSXOnShouldTerminate() +{ + wxCloseEvent event; + wxTheApp->OnQueryEndSession(event); + return !event.GetVeto(); +} +#endif + //---------------------------------------------------------------------- // Macintosh CommandID support - converting between native and wx IDs //----------------------------------------------------------------------