/////////////////////////////////////////////////////////////////////////////
-// Name: src/cocoa/bitmap.cpp
+// Name: src/cocoa/bitmap.mm
// Purpose: wxBitmap
// Author: David Elliott
// Modified by:
/////////////////////////////////////////////////////////////////////////////
#include "wx/wxprec.h"
+
+#include "wx/bitmap.h"
+
#ifndef WX_PRECOMP
#include "wx/log.h"
#include "wx/utils.h"
#include "wx/palette.h"
#include "wx/icon.h"
#include "wx/colour.h"
+ #include "wx/image.h"
#endif //WX_PRECOMP
-#include "wx/bitmap.h"
-#include "wx/image.h"
+
#include "wx/xpmdecod.h"
#include "wx/rawbmp.h"
#import <AppKit/NSImage.h>
#import <AppKit/NSColor.h>
+IMPLEMENT_ABSTRACT_CLASS(wxBitmapHandler, wxBitmapHandlerBase)
+
// ========================================================================
// wxBitmapRefData
// ========================================================================
(void)Create(w, h, d);
}
-wxBitmap::wxBitmap(void *data, wxBitmapType 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);
}
M_BITMAPDATA->m_bitmapMask = mask ;
}
-bool wxBitmap::Ok() const
+bool wxBitmap::IsOk() const
{
return m_refData && M_BITMAPDATA->m_ok;
}
return true;
}
-bool wxBitmap::Create(void *data, wxBitmapType type, int width, int height, int depth)
+bool wxBitmap::Create(const void* data, wxBitmapType type, int width, int height, int depth)
{
UnRef();
return newImage;
}
-bool wxBitmap::CreateFromXpm(const char **xpm)
-{
-#if wxUSE_IMAGE && wxUSE_XPM
- UnRef();
-
- wxCHECK_MSG( xpm, false, wxT("invalid XPM data") );
-
- wxXPMDecoder decoder;
- wxImage img = decoder.ReadData(xpm);
- wxCHECK_MSG( img.Ok(), false, wxT("invalid XPM data") );
-
- *this = wxBitmap(img);
- return true;
-#else
- return false;
-#endif
-}
-
bool wxBitmap::CreateFromImage(const wxImage& image, int depth)
{
UnRef();
m_cocoaNSBitmapImageRep = [maskRep retain];
return true;
}
-