X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6a5c31c2853ed9e6290da4b534bd4078e961e438..eda34276d67de1578a3ed3d727b595b1858a8547:/src/cocoa/bitmap.mm?ds=inline diff --git a/src/cocoa/bitmap.mm b/src/cocoa/bitmap.mm index 58f1c729fb..51cbe0fee7 100644 --- a/src/cocoa/bitmap.mm +++ b/src/cocoa/bitmap.mm @@ -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];