comparison doodle/fig/diagram_elements.d @ 84:cdd4fc728d94

Renamed Drawable to Renderer
author daveb
date Mon, 16 Aug 2010 17:23:09 +0930
parents b759414d2b72
children 66210d8ea37a
comparison
equal deleted inserted replaced
83:06b4504cbcb0 84:cdd4fc728d94
1 module doodle.fig.diagram_elements; 1 module doodle.fig.diagram_elements;
2 2
3 private { 3 private {
4 import doodle.tk.geometry; 4 import doodle.tk.geometry;
5 import doodle.tk.drawable; 5 import doodle.tk.renderer;
6 } 6 }
7 7
8 interface IDiagram { 8 interface IDiagram {
9 void add(DiagramElement element); 9 void add(DiagramElement element);
10 } 10 }
11 11
12 abstract class DiagramElement { 12 abstract class DiagramElement {
13 Rectangle bounds() const; 13 Rectangle bounds() const;
14 14
15 void draw(in Rectangle damage, scope Drawable cr) const; 15 void draw(in Rectangle damage, scope Renderer cr) const;
16 16
17 private { 17 private {
18 //GraphElement _container; // FIXME use an interface to the container 18 //GraphElement _container; // FIXME use an interface to the container
19 } 19 }
20 } 20 }
62 } 62 }
63 } 63 }
64 */ 64 */
65 65
66 final class RectanglePrimitive : GraphicPrimitive { 66 final class RectanglePrimitive : GraphicPrimitive {
67 override void draw(in Rectangle damage, scope Drawable drawable) const { 67 override void draw(in Rectangle damage, scope Renderer drawable) const {
68 drawable.drawRectangle(bounds, false); 68 drawable.drawRectangle(bounds, false);
69 } 69 }
70 70
71 override Rectangle bounds() const { return _bounds; } 71 override Rectangle bounds() const { return _bounds; }
72 72