Compile fix

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16535 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2002-08-16 02:27:12 +00:00
parent 42cfcc58ee
commit 84c1ffa9cc
2 changed files with 74 additions and 74 deletions

View File

@@ -399,7 +399,7 @@ bool wxApp::Initialize()
// __wxinitialize in Mach-O shared libraries // __wxinitialize in Mach-O shared libraries
wxStAppResource::OpenSharedLibraryResource(NULL); wxStAppResource::OpenSharedLibraryResource(NULL);
#endif #endif
#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340) #if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
AEInstallEventHandler( kCoreEventClass , kAEOpenDocuments , AEInstallEventHandler( kCoreEventClass , kAEOpenDocuments ,
NewAEEventHandlerUPP(AEHandleODoc) , NewAEEventHandlerUPP(AEHandleODoc) ,
@@ -496,7 +496,7 @@ bool wxApp::Initialize()
s_macCursorRgn = ::NewRgn() ; s_macCursorRgn = ::NewRgn() ;
wxBuffer = new char[BUFSIZ + 512]; wxBuffer = new char[BUFSIZ + 512];
wxClassInfo::InitializeClasses(); wxClassInfo::InitializeClasses();
#if wxUSE_RESOURCES #if wxUSE_RESOURCES
@@ -506,7 +506,7 @@ bool wxApp::Initialize()
#if wxUSE_THREADS #if wxUSE_THREADS
wxPendingEventsLocker = new wxCriticalSection; wxPendingEventsLocker = new wxCriticalSection;
#endif #endif
wxTheColourDatabase = new wxColourDatabase(wxKEY_STRING); wxTheColourDatabase = new wxColourDatabase(wxKEY_STRING);
wxTheColourDatabase->Initialize(); wxTheColourDatabase->Initialize();
@@ -592,7 +592,7 @@ void wxApp::CleanUp()
delete wxWinMacControlList ; delete wxWinMacControlList ;
} }
delete wxPendingEvents; delete wxPendingEvents;
#if wxUSE_THREADS #if wxUSE_THREADS
delete wxPendingEventsLocker; delete wxPendingEventsLocker;
// If we don't do the following, we get an apparent memory leak. // If we don't do the following, we get an apparent memory leak.
@@ -635,12 +635,12 @@ void wxApp::CleanUp()
// __wxterminate in Mach-O shared libraries // __wxterminate in Mach-O shared libraries
wxStAppResource::CloseSharedLibraryResource(); wxStAppResource::CloseSharedLibraryResource();
#endif #endif
UMACleanupToolbox() ; UMACleanupToolbox() ;
if (s_macCursorRgn) { if (s_macCursorRgn) {
::DisposeRgn((RgnHandle)s_macCursorRgn); ::DisposeRgn((RgnHandle)s_macCursorRgn);
} }
#if 0 #if 0
TerminateAE() ; TerminateAE() ;
#endif #endif
@@ -683,14 +683,14 @@ void wxStAppResource::OpenSharedLibraryResource(const void *initBlock)
if ( initBlock != NULL ) { if ( initBlock != NULL ) {
const CFragInitBlock *theInitBlock = (const CFragInitBlock *)initBlock; const CFragInitBlock *theInitBlock = (const CFragInitBlock *)initBlock;
FSSpec *fileSpec = NULL; FSSpec *fileSpec = NULL;
if (theInitBlock->fragLocator.where == kDataForkCFragLocator) { if (theInitBlock->fragLocator.where == kDataForkCFragLocator) {
fileSpec = theInitBlock->fragLocator.u.onDisk.fileSpec; fileSpec = theInitBlock->fragLocator.u.onDisk.fileSpec;
} }
else if (theInitBlock->fragLocator.where == kResourceCFragLocator) { else if (theInitBlock->fragLocator.where == kResourceCFragLocator) {
fileSpec = theInitBlock->fragLocator.u.inSegs.fileSpec; fileSpec = theInitBlock->fragLocator.u.inSegs.fileSpec;
} }
if (fileSpec != NULL) { if (fileSpec != NULL) {
gSharedLibraryResource = FSpOpenResFile(fileSpec, fsRdPerm); gSharedLibraryResource = FSpOpenResFile(fileSpec, fsRdPerm);
} }
@@ -701,12 +701,12 @@ void wxStAppResource::OpenSharedLibraryResource(const void *initBlock)
NSSymbol theSymbol; NSSymbol theSymbol;
NSModule theModule; NSModule theModule;
const char *theLibPath; const char *theLibPath;
gSharedLibraryBundle = CFBundleGetBundleWithIdentifier(CFSTR("com.wxwindows.wxWindows")); gSharedLibraryBundle = CFBundleGetBundleWithIdentifier(CFSTR("com.wxwindows.wxWindows"));
if (gSharedLibraryBundle != NULL) { if (gSharedLibraryBundle != NULL) {
// wxWindows has been bundled into a framework // wxWindows has been bundled into a framework
// load the framework resources // load the framework resources
gSharedLibraryResource = CFBundleOpenBundleResourceMap(gSharedLibraryBundle); gSharedLibraryResource = CFBundleOpenBundleResourceMap(gSharedLibraryBundle);
} }
else { else {
@@ -717,7 +717,7 @@ void wxStAppResource::OpenSharedLibraryResource(const void *initBlock)
char *theExt; char *theExt;
FSRef theResRef; FSRef theResRef;
OSErr theErr = noErr; OSErr theErr = noErr;
// get the library path // get the library path
theSymbol = NSLookupAndBindSymbol("_gSharedLibraryResource"); theSymbol = NSLookupAndBindSymbol("_gSharedLibraryResource");
theModule = NSModuleForSymbol(theSymbol); theModule = NSModuleForSymbol(theSymbol);
@@ -735,7 +735,7 @@ void wxStAppResource::OpenSharedLibraryResource(const void *initBlock)
theExt = strstr(theName, ".dylib"); theExt = strstr(theName, ".dylib");
// overwrite extension with ".rsrc" // overwrite extension with ".rsrc"
strcpy(theExt, ".rsrc"); strcpy(theExt, ".rsrc");
wxLogDebug( theResPath ); wxLogDebug( theResPath );
theErr = FSPathMakeRef((UInt8 *) theResPath, &theResRef, false); theErr = FSPathMakeRef((UInt8 *) theResPath, &theResRef, false);
@@ -743,7 +743,7 @@ void wxStAppResource::OpenSharedLibraryResource(const void *initBlock)
// try in current directory (using name only) // try in current directory (using name only)
theErr = FSPathMakeRef((UInt8 *) theName, &theResRef, false); theErr = FSPathMakeRef((UInt8 *) theName, &theResRef, false);
} }
// free duplicated resource file path // free duplicated resource file path
free(theResPath); free(theResPath);
@@ -776,7 +776,7 @@ void wxStAppResource::CloseSharedLibraryResource()
CloseResFile(gSharedLibraryResource); CloseResFile(gSharedLibraryResource);
} }
gSharedLibraryResource = kResFileNotOpened; gSharedLibraryResource = kResFileNotOpened;
} }
#endif /* WXMAKINGDLL */ #endif /* WXMAKINGDLL */
} }
@@ -860,12 +860,12 @@ int wxEntry( int argc, char *argv[] , bool enterLoop )
if (argc > 1) { if (argc > 1) {
char theArg[6] = ""; char theArg[6] = "";
strncpy(theArg, argv[1], 5); strncpy(theArg, argv[1], 5);
if (strcmp(theArg, "-psn_") == 0) { if (strcmp(theArg, "-psn_") == 0) {
// assume the argument is always the only one and remove it // assume the argument is always the only one and remove it
--argc; --argc;
} }
} }
#else #else
argc = 0 ; // currently we don't support files as parameters argc = 0 ; // currently we don't support files as parameters
#endif #endif
@@ -932,7 +932,7 @@ bool wxMacConvertEventToRecord( EventRef event , EventRecord *rec)
case kEventClassKeyboard : case kEventClassKeyboard :
{ {
converted = true ; converted = true ;
switch( GetEventKind(event) ) switch( GetEventKind(event) )
{ {
case kEventRawKeyDown : case kEventRawKeyDown :
rec->what = keyDown ; rec->what = keyDown ;
@@ -995,14 +995,14 @@ bool wxMacConvertEventToRecord( EventRef event , EventRecord *rec)
break ; break ;
} }
} }
return converted ; return converted ;
} }
pascal OSStatus wxMacApplicationEventHandler( EventHandlerCallRef handler , EventRef event , void *data ) pascal OSStatus wxMacApplicationEventHandler( EventHandlerCallRef handler , EventRef event , void *data )
{ {
OSStatus result = eventNotHandledErr ; OSStatus result = eventNotHandledErr ;
EventRecord rec ; EventRecord rec ;
switch ( GetEventClass( event ) ) switch ( GetEventClass( event ) )
{ {
@@ -1034,20 +1034,20 @@ bool wxApp::OnInit()
{ {
if ( ! wxAppBase::OnInit() ) if ( ! wxAppBase::OnInit() )
return FALSE ; return FALSE ;
#if 0 // TARGET_CARBON #if 0 // TARGET_CARBON
static const EventTypeSpec eventList[] = static const EventTypeSpec eventList[] =
{ {
{ kEventClassKeyboard, kEventRawKeyDown } , { kEventClassKeyboard, kEventRawKeyDown } ,
{ kEventClassKeyboard, kEventRawKeyRepeat } , { kEventClassKeyboard, kEventRawKeyRepeat } ,
{ kEventClassKeyboard, kEventRawKeyUp } , { kEventClassKeyboard, kEventRawKeyUp } ,
{ kEventClassKeyboard, kEventRawKeyModifiersChanged } , { kEventClassKeyboard, kEventRawKeyModifiersChanged } ,
{ kEventClassTextInput , kEventTextInputUnicodeForKeyEvent } , { kEventClassTextInput , kEventTextInputUnicodeForKeyEvent } ,
} ; } ;
InstallApplicationEventHandler(NewEventHandlerUPP(wxMacApplicationEventHandler) InstallApplicationEventHandler(NewEventHandlerUPP(wxMacApplicationEventHandler)
, WXSIZEOF(eventList), eventList, this, NULL); , WXSIZEOF(eventList), eventList, this, NULL);
#endif #endif
return TRUE ; return TRUE ;
} }
@@ -1067,7 +1067,7 @@ wxApp::wxApp()
argv = NULL; argv = NULL;
m_printMode = wxPRINT_WINDOWS; m_printMode = wxPRINT_WINDOWS;
m_exitOnFrameDelete = TRUE; SetExitOnFrameDelete(TRUE);
m_auto3D = TRUE; m_auto3D = TRUE;
} }
@@ -1302,13 +1302,13 @@ void wxApp::MacSuspend( bool convertClipboard )
node = node->Next(); node = node->Next();
} }
s_lastMouseDown = 0 ; s_lastMouseDown = 0 ;
if( convertClipboard ) if( convertClipboard )
{ {
MacConvertPrivateToPublicScrap() ; MacConvertPrivateToPublicScrap() ;
} }
::HideFloatingWindows() ; ::HideFloatingWindows() ;
} }
@@ -1321,9 +1321,9 @@ void wxApp::MacResume( bool convertClipboard )
{ {
MacConvertPublicToPrivateScrap() ; MacConvertPublicToPrivateScrap() ;
} }
::ShowFloatingWindows() ; ::ShowFloatingWindows() ;
// raise modal dialogs in case a non modal window was selected to activate the app // raise modal dialogs in case a non modal window was selected to activate the app
wxNode* node = wxModalDialogs.First(); wxNode* node = wxModalDialogs.First();
@@ -1331,7 +1331,7 @@ void wxApp::MacResume( bool convertClipboard )
{ {
wxDialog* dialog = (wxDialog *) node->Data(); wxDialog* dialog = (wxDialog *) node->Data();
dialog->Raise(); dialog->Raise();
node = node->Next(); node = node->Next();
} }
} }
@@ -1402,23 +1402,23 @@ void wxApp::MacHandleModifierEvents( WXEVENTREF evr )
event.m_timeStamp = ev->when; event.m_timeStamp = ev->when;
wxWindow* focus = wxWindow::FindFocus() ; wxWindow* focus = wxWindow::FindFocus() ;
event.SetEventObject(focus); event.SetEventObject(focus);
if ( (ev->modifiers ^ s_lastModifiers ) & controlKey ) if ( (ev->modifiers ^ s_lastModifiers ) & controlKey )
{ {
event.m_keyCode = WXK_CONTROL ; event.m_keyCode = WXK_CONTROL ;
event.SetEventType( ( ev->modifiers & controlKey ) ? wxEVT_KEY_DOWN : wxEVT_KEY_UP ) ; event.SetEventType( ( ev->modifiers & controlKey ) ? wxEVT_KEY_DOWN : wxEVT_KEY_UP ) ;
focus->GetEventHandler()->ProcessEvent( event ) ; focus->GetEventHandler()->ProcessEvent( event ) ;
} }
if ( (ev->modifiers ^ s_lastModifiers ) & shiftKey ) if ( (ev->modifiers ^ s_lastModifiers ) & shiftKey )
{ {
event.m_keyCode = WXK_SHIFT ; event.m_keyCode = WXK_SHIFT ;
event.SetEventType( ( ev->modifiers & shiftKey ) ? wxEVT_KEY_DOWN : wxEVT_KEY_UP ) ; event.SetEventType( ( ev->modifiers & shiftKey ) ? wxEVT_KEY_DOWN : wxEVT_KEY_UP ) ;
focus->GetEventHandler()->ProcessEvent( event ) ; focus->GetEventHandler()->ProcessEvent( event ) ;
} }
if ( (ev->modifiers ^ s_lastModifiers ) & optionKey ) if ( (ev->modifiers ^ s_lastModifiers ) & optionKey )
{ {
event.m_keyCode = WXK_ALT ; event.m_keyCode = WXK_ALT ;
event.SetEventType( ( ev->modifiers & optionKey ) ? wxEVT_KEY_DOWN : wxEVT_KEY_UP ) ; event.SetEventType( ( ev->modifiers & optionKey ) ? wxEVT_KEY_DOWN : wxEVT_KEY_UP ) ;
focus->GetEventHandler()->ProcessEvent( event ) ; focus->GetEventHandler()->ProcessEvent( event ) ;
} }
s_lastModifiers = ev->modifiers ; s_lastModifiers = ev->modifiers ;
@@ -1656,7 +1656,7 @@ void wxApp::MacHandleMouseUpEvent( WXEVENTREF evr )
{ {
window = (WindowRef) s_captureWindow->MacGetRootWindow() ; window = (WindowRef) s_captureWindow->MacGetRootWindow() ;
windowPart = inContent ; windowPart = inContent ;
} }
else else
{ {
windowPart = ::FindWindow(ev->where, &window) ; windowPart = ::FindWindow(ev->where, &window) ;
@@ -2119,14 +2119,14 @@ void wxApp::MacHandleOSEvent( WXEVENTREF evr )
event.m_y = ev->where.v; event.m_y = ev->where.v;
event.m_timeStamp = ev->when; event.m_timeStamp = ev->when;
event.SetEventObject(this); event.SetEventObject(this);
if ( wxWindow::s_lastMouseWindow ) if ( wxWindow::s_lastMouseWindow )
{ {
wxMouseEvent eventleave(event); wxMouseEvent eventleave(event);
eventleave.SetEventType( wxEVT_LEAVE_WINDOW ); eventleave.SetEventType( wxEVT_LEAVE_WINDOW );
wxWindow::s_lastMouseWindow->ScreenToClient( &eventleave.m_x, &eventleave.m_y ); wxWindow::s_lastMouseWindow->ScreenToClient( &eventleave.m_x, &eventleave.m_y );
eventleave.SetEventObject( wxWindow::s_lastMouseWindow ) ; eventleave.SetEventObject( wxWindow::s_lastMouseWindow ) ;
wxWindow::s_lastMouseWindow->GetEventHandler()->ProcessEvent(eventleave); wxWindow::s_lastMouseWindow->GetEventHandler()->ProcessEvent(eventleave);
} }
if ( currentMouseWindow ) if ( currentMouseWindow )

View File

@@ -399,7 +399,7 @@ bool wxApp::Initialize()
// __wxinitialize in Mach-O shared libraries // __wxinitialize in Mach-O shared libraries
wxStAppResource::OpenSharedLibraryResource(NULL); wxStAppResource::OpenSharedLibraryResource(NULL);
#endif #endif
#if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340) #if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
AEInstallEventHandler( kCoreEventClass , kAEOpenDocuments , AEInstallEventHandler( kCoreEventClass , kAEOpenDocuments ,
NewAEEventHandlerUPP(AEHandleODoc) , NewAEEventHandlerUPP(AEHandleODoc) ,
@@ -496,7 +496,7 @@ bool wxApp::Initialize()
s_macCursorRgn = ::NewRgn() ; s_macCursorRgn = ::NewRgn() ;
wxBuffer = new char[BUFSIZ + 512]; wxBuffer = new char[BUFSIZ + 512];
wxClassInfo::InitializeClasses(); wxClassInfo::InitializeClasses();
#if wxUSE_RESOURCES #if wxUSE_RESOURCES
@@ -506,7 +506,7 @@ bool wxApp::Initialize()
#if wxUSE_THREADS #if wxUSE_THREADS
wxPendingEventsLocker = new wxCriticalSection; wxPendingEventsLocker = new wxCriticalSection;
#endif #endif
wxTheColourDatabase = new wxColourDatabase(wxKEY_STRING); wxTheColourDatabase = new wxColourDatabase(wxKEY_STRING);
wxTheColourDatabase->Initialize(); wxTheColourDatabase->Initialize();
@@ -592,7 +592,7 @@ void wxApp::CleanUp()
delete wxWinMacControlList ; delete wxWinMacControlList ;
} }
delete wxPendingEvents; delete wxPendingEvents;
#if wxUSE_THREADS #if wxUSE_THREADS
delete wxPendingEventsLocker; delete wxPendingEventsLocker;
// If we don't do the following, we get an apparent memory leak. // If we don't do the following, we get an apparent memory leak.
@@ -635,12 +635,12 @@ void wxApp::CleanUp()
// __wxterminate in Mach-O shared libraries // __wxterminate in Mach-O shared libraries
wxStAppResource::CloseSharedLibraryResource(); wxStAppResource::CloseSharedLibraryResource();
#endif #endif
UMACleanupToolbox() ; UMACleanupToolbox() ;
if (s_macCursorRgn) { if (s_macCursorRgn) {
::DisposeRgn((RgnHandle)s_macCursorRgn); ::DisposeRgn((RgnHandle)s_macCursorRgn);
} }
#if 0 #if 0
TerminateAE() ; TerminateAE() ;
#endif #endif
@@ -683,14 +683,14 @@ void wxStAppResource::OpenSharedLibraryResource(const void *initBlock)
if ( initBlock != NULL ) { if ( initBlock != NULL ) {
const CFragInitBlock *theInitBlock = (const CFragInitBlock *)initBlock; const CFragInitBlock *theInitBlock = (const CFragInitBlock *)initBlock;
FSSpec *fileSpec = NULL; FSSpec *fileSpec = NULL;
if (theInitBlock->fragLocator.where == kDataForkCFragLocator) { if (theInitBlock->fragLocator.where == kDataForkCFragLocator) {
fileSpec = theInitBlock->fragLocator.u.onDisk.fileSpec; fileSpec = theInitBlock->fragLocator.u.onDisk.fileSpec;
} }
else if (theInitBlock->fragLocator.where == kResourceCFragLocator) { else if (theInitBlock->fragLocator.where == kResourceCFragLocator) {
fileSpec = theInitBlock->fragLocator.u.inSegs.fileSpec; fileSpec = theInitBlock->fragLocator.u.inSegs.fileSpec;
} }
if (fileSpec != NULL) { if (fileSpec != NULL) {
gSharedLibraryResource = FSpOpenResFile(fileSpec, fsRdPerm); gSharedLibraryResource = FSpOpenResFile(fileSpec, fsRdPerm);
} }
@@ -701,12 +701,12 @@ void wxStAppResource::OpenSharedLibraryResource(const void *initBlock)
NSSymbol theSymbol; NSSymbol theSymbol;
NSModule theModule; NSModule theModule;
const char *theLibPath; const char *theLibPath;
gSharedLibraryBundle = CFBundleGetBundleWithIdentifier(CFSTR("com.wxwindows.wxWindows")); gSharedLibraryBundle = CFBundleGetBundleWithIdentifier(CFSTR("com.wxwindows.wxWindows"));
if (gSharedLibraryBundle != NULL) { if (gSharedLibraryBundle != NULL) {
// wxWindows has been bundled into a framework // wxWindows has been bundled into a framework
// load the framework resources // load the framework resources
gSharedLibraryResource = CFBundleOpenBundleResourceMap(gSharedLibraryBundle); gSharedLibraryResource = CFBundleOpenBundleResourceMap(gSharedLibraryBundle);
} }
else { else {
@@ -717,7 +717,7 @@ void wxStAppResource::OpenSharedLibraryResource(const void *initBlock)
char *theExt; char *theExt;
FSRef theResRef; FSRef theResRef;
OSErr theErr = noErr; OSErr theErr = noErr;
// get the library path // get the library path
theSymbol = NSLookupAndBindSymbol("_gSharedLibraryResource"); theSymbol = NSLookupAndBindSymbol("_gSharedLibraryResource");
theModule = NSModuleForSymbol(theSymbol); theModule = NSModuleForSymbol(theSymbol);
@@ -735,7 +735,7 @@ void wxStAppResource::OpenSharedLibraryResource(const void *initBlock)
theExt = strstr(theName, ".dylib"); theExt = strstr(theName, ".dylib");
// overwrite extension with ".rsrc" // overwrite extension with ".rsrc"
strcpy(theExt, ".rsrc"); strcpy(theExt, ".rsrc");
wxLogDebug( theResPath ); wxLogDebug( theResPath );
theErr = FSPathMakeRef((UInt8 *) theResPath, &theResRef, false); theErr = FSPathMakeRef((UInt8 *) theResPath, &theResRef, false);
@@ -743,7 +743,7 @@ void wxStAppResource::OpenSharedLibraryResource(const void *initBlock)
// try in current directory (using name only) // try in current directory (using name only)
theErr = FSPathMakeRef((UInt8 *) theName, &theResRef, false); theErr = FSPathMakeRef((UInt8 *) theName, &theResRef, false);
} }
// free duplicated resource file path // free duplicated resource file path
free(theResPath); free(theResPath);
@@ -776,7 +776,7 @@ void wxStAppResource::CloseSharedLibraryResource()
CloseResFile(gSharedLibraryResource); CloseResFile(gSharedLibraryResource);
} }
gSharedLibraryResource = kResFileNotOpened; gSharedLibraryResource = kResFileNotOpened;
} }
#endif /* WXMAKINGDLL */ #endif /* WXMAKINGDLL */
} }
@@ -860,12 +860,12 @@ int wxEntry( int argc, char *argv[] , bool enterLoop )
if (argc > 1) { if (argc > 1) {
char theArg[6] = ""; char theArg[6] = "";
strncpy(theArg, argv[1], 5); strncpy(theArg, argv[1], 5);
if (strcmp(theArg, "-psn_") == 0) { if (strcmp(theArg, "-psn_") == 0) {
// assume the argument is always the only one and remove it // assume the argument is always the only one and remove it
--argc; --argc;
} }
} }
#else #else
argc = 0 ; // currently we don't support files as parameters argc = 0 ; // currently we don't support files as parameters
#endif #endif
@@ -932,7 +932,7 @@ bool wxMacConvertEventToRecord( EventRef event , EventRecord *rec)
case kEventClassKeyboard : case kEventClassKeyboard :
{ {
converted = true ; converted = true ;
switch( GetEventKind(event) ) switch( GetEventKind(event) )
{ {
case kEventRawKeyDown : case kEventRawKeyDown :
rec->what = keyDown ; rec->what = keyDown ;
@@ -995,14 +995,14 @@ bool wxMacConvertEventToRecord( EventRef event , EventRecord *rec)
break ; break ;
} }
} }
return converted ; return converted ;
} }
pascal OSStatus wxMacApplicationEventHandler( EventHandlerCallRef handler , EventRef event , void *data ) pascal OSStatus wxMacApplicationEventHandler( EventHandlerCallRef handler , EventRef event , void *data )
{ {
OSStatus result = eventNotHandledErr ; OSStatus result = eventNotHandledErr ;
EventRecord rec ; EventRecord rec ;
switch ( GetEventClass( event ) ) switch ( GetEventClass( event ) )
{ {
@@ -1034,20 +1034,20 @@ bool wxApp::OnInit()
{ {
if ( ! wxAppBase::OnInit() ) if ( ! wxAppBase::OnInit() )
return FALSE ; return FALSE ;
#if 0 // TARGET_CARBON #if 0 // TARGET_CARBON
static const EventTypeSpec eventList[] = static const EventTypeSpec eventList[] =
{ {
{ kEventClassKeyboard, kEventRawKeyDown } , { kEventClassKeyboard, kEventRawKeyDown } ,
{ kEventClassKeyboard, kEventRawKeyRepeat } , { kEventClassKeyboard, kEventRawKeyRepeat } ,
{ kEventClassKeyboard, kEventRawKeyUp } , { kEventClassKeyboard, kEventRawKeyUp } ,
{ kEventClassKeyboard, kEventRawKeyModifiersChanged } , { kEventClassKeyboard, kEventRawKeyModifiersChanged } ,
{ kEventClassTextInput , kEventTextInputUnicodeForKeyEvent } , { kEventClassTextInput , kEventTextInputUnicodeForKeyEvent } ,
} ; } ;
InstallApplicationEventHandler(NewEventHandlerUPP(wxMacApplicationEventHandler) InstallApplicationEventHandler(NewEventHandlerUPP(wxMacApplicationEventHandler)
, WXSIZEOF(eventList), eventList, this, NULL); , WXSIZEOF(eventList), eventList, this, NULL);
#endif #endif
return TRUE ; return TRUE ;
} }
@@ -1067,7 +1067,7 @@ wxApp::wxApp()
argv = NULL; argv = NULL;
m_printMode = wxPRINT_WINDOWS; m_printMode = wxPRINT_WINDOWS;
m_exitOnFrameDelete = TRUE; SetExitOnFrameDelete(TRUE);
m_auto3D = TRUE; m_auto3D = TRUE;
} }
@@ -1302,13 +1302,13 @@ void wxApp::MacSuspend( bool convertClipboard )
node = node->Next(); node = node->Next();
} }
s_lastMouseDown = 0 ; s_lastMouseDown = 0 ;
if( convertClipboard ) if( convertClipboard )
{ {
MacConvertPrivateToPublicScrap() ; MacConvertPrivateToPublicScrap() ;
} }
::HideFloatingWindows() ; ::HideFloatingWindows() ;
} }
@@ -1321,9 +1321,9 @@ void wxApp::MacResume( bool convertClipboard )
{ {
MacConvertPublicToPrivateScrap() ; MacConvertPublicToPrivateScrap() ;
} }
::ShowFloatingWindows() ; ::ShowFloatingWindows() ;
// raise modal dialogs in case a non modal window was selected to activate the app // raise modal dialogs in case a non modal window was selected to activate the app
wxNode* node = wxModalDialogs.First(); wxNode* node = wxModalDialogs.First();
@@ -1331,7 +1331,7 @@ void wxApp::MacResume( bool convertClipboard )
{ {
wxDialog* dialog = (wxDialog *) node->Data(); wxDialog* dialog = (wxDialog *) node->Data();
dialog->Raise(); dialog->Raise();
node = node->Next(); node = node->Next();
} }
} }
@@ -1402,23 +1402,23 @@ void wxApp::MacHandleModifierEvents( WXEVENTREF evr )
event.m_timeStamp = ev->when; event.m_timeStamp = ev->when;
wxWindow* focus = wxWindow::FindFocus() ; wxWindow* focus = wxWindow::FindFocus() ;
event.SetEventObject(focus); event.SetEventObject(focus);
if ( (ev->modifiers ^ s_lastModifiers ) & controlKey ) if ( (ev->modifiers ^ s_lastModifiers ) & controlKey )
{ {
event.m_keyCode = WXK_CONTROL ; event.m_keyCode = WXK_CONTROL ;
event.SetEventType( ( ev->modifiers & controlKey ) ? wxEVT_KEY_DOWN : wxEVT_KEY_UP ) ; event.SetEventType( ( ev->modifiers & controlKey ) ? wxEVT_KEY_DOWN : wxEVT_KEY_UP ) ;
focus->GetEventHandler()->ProcessEvent( event ) ; focus->GetEventHandler()->ProcessEvent( event ) ;
} }
if ( (ev->modifiers ^ s_lastModifiers ) & shiftKey ) if ( (ev->modifiers ^ s_lastModifiers ) & shiftKey )
{ {
event.m_keyCode = WXK_SHIFT ; event.m_keyCode = WXK_SHIFT ;
event.SetEventType( ( ev->modifiers & shiftKey ) ? wxEVT_KEY_DOWN : wxEVT_KEY_UP ) ; event.SetEventType( ( ev->modifiers & shiftKey ) ? wxEVT_KEY_DOWN : wxEVT_KEY_UP ) ;
focus->GetEventHandler()->ProcessEvent( event ) ; focus->GetEventHandler()->ProcessEvent( event ) ;
} }
if ( (ev->modifiers ^ s_lastModifiers ) & optionKey ) if ( (ev->modifiers ^ s_lastModifiers ) & optionKey )
{ {
event.m_keyCode = WXK_ALT ; event.m_keyCode = WXK_ALT ;
event.SetEventType( ( ev->modifiers & optionKey ) ? wxEVT_KEY_DOWN : wxEVT_KEY_UP ) ; event.SetEventType( ( ev->modifiers & optionKey ) ? wxEVT_KEY_DOWN : wxEVT_KEY_UP ) ;
focus->GetEventHandler()->ProcessEvent( event ) ; focus->GetEventHandler()->ProcessEvent( event ) ;
} }
s_lastModifiers = ev->modifiers ; s_lastModifiers = ev->modifiers ;
@@ -1656,7 +1656,7 @@ void wxApp::MacHandleMouseUpEvent( WXEVENTREF evr )
{ {
window = (WindowRef) s_captureWindow->MacGetRootWindow() ; window = (WindowRef) s_captureWindow->MacGetRootWindow() ;
windowPart = inContent ; windowPart = inContent ;
} }
else else
{ {
windowPart = ::FindWindow(ev->where, &window) ; windowPart = ::FindWindow(ev->where, &window) ;
@@ -2119,14 +2119,14 @@ void wxApp::MacHandleOSEvent( WXEVENTREF evr )
event.m_y = ev->where.v; event.m_y = ev->where.v;
event.m_timeStamp = ev->when; event.m_timeStamp = ev->when;
event.SetEventObject(this); event.SetEventObject(this);
if ( wxWindow::s_lastMouseWindow ) if ( wxWindow::s_lastMouseWindow )
{ {
wxMouseEvent eventleave(event); wxMouseEvent eventleave(event);
eventleave.SetEventType( wxEVT_LEAVE_WINDOW ); eventleave.SetEventType( wxEVT_LEAVE_WINDOW );
wxWindow::s_lastMouseWindow->ScreenToClient( &eventleave.m_x, &eventleave.m_y ); wxWindow::s_lastMouseWindow->ScreenToClient( &eventleave.m_x, &eventleave.m_y );
eventleave.SetEventObject( wxWindow::s_lastMouseWindow ) ; eventleave.SetEventObject( wxWindow::s_lastMouseWindow ) ;
wxWindow::s_lastMouseWindow->GetEventHandler()->ProcessEvent(eventleave); wxWindow::s_lastMouseWindow->GetEventHandler()->ProcessEvent(eventleave);
} }
if ( currentMouseWindow ) if ( currentMouseWindow )