annotate doodle/dia/tool.d @ 28:1754cb773d41

Part-way through getting to compile with configure/builder.
author Graham St Jack <graham.stjack@internode.on.net>
date Sun, 02 Aug 2009 16:27:21 +0930
parents dia/tool.d@06c30d250c0a
children 1b4c9ba58673
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
28
1754cb773d41 Part-way through getting to compile with configure/builder.
Graham St Jack <graham.stjack@internode.on.net>
parents: 26
diff changeset
1 module doodle.dia.tool;
2
d6f44347373d * Switched over to geometry done with structs instead of classes.
David Bryant <daveb@acres.com.au>
parents:
diff changeset
2
16
9e63308b749c * Fix up public/private includes
David Bryant <daveb@acres.com.au>
parents: 10
diff changeset
3 public {
24
a24c13bb9c98 Builds again.
"David Bryant <bagnose@gmail.com>"
parents: 22
diff changeset
4 import cairo.Context;
28
1754cb773d41 Part-way through getting to compile with configure/builder.
Graham St Jack <graham.stjack@internode.on.net>
parents: 26
diff changeset
5 import doodle.dia.icanvas;
1754cb773d41 Part-way through getting to compile with configure/builder.
Graham St Jack <graham.stjack@internode.on.net>
parents: 26
diff changeset
6 import doodle.tk.events;
16
9e63308b749c * Fix up public/private includes
David Bryant <daveb@acres.com.au>
parents: 10
diff changeset
7 }
2
d6f44347373d * Switched over to geometry done with structs instead of classes.
David Bryant <daveb@acres.com.au>
parents:
diff changeset
8
7
936feb16eed4 Checkpoint
"David Bryant <bagnose@gmail.com>"
parents: 2
diff changeset
9 /*
2
d6f44347373d * Switched over to geometry done with structs instead of classes.
David Bryant <daveb@acres.com.au>
parents:
diff changeset
10 interface IToolStack {
d6f44347373d * Switched over to geometry done with structs instead of classes.
David Bryant <daveb@acres.com.au>
parents:
diff changeset
11 void push(Tool tool);
d6f44347373d * Switched over to geometry done with structs instead of classes.
David Bryant <daveb@acres.com.au>
parents:
diff changeset
12 void pop();
d6f44347373d * Switched over to geometry done with structs instead of classes.
David Bryant <daveb@acres.com.au>
parents:
diff changeset
13 void replace(Tool tool);
d6f44347373d * Switched over to geometry done with structs instead of classes.
David Bryant <daveb@acres.com.au>
parents:
diff changeset
14 }
7
936feb16eed4 Checkpoint
"David Bryant <bagnose@gmail.com>"
parents: 2
diff changeset
15 */
2
d6f44347373d * Switched over to geometry done with structs instead of classes.
David Bryant <daveb@acres.com.au>
parents:
diff changeset
16
16
9e63308b749c * Fix up public/private includes
David Bryant <daveb@acres.com.au>
parents: 10
diff changeset
17 abstract class Tool {
2
d6f44347373d * Switched over to geometry done with structs instead of classes.
David Bryant <daveb@acres.com.au>
parents:
diff changeset
18 /*
17
c643c04e3f5e Checkpoint
David Bryant <daveb@acres.com.au>
parents: 16
diff changeset
19 enum Response {
c643c04e3f5e Checkpoint
David Bryant <daveb@acres.com.au>
parents: 16
diff changeset
20 START, CONTINUE, FINISH
c643c04e3f5e Checkpoint
David Bryant <daveb@acres.com.au>
parents: 16
diff changeset
21
c643c04e3f5e Checkpoint
David Bryant <daveb@acres.com.au>
parents: 16
diff changeset
22 }
c643c04e3f5e Checkpoint
David Bryant <daveb@acres.com.au>
parents: 16
diff changeset
23 */
c643c04e3f5e Checkpoint
David Bryant <daveb@acres.com.au>
parents: 16
diff changeset
24
c643c04e3f5e Checkpoint
David Bryant <daveb@acres.com.au>
parents: 16
diff changeset
25 /*
2
d6f44347373d * Switched over to geometry done with structs instead of classes.
David Bryant <daveb@acres.com.au>
parents:
diff changeset
26 abstract bool is_sticky();
d6f44347373d * Switched over to geometry done with structs instead of classes.
David Bryant <daveb@acres.com.au>
parents:
diff changeset
27 abstract bool is_replaceable();
d6f44347373d * Switched over to geometry done with structs instead of classes.
David Bryant <daveb@acres.com.au>
parents:
diff changeset
28 */
d6f44347373d * Switched over to geometry done with structs instead of classes.
David Bryant <daveb@acres.com.au>
parents:
diff changeset
29
7
936feb16eed4 Checkpoint
"David Bryant <bagnose@gmail.com>"
parents: 2
diff changeset
30 /*
2
d6f44347373d * Switched over to geometry done with structs instead of classes.
David Bryant <daveb@acres.com.au>
parents:
diff changeset
31 abstract void start(IToolStack tool_stack);
d6f44347373d * Switched over to geometry done with structs instead of classes.
David Bryant <daveb@acres.com.au>
parents:
diff changeset
32 abstract void stop(IToolStack tool_stack);
7
936feb16eed4 Checkpoint
"David Bryant <bagnose@gmail.com>"
parents: 2
diff changeset
33 */
16
9e63308b749c * Fix up public/private includes
David Bryant <daveb@acres.com.au>
parents: 10
diff changeset
34
26
06c30d250c0a Cleanup
"David Bryant <bagnose@gmail.com>"
parents: 24
diff changeset
35 bool handle_button_press(scope Viewport viewport, in ButtonEvent event) { return false; }
06c30d250c0a Cleanup
"David Bryant <bagnose@gmail.com>"
parents: 24
diff changeset
36 bool handle_button_release(scope Viewport viewport, in ButtonEvent event) { return false; }
06c30d250c0a Cleanup
"David Bryant <bagnose@gmail.com>"
parents: 24
diff changeset
37 bool handle_motion(scope Viewport viewport, in MotionEvent event) { return false; }
06c30d250c0a Cleanup
"David Bryant <bagnose@gmail.com>"
parents: 24
diff changeset
38 bool handle_scroll(scope Viewport viewport, in ScrollEvent event) { return false; }
06c30d250c0a Cleanup
"David Bryant <bagnose@gmail.com>"
parents: 24
diff changeset
39 //bool handle_enter(scope viewport, CrossingEvent event) { return false; }
06c30d250c0a Cleanup
"David Bryant <bagnose@gmail.com>"
parents: 24
diff changeset
40 //bool handle_leave(scope viewport, CrossingEvent event) { return false; }
06c30d250c0a Cleanup
"David Bryant <bagnose@gmail.com>"
parents: 24
diff changeset
41 //bool handle_focus_in(scope viewport, FocusEvent event) { return false; }
06c30d250c0a Cleanup
"David Bryant <bagnose@gmail.com>"
parents: 24
diff changeset
42 //bool handle_focus_out(scope viewport, FocusEvent event) { return false; }
06c30d250c0a Cleanup
"David Bryant <bagnose@gmail.com>"
parents: 24
diff changeset
43 bool handle_key_press(scope Viewport viewport, in KeyEvent event) { return false; }
06c30d250c0a Cleanup
"David Bryant <bagnose@gmail.com>"
parents: 24
diff changeset
44 bool handle_key_release(scope Viewport viewport, in KeyEvent event) { return false; }
16
9e63308b749c * Fix up public/private includes
David Bryant <daveb@acres.com.au>
parents: 10
diff changeset
45
26
06c30d250c0a Cleanup
"David Bryant <bagnose@gmail.com>"
parents: 24
diff changeset
46 void draw(in Viewport viewport,
19
22abbf4cde96 Checkpoint
"David Bryant <bagnose@gmail.com>"
parents: 18
diff changeset
47 in Rectangle pixel_damage, scope Context pixel_cr,
22abbf4cde96 Checkpoint
"David Bryant <bagnose@gmail.com>"
parents: 18
diff changeset
48 in Rectangle model_damage, scope Context model_cr) const { }
2
d6f44347373d * Switched over to geometry done with structs instead of classes.
David Bryant <daveb@acres.com.au>
parents:
diff changeset
49 }