1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxAnimation and wxAnimationCtrl
4 // Author: Julian Smart and Guillermo Rodriguez Garcia
5 // Modified by: Francesco Montorsi
8 // Copyright: (c) Julian Smart and Guillermo Rodriguez Garcia
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_ANIMATEH__
13 #define _WX_ANIMATEH__
17 #if wxUSE_ANIMATIONCTRL
19 #include "wx/animdecod.h"
20 #include "wx/control.h"
23 class WXDLLIMPEXP_ADV wxAnimation
;
25 extern WXDLLIMPEXP_DATA_ADV(wxAnimation
) wxNullAnimation
;
26 extern WXDLLIMPEXP_DATA_ADV(const wxChar
) wxAnimationCtrlNameStr
[];
29 // ----------------------------------------------------------------------------
31 // ----------------------------------------------------------------------------
33 class WXDLLIMPEXP_ADV wxAnimationBase
: public wxGDIObject
38 virtual bool IsOk() const = 0;
41 virtual int GetDelay(size_t i
) const = 0;
43 virtual size_t GetFrameCount() const = 0;
44 virtual wxImage
GetFrame(size_t i
) const = 0;
45 virtual wxSize
GetSize() const = 0;
47 virtual bool LoadFile(const wxString
&name
, wxAnimationType type
= wxANIMATION_TYPE_ANY
) = 0;
48 virtual bool Load(wxInputStream
&stream
, wxAnimationType type
= wxANIMATION_TYPE_ANY
) = 0;
51 DECLARE_ABSTRACT_CLASS(wxAnimationBase
)
56 // ----------------------------------------------------------------------------
57 // wxAnimationCtrlBase
58 // ----------------------------------------------------------------------------
60 // do not autoresize to the animation's size when SetAnimation() is called
61 #define wxAC_NO_AUTORESIZE (0x0010)
63 // default style does not include wxAC_NO_AUTORESIZE, that is, the control
64 // auto-resizes by default to fit the new animation when SetAnimation() is called
65 #define wxAC_DEFAULT_STYLE (wxNO_BORDER)
68 class WXDLLIMPEXP_ADV wxAnimationCtrlBase
: public wxControl
71 wxAnimationCtrlBase() {}
75 virtual bool LoadFile(const wxString
& filename
, wxAnimationType type
= wxANIMATION_TYPE_ANY
) = 0;
77 virtual void SetAnimation(const wxAnimation
&anim
) = 0;
78 virtual wxAnimation
GetAnimation() const = 0;
80 virtual bool Play() = 0;
81 virtual void Stop() = 0;
83 virtual bool IsPlaying() const = 0;
86 DECLARE_ABSTRACT_CLASS(wxAnimationCtrlBase
)
90 // ----------------------------------------------------------------------------
91 // include the platform-specific version of the wxAnimationCtrl class
92 // ----------------------------------------------------------------------------
94 #if defined(__WXGTK__)
95 #include "wx/gtk/animate.h"
97 #include "wx/generic/animate.h"
100 #endif // wxUSE_ANIMATIONCTRL
102 #endif // _WX_ANIMATEH__