Guiliani  Version 2.6 revision 7293 (documentation build 12)
GUIAnimationChain.h
1/*
2* Copyright (C) TES Electronic Solutions GmbH,
3* All Rights Reserved.
4* Contact: info@guiliani.de
5*
6* This file is part of the Guiliani HMI framework
7* for the development of graphical user interfaces on embedded systems.
8*/
9
10#if !defined GUIANIMATION_CHAIN__H_
11#define GUIANIMATION_CHAIN__H_
12
13
14#include "GUIAnimatable.h"
15#include "GUIAnimationObserver.h"
16#include "GUIStreamableObject.h"
17#include "eC_TList_doubleLinked.h"
18
19class CGUIAnimation;
20
66{
67 friend class CGUIAnimationHandler;
68public:
71 {
74 };
75
80 {
82 m_pkAnimation(NULL),
83 m_uiOffset(0)
84 {}
85
90 bool operator==(const AnimationInfo_t& rhs) const
91 {
92 return (m_pkAnimation == rhs.m_pkAnimation);
93 }
94
96 eC_UInt m_uiOffset;
97 };
98
101
107 CGUIAnimationChain(const AnimationChain_t eType, const eC_Bool bCyclic = false);
108
111
118 void AddAnimation(CGUIAnimation* pkAnimation, eC_UInt uiTimeOffset = 0);
119
125 void RemoveAnimation(CGUIAnimation* pkAnimation);
126
132
139
144
151
156
161 eC_Bool IsPaused() const;
162
167 virtual eC_Bool IsAnimating() const;
168
173 virtual void DoAnimate(const eC_Value& vTimes = eC_FromInt(1));
174
180 void SetCyclicAnimation(const eC_Bool bCyclicAnimation) { m_bCyclic = bCyclicAnimation; }
181
185 eC_Bool GetCyclicAnimation() const { return m_bCyclic; }
186
195 CGUIAnimation* pAnimation);
196
200 eC_UInt GetID() { return m_uiID; }
201
205 AnimationChain_t GetChainType() { return m_eChainType; }
206
211 const CGUIAnimation* GetAnimation(eC_UInt uiID);
212
216 const AnimationList_t* GetAnimations() { return &m_kAnimationList; }
217
218#if defined(GUILIANI_STREAM_GUI) || defined(GUILIANI_WRITE_GUI)
219 static const eC_UInt ANIMATION_CHAIN_CLASS_VERSION;
220#endif
221
222#ifdef GUILIANI_STREAM_GUI
224
229#endif
230
231#ifdef GUILIANI_WRITE_GUI
232 void WriteToStream(const eC_Bool bWriteClassID = false);
233
234#endif
235
236private:
237 void Init();
238
240 void StartNextAnimation();
241
246 eC_Bool GetNextAnimationStartOffset(eC_UInt& uiNextStartOfset);
247
248 eC_Bool GetNextAnimationsForOffset(const eC_UInt& uiOffset);
249
250 eC_UInt GetDuration();
251
252 void GetNextParallelAnimation();
253
254 void ResetAnimation();
255
256 void SetID(const eC_UInt& uiID);
257
258private:
260 AnimationList_t m_kAnimationList;
261
263 AnimationList_t::SafeIterator m_kNextChainedAnimation;
264
266 AnimationList_t m_kNextParallelAnimations;
267
269 AnimationChain_t m_eChainType;
270
272 eC_UInt m_uiStartTime;
273
275 eC_UInt m_uiExpiredTime;
276
278 eC_UInt m_uiOffsetSave;
279
281 eC_UInt m_uiOffsetRemaining;
282
283 eC_UInt m_uiCurrentStartOffset;
284
286 eC_Bool m_bCyclic;
287
289 eC_UInt m_uiID;
290
291 eC_Bool m_bLastAnimationOfChain;
292};
293
294#endif
Base interface for animation callbacks.
Definition: GUIAnimatable.h:51
An AnimationChain is a combination of several independent animations.
Definition: GUIAnimationChain.h:66
eC_TListDoubleLinked< AnimationInfo_t > AnimationList_t
The animation list is a double-linked list of animation info structs.
Definition: GUIAnimationChain.h:100
void AddAnimation(CGUIAnimation *pkAnimation, eC_UInt uiTimeOffset=0)
eC_Bool IsPaused() const
const CGUIAnimation * GetAnimation(eC_UInt uiID)
virtual void DoAnimate(const eC_Value &vTimes=eC_FromInt(1))
void WriteToStream(const eC_Bool bWriteClassID=false)
CGUIAnimationChain(const AnimationChain_t eType, const eC_Bool bCyclic=false)
virtual eC_Bool IsAnimating() const
void OnStatusChanged(CGUIAnimation::AnimationStatus_t eStatus, CGUIAnimation *pAnimation)
eC_UInt GetID()
Definition: GUIAnimationChain.h:200
AnimationChain_t
Defines the chain type.
Definition: GUIAnimationChain.h:71
@ PARALLEL_ANIMATION
Each animation is started based on its offset relative to the start of the animation chain.
Definition: GUIAnimationChain.h:72
@ CHAINED_ANIMATION
The animations are started one after the other. The offset is used as time between the animations.
Definition: GUIAnimationChain.h:73
eC_Bool GetCyclicAnimation() const
Definition: GUIAnimationChain.h:185
virtual ~CGUIAnimationChain()
Destructor.
void RemoveAnimation(CGUIAnimation *pkAnimation)
void RemoveAllAnimations()
static const eC_UInt ANIMATION_CHAIN_CLASS_VERSION
The class version of the animation chain class.
Definition: GUIAnimationChain.h:219
AnimationChain_t GetChainType()
Definition: GUIAnimationChain.h:205
const AnimationList_t * GetAnimations()
Definition: GUIAnimationChain.h:216
void SetCyclicAnimation(const eC_Bool bCyclicAnimation)
Definition: GUIAnimationChain.h:180
The AnimationHandler is the management class for animations.
Definition: GUIAnimationHandler.h:70
Base class for modular Guiliani animations.
Definition: GUIAnimation.h:75
AnimationStatus_t
Definition: GUIAnimation.h:83
This interface is used to observe the status of an animation.
Definition: GUIAnimationObserver.h:28
Base class for streamable objects.
Definition: GUIStreamableObject.h:46
Holds the animation id and the offset for each animation.
Definition: GUIAnimationChain.h:80
bool operator==(const AnimationInfo_t &rhs) const
Definition: GUIAnimationChain.h:90
CGUIAnimation * m_pkAnimation
animation
Definition: GUIAnimationChain.h:95
eC_UInt m_uiOffset
offset of animation
Definition: GUIAnimationChain.h:96