void wxMacWakeUp()
{
- // TODO
+ NSEvent* wakeupEvent = [NSEvent otherEventWithType:NSApplicationDefined location:NSZeroPoint
+ modifierFlags:NSAnyEventMask timestamp:0 windowNumber:0 context:nil subtype:0 data1:0 data2:0];
+ [NSApp postEvent:wakeupEvent atStart:NO];
}
#endif // wxUSE_BASE
}
@end
-/*
+/*
allows ShowModal to work when using sheets.
- see include/wx/osx/cocoa/private.h for more info
+ see include/wx/osx/cocoa/private.h for more info
*/
@implementation ModalDialogDelegate
- (id)init
return self;
}
-- (BOOL)finished
+- (BOOL)finished
{
return sheetFinished;
}
NSBitmapImageRep *rep = [[[NSBitmapImageRep alloc] initWithFocusedViewRect: [view bounds]] retain];
[view unlockFocus];
- CGImageRef cgImageRef = (CGImageRef)[rep CGImage];
+ wxBitmap bitmap(width, height);
+ if ( [rep respondsToSelector:@selector(CGImage)] )
+ {
+ CGImageRef cgImageRef = (CGImageRef)[rep CGImage];
- wxBitmap bitmap(CGImageGetWidth(cgImageRef) , CGImageGetHeight(cgImageRef) );
- 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;
+ 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
+ {
+ // TODO for 10.4 in case we can support this for osx_cocoa
+ }
[rep release];
return bitmap;