Mercurial > projects > doodle
comparison doodle/tk/renderer.d @ 84:cdd4fc728d94
Renamed Drawable to Renderer
author | daveb |
---|---|
date | Mon, 16 Aug 2010 17:23:09 +0930 |
parents | doodle/tk/drawable.d@b759414d2b72 |
children |
comparison
equal
deleted
inserted
replaced
83:06b4504cbcb0 | 84:cdd4fc728d94 |
---|---|
1 module doodle.tk.renderer; | |
2 | |
3 public { | |
4 import doodle.tk.geometry; | |
5 import doodle.tk.color; | |
6 } | |
7 | |
8 interface Renderer { | |
9 enum LineStyle { | |
10 SOLID, | |
11 DASHED, | |
12 DOTTED | |
13 } | |
14 | |
15 enum FontFace { | |
16 NORMAL | |
17 } | |
18 | |
19 // Low-level state manipulation | |
20 | |
21 void setLineStyle(LineStyle style); | |
22 void setLineWidth(in double width); | |
23 void setColor(in Color color); | |
24 | |
25 void translate(in Point p); | |
26 void scale(in double s); | |
27 | |
28 void pushState(); // Copies all of current state | |
29 void popState(); // Restores all of previous state | |
30 | |
31 // High-level drawing routines | |
32 | |
33 void drawRectangle(in Rectangle rectangle, bool fill); | |
34 void drawEllipse(in Rectangle rectangle, bool fill); | |
35 void drawSegment(in Segment segment); | |
36 void drawHLine(in double y, in double x0, in double x1); | |
37 void drawVLine(in double x, in double y0, in double y1); | |
38 void drawPoly(in Point[] points, bool fill); | |
39 | |
40 // Text routines | |
41 | |
42 void setFontFace(in FontFace face); | |
43 void setFontSize(in double size); | |
44 void drawText(in string text); | |
45 | |
46 void measureText(in string text, out Rectangle logicalBounds, out Rectangle totalBounds) const; | |
47 } |