annotate doodle/tk/cairo.d @ 73:6f2525e170f2

Cairo/OpenGL checkpoint
author "David Bryant <bagnose@gmail.com>"
date Sun, 15 Aug 2010 01:02:15 +0930
parents doodle/cairo/routines.d@43cc2135ced0
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
73
6f2525e170f2 Cairo/OpenGL checkpoint
"David Bryant <bagnose@gmail.com>"
parents: 66
diff changeset
1 module doodle.tk.cairo;
6f2525e170f2 Cairo/OpenGL checkpoint
"David Bryant <bagnose@gmail.com>"
parents: 66
diff changeset
2
6f2525e170f2 Cairo/OpenGL checkpoint
"David Bryant <bagnose@gmail.com>"
parents: 66
diff changeset
3 // THIS module is deprecated
2
d6f44347373d * Switched over to geometry done with structs instead of classes.
David Bryant <daveb@acres.com.au>
parents:
diff changeset
4
16
9e63308b749c * Fix up public/private includes
David Bryant <daveb@acres.com.au>
parents: 11
diff changeset
5 public {
28
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.geometry;
16
9e63308b749c * Fix up public/private includes
David Bryant <daveb@acres.com.au>
parents: 11
diff changeset
7 import cairo.Context;
9e63308b749c * Fix up public/private includes
David Bryant <daveb@acres.com.au>
parents: 11
diff changeset
8 }
2
d6f44347373d * Switched over to geometry done with structs instead of classes.
David Bryant <daveb@acres.com.au>
parents:
diff changeset
9
26
06c30d250c0a Cleanup
"David Bryant <bagnose@gmail.com>"
parents: 24
diff changeset
10 void rectangle(scope Context cr, in Rectangle rectangle) {
10
71ca82e0eb76 Checkpoint
"David Bryant <bagnose@gmail.com>"
parents: 3
diff changeset
11 cr.rectangle(rectangle.position.x, rectangle.position.y,
71ca82e0eb76 Checkpoint
"David Bryant <bagnose@gmail.com>"
parents: 3
diff changeset
12 rectangle.size.x, rectangle.size.y);
2
d6f44347373d * Switched over to geometry done with structs instead of classes.
David Bryant <daveb@acres.com.au>
parents:
diff changeset
13 }
35
3f6bb0bb22dc Beginnings of grid
David Bryant <bagnose@gmail.com>
parents: 28
diff changeset
14
3f6bb0bb22dc Beginnings of grid
David Bryant <bagnose@gmail.com>
parents: 28
diff changeset
15 void line(scope Context cr, in double x0, in double y0, in double x1, in double y1) {
3f6bb0bb22dc Beginnings of grid
David Bryant <bagnose@gmail.com>
parents: 28
diff changeset
16 cr.moveTo(x0, y0);
3f6bb0bb22dc Beginnings of grid
David Bryant <bagnose@gmail.com>
parents: 28
diff changeset
17 cr.lineTo(x1, y1);
3f6bb0bb22dc Beginnings of grid
David Bryant <bagnose@gmail.com>
parents: 28
diff changeset
18 }
38
452915ecd1f4 Basic logging functionality
David Bryant <bagnose@gmail.com>
parents: 35
diff changeset
19
452915ecd1f4 Basic logging functionality
David Bryant <bagnose@gmail.com>
parents: 35
diff changeset
20 // Horizontal line
452915ecd1f4 Basic logging functionality
David Bryant <bagnose@gmail.com>
parents: 35
diff changeset
21 void hline(scope Context cr, in double y, double x0, double x1) {
452915ecd1f4 Basic logging functionality
David Bryant <bagnose@gmail.com>
parents: 35
diff changeset
22 cr.moveTo(x0, y);
452915ecd1f4 Basic logging functionality
David Bryant <bagnose@gmail.com>
parents: 35
diff changeset
23 cr.lineTo(x1, y);
452915ecd1f4 Basic logging functionality
David Bryant <bagnose@gmail.com>
parents: 35
diff changeset
24 }
452915ecd1f4 Basic logging functionality
David Bryant <bagnose@gmail.com>
parents: 35
diff changeset
25
452915ecd1f4 Basic logging functionality
David Bryant <bagnose@gmail.com>
parents: 35
diff changeset
26 // Vertical line
452915ecd1f4 Basic logging functionality
David Bryant <bagnose@gmail.com>
parents: 35
diff changeset
27 void vline(scope Context cr, in double x, double y0, double y1) {
452915ecd1f4 Basic logging functionality
David Bryant <bagnose@gmail.com>
parents: 35
diff changeset
28 cr.moveTo(x, y0);
452915ecd1f4 Basic logging functionality
David Bryant <bagnose@gmail.com>
parents: 35
diff changeset
29 cr.lineTo(x, y1);
452915ecd1f4 Basic logging functionality
David Bryant <bagnose@gmail.com>
parents: 35
diff changeset
30 }