WebRadioApp  0.1
_CoreView.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 _CoreView_H
28 #define _CoreView_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 /* Forward declaration of the class Core::CursorHit */
46 #ifndef _CoreCursorHit_
48 #define _CoreCursorHit_
49 #endif
50 
51 /* Forward declaration of the class Core::Event */
52 #ifndef _CoreEvent_
53  EW_DECLARE_CLASS( CoreEvent )
54 #define _CoreEvent_
55 #endif
56 
57 /* Forward declaration of the class Core::Group */
58 #ifndef _CoreGroup_
59  EW_DECLARE_CLASS( CoreGroup )
60 #define _CoreGroup_
61 #endif
62 
63 /* Forward declaration of the class Core::LayoutContext */
64 #ifndef _CoreLayoutContext_
65  EW_DECLARE_CLASS( CoreLayoutContext )
66 #define _CoreLayoutContext_
67 #endif
68 
69 /* Forward declaration of the class Core::Outline */
70 #ifndef _CoreOutline_
71  EW_DECLARE_CLASS( CoreOutline )
72 #define _CoreOutline_
73 #endif
74 
75 /* Forward declaration of the class Core::Root */
76 #ifndef _CoreRoot_
77  EW_DECLARE_CLASS( CoreRoot )
78 #define _CoreRoot_
79 #endif
80 
81 /* Forward declaration of the class Core::View */
82 #ifndef _CoreView_
83  EW_DECLARE_CLASS( CoreView )
84 #define _CoreView_
85 #endif
86 
87 /* Forward declaration of the class Graphics::Canvas */
88 #ifndef _GraphicsCanvas_
89  EW_DECLARE_CLASS( GraphicsCanvas )
90 #define _GraphicsCanvas_
91 #endif
92 
93 
94 /* The class Core::View provides the base functionality for all visual components.
95  This class implements a set of methods and properties to manage the view, to
96  redraw its content, to receive and handle any user input events and to arrange
97  it on the screen.
98  The class Core::View doesn't define any particular behavior nor appearance. It
99  exists as an empty base for all derived view classes like the Views::Text or
100  Views::Image.
101  Views never appear alone. Within a GUI application they are composed to complex
102  GUI components, like the push button or the slider. This composition is done
103  by the class Core::Group. In this manner each view belongs to a superior group
104  and can be managed by this group. For example, showing the group makes visible
105  all enclosed views automatically. */
106 EW_DEFINE_FIELDS( CoreView, XObject )
107  EW_VARIABLE( next, CoreView )
108  EW_VARIABLE( prev, CoreView )
109  EW_VARIABLE( Owner, CoreGroup )
110  EW_VARIABLE( layoutContext, CoreLayoutContext )
111  EW_VARIABLE( viewState, XSet )
112  EW_PROPERTY( StackingPriority, XInt32 )
113  EW_PROPERTY( Layout, XSet )
114 EW_END_OF_FIELDS( CoreView )
115 
116 /* Virtual Method Table (VMT) for the class : 'Core::View' */
117 EW_DEFINE_METHODS( CoreView, XObject )
118  EW_METHOD( initLayoutContext, void )( CoreView _this, XRect aBounds, CoreOutline
119  aOutline )
120  EW_METHOD( GetRoot, CoreRoot )( CoreView _this )
121  EW_METHOD( Draw, void )( CoreView _this, GraphicsCanvas aCanvas,
123  EW_METHOD( HandleEvent, XObject )( CoreView _this, CoreEvent aEvent )
124  EW_METHOD( CursorHitTest, CoreCursorHit )( CoreView _this, XRect aArea, XInt32
125  aFinger, XInt32 aStrikeCount, CoreView aDedicatedView, XSet aRetargetReason )
126  EW_METHOD( ArrangeView, XPoint )( CoreView _this, XRect aBounds, XEnum aFormation )
127  EW_METHOD( MoveView, void )( CoreView _this, XPoint aOffset, XBool aFastMove )
128  EW_METHOD( GetExtent, XRect )( CoreView _this )
129  EW_METHOD( ChangeViewState, void )( CoreView _this, XSet aSetState, XSet aClearState )
130 EW_END_OF_METHODS( CoreView )
131 
132 /* 'C' function for method : 'Core::View.initLayoutContext()' */
133 void CoreView_initLayoutContext( CoreView _this, XRect aBounds, CoreOutline aOutline );
134 
135 /* Wrapper function for the virtual method : 'Core::View.initLayoutContext()' */
136 void CoreView__initLayoutContext( void* _this, XRect aBounds, CoreOutline aOutline );
137 
138 /* 'C' function for method : 'Core::View.OnSetLayout()' */
139 void CoreView_OnSetLayout( CoreView _this, XSet value );
140 
141 /* The method GetRoot() delivers the application object, this view belongs to. The
142  application object represents the entire screen of the GUI application. Thus
143  in the views hierarchy, the application object serves as the root view.
144  This method can fail and return null if the view still doesn't belong to any
145  owner group. */
146 CoreRoot CoreView_GetRoot( CoreView _this );
147 
148 /* Wrapper function for the virtual method : 'Core::View.GetRoot()' */
149 CoreRoot CoreView__GetRoot( void* _this );
150 
151 /* The method Draw() is invoked automatically if parts of the view should be redrawn
152  on the screen. This can occur when e.g. the view has been moved or the appearance
153  of the view has changed before.
154  Draw() is invoked automatically by the framework, you never will need to invoke
155  this method directly. However you can request an invocation of this method by
156  calling the method InvalidateArea() of the views @Owner. Usually this is also
157  unnecessary unless you are developing your own view.
158  The passed parameters determine the drawing destination aCanvas and the area
159  to redraw aClip in the coordinate space of the canvas. The parameter aOffset
160  contains the displacement between the origin of the views owner and the origin
161  of the canvas. You will need it to convert views coordinates into these of the
162  canvas.
163  The parameter aOpacity contains the opacity descended from this view's @Owner.
164  It lies in range 0 .. 255. If the view implements its own 'Opacity', 'Color',
165  etc. properties, the Draw() method should calculate the resulting real opacity
166  by mixing the values of these properties with the one passed in aOpacity parameter.
167  The parameter aBlend contains the blending mode descended from this view's @Owner.
168  It determines, whether the view should be drawn with alpha-blending active or
169  not. If aBlend is false, the outputs of the view should overwrite the corresponding
170  pixel in the drawing destination aCanvas. If aBlend is true, the outputs should
171  be mixed with the pixel already stored in aCanvas. For this purpose all Graphics
172  Engine functions provide a parameter to specify the mode for the respective drawing
173  operation. If the view implements its own 'Blend' property, the Draw() method
174  should calculate the resulting real blend mode by using logical AND operation
175  of the value of the property and the one passed in aBlend parameter. */
176 void CoreView_Draw( CoreView _this, GraphicsCanvas aCanvas, XRect aClip, XPoint
178 
179 /* Wrapper function for the virtual method : 'Core::View.Draw()' */
180 void CoreView__Draw( void* _this, GraphicsCanvas aCanvas, XRect aClip, XPoint aOffset,
182 
183 /* The method HandleEvent() is invoked automatically if the view has received an
184  event. For example, touching the view on the touch screen can cause the view
185  to receive a Core::CursorEvent event. Within this method the view can evaluate
186  the event and react to it.
187  Whether the event has been handled by the view or not is determined by the return
188  value. To sign an event as handled HandleEvent() should return a valid object
189  (e.g. 'this'). If the event has not been handled, 'null' should be returned.
190  Depending on the kind of the event, the framework can continue dispatching of
191  still unhandled events. For example, keyboard events (Core::KeyEvent class) are
192  automatically delivered to the superior @Owner of the receiver view if this view
193  has ignored the event.
194  HandleEvent() is invoked automatically by the framework, so you never should
195  need to invoke it directly. However you can prepare and post new events by using
196  the methods DispatchEvent() and BroadcastEvent() of the application class Core::Root. */
197 XObject CoreView_HandleEvent( CoreView _this, CoreEvent aEvent );
198 
199 /* Wrapper function for the virtual method : 'Core::View.HandleEvent()' */
200 XObject CoreView__HandleEvent( void* _this, CoreEvent aEvent );
201 
202 /* The method CursorHitTest() is invoked automatically in order to determine whether
203  the view is interested in the receipt of cursor events or not. This method will
204  be invoked immediately after the user has tapped the visible area of the view.
205  If the view is not interested in the cursor event, the framework repeats this
206  procedure for the next behind view until a willing view has been found or all
207  views are evaluated.
208  In the implementation of the method the view can evaluate the passed aArea parameter.
209  It determines the place where the user has tapped the view with his fingertip
210  expressed in the coordinates of the views @Owner. The method can test e.g. whether
211  the tapped area does intersect any touchable areas within the view, etc. The
212  affected finger is identified in the parameter aFinger. The first finger (or
213  the first mouse device button) has the number 0.
214  The parameter aStrikeCount determines how many times the same area has been tapped
215  in series. This is useful to detect series of multiple touches, e.g. in case
216  of the double click, aStrikeCount == 2.
217  The parameter aDedicatedView, if it is not 'null', restricts the event to be
218  handled by this view only. If aDedicatedView == null, no special restriction
219  exists.
220  This method is also invoked if during an existing grab cycle the current target
221  view has decided to resign and deflect the cursor events to another view. This
222  is usually the case after the user has performed a gesture the current target
223  view is not interested to process. Thereupon, the system looks for another view
224  willing to take over the cursor event processing after the performed gesture.
225  Which gesture has caused the operation, is specified in the parameter aRetargetReason.
226  If the view is willing to process the event, the method should create, initialize
227  and return a new Core::CursorHit object. This object identify the willing view.
228  Otherwise the method should return 'null'.
229  CursorHitTest() is invoked automatically by the framework, so you never should
230  need to invoke it directly. This method is predetermined for the hit-test only.
231  The proper processing of events should take place in the @HandleEvent() method
232  by reacting to Core::CursorEvent and Core::DragEvent events. */
233 CoreCursorHit CoreView_CursorHitTest( CoreView _this, XRect aArea, XInt32 aFinger,
234  XInt32 aStrikeCount, CoreView aDedicatedView, XSet aRetargetReason );
235 
236 /* Wrapper function for the virtual method : 'Core::View.CursorHitTest()' */
237 CoreCursorHit CoreView__CursorHitTest( void* _this, XRect aArea, XInt32 aFinger,
238  XInt32 aStrikeCount, CoreView aDedicatedView, XSet aRetargetReason );
239 
240 /* The method ArrangeView() is invoked automatically if the superior @Owner group
241  needs to re-arrange its views. For example, the changing of the owners size can
242  cause the enclosed views to adapt their position and size, so all views still
243  fit within the new owners area. This method provides the core functionality for
244  the automatic GUI layout mechanism.
245  The arrangement is controlled primarily by the @Layout property of the view.
246  It specifies a set of alignment constraints and determines whether the view can
247  change its size. The bounds area where the view should be arranged, is passed
248  in the parameter aBounds. This is usually the current area of the views owner.
249  The parameter aFormation defines the desired arrangement mode. Depending on the
250  value of this parameter, the views can be arranged in rows or columns. If aFormation
251  == Core::Formation.None, no automatic row/column arrangement is performed and
252  the view is moved and scaled only to fit inside the aBounds area.
253  ArrangeView() is invoked automatically by the framework, so you never should
254  need to invoke it directly.
255  The method returns the size of the view after it has been arranged. */
256 XPoint CoreView_ArrangeView( CoreView _this, XRect aBounds, XEnum aFormation );
257 
258 /* Wrapper function for the virtual method : 'Core::View.ArrangeView()' */
259 XPoint CoreView__ArrangeView( void* _this, XRect aBounds, XEnum aFormation );
260 
261 /* The method MoveView() changes the position of the view by adding the value aOffset
262  to all corners of the view. For example, in case of a line view the value is
263  added to the both line end points.
264  The parameter aFastMove serves for the optimization purpose. If it is 'true',
265  the corners are modified without performing any updates of the view and without
266  redrawing the screen. This is useful, when you wish to move or arrange a lot
267  of views at once. In this case it's up to you to request the finally screen update.
268  To do this you can use the method InvalidateArea() of the views @Owner.
269  In the case aFastMove == false, the operation automatically requests the screen
270  redraw of the view areas before and after the movement. You don't need to take
271  care about it. */
272 void CoreView_MoveView( CoreView _this, XPoint aOffset, XBool aFastMove );
273 
274 /* Wrapper function for the virtual method : 'Core::View.MoveView()' */
275 void CoreView__MoveView( void* _this, XPoint aOffset, XBool aFastMove );
276 
277 /* The method GetExtent() returns the position and the size of the view relative
278  to the origin of its @Owner. In case of views with a non rectangular shape the
279  method returns the rectangular boundary area enclosing the entire shape. */
280 XRect CoreView_GetExtent( CoreView _this );
281 
282 /* Wrapper function for the virtual method : 'Core::View.GetExtent()' */
283 XRect CoreView__GetExtent( void* _this );
284 
285 /* The following define announces the presence of the method Core::View.GetExtent(). */
286 #define _CoreView__GetExtent_
287 
288 /* The method ChangeViewState() modifies the current state of the view. The state
289  is a set of switches determining whether a view is visible, whether it can react
290  to user inputs or whether it is just performing some update operations, etc.
291  The modification is controlled by the the both parameters. The first aSetState
292  contains the switches to activate within the view state. The second aClearState
293  determines all switches to disable.
294  Depending on the state alteration the method will perform different operations,
295  e.g. in response to the clearing of the visible state, the method will request
296  a screen redraw to make disappear the view from the screen.
297  ChangeViewState() is invoked automatically by the framework, so you never should
298  need to invoke it directly. All relevant states are available as properties e.g.
299  the property Visible in derived classes reflects the visible state of the view. */
300 void CoreView_ChangeViewState( CoreView _this, XSet aSetState, XSet aClearState );
301 
302 /* Wrapper function for the virtual method : 'Core::View.ChangeViewState()' */
303 void CoreView__ChangeViewState( void* _this, XSet aSetState, XSet aClearState );
304 
305 #ifdef __cplusplus
306  }
307 #endif
308 
309 #endif /* _CoreView_H */
310 
311 /* Embedded Wizard */
CoreView__HandleEvent
XObject CoreView__HandleEvent(void *_this, CoreEvent aEvent)
Definition: Core.c:328
CoreView_Draw
void CoreView_Draw(CoreView _this, GraphicsCanvas aCanvas, XRect aClip, XPoint aOffset, XInt32 aOpacity, XBool aBlend)
Definition: Core.c:284
CoreView_ArrangeView
XPoint CoreView_ArrangeView(CoreView _this, XRect aBounds, XEnum aFormation)
Definition: Core.c:402
ewrte.h
aBounds
XRect aBounds
Definition: _CoreView.h:118
CoreView_HandleEvent
XObject CoreView_HandleEvent(CoreView _this, CoreEvent aEvent)
Definition: Core.c:318
CoreCursorHit
XRect CoreOutline aOutline CoreCursorHit(CoreView _this, XRect aArea, XInt32 aFinger, XInt32 aStrikeCount, CoreView aDedicatedView, XSet aRetargetReason) EW_METHOD(ArrangeView
EW_END_OF_FIELDS
#define EW_END_OF_FIELDS(aClass)
Definition: ewrte.h:460
aOutline
XRect CoreOutline aOutline XRect CoreOutline aOutline
Definition: _CoreView.h:133
EW_DECLARE_CLASS
#define EW_DECLARE_CLASS(aClass)
Definition: ewrte.h:393
CoreView_ChangeViewState
void CoreView_ChangeViewState(CoreView _this, XSet aSetState, XSet aClearState)
Definition: Core.c:472
CoreView_OnSetLayout
void CoreView_OnSetLayout(CoreView _this, XSet value)
Definition: Core.c:203
CoreView__CursorHitTest
CoreCursorHit CoreView__CursorHitTest(void *_this, XRect aArea, XInt32 aFinger, XInt32 aStrikeCount, CoreView aDedicatedView, XSet aRetargetReason)
Definition: Core.c:379
EW_VARIABLE
#define EW_VARIABLE(aName, aType)
Definition: ewrte.h:464
ewgfx.h
_obj_XObject
Definition: ewrte.h:281
CoreView_CursorHitTest
CoreCursorHit CoreView_CursorHitTest(CoreView _this, XRect aArea, XInt32 aFinger, XInt32 aStrikeCount, CoreView aDedicatedView, XSet aRetargetReason)
Definition: Core.c:364
XInt32
signed long XInt32
Definition: ewrte.h:1586
value
XRect CoreOutline aOutline XPoint value
Definition: _ViewsWarpView.h:137
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
CoreView__GetRoot
CoreRoot CoreView__GetRoot(void *_this)
Definition: Core.c:254
XSet
unsigned long XSet
Definition: ewrte.h:1594
CoreView__ArrangeView
XPoint CoreView__ArrangeView(void *_this, XRect aBounds, XEnum aFormation)
Definition: Core.c:413
CoreView__initLayoutContext
void CoreView__initLayoutContext(void *_this, XRect aBounds, CoreOutline aOutline)
Definition: Core.c:197
aOpacity
XRect CoreOutline aOutline GraphicsCanvas XRect XPoint XInt32 aOpacity
Definition: _CoreOutline.h:172
CoreView_GetExtent
XRect CoreView_GetExtent(CoreView _this)
Definition: Core.c:446
CoreView_initLayoutContext
void CoreView_initLayoutContext(CoreView _this, XRect aBounds, CoreOutline aOutline)
Definition: Core.c:188
CoreView_GetRoot
CoreRoot CoreView_GetRoot(CoreView _this)
Definition: Core.c:236
CoreView__ChangeViewState
void CoreView__ChangeViewState(void *_this, XSet aSetState, XSet aClearState)
Definition: Core.c:520
aClip
XRect CoreOutline aOutline GraphicsCanvas XRect aClip
Definition: _CoreOutline.h:171
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
aCanvas
XRect CoreOutline aOutline GraphicsCanvas aCanvas
Definition: _CoreOutline.h:171
CoreView__MoveView
void CoreView__MoveView(void *_this, XPoint aOffset, XBool aFastMove)
Definition: Core.c:438
EW_END_OF_METHODS
#define EW_END_OF_METHODS(aClass)
Definition: ewrte.h:539
CoreView_MoveView
void CoreView_MoveView(CoreView _this, XPoint aOffset, XBool aFastMove)
Definition: Core.c:429
aBlend
XRect CoreOutline aOutline GraphicsCanvas XRect XPoint XInt32 XBool aBlend
Definition: _CoreOutline.h:172
CoreView__Draw
void CoreView__Draw(void *_this, GraphicsCanvas aCanvas, XRect aClip, XPoint aOffset, XInt32 aOpacity, XBool aBlend)
Definition: Core.c:297
EW_METHOD
EW_METHOD(initLayoutContext, void)(CoreView _this
CoreView__GetExtent
XRect CoreView__GetExtent(void *_this)
Definition: Core.c:455
EW_DEFINE_FIELDS
#define EW_DEFINE_FIELDS(aClass, aSuperClass)
Definition: ewrte.h:451