-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDeviceTracker.h
executable file
·60 lines (50 loc) · 2.12 KB
/
DeviceTracker.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/*----------------------------------------------------------------------------
FILE NAME
DeviceTracker.h - Header file for the DeviceTracker and Transducer classes.
Note: Basically, these classes provide a way for the user
to assign a specific color to each pen (if the pen
supports unique serial numbers). Then, to change colors,
the user literally just uses a different pen on the
tablet. The program will automatically change the
forground color to the last color used by that pen.
This concept could be extended to any other kind of
preference such as brush type, tool type, privlages etc.
One wacky idea is that when a manger uses his/her
personal pen, additional options are unlocked.
It is not done in this sample code, but the data stored
by the DeviceTracker could be saved to NSUserPreferences
and reloaded at app start. Then the app would remember
brush color across launches!
Transducer - This class stores the color preferences for
a specific transducer.
DeviceTracker - This class manages a collection of Transducer
objects. It makes sure that it each transducer
in it's collection has a unique ID.
It also has a cocpet of the "current"
transducer object being used.
COPYRIGHT
Author Project Builder
Copyright WACOM Technology, Inc. 2004-2005.
All rights reserved.
----------------------------------------------------------------------------*/
#import <Cocoa/Cocoa.h>
@interface Transducer : NSObject {
UInt64 ident;
NSColor *mColor;
}
-(Transducer *) initWithIdent:(UInt64)newIdent color:(NSColor *) newColor;
-(UInt64) ident;
-(NSColor *) color;
-(void) setColor:(NSColor *) newColor;
@end
@interface DeviceTracker : NSObject {
Transducer *currentDevice;
NSMutableArray *deviceList;
UInt16 currentDeviceEventID;
}
-(BOOL) setCurrentDeviceByID:(UInt64) deviceIdent;
-(Transducer *) currentDevice;
-(UInt16) currentDeviceEventID;
-(void) setCurrentDeviceEventID:(UInt16) newEventID;
-(void) addDevice:(Transducer *) newDevice;
@end