#ifndef _WX_GIFDECOD_H
#define _WX_GIFDECOD_H
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(__APPLE__)
#pragma interface "gifdecod.h"
#endif
// --------------------------------------------------------------------------
-// constants
+// Constants
// --------------------------------------------------------------------------
-// disposal method
+// Error codes:
+// Note that the error code wxGIF_TRUNCATED means that the image itself
+// is most probably OK, but the decoder didn't reach the end of the data
+// stream; this means that if it was not reading directly from file,
+// the stream will not be correctly positioned. the
+//
+enum
+{
+ wxGIF_OK = 0, /* everything was OK */
+ wxGIF_INVFORMAT, /* error in gif header */
+ wxGIF_MEMERR, /* error allocating memory */
+ wxGIF_TRUNCATED /* file appears to be truncated */
+};
+
+// Disposal method
+// Experimental; subject to change.
+//
enum
{
wxGIF_D_UNSPECIFIED = -1, /* not specified */
wxGIF_D_TOPREVIOUS = 2 /* restore to previous image */
};
-// error codes
-enum
-{
- wxGIF_OK = 0, /* everything was OK */
- wxGIF_INVFORMAT = 1, /* error in gif header */
- wxGIF_MEMERR = 2 /* error allocating memory */
-};
#define MAX_BLOCK_SIZE 256 /* max. block size */
class GIFImage
{
public:
+ // def ctor
+ GIFImage();
+
unsigned int w; /* width */
unsigned int h; /* height */
unsigned int left; /* x coord (in logical screen) */
unsigned char *pal; /* palette */
GIFImage *next; /* next image */
GIFImage *prev; /* prev image */
+
+ DECLARE_NO_COPY_CLASS(GIFImage)
};
int getcode(int bits, int abfin);
int dgif(GIFImage *img, int interl, int bits);
-protected:
+public:
// get data of current frame
int GetFrameIndex() const;
unsigned char* GetData() const;
// convert current frame to wxImage
bool ConvertToImage(wxImage *image) const;
+
+ DECLARE_NO_COPY_CLASS(wxGIFDecoder)
};