]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/app.cpp
fixed compile error
[wxWidgets.git] / src / mac / carbon / app.cpp
index 5e2dd1cae98637f049abf8018835465070b976fa..2b2c0b892cb770f06a6bf8b9fd3ab88f35c1b2bb 100644 (file)
@@ -165,7 +165,6 @@ short wxApp::MacHandleAEODoc(const WXEVENTREF event, WXEVENTREF WXUNUSED(reply))
     DescType returnedType;
     Size actualSize;
     long itemsInList;
-    FSSpec theSpec;
     OSErr err;
     short i;
     err = AEGetParamDesc((AppleEvent *)event, keyDirectObject, typeAEList,&docList);
@@ -181,10 +180,15 @@ short wxApp::MacHandleAEODoc(const WXEVENTREF event, WXEVENTREF WXUNUSED(reply))
     PSN.lowLongOfPSN = kCurrentProcess ;
     SetFrontProcess( &PSN ) ;
 
-    for (i = 1; i <= itemsInList; i++) {
-        AEGetNthPtr(&docList, i, typeFSS, &keywd, &returnedType,
-        (Ptr) & theSpec, sizeof(theSpec), &actualSize);
-        wxString fName = wxMacFSSpec2MacFilename(&theSpec);
+    for (i = 1; i <= itemsInList; i++) 
+    {
+        wxString fName ;
+
+        FSRef theRef ;
+        AEGetNthPtr(&docList, i, typeFSRef, &keywd, &returnedType,
+        (Ptr) & theRef, sizeof(theRef), &actualSize);
+        fName = wxMacFSRefToPath( &theRef ) ;
+
         MacOpenFile(fName);
     }
     return noErr;
@@ -199,7 +203,6 @@ short wxApp::MacHandleAEPDoc(const WXEVENTREF event , WXEVENTREF WXUNUSED(reply)
     DescType returnedType;
     Size actualSize;
     long itemsInList;
-    FSSpec theSpec;
     OSErr err;
     short i;
     err = AEGetParamDesc((AppleEvent *)event, keyDirectObject, typeAEList,&docList);
@@ -216,9 +219,13 @@ short wxApp::MacHandleAEPDoc(const WXEVENTREF event , WXEVENTREF WXUNUSED(reply)
     SetFrontProcess( &PSN ) ;
 
     for (i = 1; i <= itemsInList; i++) {
-        AEGetNthPtr(&docList, i, typeFSS, &keywd, &returnedType,
-        (Ptr) & theSpec, sizeof(theSpec), &actualSize);
-        wxString fName = wxMacFSSpec2MacFilename(&theSpec);
+        wxString fName ;
+
+        FSRef theRef ;
+        AEGetNthPtr(&docList, i, typeFSRef, &keywd, &returnedType,
+        (Ptr) & theRef, sizeof(theRef), &actualSize);
+        fName = wxMacFSRefToPath( &theRef ) ;
+
         MacPrintFile(fName);
     }
     return noErr;
@@ -513,7 +520,17 @@ pascal OSStatus wxMacAppEventHandler( EventHandlerCallRef handler , EventRef eve
             result = wxMacAppMenuEventHandler( handler , event , data ) ;
             break ;
         case kEventClassMouse :
-            result = wxMacTopLevelMouseEventHandler( handler , event , NULL ) ;
+            {
+                wxMacCarbonEvent cEvent( event ) ;
+                
+                WindowRef window ;
+                Point screenMouseLocation = cEvent.GetParameter<Point>(kEventParamMouseLocation) ;
+                short windowPart = ::FindWindow(screenMouseLocation, &window);
+                // only send this event in case it had not already been sent to a tlw, as we get
+                // double events otherwise (in case event.skip) was called
+                if ( window == NULL )
+                    result = wxMacTopLevelMouseEventHandler( handler , event , NULL ) ;
+            }
             break ;
         case kEventClassAppleEvent :
             {
@@ -585,12 +602,6 @@ bool wxApp::Initialize(int& argc, wxChar **argv)
     SetEventMask( everyEvent ) ;
     UMAShowWatchCursor() ;
 
-#if defined(WXMAKINGDLL_CORE) && defined(__DARWIN__)
-    // open shared library resources from here since we don't have
-    //   __wxinitialize in Mach-O shared libraries
-    wxStAppResource::OpenSharedLibraryResource(NULL);
-#endif
-
 #ifndef __DARWIN__
 #  if __option(profile)
     ProfilerInit( collectDetailed, bestTimeBase , 40000 , 50 ) ;
@@ -704,12 +715,6 @@ void wxApp::CleanUp()
 #  endif
 #endif
 
-#if defined(WXMAKINGDLL_CORE) && defined(__DARWIN__)
-    // close shared library resources from here since we don't have
-    //   __wxterminate in Mach-O shared libraries
-    wxStAppResource::CloseSharedLibraryResource();
-#endif
-
     UMACleanupToolbox() ;
     if (s_macCursorRgn) {
         ::DisposeRgn((RgnHandle)s_macCursorRgn);