X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/943d32e1c6fbd658b6e460fcb20058d3958f5d77..470402b9966ec0c9b0011193cb82bd6baa4a98c5:/include/wx/generic/animate.h diff --git a/include/wx/generic/animate.h b/include/wx/generic/animate.h index 8b9dc20120..f56056e595 100644 --- a/include/wx/generic/animate.h +++ b/include/wx/generic/animate.h @@ -12,43 +12,17 @@ #ifndef _WX_GENERIC_ANIMATEH__ #define _WX_GENERIC_ANIMATEH__ -#include -#include -#include -#include -#include -#include -#include -#include -#include - -class WXDLLIMPEXP_ADV wxAnimationBase; -class WXDLLIMPEXP_ADV wxAnimationPlayer; -class WXDLLEXPORT wxImage; -class WXDLLEXPORT wxGIFDecoder; -class WXDLLIMPEXP_ADV wxAnimation; - +#include "wx/bitmap.h" // ---------------------------------------------------------------------------- // wxAnimation // ---------------------------------------------------------------------------- -WX_DECLARE_LIST(wxAnimationDecoder, wxAnimationDecoderList); +WX_DECLARE_LIST_WITH_DECL(wxAnimationDecoder, wxAnimationDecoderList, class WXDLLIMPEXP_ADV); class WXDLLIMPEXP_ADV wxAnimation : public wxAnimationBase { public: - wxAnimation(const wxAnimation &tocopy) - { Ref(tocopy); } - wxAnimation() {} - ~wxAnimation() { UnRef(); } - - wxAnimation &operator= (const wxAnimation &tocopy) - { - Ref(tocopy); - return *this; - } - bool operator == (const wxAnimation& anim) const { return m_refData == anim.m_refData; } bool operator != (const wxAnimation& anim) const @@ -68,7 +42,9 @@ public: 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: @@ -83,7 +59,6 @@ public: static void CleanUpHandlers(); static void InitStandardHandlers(); -protected: DECLARE_DYNAMIC_CLASS(wxAnimation) }; @@ -95,7 +70,7 @@ protected: class WXDLLIMPEXP_ADV wxAnimationCtrl: public wxAnimationCtrlBase { public: - wxAnimationCtrl() {} + wxAnimationCtrl() { Init(); } wxAnimationCtrl(wxWindow *parent, wxWindowID id, const wxAnimation& anim = wxNullAnimation, @@ -104,9 +79,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, @@ -129,6 +108,8 @@ public: wxAnimation GetAnimation() const { return m_animation; } + void SetInactiveBitmap(const wxBitmap &bmp); + public: // event handlers void OnPaint(wxPaintEvent& event); @@ -161,10 +142,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; @@ -182,6 +166,7 @@ protected: // on the screen private: + typedef wxAnimationCtrlBase base_type; DECLARE_DYNAMIC_CLASS(wxAnimationCtrl) DECLARE_EVENT_TABLE() };