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
20 #include <wx/string.h>
21 #include <wx/gdicmn.h>
24 #include <wx/bitmap.h>
25 #include <wx/colour.h>
26 #include <wx/control.h>
27 #include <wx/animdecod.h>
29 class WXDLLIMPEXP_ADV wxAnimation
;
31 extern WXDLLEXPORT_DATA(wxAnimation
) wxNullAnimation
;
32 extern WXDLLEXPORT_DATA(const wxChar
) wxAnimationCtrlNameStr
[];
35 // ----------------------------------------------------------------------------
37 // ----------------------------------------------------------------------------
39 class WXDLLEXPORT wxAnimationBase
: public wxGDIObject
44 virtual bool IsOk() const = 0;
47 virtual int GetDelay(size_t i
) const = 0;
49 virtual size_t GetFrameCount() const = 0;
50 virtual wxImage
GetFrame(size_t i
) const = 0;
51 virtual wxSize
GetSize() const = 0;
53 virtual bool LoadFile(const wxString
&name
, wxAnimationType type
= wxANIMATION_TYPE_ANY
) = 0;
54 virtual bool Load(wxInputStream
&stream
, wxAnimationType type
= wxANIMATION_TYPE_ANY
) = 0;
57 DECLARE_ABSTRACT_CLASS(wxAnimationBase
)
62 // ----------------------------------------------------------------------------
63 // wxAnimationCtrlBase
64 // ----------------------------------------------------------------------------
66 // do not autoresize to the animation's size when SetAnimation() is called
67 #define wxAC_NO_AUTORESIZE (0x0010)
69 // default style does not include wxAC_NO_AUTORESIZE, that is, the control
70 // auto-resizes by default to fit the new animation when SetAnimation() is called
71 #define wxAC_DEFAULT_STYLE (wxNO_BORDER)
74 class WXDLLIMPEXP_ADV wxAnimationCtrlBase
: public wxControl
77 wxAnimationCtrlBase() {}
81 virtual bool LoadFile(const wxString
& filename
, wxAnimationType type
= wxANIMATION_TYPE_ANY
) = 0;
83 virtual void SetAnimation(const wxAnimation
&anim
) = 0;
84 virtual wxAnimation
GetAnimation() const = 0;
86 virtual bool Play() = 0;
87 virtual void Stop() = 0;
89 virtual bool IsPlaying() const = 0;
92 DECLARE_ABSTRACT_CLASS(wxAnimationCtrlBase
)
96 // ----------------------------------------------------------------------------
97 // include the platform-specific version of the wxAnimationCtrl class
98 // ----------------------------------------------------------------------------
100 #if defined(__WXGTK__)
101 #include "wx/gtk/animate.h"
103 #include "wx/generic/animate.h"
106 #endif // wxUSE_ANIMATIONCTRL
108 #endif // _WX_ANIMATEH__