X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6a5c31c2853ed9e6290da4b534bd4078e961e438..1cea736e035f7bf6dbe696d5e724cfdb17c35686:/src/cocoa/bitmap.mm?ds=inline diff --git a/src/cocoa/bitmap.mm b/src/cocoa/bitmap.mm index 58f1c729fb..3ce0eee2a7 100644 --- a/src/cocoa/bitmap.mm +++ b/src/cocoa/bitmap.mm @@ -6,7 +6,7 @@ // Created: 2003/07/19 // RCS-ID: $Id$ // Copyright: (c) 2003 David Elliott -// Licence: wxWidgets licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #include "wx/wxprec.h" @@ -39,6 +39,7 @@ IMPLEMENT_ABSTRACT_CLASS(wxBitmapHandler, wxBitmapHandlerBase) // ======================================================================== // wxBitmapRefData // ======================================================================== + class wxBitmapRefData: public wxGDIRefData { friend class wxBitmap; @@ -61,8 +62,6 @@ protected: wxMask *m_bitmapMask; // Optional mask }; -#define M_BITMAPDATA ((wxBitmapRefData *)m_refData) - wxBitmapRefData::wxBitmapRefData() { m_ok = FALSE; @@ -102,6 +101,9 @@ wxBitmapRefData::~wxBitmapRefData() // ======================================================================== // wxBitmap // ======================================================================== + +#define M_BITMAPDATA ((wxBitmapRefData *)m_refData) + IMPLEMENT_DYNAMIC_CLASS(wxBitmap, wxGDIObject) wxBitmap::wxBitmap() @@ -125,11 +127,6 @@ wxBitmap::wxBitmap(const char bits[], int the_width, int the_height, int no_bits /* TODO: create the bitmap from data */ } -wxBitmap::wxBitmap(int w, int h, int d) -{ - (void)Create(w, h, d); -} - wxBitmap::wxBitmap(NSImage* cocoaNSImage) { (void) Create(cocoaNSImage); @@ -439,8 +436,8 @@ wxBitmap wxBitmap::GetSubBitmap(const wxRect& rect) const NSRect imageRect = {{0,0}, [nsimage size]}; imageRect.origin.x = imageRect.size.width * rect.x / GetWidth(); imageRect.origin.y = imageRect.size.height * rect.y / GetHeight(); - imageRect.size.width *= wx_static_cast(CGFloat, rect.width) / GetWidth(); - imageRect.size.height *= wx_static_cast(CGFloat, rect.height) / GetHeight(); + imageRect.size.width *= static_cast(rect.width) / GetWidth(); + imageRect.size.height *= static_cast(rect.height) / GetHeight(); NSBitmapImageRep *newBitmapRep = [[NSBitmapImageRep alloc] initWithFocusedViewRect:imageRect]; [nsimage unlockFocus]; @@ -523,7 +520,7 @@ void *wxBitmap::GetRawData(wxPixelDataBase& data, int bpp) if([bitmapRep bitsPerPixel]!=bpp) { - wxFAIL_MSG( _T("incorrect bitmap type in wxBitmap::GetRawData()") ); + wxFAIL_MSG( wxT("incorrect bitmap type in wxBitmap::GetRawData()") ); return NULL; } data.m_width = [bitmapRep pixelsWide];