diff options
Diffstat (limited to 'AppKit')
-rw-r--r-- | AppKit/GTMCarbonEvent.m | 5 | ||||
-rw-r--r-- | AppKit/GTMHotKeyTextField.m | 4 | ||||
-rw-r--r-- | AppKit/GTMLargeTypeWindow.m | 6 | ||||
-rw-r--r-- | AppKit/GTMWindowSheetController.m | 4 |
4 files changed, 13 insertions, 6 deletions
diff --git a/AppKit/GTMCarbonEvent.m b/AppKit/GTMCarbonEvent.m index 16c46c8..2166331 100644 --- a/AppKit/GTMCarbonEvent.m +++ b/AppKit/GTMCarbonEvent.m @@ -19,6 +19,7 @@ #import "GTMCarbonEvent.h" #import "GTMObjectSingleton.h" #import "GTMDebugSelectorValidation.h" +#import "GTMTypeCasting.h" // Wrapper for all the info we need about a hotkey that we can store in a // Foundation storage class. We expecct selector to have this signature: @@ -432,8 +433,8 @@ static OSStatus EventHandler(EventHandlerCallRef inHandler, EventRef inEvent, void *inUserData) { GTMCarbonEvent *event = [GTMCarbonEvent eventWithEvent:inEvent]; - GTMCarbonEventHandler *handler= (GTMCarbonEventHandler *)inUserData; - check([handler isKindOfClass:[GTMCarbonEventHandler class]]); + GTMCarbonEventHandler *handler + = GTM_STATIC_CAST(GTMCarbonEventHandler, inUserData); // First check to see if our delegate cares about this event. If the delegate // handles it (i.e responds to it and does not return eventNotHandledErr) we diff --git a/AppKit/GTMHotKeyTextField.m b/AppKit/GTMHotKeyTextField.m index 864ba54..4524340 100644 --- a/AppKit/GTMHotKeyTextField.m +++ b/AppKit/GTMHotKeyTextField.m @@ -21,6 +21,7 @@ #import "GTMSystemVersion.h" #import "GTMObjectSingleton.h" #import "GTMNSObject+KeyValueObserving.h" +#import "GTMTypeCasting.h" #if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4 typedef struct __TISInputSource* TISInputSourceRef; @@ -370,7 +371,8 @@ static CFStringRef kGTM_TISPropertyUnicodeKeyLayoutData = NULL; - (void)textDidChange:(NSNotification *)notification { // Sanity - GTMHotKeyFieldEditor *fieldEditor = [notification object]; + GTMHotKeyFieldEditor *fieldEditor = GTM_STATIC_CAST(GTMHotKeyFieldEditor, + [notification object]); if (![fieldEditor isKindOfClass:[GTMHotKeyFieldEditor class]]) { _GTMDevLog(@"Field editor not appropriate for field, check window delegate"); return; diff --git a/AppKit/GTMLargeTypeWindow.m b/AppKit/GTMLargeTypeWindow.m index dfef15f..de85ec8 100644 --- a/AppKit/GTMLargeTypeWindow.m +++ b/AppKit/GTMLargeTypeWindow.m @@ -22,7 +22,7 @@ #import "GTMGeometryUtils.h" #import "GTMNSBezierPath+RoundRect.h" #import "GTMMethodCheck.h" - +#import "GTMTypeCasting.h" // How far to inset the text from the edge of the window static const CGFloat kEdgeInset = 16.0; @@ -221,7 +221,9 @@ static NSTimeInterval gGTMLargeTypeWindowFadeAnimationDuration = 0.333; // Give the user some feedback that a copy has occurred NSTimeInterval dur = [[self class] copyAnimationDuration]; - [(GTMLargeTypeBackgroundView*)[self contentView] animateCopyWithDuration:dur]; + GTMLargeTypeBackgroundView *view + = GTM_STATIC_CAST(GTMLargeTypeBackgroundView, [self contentView]); + [view animateCopyWithDuration:dur]; } - (BOOL)canBecomeKeyWindow { diff --git a/AppKit/GTMWindowSheetController.m b/AppKit/GTMWindowSheetController.m index ae14685..59a866d 100644 --- a/AppKit/GTMWindowSheetController.m +++ b/AppKit/GTMWindowSheetController.m @@ -19,6 +19,7 @@ #import "GTMWindowSheetController.h" #import "GTMDefines.h" +#import "GTMTypeCasting.h" @interface GTMWSCSheetInfo : NSObject { @public @@ -462,7 +463,8 @@ willPositionSheet:(NSWindow*)sheet } - (void)notificationHappened:(NSNotification*)notification { - [self viewDidChangeSize:[notification object]]; + NSView *view = GTM_STATIC_CAST(NSView, [notification object]); + [self viewDidChangeSize:view]; } - (void)viewDidChangeSize:(NSView*)view { |