X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2263a14efc121f52675be4408f26185779838c96..94e0018723919fe2ca2f5b5f0a42804c16dbf3a1:/src/motif/bmpmotif.cpp diff --git a/src/motif/bmpmotif.cpp b/src/motif/bmpmotif.cpp index 4275b214fb..51caa8e009 100644 --- a/src/motif/bmpmotif.cpp +++ b/src/motif/bmpmotif.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: bitmap.cpp +// Name: src/motif/bmpmotif.cpp // Purpose: wxBitmap // Author: Julian Smart, originally in bitmap.cpp // Modified by: @@ -9,21 +9,15 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma implementation "bmpmotif.h" -#endif - // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" -#ifdef __VMS -#define XtParent XTPARENT -#define XtDisplay XTDISPLAY -#endif - -#include "wx/defs.h" #include "wx/motif/bmpmotif.h" +#ifndef WX_PRECOMP + #include "wx/math.h" +#endif + #ifdef __VMS__ #pragma message disable nosimpint #endif @@ -38,13 +32,11 @@ #include #endif -#include "wx/math.h" - Pixmap XCreateInsensitivePixmap( Display *display, Pixmap pixmap ); static inline wxCharBuffer GetCacheImageName(WXImage image) { - return wxString::Format(_T("wxBitmap_%p"), image).ToAscii(); + return wxString::Format(wxT("wxBitmap_%p"), image).ToAscii(); } wxBitmapCache::~wxBitmapCache() @@ -73,7 +65,7 @@ wxBitmapCache::~wxBitmapCache() void wxBitmapCache::SetBitmap( const wxBitmap& bitmap ) { - if( m_bitmap != bitmap ) + if ( !m_bitmap.IsSameAs(bitmap) ) { InvalidateCache(); m_bitmap = bitmap; @@ -82,7 +74,7 @@ void wxBitmapCache::SetBitmap( const wxBitmap& bitmap ) { XmUninstallImage( (XImage*)m_image ); XtFree( (char*)(XImage*)m_image ); - m_image = (WXImage*)NULL; + m_image = NULL; } } } @@ -128,7 +120,7 @@ WXPixmap wxBitmapCache::GetPixmapFromCache(WXWidget w) while( XmIsGadget( widget ) ) widget = XtParent( widget ); - Pixel fg, bg; + WXPixel fg, bg; XtVaGetValues( widget, XmNbackground, &bg, XmNforeground, &fg, @@ -271,7 +263,7 @@ XCreateInsensitivePixmap( Display *display, Pixmap pixmap ) stipple = XCreateBitmapFromData( display, pixmap, stipple_data, 16, 16 ); if ( 0 != stipple ) { - gc = XCreateGC( display, pixmap, (XtGCMask)0, (XGCValues*)NULL ); + gc = XCreateGC( display, pixmap, (XtGCMask)0, NULL ); if ( NULL != gc ) { /* Create an identical copy of the argument pixmap.