Mercurial > projects > doodle
annotate canvas.d @ 2:d6f44347373d
* Switched over to geometry done with structs instead of classes.
* Removed direct access to gtk structs
* Refactoring
author | David Bryant <daveb@acres.com.au> |
---|---|
date | Fri, 10 Jul 2009 15:15:27 +0930 |
parents | e907d2c54ec3 |
children | 7d57cae10805 |
rev | line source |
---|---|
0 | 1 module canvas; |
2 | |
3 import std.stdio; | |
4 import std.math; | |
5 | |
6 import cairo.Context; | |
7 import cairo.Surface; | |
8 | |
9 import gdk.Drawable; | |
10 | |
11 import gtk.Widget; | |
12 import gtk.Toolbar; | |
13 import gtk.Table; | |
14 import gtk.HRuler; | |
15 import gtk.VRuler; | |
16 import gtk.Range; | |
17 import gtk.HScrollbar; | |
18 import gtk.VScrollbar; | |
19 import gtk.DrawingArea; | |
20 import gtk.Adjustment; | |
21 | |
22 import tk.misc; | |
2
d6f44347373d
* Switched over to geometry done with structs instead of classes.
David Bryant <daveb@acres.com.au>
parents:
0
diff
changeset
|
23 import tk.geometry2; |
0 | 24 import tk.types; |
25 import tk.events; | |
26 import tk.gtk_support; | |
27 | |
28 private import gtkc.gtk; | |
29 | |
30 import icanvas; | |
2
d6f44347373d
* Switched over to geometry done with structs instead of classes.
David Bryant <daveb@acres.com.au>
parents:
0
diff
changeset
|
31 import cairo_support; |
0 | 32 |
33 // x and y run right and up respectively | |
34 | |
35 class Canvas : Table, ICanvas { | |
36 static this() { | |
2
d6f44347373d
* Switched over to geometry done with structs instead of classes.
David Bryant <daveb@acres.com.au>
parents:
0
diff
changeset
|
37 ORIGIN = Point2(0.0, 0.0); |
d6f44347373d
* Switched over to geometry done with structs instead of classes.
David Bryant <daveb@acres.com.au>
parents:
0
diff
changeset
|
38 INITIAL_PAGE_SIZE = Vector2(210.0, 297.0); // A4 |
0 | 39 } |
40 | |
41 this(ICanvasEventHandler event_handler) { | |
42 super(3, 3, 0); | |
43 | |
44 mEventHandler = event_handler; | |
45 | |
46 const double PPI = 120.0; | |
47 const double MM_PER_INCH = 25.4; | |
48 mZoom = 0.25 * PPI / MM_PER_INCH; | |
49 | |
2
d6f44347373d
* Switched over to geometry done with structs instead of classes.
David Bryant <daveb@acres.com.au>
parents:
0
diff
changeset
|
50 mPageLeftBottom = ORIGIN; |
0 | 51 mPageRightTop = ORIGIN + INITIAL_PAGE_SIZE; |
52 mViewCentre = ORIGIN + INITIAL_PAGE_SIZE / 2.0; | |
53 | |
54 mCanvasLeftBottom = mPageLeftBottom - 3.0 * INITIAL_PAGE_SIZE; | |
55 mCanvasRightTop = mPageRightTop + 3.0 * INITIAL_PAGE_SIZE; | |
56 | |
57 mHRuler = new HRuler(); | |
58 attach(mHRuler, | |
59 1, 2, | |
60 0, 1, | |
61 AttachOptions.FILL | AttachOptions.EXPAND, AttachOptions.SHRINK, | |
62 0, 0); | |
63 mHRuler.setMetric(GtkMetricType.CENTIMETERS); | |
64 | |
65 mVRuler = new VRuler(); | |
66 attach(mVRuler, | |
67 0, 1, | |
68 1, 2, | |
69 AttachOptions.SHRINK, AttachOptions.FILL | AttachOptions.EXPAND, | |
70 0, 0); | |
71 mVRuler.setMetric(GtkMetricType.CENTIMETERS); | |
72 | |
73 mDrawingArea = new DrawingArea(); | |
74 mDrawingArea.addOnRealize(&onRealize); | |
75 mDrawingArea.addOnConfigure(&onConfigure); | |
76 mDrawingArea.addOnExpose(&onExpose); | |
77 mDrawingArea.addOnButtonPress(&onButtonEvent); | |
78 mDrawingArea.addOnButtonRelease(&onButtonEvent); | |
79 mDrawingArea.addOnKeyPress(&onKeyEvent); | |
80 mDrawingArea.addOnKeyRelease(&onKeyEvent); | |
81 mDrawingArea.addOnMotionNotify(&onMotionNotify); | |
82 mDrawingArea.addOnScroll(&onScroll); | |
83 attach(mDrawingArea, | |
84 1, 2, | |
85 1, 2, | |
86 AttachOptions.FILL | AttachOptions.EXPAND, AttachOptions.FILL | AttachOptions.EXPAND, | |
87 0, 0); | |
88 | |
89 // value, lower, upper, step-inc, page-inc, page-size | |
90 // Give the adjustments dummy values until we receive a configure | |
2
d6f44347373d
* Switched over to geometry done with structs instead of classes.
David Bryant <daveb@acres.com.au>
parents:
0
diff
changeset
|
91 mHAdjustment = new Adjustment(0.25, 0.0, 1.0, 0.2, 0.5, 0.5); |
0 | 92 mHAdjustment.addOnValueChanged(&onValueChanged); |
93 mHScrollbar = new HScrollbar(mHAdjustment); | |
94 attach(mHScrollbar, | |
95 1, 2, | |
96 2, 3, | |
97 AttachOptions.FILL | AttachOptions.EXPAND, AttachOptions.SHRINK, | |
98 0, 0); | |
99 | |
2
d6f44347373d
* Switched over to geometry done with structs instead of classes.
David Bryant <daveb@acres.com.au>
parents:
0
diff
changeset
|
100 mVAdjustment = new Adjustment(0.0, 0.0, 1.0, 0.2, 0.5, 0.5); |
0 | 101 mVAdjustment.addOnValueChanged(&onValueChanged); |
102 mVScrollbar = new VScrollbar(mVAdjustment); | |
103 attach(mVScrollbar, | |
104 2, 3, | |
105 1, 2, | |
106 AttachOptions.SHRINK, | |
107 AttachOptions.FILL | AttachOptions.EXPAND, | |
108 0, 0); | |
109 } | |
110 | |
2
d6f44347373d
* Switched over to geometry done with structs instead of classes.
David Bryant <daveb@acres.com.au>
parents:
0
diff
changeset
|
111 override void rel_zoom(Point2 screen_datum, double factor) { |
0 | 112 // Work out pixel distance from current centre to datum, |
113 // Do the zoom, then work out the new centre that keeps the | |
114 // pixel distance the same | |
115 | |
2
d6f44347373d
* Switched over to geometry done with structs instead of classes.
David Bryant <daveb@acres.com.au>
parents:
0
diff
changeset
|
116 Point2 old_model_datum = screen_to_model(screen_datum); |
d6f44347373d
* Switched over to geometry done with structs instead of classes.
David Bryant <daveb@acres.com.au>
parents:
0
diff
changeset
|
117 Vector2 pixel_distance = model_to_screen(old_model_datum - mViewCentre); |
0 | 118 mZoom = clamp_zoom(factor * mZoom); |
119 mViewCentre = old_model_datum - screen_to_model(pixel_distance); | |
120 | |
2
d6f44347373d
* Switched over to geometry done with structs instead of classes.
David Bryant <daveb@acres.com.au>
parents:
0
diff
changeset
|
121 Point2 new_model_datum = screen_to_model(screen_datum); |
0 | 122 |
123 update_adjustments(); | |
124 //update_rulers(new_model_datum); | |
125 update_rulers(); | |
126 queueDraw(); | |
127 } | |
128 | |
2
d6f44347373d
* Switched over to geometry done with structs instead of classes.
David Bryant <daveb@acres.com.au>
parents:
0
diff
changeset
|
129 override void rel_pan(Vector2 screen_displacement) { |
0 | 130 mViewCentre = mViewCentre + screen_to_model(screen_displacement); |
131 | |
132 update_adjustments(); | |
133 update_rulers(); | |
134 queueDraw(); | |
135 } | |
136 | |
137 private { | |
138 | |
139 void onRealize(Widget widget) { | |
140 assert(widget is mDrawingArea); | |
141 //writefln("Got realize\n"); | |
142 } | |
143 | |
144 bool onConfigure(GdkEventConfigure * event, Widget widget) { | |
145 assert(widget is mDrawingArea); | |
146 | |
2
d6f44347373d
* Switched over to geometry done with structs instead of classes.
David Bryant <daveb@acres.com.au>
parents:
0
diff
changeset
|
147 mViewSize = Vector2(cast(double)event.width, cast(double)event.height); |
0 | 148 update_adjustments(); |
149 update_rulers(); | |
150 | |
151 | |
2
d6f44347373d
* Switched over to geometry done with structs instead of classes.
David Bryant <daveb@acres.com.au>
parents:
0
diff
changeset
|
152 return true; |
0 | 153 } |
154 | |
155 bool onExpose(GdkEventExpose * event, Widget widget) { | |
156 assert(widget is mDrawingArea); | |
157 | |
158 Drawable dr = mDrawingArea.getWindow(); | |
159 | |
160 int width, height; | |
161 dr.getSize(width, height); | |
162 //writefln("Got expose %dx%d\n", width, height); | |
163 | |
164 scope auto cr = new Context(dr); | |
165 | |
166 if (event) { | |
167 cr.rectangle(event.area.x, event.area.y, event.area.width, event.area.height); | |
168 cr.clip(); | |
169 } | |
170 | |
171 // Make the window light grey | |
172 cr.setSourceRgba(1.0, 1.0, 1.0, 0.7); | |
173 if (event) { | |
174 cr.rectangle(event.area.x, event.area.y, event.area.width, event.area.height); | |
175 } | |
176 else { | |
177 cr.rectangle(0.0, 0.0, width, height); | |
178 } | |
179 cr.fill(); | |
180 | |
181 { | |
182 // Make the paper white, with a border | |
183 | |
2
d6f44347373d
* Switched over to geometry done with structs instead of classes.
David Bryant <daveb@acres.com.au>
parents:
0
diff
changeset
|
184 Point2 screen_page_left_bottom = model_to_screen(mPageLeftBottom); |
d6f44347373d
* Switched over to geometry done with structs instead of classes.
David Bryant <daveb@acres.com.au>
parents:
0
diff
changeset
|
185 Point2 screen_page_right_top = model_to_screen(mPageRightTop); |
0 | 186 |
187 cr.setSourceRgba(1.0, 1.0, 1.0, 1.0); | |
188 rectangle(cr, screen_page_left_bottom, screen_page_right_top); | |
189 cr.fill(); | |
190 | |
191 cr.setSourceRgba(0.0, 0.0, 0.0, 1.0); | |
192 rectangle(cr, screen_page_left_bottom, screen_page_right_top); | |
193 cr.stroke(); | |
194 } | |
195 | |
2
d6f44347373d
* Switched over to geometry done with structs instead of classes.
David Bryant <daveb@acres.com.au>
parents:
0
diff
changeset
|
196 return true; |
0 | 197 } |
198 | |
199 bool onButtonEvent(GdkEventButton * event, Widget widget) { | |
200 assert(widget is mDrawingArea); | |
201 //writefln("Got button event\n"); | |
202 | |
2
d6f44347373d
* Switched over to geometry done with structs instead of classes.
David Bryant <daveb@acres.com.au>
parents:
0
diff
changeset
|
203 Point2 screen_point = Point2(event.x + 0.5, event.y + 0.5); |
d6f44347373d
* Switched over to geometry done with structs instead of classes.
David Bryant <daveb@acres.com.au>
parents:
0
diff
changeset
|
204 Point2 model_point = screen_to_model(screen_point); |
0 | 205 |
206 auto button_event = new ButtonEvent(gtk2tk_click(event.type), | |
207 gtk2tk_button(event.button), | |
208 screen_point, | |
209 model_point, | |
210 gtk2tk_mask(event.state)); | |
211 | |
212 //mEventHandle.handle_button_press | |
213 | |
2
d6f44347373d
* Switched over to geometry done with structs instead of classes.
David Bryant <daveb@acres.com.au>
parents:
0
diff
changeset
|
214 return true; |
0 | 215 } |
216 | |
217 bool onKeyEvent(GdkEventKey * event, Widget widget) { | |
218 assert(widget is mDrawingArea); | |
219 //writefln("Got key event\n"); | |
220 | |
221 //auto key_event = new KeyEvent("", | |
222 // mEventHandle.handle_key(key_event); | |
223 | |
2
d6f44347373d
* Switched over to geometry done with structs instead of classes.
David Bryant <daveb@acres.com.au>
parents:
0
diff
changeset
|
224 return true; |
0 | 225 } |
226 | |
227 bool onMotionNotify(GdkEventMotion * event, Widget widget) { | |
228 assert(widget is mDrawingArea); | |
229 //writefln("Got motion notify\n"); | |
230 gtk_widget_event(mHRuler.getWidgetStruct(), cast(GdkEvent *)event); | |
231 gtk_widget_event(mVRuler.getWidgetStruct(), cast(GdkEvent *)event); | |
232 | |
2
d6f44347373d
* Switched over to geometry done with structs instead of classes.
David Bryant <daveb@acres.com.au>
parents:
0
diff
changeset
|
233 Point2 screen_point = Point2(event.x + 0.5, event.y + 0.5); |
d6f44347373d
* Switched over to geometry done with structs instead of classes.
David Bryant <daveb@acres.com.au>
parents:
0
diff
changeset
|
234 Point2 model_point = screen_to_model(screen_point); |
0 | 235 |
236 auto motion_event = new MotionEvent(screen_point, | |
237 model_point, | |
238 gtk2tk_mask(event.state)); | |
239 | |
240 mEventHandler.handle_motion(this, motion_event); | |
241 | |
2
d6f44347373d
* Switched over to geometry done with structs instead of classes.
David Bryant <daveb@acres.com.au>
parents:
0
diff
changeset
|
242 return true; |
0 | 243 } |
244 | |
245 bool onScroll(GdkEventScroll * event, Widget widget) { | |
246 assert(widget is mDrawingArea); | |
247 //writefln("Got scroll\n"); | |
248 | |
2
d6f44347373d
* Switched over to geometry done with structs instead of classes.
David Bryant <daveb@acres.com.au>
parents:
0
diff
changeset
|
249 Point2 screen_point = Point2(event.x + 0.5, event.y + 0.5); |
d6f44347373d
* Switched over to geometry done with structs instead of classes.
David Bryant <daveb@acres.com.au>
parents:
0
diff
changeset
|
250 Point2 model_point = screen_to_model(screen_point); |
0 | 251 |
252 auto scroll_event = new ScrollEvent(gtk2tk_direction(event.direction), | |
253 screen_point, | |
254 model_point, | |
255 gtk2tk_mask(event.state)); | |
256 | |
257 mEventHandler.handle_scroll(this, scroll_event); | |
258 | |
2
d6f44347373d
* Switched over to geometry done with structs instead of classes.
David Bryant <daveb@acres.com.au>
parents:
0
diff
changeset
|
259 return true; |
0 | 260 } |
261 | |
262 void onValueChanged(Adjustment adjustment) { | |
263 GtkAdjustment * h_gtkAdjustment = mHAdjustment.getAdjustmentStruct(); | |
264 GtkAdjustment * v_gtkAdjustment = mVAdjustment.getAdjustmentStruct(); | |
265 | |
2
d6f44347373d
* Switched over to geometry done with structs instead of classes.
David Bryant <daveb@acres.com.au>
parents:
0
diff
changeset
|
266 Point2 view_left_bottom = Point2(gtk_adjustment_get_value(h_gtkAdjustment), |
d6f44347373d
* Switched over to geometry done with structs instead of classes.
David Bryant <daveb@acres.com.au>
parents:
0
diff
changeset
|
267 gtk_adjustment_get_value(v_gtkAdjustment)); |
0 | 268 writefln("%s", view_left_bottom); |
2
d6f44347373d
* Switched over to geometry done with structs instead of classes.
David Bryant <daveb@acres.com.au>
parents:
0
diff
changeset
|
269 Vector2 model_size = screen_to_model(mViewSize); |
0 | 270 mViewCentre = view_left_bottom + model_size / 2.0; |
271 | |
272 update_rulers(); | |
273 | |
274 queueDraw(); | |
275 } | |
276 | |
277 void update_rulers() { | |
2
d6f44347373d
* Switched over to geometry done with structs instead of classes.
David Bryant <daveb@acres.com.au>
parents:
0
diff
changeset
|
278 Vector2 model_size = screen_to_model(mViewSize); |
0 | 279 |
2
d6f44347373d
* Switched over to geometry done with structs instead of classes.
David Bryant <daveb@acres.com.au>
parents:
0
diff
changeset
|
280 Point2 view_left_bottom = mViewCentre - model_size / 2.0; |
d6f44347373d
* Switched over to geometry done with structs instead of classes.
David Bryant <daveb@acres.com.au>
parents:
0
diff
changeset
|
281 Point2 view_right_top = mViewCentre + model_size / 2.0; |
0 | 282 |
283 mHRuler.setRange(view_left_bottom.x, | |
284 view_right_top.x, | |
285 0.0, // TODO preserve the value | |
286 mZoom * 2000.0); | |
287 mVRuler.setRange(view_right_top.y, | |
288 view_left_bottom.y, | |
289 0.0, | |
290 mZoom * 2000.0); | |
291 } | |
292 | |
293 void update_adjustments() { | |
2
d6f44347373d
* Switched over to geometry done with structs instead of classes.
David Bryant <daveb@acres.com.au>
parents:
0
diff
changeset
|
294 Vector2 model_size = screen_to_model(mViewSize); |
0 | 295 |
2
d6f44347373d
* Switched over to geometry done with structs instead of classes.
David Bryant <daveb@acres.com.au>
parents:
0
diff
changeset
|
296 Point2 view_left_bottom = mViewCentre - model_size / 2.0; |
d6f44347373d
* Switched over to geometry done with structs instead of classes.
David Bryant <daveb@acres.com.au>
parents:
0
diff
changeset
|
297 Point2 view_right_top = mViewCentre + model_size / 2.0; |
0 | 298 |
299 // Adjust the canvas size if necessary | |
300 mCanvasLeftBottom = min_extents(mCanvasLeftBottom, view_left_bottom); | |
301 mCanvasRightTop = max_extents(mCanvasRightTop, view_right_top); | |
302 | |
2
d6f44347373d
* Switched over to geometry done with structs instead of classes.
David Bryant <daveb@acres.com.au>
parents:
0
diff
changeset
|
303 Vector2 canvas_size = mCanvasRightTop - mCanvasLeftBottom; |
d6f44347373d
* Switched over to geometry done with structs instead of classes.
David Bryant <daveb@acres.com.au>
parents:
0
diff
changeset
|
304 Vector2 page_size = mPageRightTop - mPageLeftBottom; |
0 | 305 |
306 // Update the adjustments | |
307 | |
308 GtkAdjustment * h_gtkAdjustment = mHAdjustment.getAdjustmentStruct(); | |
309 GtkAdjustment * v_gtkAdjustment = mVAdjustment.getAdjustmentStruct(); | |
310 | |
2
d6f44347373d
* Switched over to geometry done with structs instead of classes.
David Bryant <daveb@acres.com.au>
parents:
0
diff
changeset
|
311 gtk_adjustment_set_lower(h_gtkAdjustment, mCanvasLeftBottom.x); |
d6f44347373d
* Switched over to geometry done with structs instead of classes.
David Bryant <daveb@acres.com.au>
parents:
0
diff
changeset
|
312 gtk_adjustment_set_upper(h_gtkAdjustment, mCanvasRightTop.x); |
d6f44347373d
* Switched over to geometry done with structs instead of classes.
David Bryant <daveb@acres.com.au>
parents:
0
diff
changeset
|
313 gtk_adjustment_set_value(h_gtkAdjustment, view_left_bottom.x); |
d6f44347373d
* Switched over to geometry done with structs instead of classes.
David Bryant <daveb@acres.com.au>
parents:
0
diff
changeset
|
314 gtk_adjustment_set_step_increment(h_gtkAdjustment, canvas_size.x / 10.0); |
d6f44347373d
* Switched over to geometry done with structs instead of classes.
David Bryant <daveb@acres.com.au>
parents:
0
diff
changeset
|
315 gtk_adjustment_set_page_increment(h_gtkAdjustment, canvas_size.x / 5.0); |
d6f44347373d
* Switched over to geometry done with structs instead of classes.
David Bryant <daveb@acres.com.au>
parents:
0
diff
changeset
|
316 gtk_adjustment_set_page_size(h_gtkAdjustment, model_size.x); |
0 | 317 |
2
d6f44347373d
* Switched over to geometry done with structs instead of classes.
David Bryant <daveb@acres.com.au>
parents:
0
diff
changeset
|
318 gtk_adjustment_set_lower(v_gtkAdjustment, mCanvasLeftBottom.y); |
d6f44347373d
* Switched over to geometry done with structs instead of classes.
David Bryant <daveb@acres.com.au>
parents:
0
diff
changeset
|
319 gtk_adjustment_set_upper(v_gtkAdjustment, mCanvasRightTop.y); |
d6f44347373d
* Switched over to geometry done with structs instead of classes.
David Bryant <daveb@acres.com.au>
parents:
0
diff
changeset
|
320 gtk_adjustment_set_value(v_gtkAdjustment, view_left_bottom.y); |
d6f44347373d
* Switched over to geometry done with structs instead of classes.
David Bryant <daveb@acres.com.au>
parents:
0
diff
changeset
|
321 gtk_adjustment_set_step_increment(v_gtkAdjustment, canvas_size.y / 10.0); |
d6f44347373d
* Switched over to geometry done with structs instead of classes.
David Bryant <daveb@acres.com.au>
parents:
0
diff
changeset
|
322 gtk_adjustment_set_page_increment(v_gtkAdjustment, canvas_size.y / 5.0); |
d6f44347373d
* Switched over to geometry done with structs instead of classes.
David Bryant <daveb@acres.com.au>
parents:
0
diff
changeset
|
323 gtk_adjustment_set_page_size(v_gtkAdjustment, model_size.y); |
0 | 324 |
325 mHAdjustment.changed(); | |
326 mHAdjustment.valueChanged(); | |
327 mVAdjustment.changed(); | |
328 mVAdjustment.valueChanged(); | |
329 } | |
330 | |
2
d6f44347373d
* Switched over to geometry done with structs instead of classes.
David Bryant <daveb@acres.com.au>
parents:
0
diff
changeset
|
331 Point2 model_to_screen(Point2 model) { return ORIGIN + mViewSize / 2.0 + mZoom * (model - mViewCentre); } |
d6f44347373d
* Switched over to geometry done with structs instead of classes.
David Bryant <daveb@acres.com.au>
parents:
0
diff
changeset
|
332 Point2 screen_to_model(Point2 screen) { return mViewCentre + (screen - mViewSize / 2.0 - ORIGIN) / mZoom; } |
d6f44347373d
* Switched over to geometry done with structs instead of classes.
David Bryant <daveb@acres.com.au>
parents:
0
diff
changeset
|
333 Vector2 model_to_screen(Vector2 model) { return mZoom * model; } |
d6f44347373d
* Switched over to geometry done with structs instead of classes.
David Bryant <daveb@acres.com.au>
parents:
0
diff
changeset
|
334 Vector2 screen_to_model(Vector2 screen) { return screen / mZoom; } |
0 | 335 double model_to_screen(double model) { return mZoom * model; } |
336 double screen_to_model(double screen) { return screen / mZoom; } | |
337 | |
338 double clamp_zoom(double zoom) { return clamp(zoom, 0.1, 10.0); } | |
339 | |
2
d6f44347373d
* Switched over to geometry done with structs instead of classes.
David Bryant <daveb@acres.com.au>
parents:
0
diff
changeset
|
340 static const Point2 ORIGIN; |
d6f44347373d
* Switched over to geometry done with structs instead of classes.
David Bryant <daveb@acres.com.au>
parents:
0
diff
changeset
|
341 static const Vector2 INITIAL_PAGE_SIZE; |
0 | 342 |
343 ICanvasEventHandler mEventHandler; | |
344 | |
345 // Model units are in millimetres | |
346 // Screen units are in pixels | |
347 | |
2
d6f44347373d
* Switched over to geometry done with structs instead of classes.
David Bryant <daveb@acres.com.au>
parents:
0
diff
changeset
|
348 double mZoom; // pixels-per-mm |
d6f44347373d
* Switched over to geometry done with structs instead of classes.
David Bryant <daveb@acres.com.au>
parents:
0
diff
changeset
|
349 Point2 mViewCentre; // model: where in the model is the centre of our view |
0 | 350 |
2
d6f44347373d
* Switched over to geometry done with structs instead of classes.
David Bryant <daveb@acres.com.au>
parents:
0
diff
changeset
|
351 Point2 mCanvasLeftBottom; // model: bottom left corner of canvas |
d6f44347373d
* Switched over to geometry done with structs instead of classes.
David Bryant <daveb@acres.com.au>
parents:
0
diff
changeset
|
352 Point2 mCanvasRightTop; // model: top right corner of canvas |
d6f44347373d
* Switched over to geometry done with structs instead of classes.
David Bryant <daveb@acres.com.au>
parents:
0
diff
changeset
|
353 Point2 mPageLeftBottom; // model: bottom left corner of page |
d6f44347373d
* Switched over to geometry done with structs instead of classes.
David Bryant <daveb@acres.com.au>
parents:
0
diff
changeset
|
354 Point2 mPageRightTop; // model: top right corner of page |
0 | 355 |
2
d6f44347373d
* Switched over to geometry done with structs instead of classes.
David Bryant <daveb@acres.com.au>
parents:
0
diff
changeset
|
356 Vector2 mViewSize; // screen: size of view window in pixels |
0 | 357 |
358 HRuler mHRuler; | |
359 VRuler mVRuler; | |
360 DrawingArea mDrawingArea; | |
361 Adjustment mHAdjustment; | |
362 HScrollbar mHScrollbar; | |
363 Adjustment mVAdjustment; | |
364 VScrollbar mVScrollbar; | |
365 } | |
366 } |