WebRadioApp  0.1
_EffectsPositionFader.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 _EffectsPositionFader_H
28 #define _EffectsPositionFader_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 "_EffectsFader.h"
46 #include "_EffectsInt32Effect.h"
47 #include "_EffectsPointEffect.h"
48 
49 /* Forward declaration of the class Core::Group */
50 #ifndef _CoreGroup_
51  EW_DECLARE_CLASS( CoreGroup )
52 #define _CoreGroup_
53 #endif
54 
55 /* Forward declaration of the class Effects::FaderTask */
56 #ifndef _EffectsFaderTask_
57  EW_DECLARE_CLASS( EffectsFaderTask )
58 #define _EffectsFaderTask_
59 #endif
60 
61 /* Forward declaration of the class Effects::PositionFader */
62 #ifndef _EffectsPositionFader_
63  EW_DECLARE_CLASS( EffectsPositionFader )
64 #define _EffectsPositionFader_
65 #endif
66 
67 
68 /* The class Effects::PositionFader provides functionality for the fade-in and fade-out
69  transitions affecting the position and eventually the opacity of a given GUI
70  component. This fader is thus ideal wherever one GUI component should smoothly
71  appear or disappear by moving it within another component.
72  The parameters for the translation (the desired start and the end position, the
73  duration of the animation, its timing, etc.) are configured in the embedded object
74  @PositionEffect. If the property @UseCurrentState is 'true', the position where
75  to start the animation is automatically taken over from the affected GUI component
76  as it is just in the moment the fader starts the transition.
77  The parameters for the opacity transition (their start and the end values, the
78  duration of the transition, the timing, etc.) are configured in the embedded
79  object @OpacityEffect. If the property @UseCurrentState is 'true', the opacity
80  to start the animation is automatically taken over from the affected GUI component
81  as it is just in the moment the fader starts the transition.
82  Whether the fader is considered as performing a fade-in or fade-out transition
83  is determined by value of the property @Visible. Set this property to the value
84  'true' if you want the component to appear or remain visible after the transition
85  is done. Set this property to the value 'false' if your intention is to hide
86  or keep invisible the component.
87  With the property @Buffered you can configure, whether the fader should additionally
88  enable the buffering mode for the affected GUI component while it drives the
89  transition.
90  The fader automatically takes care of adding the GUI component to the intended
91  owner, when the component should appear and it is not yet a member within the
92  owner. Moreover, when fading-in the component, the fader automatically focuses
93  it and restacks it to appear above all other sibling views existing already within
94  the owner component. This behavior can be configured by modifying the properties
95  @AssignFocus and @RestackTopmost.
96  The fader automatically removes the GUI component from its owner, when the component
97  disappears (after fade-out). This behavior can be changed by modifying the property
98  @RemoveIfHidden.
99  Applying the fade-out transition on a GUI component, which is already invisible
100  has no effect. Similarly, the fade-in transition has no effect if the GUI component
101  is already visible and has the opacity and position equal to the specified in
102  @PositionEffect and @OpacityEffect objects. In both cases the affected component
103  retains its actual state and the fader finishes its work immediately without
104  driving the effect objects and waiting for their completion.
105  In practice, you create an instance of the fader class, configure its properties
106  (in particular the property @Visible) and the @PositionEffect and @OpacityEffect
107  objects according to the desired kind of transition and pass both, the fader
108  instance and the affected GUI component as parameters in the invocation of the
109  method Core::Group.FadeGroup(). */
110 EW_DEFINE_FIELDS( EffectsPositionFader, EffectsFader )
111  EW_OBJECT ( OpacityEffect, EffectsInt32Effect )
112  EW_OBJECT ( PositionEffect, EffectsPointEffect )
113  EW_PROPERTY( Buffered, XBool )
114  EW_VARIABLE( finished, XBool )
115  EW_VARIABLE( wasBuffered, XBool )
116 EW_END_OF_FIELDS( EffectsPositionFader )
117 
118 /* Virtual Method Table (VMT) for the class : 'Effects::PositionFader' */
119 EW_DEFINE_METHODS( EffectsPositionFader, EffectsFader )
120  EW_METHOD( IsFinished, XBool )( EffectsPositionFader _this )
121  EW_METHOD( OnEnd, void )( EffectsPositionFader _this )
122  EW_METHOD( OnStart, void )( EffectsPositionFader _this )
123 EW_END_OF_METHODS( EffectsPositionFader )
124 
125 /* The method IsFinished() should return 'true' if the fader has finalized its fading
126  animation and 'false' if the animation is not started or it is still in progress.
127  This method should therefore be overridden in derived classes to evaluate the
128  state of animation effects used inside the fader. */
129 XBool EffectsPositionFader_IsFinished( EffectsPositionFader _this );
130 
131 /* The method OnEnd() is invoked automatically just in the moment, when this fader
132  and all other faders belonging to the same fading task have signaled that they
133  are finished with their animations. The default implementation of this method
134  simply does nothing.
135  Derived classes can override this method and implement there the code to complete
136  the animation (e.g. to remove the group from its owner after it has been faded-out,
137  etc.). The implementation of the overridden OnEnd() method has to use the variables
138  @Group and @Owner to determine on which group the fader has applied the animation.
139  Depending on the kind of the implemented animation, the OnEnd() method can also
140  evaluate the properties @UseCurrentState, @AssignFocus and @RestackTopmost. */
141 void EffectsPositionFader_OnEnd( EffectsPositionFader _this );
142 
143 /* The method OnStart() is invoked automatically just in the moment, when the fader
144  is triggered to begin its animation. The default implementation of this method
145  simply calls the @Complete() method indicating so, that the fader is done with
146  its work. Thereupon the next fader waiting for its execution can start.
147  Derived classes should override this method and implement there the code to prepare
148  and start the desired fade-in/out animation effects. The implementation of the
149  overridden OnStart() method has to use the variables @Group and @Owner to determine
150  on which group the fader should apply the animation. Depending on the kind of
151  the implemented animation, the OnStart() method can also evaluate the properties
152  @UseCurrentState, @AssignFocus and @RestackTopmost.
153  Please note, if there is a slot method associated to the property @OnInitialize,
154  this slot method is signaled shortly before the method OnStart() is executed
155  given the slot method a possibility to apply more individual initialization steps
156  on the fader just before the animation begins.
157  When the animation reaches its end (e.g. when the animation effects used inside
158  the fader do terminate), your implementation of the fader should invoke the method
159  @Complete() otherwise the animation is considered as still being in progress
160  causing other pending faders to wait. */
161 void EffectsPositionFader_OnStart( EffectsPositionFader _this );
162 
163 /* 'C' function for method : 'Effects::PositionFader.onFinished()' */
164 void EffectsPositionFader_onFinished( EffectsPositionFader _this, XObject sender );
165 
166 /* 'C' function for method : 'Effects::PositionFader.onAnimate()' */
167 void EffectsPositionFader_onAnimate( EffectsPositionFader _this, XObject sender );
168 
169 #ifdef __cplusplus
170  }
171 #endif
172 
173 #endif /* _EffectsPositionFader_H */
174 
175 /* Embedded Wizard */
ewrte.h
EffectsPositionFader_onAnimate
void EffectsPositionFader_onAnimate(EffectsPositionFader _this, XObject sender)
Definition: Effects.c:1865
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
EW_VARIABLE
#define EW_VARIABLE(aName, aType)
Definition: ewrte.h:464
_EffectsPointEffect.h
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
EffectsFader(EffectsShowHideTransition _this) EW_METHOD(CreateRestoreFader
EffectsPositionFader_IsFinished
XBool EffectsPositionFader_IsFinished(EffectsPositionFader _this)
Definition: Effects.c:1685
_EffectsFader.h
EffectsPositionFader_OnEnd
void EffectsPositionFader_OnEnd(EffectsPositionFader _this)
Definition: Effects.c:1700
EffectsPositionFader_onFinished
void EffectsPositionFader_onFinished(EffectsPositionFader _this, XObject sender)
Definition: Effects.c:1855
sender
XRect CoreOutline aOutline XObject sender
Definition: _ApplicationRadioInterface.h:186
EW_PROPERTY
#define EW_PROPERTY(aName, aType)
Definition: ewrte.h:466
EW_OBJECT
#define EW_OBJECT(aName, aObjectClass)
Definition: ewrte.h:468
EW_END_OF_METHODS
#define EW_END_OF_METHODS(aClass)
Definition: ewrte.h:539
_EffectsInt32Effect.h
EW_METHOD
EW_METHOD(IsFinished, XBool)(EffectsPositionFader _this) EW_METHOD(OnEnd
EffectsPositionFader_OnStart
void EffectsPositionFader_OnStart(EffectsPositionFader _this)
Definition: Effects.c:1738
EW_DEFINE_FIELDS
#define EW_DEFINE_FIELDS(aClass, aSuperClass)
Definition: ewrte.h:451