X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1fb4de3138151a34ea2653107c08386e3a1236bf..fb10f04c957b3712c04ddec92d083209e127b011:/src/gtk1/bitmap.cpp diff --git a/src/gtk1/bitmap.cpp b/src/gtk1/bitmap.cpp index 59428e9024..572a176c3b 100644 --- a/src/gtk1/bitmap.cpp +++ b/src/gtk1/bitmap.cpp @@ -245,9 +245,9 @@ wxBitmap::wxBitmap( int width, int height, int depth ) if (wxTheBitmapList) wxTheBitmapList->AddBitmap(this); } -wxBitmap::wxBitmap( const char **bits ) +bool wxBitmap::CreateFromXpm( const char **bits ) { - wxCHECK_RET( bits != NULL, wxT("invalid bitmap data") ) + wxCHECK_MSG( bits != NULL, FALSE, wxT("invalid bitmap data") ) m_refData = new wxBitmapRefData(); @@ -256,30 +256,7 @@ wxBitmap::wxBitmap( const char **bits ) M_BMPDATA->m_pixmap = gdk_pixmap_create_from_xpm_d( parent, &mask, NULL, (gchar **) bits ); - if (mask) - { - M_BMPDATA->m_mask = new wxMask(); - M_BMPDATA->m_mask->m_bitmap = mask; - } - - gdk_window_get_size( M_BMPDATA->m_pixmap, &(M_BMPDATA->m_width), &(M_BMPDATA->m_height) ); - - M_BMPDATA->m_bpp = gdk_window_get_visual( parent )->depth; // ? - if (wxTheBitmapList) wxTheBitmapList->AddBitmap(this); -} - -wxBitmap::wxBitmap( char **bits ) -{ - wxCHECK_RET( bits != NULL, wxT("invalid bitmap data") ) - - m_refData = new wxBitmapRefData(); - - GdkBitmap *mask = (GdkBitmap*) NULL; - GdkWindow *parent = (GdkWindow*) &gdk_root_parent; - - M_BMPDATA->m_pixmap = gdk_pixmap_create_from_xpm_d( parent, &mask, NULL, (gchar **) bits ); - - wxCHECK_RET( M_BMPDATA->m_pixmap, wxT("couldn't create pixmap") ); + wxCHECK_MSG( M_BMPDATA->m_pixmap, FALSE, wxT("couldn't create pixmap") ); if (mask) { @@ -291,6 +268,8 @@ wxBitmap::wxBitmap( char **bits ) M_BMPDATA->m_bpp = gdk_window_get_visual( parent )->depth; // ? if (wxTheBitmapList) wxTheBitmapList->AddBitmap(this); + + return TRUE; } wxBitmap::wxBitmap( const wxBitmap& bmp )