Removing the use of private CoreGraphics APIs to draw shadows, and replacing with...
[ITKit.git] / ITHotKey.m
1 #import "ITHotKey.h"
2 #import "ITKeyCombo.h"
3
4 @implementation ITHotKey
5
6 - (id)init {
7         if ((self = [super init])) {
8                 [self setKeyCombo:[ITKeyCombo clearKeyCombo]];
9         }
10         return self;
11 }
12
13 - (void)dealloc {
14         [mName release];
15         [mKeyCombo release];
16         [super dealloc];
17 }
18
19 - (NSString *)description {
20         return [NSString stringWithFormat:@"<%@: %@>", NSStringFromClass([self class]), [self keyCombo]];
21 }
22
23 - (void)setKeyCombo:(ITKeyCombo *)combo {
24         [mKeyCombo autorelease];
25         mKeyCombo = [combo retain];
26 }
27
28 - (ITKeyCombo *)keyCombo {
29         return mKeyCombo;
30 }
31
32 - (void)setName:(NSString *)name {
33         [mName autorelease];
34         mName = [name retain];
35 }
36
37 - (NSString *)name {
38         return mName;
39 }
40
41 - (void)setTarget:(id)target {
42         mTarget = target;
43 }
44
45 - (id)target {
46         return mTarget;
47 }
48
49 - (void)setAction:(SEL)action {
50         mAction = action;
51 }
52
53 - (SEL)action {
54         return mAction;
55 }
56
57 - (void)invoke {
58         [mTarget performSelector:mAction withObject:self];
59 }
60
61 @end