X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/83c23edb02c271787db7f7e388a603a6b0a54f09..e9d0f38a2d7a4f01ea49f35353dab25670d0e59d:/src/osx/core/bitmap.cpp diff --git a/src/osx/core/bitmap.cpp b/src/osx/core/bitmap.cpp index 15e8a233f0..dc09e4a12b 100644 --- a/src/osx/core/bitmap.cpp +++ b/src/osx/core/bitmap.cpp @@ -21,8 +21,6 @@ #endif #include "wx/metafile.h" -#include "wx/xpmdecod.h" - #include "wx/rawbmp.h" IMPLEMENT_DYNAMIC_CLASS(wxBitmap, wxGDIObject) @@ -67,9 +65,11 @@ public: void Free(); void SetOk( bool isOk) { m_ok = isOk; } +#if WXWIN_COMPATIBILITY_2_8 void SetWidth( int width ) { m_width = width; } void SetHeight( int height ) { m_height = height; } void SetDepth( int depth ) { m_depth = depth; } +#endif int GetWidth() const { return m_width; } int GetHeight() const { return m_height; } @@ -109,7 +109,7 @@ public: CGContextRef GetBitmapContext() const; int GetBytesPerRow() const { return m_bytesPerRow; } - private : +private: bool Create(int width , int height , int depth); void Init(); @@ -287,8 +287,8 @@ bool wxBitmapRefData::Create( int w , int h , int d ) m_depth = d ; m_hBitmap = NULL ; - m_bytesPerRow = GetBestBytesPerRow( w * 4 ) ; - size_t size = m_bytesPerRow * h ; + m_bytesPerRow = GetBestBytesPerRow( m_width * 4 ) ; + size_t size = m_bytesPerRow * m_height ; void* data = m_memBuf.GetWriteBuf( size ) ; if ( data != NULL ) { @@ -510,10 +510,10 @@ IconRef wxBitmapRefData::GetIconRef() { // setup the header properly - Handle data = NULL ; - Handle maskdata = NULL ; - unsigned char * maskptr = NULL ; - unsigned char * ptr = NULL ; + Handle data; + Handle maskdata; + unsigned char * maskptr; + unsigned char * ptr; size_t datasize, masksize ; datasize = sz * sz * 4 ; @@ -1019,7 +1019,7 @@ IconRef wxBitmap::CreateIconRef() const } #endif -#if wxOSX_USE_COCOA_OR_IPHONE +#if wxOSX_USE_COCOA WX_NSImage wxBitmap::GetNSImage() const { @@ -1029,6 +1029,15 @@ WX_NSImage wxBitmap::GetNSImage() const #endif +#if wxOSX_USE_IPHONE + +WX_UIImage wxBitmap::GetUIImage() const +{ + wxCFRef< CGImageRef > cgimage(CreateCGImage()); + return wxOSXCreateUIImageFromCGImage( cgimage ); +} + +#endif wxBitmap wxBitmap::GetSubBitmap(const wxRect &rect) const { wxCHECK_MSG( Ok() && @@ -1162,7 +1171,7 @@ wxBitmap::wxBitmap(const wxImage& image, int depth) int height = image.GetHeight(); wxBitmapRefData* bitmapRefData; - + m_refData = bitmapRefData = new wxBitmapRefData( width , height , depth ) ; if ( bitmapRefData->IsOk()) @@ -1394,6 +1403,7 @@ bool wxBitmap::HasAlpha() const return M_BITMAPDATA->HasAlpha() ; } +#if WXWIN_COMPATIBILITY_2_8 void wxBitmap::SetWidth(int w) { AllocExclusive(); @@ -1411,6 +1421,7 @@ void wxBitmap::SetDepth(int d) AllocExclusive(); M_BITMAPDATA->SetDepth(d); } +#endif // WXWIN_COMPATIBILITY_2_8 void wxBitmap::SetOk(bool isOk) { @@ -1645,7 +1656,7 @@ WXHBITMAP wxMask::GetHBITMAP() const // Standard Handlers // ---------------------------------------------------------------------------- -#if !defined( __LP64__ ) && !defined(__WXOSX_IPHONE__) +#if !defined( __LP64__ ) && !defined(__WXOSX_IPHONE__) class WXDLLEXPORT wxPICTResourceHandler: public wxBitmapHandler {