-IMPLEMENT_DYNAMIC_CLASS(wxBitmap, wxGDIObject)
-IMPLEMENT_DYNAMIC_CLASS(wxMask, wxObject)
-
-wxBitmapRefData::wxBitmapRefData()
-{
- m_ok = FALSE;
- m_width = 0;
- m_height = 0;
- m_depth = 0;
- m_quality = 0;
- m_numColors = 0;
- m_bitmapMask = NULL;
-
- m_pixmap = (WXPixmap) 0;
- m_display = (WXDisplay*) 0;
-
- m_freePixmap = TRUE; //TODO: necessary?
- m_freeColors = (unsigned long*) 0;
- m_freeColorsCount = 0;
-
- // These 5 variables are for wxControl
- m_insensPixmap = (WXPixmap) 0;
- m_labelPixmap = (WXPixmap) 0;
- m_armPixmap = (WXPixmap) 0;
- m_image = (WXImage*) 0;
- m_insensImage = (WXImage*) 0;
-}
-
-wxBitmapRefData::~wxBitmapRefData()
-{
- if (m_labelPixmap)
- XmDestroyPixmap (DefaultScreenOfDisplay ((Display*) m_display), (Pixmap) m_labelPixmap);
-
- if (m_armPixmap)
- XmDestroyPixmap (DefaultScreenOfDisplay ((Display*) m_display), (Pixmap) m_armPixmap);
-
- if (m_insensPixmap)
- XmDestroyPixmap (DefaultScreenOfDisplay ((Display*) m_display), (Pixmap) m_insensPixmap);
-
- if (m_image)
- {
- XmUninstallImage ((XImage*) m_image);
- XtFree ((char *) (XImage*) m_image);
- }
-
- if (m_insensImage)
- {
- XmUninstallImage ((XImage*) m_insensImage);
- delete[] ((XImage*) m_insensImage)->data;
- XtFree ((char *) (XImage*) m_insensImage);
- }
- if (m_pixmap && m_freePixmap)
- XFreePixmap ((Display*) m_display, (Pixmap) m_pixmap);
-
- if (m_freeColors)
- {
- int screen = DefaultScreen((Display*) m_display);
- Colormap cmp = DefaultColormap((Display*) m_display,screen);
- long llp;
- for(llp = 0;llp < m_freeColorsCount;llp++)
- XFreeColors((Display*) m_display, cmp, &m_freeColors[llp], 1, 0L);
- delete m_freeColors;
- };
-
- if (m_bitmapMask)
- delete m_bitmapMask;
- m_bitmapMask = NULL;
-}
-
-wxList wxBitmap::sm_handlers;
-
-#define M_BMPDATA ((wxBitmapRefData *)m_refData)
-
-wxBitmap::wxBitmap()
-{
- m_refData = NULL;
-}
-
-wxBitmap::~wxBitmap()
-{
-}
-
-wxBitmap::wxBitmap(const char bits[], int width, int height, int depth)
-{
- m_refData = new wxBitmapRefData;
-
- (void) Create((void*) bits, wxBITMAP_TYPE_XBM_DATA, width, height, depth);
-}
-
-wxBitmap::wxBitmap(int w, int h, int d)
-{
- (void)Create(w, h, d);
-}