static gboolean webViewDraw(GtkWidget* widget, cairo_t* cr) { WebView* webView = webViewWidgetGetWebViewInstance(WEB_VIEW_WIDGET(widget)); GdkRectangle clipRect; if (!gdk_cairo_get_clip_rectangle(cr, &clipRect)) return FALSE; webView->paint(widget, clipRect, cr); return FALSE; }
static gboolean webViewExpose(GtkWidget* widget, GdkEventExpose* event) { WebView* webView = webViewWidgetGetWebViewInstance(WEB_VIEW_WIDGET(widget)); GdkRectangle clipRect; gdk_region_get_clipbox(event->region, &clipRect); GdkWindow* window = gtk_widget_get_window(widget); RefPtr<cairo_t> cr = adoptRef(gdk_cairo_create(window)); webView->paint(widget, clipRect, cr.get()); return FALSE; }