X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/80f218424f34e2ded439cc23631ea1b74c72f732..5dafb071ba85e7329aa4a0ac176f3ec8e13e55dc:/src/gtk1/bitmap.cpp diff --git a/src/gtk1/bitmap.cpp b/src/gtk1/bitmap.cpp index e382abbec1..1e7534bcc2 100644 --- a/src/gtk1/bitmap.cpp +++ b/src/gtk1/bitmap.cpp @@ -11,12 +11,17 @@ #include "wx/wxprec.h" #include "wx/bitmap.h" -#include "wx/palette.h" -#include "wx/icon.h" + +#ifndef WX_PRECOMP + #include "wx/app.h" + #include "wx/dcmemory.h" + #include "wx/palette.h" + #include "wx/icon.h" + #include "wx/math.h" + #include "wx/image.h" +#endif // WX_PRECOMP + #include "wx/filefn.h" -#include "wx/image.h" -#include "wx/dcmemory.h" -#include "wx/app.h" #include #include @@ -24,8 +29,6 @@ #include -#include "wx/math.h" - extern void gdk_wx_draw_bitmap (GdkDrawable *drawable, GdkGC *gc, @@ -225,7 +228,7 @@ class wxBitmapRefData: public wxObjectRefData { public: wxBitmapRefData(); - ~wxBitmapRefData(); + virtual ~wxBitmapRefData(); GdkPixmap *m_pixmap; GdkBitmap *m_bitmap; @@ -309,11 +312,9 @@ bool wxBitmap::Create( int width, int height, int depth ) return Ok(); } -bool wxBitmap::CreateFromXpm( const char **bits ) +wxBitmap::wxBitmap(const char* const* bits) { - UnRef(); - - wxCHECK_MSG( bits != NULL, false, wxT("invalid bitmap data") ); + wxCHECK2_MSG(bits != NULL, return, wxT("invalid bitmap data")); GdkVisual *visual = wxTheApp->GetGdkVisual(); @@ -323,7 +324,7 @@ bool wxBitmap::CreateFromXpm( const char **bits ) M_BMPDATA->m_pixmap = gdk_pixmap_create_from_xpm_d( wxGetRootWindow()->window, &mask, NULL, (gchar **) bits ); - wxCHECK_MSG( M_BMPDATA->m_pixmap, false, wxT("couldn't create pixmap") ); + wxCHECK2_MSG(M_BMPDATA->m_pixmap, return, wxT("couldn't create pixmap")); if (mask) { @@ -334,8 +335,6 @@ bool wxBitmap::CreateFromXpm( const char **bits ) gdk_window_get_size( M_BMPDATA->m_pixmap, &(M_BMPDATA->m_width), &(M_BMPDATA->m_height) ); M_BMPDATA->m_bpp = visual->depth; // Can we get a different depth from create_from_xpm_d() ? - - return true; } wxBitmap wxBitmap::Rescale( int clipx, int clipy, int clipwidth, int clipheight, int newx, int newy ) @@ -1077,7 +1076,7 @@ bool wxBitmap::operator != ( const wxBitmap& bmp ) const return m_refData != bmp.m_refData; } -bool wxBitmap::Ok() const +bool wxBitmap::IsOk() const { return (m_refData != NULL) && (M_BMPDATA->m_bitmap || M_BMPDATA->m_pixmap); @@ -1317,7 +1316,6 @@ void wxBitmap::UngetRawData(wxPixelDataBase& WXUNUSED(data)) { } - bool wxBitmap::HasAlpha() const { return false; @@ -1331,44 +1329,7 @@ void wxBitmap::UseAlpha() // wxBitmapHandler //----------------------------------------------------------------------------- -IMPLEMENT_DYNAMIC_CLASS(wxBitmapHandler,wxBitmapHandlerBase) - -wxBitmapHandler::~wxBitmapHandler() -{ -} - -bool wxBitmapHandler::Create(wxBitmap * WXUNUSED(bitmap), - void * WXUNUSED(data), - long WXUNUSED(type), - int WXUNUSED(width), - int WXUNUSED(height), - int WXUNUSED(depth)) -{ - wxFAIL_MSG( _T("not implemented") ); - - return false; -} - -bool wxBitmapHandler::LoadFile(wxBitmap * WXUNUSED(bitmap), - const wxString& WXUNUSED(name), - long WXUNUSED(flags), - int WXUNUSED(desiredWidth), - int WXUNUSED(desiredHeight)) -{ - wxFAIL_MSG( _T("not implemented") ); - - return false; -} - -bool wxBitmapHandler::SaveFile(const wxBitmap * WXUNUSED(bitmap), - const wxString& WXUNUSED(name), - int WXUNUSED(type), - const wxPalette * WXUNUSED(palette)) -{ - wxFAIL_MSG( _T("not implemented") ); - - return false; -} +IMPLEMENT_ABSTRACT_CLASS(wxBitmapHandler, wxBitmapHandlerBase) /* static */ void wxBitmap::InitStandardHandlers() {