Mercurial > projects > doodle
annotate doodle/dia/page_layer.d @ 41:f2e4e1d29b98
Bah
author | daveb |
---|---|
date | Tue, 01 Jun 2010 17:21:01 +0930 |
parents | 188397ef9a12 |
children | 1b4c9ba58673 |
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 public { | |
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.dia.icanvas; |
17 | 5 } |
10 | 6 |
36 | 7 private { |
8 import doodle.cairo.routines; | |
10 | 9 } |
10 | |
11 class PageLayer : Layer, Page { | |
12 | 12 this(in string name) { |
13 super(name); | |
16
9e63308b749c
* Fix up public/private includes
David Bryant <daveb@acres.com.au>
parents:
12
diff
changeset
|
14 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
|
15 //mPageGeometry = Rectangle(Point.DEFAULT, Vector(100.0, 100.0)); |
11 | 16 } |
17 | |
36 | 18 // Layer overrides: |
19 | |
11 | 20 override Rectangle bounds() const { |
21 return mPageGeometry; | |
22 } | |
23 | |
26 | 24 override void draw(in Viewport viewport, |
19 | 25 in Rectangle pixel_damage, scope Context pixel_cr, |
26 in Rectangle model_damage, scope Context model_cr) const { | |
10 | 27 // Make the paper white, with a border |
28 | |
18 | 29 model_cr.save; { |
41 | 30 model_cr.setSourceRgba(0.0, 0.0, 0.0, 1.0); |
31 rectangle(model_cr, mPageGeometry); | |
32 model_cr.stroke; | |
33 } model_cr.restore; | |
34 | |
35 model_cr.save; { | |
18 | 36 model_cr.setSourceRgba(1.0, 1.0, 1.0, 1.0); |
37 rectangle(model_cr, mPageGeometry); | |
38 model_cr.fill; | |
39 } model_cr.restore; | |
10 | 40 } |
41 | |
36 | 42 // Page overrides: |
43 | |
10 | 44 private { |
11 | 45 Rectangle mPageGeometry; |
10 | 46 } |
47 } |