* Switch back to using an wxAnimationBase class

* Change the [GS]etAnimation methods to be non-virtual so they can use generic/native types of animation obj
This commit is contained in:
Robin Dunn
2020-03-30 14:53:11 -07:00
parent 08ac4dbad6
commit a7f9d5e3c5
6 changed files with 120 additions and 67 deletions

View File

@@ -38,20 +38,32 @@ public:
{ return m_pixbuf != NULL; }
// unfortunately GdkPixbufAnimation does not expose these info:
virtual unsigned int GetFrameCount() const wxOVERRIDE { return 0; }
virtual wxImage GetFrame(unsigned int frame) const wxOVERRIDE;
// we can retrieve the delay for a frame only after building
// a GdkPixbufAnimationIter...
virtual int GetDelay(unsigned int WXUNUSED(frame)) const wxOVERRIDE { return 0; }
virtual wxSize GetSize() const wxOVERRIDE;
virtual bool LoadFile(const wxString &name, wxAnimationType type = wxANIMATION_TYPE_ANY) wxOVERRIDE;
virtual bool Load(wxInputStream &stream, wxAnimationType type = wxANIMATION_TYPE_ANY) wxOVERRIDE;
// unfortunately GdkPixbufAnimation does not expose these info:
virtual unsigned int GetFrameCount() const wxOVERRIDE
{ return 0; }
virtual wxImage GetFrame(unsigned int WXUNUSED(frame)) const wxOVERRIDE
{ return wxNullImage; }
virtual wxPoint GetFramePosition(unsigned int WXUNUSED(frame)) const wxOVERRIDE
{ return wxDefaultPosition; }
virtual wxSize GetFrameSize(unsigned int WXUNUSED(frame)) const wxOVERRIDE
{ return wxDefaultSize; }
virtual wxAnimationDisposal GetDisposalMethod(unsigned int WXUNUSED(frame)) const wxOVERRIDE
{ return wxANIM_UNSPECIFIED; }
virtual wxColour GetTransparentColour(unsigned int WXUNUSED(frame)) const wxOVERRIDE
{ return wxNullColour; }
virtual wxColour GetBackgroundColour() const wxOVERRIDE
{ return wxNullColour; }
// Implementation
public: // used by GTK callbacks
@@ -112,9 +124,9 @@ public: // public API
virtual bool LoadFile(const wxString& filename, wxAnimationType type = wxANIMATION_TYPE_ANY) wxOVERRIDE;
virtual bool Load(wxInputStream& stream, wxAnimationType type = wxANIMATION_TYPE_ANY) wxOVERRIDE;
virtual void SetAnimation(const wxAnimation &anim) wxOVERRIDE;
virtual wxAnimation GetAnimation() const wxOVERRIDE
{ return wxAnimation(m_anim); }
void SetAnimation(const wxAnimation &anim);
wxAnimation GetAnimation() const
{ return wxAnimation(m_anim) ; }
virtual bool Play() wxOVERRIDE;
virtual void Stop() wxOVERRIDE;