Commit 9f5d6cdd authored by Moritz Lipp's avatar Moritz Lipp
Browse files

Added page_render_cairo function

parent 13eeebc9
......@@ -206,32 +206,16 @@ zathura_document_open(zathura_t* zathura, const char* path, const char* password
goto error_free;
}
document = malloc(sizeof(zathura_document_t));
document = g_malloc0(sizeof(zathura_document_t));
if (document == NULL) {
goto error_free;
}
document->file_path = real_path;
document->password = password;
document->current_page_number = 0;
document->number_of_pages = 0;
document->scale = 1.0;
document->rotate = 0;
document->data = NULL;
document->pages = NULL;
document->zathura = zathura;
document->functions.document_free = NULL;
document->functions.document_index_generate = NULL;
document->functions.document_save_as = NULL;
document->functions.document_attachments_get = NULL;
document->functions.page_get = NULL;
document->functions.page_free = NULL;
document->functions.page_search_text = NULL;
document->functions.page_links_get = NULL;
document->functions.page_form_fields_get = NULL;
document->functions.page_render = NULL;
girara_list_iterator_t* iter = girara_list_iterator(zathura->plugins.plugins);
if (iter == NULL) {
goto error_free;
......@@ -285,7 +269,7 @@ error_free:
free(document->pages);
}
free(document);
g_free(document);
error_out:
......@@ -315,7 +299,7 @@ zathura_document_free(zathura_document_t* document)
free(document->file_path);
}
free(document);
g_free(document);
return true;
}
......@@ -325,7 +309,7 @@ zathura_document_free(zathura_document_t* document)
free(document->file_path);
}
free(document);
g_free(document);
return r;
}
......
......@@ -3,6 +3,7 @@
#ifndef DOCUMENT_H
#define DOCUMENT_H
#include <cairo.h>
#include <gtk/gtk.h>
#include <stdbool.h>
......@@ -213,6 +214,11 @@ struct zathura_document_s
*/
zathura_image_buffer_t* (*page_render)(zathura_page_t* page);
/**
* Renders the page
*/
bool (*page_render_cairo)(zathura_page_t* page, cairo_t* cairo);
/**
* Free page
*/
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment