xpmdecod.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/xpmdecod.h
  3. // Purpose: wxXPMDecoder, XPM reader for wxImage and wxBitmap
  4. // Author: Vaclav Slavik
  5. // Copyright: (c) 2001 Vaclav Slavik
  6. // Licence: wxWindows licence
  7. /////////////////////////////////////////////////////////////////////////////
  8. #ifndef _WX_XPMDECOD_H_
  9. #define _WX_XPMDECOD_H_
  10. #include "wx/defs.h"
  11. #if wxUSE_IMAGE && wxUSE_XPM
  12. class WXDLLIMPEXP_FWD_CORE wxImage;
  13. class WXDLLIMPEXP_FWD_BASE wxInputStream;
  14. // --------------------------------------------------------------------------
  15. // wxXPMDecoder class
  16. // --------------------------------------------------------------------------
  17. class WXDLLIMPEXP_CORE wxXPMDecoder
  18. {
  19. public:
  20. // constructor, destructor, etc.
  21. wxXPMDecoder() {}
  22. ~wxXPMDecoder() {}
  23. #if wxUSE_STREAMS
  24. // Is the stream XPM file?
  25. // NOTE: this function modifies the current stream position
  26. bool CanRead(wxInputStream& stream);
  27. // Read XPM file from the stream, parse it and create image from it
  28. wxImage ReadFile(wxInputStream& stream);
  29. #endif
  30. // Read directly from XPM data (as passed to wxBitmap ctor):
  31. wxImage ReadData(const char* const* xpm_data);
  32. #ifdef __BORLANDC__
  33. // needed for Borland 5.5
  34. wxImage ReadData(char** xpm_data)
  35. { return ReadData(const_cast<const char* const*>(xpm_data)); }
  36. #endif
  37. };
  38. #endif // wxUSE_IMAGE && wxUSE_XPM
  39. #endif // _WX_XPM_H_