Remove useless items in menubar.
[enjoyable.git] / Target.m
1 //
2 // Target.m
3 // Enjoy
4 //
5 // Created by Sam McCall on 5/05/09.
6 //
7
8 @implementation Target
9
10 +(Target*) unstringify: (NSString*) str withConfigList: (NSArray*) configs {
11 NSArray* components = [str componentsSeparatedByString:@"~"];
12 NSParameterAssert([components count]);
13 NSString* typeTag = components[0];
14 if([typeTag isEqualToString:@"key"])
15 return [TargetKeyboard unstringifyImpl:components];
16 if([typeTag isEqualToString:@"cfg"])
17 return [TargetConfig unstringifyImpl:components withConfigList:configs];
18 if([typeTag isEqualToString:@"mmove"])
19 return [TargetMouseMove unstringifyImpl:components];
20 if([typeTag isEqualToString:@"mbtn"])
21 return [TargetMouseBtn unstringifyImpl:components];
22 if([typeTag isEqualToString:@"mscroll"])
23 return [TargetMouseScroll unstringifyImpl:components];
24 if([typeTag isEqualToString:@"mtoggle"])
25 return [TargetToggleMouseScope unstringifyImpl:components];
26
27 NSParameterAssert(NO);
28 return NULL;
29 }
30
31 -(NSString*) stringify {
32 [self doesNotRecognizeSelector:_cmd];
33 return NULL;
34 }
35
36 -(void) trigger: (JoystickController *)jc {
37 [self doesNotRecognizeSelector:_cmd];
38 }
39
40 -(void) untrigger: (JoystickController *)jc {
41 // no-op by default
42 }
43
44 -(void) update: (JoystickController *) jc {
45 [self doesNotRecognizeSelector:_cmd];
46 }
47
48 -(BOOL) isContinuous {
49 return false;
50 }
51
52 @synthesize inputValue, running;
53
54 @end