Subversion Repositories Kolibri OS

Rev

Rev 7257 | Rev 7260 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7257 Rev 7259
Line 11... Line 11...
11
	void (*onCanvasDraw)();
11
	void (*onCanvasDraw)();
12
};
12
};
Line 13... Line 13...
13
 
13
 
14
int previousTool = -1;
14
int previousTool = -1;
15
int currentTool = -1;
15
int currentTool = -1;
Line 16... Line 16...
16
Tool tools[6];
16
Tool tools[7];
17
 
17
 
18
enum {
18
enum {
19
	TOOL_NONE = -1,
19
	TOOL_NONE = -1,
20
	TOOL_PENCIL,
20
	TOOL_PENCIL,
21
	TOOL_PIPETTE,
21
	TOOL_PIPETTE,
22
	TOOL_FILL,
22
	TOOL_FILL,
-
 
23
	TOOL_LINE,
23
	TOOL_LINE,
24
	TOOL_RECT,
24
	TOOL_RECT,
25
	TOOL_BAR,
25
	TOOL_SELECT
26
	TOOL_SELECT
26
};
27
};
27
#include "tools/pencil.h";
28
#include "tools/pencil.h";
Line 31... Line 32...
31
#include "tools/simple_figure.h";
32
#include "tools/simple_figure.h";
Line 32... Line 33...
32
 
33
 
33
 
34
 
34
void initTools() 
35
void initTools() 
35
{
36
{
36
	tools[0].id = TOOL_PENCIL;
37
	tools[TOOL_PENCIL].id = TOOL_PENCIL;
37
	tools[0].onMouseEvent = #PencilTool_onMouseEvent;
38
	tools[TOOL_PENCIL].onMouseEvent = #PencilTool_onMouseEvent;
38
	tools[0].deactivate = #PencilTool_reset;
39
	tools[TOOL_PENCIL].deactivate = #PencilTool_reset;
39
	
40
	
40
	tools[1].id = TOOL_PIPETTE;
41
	tools[TOOL_PIPETTE].id = TOOL_PIPETTE;
41
	tools[1].activate = #PipetteTool_activate;
42
	tools[TOOL_PIPETTE].activate = #PipetteTool_activate;
42
	tools[1].onMouseEvent = #PipetteTool_onMouseEvent;
43
	tools[TOOL_PIPETTE].onMouseEvent = #PipetteTool_onMouseEvent;
43
	
44
	
44
	tools[2].id = TOOL_FILL;
45
	tools[TOOL_FILL].id = TOOL_FILL;
45
	tools[2].onMouseEvent = #FillTool_onMouseEvent;
46
	tools[TOOL_FILL].onMouseEvent = #FillTool_onMouseEvent;
46
	
47
	
47
	tools[3].id = TOOL_LINE;
48
	tools[TOOL_LINE].id = TOOL_LINE;
48
	tools[3].activate = #SimpleFigureTool_Reset;
49
	tools[TOOL_LINE].activate = #SimpleFigureTool_Reset;
49
	tools[3].deactivate = #SimpleFigureTool_Reset;
50
	tools[TOOL_LINE].deactivate = #SimpleFigureTool_Reset;
50
	tools[3].onMouseEvent = #SimpleFigureTool_onMouseEvent;
51
	tools[TOOL_LINE].onMouseEvent = #SimpleFigureTool_onMouseEvent;
51
	tools[3].onCanvasDraw = #SimpleFigureTool_onCanvasDraw;
52
	tools[TOOL_LINE].onCanvasDraw = #SimpleFigureTool_onCanvasDraw;
-
 
53
	
-
 
54
	tools[TOOL_RECT].id = TOOL_RECT;
-
 
55
	tools[TOOL_RECT].activate = #SimpleFigureTool_Reset;
-
 
56
	tools[TOOL_RECT].deactivate = #SimpleFigureTool_Reset;
-
 
57
	tools[TOOL_RECT].onMouseEvent = #SimpleFigureTool_onMouseEvent;
-
 
58
	tools[TOOL_RECT].onCanvasDraw = #SimpleFigureTool_onCanvasDraw;	
52
	
59
 
53
	tools[4].id = TOOL_RECT;
60
	tools[TOOL_BAR].id = TOOL_BAR;
54
	tools[4].activate = #SimpleFigureTool_Reset;
61
	tools[TOOL_BAR].activate = #SimpleFigureTool_Reset;
55
	tools[4].deactivate = #SimpleFigureTool_Reset;
62
	tools[TOOL_BAR].deactivate = #SimpleFigureTool_Reset;
56
	tools[4].onMouseEvent = #SimpleFigureTool_onMouseEvent;
63
	tools[TOOL_BAR].onMouseEvent = #SimpleFigureTool_onMouseEvent;
57
	tools[4].onCanvasDraw = #SimpleFigureTool_onCanvasDraw;	
64
	tools[TOOL_BAR].onCanvasDraw = #SimpleFigureTool_onCanvasDraw;	
58
 
65
 
59
	tools[5].id = TOOL_SELECT;
66
	tools[TOOL_SELECT].id = TOOL_SELECT;
60
	tools[5].activate = #SelectTool_activate;
67
	tools[TOOL_SELECT].activate = #SelectTool_activate;
61
	tools[5].deactivate = #SelectTool_deactivate;
68
	tools[TOOL_SELECT].deactivate = #SelectTool_deactivate;
62
	tools[5].onMouseEvent = #SelectTool_onMouseEvent;
69
	tools[TOOL_SELECT].onMouseEvent = #SelectTool_onMouseEvent;
63
	tools[5].onCanvasDraw = #SelectTool_onCanvasDraw;	
70
	tools[TOOL_SELECT].onCanvasDraw = #SelectTool_onCanvasDraw;	
Line 64... Line 71...
64
	tools[5].onKeyEvent = #SelectTool_onKeyEvent;	
71
	tools[TOOL_SELECT].onKeyEvent = #SelectTool_onKeyEvent;	
65
}
72
}
Line 83... Line 90...
83
 
90
 
84
	DrawLeftPanel();
91
	DrawLeftPanel();
85
	DrawCanvas();
92
	DrawCanvas();
Line 86... Line -...
86
}
-
 
87
 
-
 
88
//===================================================//
-
 
89
//                                                   //
-
 
90
//                    FUNTIONS                       //
-
 
91
//                                                   //
-