X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ab171e95021482a8a0c0e24ebe050fa0181e7af0..29ae3766ccb6076cf5e875f35ce137905ceb6f79:/src/gtk/dcclient.cpp?ds=sidebyside diff --git a/src/gtk/dcclient.cpp b/src/gtk/dcclient.cpp index feb56a2e03..1e8787ca40 100644 --- a/src/gtk/dcclient.cpp +++ b/src/gtk/dcclient.cpp @@ -28,7 +28,6 @@ #include "wx/fontutil.h" #include "wx/scrolwin.h" -#include "wx/gtk/win_gtk.h" #include "wx/gtk/private.h" #include @@ -37,6 +36,11 @@ // local defines //----------------------------------------------------------------------------- +#define XLOG2DEV(x) LogicalToDeviceX(x) +#define XLOG2DEVREL(x) LogicalToDeviceXRel(x) +#define YLOG2DEV(y) LogicalToDeviceY(y) +#define YLOG2DEVREL(y) LogicalToDeviceYRel(y) + #define USE_PAINT_REGION 1 //----------------------------------------------------------------------------- @@ -86,11 +90,7 @@ void gdk_wx_draw_bitmap(GdkDrawable *drawable, GdkGC *gc, GdkDrawable *src, gint xsrc, - gint ysrc, - gint xdest, - gint ydest, - gint width, - gint height) + gint ysrc) { wxCHECK_RET( drawable, _T("NULL drawable in gdk_wx_draw_bitmap") ); wxCHECK_RET( src, _T("NULL src in gdk_wx_draw_bitmap") ); @@ -98,15 +98,13 @@ void gdk_wx_draw_bitmap(GdkDrawable *drawable, gint src_width, src_height; gdk_drawable_get_size(src, &src_width, &src_height); - if (width == -1) width = src_width; - if (height == -1) height = src_height; XCopyPlane( GDK_WINDOW_XDISPLAY(drawable), GDK_WINDOW_XID(src), GDK_WINDOW_XID(drawable), GDK_GC_XGC(gc), xsrc, ysrc, - width, height, + src_width, src_height, 0, 0, 1 ); } @@ -312,8 +310,7 @@ wxWindowDC::wxWindowDC( wxWindow *window ) m_layout = pango_layout_new( m_context ); m_fontdesc = pango_font_description_copy( widget->style->font_desc ); - GtkPizza *pizza = GTK_PIZZA( widget ); - m_window = pizza->bin_window; + m_window = widget->window; // Window not realized ? if (!m_window) @@ -400,11 +397,7 @@ void wxGTKWindowImplDC::SetUpDC( bool isMemDC ) /* background colour */ m_backgroundBrush = *wxWHITE_BRUSH; m_backgroundBrush.GetColour().CalcPixel( m_cmap ); -#ifdef __WXGTK24__ const GdkColor *bg_col = m_backgroundBrush.GetColour().GetColor(); -#else - GdkColor *bg_col = m_backgroundBrush.GetColour().GetColor(); -#endif /* m_textGC */ m_textForegroundColour.CalcPixel( m_cmap ); @@ -476,6 +469,11 @@ bool wxGTKWindowImplDC::DoFloodFill(wxCoord x, wxCoord y, return wxDoFloodFill( GetOwner(), x, y, col, style); #else + wxUnusedVar(x); + wxUnusedVar(y); + wxUnusedVar(col); + wxUnusedVar(style); + return false; #endif } @@ -495,6 +493,10 @@ bool wxGTKWindowImplDC::DoGetPixel( wxCoord x1, wxCoord y1, wxColour *col ) cons col->Set(image.GetRed(0, 0), image.GetGreen(0, 0), image.GetBlue(0, 0)); return true; #else // !wxUSE_IMAGE + wxUnusedVar(x1); + wxUnusedVar(y1); + wxUnusedVar(col); + return false; #endif // wxUSE_IMAGE/!wxUSE_IMAGE } @@ -1140,13 +1142,6 @@ void wxGTKWindowImplDC::DoDrawBitmap( const wxBitmap &bitmap, if ((w != ww) || (h != hh)) use_bitmap = use_bitmap.Rescale( 0, 0, ww, hh, ww, hh ); - // NB: We can't render pixbufs with GTK+ < 2.2, we need to use pixmaps code. - // Pixbufs-based bitmaps with alpha channel don't have a mask, so we - // have to call GetPixmap() here -- it converts the pixbuf into pixmap - // and also creates the mask as a side-effect: - if (gtk_check_version(2,2,0)) - use_bitmap.GetPixmap(); - // apply mask if any GdkBitmap *mask = (GdkBitmap *) NULL; if (useMask && use_bitmap.GetMask()) @@ -1191,7 +1186,7 @@ void wxGTKWindowImplDC::DoDrawBitmap( const wxBitmap &bitmap, GdkGC *gc = gdk_gc_new( bitmap2 ); gdk_gc_set_foreground( gc, m_textForegroundColour.GetColor() ); gdk_gc_set_background( gc, m_textBackgroundColour.GetColor() ); - gdk_wx_draw_bitmap( bitmap2, gc, use_bitmap.GetPixmap(), 0, 0, 0, 0, -1, -1 ); + gdk_wx_draw_bitmap(bitmap2, gc, use_bitmap.GetPixmap(), 0, 0); gdk_draw_drawable(m_window, use_gc, bitmap2, 0, 0, xx, yy, -1, -1); @@ -1200,8 +1195,7 @@ void wxGTKWindowImplDC::DoDrawBitmap( const wxBitmap &bitmap, } else { -#if GTK_CHECK_VERSION(2,2,0) - if (!gtk_check_version(2,2,0) && use_bitmap.HasPixbuf()) + if (use_bitmap.HasPixbuf()) { gdk_draw_pixbuf(m_window, use_gc, use_bitmap.GetPixbuf(), @@ -1209,7 +1203,6 @@ void wxGTKWindowImplDC::DoDrawBitmap( const wxBitmap &bitmap, GDK_RGB_DITHER_NORMAL, xx, yy); } else -#endif { gdk_draw_drawable(m_window, use_gc, use_bitmap.GetPixmap(), @@ -1413,7 +1406,7 @@ bool wxGTKWindowImplDC::DoBlit( wxCoord xdest, wxCoord ydest, GdkGC *gc = gdk_gc_new( bitmap ); gdk_gc_set_foreground( gc, m_textForegroundColour.GetColor() ); gdk_gc_set_background( gc, m_textBackgroundColour.GetColor() ); - gdk_wx_draw_bitmap( bitmap, gc, use_bitmap.GetPixmap(), 0, 0, 0, 0, -1, -1 ); + gdk_wx_draw_bitmap(bitmap, gc, use_bitmap.GetPixmap(), 0, 0); gdk_draw_drawable(m_window, use_gc, bitmap, xsrc, ysrc, cx, cy, cw, ch); @@ -1752,7 +1745,12 @@ void wxGTKWindowImplDC::DoDrawRotatedText( const wxString &text, wxCoord x, wxCo // update the bounding box CalcBoundingBox(x + minX, y + minY); CalcBoundingBox(x + maxX, y + maxY); -#endif // wxUSE_IMAGE +#else // !wxUSE_IMAGE + wxUnusedVar(text); + wxUnusedVar(x); + wxUnusedVar(y); + wxUnusedVar(angle); +#endif // wxUSE_IMAGE/!wxUSE_IMAGE } void wxGTKWindowImplDC::DoGetTextExtent(const wxString &string, @@ -2304,7 +2302,7 @@ void wxGTKWindowImplDC::DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord width wxCoord xx, yy, ww, hh; m_currentClippingRegion.GetBox( xx, yy, ww, hh ); #if wxUSE_NEW_DC - wxImplDC::DoSetClippingRegion( xx, yy, ww, hh ); + wxGTKImplDC::DoSetClippingRegion( xx, yy, ww, hh ); #else wxDC::DoSetClippingRegion( xx, yy, ww, hh ); #endif @@ -2340,7 +2338,7 @@ void wxGTKWindowImplDC::DoSetClippingRegionAsRegion( const wxRegion ®ion ) wxCoord xx, yy, ww, hh; m_currentClippingRegion.GetBox( xx, yy, ww, hh ); #if wxUSE_NEW_DC - wxImplDC::DoSetClippingRegion( xx, yy, ww, hh ); + wxGTKImplDC::DoSetClippingRegion( xx, yy, ww, hh ); #else wxDC::DoSetClippingRegion( xx, yy, ww, hh ); #endif