X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d18868bb9b22d6f0fd1010779ddab14a6ab398d8..2ff86a86a7f3f5778e3358758c087b8c3507bdc7:/include/wx/anidecod.h?ds=sidebyside diff --git a/include/wx/anidecod.h b/include/wx/anidecod.h index 4375a24f70..15b3adfe11 100644 --- a/include/wx/anidecod.h +++ b/include/wx/anidecod.h @@ -12,55 +12,42 @@ #include "wx/defs.h" -#if wxUSE_STREAMS && wxUSE_ICO_CUR +#if wxUSE_STREAMS && (wxUSE_ICO_CUR || wxUSE_GIF) #include "wx/stream.h" #include "wx/image.h" #include "wx/animdecod.h" +#include "wx/dynarray.h" -class /*WXDLLEXPORT*/ wxANIFrameInfo; +class /*WXDLLIMPEXP_CORE*/ wxANIFrameInfo; // private implementation detail -WX_DECLARE_OBJARRAY(wxANIFrameInfo, wxANIFrameInfoArray); -WX_DECLARE_OBJARRAY(wxImage, wxImageArray); +WX_DECLARE_EXPORTED_OBJARRAY(wxANIFrameInfo, wxANIFrameInfoArray); +WX_DECLARE_EXPORTED_OBJARRAY(wxImage, wxImageArray); // -------------------------------------------------------------------------- // wxANIDecoder class // -------------------------------------------------------------------------- -class WXDLLEXPORT wxANIDecoder : public wxAnimationDecoder +class WXDLLIMPEXP_CORE wxANIDecoder : public wxAnimationDecoder { -private: - - // frames stored as wxImage(s): ANI files are meant to be used mostly for animated - // cursors and thus they do not use any optimization to encode differences between - // two frames: they are just a list of images to display sequentially. - wxImageArray m_images; - - // the info about each image stored in m_images. - // NB: m_info.GetCount() may differ from m_images.GetCount()! - wxANIFrameInfoArray m_info; - - // this is the wxCURHandler used to load the ICON chunk of the ANI files - static wxCURHandler sm_handler; - -public: - virtual wxSize GetFrameSize(size_t frame) const; - virtual wxPoint GetFramePosition(size_t frame) const; - virtual wxAnimationDisposal GetDisposalMethod(size_t frame) const; - virtual long GetDelay(size_t frame) const; - public: // constructor, destructor, etc. wxANIDecoder(); ~wxANIDecoder(); -public: // implementation of wxAnimationDecoder's pure virtuals - virtual bool CanRead( wxInputStream& stream ) const; + virtual wxSize GetFrameSize(unsigned int frame) const; + virtual wxPoint GetFramePosition(unsigned int frame) const; + virtual wxAnimationDisposal GetDisposalMethod(unsigned int frame) const; + virtual long GetDelay(unsigned int frame) const; + virtual wxColour GetTransparentColour(unsigned int frame) const; + + // implementation of wxAnimationDecoder's pure virtuals + virtual bool Load( wxInputStream& stream ); - bool ConvertToImage(size_t frame, wxImage *image) const; + bool ConvertToImage(unsigned int frame, wxImage *image) const; wxAnimationDecoder *Clone() const { return new wxANIDecoder; } @@ -68,10 +55,27 @@ public: // implementation of wxAnimationDecoder's pure virtuals { return wxANIMATION_TYPE_ANI; } private: - DECLARE_NO_COPY_CLASS(wxANIDecoder) + // wxAnimationDecoder pure virtual: + virtual bool DoCanRead( wxInputStream& stream ) const; + // modifies current stream position (see wxAnimationDecoder::CanRead) + + // frames stored as wxImage(s): ANI files are meant to be used mostly for animated + // cursors and thus they do not use any optimization to encode differences between + // two frames: they are just a list of images to display sequentially. + wxImageArray m_images; + + // the info about each image stored in m_images. + // NB: m_info.GetCount() may differ from m_images.GetCount()! + wxANIFrameInfoArray m_info; + + // this is the wxCURHandler used to load the ICON chunk of the ANI files + static wxCURHandler sm_handler; + + + wxDECLARE_NO_COPY_CLASS(wxANIDecoder); }; -#endif // wxUSE_STREAM && wxUSE_ICO_CUR +#endif // wxUSE_STREAMS && (wxUSE_ICO_CUR || wxUSE_GIF) #endif // _WX_ANIDECOD_H