Mercurial > hg > orthanc-stone
comparison Framework/Widgets/EmptyWidget.h @ 235:ce4405d98b92 am
Added SimpleViewerApplication (working in SDL)
author | am@osimis.io |
---|---|
date | Tue, 19 Jun 2018 16:02:41 +0200 |
parents | fccffbf99ba1 |
children | 8a86695fcbc3 |
comparison
equal
deleted
inserted
replaced
234:9afb50d1ac14 | 235:ce4405d98b92 |
---|---|
11 * | 11 * |
12 * This program is distributed in the hope that it will be useful, but | 12 * This program is distributed in the hope that it will be useful, but |
13 * WITHOUT ANY WARRANTY; without even the implied warranty of | 13 * WITHOUT ANY WARRANTY; without even the implied warranty of |
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
15 * Affero General Public License for more details. | 15 * Affero General Public License for more details. |
16 * | 16 * |
17 * You should have received a copy of the GNU Affero General Public License | 17 * You should have received a copy of the GNU Affero General Public License |
18 * along with this program. If not, see <http://www.gnu.org/licenses/>. | 18 * along with this program. If not, see <http://www.gnu.org/licenses/>. |
19 **/ | 19 **/ |
20 | 20 |
21 | 21 |
23 | 23 |
24 #include "IWidget.h" | 24 #include "IWidget.h" |
25 | 25 |
26 namespace OrthancStone | 26 namespace OrthancStone |
27 { | 27 { |
28 namespace Samples | 28 /** |
29 { | |
30 /** | |
31 * This is a test widget that simply fills its surface with an | 29 * This is a test widget that simply fills its surface with an |
32 * uniform color. | 30 * uniform color. |
33 **/ | 31 **/ |
34 class EmptyWidget : public IWidget | 32 class EmptyWidget : public IWidget |
33 { | |
34 private: | |
35 uint8_t red_; | |
36 uint8_t green_; | |
37 uint8_t blue_; | |
38 | |
39 public: | |
40 EmptyWidget(uint8_t red, | |
41 uint8_t green, | |
42 uint8_t blue) : | |
43 red_(red), | |
44 green_(green), | |
45 blue_(blue) | |
35 { | 46 { |
36 private: | 47 } |
37 uint8_t red_; | |
38 uint8_t green_; | |
39 uint8_t blue_; | |
40 | 48 |
41 public: | 49 virtual void SetDefaultView() |
42 EmptyWidget(uint8_t red, | 50 { |
43 uint8_t green, | 51 } |
44 uint8_t blue) : | |
45 red_(red), | |
46 green_(green), | |
47 blue_(blue) | |
48 { | |
49 } | |
50 | 52 |
51 virtual void SetDefaultView() | 53 virtual void SetParent(IWidget& widget) |
52 { | 54 { |
53 } | 55 } |
54 | |
55 virtual void SetParent(OrthancStone::IWidget& widget) | |
56 { | |
57 } | |
58 | |
59 virtual void SetViewport(IViewport& viewport) | |
60 { | |
61 } | |
62 | 56 |
63 virtual void NotifyChange() | 57 virtual void SetViewport(IViewport& viewport) |
64 { | 58 { |
65 } | 59 } |
66 | 60 |
67 virtual void SetStatusBar(IStatusBar& statusBar) | 61 virtual void NotifyChange() |
68 { | 62 { |
69 } | 63 } |
70 | 64 |
71 virtual void SetSize(unsigned int width, | 65 virtual void SetStatusBar(IStatusBar& statusBar) |
72 unsigned int height) | 66 { |
73 { | 67 } |
74 } | |
75 | |
76 virtual bool Render(Orthanc::ImageAccessor& surface); | |
77 | 68 |
78 virtual IMouseTracker* CreateMouseTracker(MouseButton button, | 69 virtual void SetSize(unsigned int width, |
79 int x, | 70 unsigned int height) |
80 int y, | 71 { |
81 KeyboardModifiers modifiers) | 72 } |
82 { | |
83 return NULL; | |
84 } | |
85 | 73 |
86 virtual void RenderMouseOver(Orthanc::ImageAccessor& target, | 74 virtual bool Render(Orthanc::ImageAccessor& surface); |
87 int x, | |
88 int y) | |
89 { | |
90 } | |
91 | 75 |
92 virtual void MouseWheel(MouseWheelDirection direction, | 76 virtual IMouseTracker* CreateMouseTracker(MouseButton button, |
93 int x, | 77 int x, |
94 int y, | 78 int y, |
95 KeyboardModifiers modifiers) | 79 KeyboardModifiers modifiers) |
96 { | 80 { |
97 } | 81 return NULL; |
82 } | |
98 | 83 |
99 virtual void KeyPressed(char key, | 84 virtual void RenderMouseOver(Orthanc::ImageAccessor& target, |
100 KeyboardModifiers modifiers) | 85 int x, |
101 { | 86 int y) |
102 } | 87 { |
88 } | |
103 | 89 |
104 virtual bool HasUpdateContent() const | 90 virtual void MouseWheel(MouseWheelDirection direction, |
105 { | 91 int x, |
106 return false; | 92 int y, |
107 } | 93 KeyboardModifiers modifiers) |
94 { | |
95 } | |
108 | 96 |
109 virtual void UpdateContent(); | 97 virtual void KeyPressed(char key, |
98 KeyboardModifiers modifiers) | |
99 { | |
100 } | |
110 | 101 |
111 virtual bool HasRenderMouseOver() | 102 virtual bool HasUpdateContent() const |
112 { | 103 { |
113 return false; | 104 return false; |
114 } | 105 } |
115 }; | 106 |
116 } | 107 virtual void UpdateContent(); |
108 | |
109 virtual bool HasRenderMouseOver() | |
110 { | |
111 return false; | |
112 } | |
113 }; | |
117 } | 114 } |