Mercurial > projects > doodle
annotate dia/page_layer.d @ 26:06c30d250c0a
Cleanup
author | "David Bryant <bagnose@gmail.com>" |
---|---|
date | Thu, 16 Jul 2009 00:12:02 +0930 |
parents | a24c13bb9c98 |
children |
rev | line source |
---|---|
22 | 1 module dia.page_layer; |
17 | 2 |
3 private { | |
24 | 4 import cairo.routines; |
17 | 5 } |
6 | |
7 public { | |
24 | 8 import 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 } |