1 /* PXToolSwitcher */
2 
3 #import <Foundation/NSObject.h>
4 #import <AppKit/NSNibDeclarations.h>
5 
6 @class PXTool;
7 @class NSString;
8 @class NSColor;
9 @class NSColorWell;
10 @class NSImage;
11 
12 extern NSString * PXToolDidChangeNotificationName;
13 
14 typedef enum {
15   PXPencilToolTag = 0,
16   PXEraserToolTag,
17   PXEyedropperToolTag,
18   PXZoomToolTag,
19   PXFillToolTag,
20   PXLineToolTag,
21   PXRectangularSelectionToolTag,
22   PXMoveToolTag,
23   PXRectangleToolTag,
24   PXEllipseToolTag,
25   PXMagicWandToolTag,
26   PXLassoToolTag
27 } PXToolTag;
28 
29 
30 
31 @interface PXToolSwitcher : NSObject
32 {
33   id tools;
34   IBOutlet id toolsMatrix;
35   IBOutlet NSColorWell *colorWell;
36 @private
37   NSColor *_color;
38   PXTool *_tool;
39   PXTool *_lastTool;
40   BOOL _locked;
41 }
42 - (id) init;
43 - (id) tool;
44 
45 - (id) toolWithTag:(PXToolTag)tag;
46 - (PXToolTag)tagForTool:(id) aTool;
47 - (void)setIcon:(NSImage *) anImage forTool:(id)aTool;
48 
49 //Manage color/colorWell
50 - (NSColor*) color;
51 - (void)setColor:aColor;
52 
53 - (void)useTool:aTool;
54 - (void)useToolTagged:(PXToolTag)tag;
55 
56 //Actions methods
57 - (IBAction)toolClicked:(id)sender;
58 - (IBAction)colorChanged:(id)sender;
59 
60 //Events methods
61 - (void)keyDown:event;
62 - (void)optionKeyDown;
63 - (void)optionKeyUp;
64 - (void)shiftKeyDown;
65 - (void)shiftKeyUp;
66 
67 - (void)checkUserDefaults;
68 
69 - (void)requestToolChangeNotification;
70 
71 @end
72