// wxMask represents the transparent area of the bitmap
// ----------------------------------------------------------------------------
+// TODO: all implementation of wxMask, except the generic one,
+// do not derive from wxMaskBase,,, they should
class WXDLLEXPORT wxMaskBase : public wxObject
{
public:
#define wxUSE_BITMAP_BASE 0
#endif
-// Only used by some ports
-// FIXME -- make all ports (but MSW which uses wxGDIImage) use these base classes
+// a more readable way to tell
+#define wxBITMAP_SCREEN_DEPTH (-1)
+
+
+// All ports except wxMSW,wxOS2,wxPalmOS use wxBitmapHandler and wxBitmapBase as base class
+// for wxBitmapHandler; wxMSW,wxOS2,wxPalmOS use wxGDIImageHandler as base class
+// since it allows some code reuse there.
#if wxUSE_BITMAP_BASE
// ----------------------------------------------------------------------------
// different formats
// ----------------------------------------------------------------------------
-class WXDLLEXPORT wxBitmapHandlerBase : public wxObject
+class WXDLLEXPORT wxBitmapHandler : public wxObject
{
public:
- wxBitmapHandlerBase() { m_type = wxBITMAP_TYPE_INVALID; }
- virtual ~wxBitmapHandlerBase() { }
+ wxBitmapHandler() { m_type = wxBITMAP_TYPE_INVALID; }
+ virtual ~wxBitmapHandler() { }
+
+ // NOTE: the following functions should be pure virtuals, but they aren't
+ // because otherwise almost all ports would have to implement
+ // them as "return false"...
- virtual bool Create(wxBitmap *bitmap, const void* data, long flags,
- int width, int height, int depth = 1);
- virtual bool LoadFile(wxBitmap *bitmap, const wxString& name, long flags,
- int desiredWidth, int desiredHeight);
- virtual bool SaveFile(const wxBitmap *bitmap, const wxString& name,
- int type, const wxPalette *palette = NULL);
+ virtual bool Create(wxBitmap *WXUNUSED(bitmap), const void* WXUNUSED(data),
+ wxBitmapType WXUNUSED(type), int WXUNUSED(width), int WXUNUSED(height),
+ int WXUNUSED(depth) = 1)
+ { return false; }
+
+ virtual bool LoadFile(wxBitmap *WXUNUSED(bitmap), const wxString& WXUNUSED(name),
+ wxBitmapType WXUNUSED(type), int WXUNUSED(desiredWidth),
+ int WXUNUSED(desiredHeight))
+ { return false; }
+
+ virtual bool SaveFile(const wxBitmap *WXUNUSED(bitmap), const wxString& WXUNUSED(name),
+ wxBitmapType WXUNUSED(type), const wxPalette *WXUNUSED(palette) = NULL) const
+ { return false; }
void SetName(const wxString& name) { m_name = name; }
void SetExtension(const wxString& ext) { m_extension = ext; }
wxString m_extension;
wxBitmapType m_type;
- DECLARE_ABSTRACT_CLASS(wxBitmapHandlerBase)
+ DECLARE_ABSTRACT_CLASS(wxBitmapHandler)
};
+
+// ----------------------------------------------------------------------------
+// wxBitmap: class which represents platform-dependent bitmap (unlike wxImage)
+// ----------------------------------------------------------------------------
+
class WXDLLEXPORT wxBitmapBase : public wxGDIObject
{
public:
Derived class must implement these:
wxBitmap();
- wxBitmap(int width, int height, int depth = -1);
+ wxBitmap(const wxBitmap& bmp);
wxBitmap(const char bits[], int width, int height, int depth = 1);
+ wxBitmap(int width, int height, int depth = wxBITMAP_SCREEN_DEPTH);
wxBitmap(const char* const* bits);
wxBitmap(const wxString &filename, wxBitmapType type = wxBITMAP_TYPE_XPM);
- wxBitmap(const wxImage& image, int depth = -1);
-
- bool Create(int width, int height, int depth = -1);
+ wxBitmap(const wxImage& image, int depth = wxBITMAP_SCREEN_DEPTH);
static void InitStandardHandlers();
*/
+ virtual bool Create(int width, int height, int depth = wxBITMAP_SCREEN_DEPTH) = 0;
+
virtual int GetHeight() const = 0;
virtual int GetWidth() const = 0;
virtual int GetDepth() const = 0;
// Format handling
static inline wxList& GetHandlers() { return sm_handlers; }
- static void AddHandler(wxBitmapHandlerBase *handler);
- static void InsertHandler(wxBitmapHandlerBase *handler);
+ static void AddHandler(wxBitmapHandler *handler);
+ static void InsertHandler(wxBitmapHandler *handler);
static bool RemoveHandler(const wxString& name);
static wxBitmapHandler *FindHandler(const wxString& name);
static wxBitmapHandler *FindHandler(const wxString& extension, wxBitmapType bitmapType);
wxMask *GetMask() const;
void SetMask(wxMask *mask) ;
- int GetBitmapType() const;
+ wxBitmapType GetBitmapType() const;
// wxCocoa
WX_NSBitmapImageRep GetNSBitmapImageRep();
DECLARE_DYNAMIC_CLASS(wxBitmap)
};
-class WXDLLIMPEXP_CORE wxBitmapHandler: public wxBitmapHandlerBase
-{
- DECLARE_ABSTRACT_CLASS(wxBitmapHandler)
-};
#endif // __WX_COCOA_BITMAP_H__
// wxBitmap
//-----------------------------------------------------------------------------
-class WXDLLIMPEXP_CORE wxBitmapHandler : public wxBitmapHandlerBase
-{
- DECLARE_ABSTRACT_CLASS(wxBitmapHandler)
-};
-
class WXDLLIMPEXP_CORE wxBitmap : public wxBitmapBase
{
public:
virtual wxBitmap GetSubBitmap(const wxRect& rect) const;
- virtual bool SaveFile(const wxString &name, wxBitmapType type, const wxPalette *palette = (wxPalette *) NULL) const;
+ virtual bool SaveFile(const wxString &name, wxBitmapType type,
+ const wxPalette *palette = (wxPalette *) NULL) const;
virtual bool LoadFile(const wxString &name, wxBitmapType type = wxBITMAP_TYPE_RESOURCE);
#if wxUSE_PALETTE
{
public:
wxBitmap() { }
- wxBitmap( int width, int height, int depth = -1 );
+ wxBitmap( int width, int height, int depth = wxBITMAP_SCREEN_DEPTH );
wxBitmap( const char bits[], int width, int height, int depth = 1 );
wxBitmap( const char* const* bits );
#ifdef wxNEEDS_CHARPP
// needed for old GCC
wxBitmap(char** data)
- {
- *this = wxBitmap(wx_const_cast(const char* const*, data));
- }
+ { *this = wxBitmap(wx_const_cast(const char* const*, data)); }
#endif
wxBitmap( const wxString &filename, wxBitmapType type = wxBITMAP_TYPE_XPM );
#if wxUSE_IMAGE
- wxBitmap( const wxImage& image, int depth = -1 ) { (void)CreateFromImage(image, depth); }
+ wxBitmap( const wxImage& image, int depth = wxBITMAP_SCREEN_DEPTH )
+ { (void)CreateFromImage(image, depth); }
#endif // wxUSE_IMAGE
virtual ~wxBitmap();
- bool Create(int width, int height, int depth = -1);
+ bool Create(int width, int height, int depth = wxBITMAP_SCREEN_DEPTH);
virtual int GetHeight() const;
virtual int GetWidth() const;
GdkPixbuf *GetPixbuf() const;
// Basically, this corresponds to Win32 StretchBlt()
- wxBitmap Rescale(int clipx, int clipy, int clipwidth, int clipheight, int width, int height) const;
+ wxBitmap Rescale(int clipx, int clipy, int clipwidth, int clipheight,
+ int width, int height) const;
// raw bitmap access support functions
void *GetRawData(wxPixelDataBase& data, int bpp);
DECLARE_DYNAMIC_CLASS(wxBitmap)
};
-//-----------------------------------------------------------------------------
-// wxBitmapHandler
-//-----------------------------------------------------------------------------
-
-class WXDLLIMPEXP_CORE wxBitmapHandler: public wxBitmapHandlerBase
-{
- DECLARE_ABSTRACT_CLASS(wxBitmapHandler)
-};
-
#endif // _WX_GTK_BITMAP_H_
DECLARE_DYNAMIC_CLASS(wxBitmap)
};
-//-----------------------------------------------------------------------------
-// wxBitmapHandler
-//-----------------------------------------------------------------------------
-
-class WXDLLIMPEXP_CORE wxBitmapHandler: public wxBitmapHandlerBase
-{
- DECLARE_ABSTRACT_CLASS(wxBitmapHandler)
-};
#endif // __GTKBITMAPH__
};
-class WXDLLIMPEXP_CORE wxBitmapHandler: public wxBitmapHandlerBase
-{
- DECLARE_ABSTRACT_CLASS(wxBitmapHandler)
-};
-
class WXDLLEXPORT wxBitmap: public wxBitmapBase
{
DECLARE_DYNAMIC_CLASS(wxBitmap)
// wxBitmap
//-----------------------------------------------------------------------------
-class WXDLLIMPEXP_CORE wxBitmapHandler: public wxBitmapHandlerBase
-{
- DECLARE_ABSTRACT_CLASS(wxBitmapHandler)
-};
-
class WXDLLEXPORT wxBitmap: public wxBitmapBase
{
public:
// ----------------------------------------------------------------------------
// wxBitmap: a mono or colour bitmap
+// NOTE: for wxMSW we don't use the wxBitmapBase base class declared in bitmap.h!
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxBitmap : public wxGDIImage
wxBitmap(const wxString& name, wxBitmapType type = wxBITMAP_TYPE_BMP_RESOURCE);
// New constructor for generalised creation from data
- wxBitmap(const void* data, long type, int width, int height, int depth = 1);
+ wxBitmap(const void* data, wxBitmapType type, int width, int height, int depth = 1);
// Create a new, uninitialized bitmap of the given size and depth (if it
// is omitted, will create a bitmap compatible with the display)
bool CopyFromDIB(const wxDIB& dib);
#endif
- virtual bool Create(int width, int height, int depth = -1);
+ virtual bool Create(int width, int height, int depth = wxBITMAP_SCREEN_DEPTH);
virtual bool Create(int width, int height, const wxDC& dc);
- virtual bool Create(const void* data, long type, int width, int height, int depth = 1);
- virtual bool LoadFile(const wxString& name, long type = wxBITMAP_TYPE_BMP_RESOURCE);
- virtual bool SaveFile(const wxString& name, int type, const wxPalette *cmap = NULL);
+ virtual bool Create(const void* data, wxBitmapType type, int width, int height, int depth = 1);
+ virtual bool LoadFile(const wxString& name, wxBitmapType type = wxBITMAP_TYPE_BMP_RESOURCE);
+ virtual bool SaveFile(const wxString& name, wxBitmapType type, const wxPalette *cmap = NULL) const;
wxBitmapRefData *GetBitmapData() const
{ return (wxBitmapRefData *)m_refData; }
DECLARE_DYNAMIC_CLASS(wxMask)
};
+
// ----------------------------------------------------------------------------
// wxBitmapHandler is a class which knows how to load/save bitmaps to/from file
+// NOTE: for wxMSW we don't use the wxBitmapHandler class declared in bitmap.h!
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxBitmapHandler : public wxGDIImageHandler
{
public:
wxBitmapHandler() { }
- wxBitmapHandler(const wxString& name, const wxString& ext, long type)
- : wxGDIImageHandler(name, ext, type)
- {
- }
+ wxBitmapHandler(const wxString& name, const wxString& ext, wxBitmapType type)
+ : wxGDIImageHandler(name, ext, type) { }
- // keep wxBitmapHandler derived from wxGDIImageHandler compatible with the
- // old class which worked only with bitmaps
- virtual bool Create(wxBitmap *bitmap,
- const void* data,
- long flags,
- int width, int height, int depth = 1);
- virtual bool LoadFile(wxBitmap *bitmap,
- const wxString& name,
- long flags,
- int desiredWidth, int desiredHeight);
- virtual bool SaveFile(wxBitmap *bitmap,
- const wxString& name,
- int type,
- const wxPalette *palette = NULL);
+ // implement wxGDIImageHandler's pure virtuals:
virtual bool Create(wxGDIImage *image,
const void* data,
- long flags,
+ wxBitmapType type,
int width, int height, int depth = 1);
virtual bool Load(wxGDIImage *image,
const wxString& name,
- long flags,
+ wxBitmapType type,
int desiredWidth, int desiredHeight);
- virtual bool Save(wxGDIImage *image,
+ virtual bool Save(const wxGDIImage *image,
const wxString& name,
- int type);
+ wxBitmapType type) const;
+
+
+ // make wxBitmapHandler compatible with the wxBitmapHandler interface
+ // declared in bitmap.h, even if it's derived from wxGDIImageHandler:
+
+ virtual bool Create(wxBitmap *bitmap,
+ const void* data,
+ wxBitmapType type,
+ int width, int height, int depth = 1);
+ virtual bool LoadFile(wxBitmap *bitmap,
+ const wxString& name,
+ wxBitmapType type,
+ int desiredWidth, int desiredHeight);
+ virtual bool SaveFile(const wxBitmap *bitmap,
+ const wxString& name,
+ wxBitmapType type,
+ const wxPalette *palette = NULL) const;
private:
DECLARE_DYNAMIC_CLASS(wxBitmapHandler)
};
};
-// ----------------------------------------------------------------------------
-// wxGDIImageHandler: a class which knows how to load/save wxGDIImages.
-// ----------------------------------------------------------------------------
-
-class WXDLLEXPORT wxGDIImageHandler : public wxObject
-{
-public:
- // ctor
- wxGDIImageHandler() { m_type = wxBITMAP_TYPE_INVALID; }
- wxGDIImageHandler(const wxString& name,
- const wxString& ext,
- long type)
- : m_name(name), m_extension(ext)
- {
- m_type = type;
- }
-
- // accessors
- void SetName(const wxString& name) { m_name = name; }
- void SetExtension(const wxString& ext) { m_extension = ext; }
- void SetType(long type) { m_type = type; }
-
- const wxString& GetName() const { return m_name; }
- const wxString& GetExtension() const { return m_extension; }
- long GetType() const { return m_type; }
-
- // real handler operations: to implement in derived classes
- virtual bool Create(wxGDIImage *image,
- const void* data,
- long flags,
- int width, int height, int depth = 1) = 0;
- virtual bool Load(wxGDIImage *image,
- const wxString& name,
- long flags,
- int desiredWidth, int desiredHeight) = 0;
- virtual bool Save(wxGDIImage *image,
- const wxString& name,
- int type) = 0;
-
-protected:
- wxString m_name;
- wxString m_extension;
- long m_type;
-};
-
// ----------------------------------------------------------------------------
// wxGDIImage: this class supports GDI image handlers which may be registered
// dynamically and will be used for loading/saving the images in the specified
static wxGDIImageHandlerList ms_handlers;
};
+// ----------------------------------------------------------------------------
+// wxGDIImageHandler: a class which knows how to load/save wxGDIImages.
+// ----------------------------------------------------------------------------
+
+class WXDLLEXPORT wxGDIImageHandler : public wxObject
+{
+public:
+ // ctor
+ wxGDIImageHandler() { m_type = wxBITMAP_TYPE_INVALID; }
+ wxGDIImageHandler(const wxString& name,
+ const wxString& ext,
+ wxBitmapType type)
+ : m_name(name), m_extension(ext), m_type(type) { }
+
+ // accessors
+ void SetName(const wxString& name) { m_name = name; }
+ void SetExtension(const wxString& ext) { m_extension = ext; }
+ void SetType(wxBitmapType type) { m_type = type; }
+
+ const wxString& GetName() const { return m_name; }
+ const wxString& GetExtension() const { return m_extension; }
+ wxBitmapType GetType() const { return m_type; }
+
+ // real handler operations: to implement in derived classes
+ virtual bool Create(wxGDIImage *image,
+ const void* data,
+ wxBitmapType flags,
+ int width, int height, int depth = 1) = 0;
+ virtual bool Load(wxGDIImage *image,
+ const wxString& name,
+ wxBitmapType flags,
+ int desiredWidth, int desiredHeight) = 0;
+ virtual bool Save(const wxGDIImage *image,
+ const wxString& name,
+ wxBitmapType type) const = 0;
+
+protected:
+ wxString m_name;
+ wxString m_extension;
+ wxBitmapType m_type;
+};
+
#endif // _WX_MSW_GDIIMAGE_H_
#endif
// from resource/file
wxIcon(const wxString& name,
- long type = wxBITMAP_TYPE_ICO_RESOURCE,
+ wxBitmapType type = wxBITMAP_TYPE_ICO_RESOURCE,
int desiredWidth = -1, int desiredHeight = -1);
wxIcon(const wxIconLocation& loc);
virtual ~wxIcon();
virtual bool LoadFile(const wxString& name,
- long type = wxBITMAP_TYPE_ICO_RESOURCE,
+ wxBitmapType type = wxBITMAP_TYPE_ICO_RESOURCE,
int desiredWidth = -1, int desiredHeight = -1);
// implementation only from now on
inline wxBitmapHandler( const wxString& rName
,const wxString& rExt
- ,long lType
+ ,wxBitmapType lType
)
: wxGDIImageHandler( rName
,rExt
// old class which worked only with bitmaps
virtual bool Create( wxBitmap* pBitmap
,const void* pData
- ,long lFlags
+ ,wxBitmapType lType
,int nWidth
,int nHeight
,int nDepth = 1
);
virtual bool LoadFile( wxBitmap* pBitmap
,int nId
- ,long lFlags
+ ,wxBitmapType lType
,int nDesiredWidth
,int nDesiredHeight
);
virtual bool LoadFile( wxBitmap* pBitmap
,const wxString& rName
- ,long lFlags
+ ,wxBitmapType lType
,int nDesiredWidth
,int nDesiredHeight
);
virtual bool SaveFile( wxBitmap* pBitmap
,const wxString& rName
- ,int lType
+ ,wxBitmapType lType
,const wxPalette* pPalette = NULL
- );
+ ) const;
virtual bool Create( wxGDIImage* pImage
,const void* pData
virtual bool Save( wxGDIImage* pImage
,const wxString& rName
,int lType
- );
+ ) const;
private:
inline virtual bool Load( wxGDIImage* WXUNUSED(pImage)
,const wxString& WXUNUSED(rName)
// wxBitmap
//-----------------------------------------------------------------------------
-class WXDLLIMPEXP_CORE wxBitmapHandler: public wxBitmapHandlerBase
-{
- DECLARE_ABSTRACT_CLASS(wxBitmapHandler)
-};
-
class WXDLLIMPEXP_CORE wxBitmap: public wxBitmapBase
{
public:
IMPLEMENT_ABSTRACT_CLASS(wxBitmapBase, wxGDIObject)
-IMPLEMENT_ABSTRACT_CLASS(wxBitmapHandlerBase,wxObject)
+IMPLEMENT_ABSTRACT_CLASS(wxBitmapHandler, wxObject)
wxList wxBitmapBase::sm_handlers;
}
}
-bool wxBitmapHandlerBase::Create(wxBitmap*, const void*, long, int, int, int)
-{
- return false;
-}
-
-bool wxBitmapHandlerBase::LoadFile(wxBitmap*, const wxString&, long, int, int)
-{
- return false;
-}
-
-bool wxBitmapHandlerBase::SaveFile(const wxBitmap*, const wxString&, int, const wxPalette*)
-{
- return false;
-}
-
class wxBitmapBaseModule: public wxModule
{
DECLARE_DYNAMIC_CLASS(wxBitmapBaseModule)
return newRef;
}
-//-----------------------------------------------------------------------------
-// wxBitmapHandler
-//-----------------------------------------------------------------------------
-
-IMPLEMENT_ABSTRACT_CLASS(wxBitmapHandler, wxBitmapHandlerBase)
-
/* static */ void wxBitmap::InitStandardHandlers()
{
// TODO: Insert handler based on GdkPixbufs handler later
return false;
}
-//-----------------------------------------------------------------------------
-// wxBitmapHandler
-//-----------------------------------------------------------------------------
-
-IMPLEMENT_ABSTRACT_CLASS(wxBitmapHandler, wxBitmapHandlerBase)
-
/* static */ void wxBitmap::InitStandardHandlers()
{
// TODO: Insert handler based on GdkPixbufs handler later
return m_maskBitmap ;
}
-// ----------------------------------------------------------------------------
-// wxBitmapHandler
-// ----------------------------------------------------------------------------
-
-IMPLEMENT_ABSTRACT_CLASS(wxBitmapHandler, wxBitmapHandlerBase)
-
// ----------------------------------------------------------------------------
// Standard Handlers
// ----------------------------------------------------------------------------
#define M_BMPDATA ((wxBitmapRefData *)m_refData)
-
-IMPLEMENT_ABSTRACT_CLASS(wxBitmapHandler, wxBitmapHandlerBase)
IMPLEMENT_DYNAMIC_CLASS(wxBitmap,wxBitmapBase)
wxBitmap::wxBitmap(int width, int height, int depth)
(void)Create(w, h, dc);
}
-wxBitmap::wxBitmap(const void* data, long type, int width, int height, int depth)
+wxBitmap::wxBitmap(const void* data, wxBitmapType type, int width, int height, int depth)
{
(void)Create(data, type, width, height, depth);
}
wxBitmap::wxBitmap(const wxString& filename, wxBitmapType type)
{
- LoadFile(filename, (int)type);
+ LoadFile(filename, type);
}
bool wxBitmap::Create(int width, int height, int depth)
// loading and saving bitmaps
// ----------------------------------------------------------------------------
-bool wxBitmap::LoadFile(const wxString& filename, long type)
+bool wxBitmap::LoadFile(const wxString& filename, wxBitmapType type)
{
UnRef();
return false;
}
-bool wxBitmap::Create(const void* data, long type, int width, int height, int depth)
+bool wxBitmap::Create(const void* data, wxBitmapType type, int width, int height, int depth)
{
UnRef();
}
bool wxBitmap::SaveFile(const wxString& filename,
- int type,
- const wxPalette *palette)
+ wxBitmapType type,
+ const wxPalette *palette) const
{
wxBitmapHandler *handler = wxDynamicCast(FindHandler(type), wxBitmapHandler);
bool wxBitmapHandler::Create(wxGDIImage *image,
const void* data,
- long flags,
+ wxBitmapType type,
int width, int height, int depth)
{
wxBitmap *bitmap = wxDynamicCast(image, wxBitmap);
- return bitmap && Create(bitmap, data, flags, width, height, depth);
+ return bitmap && Create(bitmap, data, type, width, height, depth);
}
bool wxBitmapHandler::Load(wxGDIImage *image,
const wxString& name,
- long flags,
+ wxBitmapType type,
int width, int height)
{
wxBitmap *bitmap = wxDynamicCast(image, wxBitmap);
- return bitmap && LoadFile(bitmap, name, flags, width, height);
+ return bitmap && LoadFile(bitmap, name, type, width, height);
}
-bool wxBitmapHandler::Save(wxGDIImage *image,
+bool wxBitmapHandler::Save(const wxGDIImage *image,
const wxString& name,
- int type)
+ wxBitmapType type) const
{
wxBitmap *bitmap = wxDynamicCast(image, wxBitmap);
bool wxBitmapHandler::Create(wxBitmap *WXUNUSED(bitmap),
const void* WXUNUSED(data),
- long WXUNUSED(type),
+ wxBitmapType WXUNUSED(type),
int WXUNUSED(width),
int WXUNUSED(height),
int WXUNUSED(depth))
bool wxBitmapHandler::LoadFile(wxBitmap *WXUNUSED(bitmap),
const wxString& WXUNUSED(name),
- long WXUNUSED(type),
+ wxBitmapType WXUNUSED(type),
int WXUNUSED(desiredWidth),
int WXUNUSED(desiredHeight))
{
return false;
}
-bool wxBitmapHandler::SaveFile(wxBitmap *WXUNUSED(bitmap),
+bool wxBitmapHandler::SaveFile(const wxBitmap *WXUNUSED(bitmap),
const wxString& WXUNUSED(name),
- int WXUNUSED(type),
- const wxPalette *WXUNUSED(palette))
+ wxBitmapType WXUNUSED(type),
+ const wxPalette *WXUNUSED(palette)) const
{
return false;
}
}
virtual bool LoadFile(wxBitmap *bitmap,
- const wxString& name, long flags,
+ const wxString& name, wxBitmapType flags,
int desiredWidth, int desiredHeight);
- virtual bool SaveFile(wxBitmap *bitmap,
- const wxString& name, int type,
- const wxPalette *palette = NULL);
+ virtual bool SaveFile(const wxBitmap *bitmap,
+ const wxString& name, wxBitmapType type,
+ const wxPalette *palette = NULL) const;
private:
DECLARE_DYNAMIC_CLASS(wxBMPFileHandler)
}
virtual bool LoadFile(wxBitmap *bitmap,
- const wxString& name, long flags,
+ const wxString& name, wxBitmapType flags,
int desiredWidth, int desiredHeight);
private:
class WXDLLEXPORT wxIconHandler : public wxGDIImageHandler
{
public:
- wxIconHandler(const wxString& name, const wxString& ext, long type)
+ wxIconHandler(const wxString& name, const wxString& ext, wxBitmapType type)
: wxGDIImageHandler(name, ext, type)
{
}
// creating and saving icons is not supported
virtual bool Create(wxGDIImage *WXUNUSED(image),
const void* WXUNUSED(data),
- long WXUNUSED(flags),
+ wxBitmapType WXUNUSED(flags),
int WXUNUSED(width),
int WXUNUSED(height),
int WXUNUSED(depth) = 1)
return false;
}
- virtual bool Save(wxGDIImage *WXUNUSED(image),
+ virtual bool Save(const wxGDIImage *WXUNUSED(image),
const wxString& WXUNUSED(name),
- int WXUNUSED(type))
+ wxBitmapType WXUNUSED(type)) const
{
return false;
}
virtual bool Load(wxGDIImage *image,
const wxString& name,
- long flags,
+ wxBitmapType flags,
int desiredWidth, int desiredHeight)
{
wxIcon *icon = wxDynamicCast(image, wxIcon);
protected:
virtual bool LoadIcon(wxIcon *icon,
- const wxString& name, long flags,
+ const wxString& name, wxBitmapType flags,
int desiredWidth = -1, int desiredHeight = -1) = 0;
};
protected:
virtual bool LoadIcon(wxIcon *icon,
- const wxString& name, long flags,
+ const wxString& name, wxBitmapType flags,
int desiredWidth = -1, int desiredHeight = -1);
private:
protected:
virtual bool LoadIcon(wxIcon *icon,
- const wxString& name, long flags,
+ const wxString& name, wxBitmapType flags,
int desiredWidth = -1, int desiredHeight = -1);
private:
// ----------------------------------------------------------------------------
bool wxBMPResourceHandler::LoadFile(wxBitmap *bitmap,
- const wxString& name, long WXUNUSED(flags),
+ const wxString& name, wxBitmapType WXUNUSED(flags),
int WXUNUSED(desiredWidth),
int WXUNUSED(desiredHeight))
{
}
bool wxBMPFileHandler::LoadFile(wxBitmap *bitmap,
- const wxString& name, long WXUNUSED(flags),
+ const wxString& name, wxBitmapType WXUNUSED(flags),
int WXUNUSED(desiredWidth),
int WXUNUSED(desiredHeight))
{
#endif
}
-bool wxBMPFileHandler::SaveFile(wxBitmap *bitmap,
+bool wxBMPFileHandler::SaveFile(const wxBitmap *bitmap,
const wxString& name,
- int WXUNUSED(type),
- const wxPalette * WXUNUSED(pal))
+ wxBitmapType WXUNUSED(type),
+ const wxPalette * WXUNUSED(pal)) const
{
#if wxUSE_WXDIB
wxCHECK_MSG( bitmap, false, _T("NULL bitmap in SaveFile") );
bool wxICOFileHandler::LoadIcon(wxIcon *icon,
const wxString& name,
- long WXUNUSED(flags),
+ wxBitmapType WXUNUSED(flags),
int desiredWidth, int desiredHeight)
{
icon->UnRef();
bool wxICOResourceHandler::LoadIcon(wxIcon *icon,
const wxString& name,
- long WXUNUSED(flags),
+ wxBitmapType WXUNUSED(flags),
int desiredWidth, int desiredHeight)
{
HICON hicon;
}
wxIcon::wxIcon(const wxString& iconfile,
- long flags,
+ wxBitmapType type,
int desiredWidth,
int desiredHeight)
{
- LoadFile(iconfile, flags, desiredWidth, desiredHeight);
+ LoadFile(iconfile, type, desiredWidth, desiredHeight);
}
wxIcon::wxIcon(const wxIconLocation& loc)
}
bool wxIcon::LoadFile(const wxString& filename,
- long type,
+ wxBitmapType type,
int desiredWidth, int desiredHeight)
{
UnRef();
IMPLEMENT_DYNAMIC_CLASS(wxBitmap, wxGDIObject)
IMPLEMENT_DYNAMIC_CLASS(wxMask, wxObject)
-IMPLEMENT_DYNAMIC_CLASS(wxBitmapHandler, wxObject)
// ============================================================================
// implementation
bool wxBitmapHandler::Create( wxGDIImage* pImage,
const void* pData,
- long WXUNUSED(lFlags),
+ wxBitmapType WXUNUSED(lFlags),
int nWidth,
int nHeight,
int nDepth)
bool wxBitmapHandler::Load(
wxGDIImage* pImage
, int nId
-, long lFlags
+, wxBitmapType lFlags
, int nWidth
, int nHeight
)
wxGDIImage* pImage
, const wxString& rName
, int lType
-)
+) const
{
wxBitmap* pBitmap = wxDynamicCast( pImage
,wxBitmap
bool wxBitmapHandler::Create(
wxBitmap* WXUNUSED(pBitmap)
, const void* WXUNUSED(pData)
-, long WXUNUSED(lType)
+, wxBitmapType WXUNUSED(lType)
, int WXUNUSED(nWidth)
, int WXUNUSED(nHeight)
, int WXUNUSED(nDepth)
bool wxBitmapHandler::LoadFile(
wxBitmap* WXUNUSED(pBitmap)
, int WXUNUSED(nId)
-, long WXUNUSED(lType)
+, wxBitmapType WXUNUSED(lType)
, int WXUNUSED(nDesiredWidth)
, int WXUNUSED(nDesiredHeight)
)
bool wxBitmapHandler::LoadFile(
wxBitmap* WXUNUSED(pBitmap)
, const wxString& WXUNUSED(rName)
-, long WXUNUSED(lType)
+, wxBitmapType WXUNUSED(lType)
, int WXUNUSED(nDesiredWidth)
, int WXUNUSED(nDesiredHeight)
)
bool wxBitmapHandler::SaveFile(
wxBitmap* WXUNUSED(pBitmap)
, const wxString& WXUNUSED(rName)
-, int WXUNUSED(nType)
+, wxBitmapType WXUNUSED(nType)
, const wxPalette* WXUNUSED(pPalette)
-)
+) const
{
return false;
}
// Bitmap handlers
// ============================================================================
-IMPLEMENT_ABSTRACT_CLASS(wxBitmapHandler, wxBitmapHandlerBase)
-
#define M_BMPHANDLERDATA ((wxBitmapRefData *)bitmap->GetRefData())
#if wxUSE_XPM