comparison doodle/tk/drawing.d @ 73:6f2525e170f2

Cairo/OpenGL checkpoint
author "David Bryant <bagnose@gmail.com>"
date Sun, 15 Aug 2010 01:02:15 +0930
parents
children 78bc2046256e
comparison
equal deleted inserted replaced
72:5cc2de64f6d0 73:6f2525e170f2
1 module doodle.tk.drawing;
2
3 public {
4 import doodle.tk.geometry;
5 }
6
7 interface Drawing {
8 enum LineStyle {
9 SOLID,
10 DASHED,
11 DOTTED
12 }
13
14 void setLineStyle(LineStyle style);
15 void setLineThickness(in double thickness);
16 //void setLineColor(in Color color);
17 //void setFillColor(in Color color);
18
19 void drawRectangle(in Rectangle rectangle, bool fill);
20 void drawEllipse(in Rectangle rectangle, bool fill);
21 void drawSegment(in Segment segment);
22 void drawHLine(in double y0, in double x0, in double x1);
23 void drawVLine(in double x0, in double y0, in double y1);
24 void drawPoly(in Point[] points, bool fill);
25
26 void pushState(); // Copies all of current state
27 void popState(); // Restores all of previous state
28
29 void translate(in Vector v);
30 void translate(in Point p);
31 void scale(in Vector v);
32 void zoom(in double z);
33
34 //void setFontFace;
35 //void setFontSize;
36 void drawText(in string text);
37
38 // How to fit fonts, metrics, etc in here?
39 }