X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/17a1ebd101f0653e69736416a2a28d0ada423141..ad4e3f7be6f20d5a164a608b44c51056231ddad9:/src/gtk1/bitmap.cpp diff --git a/src/gtk1/bitmap.cpp b/src/gtk1/bitmap.cpp index 1ea0526a59..46ffd4b0ca 100644 --- a/src/gtk1/bitmap.cpp +++ b/src/gtk1/bitmap.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: bitmap.cpp +// Name: src/gtk/bitmap.cpp // Purpose: // Author: Robert Roebling // RCS-ID: $Id$ @@ -71,11 +71,13 @@ wxMask::wxMask( const wxBitmap& bitmap, const wxColour& colour ) Create( bitmap, colour ); } +#if wxUSE_PALETTE wxMask::wxMask( const wxBitmap& bitmap, int paletteIndex ) { m_bitmap = (GdkBitmap *) NULL; Create( bitmap, paletteIndex ); } +#endif // wxUSE_PALETTE wxMask::wxMask( const wxBitmap& bitmap ) { @@ -182,6 +184,7 @@ bool wxMask::Create( const wxBitmap& bitmap, return true; } +#if wxUSE_PALETTE bool wxMask::Create( const wxBitmap& bitmap, int paletteIndex ) { unsigned char r,g,b; @@ -193,6 +196,7 @@ bool wxMask::Create( const wxBitmap& bitmap, int paletteIndex ) return Create(bitmap, wxColour(r, g, b)); } +#endif // wxUSE_PALETTE bool wxMask::Create( const wxBitmap& bitmap ) { @@ -271,7 +275,9 @@ wxBitmapRefData::~wxBitmapRefData() gdk_pixbuf_unref( m_pixbuf ); #endif delete m_mask; +#if wxUSE_PALETTE delete m_palette; +#endif // wxUSE_PALETTE } //----------------------------------------------------------------------------- @@ -1282,7 +1288,7 @@ wxBitmap wxBitmap::GetSubBitmap( const wxRect& rect) const { GdkPixbuf *pixbuf = gdk_pixbuf_new(GDK_COLORSPACE_RGB, gdk_pixbuf_get_has_alpha(GetPixbuf()), - 8, GetWidth(), GetHeight()); + 8, rect.width, rect.height); ret.SetPixbuf(pixbuf); gdk_pixbuf_copy_area(GetPixbuf(), rect.x, rect.y, rect.width, rect.height, @@ -1388,6 +1394,7 @@ bool wxBitmap::LoadFile( const wxString &name, wxBitmapType type ) return true; } +#if wxUSE_PALETTE wxPalette *wxBitmap::GetPalette() const { if (!Ok()) @@ -1400,6 +1407,7 @@ void wxBitmap::SetPalette(const wxPalette& WXUNUSED(palette)) { // TODO } +#endif // wxUSE_PALETTE void wxBitmap::SetHeight( int height ) { @@ -1658,5 +1666,3 @@ bool wxBitmapHandler::SaveFile(const wxBitmap * WXUNUSED(bitmap), { // TODO: Insert handler based on GdkPixbufs handler later } - -