#include "wx/bitmap.h"
-#define M_ICONDATA ((wxBitmapRefData *)m_refData)
-#define M_ICONHANDLERDATA ((wxBitmapRefData *)bitmap->GetRefData())
-
// Icon
class WXDLLEXPORT wxIcon: public wxBitmap
{
- DECLARE_DYNAMIC_CLASS(wxIcon)
+ DECLARE_DYNAMIC_CLASS(wxIcon);
public:
wxIcon();
// ctors, assignment operators...), but it's ok to have such function
void CopyFromBitmap(const wxBitmap& bmp);
- inline wxIcon& operator = (const wxIcon& icon) { if (*this == icon) return (*this); Ref(icon); return *this; }
- inline bool operator == (const wxIcon& icon) const { return m_refData == icon.m_refData; }
- inline bool operator != (const wxIcon& icon) const { return m_refData != icon.m_refData; }
-
- virtual bool Ok() const { return ((m_refData != NULL) && (M_ICONDATA->m_ok)); }
+ inline wxIcon& operator = (const wxIcon& icon)
+ { if (*this == icon) return (*this); Ref(icon); return *this; }
+ inline bool operator == (const wxIcon& icon) const
+ { return m_refData == icon.m_refData; }
+ inline bool operator != (const wxIcon& icon) const
+ { return m_refData != icon.m_refData; }
};
-#endif
-// _WX_ICON_H_
+#endif // _WX_ICON_H_
int WXUNUSED(desiredHeight))
{
// M_BITMAPHANDLERDATA->m_freePixmap = TRUE;
+ if (!bitmap->GetRefData())
+ bitmap->SetRefData( new wxBitmapRefData() );
int hotX, hotY;
unsigned int w, h;
long WXUNUSED(flags),
int width, int height, int WXUNUSED(depth))
{
+ if (!bitmap->GetRefData())
+ bitmap->SetRefData( new wxBitmapRefData() );
+
M_BITMAPHANDLERDATA->m_width = width;
M_BITMAPHANDLERDATA->m_height = height;
M_BITMAPHANDLERDATA->m_depth = 1;
int WXUNUSED(desiredWidth),
int WXUNUSED(desiredHeight) )
{
+ if (!bitmap->GetRefData())
+ bitmap->SetRefData( new wxBitmapRefData() );
+
Display *dpy = (Display*) wxGetDisplay();
M_BITMAPHANDLERDATA->m_display = (WXDisplay*) dpy;
long WXUNUSED(flags),
int width, int height, int WXUNUSED(depth))
{
+ if (!bitmap->GetRefData())
+ bitmap->SetRefData( new wxBitmapRefData() );
+
M_BITMAPHANDLERDATA->m_width = width;
M_BITMAPHANDLERDATA->m_height = height;
M_BITMAPHANDLERDATA->m_depth = 1;
#endif
#include "wx/icon.h"
-#include "wx/window.h"
-#ifdef __VMS__
-#pragma message disable nosimpint
-#endif
-#include <Xm/Xm.h>
-#include <X11/cursorfont.h>
-#ifdef __VMS__
-#pragma message enable nosimpint
-#endif
-
-#include "wx/motif/private.h"
-
-IMPLEMENT_DYNAMIC_CLASS(wxIcon, wxBitmap)
+IMPLEMENT_DYNAMIC_CLASS(wxIcon, wxBitmap);
-/*
-* Icons
-*/
+// ============================================================================
+// Icons
+// ============================================================================
wxIcon::wxIcon()
{
int desiredWidth, int desiredHeight)
{
UnRef();
-
- m_refData = new wxBitmapRefData;
-
+
wxBitmapHandler *handler = FindHandler(type);
if ( handler )
else
return FALSE;
}
-