X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e07c114691a53dd0203809b6c630a4320aef05f7..623a195ec2e8fde5106a221d4547db331ebb6676:/include/wx/generic/animate.h diff --git a/include/wx/generic/animate.h b/include/wx/generic/animate.h index 9a7b30f58b..fd7ee2a824 100644 --- a/include/wx/generic/animate.h +++ b/include/wx/generic/animate.h @@ -12,6 +12,8 @@ #ifndef _WX_GENERIC_ANIMATEH__ #define _WX_GENERIC_ANIMATEH__ +#include "wx/bitmap.h" + // ---------------------------------------------------------------------------- // wxAnimation // ---------------------------------------------------------------------------- @@ -21,26 +23,25 @@ WX_DECLARE_LIST_WITH_DECL(wxAnimationDecoder, wxAnimationDecoderList, class WXDL class WXDLLIMPEXP_ADV wxAnimation : public wxAnimationBase { public: - bool operator == (const wxAnimation& anim) const - { return m_refData == anim.m_refData; } - bool operator != (const wxAnimation& anim) const - { return m_refData != anim.m_refData; } - - bool IsOk() const + virtual bool IsOk() const { return m_refData != NULL; } - size_t GetFrameCount() const; - int GetDelay(size_t i) const; - wxImage GetFrame(size_t i) const; - wxSize GetSize() const; + virtual size_t GetFrameCount() const; + virtual int GetDelay(size_t i) const; + virtual wxImage GetFrame(size_t i) const; + virtual wxSize GetSize() const; - bool LoadFile(const wxString& filename, wxAnimationType type = wxANIMATION_TYPE_ANY); - bool Load(wxInputStream &stream, wxAnimationType type = wxANIMATION_TYPE_ANY); + virtual bool LoadFile(const wxString& filename, + wxAnimationType type = wxANIMATION_TYPE_ANY); + virtual bool Load(wxInputStream& stream, + wxAnimationType type = wxANIMATION_TYPE_ANY); public: // extended interface used by the generic implementation of wxAnimationCtrl wxPoint GetFramePosition(size_t frame) const; + wxSize GetFrameSize(size_t frame) const; wxAnimationDisposal GetDisposalMethod(size_t frame) const; + wxColour GetTransparentColour(size_t frame) const; wxColour GetBackgroundColour() const; protected: @@ -66,7 +67,7 @@ public: class WXDLLIMPEXP_ADV wxAnimationCtrl: public wxAnimationCtrlBase { public: - wxAnimationCtrl(); + wxAnimationCtrl() { Init(); } wxAnimationCtrl(wxWindow *parent, wxWindowID id, const wxAnimation& anim = wxNullAnimation, @@ -75,9 +76,13 @@ public: long style = wxAC_DEFAULT_STYLE, const wxString& name = wxAnimationCtrlNameStr) { + Init(); + Create(parent, id, anim, pos, size, style, name); } + void Init(); + bool Create(wxWindow *parent, wxWindowID id, const wxAnimation& anim = wxNullAnimation, const wxPoint& pos = wxDefaultPosition, @@ -100,6 +105,8 @@ public: wxAnimation GetAnimation() const { return m_animation; } + void SetInactiveBitmap(const wxBitmap &bmp); + public: // event handlers void OnPaint(wxPaintEvent& event); @@ -132,10 +139,13 @@ protected: // internal utilities void FitToAnimation(); // Draw the background; use this when e.g. previous frame had wxANIM_TOBACKGROUND disposal. + void DisposeToBackground(); void DisposeToBackground(wxDC& dc); + void DisposeToBackground(wxDC& dc, const wxPoint &pos, const wxSize &sz); + void UpdateBackingStoreWithStaticImage(); void IncrementalUpdateBackingStore(); - void RebuildBackingStoreUpToFrame(size_t); + bool RebuildBackingStoreUpToFrame(size_t); void DrawFrame(wxDC &dc, size_t); virtual wxSize DoGetBestSize() const;