wxIconRefData( const wxIconRefData& data );
virtual ~wxIconRefData();
+ virtual bool IsOk() const { return m_ok; }
+
protected:
int m_width;
int m_height;
{
}
-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<const wxIconRefData *>(data));
+}
+
+bool wxIcon::CreateFromXpm(const char* const* xpm)
{
wxBitmap bitmap(xpm);
CopyFromBitmap(bitmap);
bool wxIcon::LoadFile(const wxString& filename, wxBitmapType type,
int desiredWidth, int desiredHeight)
{
- UnRef();
-
- m_refData = new wxIconRefData;
- M_ICONDATA->m_width = 5;
- M_ICONDATA->m_height = 5;
- M_ICONDATA->m_cocoaNSImage = [[NSImage alloc] initWithSize:NSMakeSize(5,5)];
- M_ICONDATA->m_ok = true;
- M_ICONDATA->m_numColors = 0;
- M_ICONDATA->m_quality = 0;
-
- return false;
+ wxBitmap bitmap(filename, type);
+ CopyFromBitmap(bitmap);
+ return bitmap.Ok();
}
void wxIcon::CopyFromBitmap(const wxBitmap& bitmap)
M_ICONDATA->m_quality = 0;
}
-bool wxIcon::IsOk() const
-{
- return m_refData && M_ICONDATA->m_ok;
-}
-
int wxIcon::GetWidth() const
{
if(!m_refData)