cleanup of handlers
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34378 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -696,6 +696,12 @@ bool wxApp::Initialize(int& argc, wxChar **argv)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AEEventHandlerUPP sODocHandler = NULL ;
|
||||||
|
AEEventHandlerUPP sOAppHandler = NULL ;
|
||||||
|
AEEventHandlerUPP sPDocHandler = NULL ;
|
||||||
|
AEEventHandlerUPP sRAppHandler = NULL ;
|
||||||
|
AEEventHandlerUPP sQuitHandler = NULL ;
|
||||||
|
|
||||||
bool wxApp::OnInitGui()
|
bool wxApp::OnInitGui()
|
||||||
{
|
{
|
||||||
if( !wxAppBase::OnInitGui() )
|
if( !wxAppBase::OnInitGui() )
|
||||||
@@ -712,21 +718,22 @@ bool wxApp::OnInitGui()
|
|||||||
|
|
||||||
if (!sm_isEmbedded)
|
if (!sm_isEmbedded)
|
||||||
{
|
{
|
||||||
|
sODocHandler = NewAEEventHandlerUPP(AEHandleODoc) ;
|
||||||
|
sOAppHandler = NewAEEventHandlerUPP(AEHandleOApp) ;
|
||||||
|
sPDocHandler = NewAEEventHandlerUPP(AEHandlePDoc) ;
|
||||||
|
sRAppHandler = NewAEEventHandlerUPP(AEHandleRApp) ;
|
||||||
|
sQuitHandler = NewAEEventHandlerUPP(AEHandleQuit) ;
|
||||||
|
|
||||||
AEInstallEventHandler( kCoreEventClass , kAEOpenDocuments ,
|
AEInstallEventHandler( kCoreEventClass , kAEOpenDocuments ,
|
||||||
NewAEEventHandlerUPP(AEHandleODoc) ,
|
sODocHandler , 0 , FALSE ) ;
|
||||||
0 , FALSE ) ;
|
|
||||||
AEInstallEventHandler( kCoreEventClass , kAEOpenApplication ,
|
AEInstallEventHandler( kCoreEventClass , kAEOpenApplication ,
|
||||||
NewAEEventHandlerUPP(AEHandleOApp) ,
|
sOAppHandler , 0 , FALSE ) ;
|
||||||
0 , FALSE ) ;
|
|
||||||
AEInstallEventHandler( kCoreEventClass , kAEPrintDocuments ,
|
AEInstallEventHandler( kCoreEventClass , kAEPrintDocuments ,
|
||||||
NewAEEventHandlerUPP(AEHandlePDoc) ,
|
sPDocHandler , 0 , FALSE ) ;
|
||||||
0 , FALSE ) ;
|
|
||||||
AEInstallEventHandler( kCoreEventClass , kAEReopenApplication ,
|
AEInstallEventHandler( kCoreEventClass , kAEReopenApplication ,
|
||||||
NewAEEventHandlerUPP(AEHandleRApp) ,
|
sRAppHandler , 0 , FALSE ) ;
|
||||||
0 , FALSE ) ;
|
|
||||||
AEInstallEventHandler( kCoreEventClass , kAEQuitApplication ,
|
AEInstallEventHandler( kCoreEventClass , kAEQuitApplication ,
|
||||||
NewAEEventHandlerUPP(AEHandleQuit) ,
|
sQuitHandler , 0 , FALSE ) ;
|
||||||
0 , FALSE ) ;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE ;
|
return TRUE ;
|
||||||
@@ -763,9 +770,30 @@ void wxApp::CleanUp()
|
|||||||
::DisposeRgn((RgnHandle)s_macCursorRgn);
|
::DisposeRgn((RgnHandle)s_macCursorRgn);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
if (!sm_isEmbedded)
|
||||||
TerminateAE() ;
|
{
|
||||||
#endif
|
RemoveEventHandler( (EventHandlerRef)(wxTheApp->m_macEventHandler) );
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!sm_isEmbedded)
|
||||||
|
{
|
||||||
|
AERemoveEventHandler( kCoreEventClass , kAEOpenDocuments ,
|
||||||
|
sODocHandler , FALSE ) ;
|
||||||
|
AERemoveEventHandler( kCoreEventClass , kAEOpenApplication ,
|
||||||
|
sOAppHandler , FALSE ) ;
|
||||||
|
AERemoveEventHandler( kCoreEventClass , kAEPrintDocuments ,
|
||||||
|
sPDocHandler , FALSE ) ;
|
||||||
|
AERemoveEventHandler( kCoreEventClass , kAEReopenApplication ,
|
||||||
|
sRAppHandler , FALSE ) ;
|
||||||
|
AERemoveEventHandler( kCoreEventClass , kAEQuitApplication ,
|
||||||
|
sQuitHandler , FALSE ) ;
|
||||||
|
|
||||||
|
DisposeAEEventHandlerUPP( sODocHandler ) ;
|
||||||
|
DisposeAEEventHandlerUPP( sOAppHandler ) ;
|
||||||
|
DisposeAEEventHandlerUPP( sPDocHandler ) ;
|
||||||
|
DisposeAEEventHandlerUPP( sRAppHandler ) ;
|
||||||
|
DisposeAEEventHandlerUPP( sQuitHandler ) ;
|
||||||
|
}
|
||||||
|
|
||||||
wxAppBase::CleanUp();
|
wxAppBase::CleanUp();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user