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"
22 #include "wx/bitmap.h"
24 class WXDLLIMPEXP_ADV wxAnimation
;
26 extern WXDLLIMPEXP_DATA_ADV(wxAnimation
) wxNullAnimation
;
27 extern WXDLLIMPEXP_DATA_ADV(const wxChar
) wxAnimationCtrlNameStr
[];
30 // ----------------------------------------------------------------------------
32 // ----------------------------------------------------------------------------
34 class WXDLLIMPEXP_ADV wxAnimationBase
: public wxGDIObject
39 virtual bool IsOk() const = 0;
42 virtual int GetDelay(size_t i
) const = 0;
44 virtual size_t GetFrameCount() const = 0;
45 virtual wxImage
GetFrame(size_t i
) const = 0;
46 virtual wxSize
GetSize() const = 0;
48 virtual bool LoadFile(const wxString
&name
, wxAnimationType type
= wxANIMATION_TYPE_ANY
) = 0;
49 virtual bool Load(wxInputStream
&stream
, wxAnimationType type
= wxANIMATION_TYPE_ANY
) = 0;
52 DECLARE_ABSTRACT_CLASS(wxAnimationBase
)
57 // ----------------------------------------------------------------------------
58 // wxAnimationCtrlBase
59 // ----------------------------------------------------------------------------
61 // do not autoresize to the animation's size when SetAnimation() is called
62 #define wxAC_NO_AUTORESIZE (0x0010)
64 // default style does not include wxAC_NO_AUTORESIZE, that is, the control
65 // auto-resizes by default to fit the new animation when SetAnimation() is called
66 #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;
85 virtual void SetInactiveBitmap(const wxBitmap
&bmp
) = 0;
86 wxBitmap
GetInactiveBitmap() const
87 { return m_bmpStatic
; }
93 DECLARE_ABSTRACT_CLASS(wxAnimationCtrlBase
)
97 // ----------------------------------------------------------------------------
98 // include the platform-specific version of the wxAnimationCtrl class
99 // ----------------------------------------------------------------------------
101 #if defined(__WXGTK20__) && !defined(__WXUNIVERSAL__)
102 #include "wx/gtk/animate.h"
104 #include "wx/generic/animate.h"
107 #endif // wxUSE_ANIMATIONCTRL
109 #endif // _WX_ANIMATEH__