static GdkPixmap *hatches[num_hatches];
static GdkPixmap **hatch_bitmap = (GdkPixmap **) NULL;
-extern GtkWidget *wxRootWindow;
+extern GtkWidget *wxGetRootWindow();
//-----------------------------------------------------------------------------
// constants
#include "gdk/gdkprivate.h"
-void gdk_wx_draw_bitmap (GdkDrawable *drawable,
- GdkGC *gc,
- GdkDrawable *src,
- gint xsrc,
- gint ysrc,
- gint xdest,
- gint ydest,
- gint width,
- gint height)
+void gdk_wx_draw_bitmap(GdkDrawable *drawable,
+ GdkGC *gc,
+ GdkDrawable *src,
+ gint xsrc,
+ gint ysrc,
+ gint xdest,
+ gint ydest,
+ gint width,
+ gint height)
{
gint src_width, src_height;
#ifndef __WXGTK20__
memdc.SelectObject(bitmap);
memdc.Blit(0, 0, 1, 1, (wxDC*) this, x1, y1);
memdc.SelectObject(wxNullBitmap);
-
+
wxImage image(bitmap);
col->Set(image.GetRed(0, 0), image.GetGreen(0, 0), image.GetBlue(0, 0));
return TRUE;
gdk_draw_arc( m_window, m_penGC, FALSE, xx, yy, ww, hh, 0, 360*64 );
}
- CalcBoundingBox( x - width, y - height );
+ CalcBoundingBox( x, y );
CalcBoundingBox( x + width, y + height );
}
if (!m_currentClippingRegion.IsNull())
{
GdkColor col;
- new_mask = gdk_pixmap_new( wxRootWindow->window, ww, hh, 1 );
+ new_mask = gdk_pixmap_new( wxGetRootWindow()->window, ww, hh, 1 );
GdkGC *gc = gdk_gc_new( new_mask );
col.pixel = 0;
gdk_gc_set_foreground( gc, &col );
}
}
-bool wxWindowDC::DoBlit( wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height,
- wxDC *source, wxCoord xsrc, wxCoord ysrc,
- int logical_func, bool useMask )
+bool wxWindowDC::DoBlit( wxCoord xdest, wxCoord ydest,
+ wxCoord width, wxCoord height,
+ wxDC *source,
+ wxCoord xsrc, wxCoord ysrc,
+ int logical_func,
+ bool useMask )
{
/* this is the nth try to get this utterly useless function to
work. it now completely ignores the scaling or translation
if (!m_window) return FALSE;
+#if 0
+ // transform the source DC coords to the device ones
+ xsrc = XLOG2DEV(xsrc);
+ ysrc = YLOG2DEV(ysrc);
+#endif
+
wxClientDC *srcDC = (wxClientDC*)source;
wxMemoryDC *memDC = (wxMemoryDC*)source;
if (!m_currentClippingRegion.IsNull())
{
GdkColor col;
- new_mask = gdk_pixmap_new( wxRootWindow->window, bm_ww, bm_hh, 1 );
+ new_mask = gdk_pixmap_new( wxGetRootWindow()->window, bm_ww, bm_hh, 1 );
GdkGC *gc = gdk_gc_new( new_mask );
col.pixel = 0;
gdk_gc_set_foreground( gc, &col );
GdkRegion *region = m_paintClippingRegion.GetRegion();
if ( region )
{
- m_currentClippingRegion.Union( m_paintClippingRegion );
+ m_paintClippingRegion = win->GetUpdateRegion();
+ GdkRegion *region = m_paintClippingRegion.GetRegion();
+ if ( region )
+ {
+ m_currentClippingRegion.Union( m_paintClippingRegion );
- gdk_gc_set_clip_region( m_penGC, region );
- gdk_gc_set_clip_region( m_brushGC, region );
- gdk_gc_set_clip_region( m_textGC, region );
- gdk_gc_set_clip_region( m_bgGC, region );
+ gdk_gc_set_clip_region( m_penGC, region );
+ gdk_gc_set_clip_region( m_brushGC, region );
+ gdk_gc_set_clip_region( m_textGC, region );
+ gdk_gc_set_clip_region( m_bgGC, region );
+ }
}
-#endif
+#endif // USE_PAINT_REGION
}
//-----------------------------------------------------------------------------
wxClientDC::wxClientDC( wxWindow *win )
: wxWindowDC( win )
{
+ wxCHECK_RET( win, _T("NULL window in wxClientDC::wxClientDC") );
+
+#ifdef __WXUNIVERSAL__
+ wxPoint ptOrigin = win->GetClientAreaOrigin();
+ SetDeviceOrigin(ptOrigin.x, ptOrigin.y);
+ wxSize size = win->GetClientSize();
+ SetClippingRegion(wxPoint(0, 0), size);
+#endif // __WXUNIVERSAL__
}
void wxClientDC::DoGetSize(int *width, int *height) const