X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3222fc18c9363f4339937bac1f92705ee6cfcd7c..74a8f67d96591cec101def2a7d47c64072aff7fd:/src/cocoa/icon.mm diff --git a/src/cocoa/icon.mm b/src/cocoa/icon.mm index 91b059ba59..3dc3027c48 100644 --- a/src/cocoa/icon.mm +++ b/src/cocoa/icon.mm @@ -6,7 +6,7 @@ // Created: 2003/08/11 // RCS-ID: $Id$ // Copyright: (c) 2003 David Elliott -// Licence: wxWidgets licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #include "wx/wxprec.h" @@ -32,6 +32,8 @@ public: wxIconRefData( const wxIconRefData& data ); virtual ~wxIconRefData(); + virtual bool IsOk() const { return m_ok; } + protected: int m_width; int m_height; @@ -98,11 +100,21 @@ wxIcon::~wxIcon() { } -bool wxIcon::CreateFromXpm(const char **xpm) +wxGDIRefData *wxIcon::CreateGDIRefData() const +{ + return new wxIconRefData; +} + +wxGDIRefData *wxIcon::CloneGDIRefData(const wxGDIRefData *data) const +{ + return new wxIconRefData(*static_cast(data)); +} + +bool wxIcon::CreateFromXpm(const char* const* xpm) { wxBitmap bitmap(xpm); CopyFromBitmap(bitmap); - return Ok(); + return IsOk(); } bool wxIcon::LoadFile(const wxString& filename, wxBitmapType type, @@ -110,7 +122,7 @@ bool wxIcon::LoadFile(const wxString& filename, wxBitmapType type, { wxBitmap bitmap(filename, type); CopyFromBitmap(bitmap); - return bitmap.Ok(); + return bitmap.IsOk(); } void wxIcon::CopyFromBitmap(const wxBitmap& bitmap) @@ -121,16 +133,11 @@ void wxIcon::CopyFromBitmap(const wxBitmap& bitmap) M_ICONDATA->m_height = bitmap.GetHeight(); wxAutoNSAutoreleasePool pool; M_ICONDATA->m_cocoaNSImage = [bitmap.GetNSImage(true) retain]; - M_ICONDATA->m_ok = bitmap.Ok(); + M_ICONDATA->m_ok = bitmap.IsOk(); M_ICONDATA->m_numColors = 0; M_ICONDATA->m_quality = 0; } -bool wxIcon::IsOk() const -{ - return m_refData && M_ICONDATA->m_ok; -} - int wxIcon::GetWidth() const { if(!m_refData)