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 749feb2..08bf149 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 a0b8516..e8d8013 100644 (file)
@@ -10,6 +10,6 @@
 
 @interface TargetMouseBtn : Target
 
-@property (assign) CGMouseButton which;
+@property (assign) CGMouseButton button;
 
 @end
index 28fe536..2f56f7e 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 24efa40..89f9c76 100644 (file)
@@ -10,6 +10,6 @@
 
 @interface TargetMouseMove : Target
 
-@property (assign) int dir;
+@property (assign) int axis;
 
 @end
index f75f70b..893bbb6 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 cdfe010..5c13d5f 100644 (file)
@@ -10,6 +10,6 @@
 
 @interface TargetMouseScroll : Target
 
-@property (assign) int howMuch;
+@property (assign) int amount;
 
 @end
index 3c417c1..4d6f409 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);
 }