WebRadioApp  0.1
_EffectsFader.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 _EffectsFader_H
28 #define _EffectsFader_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::Group */
46 #ifndef _CoreGroup_
47  EW_DECLARE_CLASS( CoreGroup )
48 #define _CoreGroup_
49 #endif
50 
51 /* Forward declaration of the class Effects::Fader */
52 #ifndef _EffectsFader_
54 #define _EffectsFader_
55 #endif
56 
57 /* Forward declaration of the class Effects::FaderTask */
58 #ifndef _EffectsFaderTask_
59  EW_DECLARE_CLASS( EffectsFaderTask )
60 #define _EffectsFaderTask_
61 #endif
62 
63 
64 /* The class Effects::Fader provides the basic infrastructure, which can be enhanced
65  in derived classes in order to implement sophisticated transitions for fading-in
66  and/or fading-out GUI components. At the runtime, an instance of the fader class
67  represents a transition you can simply apply on a GUI component by passing both,
68  the fader instance and the affected GUI component as parameters in the invocation
69  of the method Core::Group.FadeGroup(). The infrastructure consists of:
70  - The method @OnStart(), which is invoked automatically as soon as the fader
71  is scheduled to start with its transition. Usually, in derived classes this method
72  has then the job to create, initialize and start animation effects (instances
73  of classes descending from Effects::Effect) to fade-in or fade-out the GUI component
74  @Group within another component @Owner.
75  - Whether the fader is intended to perform a fade-in or fade-out transition is
76  determined in the property @Visible. Initializing this property with 'true' indicates,
77  that the affected component should become or/and remain visible during and after
78  the transition.
79  - As soon as all involved animation effects has finalized their work, the fader
80  should invoke its method @Complete().
81  - By overriding the method @OnEnd() the implementation of the fader can additionally
82  be adapted to perform further operation just at the end of the transition, for
83  example to remove @Group from its @Owner after it has been faded-out, etc.
84  - The method @IsFinished() should be overridden in derived class to return 'true'
85  if all animation effects has finalized their work.
86  - Furthermore, the properties @AddToOwner, @AssignFocus, @RemoveIfHidden, @RestackTopmost
87  and @UseCurrentState are available to provide common parameters how the fader
88  should act. These properties should be evaluated in the implementation of the
89  @OnStart() and/or @OnEnd() method.
90  - The property @OnInitialize can refer to a slot method containing more individual
91  code to initialize the fader just in the moment it is started.
92  Being the basic class, Effects::Fader doesn't implement any particular transition
93  effects. This class is intended to be overridden and enhanced accordingly. */
95  EW_VARIABLE( task, EffectsFaderTask )
96  EW_VARIABLE( prev, EffectsFader )
97  EW_VARIABLE( next, EffectsFader )
98  EW_VARIABLE( Owner, CoreGroup )
99  EW_VARIABLE( Group, CoreGroup )
100  EW_VARIABLE( onCancel, XSlot )
101  EW_VARIABLE( onComplete, XSlot )
102  EW_PROPERTY( OnInitialize, XSlot )
103  EW_PROPERTY( Visible, XBool )
104  EW_PROPERTY( UseCurrentState, XBool )
105  EW_PROPERTY( AddToOwner, XBool )
106  EW_PROPERTY( AssignFocus, XBool )
107  EW_PROPERTY( RestackTopmost, XBool )
108  EW_PROPERTY( RemoveIfHidden, XBool )
110 
111 /* Virtual Method Table (VMT) for the class : 'Effects::Fader' */
113  EW_METHOD( IsFinished, XBool )( EffectsFader _this )
114  EW_METHOD( OnEnd, void )( EffectsFader _this )
115  EW_METHOD( OnStart, void )( EffectsFader _this )
117 
118 /* The method Complete() is intended to be called by the implementation of your
119  adapted fader as soon as the animation effects used inside the fader has finalized
120  their work. This is essential in order to ensure, that next faders waiting for
121  execution can start with their animations. */
122 void EffectsFader_Complete( EffectsFader _this );
123 
124 /* The method IsFinished() should return 'true' if the fader has finalized its fading
125  animation and 'false' if the animation is not started or it is still in progress.
126  This method should therefore be overridden in derived classes to evaluate the
127  state of animation effects used inside the fader. */
129 
130 /* Wrapper function for the virtual method : 'Effects::Fader.IsFinished()' */
131 XBool EffectsFader__IsFinished( void* _this );
132 
133 /* The method OnEnd() is invoked automatically just in the moment, when this fader
134  and all other faders belonging to the same fading task have signaled that they
135  are finished with their animations. The default implementation of this method
136  simply does nothing.
137  Derived classes can override this method and implement there the code to complete
138  the animation (e.g. to remove the group from its owner after it has been faded-out,
139  etc.). The implementation of the overridden OnEnd() method has to use the variables
140  @Group and @Owner to determine on which group the fader has applied the animation.
141  Depending on the kind of the implemented animation, the OnEnd() method can also
142  evaluate the properties @UseCurrentState, @AssignFocus and @RestackTopmost. */
143 void EffectsFader_OnEnd( EffectsFader _this );
144 
145 /* Wrapper function for the virtual method : 'Effects::Fader.OnEnd()' */
146 void EffectsFader__OnEnd( void* _this );
147 
148 /* The method OnStart() is invoked automatically just in the moment, when the fader
149  is triggered to begin its animation. The default implementation of this method
150  simply calls the @Complete() method indicating so, that the fader is done with
151  its work. Thereupon the next fader waiting for its execution can start.
152  Derived classes should override this method and implement there the code to prepare
153  and start the desired fade-in/out animation effects. The implementation of the
154  overridden OnStart() method has to use the variables @Group and @Owner to determine
155  on which group the fader should apply the animation. Depending on the kind of
156  the implemented animation, the OnStart() method can also evaluate the properties
157  @UseCurrentState, @AssignFocus and @RestackTopmost.
158  Please note, if there is a slot method associated to the property @OnInitialize,
159  this slot method is signaled shortly before the method OnStart() is executed
160  given the slot method a possibility to apply more individual initialization steps
161  on the fader just before the animation begins.
162  When the animation reaches its end (e.g. when the animation effects used inside
163  the fader do terminate), your implementation of the fader should invoke the method
164  @Complete() otherwise the animation is considered as still being in progress
165  causing other pending faders to wait. */
166 void EffectsFader_OnStart( EffectsFader _this );
167 
168 /* Wrapper function for the virtual method : 'Effects::Fader.OnStart()' */
169 void EffectsFader__OnStart( void* _this );
170 
171 #ifdef __cplusplus
172  }
173 #endif
174 
175 #endif /* _EffectsFader_H */
176 
177 /* Embedded Wizard */
EW_METHOD
EW_METHOD(IsFinished, XBool)(EffectsFader _this) EW_METHOD(OnEnd
ewrte.h
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
XSlot
Definition: ewrte.h:2114
EW_VARIABLE
#define EW_VARIABLE(aName, aType)
Definition: ewrte.h:464
EffectsFader__OnStart
void EffectsFader__OnStart(void *_this)
Definition: Effects.c:1483
ewgfx.h
_obj_XObject
Definition: ewrte.h:281
XBool
char XBool
Definition: ewrte.h:1592
EW_DEFINE_METHODS
#define EW_DEFINE_METHODS(aClass, aSuperClass)
Definition: ewrte.h:524
EffectsFader_IsFinished
XBool EffectsFader_IsFinished(EffectsFader _this)
Definition: Effects.c:1423
EffectsFader
EffectsFader(EffectsShowHideTransition _this) EW_METHOD(CreateRestoreFader
EffectsFader_Complete
void EffectsFader_Complete(EffectsFader _this)
Definition: Effects.c:1413
EffectsFader__IsFinished
XBool EffectsFader__IsFinished(void *_this)
Definition: Effects.c:1432
EW_PROPERTY
#define EW_PROPERTY(aName, aType)
Definition: ewrte.h:466
EffectsFader_OnStart
void EffectsFader_OnStart(EffectsFader _this)
Definition: Effects.c:1477
EW_END_OF_METHODS
#define EW_END_OF_METHODS(aClass)
Definition: ewrte.h:539
EffectsFader__OnEnd
void EffectsFader__OnEnd(void *_this)
Definition: Effects.c:1454
EffectsFader_OnEnd
void EffectsFader_OnEnd(EffectsFader _this)
Definition: Effects.c:1447
EW_DEFINE_FIELDS
#define EW_DEFINE_FIELDS(aClass, aSuperClass)
Definition: ewrte.h:451