add argument printing to zathura_page_render

This commit is contained in:
Sebastian Ramacher 2012-02-07 15:10:58 +01:00
parent c2b9d22ad1
commit aea5024ce3
4 changed files with 7 additions and 6 deletions

View File

@ -546,7 +546,7 @@ zathura_page_image_save(zathura_page_t* page, zathura_image_t* image, const char
}
bool
zathura_page_render(zathura_page_t* page, cairo_t* cairo)
zathura_page_render(zathura_page_t* page, cairo_t* cairo, bool printing)
{
if (page == NULL || page->document == NULL || cairo == NULL) {
return NULL;
@ -557,7 +557,7 @@ zathura_page_render(zathura_page_t* page, cairo_t* cairo)
return NULL;
}
return page->document->functions.page_render_cairo(page, cairo);
return page->document->functions.page_render_cairo(page, cairo, printing);
}
zathura_index_element_t*

View File

@ -249,7 +249,7 @@ struct zathura_document_s
/**
* Renders the page
*/
bool (*page_render_cairo)(zathura_page_t* page, cairo_t* cairo);
bool (*page_render_cairo)(zathura_page_t* page, cairo_t* cairo, bool printing);
/**
* Free page
@ -420,9 +420,10 @@ bool zathura_page_image_save(zathura_page_t* page, zathura_image_t* image, const
*
* @param page The page object
* @param cairo Cairo object
* @param printing render for printing
* @return True if no error occured, otherwise false
*/
bool zathura_page_render(zathura_page_t* page, cairo_t* cairo);
bool zathura_page_render(zathura_page_t* page, cairo_t* cairo, bool printing);
/**
* Create new index element

View File

@ -89,5 +89,5 @@ cb_print_draw_page(GtkPrintOperation* UNUSED(print_operation), GtkPrintContext*
return;
}
zathura_page_render(page, cairo);
zathura_page_render(page, cairo, true);
}

View File

@ -194,7 +194,7 @@ render(zathura_t* zathura, zathura_page_t* page)
cairo_scale(cairo, zathura->document->scale, zathura->document->scale);
}
if (zathura_page_render(page, cairo) == false) {
if (zathura_page_render(page, cairo, false) == false) {
cairo_destroy(cairo);
cairo_surface_destroy(surface);
gdk_threads_leave();