Mercurial > projects > doodle
annotate doodle/dia/page_layer.d @ 28:1754cb773d41
Part-way through getting to compile with configure/builder.
author | Graham St Jack <graham.stjack@internode.on.net> |
---|---|
date | Sun, 02 Aug 2009 16:27:21 +0930 |
parents | dia/page_layer.d@06c30d250c0a |
children | 188397ef9a12 |
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.page_layer; |
17 | 2 |
3 private { | |
28
1754cb773d41
Part-way through getting to compile with configure/builder.
Graham St Jack <graham.stjack@internode.on.net>
parents:
26
diff
changeset
|
4 import doodle.cairo.routines; |
17 | 5 } |
6 | |
7 public { | |
28
1754cb773d41
Part-way through getting to compile with configure/builder.
Graham St Jack <graham.stjack@internode.on.net>
parents:
26
diff
changeset
|
8 import doodle.dia.icanvas; |
17 | 9 } |
10 | 10 |
11 interface Page { | |
12 } | |
13 | |
14 class PageLayer : Layer, Page { | |
12 | 15 this(in string name) { |
16 super(name); | |
16
9e63308b749c
* Fix up public/private includes
David Bryant <daveb@acres.com.au>
parents:
12
diff
changeset
|
17 mPageGeometry = Rectangle(Point.DEFAULT, Vector(210.0, 297.0)); |
9e63308b749c
* Fix up public/private includes
David Bryant <daveb@acres.com.au>
parents:
12
diff
changeset
|
18 //mPageGeometry = Rectangle(Point.DEFAULT, Vector(100.0, 100.0)); |
11 | 19 } |
20 | |
21 override Rectangle bounds() const { | |
22 return mPageGeometry; | |
23 } | |
24 | |
26 | 25 override void draw(in Viewport viewport, |
19 | 26 in Rectangle pixel_damage, scope Context pixel_cr, |
27 in Rectangle model_damage, scope Context model_cr) const { | |
10 | 28 // Make the paper white, with a border |
29 | |
18 | 30 model_cr.save; { |
31 model_cr.setSourceRgba(1.0, 1.0, 1.0, 1.0); | |
32 rectangle(model_cr, mPageGeometry); | |
33 model_cr.fill; | |
34 } model_cr.restore; | |
12 | 35 |
18 | 36 model_cr.save; { |
37 model_cr.setSourceRgba(0.0, 0.0, 0.0, 1.0); | |
38 rectangle(model_cr, mPageGeometry); | |
39 model_cr.stroke; | |
40 } model_cr.restore; | |
10 | 41 } |
42 | |
43 private { | |
11 | 44 Rectangle mPageGeometry; |
10 | 45 } |
46 } |