WebRadioApp  0.1
_WidgetSetGauge.h
Go to the documentation of this file.
1 /*******************************************************************************
2 *
3 * E M B E D D E D W I Z A R D P R O J E C T
4 *
5 * Copyright (c) TARA Systems GmbH
6 * written by Paul Banach and Manfred Schweyer
7 *
8 ********************************************************************************
9 *
10 * This file was generated automatically by Embedded Wizard Studio.
11 *
12 * Please do not make any modifications of this file! The modifications are lost
13 * when the file is generated again by Embedded Wizard Studio!
14 *
15 * The template of this heading text can be found in the file 'head.ewt' in the
16 * directory 'Platforms' of your Embedded Wizard installation directory. If you
17 * wish to adapt this text, please copy the template file 'head.ewt' into your
18 * project directory and edit the copy only. Please avoid any modifications of
19 * the original template file!
20 *
21 * Version : 10.00
22 * Profile : STM32H747
23 * Platform : STM.STM32.RGB565
24 *
25 *******************************************************************************/
26 
27 #ifndef _WidgetSetGauge_H
28 #define _WidgetSetGauge_H
29 
30 #ifdef __cplusplus
31  extern "C"
32  {
33 #endif
34 
35 #include "ewrte.h"
36 #if EW_RTE_VERSION != 0x000A0000
37  #error Wrong version of Embedded Wizard Runtime Environment.
38 #endif
39 
40 #include "ewgfx.h"
41 #if EW_GFX_VERSION != 0x000A0000
42  #error Wrong version of Embedded Wizard Graphics Engine.
43 #endif
44 
45 #include "_CoreGroup.h"
46 #include "_EffectsFloatEffect.h"
47 
48 /* Forward declaration of the class Core::DialogContext */
49 #ifndef _CoreDialogContext_
50  EW_DECLARE_CLASS( CoreDialogContext )
51 #define _CoreDialogContext_
52 #endif
53 
54 /* Forward declaration of the class Core::KeyPressHandler */
55 #ifndef _CoreKeyPressHandler_
56  EW_DECLARE_CLASS( CoreKeyPressHandler )
57 #define _CoreKeyPressHandler_
58 #endif
59 
60 /* Forward declaration of the class Core::LayoutContext */
61 #ifndef _CoreLayoutContext_
62  EW_DECLARE_CLASS( CoreLayoutContext )
63 #define _CoreLayoutContext_
64 #endif
65 
66 /* Forward declaration of the class Core::TaskQueue */
67 #ifndef _CoreTaskQueue_
68  EW_DECLARE_CLASS( CoreTaskQueue )
69 #define _CoreTaskQueue_
70 #endif
71 
72 /* Forward declaration of the class Core::View */
73 #ifndef _CoreView_
74  EW_DECLARE_CLASS( CoreView )
75 #define _CoreView_
76 #endif
77 
78 /* Forward declaration of the class Effects::Fader */
79 #ifndef _EffectsFader_
81 #define _EffectsFader_
82 #endif
83 
84 /* Forward declaration of the class Graphics::ArcPath */
85 #ifndef _GraphicsArcPath_
86  EW_DECLARE_CLASS( GraphicsArcPath )
87 #define _GraphicsArcPath_
88 #endif
89 
90 /* Forward declaration of the class Graphics::Canvas */
91 #ifndef _GraphicsCanvas_
92  EW_DECLARE_CLASS( GraphicsCanvas )
93 #define _GraphicsCanvas_
94 #endif
95 
96 /* Forward declaration of the class Views::FillPath */
97 #ifndef _ViewsFillPath_
98  EW_DECLARE_CLASS( ViewsFillPath )
99 #define _ViewsFillPath_
100 #endif
101 
102 /* Forward declaration of the class Views::Image */
103 #ifndef _ViewsImage_
104  EW_DECLARE_CLASS( ViewsImage )
105 #define _ViewsImage_
106 #endif
107 
108 /* Forward declaration of the class Views::WarpImage */
109 #ifndef _ViewsWarpImage_
110  EW_DECLARE_CLASS( ViewsWarpImage )
111 #define _ViewsWarpImage_
112 #endif
113 
114 /* Forward declaration of the class WidgetSet::Gauge */
115 #ifndef _WidgetSetGauge_
116  EW_DECLARE_CLASS( WidgetSetGauge )
117 #define _WidgetSetGauge_
118 #endif
119 
120 /* Forward declaration of the class WidgetSet::GaugeConfig */
121 #ifndef _WidgetSetGaugeConfig_
122  EW_DECLARE_CLASS( WidgetSetGaugeConfig )
123 #define _WidgetSetGaugeConfig_
124 #endif
125 
126 
127 /* This class implements an 'analog instrument' (circular gauge), intended to display
128  a value as a needle that rotates above a scale. The rotation of the needle corresponds
129  to the value specified in the property @CurrentValue, which lies in range determined
130  by the properties @MinValue and @MaxValue.
131  Alternatively the property @Outlet can refer to any other 'int32' property the
132  widget should remain synchronized with. When the referred property is modified
133  by another one, the widget is automatically notified to remain in sync with the
134  property.
135  This approach follows the Controller-View programming paradigm. Here the gauge
136  widget represents the 'View' and the property referred via 'Outlet' can be seen
137  as a part of the 'Controller'.
138  The exact look and feel of the gauge is determined by the 'Gauge Configuration'
139  object assigned to the property @Appearance. The configuration object provides
140  bitmaps, colors and other configuration parameters needed to construct and display
141  the gauge widget. Usually, you will manage in your project your own configuration
142  objects and customize the gauge widgets according to your design expectations.
143  Depending on the information provided in the associated configuration object,
144  the gauge widget will be composed of following views:
145  - 'Scale' is an image view (Views::Image) displayed centered in the background
146  within the widget area. In the configuration object you can specify the desired
147  bitmap, its opacity, frame number (if the bitmap is multi-frame) and tint color
148  (if the bitmap contains Alpha8 information only). The gauge widget can automatically
149  play animated bitmaps.
150  - 'TrackLeft' is a vector graphic view (Views::FillPath) displaying a circle
151  segment between the needle's leftmost position (clockwise) and its actual position.
152  From this results the effect of a track behind the needle. In the configuration
153  object you can specify the track thickness, color and the appearance of its caps.
154  - 'TrackRight' is a vector graphic view (Views::FillPath) displaying a circle
155  segment between the actual position of the needle and its rightmost position
156  (clockwise). From this results the effect of a track behind the needle. In the
157  configuration object you can specify the track thickness, color and the appearance
158  of its caps.
159  - 'Needle' is a warp image view (Views::WarpImage) displayed and rotated around
160  predetermined pivot position. In the configuration object you can specify the
161  desired bitmap, its opacity, frame number (if the bitmap is multi-frame) and
162  tint color (if the bitmap contains Alpha8 information only). The gauge widget
163  can automatically play animated bitmaps. The desired rotation range (the angles
164  corresponding to the values @MinValue and @MaxValue) and the pivot position are
165  also specify in the configuration object.
166  - 'Cover' is an image view (Views::Image) displayed centered within the widget
167  area and covering so eventually the scale and needle images. In the configuration
168  object you can specify the desired bitmap, its opacity, frame number (if the
169  bitmap is multi-frame) and tint color (if the bitmap contains Alpha8 information
170  only). The gauge widget can automatically play animated bitmaps.
171  The gauge widget implements a 'swing' animation effect to rotate the needle smoothly.
172  You can configure the duration and the timing of this effect in the configuration
173  object. Gauge widgets are not intended to be controlled by the user. The widget
174  ignores all touch and keyboard events and it can't be focused.
175  The gauge widget provides an additional set of methods useful to query the actual
176  rotation angle of the needle, its possible rotation range and the position around
177  which the needle is rotated (@GetCenterPosition(), @GetNeedleAngle(), @GetNeedleMaxAngle(),
178  @GetNeedleMinAngle()). These methods can be invoked from a slot method assigned
179  to the property @OnUpdate. In this manner you can automatically arrange and updated
180  additional decoration according to the actual state of the gauge widget. For
181  example, you can arrange a Views::Text view to follow the needle and to display
182  the actual value of the widget (@CurrentValue).
183  For more details regarding the customization of the gauge widget see the description
184  of WidgetSet::GaugeConfig class. */
185 EW_DEFINE_FIELDS( WidgetSetGauge, CoreGroup )
186  EW_VARIABLE( imageView1, ViewsImage )
187  EW_VARIABLE( imageView2, ViewsImage )
188  EW_VARIABLE( warpView, ViewsWarpImage )
189  EW_VARIABLE( pathView1, ViewsFillPath )
190  EW_VARIABLE( pathView2, ViewsFillPath )
191  EW_VARIABLE( path1, GraphicsArcPath )
192  EW_VARIABLE( path2, GraphicsArcPath )
193  EW_PROPERTY( Appearance, WidgetSetGaugeConfig )
194  EW_PROPERTY( OnUpdate, XSlot )
195  EW_OBJECT ( FloatEffect, EffectsFloatEffect )
196  EW_VARIABLE( currentAngle, XFloat )
197  EW_PROPERTY( MaxValue, XInt32 )
198  EW_PROPERTY( MinValue, XInt32 )
199  EW_PROPERTY( CurrentValue, XInt32 )
200  EW_VARIABLE( setupCurrentAngle, XBool )
201 EW_END_OF_FIELDS( WidgetSetGauge )
202 
203 /* Virtual Method Table (VMT) for the class : 'WidgetSet::Gauge' */
204 EW_DEFINE_METHODS( WidgetSetGauge, CoreGroup )
205  EW_METHOD( initLayoutContext, void )( CoreRectView _this, XRect aBounds, CoreOutline
206  aOutline )
207  EW_METHOD( GetRoot, CoreRoot )( CoreView _this )
208  EW_METHOD( Draw, void )( CoreGroup _this, GraphicsCanvas aCanvas,
210  EW_METHOD( HandleEvent, XObject )( CoreView _this, CoreEvent aEvent )
211  EW_METHOD( CursorHitTest, CoreCursorHit )( CoreGroup _this, XRect aArea, XInt32
212  aFinger, XInt32 aStrikeCount, CoreView aDedicatedView, XSet aRetargetReason )
213  EW_METHOD( ArrangeView, XPoint )( CoreRectView _this, XRect aBounds, XEnum
214  aFormation )
215  EW_METHOD( MoveView, void )( CoreRectView _this, XPoint aOffset, XBool
216  aFastMove )
217  EW_METHOD( GetExtent, XRect )( CoreRectView _this )
218  EW_METHOD( ChangeViewState, void )( CoreGroup _this, XSet aSetState, XSet aClearState )
219  EW_METHOD( OnSetBounds, void )( WidgetSetGauge _this, XRect value )
220  EW_METHOD( drawContent, void )( CoreGroup _this, GraphicsCanvas aCanvas,
222  EW_METHOD( OnSetFocus, void )( CoreGroup _this, CoreView value )
223  EW_METHOD( OnSetBuffered, void )( CoreGroup _this, XBool value )
224  EW_METHOD( OnSetOpacity, void )( CoreGroup _this, XInt32 value )
225  EW_METHOD( IsDialog, XBool )( CoreGroup _this, XBool aRecursive )
226  EW_METHOD( DispatchEvent, XObject )( CoreGroup _this, CoreEvent aEvent )
227  EW_METHOD( BroadcastEvent, XObject )( CoreGroup _this, CoreEvent aEvent, XSet
228  aFilter )
229  EW_METHOD( UpdateLayout, void )( CoreGroup _this, XPoint aSize )
230  EW_METHOD( UpdateViewState, void )( WidgetSetGauge _this, XSet aState )
231  EW_METHOD( InvalidateArea, void )( CoreGroup _this, XRect aArea )
232 EW_END_OF_METHODS( WidgetSetGauge )
233 
234 /* 'C' function for method : 'WidgetSet::Gauge.OnSetBounds()' */
235 void WidgetSetGauge_OnSetBounds( WidgetSetGauge _this, XRect value );
236 
237 /* The method UpdateViewState() is invoked automatically after the state of the
238  component has been changed. This method can be overridden and filled with logic
239  to ensure the visual aspect of the component does reflect its current state.
240  For example, the 'enabled' state of the component can affect its colors (disabled
241  components may appear pale). In this case the logic of the method should modify
242  the respective color properties accordingly to the current 'enabled' state.
243  The current state of the component is passed as a set in the parameter aState.
244  It reflects the very basic component state like its visibility or the ability
245  to react to user inputs. Beside this common state, the method can also involve
246  any other variables used in the component as long as they reflect its current
247  state. For example, the toggle switch component can take in account its toggle
248  state 'on' or 'off' and change accordingly the location of the slider, etc.
249  Usually, this method will be invoked automatically by the framework. Optionally
250  you can request its invocation by using the method @InvalidateViewState(). */
251 void WidgetSetGauge_UpdateViewState( WidgetSetGauge _this, XSet aState );
252 
253 /* 'C' function for method : 'WidgetSet::Gauge.onUpdateAngle()' */
254 void WidgetSetGauge_onUpdateAngle( WidgetSetGauge _this, XObject sender );
255 
256 /* 'C' function for method : 'WidgetSet::Gauge.onEndFloatEffect()' */
257 void WidgetSetGauge_onEndFloatEffect( WidgetSetGauge _this, XObject sender );
258 
259 /* 'C' function for method : 'WidgetSet::Gauge.onFloatEffect()' */
260 void WidgetSetGauge_onFloatEffect( WidgetSetGauge _this, XObject sender );
261 
262 /* 'C' function for method : 'WidgetSet::Gauge.onConfigChanged()' */
263 void WidgetSetGauge_onConfigChanged( WidgetSetGauge _this, XObject sender );
264 
265 /* 'C' function for method : 'WidgetSet::Gauge.OnSetMaxValue()' */
266 void WidgetSetGauge_OnSetMaxValue( WidgetSetGauge _this, XInt32 value );
267 
268 /* 'C' function for method : 'WidgetSet::Gauge.OnSetMinValue()' */
269 void WidgetSetGauge_OnSetMinValue( WidgetSetGauge _this, XInt32 value );
270 
271 /* 'C' function for method : 'WidgetSet::Gauge.OnGetCurrentValue()' */
272 XInt32 WidgetSetGauge_OnGetCurrentValue( WidgetSetGauge _this );
273 
274 /* 'C' function for method : 'WidgetSet::Gauge.OnSetCurrentValue()' */
275 void WidgetSetGauge_OnSetCurrentValue( WidgetSetGauge _this, XInt32 value );
276 
277 /* 'C' function for method : 'WidgetSet::Gauge.OnSetAppearance()' */
278 void WidgetSetGauge_OnSetAppearance( WidgetSetGauge _this, WidgetSetGaugeConfig
279  value );
280 
281 #ifdef __cplusplus
282  }
283 #endif
284 
285 #endif /* _WidgetSetGauge_H */
286 
287 /* Embedded Wizard */
ewrte.h
_CoreGroup.h
value
XRect CoreOutline aOutline XRect value
Definition: _WidgetSetGauge.h:235
EW_END_OF_FIELDS
#define EW_END_OF_FIELDS(aClass)
Definition: ewrte.h:460
EW_DECLARE_CLASS
#define EW_DECLARE_CLASS(aClass)
Definition: ewrte.h:393
CoreCursorHit
XRect CoreOutline aOutline CoreCursorHit(CoreGroup _this, XRect aArea, XInt32 aFinger, XInt32 aStrikeCount, CoreView aDedicatedView, XSet aRetargetReason) EW_METHOD(ArrangeView
XSlot
Definition: ewrte.h:2114
WidgetSetGauge_OnSetCurrentValue
void WidgetSetGauge_OnSetCurrentValue(WidgetSetGauge _this, XInt32 value)
Definition: WidgetSet.c:2953
EW_VARIABLE
#define EW_VARIABLE(aName, aType)
Definition: ewrte.h:464
ewgfx.h
WidgetSetGauge_OnGetCurrentValue
XInt32 WidgetSetGauge_OnGetCurrentValue(WidgetSetGauge _this)
Definition: WidgetSet.c:2928
_obj_XObject
Definition: ewrte.h:281
WidgetSetGauge_onFloatEffect
void WidgetSetGauge_onFloatEffect(WidgetSetGauge _this, XObject sender)
Definition: WidgetSet.c:2882
aOutline
XRect CoreOutline aOutline XRect CoreOutline aOutline
Definition: _CoreQuadView.h:109
XInt32
signed long XInt32
Definition: ewrte.h:1586
XBool
char XBool
Definition: ewrte.h:1592
XEnum
unsigned long XEnum
Definition: ewrte.h:1593
EW_DEFINE_METHODS
#define EW_DEFINE_METHODS(aClass, aSuperClass)
Definition: ewrte.h:524
XRect
Definition: ewrte.h:1639
EW_METHOD
EW_METHOD(initLayoutContext, void)(CoreRectView _this
WidgetSetGauge_UpdateViewState
void WidgetSetGauge_UpdateViewState(WidgetSetGauge _this, XSet aState)
Definition: WidgetSet.c:2561
WidgetSetGauge_OnSetAppearance
void WidgetSetGauge_OnSetAppearance(WidgetSetGauge _this, WidgetSetGaugeConfig value)
Definition: WidgetSet.c:2964
WidgetSetGauge_OnSetBounds
void WidgetSetGauge_OnSetBounds(WidgetSetGauge _this, XRect value)
Definition: WidgetSet.c:2482
EffectsFader
EffectsFader(EffectsShowHideTransition _this) EW_METHOD(CreateRestoreFader
XSet
unsigned long XSet
Definition: ewrte.h:1594
aOpacity
XRect CoreOutline aOutline GraphicsCanvas XRect XPoint XInt32 aOpacity
Definition: _CoreOutline.h:172
aBounds
XRect aBounds
Definition: _WidgetSetGauge.h:205
WidgetSetGauge_OnSetMaxValue
void WidgetSetGauge_OnSetMaxValue(WidgetSetGauge _this, XInt32 value)
Definition: WidgetSet.c:2908
WidgetSetGauge_OnSetMinValue
void WidgetSetGauge_OnSetMinValue(WidgetSetGauge _this, XInt32 value)
Definition: WidgetSet.c:2918
XFloat
float XFloat
Definition: ewrte.h:1595
WidgetSetGauge_onEndFloatEffect
void WidgetSetGauge_onEndFloatEffect(WidgetSetGauge _this, XObject sender)
Definition: WidgetSet.c:2873
aClip
XRect CoreOutline aOutline GraphicsCanvas XRect aClip
Definition: _CoreOutline.h:171
sender
XRect CoreOutline aOutline XObject sender
Definition: _ApplicationRadioInterface.h:186
XPoint
Definition: ewrte.h:1616
EW_PROPERTY
#define EW_PROPERTY(aName, aType)
Definition: ewrte.h:466
aOffset
XRect CoreOutline aOutline GraphicsCanvas XRect XPoint aOffset
Definition: _CoreOutline.h:172
EW_OBJECT
#define EW_OBJECT(aName, aObjectClass)
Definition: ewrte.h:468
WidgetSetGauge_onConfigChanged
void WidgetSetGauge_onConfigChanged(WidgetSetGauge _this, XObject sender)
Definition: WidgetSet.c:2893
aCanvas
XRect CoreOutline aOutline GraphicsCanvas aCanvas
Definition: _CoreOutline.h:171
EW_END_OF_METHODS
#define EW_END_OF_METHODS(aClass)
Definition: ewrte.h:539
WidgetSetGauge_onUpdateAngle
void WidgetSetGauge_onUpdateAngle(WidgetSetGauge _this, XObject sender)
Definition: WidgetSet.c:2805
_EffectsFloatEffect.h
aBlend
XRect CoreOutline aOutline GraphicsCanvas XRect XPoint XInt32 XBool aBlend
Definition: _CoreOutline.h:172
EW_DEFINE_FIELDS
#define EW_DEFINE_FIELDS(aClass, aSuperClass)
Definition: ewrte.h:451