+void wxWindowDC::DrawBitmap( const wxBitmap &bitmap, long x, long y, bool useMask )
+{
+ if (!Ok()) return;
+
+ if (!bitmap.Ok()) return;
+
+ int xx = XLOG2DEV(x);
+ int yy = YLOG2DEV(y);
+
+ GdkBitmap *mask = (GdkBitmap *) NULL;
+ if (bitmap.GetMask()) mask = bitmap.GetMask()->GetBitmap();
+
+ if (useMask && mask)
+ {
+ gdk_gc_set_clip_mask( m_penGC, mask );
+ gdk_gc_set_clip_origin( m_penGC, xx, yy );
+ }
+
+ GdkPixmap *pm = bitmap.GetPixmap();
+ gdk_draw_pixmap( m_window, m_penGC, pm, 0, 0, xx, yy, -1, -1 );
+
+ if (useMask && mask)
+ {
+ gdk_gc_set_clip_mask( m_penGC, (GdkBitmap *) NULL );
+ gdk_gc_set_clip_origin( m_penGC, 0, 0 );
+ }
+
+ CalcBoundingBox( x, y );
+ int width = bitmap.GetWidth();
+ int height = bitmap.GetHeight();
+ CalcBoundingBox( x + width, y + height );
+}
+