Mercurial > projects > doodle
comparison doodle/dia/icanvas.d @ 48:1b4c9ba58673
Stylistic overhaul.
author | daveb |
---|---|
date | Tue, 03 Aug 2010 17:37:21 +0930 |
parents | f2e4e1d29b98 |
children | 576b9fba4677 |
comparison
equal
deleted
inserted
replaced
47:14f1c051c35b | 48:1b4c9ba58673 |
---|---|
12 | 12 |
13 mixin(defineEnum!("Cursor", | 13 mixin(defineEnum!("Cursor", |
14 "DEFAULT", "HAND", "CROSSHAIR")); | 14 "DEFAULT", "HAND", "CROSSHAIR")); |
15 | 15 |
16 interface Viewport { | 16 interface Viewport { |
17 void zoom_relative(in Point pixel_datum, in double factor); | 17 void zoomRelative(in Point pixelDatum, in double factor); |
18 void pan_relative(in Vector pixel_displacement); | 18 void panRelative(in Vector pixelDisplacement); |
19 void set_cursor(in Cursor cursor); | 19 void setCursor(in Cursor cursor); |
20 | 20 |
21 // FIXME get rid of these and accumulate damage during event handling | 21 // FIXME get rid of these and accumulate damage during event handling |
22 void damage_model(in Rectangle area); // FIXME could be an inout parameter of the event handling, or a special scope Damage object that supports growth only | 22 void damageModel(in Rectangle area); // FIXME could be an inout parameter of the event handling, or a special scope Damage object that supports growth only |
23 void damage_pixel(in Rectangle area); // FIXME as above | 23 void damagePixel(in Rectangle area); // FIXME as above |
24 | 24 |
25 /* | 25 /* |
26 // FIXME hoping we won't need anything like this | 26 // FIXME hoping we won't need anything like this |
27 double zoom() const; | 27 double zoom() const; |
28 Point model_to_pixel(in Point model) const; | 28 Point modelToPixel(in Point model) const; |
29 Point pixel_to_model(in Point pixel) const; | 29 Point pixelToModel(in Point pixel) const; |
30 Vector model_to_pixel(in Vector model) const; | 30 Vector modelToPixel(in Vector model) const; |
31 Vector pixel_to_model(in Vector pixel) const; | 31 Vector pixelToModel(in Vector pixel) const; |
32 Rectangle model_to_pixel(in Rectangle model) const; | 32 Rectangle modelToPixel(in Rectangle model) const; |
33 Rectangle pixel_to_model(in Rectangle model) const; | 33 Rectangle pixelToModel(in Rectangle model) const; |
34 double model_to_pixel(in double model) const; | 34 double modelToPixel(in double model) const; |
35 double pixel_to_model(in double pixel) const; | 35 double pixelToModel(in double pixel) const; |
36 */ | 36 */ |
37 } | 37 } |
38 | 38 |
39 interface EventHandler { | 39 interface EventHandler { |
40 bool handle_button_press(scope Viewport viewport, in ButtonEvent event); | 40 bool handleButtonPress(scope Viewport viewport, in ButtonEvent event); |
41 bool handle_button_release(scope Viewport viewport, in ButtonEvent event); | 41 bool handleButtonRelease(scope Viewport viewport, in ButtonEvent event); |
42 bool handle_motion(scope Viewport viewport, in MotionEvent event); | 42 bool handleMotion(scope Viewport viewport, in MotionEvent event); |
43 bool handle_scroll(scope Viewport viewport, in ScrollEvent event); | 43 bool handleScroll(scope Viewport viewport, in ScrollEvent event); |
44 //bool handle_enter(scope Viewport viewport, CrossingEvent event); | 44 //bool handleEnter(scope Viewport viewport, CrossingEvent event); |
45 //bool handle_leave(scope Viewport viewport, CrossingEvent event); | 45 //bool handleLeave(scope Viewport viewport, CrossingEvent event); |
46 //bool handle_focus_in(scope Viewport viewport, FocusEvent event); | 46 //bool handleFocusIn(scope Viewport viewport, FocusEvent event); |
47 //bool handle_focus_out(scope Viewport viewport, FocusEvent event); | 47 //bool handleFocusOut(scope Viewport viewport, FocusEvent event); |
48 bool handle_key_press(scope Viewport viewport, in KeyEvent event); | 48 bool handleKeyPress(scope Viewport viewport, in KeyEvent event); |
49 bool handle_key_release(scope Viewport viewport, in KeyEvent event); | 49 bool handleKeyRelease(scope Viewport viewport, in KeyEvent event); |
50 } | 50 } |
51 | 51 |
52 interface Grid { | 52 interface Grid { |
53 void zoom_changed(double zoom); | 53 void zoomChanged(double zoom); |
54 | 54 |
55 // TODO inout? | 55 // TODO inout? |
56 bool snap(in Point a, out Point b) const; | 56 bool snap(in Point a, out Point b) const; |
57 } | 57 } |
58 | 58 |
68 string name() const { return mName; } | 68 string name() const { return mName; } |
69 | 69 |
70 Rectangle bounds() const; | 70 Rectangle bounds() const; |
71 | 71 |
72 void draw(in Viewport viewport, | 72 void draw(in Viewport viewport, |
73 in Rectangle pixel_damage, scope Context pixel_cr, | 73 in Rectangle pixelDamage, scope Context pixelCr, |
74 in Rectangle model_damage, scope Context model_cr) const; | 74 in Rectangle modelDamage, scope Context modelCr) const; |
75 | 75 |
76 private { | 76 private { |
77 invariant string mName; | 77 invariant string mName; |
78 } | 78 } |
79 } | 79 } |