Mercurial > projects > doodle
annotate doodle/dia/tool.d @ 132:bc5baa585b32
Updated to dmd 2.060
author | David Bryant <bagnose@gmail.com> |
---|---|
date | Thu, 02 Aug 2012 15:32:43 +0930 |
parents | dcd641209671 |
children |
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 | 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 |
97 | 9 // |
10 | |
16
9e63308b749c
* Fix up public/private includes
David Bryant <daveb@acres.com.au>
parents:
10
diff
changeset
|
11 abstract class Tool { |
58
c63719604adb
Beginnings of creating a rectangle...
"David Bryant <bagnose@gmail.com>"
parents:
57
diff
changeset
|
12 this (in string name) { |
c63719604adb
Beginnings of creating a rectangle...
"David Bryant <bagnose@gmail.com>"
parents:
57
diff
changeset
|
13 _name = name; |
c63719604adb
Beginnings of creating a rectangle...
"David Bryant <bagnose@gmail.com>"
parents:
57
diff
changeset
|
14 } |
17 | 15 |
132 | 16 @property string name() const { return _name; } |
16
9e63308b749c
* Fix up public/private includes
David Bryant <daveb@acres.com.au>
parents:
10
diff
changeset
|
17 |
57 | 18 bool handleButtonPress(scope IViewport viewport, in ButtonEvent event) { return false; } |
19 bool handleButtonRelease(scope IViewport viewport, in ButtonEvent event) { return false; } | |
20 bool handleMotion(scope IViewport viewport, in MotionEvent event) { return false; } | |
21 bool handleScroll(scope IViewport viewport, in ScrollEvent event) { return false; } | |
92 | 22 bool handleEnter(scope IViewport viewport, in CrossingEvent event) { return false; } |
23 bool handleLeave(scope IViewport viewport, in CrossingEvent event) { return false; } | |
57 | 24 bool handleKeyPress(scope IViewport viewport, in KeyEvent event) { return false; } |
25 bool handleKeyRelease(scope IViewport viewport, in KeyEvent event) { return false; } | |
64
eb5436b47d13
Implemented crossing events
"David Bryant <bagnose@gmail.com>"
parents:
58
diff
changeset
|
26 //bool handleFocusIn(scope IViewport viewport, FocusEvent event) { return false; } |
eb5436b47d13
Implemented crossing events
"David Bryant <bagnose@gmail.com>"
parents:
58
diff
changeset
|
27 //bool handleFocusOut(scope IViewport viewport, FocusEvent event) { return false; } |
16
9e63308b749c
* Fix up public/private includes
David Bryant <daveb@acres.com.au>
parents:
10
diff
changeset
|
28 |
84 | 29 void draw(in Rectangle screenDamage, scope Renderer screenRenderer) const { } |
58
c63719604adb
Beginnings of creating a rectangle...
"David Bryant <bagnose@gmail.com>"
parents:
57
diff
changeset
|
30 |
c63719604adb
Beginnings of creating a rectangle...
"David Bryant <bagnose@gmail.com>"
parents:
57
diff
changeset
|
31 private { |
c63719604adb
Beginnings of creating a rectangle...
"David Bryant <bagnose@gmail.com>"
parents:
57
diff
changeset
|
32 immutable string _name; |
c63719604adb
Beginnings of creating a rectangle...
"David Bryant <bagnose@gmail.com>"
parents:
57
diff
changeset
|
33 } |
2
d6f44347373d
* Switched over to geometry done with structs instead of classes.
David Bryant <daveb@acres.com.au>
parents:
diff
changeset
|
34 } |