Mercurial > hg > orthanc-stone
comparison Framework/Widgets/TestCairoWidget.cpp @ 726:4f2416d519b4
moving layers, widgets and loaders to Deprecated namespace
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 21 May 2019 11:43:25 +0200 |
parents | 3b4df9925db6 |
children |
comparison
equal
deleted
inserted
replaced
714:d2c0e347ddc2 | 726:4f2416d519b4 |
---|---|
22 #include "TestCairoWidget.h" | 22 #include "TestCairoWidget.h" |
23 | 23 |
24 #include <stdio.h> | 24 #include <stdio.h> |
25 | 25 |
26 | 26 |
27 namespace OrthancStone | 27 namespace Deprecated |
28 { | 28 { |
29 namespace Samples | 29 namespace Samples |
30 { | 30 { |
31 void TestCairoWidget::DoAnimation() | 31 void TestCairoWidget::DoAnimation() |
32 { | 32 { |
38 | 38 |
39 NotifyContentChanged(); | 39 NotifyContentChanged(); |
40 } | 40 } |
41 | 41 |
42 | 42 |
43 bool TestCairoWidget::RenderCairo(CairoContext& context) | 43 bool TestCairoWidget::RenderCairo(OrthancStone::CairoContext& context) |
44 { | 44 { |
45 cairo_t* cr = context.GetObject(); | 45 cairo_t* cr = context.GetObject(); |
46 | 46 |
47 cairo_set_source_rgb (cr, .3, 0, 0); | 47 cairo_set_source_rgb (cr, .3, 0, 0); |
48 cairo_paint(cr); | 48 cairo_paint(cr); |
58 | 58 |
59 return true; | 59 return true; |
60 } | 60 } |
61 | 61 |
62 | 62 |
63 void TestCairoWidget::RenderMouseOverCairo(CairoContext& context, | 63 void TestCairoWidget::RenderMouseOverCairo(OrthancStone::CairoContext& context, |
64 int x, | 64 int x, |
65 int y) | 65 int y) |
66 { | 66 { |
67 cairo_t* cr = context.GetObject(); | 67 cairo_t* cr = context.GetObject(); |
68 | 68 |
94 width_ = width; | 94 width_ = width; |
95 height_ = height; | 95 height_ = height; |
96 } | 96 } |
97 | 97 |
98 | 98 |
99 IMouseTracker* TestCairoWidget::CreateMouseTracker(MouseButton button, | 99 IMouseTracker* TestCairoWidget::CreateMouseTracker(OrthancStone::MouseButton button, |
100 int x, | 100 int x, |
101 int y, | 101 int y, |
102 KeyboardModifiers modifiers, | 102 OrthancStone::KeyboardModifiers modifiers, |
103 const std::vector<Touch>& touches) | 103 const std::vector<Touch>& touches) |
104 { | 104 { |
105 UpdateStatusBar("Click"); | 105 UpdateStatusBar("Click"); |
106 return NULL; | 106 return NULL; |
107 } | 107 } |
108 | 108 |
109 | 109 |
110 void TestCairoWidget::MouseWheel(MouseWheelDirection direction, | 110 void TestCairoWidget::MouseWheel(OrthancStone::MouseWheelDirection direction, |
111 int x, | 111 int x, |
112 int y, | 112 int y, |
113 KeyboardModifiers modifiers) | 113 OrthancStone::KeyboardModifiers modifiers) |
114 { | 114 { |
115 UpdateStatusBar(direction == MouseWheelDirection_Down ? "Wheel down" : "Wheel up"); | 115 UpdateStatusBar(direction == OrthancStone::MouseWheelDirection_Down ? "Wheel down" : "Wheel up"); |
116 } | 116 } |
117 | 117 |
118 | 118 |
119 void TestCairoWidget::KeyPressed(KeyboardKeys key, | 119 void TestCairoWidget::KeyPressed(OrthancStone::KeyboardKeys key, |
120 char keyChar, | 120 char keyChar, |
121 KeyboardModifiers modifiers) | 121 OrthancStone::KeyboardModifiers modifiers) |
122 { | 122 { |
123 UpdateStatusBar("Key pressed: \"" + std::string(1, keyChar) + "\""); | 123 UpdateStatusBar("Key pressed: \"" + std::string(1, keyChar) + "\""); |
124 } | 124 } |
125 } | 125 } |
126 } | 126 } |