Fix names while I still can.
authorJoe Wreschnig <joe.wreschnig@gmail.com>
Thu, 28 Feb 2013 19:20:55 +0000 (20:20 +0100)
committerJoe Wreschnig <joe.wreschnig@gmail.com>
Thu, 28 Feb 2013 19:20:55 +0000 (20:20 +0100)
TargetController.m
TargetMouseBtn.h
TargetMouseBtn.m
TargetMouseMove.h
TargetMouseMove.m
TargetMouseScroll.h
TargetMouseScroll.m

index 749feb281463d2d059603b5e4eadc6f049da709d..08bf1493b797b88e7171f7db4151c42323630c24 100644 (file)
         }
         case 3: {
             TargetMouseMove *mm = [[TargetMouseMove alloc] init];
-            mm.dir = mouseDirSelect.selectedSegment;
+            mm.axis = mouseDirSelect.selectedSegment;
             return mm;
         }
         case 4: {
             TargetMouseBtn *mb = [[TargetMouseBtn alloc] init];
-            mb.which = mouseBtnSelect.selectedSegment == 0 ? kCGMouseButtonLeft : kCGMouseButtonRight;
+            mb.button = mouseBtnSelect.selectedSegment == 0 ? kCGMouseButtonLeft : kCGMouseButtonRight;
             return mb;
         }
         case 5: {
             TargetMouseScroll *ms = [[TargetMouseScroll alloc] init];
-            ms.howMuch = scrollDirSelect.selectedSegment ? 1 : -1;
+            ms.amount = scrollDirSelect.selectedSegment ? 1 : -1;
             return ms;
         }
         case 6: {
     }
     else if ([target isKindOfClass:[TargetMouseMove class]]) {
         [radioButtons setState:1 atRow:3 column:0];
-        [mouseDirSelect setSelectedSegment:[(TargetMouseMove *)target dir]];
+        [mouseDirSelect setSelectedSegment:[(TargetMouseMove *)target axis]];
     }
     else if ([target isKindOfClass:[TargetMouseBtn class]]) {
         [radioButtons setState:1 atRow:4 column:0];
-        mouseBtnSelect.selectedSegment = [(TargetMouseBtn *)target which] == kCGMouseButtonLeft ? 0 : 1;
+        mouseBtnSelect.selectedSegment = [(TargetMouseBtn *)target button] == kCGMouseButtonLeft ? 0 : 1;
     }
     else if ([target isKindOfClass:[TargetMouseScroll class]]) {
         [radioButtons setState:1 atRow:5 column:0];
-        scrollDirSelect.selectedSegment = [(TargetMouseScroll *)target howMuch] > 0;
+        scrollDirSelect.selectedSegment = [(TargetMouseScroll *)target amount] > 0;
     }
     else if ([target isKindOfClass:[TargetToggleMouseScope class]]) {
         [radioButtons setState:1 atRow:6 column:0];
index a0b85166526544a45531e96f96655a62b09b7131..e8d80137cdc33363bc21d2f10f3898bb6301e41b 100644 (file)
@@ -10,6 +10,6 @@
 
 @interface TargetMouseBtn : Target
 
-@property (assign) CGMouseButton which;
+@property (assign) CGMouseButton button;
 
 @end
index 28fe536345c24fa88f3e490e320b688da0504fa1..2f56f7e1849b5bcdb551ba17360f1076fe5f4260 100644 (file)
 
 @implementation TargetMouseBtn
 
-@synthesize which;
+@synthesize button;
 
 + (NSString *)serializationCode {
     return @"mbtn";
 }
 
 - (NSDictionary *)serialize {
-    return @{ @"type": @"mbtn", @"which": @(self.which) };
+    return @{ @"type": @"mbtn", @"button": @(self.button) };
 }
 
 + (Target *)targetDeserialize:(NSDictionary *)serialization
                   withConfigs:(NSArray *)configs {
        TargetMouseBtn *target = [[TargetMouseBtn alloc] init];
-    target.which = [serialization[@"which"] intValue];
+    target.button = [serialization[@"button"] intValue];
        return target;
 }
 
     NSRect screenRect = [[NSScreen mainScreen] frame];
     NSInteger height = screenRect.size.height;
     NSPoint mouseLoc = [NSEvent mouseLocation];
-    CGEventType eventType = (which == kCGMouseButtonLeft) ? kCGEventLeftMouseDown : kCGEventRightMouseDown;
+    CGEventType eventType = (button == kCGMouseButtonLeft) ? kCGEventLeftMouseDown : kCGEventRightMouseDown;
     CGEventRef click = CGEventCreateMouseEvent(NULL,
                                                eventType,
                                                CGPointMake(mouseLoc.x, height - mouseLoc.y),
-                                               which);
+                                               button);
     CGEventPost(kCGHIDEventTap, click);
     CFRelease(click);
 }
     NSRect screenRect = [[NSScreen mainScreen] frame];
     NSInteger height = screenRect.size.height;
     NSPoint mouseLoc = [NSEvent mouseLocation];
-    CGEventType eventType = (which == kCGMouseButtonLeft) ? kCGEventLeftMouseUp : kCGEventRightMouseUp;
+    CGEventType eventType = (button == kCGMouseButtonLeft) ? kCGEventLeftMouseUp : kCGEventRightMouseUp;
     CGEventRef click = CGEventCreateMouseEvent(NULL,
                                                eventType,
                                                CGPointMake(mouseLoc.x, height - mouseLoc.y),
-                                               which);
+                                               button);
     CGEventPost(kCGHIDEventTap, click);
     CFRelease(click);
 }
index 24efa406fa8b30b93c36e0c4b29689ef72017b2c..89f9c76aba743c6a3e540fe7475931abeaa52209 100644 (file)
@@ -10,6 +10,6 @@
 
 @interface TargetMouseMove : Target
 
-@property (assign) int dir;
+@property (assign) int axis;
 
 @end
index f75f70bd2d74a3fa92db4fc80da75b47239c67a7..893bbb6263e92f23e67dff295f4652a159ea13b2 100644 (file)
     return YES;
 }
 
-@synthesize dir;
+@synthesize axis;
 
 + (NSString *)serializationCode {
     return @"mmove";
 }
 
 - (NSDictionary *)serialize {
-    return @{ @"type": @"mmove", @"dir": @(self.dir) };
+    return @{ @"type": @"mmove", @"axis": @(self.axis) };
 }
 
 + (Target *)targetDeserialize:(NSDictionary *)serialization
                   withConfigs:(NSArray *)configs {
        TargetMouseMove *target = [[TargetMouseMove alloc] init];
-    target.dir = [serialization[@"dir"] intValue];
+    target.axis = [serialization[@"axis"] intValue];
        return target;
 }
 
@@ -57,7 +57,7 @@
     if ([jc frontWindowOnly])
         speed = 12.f;
     float dx = 0.f, dy = 0.f;
-    if (self.dir == 0)
+    if (axis == 0)
         dx = self.magnitude * speed;
     else
         dy = self.magnitude * speed;
index cdfe010157a674096e6ce5ced8d4f2433cb449d5..5c13d5f345e54223c2244ad8e89ed4f94170a864 100644 (file)
@@ -10,6 +10,6 @@
 
 @interface TargetMouseScroll : Target
 
-@property (assign) int howMuch;
+@property (assign) int amount;
 
 @end
index 3c417c1264a56576d0d4d2870af97d219acfdbb3..4d6f409a97d2804765f74109447c2c3642837763 100644 (file)
 
 @implementation TargetMouseScroll
 
-@synthesize howMuch;
+@synthesize amount;
 
 + (NSString *)serializationCode {
     return @"mscroll";
 }
 
 - (NSDictionary *)serialize {
-    return @{ @"type": @"mscroll", @"howMuch": @(self.howMuch) };
+    return @{ @"type": @"mscroll", @"amount": @(self.amount) };
 }
 
 + (Target *)targetDeserialize:(NSDictionary *)serialization
                   withConfigs:(NSArray *)configs {
        TargetMouseScroll *target = [[TargetMouseScroll alloc] init];
-    target.howMuch = [serialization[@"howMuch"] intValue];
+    target.amount = [serialization[@"amount"] intValue];
        return target;
 }
 -(void) trigger {
     CGEventRef scroll = CGEventCreateScrollWheelEvent(NULL,
                                                       kCGScrollEventUnitLine,
                                                       1,
-                                                      self.howMuch);
+                                                      self.amount);
     CGEventPost(kCGHIDEventTap, scroll);
     CFRelease(scroll);
 }