mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-12-29 14:06:02 +01:00
Render (does not work yet)
This commit is contained in:
parent
ca35db2dc9
commit
b8aa82b4b1
1 changed files with 16 additions and 0 deletions
16
callbacks.c
16
callbacks.c
|
@ -19,9 +19,21 @@ cb_destroy(GtkWidget* widget, gpointer data)
|
||||||
gboolean
|
gboolean
|
||||||
cb_draw(GtkWidget* widget, GdkEventExpose* expose, gpointer data)
|
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
|
// FIXME: Split up
|
||||||
zathura_page_t* page = zathura_page_get(Zathura.document, Zathura.document->current_page_number);
|
zathura_page_t* page = zathura_page_get(Zathura.document, Zathura.document->current_page_number);
|
||||||
if(!page) {
|
if(!page) {
|
||||||
|
cairo_destroy(cairo);
|
||||||
goto error_out;
|
goto error_out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,6 +44,10 @@ cb_draw(GtkWidget* widget, GdkEventExpose* expose, gpointer data)
|
||||||
goto error_out;
|
goto error_out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cairo_set_source_surface(cairo, surface, 0, 0);
|
||||||
|
cairo_paint(cairo);
|
||||||
|
cairo_destroy(cairo);
|
||||||
|
|
||||||
cairo_surface_destroy(surface);
|
cairo_surface_destroy(surface);
|
||||||
zathura_page_free(page);
|
zathura_page_free(page);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue