#if wxUSE_GIF
+#define wxIMAGE_OPTION_GIF_COMMENT wxT("GifComment")
+
struct wxRGB;
struct GifHashTableType;
class WXDLLIMPEXP_FWD_CORE wxImageArray; // anidecod.h
// Save animated gif
bool SaveAnimation(const wxImageArray& images, wxOutputStream *stream,
- bool verbose = true, int delayMilliSecs = 1000,
- const wxString& comment = wxEmptyString);
+ bool verbose = true, int delayMilliSecs = 1000);
protected:
virtual int DoGetImageCount(wxInputStream& stream);
bool DoSaveFile(const wxImage&, wxOutputStream *, bool verbose,
bool first, int delayMilliSecs, bool loop,
const wxRGB *pal, int palCount,
- int mask_index, const wxString& comment = wxEmptyString);
+ int mask_index);
#endif // wxUSE_STREAMS
protected:
bool SetupCompress(wxOutputStream *, int bpp);
bool CompressLine(wxOutputStream *, const wxUint8 *line, int lineLen);
#endif
-public:
- static wxString ms_comment;
+
private:
DECLARE_DYNAMIC_CLASS(wxGIFHandler)
};
wxUint32 HTable[HT_SIZE];
};
-/*static*/ wxString wxGIFHandler::ms_comment;
-
IMPLEMENT_DYNAMIC_CLASS(wxGIFHandler,wxImageHandler)
//----------------------------------------------------------------------------
return wxGIFHandler_GetPalette(*image, pal, &palCount, &maskIndex)
&& DoSaveFile(*image, &stream, verbose, true /*first?*/, 0,
- false /*loop?*/, pal, palCount, maskIndex, ms_comment)
+ false /*loop?*/, pal, palCount, maskIndex)
&& wxGIFHandler_WriteTerm(&stream);
#else
wxUnusedVar(image);
bool wxGIFHandler::DoSaveFile(const wxImage& image, wxOutputStream *stream,
bool WXUNUSED(verbose), bool first, int delayMilliSecs, bool loop,
- const wxRGB *pal, int palCount, int maskIndex, const wxString& comment)
+ const wxRGB *pal, int palCount, int maskIndex)
{
const unsigned long colorcount = image.CountColours(256+1);
bool ok = colorcount && (colorcount <= 256);
if (first)
{
ok = wxGIFHandler_WriteHeader(stream, width, height, loop,
- pal, palCount, comment);
+ pal, palCount, image.GetOption(wxIMAGE_OPTION_GIF_COMMENT));
}
ok = ok && wxGIFHandler_WriteControl(stream, maskIndex, delayMilliSecs)
}
bool wxGIFHandler::SaveAnimation(const wxImageArray& images,
- wxOutputStream *stream, bool verbose, int delayMilliSecs,
- const wxString& comment)
+ wxOutputStream *stream, bool verbose, int delayMilliSecs)
{
#if wxUSE_PALETTE
bool ok = true;
ok = wxGIFHandler_GetPalette(image, pal, &palCount, &maskIndex)
&& DoSaveFile(image, stream, verbose, i == 0 /*first?*/, delayMilliSecs,
- true /*loop?*/, pal, palCount, maskIndex,
- comment.length() ? comment : ms_comment);
+ true /*loop?*/, pal, palCount, maskIndex);
}
return ok && wxGIFHandler_WriteTerm(stream);
wxUnusedVar(stream);
wxUnusedVar(verbose);
wxUnusedVar(delayMilliSecs);
- wxUnusedVar(comment);
return false;
#endif