Show an error message if opening input devices fail. Move real vs. configuration...
[enjoyable.git] / TargetToggleMouseScope.m
index d6833fc..4f1d157 100644 (file)
 
 @implementation TargetToggleMouseScope
 
--(NSString*) stringify {
-       return [[NSString alloc] initWithFormat: @"mtoggle"];
++ (NSString *)serializationCode {
+    return @"mtoggle";
 }
 
-+(TargetToggleMouseScope*) unstringifyImpl: (NSArray*) comps {
-       NSParameterAssert([comps count] == 1);
-       TargetToggleMouseScope* target = [[TargetToggleMouseScope alloc] init];
-       return target;
+- (NSDictionary *)serialize {
+    return @{ @"type": @"mtoggle" };
 }
 
++ (Target *)targetDeserialize:(NSDictionary *)serialization
+                  withConfigs:(NSArray *)configs {
+       TargetToggleMouseScope *target = [[TargetToggleMouseScope alloc] init];
+       return target;
+}
 - (void)trigger {
     // FIXME: It's hacky to get at the controller this way, but it's
     // also hacky to pass it. Shouldn't need to do either.