Render (does not work yet)

This commit is contained in:
Moritz Lipp 2010-12-26 02:22:08 +01:00
parent ca35db2dc9
commit b8aa82b4b1

View file

@ -19,9 +19,21 @@ cb_destroy(GtkWidget* widget, gpointer data)
gboolean
cb_draw(GtkWidget* widget, GdkEventExpose* expose, gpointer data)
{
if(!widget) {
return false;
}
gdk_window_clear(widget->window);
cairo_t *cairo = gdk_cairo_create(widget->window);
if(!cairo) {
return false;
}
// FIXME: Split up
zathura_page_t* page = zathura_page_get(Zathura.document, Zathura.document->current_page_number);
if(!page) {
cairo_destroy(cairo);
goto error_out;
}
@ -32,6 +44,10 @@ cb_draw(GtkWidget* widget, GdkEventExpose* expose, gpointer data)
goto error_out;
}
cairo_set_source_surface(cairo, surface, 0, 0);
cairo_paint(cairo);
cairo_destroy(cairo);
cairo_surface_destroy(surface);
zathura_page_free(page);