void GR_UnixCairoGraphics::scroll(UT_sint32 x_dest, UT_sint32 y_dest,
						  UT_sint32 x_src, UT_sint32 y_src,
						  G_GNUC_UNUSED UT_sint32 width, G_GNUC_UNUSED UT_sint32 height)
{
#if !GTK_CHECK_VERSION(3,0,0)
	GdkGC *gc;

	disableAllCarets();
	gc = gdk_gc_new(_getWindow());
   	gdk_draw_drawable(_getWindow(), gc, _getWindow(), tdu(x_src), tdu(y_src),
					  tdu(x_dest), tdu(y_dest), tdu(width), tdu(height));
	g_object_unref(G_OBJECT(gc)), gc = NULL;
	enableAllCarets();
#else
	scroll(x_src - x_dest, y_src - y_dest);
#endif
}
GR_UnixCairoGraphics::GR_UnixCairoGraphics(GdkWindow * win, bool double_buffered)
	: GR_UnixCairoGraphicsBase(),
	  m_pWin(win),
	  m_double_buffered(double_buffered),
	  m_CairoCreated(false),
	  m_Painting(false),
	  m_Signal(0),
 	  m_DestroySignal(0),
     m_Widget(NULL)
{
	m_cr = NULL;
	if (_getWindow())
	{
		// Set GraphicsExposes so that XCopyArea() causes an expose on
		// obscured regions rather than just tiling in the default background.
		// TODO: is this still needed with cairo, and if yes can it be emulated
		// without having m_pGC any more?
		// gdk_gc_set_exposures(m_pGC, 1);
		setCursor(GR_CURSOR_DEFAULT);	
	}
}
void Win32CustomControl::SetVisible(bool visible) {
	ShowWindow(_getWindow(), (visible) ? SW_SHOW : SW_HIDE);
	__visible = visible;
}
const RECT Win32CustomControl::_getBounds() {
	RECT r;
	GetClientRect(_getWindow(), &r);
	return r;
}