X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/bda7c3535efb8499ad7eb97fd11b6e46c63cf206..fe104ff925ac53779d25280112401874089276b0:/src/osx/cocoa/utils.mm?ds=inline diff --git a/src/osx/cocoa/utils.mm b/src/osx/cocoa/utils.mm index b35775be06..cb71db77a3 100644 --- a/src/osx/cocoa/utils.mm +++ b/src/osx/cocoa/utils.mm @@ -4,7 +4,7 @@ // Author: Stefan Csomor // Modified by: // Created: 1998-01-01 -// RCS-ID: $Id: utils.mm 48805 2007-09-19 14:52:25Z SC $ +// RCS-ID: $Id$ // Copyright: (c) Stefan Csomor // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -55,12 +55,18 @@ void wxBell() wxUnusedVar(application); } -- (BOOL)application:(NSApplication *)sender openFile:(NSString *)filename +- (void)application:(NSApplication *)sender openFiles:(NSArray *)fileNames { wxUnusedVar(sender); - wxCFStringRef cf(wxCFRetain(filename)); - wxTheApp->MacOpenFile(cf.AsString()) ; - return YES; + wxArrayString fileList; + size_t i; + const size_t count = [fileNames count]; + for (i = 0; i < count; i++) + { + fileList.Add( wxCFStringRef::AsString([fileNames objectAtIndex:i]) ); + } + + wxTheApp->MacOpenFiles(fileList); } - (BOOL)applicationShouldOpenUntitledFile:(NSApplication *)sender @@ -179,7 +185,7 @@ void wxBell() @implementation ModalDialogDelegate - (id)init { - [super init]; + self = [super init]; sheetFinished = NO; resultCode = -1; impl = 0; @@ -379,7 +385,7 @@ wxBitmap wxWindowDCImpl::DoGetAsBitmap(const wxRect *subrect) const [view lockFocus]; // we use this method as other methods force a repaint, and this method can be // called from OnPaint, even with the window's paint dc as source (see wxHTMLWindow) - NSBitmapImageRep *rep = [[[NSBitmapImageRep alloc] initWithFocusedViewRect: [view bounds]] retain]; + NSBitmapImageRep *rep = [[NSBitmapImageRep alloc] initWithFocusedViewRect: [view bounds]]; [view unlockFocus]; if ( [rep respondsToSelector:@selector(CGImage)] ) { @@ -388,8 +394,6 @@ wxBitmap wxWindowDCImpl::DoGetAsBitmap(const wxRect *subrect) const CGRect r = CGRectMake( 0 , 0 , CGImageGetWidth(cgImageRef) , CGImageGetHeight(cgImageRef) ); // since our context is upside down we dont use CGContextDrawImage wxMacDrawCGImage( (CGContextRef) bitmap.GetHBITMAP() , &r, cgImageRef ) ; - CGImageRelease(cgImageRef); - cgImageRef = NULL; } else {