incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eri...@apache.org
Subject svn commit: r1195271 - /incubator/ooo/trunk/main/apple_remote/AppleRemote.m
Date Sun, 30 Oct 2011 22:56:44 GMT
Author: ericb2
Date: Sun Oct 30 22:56:44 2011
New Revision: 1195271

URL: http://svn.apache.org/viewvc?rev=1195271&view=rev
Log:
Propragating the modif in the implementation (AppleRemote.m)

Modified:
    incubator/ooo/trunk/main/apple_remote/AppleRemote.m

Modified: incubator/ooo/trunk/main/apple_remote/AppleRemote.m
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/apple_remote/AppleRemote.m?rev=1195271&r1=1195270&r2=1195271&view=diff
==============================================================================
--- incubator/ooo/trunk/main/apple_remote/AppleRemote.m (original)
+++ incubator/ooo/trunk/main/apple_remote/AppleRemote.m Sun Oct 30 22:56:44 2011
@@ -42,8 +42,9 @@ const char* AppleRemoteDeviceName = "App
 #ifndef NSAppKitVersionNumber10_4
 	#define NSAppKitVersionNumber10_4 824
 #endif
+
 #ifndef NSAppKitVersionNumber10_5
-	#define NSAppKitVersionNumber10_5 949
+    #define NSAppKitVersionNumber10_5 949
 #endif
 
 @implementation AppleRemote
@@ -52,13 +53,15 @@ const char* AppleRemoteDeviceName = "App
 	return AppleRemoteDeviceName;
 }
 
-- (void) setCookieMappingInDictionary: (NSMutableDictionary*) _cookieToButtonMapping	{	
-    
+- (void) setCookieMappingInDictionary: (NSMutableDictionary*) _cookieToButtonMapping
+{	
     // TODO : avoid such magics 
-	if (floor(NSAppKitVersionNumber) <= NSAppKitVersionNumber10_4) {
-	    #ifdef DEBUG
-	    NSLog( @"setting 10.4 cookies" );
-	    #endif
+	if (floor(NSAppKitVersionNumber) <= NSAppKitVersionNumber10_4) 
+    {
+        #ifdef DEBUG
+            NSLog( @"setting 10.4 cookies" );
+        #endif
+
 		// 10.4.x Tiger
 		[_cookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteButtonPlus]		forKey:@"14_12_11_6_"];
 		[_cookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteButtonMinus]		forKey:@"14_13_11_6_"];
	
@@ -71,10 +74,12 @@ const char* AppleRemoteDeviceName = "App
 		[_cookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteButtonMenu_Hold]	forKey:@"14_6_14_6_"];
 		[_cookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteButtonPlay_Hold]	forKey:@"18_14_6_18_14_6_"];
 		[_cookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteControl_Switched]	forKey:@"19_"];
		
-	} else if( floor(NSAppKitVersionNumber) <= NSAppKitVersionNumber10_5 ) {
-	    #ifdef DEBUG
-	    NSLog( @"setting 10.5 cookies" );
-	    #endif
+	} 
+    else if( floor(NSAppKitVersionNumber) <= NSAppKitVersionNumber10_5 )
+    {
+        #ifdef DEBUG
+            NSLog( @"setting 10.5 cookies" );
+        #endif
 		// 10.5.x Leopard
 		[_cookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteButtonPlus]		forKey:@"31_29_28_19_18_"];
 		[_cookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteButtonMinus]		forKey:@"31_30_28_19_18_"];

@@ -87,28 +92,31 @@ const char* AppleRemoteDeviceName = "App
 		[_cookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteButtonMenu_Hold]	forKey:@"31_19_18_31_19_18_"];
 		[_cookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteButtonPlay_Hold]	forKey:@"35_31_19_18_35_31_19_18_"];
 		[_cookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteControl_Switched]	forKey:@"19_"];
		
-	}
-	else
-	{
-	    #ifdef DEBUG
-	    NSLog( @"setting 10.6 cookies" );
-	    #endif
-	    // 10.6.x Snow Leopard
-		[_cookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteButtonPlus]		forKey:@"33_31_30_21_20_2_"];
-		[_cookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteButtonMinus]		forKey:@"33_32_30_21_20_2_"];

-		[_cookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteButtonMenu]		forKey:@"33_22_21_20_2_33_22_21_20_2_"];
-		[_cookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteButtonPlay]		forKey:@"33_23_21_20_2_33_23_21_20_2_"];
-		[_cookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteButtonRight]		forKey:@"33_24_21_20_2_33_24_21_20_2_"];
-		[_cookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteButtonLeft]		forKey:@"33_25_21_20_2_33_25_21_20_2_"];
-		[_cookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteButtonRight_Hold]	forKey:@"33_21_20_14_12_2_"];
-		[_cookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteButtonLeft_Hold]	forKey:@"33_21_20_13_12_2_"];
-		[_cookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteButtonMenu_Hold]	forKey:@"33_21_20_2_33_21_20_2_"];
-		[_cookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteButtonPlay_Hold]	forKey:@"37_33_21_20_2_37_33_21_20_2_"];
-		[_cookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteControl_Switched]	forKey:@"19_"];
+    }    
+    else
+    {
+        #ifdef DEBUG
+            NSLog( @"setting 10.6 cookies" );
+        #endif
+        // 10.6.x Snow Leopard
+        [_cookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteButtonPlus]		forKey:@"33_31_30_21_20_2_"];
+        [_cookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteButtonMinus]		forKey:@"33_32_30_21_20_2_"];

+        [_cookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteButtonMenu]		forKey:@"33_22_21_20_2_33_22_21_20_2_"];
+        [_cookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteButtonPlay]		forKey:@"33_23_21_20_2_33_23_21_20_2_"];
+        [_cookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteButtonRight]		forKey:@"33_24_21_20_2_33_24_21_20_2_"];
+        [_cookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteButtonLeft]		forKey:@"33_25_21_20_2_33_25_21_20_2_"];
+        [_cookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteButtonRight_Hold]
forKey:@"33_21_20_14_12_2_"];
+        [_cookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteButtonLeft_Hold]
forKey:@"33_21_20_13_12_2_"];
+        [_cookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteButtonMenu_Hold]
forKey:@"33_21_20_2_33_21_20_2_"];
+        [_cookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteButtonPlay_Hold]
forKey:@"37_33_21_20_2_37_33_21_20_2_"];
+        [cookieToButtonMapping setObject:[NSNumber numberWithInt:kMetallicRemote2009ButtonPlay]
      forKey:@"33_21_20_8_2_33_21_20_8_2_"];
+        [cookieToButtonMapping setObject:[NSNumber numberWithInt:kMetallicRemote2009ButtonMiddlePlay]
forKey:@"33_21_20_3_2_33_21_20_3_2_"];
+        [_cookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteControl_Switched]
forKey:@"19_"];
 	}
 }
 
-- (void) sendRemoteButtonEvent: (RemoteControlEventIdentifier) event pressedDown: (BOOL)
pressedDown {
+- (void) sendRemoteButtonEvent: (RemoteControlEventIdentifier) event pressedDown: (BOOL)
pressedDown
+{
 	if (pressedDown == NO && event == kRemoteButtonMenu_Hold) {
 		// There is no seperate event for pressed down on menu hold. We are simulating that event
here
 		[super sendRemoteButtonEvent:event pressedDown:YES];



Mime
View raw message