return proposedMax - OUTPUT_PANE_MIN_WIDTH;
}
--(void)splitView:(NSSplitView *)splitView resizeSubviewsWithOldSize:(NSSize)oldSize {
+- (void)splitView:(NSSplitView *)splitView resizeSubviewsWithOldSize:(NSSize)oldSize {
NSView *inputView = splitView.subviews[0];
NSView *outputView = splitView.subviews[1];
if (outputView.frame.size.width < OUTPUT_PANE_MIN_WIDTH) {
@class NJOutputController;
@interface NJDeviceController : NSObject <NSOutlineViewDataSource, NSOutlineViewDelegate> {
- IBOutlet NSOutlineView *outlineView;
- IBOutlet NJOutputController *outputController;
- IBOutlet NJMappingsController *mappingsController;
+ IBOutlet NSOutlineView *outlineView;
+ IBOutlet NJOutputController *outputController;
+ IBOutlet NJMappingsController *mappingsController;
IBOutlet NSButton *translatingEventsButton;
IBOutlet NSMenuItem *translatingEventsMenu;
}
[self mappingsChanged];
}
--(void)tableViewSelectionDidChange:(NSNotification *)notify {
+- (void)tableViewSelectionDidChange:(NSNotification *)notify {
[self activateMapping:self[tableView.selectedRow]];
}
+ (NJOutput *)outputDeserialize:(NSDictionary *)serialization
withMappings:(NSArray *)mappings {
- NJOutputMouseButton *output = [[NJOutputMouseButton alloc] init];
+ NJOutputMouseButton *output = [[NJOutputMouseButton alloc] init];
output.button = [serialization[@"button"] intValue];
- return output;
+ return output;
}
--(void) trigger {
+- (void)trigger {
CGFloat height = NSScreen.mainScreen.frame.size.height;
NSPoint mouseLoc = NSEvent.mouseLocation;
CGEventType eventType = (_button == kCGMouseButtonLeft) ? kCGEventLeftMouseDown : kCGEventRightMouseDown;
CFRelease(click);
}
--(void) untrigger {
+- (void)untrigger {
CGFloat height = NSScreen.mainScreen.frame.size.height;
NSPoint mouseLoc = NSEvent.mouseLocation;
CGEventType eventType = (_button == kCGMouseButtonLeft) ? kCGEventLeftMouseUp : kCGEventRightMouseUp;
@implementation NJOutputMouseMove
--(BOOL) isContinuous {
- return YES;
-}
-
+ (NSString *)serializationCode {
return @"mouse move";
}
+ (NJOutput *)outputDeserialize:(NSDictionary *)serialization
withMappings:(NSArray *)mappings {
- NJOutputMouseMove *output = [[NJOutputMouseMove alloc] init];
+ NJOutputMouseMove *output = [[NJOutputMouseMove alloc] init];
output.axis = [serialization[@"axis"] intValue];
output.speed = [serialization[@"speed"] floatValue];
if (!output.speed)
output.speed = 4;
- return output;
+ return output;
+}
+
+- (BOOL)isContinuous {
+ return YES;
}
- (BOOL)update:(NJDeviceController *)jc {
+ (NJOutput *)outputDeserialize:(NSDictionary *)serialization
withMappings:(NSArray *)mappings {
- NJOutputMouseScroll *output = [[NJOutputMouseScroll alloc] init];
+ NJOutputMouseScroll *output = [[NJOutputMouseScroll alloc] init];
output.direction = [serialization[@"direction"] intValue];
output.speed = [serialization[@"direction"] floatValue];
- return output;
+ return output;
}
- (BOOL)isContinuous {