Commit efc108fb authored by Moritz Lipp's avatar Moritz Lipp

Introduced page.h

parent fab515a4
......@@ -16,6 +16,7 @@
#include "utils.h"
#include "shortcuts.h"
#include "page-widget.h"
#include "page.h"
gboolean
cb_destroy(GtkWidget* UNUSED(widget), zathura_t* zathura)
......@@ -79,22 +80,23 @@ cb_view_vadjustment_value_changed(GtkAdjustment* GIRARA_UNUSED(adjustment), gpoi
zathura_page_t* page = zathura->document->pages[page_id];
GdkRectangle page_rect;
gtk_widget_translate_coordinates(page->drawing_area,
GtkWidget* page_widget = zathura_page_get_widget(page);
gtk_widget_translate_coordinates(page_widget,
zathura->ui.session->gtk.view, 0, 0, &page_rect.x, &page_rect.y);
page_rect.width = page->width * zathura->document->scale;
page_rect.height = page->height * zathura->document->scale;
page_rect.width = zathura_page_get_width(page) * zathura->document->scale;
page_rect.height = zathura_page_get_height(page) * zathura->document->scale;
if (gdk_rectangle_intersect(&view_rect, &page_rect, NULL) == TRUE) {
page->visible = true;
zathura_page_set_visibility(page, true);
if (zathura->global.update_page_number == true && updated == false
&& gdk_rectangle_intersect(&center, &page_rect, NULL) == TRUE) {
zathura->document->current_page_number = page_id;
updated = true;
}
} else {
page->visible = false;
zathura_page_set_visibility(page, false);
}
zathura_page_widget_update_view_time(ZATHURA_PAGE(page->drawing_area));
zathura_page_widget_update_view_time(ZATHURA_PAGE(page_widget));
}
statusbar_page_number_update(zathura);
......@@ -185,14 +187,15 @@ cb_sc_follow(GtkEntry* entry, girara_session_t* session)
bool invalid_index = true;
for (unsigned int page_id = 0; page_id < zathura->document->number_of_pages; page_id++) {
zathura_page_t* page = zathura->document->pages[page_id];
if (page == NULL || page->visible == false) {
if (page == NULL || zathura_page_get_visibility(page) == false) {
continue;
}
g_object_set(page->drawing_area, "draw-links", FALSE, NULL);
GtkWidget* page_widget = zathura_page_get_widget(page);
g_object_set(page_widget, "draw-links", FALSE, NULL);
if (eval == true) {
zathura_link_t* link = zathura_page_widget_link_get(ZATHURA_PAGE(page->drawing_area), index);
zathura_link_t* link = zathura_page_widget_link_get(ZATHURA_PAGE(page_widget), index);
if (link != NULL) {
switch (link->type) {
case ZATHURA_LINK_TO_PAGE:
......
......@@ -14,7 +14,7 @@
#include "document.h"
#include "utils.h"
#include "page-widget.h"
#include "page.h"
#include <girara/session.h>
#include <girara/datastructures.h>
......@@ -310,12 +310,13 @@ cmd_search(girara_session_t* session, const char* input, girara_argument_t* argu
continue;
}
g_object_set(page->drawing_area, "draw-links", FALSE, NULL);
GtkWidget* page_widget = zathura_page_get_widget(page);
g_object_set(page_widget, "draw-links", FALSE, NULL);
girara_list_t* result = zathura_page_search_text(page, input, &error);
if (result == NULL || girara_list_size(result) == 0) {
girara_list_free(result);
g_object_set(page->drawing_area, "search-results", NULL, NULL);
g_object_set(page_widget, "search-results", NULL, NULL);
if (error == ZATHURA_PLUGIN_ERROR_NOT_IMPLEMENTED) {
break;
......@@ -324,12 +325,12 @@ cmd_search(girara_session_t* session, const char* input, girara_argument_t* argu
}
}
g_object_set(page->drawing_area, "search-results", result, NULL);
g_object_set(page_widget, "search-results", result, NULL);
if (firsthit == true) {
if (page_id != 0) {
page_set_delayed(zathura, page->number);
page_set_delayed(zathura, zathura_page_get_id(page));
}
g_object_set(page->drawing_area, "search-current", 0, NULL);
g_object_set(page_widget, "search-current", 0, NULL);
firsthit = false;
}
}
......
......@@ -93,7 +93,7 @@ config_load_default(zathura_t* zathura)
girara_setting_add(gsession, "zoom-min", &int_value, INT, false, _("Zoom minimum"), NULL, NULL);
int_value = 1000;
girara_setting_add(gsession, "zoom-max", &int_value, INT, false, _("Zoom maximum"), NULL, NULL);
int_value = 30;
int_value = 5;
girara_setting_add(gsession, "page-store-threshold", &int_value, INT, false, _("Store unvisible pages only for some time (in seconds)"), NULL, NULL);
girara_setting_add(gsession, "page-store-interval", &int_value, INT, true, _("Amount of seconds between the checks for invisible pages"), NULL, NULL);
......
......@@ -18,6 +18,7 @@
#include "zathura.h"
#include "render.h"
#include "database.h"
#include "page.h"
#include "page-widget.h"
#include <girara/datastructures.h>
......@@ -550,235 +551,6 @@ zathura_document_meta_get(zathura_document_t* document, zathura_document_meta_t
return document->functions.document_meta_get(document, meta, error);
}
zathura_page_t*
zathura_page_get(zathura_document_t* document, unsigned int page_id, zathura_plugin_error_t* error)
{
if (document == NULL || document->zathura == NULL || document->zathura->ui.session == NULL) {
if (error != NULL) {
*error = ZATHURA_PLUGIN_ERROR_INVALID_ARGUMENTS;
}
return NULL;
}
if (document->functions.page_get == NULL) {
girara_notify(document->zathura->ui.session, GIRARA_WARNING, _("%s not implemented"), __FUNCTION__);
girara_error("%s not implemented", __FUNCTION__);
if (error != NULL) {
*error = ZATHURA_PLUGIN_ERROR_NOT_IMPLEMENTED;
}
return NULL;
}
zathura_page_t* page = document->functions.page_get(document, page_id, error);
if (page != NULL) {
page->number = page_id;
page->visible = false;
page->drawing_area = zathura_page_widget_new(page);
if (page->drawing_area == NULL) {
if (error != NULL) {
*error = ZATHURA_PLUGIN_ERROR_UNKNOWN;
}
girara_error("Couldn't create page widget");
zathura_page_free(page);
return NULL;
}
page->document = document;
unsigned int page_height = 0;
unsigned int page_width = 0;
page_calc_height_width(page, &page_height, &page_width, true);
gtk_widget_set_size_request(page->drawing_area, page_width, page_height);
}
return page;
}
zathura_plugin_error_t
zathura_page_free(zathura_page_t* page)
{
if (page == NULL || page->document == NULL || page->document->zathura == NULL || page->document->zathura->ui.session == NULL) {
return ZATHURA_PLUGIN_ERROR_INVALID_ARGUMENTS;
}
if (page->document->functions.page_free == NULL) {
girara_notify(page->document->zathura->ui.session, GIRARA_WARNING, _("%s not implemented"), __FUNCTION__);
girara_error("%s not implemented", __FUNCTION__);
return ZATHURA_PLUGIN_ERROR_NOT_IMPLEMENTED;
}
return page->document->functions.page_free(page);
}
girara_list_t*
zathura_page_search_text(zathura_page_t* page, const char* text, zathura_plugin_error_t* error)
{
if (page == NULL || page->document == NULL || text == NULL ||
page->document->zathura == NULL || page->document->zathura->ui.session == NULL) {
if (error != NULL) {
*error = ZATHURA_PLUGIN_ERROR_INVALID_ARGUMENTS;
}
return NULL;
}
if (page->document->functions.page_search_text == NULL) {
girara_notify(page->document->zathura->ui.session, GIRARA_WARNING, _("%s not implemented"), __FUNCTION__);
girara_error("%s not implemented", __FUNCTION__);
if (error != NULL) {
*error = ZATHURA_PLUGIN_ERROR_NOT_IMPLEMENTED;
}
return NULL;
}
return page->document->functions.page_search_text(page, text, error);
}
girara_list_t*
zathura_page_links_get(zathura_page_t* page, zathura_plugin_error_t* error)
{
if (page == NULL || page->document == NULL || page->document->zathura == NULL
|| page->document->zathura->ui.session == NULL) {
if (error != NULL) {
*error = ZATHURA_PLUGIN_ERROR_INVALID_ARGUMENTS;
}
return NULL;
}
if (page->document->functions.page_links_get == NULL) {
girara_notify(page->document->zathura->ui.session, GIRARA_WARNING, _("%s not implemented"), __FUNCTION__);
girara_error("%s not implemented", __FUNCTION__);
if (error != NULL) {
*error = ZATHURA_PLUGIN_ERROR_NOT_IMPLEMENTED;
}
return NULL;
}
return page->document->functions.page_links_get(page, error);
}
zathura_plugin_error_t
zathura_page_links_free(girara_list_t* UNUSED(list))
{
return false;
}
girara_list_t*
zathura_page_form_fields_get(zathura_page_t* page, zathura_plugin_error_t* error)
{
if (page == NULL || page->document == NULL || page->document->zathura == NULL
|| page->document->zathura->ui.session == NULL) {
if (error != NULL) {
*error = ZATHURA_PLUGIN_ERROR_INVALID_ARGUMENTS;
}
return NULL;
}
if (page->document->functions.page_form_fields_get == NULL) {
girara_notify(page->document->zathura->ui.session, GIRARA_WARNING, _("%s not implemented"), __FUNCTION__);
girara_error("%s not implemented", __FUNCTION__);
if (error != NULL) {
*error = ZATHURA_PLUGIN_ERROR_NOT_IMPLEMENTED;
}
return NULL;
}
return page->document->functions.page_form_fields_get(page, error);
}
zathura_plugin_error_t
zathura_page_form_fields_free(girara_list_t* UNUSED(list))
{
return ZATHURA_PLUGIN_ERROR_NOT_IMPLEMENTED;
}
girara_list_t*
zathura_page_images_get(zathura_page_t* page, zathura_plugin_error_t* error)
{
if (page == NULL || page->document == NULL || page->document->zathura == NULL
|| page->document->zathura->ui.session == NULL) {
if (error != NULL) {
*error = ZATHURA_PLUGIN_ERROR_INVALID_ARGUMENTS;
}
return NULL;
}
if (page->document->functions.page_images_get == NULL) {
girara_notify(page->document->zathura->ui.session, GIRARA_WARNING, _("%s not implemented"), __FUNCTION__);
girara_error("%s not implemented", __FUNCTION__);
if (error != NULL) {
*error = ZATHURA_PLUGIN_ERROR_NOT_IMPLEMENTED;
}
return NULL;
}
return page->document->functions.page_images_get(page, error);
}
cairo_surface_t*
zathura_page_image_get_cairo(zathura_page_t* page, zathura_image_t* image, zathura_plugin_error_t* error)
{
if (page == NULL || page->document == NULL || image == NULL ||
page->document->zathura == NULL || page->document->zathura->ui.session ==
NULL) {
if (error != NULL) {
*error = ZATHURA_PLUGIN_ERROR_INVALID_ARGUMENTS;
}
return NULL;
}
if (page->document->functions.page_image_get_cairo == NULL) {
girara_notify(page->document->zathura->ui.session, GIRARA_WARNING, _("%s not implemented"), __FUNCTION__);
girara_error("%s not implemented", __FUNCTION__);
if (error != NULL) {
*error = ZATHURA_PLUGIN_ERROR_NOT_IMPLEMENTED;
}
return NULL;
}
return page->document->functions.page_image_get_cairo(page, image, error);
}
char* zathura_page_get_text(zathura_page_t* page, zathura_rectangle_t rectangle, zathura_plugin_error_t* error)
{
if (page == NULL || page->document == NULL || page->document->zathura == NULL || page->document->zathura->ui.session == NULL) {
if (error) {
*error = ZATHURA_PLUGIN_ERROR_INVALID_ARGUMENTS;
}
return NULL;
}
if (page->document->functions.page_get_text == NULL) {
girara_notify(page->document->zathura->ui.session, GIRARA_WARNING, _("%s not implemented"), __FUNCTION__);
girara_error("%s not implemented", __FUNCTION__);
if (error) {
*error = ZATHURA_PLUGIN_ERROR_NOT_IMPLEMENTED;
}
return NULL;
}
return page->document->functions.page_get_text(page, rectangle, error);
}
zathura_plugin_error_t
zathura_page_render(zathura_page_t* page, cairo_t* cairo, bool printing)
{
if (page == NULL || page->document == NULL || cairo == NULL ||
page->document->zathura == NULL || page->document->zathura->ui.session ==
NULL) {
return ZATHURA_PLUGIN_ERROR_INVALID_ARGUMENTS;
}
if (page->document->functions.page_render_cairo == NULL) {
girara_notify(page->document->zathura->ui.session, GIRARA_WARNING, _("%s not implemented"), __FUNCTION__);
girara_error("%s not implemented", __FUNCTION__);
return ZATHURA_PLUGIN_ERROR_NOT_IMPLEMENTED;
}
return page->document->functions.page_render_cairo(page, cairo, printing);
}
zathura_index_element_t*
zathura_index_element_new(const char* title)
{
......
......@@ -233,20 +233,6 @@ typedef struct zathura_form_s
zathura_form_type_t type; /**< Type */
} zathura_form_t;
/**
* Page
*/
struct zathura_page_s
{
double height; /**< Page height */
double width; /**< Page width */
unsigned int number; /**< Page number */
zathura_document_t* document; /**< Document */
void* data; /**< Custom data */
bool visible; /**< Page is visible */
GtkWidget* drawing_area; /**< Drawing area */
};
/**
* Document
*/
......@@ -439,117 +425,6 @@ zathura_plugin_error_t zathura_document_attachment_save(zathura_document_t* docu
*/
char* zathura_document_meta_get(zathura_document_t* document, zathura_document_meta_t meta, zathura_plugin_error_t* error);
/**
* Get the page object
*
* @param document The document
* @param page_id Page number
* @param error Set to an error value (see \ref zathura_plugin_error_t) if an
* error occured
* @return Page object or NULL if an error occured
*/
zathura_page_t* zathura_page_get(zathura_document_t* document, unsigned int page_id, zathura_plugin_error_t* error);
/**
* Frees the page object
*
* @param page The page object
* @return ZATHURA_PLUGIN_ERROR_OK when no error occured, otherwise see
* zathura_plugin_error_t
*/
zathura_plugin_error_t zathura_page_free(zathura_page_t* page);
/**
* Search page
*
* @param page The page object
* @param text Search item
* @param error Set to an error value (see \ref zathura_plugin_error_t) if an
* error occured
* @return List of results
*/
girara_list_t* zathura_page_search_text(zathura_page_t* page, const char* text, zathura_plugin_error_t* error);
/**
* Get page links
*
* @param page The page object
* @param error Set to an error value (see \ref zathura_plugin_error_t) if an
* error occured
* @return List of links
*/
girara_list_t* zathura_page_links_get(zathura_page_t* page, zathura_plugin_error_t* error);
/**
* Free page links
*
* @param list List of links
* @return ZATHURA_PLUGIN_ERROR_OK when no error occured, otherwise see
* zathura_plugin_error_t
*/
zathura_plugin_error_t zathura_page_links_free(girara_list_t* list);
/**
* Get list of form fields
*
* @param page The page object
* @param error Set to an error value (see \ref zathura_plugin_error_t) if an
* error occured
* @return List of form fields
*/
girara_list_t* zathura_page_form_fields_get(zathura_page_t* page, zathura_plugin_error_t* error);
/**
* Free list of form fields
*
* @param list List of form fields
* @return ZATHURA_PLUGIN_ERROR_OK when no error occured, otherwise see
* zathura_plugin_error_t
*/
zathura_plugin_error_t zathura_page_form_fields_free(girara_list_t* list);
/**
* Get list of images
*
* @param page Page
* @param error Set to an error value (see \ref zathura_plugin_error_t) if an
* error occured
* @return List of images or NULL if an error occured
*/
girara_list_t* zathura_page_images_get(zathura_page_t* page, zathura_plugin_error_t* error);
/**
* Get image
*
* @param page Page
* @param image Image identifier
* @param error Set to an error value (see \ref zathura_plugin_error_t) if an
* error occured
* @return The cairo image surface or NULL if an error occured
*/
cairo_surface_t* zathura_page_image_get_cairo(zathura_page_t* page, zathura_image_t* image, zathura_plugin_error_t* error);
/**
* Get text for selection
* @param page Page
* @param rectangle Selection
* @param error Set to an error value (see \ref zathura_plugin_error_t) if an error
* occured
* @return The selected text (needs to be deallocated with g_free)
*/
char* zathura_page_get_text(zathura_page_t* page, zathura_rectangle_t rectangle, zathura_plugin_error_t* error);
/**
* Render page
*
* @param page The page object
* @param cairo Cairo object
* @param printing render for printing
* @return ZATHURA_PLUGIN_ERROR_OK when no error occured, otherwise see
* zathura_plugin_error_t
*/
zathura_plugin_error_t zathura_page_render(zathura_page_t* page, cairo_t* cairo, bool printing);
/**
* Create new index element
*
......
......@@ -8,6 +8,7 @@
#include <glib/gi18n.h>
#include "page-widget.h"
#include "page.h"
#include "render.h"
#include "utils.h"
#include "shortcuts.h"
......@@ -172,11 +173,13 @@ zathura_page_widget_set_property(GObject* object, guint prop_id, const GValue* v
{
ZathuraPage* pageview = ZATHURA_PAGE(object);
zathura_page_widget_private_t* priv = ZATHURA_PAGE_GET_PRIVATE(pageview);
zathura_document_t* document = NULL;
switch (prop_id) {
case PROP_PAGE:
priv->page = g_value_get_pointer(value);
priv->zathura = priv->page->document->zathura;
document = zathura_page_get_document(priv->page);
priv->zathura = document->zathura;
break;
case PROP_DRAW_LINKS:
priv->draw_links = g_value_get_boolean(value);
......@@ -282,6 +285,8 @@ zathura_page_widget_draw(GtkWidget* widget, cairo_t* cairo)
zathura_page_widget_private_t* priv = ZATHURA_PAGE_GET_PRIVATE(widget);
g_static_mutex_lock(&(priv->lock));
zathura_document_t* document = zathura_page_get_document(priv->page);
#if GTK_MAJOR_VERSION == 2
GtkAllocation allocation;
gtk_widget_get_allocation(widget, &allocation);
......@@ -295,7 +300,7 @@ zathura_page_widget_draw(GtkWidget* widget, cairo_t* cairo)
if (priv->surface != NULL) {
cairo_save(cairo);
switch (priv->page->document->rotate) {
switch (document->rotate) {
case 90:
cairo_translate(cairo, page_width, 0);
break;
......@@ -307,8 +312,8 @@ zathura_page_widget_draw(GtkWidget* widget, cairo_t* cairo)
break;
}
if (priv->page->document->rotate != 0) {
cairo_rotate(cairo, priv->page->document->rotate * G_PI / 180.0);
if (document->rotate != 0) {
cairo_rotate(cairo, document->rotate * G_PI / 180.0);
}
cairo_set_source_surface(cairo, priv->surface, 0, 0);
......@@ -524,6 +529,7 @@ cb_zathura_page_widget_button_release_event(GtkWidget* widget, GdkEventButton* b
}
zathura_page_widget_private_t* priv = ZATHURA_PAGE_GET_PRIVATE(widget);
zathura_document_t* document = zathura_page_get_document(priv->page);
if (priv->selection.y2 == -1 && priv->selection.x2 == -1 ) {
/* simple single click */
......@@ -541,7 +547,7 @@ cb_zathura_page_widget_button_release_event(GtkWidget* widget, GdkEventButton* b
&& rect.y1 <= button->y && rect.y2 >= button->y) {
switch (link->type) {
case ZATHURA_LINK_TO_PAGE:
page_set_delayed(priv->page->document->zathura, link->target.page_number);
page_set_delayed(document->zathura, link->target.page_number);
return false;
case ZATHURA_LINK_EXTERNAL:
girara_xdg_open(link->target.value);
......@@ -554,10 +560,10 @@ cb_zathura_page_widget_button_release_event(GtkWidget* widget, GdkEventButton* b
redraw_rect(ZATHURA_PAGE(widget), &priv->selection);
zathura_rectangle_t tmp = priv->selection;
tmp.x1 /= priv->page->document->scale;
tmp.x2 /= priv->page->document->scale;
tmp.y1 /= priv->page->document->scale;
tmp.y2 /= priv->page->document->scale;
tmp.x1 /= document->scale;
tmp.x2 /= document->scale;
tmp.y1 /= document->scale;
tmp.y2 /= document->scale;
char* text = zathura_page_get_text(priv->page, tmp, NULL);
if (text != NULL) {
......@@ -566,8 +572,8 @@ cb_zathura_page_widget_button_release_event(GtkWidget* widget, GdkEventButton* b
gtk_clipboard_set_text(gtk_clipboard_get(GDK_SELECTION_PRIMARY), text, -1);
if (priv->page != NULL && priv->page->document != NULL && priv->page->document->zathura != NULL) {
zathura_t* zathura = priv->page->document->zathura;
if (priv->page != NULL && document != NULL && document->zathura != NULL) {
zathura_t* zathura = document->zathura;
char* stripped_text = g_strdelimit(g_strdup(text), "\n\t\r\n", ' ');
girara_notify(zathura->ui.session, GIRARA_INFO, _("Copied selected text to clipbard: %s"), stripped_text);
g_free(stripped_text);
......@@ -730,7 +736,7 @@ zathura_page_widget_update_view_time(ZathuraPage* widget)
g_return_if_fail(ZATHURA_IS_PAGE(widget) == TRUE);
zathura_page_widget_private_t* priv = ZATHURA_PAGE_GET_PRIVATE(widget);
if (priv->page->visible == true) {
if (zathura_page_get_visibility(priv->page) == true) {
priv->last_view = g_get_real_time();
}
}
......@@ -740,7 +746,7 @@ zathura_page_widget_purge_unused(ZathuraPage* widget, gint64 threshold)
{
g_return_if_fail(ZATHURA_IS_PAGE(widget) == TRUE);
zathura_page_widget_private_t* priv = ZATHURA_PAGE_GET_PRIVATE(widget);
if (priv->page->visible == true || priv->surface == NULL || threshold <= 0) {
if (zathura_page_get_visibility(priv->page) == true || priv->surface == NULL || threshold <= 0) {
return;
}
......
/* See LICENSE file for license and copyright information */
#include <girara/session.h>
#include <girara/utils.h>
#include <glib/gi18n.h>
#include "document.h"
#include "page.h"
#include "page-widget.h"
#include "utils.h"
struct zathura_page_s {
double height; /**< Page height */
double width; /**< Page width */
unsigned int id; /**< Page number */
void* data; /**< Custom data */
bool visible; /**< Page is visible */
GtkWidget* widget; /**< Drawing area */
zathura_document_t* document; /**< Document */
};
zathura_page_t*
zathura_page_get(zathura_document_t* document, unsigned int page_id, zathura_plugin_error_t* error)
{
if (document == NULL || document->zathura == NULL || document->zathura->ui.session == NULL) {
if (error != NULL) {
*error = ZATHURA_PLUGIN_ERROR_INVALID_ARGUMENTS;
}
goto error_ret;
}
zathura_page_t* page = NULL;
if (document->functions.page_get == NULL) {
if (error != NULL) {
girara_notify(page->document->zathura->ui.session, GIRARA_WARNING, _("%s not implemented"), __FUNCTION__);
girara_error("%s not implemented", __FUNCTION__);
*error = ZATHURA_PLUGIN_ERROR_NOT_IMPLEMENTED;
}
goto error_ret;
}
page = document->functions.page_get(document, page_id, error);
if (page != NULL) {
page->id = page_id;
page->visible = false;
page->document = document;
page->widget = zathura_page_widget_new(page);
if (page->widget == NULL) {
if (error != NULL) {
*error = ZATHURA_PLUGIN_ERROR_UNKNOWN;
}
goto error_free;
}
unsigned int page_height = 0;
unsigned int page_width = 0;
page_calc_height_width(page, &page_height, &page_width, true);
gtk_widget_set_size_request(page->widget, page_width, page_height);
}
return page;
error_free:
if (page != NULL) {
zathura_page_free(page);
}
error_ret:
return NULL;
}
zathura_plugin_error_t
zathura_page_free(zathura_page_t* page)
{
if (page == NULL || page->document == NULL || page->document->zathura == NULL || page->document->zathura->ui.session == NULL) {
return ZATHURA_PLUGIN_ERROR_INVALID_ARGUMENTS;
}
if (page->document->functions.page_free == NULL) {
girara_notify(page->document->zathura->ui.session, GIRARA_WARNING, _("%s not implemented"), __FUNCTION__);
girara_error("%s not implemented", __FUNCTION__);
return ZATHURA_PLUGIN_ERROR_NOT_IMPLEMENTED;
}
return page->document->functions.page_free(page);
}
zathura_document_t*
zathura_page_get_document(zathura_page_t* page)
{
if (page == NULL) {
return NULL;
}
return page->document;
}
unsigned int
zathura_page_get_id(zathura_page_t* page)
{
if (page == NULL) {
return 0;
}
return page->id;
}
GtkWidget*
zathura_page_get_widget(zathura_page_t* page)
{
if (page == NULL) {
return NULL;
}
return page->widget;
}
double
zathura_page_get_width(zathura_page_t* page)
{
if (page == NULL) {
return -1;
}
return page->width;
}
void
zathura_page_set_width(zathura_page_t* page, double width)
{
if (page == NULL) {
return;
}
page->width = width;