]> git.saurik.com Git - wxWidgets.git/blame - include/wx/animate.h
remove tests for bool and {const,static,reinterpret}_cast in configure and wx/defs...
[wxWidgets.git] / include / wx / animate.h
CommitLineData
72045d57
VZ
1/////////////////////////////////////////////////////////////////////////////
2// Name: wx/animate.h
3// Purpose: wxAnimation and wxAnimationCtrl
4// Author: Julian Smart and Guillermo Rodriguez Garcia
5// Modified by: Francesco Montorsi
6// Created: 13/8/99
7// RCS-ID: $Id$
8// Copyright: (c) Julian Smart and Guillermo Rodriguez Garcia
9// Licence: wxWindows licence
10/////////////////////////////////////////////////////////////////////////////
11
870cf35c
VZ
12#ifndef _WX_ANIMATE_H_
13#define _WX_ANIMATE_H_
72045d57
VZ
14
15#include "wx/defs.h"
16
17#if wxUSE_ANIMATIONCTRL
18
c2f12218
PC
19#include "wx/animdecod.h"
20#include "wx/control.h"
21#include "wx/timer.h"
8e458bb5 22#include "wx/bitmap.h"
72045d57 23
b5dbe15d 24class WXDLLIMPEXP_FWD_ADV wxAnimation;
72045d57 25
943d32e1
RD
26extern WXDLLIMPEXP_DATA_ADV(wxAnimation) wxNullAnimation;
27extern WXDLLIMPEXP_DATA_ADV(const wxChar) wxAnimationCtrlNameStr[];
72045d57
VZ
28
29
30// ----------------------------------------------------------------------------
31// wxAnimationBase
32// ----------------------------------------------------------------------------
33
8f884a0d 34class WXDLLIMPEXP_ADV wxAnimationBase : public wxObject
72045d57
VZ
35{
36public:
37 wxAnimationBase() {}
38
39 virtual bool IsOk() const = 0;
40
41 // can be -1
870cf35c 42 virtual int GetDelay(unsigned int frame) const = 0;
72045d57 43
870cf35c
VZ
44 virtual unsigned int GetFrameCount() const = 0;
45 virtual wxImage GetFrame(unsigned int frame) const = 0;
72045d57
VZ
46 virtual wxSize GetSize() const = 0;
47
870cf35c
VZ
48 virtual bool LoadFile(const wxString& name,
49 wxAnimationType type = wxANIMATION_TYPE_ANY) = 0;
50 virtual bool Load(wxInputStream& stream,
51 wxAnimationType type = wxANIMATION_TYPE_ANY) = 0;
72045d57
VZ
52
53protected:
54 DECLARE_ABSTRACT_CLASS(wxAnimationBase)
55};
56
57
58
59// ----------------------------------------------------------------------------
60// wxAnimationCtrlBase
61// ----------------------------------------------------------------------------
62
63// do not autoresize to the animation's size when SetAnimation() is called
64#define wxAC_NO_AUTORESIZE (0x0010)
65
66// default style does not include wxAC_NO_AUTORESIZE, that is, the control
67// auto-resizes by default to fit the new animation when SetAnimation() is called
2fd0ada5 68#define wxAC_DEFAULT_STYLE (wxBORDER_NONE)
72045d57 69
72045d57
VZ
70class WXDLLIMPEXP_ADV wxAnimationCtrlBase : public wxControl
71{
72public:
870cf35c 73 wxAnimationCtrlBase() { }
72045d57 74
870cf35c
VZ
75 // public API
76 virtual bool LoadFile(const wxString& filename,
77 wxAnimationType type = wxANIMATION_TYPE_ANY) = 0;
462167a9
VZ
78 virtual bool Load(wxInputStream& stream,
79 wxAnimationType type = wxANIMATION_TYPE_ANY) = 0;
72045d57
VZ
80
81 virtual void SetAnimation(const wxAnimation &anim) = 0;
82 virtual wxAnimation GetAnimation() const = 0;
83
84 virtual bool Play() = 0;
85 virtual void Stop() = 0;
86
87 virtual bool IsPlaying() const = 0;
88
1bd2ceb5
RR
89 virtual void SetInactiveBitmap(const wxBitmap &bmp);
90
91 // always return the original bitmap set in this control
8e458bb5
RR
92 wxBitmap GetInactiveBitmap() const
93 { return m_bmpStatic; }
94
95protected:
1bd2ceb5 96 // the inactive bitmap as it was set by the user
8e458bb5
RR
97 wxBitmap m_bmpStatic;
98
1bd2ceb5
RR
99 // the inactive bitmap currently shown in the control
100 // (may differ in the size from m_bmpStatic)
101 wxBitmap m_bmpStaticReal;
102
103 // updates m_bmpStaticReal from m_bmpStatic if needed
104 virtual void UpdateStaticImage();
105
106 // called by SetInactiveBitmap
107 virtual void DisplayStaticImage() = 0;
108
72045d57
VZ
109private:
110 DECLARE_ABSTRACT_CLASS(wxAnimationCtrlBase)
111};
112
113
114// ----------------------------------------------------------------------------
115// include the platform-specific version of the wxAnimationCtrl class
116// ----------------------------------------------------------------------------
117
5f8047a6 118#if defined(__WXGTK20__) && !defined(__WXUNIVERSAL__)
72045d57
VZ
119 #include "wx/gtk/animate.h"
120#else
121 #include "wx/generic/animate.h"
122#endif
123
870cf35c 124#endif // wxUSE_ANIMATIONCTRL
72045d57 125
870cf35c 126#endif // _WX_ANIMATE_H_