Mercurial > projects > doodle
comparison dia/page_layer.d @ 22:17c2df87b459
Package refactoring.
author | "David Bryant <bagnose@gmail.com>" |
---|---|
date | Wed, 15 Jul 2009 23:31:29 +0930 |
parents | page_layer.d@22abbf4cde96 |
children | a24c13bb9c98 |
comparison
equal
deleted
inserted
replaced
21:993ac3a183c8 | 22:17c2df87b459 |
---|---|
1 module dia.page_layer; | |
2 | |
3 private { | |
4 import cairo_support; | |
5 } | |
6 | |
7 public { | |
8 import icanvas; | |
9 } | |
10 | |
11 interface Page { | |
12 } | |
13 | |
14 class PageLayer : Layer, Page { | |
15 this(in string name) { | |
16 super(name); | |
17 mPageGeometry = Rectangle(Point.DEFAULT, Vector(210.0, 297.0)); | |
18 //mPageGeometry = Rectangle(Point.DEFAULT, Vector(100.0, 100.0)); | |
19 } | |
20 | |
21 override Rectangle bounds() const { | |
22 return mPageGeometry; | |
23 } | |
24 | |
25 override void draw(const Viewport viewport, | |
26 in Rectangle pixel_damage, scope Context pixel_cr, | |
27 in Rectangle model_damage, scope Context model_cr) const { | |
28 // Make the paper white, with a border | |
29 | |
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; | |
35 | |
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; | |
41 } | |
42 | |
43 private { | |
44 Rectangle mPageGeometry; | |
45 } | |
46 } |