From 6128e529ea5c0d09de65dcbbc00a299f6b871735 Mon Sep 17 00:00:00 2001 From: Tomáš Znamenáček Date: Thu, 7 Aug 2014 14:04:32 +0200 Subject: Whitespace fixes. --- Framework/MASKeyCodes.h | 28 ++++++------- Framework/MASShortcutMonitor.m | 8 ++-- Framework/MASShortcutValidator.m | 4 +- Framework/MASShortcutView+Bindings.m | 2 +- Framework/MASShortcutView.m | 80 ++++++++++++++++++------------------ 5 files changed, 61 insertions(+), 61 deletions(-) (limited to 'Framework') diff --git a/Framework/MASKeyCodes.h b/Framework/MASKeyCodes.h index 9fb5b02..8c1ce06 100644 --- a/Framework/MASKeyCodes.h +++ b/Framework/MASKeyCodes.h @@ -4,22 +4,22 @@ enum { kMASShortcutGlyphEject = 0x23CF, kMASShortcutGlyphClear = 0x2715, - kMASShortcutGlyphDeleteLeft = 0x232B, - kMASShortcutGlyphDeleteRight = 0x2326, + kMASShortcutGlyphDeleteLeft = 0x232B, + kMASShortcutGlyphDeleteRight = 0x2326, kMASShortcutGlyphLeftArrow = 0x2190, - kMASShortcutGlyphRightArrow = 0x2192, - kMASShortcutGlyphUpArrow = 0x2191, - kMASShortcutGlyphDownArrow = 0x2193, - kMASShortcutGlyphEscape = 0x238B, - kMASShortcutGlyphHelp = 0x003F, + kMASShortcutGlyphRightArrow = 0x2192, + kMASShortcutGlyphUpArrow = 0x2191, + kMASShortcutGlyphDownArrow = 0x2193, + kMASShortcutGlyphEscape = 0x238B, + kMASShortcutGlyphHelp = 0x003F, kMASShortcutGlyphPageDown = 0x21DF, - kMASShortcutGlyphPageUp = 0x21DE, - kMASShortcutGlyphTabRight = 0x21E5, - kMASShortcutGlyphReturn = 0x2305, - kMASShortcutGlyphReturnR2L = 0x21A9, - kMASShortcutGlyphPadClear = 0x2327, - kMASShortcutGlyphNorthwestArrow = 0x2196, - kMASShortcutGlyphSoutheastArrow = 0x2198, + kMASShortcutGlyphPageUp = 0x21DE, + kMASShortcutGlyphTabRight = 0x21E5, + kMASShortcutGlyphReturn = 0x2305, + kMASShortcutGlyphReturnR2L = 0x21A9, + kMASShortcutGlyphPadClear = 0x2327, + kMASShortcutGlyphNorthwestArrow = 0x2196, + kMASShortcutGlyphSoutheastArrow = 0x2198, } MASShortcutGlyph; NS_INLINE NSString* NSStringFromMASKeyCode(unsigned short ch) diff --git a/Framework/MASShortcutMonitor.m b/Framework/MASShortcutMonitor.m index d175b82..cb89ce1 100644 --- a/Framework/MASShortcutMonitor.m +++ b/Framework/MASShortcutMonitor.m @@ -71,13 +71,13 @@ static OSStatus MASCarbonEventCallback(EventHandlerCallRef, EventRef, void*); - (void) handleEvent: (EventRef) event { - if (GetEventClass(event) != kEventClassKeyboard) { + if (GetEventClass(event) != kEventClassKeyboard) { return; } - EventHotKeyID hotKeyID; - OSStatus status = GetEventParameter(event, kEventParamDirectObject, typeEventHotKeyID, NULL, sizeof(hotKeyID), NULL, &hotKeyID); - if (status != noErr || hotKeyID.signature != MASHotKeySignature) { + EventHotKeyID hotKeyID; + OSStatus status = GetEventParameter(event, kEventParamDirectObject, typeEventHotKeyID, NULL, sizeof(hotKeyID), NULL, &hotKeyID); + if (status != noErr || hotKeyID.signature != MASHotKeySignature) { return; } diff --git a/Framework/MASShortcutValidator.m b/Framework/MASShortcutValidator.m index 4fcba9b..1db3ed9 100644 --- a/Framework/MASShortcutValidator.m +++ b/Framework/MASShortcutValidator.m @@ -80,8 +80,8 @@ - (BOOL) isShortcutAlreadyTakenBySystem: (MASShortcut*) shortcut explanation: (NSString**) explanation { - CFArrayRef globalHotKeys; - if (CopySymbolicHotKeys(&globalHotKeys) == noErr) { + CFArrayRef globalHotKeys; + if (CopySymbolicHotKeys(&globalHotKeys) == noErr) { // Enumerate all global hotkeys and check if any of them matches current shortcut for (CFIndex i = 0, count = CFArrayGetCount(globalHotKeys); i < count; i++) { diff --git a/Framework/MASShortcutView+Bindings.m b/Framework/MASShortcutView+Bindings.m index 7a6064c..d8e10bc 100644 --- a/Framework/MASShortcutView+Bindings.m +++ b/Framework/MASShortcutView+Bindings.m @@ -4,7 +4,7 @@ - (NSString*) associatedUserDefaultsKey { - NSDictionary* bindingInfo = [self infoForBinding:MASShortcutBinding]; + NSDictionary* bindingInfo = [self infoForBinding:MASShortcutBinding]; if (bindingInfo != nil) { NSString *keyPath = [bindingInfo objectForKey:NSObservedKeyPathKey]; NSString *key = [keyPath stringByReplacingOccurrencesOfString:@"values." withString:@""]; diff --git a/Framework/MASShortcutView.m b/Framework/MASShortcutView.m index 61df2d0..716edba 100644 --- a/Framework/MASShortcutView.m +++ b/Framework/MASShortcutView.m @@ -462,46 +462,46 @@ void *kUserDataHint = &kUserDataHint; // http://tomdalling.com/blog/cocoa/implementing-your-own-cocoa-bindings/ -(void) propagateValue:(id)value forBinding:(NSString*)binding; { - NSParameterAssert(binding != nil); - - //WARNING: bindingInfo contains NSNull, so it must be accounted for - NSDictionary* bindingInfo = [self infoForBinding:binding]; - if(!bindingInfo) - return; //there is no binding - - //apply the value transformer, if one has been set - NSDictionary* bindingOptions = [bindingInfo objectForKey:NSOptionsKey]; - if(bindingOptions){ - NSValueTransformer* transformer = [bindingOptions valueForKey:NSValueTransformerBindingOption]; - if(!transformer || (id)transformer == [NSNull null]){ - NSString* transformerName = [bindingOptions valueForKey:NSValueTransformerNameBindingOption]; - if(transformerName && (id)transformerName != [NSNull null]){ - transformer = [NSValueTransformer valueTransformerForName:transformerName]; - } - } - - if(transformer && (id)transformer != [NSNull null]){ - if([[transformer class] allowsReverseTransformation]){ - value = [transformer reverseTransformedValue:value]; - } else { - NSLog(@"WARNING: binding \"%@\" has value transformer, but it doesn't allow reverse transformations in %s", binding, __PRETTY_FUNCTION__); - } - } - } - - id boundObject = [bindingInfo objectForKey:NSObservedObjectKey]; - if(!boundObject || boundObject == [NSNull null]){ - NSLog(@"ERROR: NSObservedObjectKey was nil for binding \"%@\" in %s", binding, __PRETTY_FUNCTION__); - return; - } - - NSString* boundKeyPath = [bindingInfo objectForKey:NSObservedKeyPathKey]; - if(!boundKeyPath || (id)boundKeyPath == [NSNull null]){ - NSLog(@"ERROR: NSObservedKeyPathKey was nil for binding \"%@\" in %s", binding, __PRETTY_FUNCTION__); - return; - } - - [boundObject setValue:value forKeyPath:boundKeyPath]; + NSParameterAssert(binding != nil); + + //WARNING: bindingInfo contains NSNull, so it must be accounted for + NSDictionary* bindingInfo = [self infoForBinding:binding]; + if(!bindingInfo) + return; //there is no binding + + //apply the value transformer, if one has been set + NSDictionary* bindingOptions = [bindingInfo objectForKey:NSOptionsKey]; + if(bindingOptions){ + NSValueTransformer* transformer = [bindingOptions valueForKey:NSValueTransformerBindingOption]; + if(!transformer || (id)transformer == [NSNull null]){ + NSString* transformerName = [bindingOptions valueForKey:NSValueTransformerNameBindingOption]; + if(transformerName && (id)transformerName != [NSNull null]){ + transformer = [NSValueTransformer valueTransformerForName:transformerName]; + } + } + + if(transformer && (id)transformer != [NSNull null]){ + if([[transformer class] allowsReverseTransformation]){ + value = [transformer reverseTransformedValue:value]; + } else { + NSLog(@"WARNING: binding \"%@\" has value transformer, but it doesn't allow reverse transformations in %s", binding, __PRETTY_FUNCTION__); + } + } + } + + id boundObject = [bindingInfo objectForKey:NSObservedObjectKey]; + if(!boundObject || boundObject == [NSNull null]){ + NSLog(@"ERROR: NSObservedObjectKey was nil for binding \"%@\" in %s", binding, __PRETTY_FUNCTION__); + return; + } + + NSString* boundKeyPath = [bindingInfo objectForKey:NSObservedKeyPathKey]; + if(!boundKeyPath || (id)boundKeyPath == [NSNull null]){ + NSLog(@"ERROR: NSObservedKeyPathKey was nil for binding \"%@\" in %s", binding, __PRETTY_FUNCTION__); + return; + } + + [boundObject setValue:value forKeyPath:boundKeyPath]; } @end -- cgit v1.2.3