Commit c659361a authored by Sebastian Ramacher's avatar Sebastian Ramacher
Browse files

Merge branch 'develop'

parents de0890c2 07cb63c8
......@@ -11,3 +11,4 @@ zathura.pc
*.gcno
*.gcda
gcov/
*.swp
zathura is written by:
Moritz Lipp <mlq@pwmt.org>
Sebastian Ramacher <s.ramacher@gmx.at>
Other contributors are (in alphabetical order):
Pavel Borzenkov <pavel.borzenkov@gmail.com>
Ivan Sichmann Freitas <ivansichfreitas@gmail.com>
int3 <jezreel@gmail.com>
karottenreibe <k@rottenrei.be>
Johannes Meng <j@jmeng.de>
Copyright (c) 2009-2011 pwmt.org
Copyright (c) 2009-2012 pwmt.org
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
......
......@@ -63,6 +63,8 @@ ${PROJECT}.pc: ${PROJECT}.pc.in config.mk
$(QUIET)echo project=${PROJECT} > ${PROJECT}.pc
$(QUIET)echo version=${VERSION} >> ${PROJECT}.pc
$(QUIET)echo includedir=${PREFIX}/include >> ${PROJECT}.pc
$(QUIET)echo plugindir=${PLUGINDIR} >> ${PROJECT}.pc
$(QUIET)echo GTK_VERSION=${ZATHURA_GTK_VERSION} >> ${PROJECT}.pc
$(QUIET)cat ${PROJECT}.pc.in >> ${PROJECT}.pc
valgrind: debug
......@@ -72,19 +74,22 @@ valgrind: debug
gdb: debug
cgdb ${PROJECT}-debug
tests: ${OBJECTS}
$(QUIET)make -C tests
test: ${OBJECTS}
$(QUIET)make -C tests run
dist: clean
$(QUIET)mkdir -p ${PROJECT}-${VERSION}
$(QUIET)cp -R LICENSE Makefile config.mk common.mk README Doxyfile \
${PROJECT}.1 ${SOURCE} ${HEADER} ${PROJECT}.pc.in tests \
$(QUIET)mkdir -p ${PROJECT}-${VERSION}/tests
$(QUIET)cp LICENSE Makefile config.mk common.mk README AUTHORS Doxyfile \
${PROJECT}.1.rst ${PROJECT}rc.5.rst ${SOURCE} ${HEADER} ${PROJECT}.pc.in \
${PROJECT}-${VERSION}
$(QUIET)cp Makefile config.mk tests/*.c \
${PROJECT}-${VERSION}/tests
$(QUIET)tar -cf ${PROJECT}-${VERSION}.tar ${PROJECT}-${VERSION}
$(QUIET)gzip ${PROJECT}-${VERSION}.tar
$(QUIET)rm -rf ${PROJECT}-${VERSION}
doc: clean
doc:
$(QUIET)doxygen Doxyfile
gcov: clean
......@@ -103,10 +108,15 @@ install: all ${PROJECT}.pc
$(QUIET)cp -f zathura.h ${DESTDIR}${PREFIX}/include/${PROJECT}
$(ECHO) installing manual pages
$(QUIET)mkdir -p ${DESTDIR}${MANPREFIX}/man1
$(QUIET)sed "s/VERSION/${VERSION}/g" < ${PROJECT}.1 > ${DESTDIR}${MANPREFIX}/man1/${PROJECT}.1
$(QUIET)if which rst2man > /dev/null ; then \
mkdir -p ${DESTDIR}${MANPREFIX}/man1 ; \
sed "s/VERSION/${VERSION}/g" < ${PROJECT}.1.rst > ${PROJECT}-v.1.rst ; \
rst2man ${PROJECT}-v.1.rst > ${DESTDIR}${MANPREFIX}/man1/${PROJECT}.1 ; \
rm -f ${PROJECT}-v.1.rst ; \
mkdir -p ${DESTDIR}${MANPREFIX}/man5 ; \
rst2man ${PROJECT}rc.5.rst > ${DESTDIR}${MANPREFIX}/man5/${PROJECT}rc.5 ; \
sed "s/VERSION/${VERSION}/g" < ${PROJECT}rc.5.rst > ${PROJECT}rc-v.5.rst ; \
rst2man ${PROJECT}rc-v.5.rst > ${DESTDIR}${MANPREFIX}/man5/${PROJECT}rc.5 ; \
rm -f ${PROJECT}rc-v.5.rst ; \
fi
$(QUIET)mkdir -p ${DESTDIR}${DESKTOPPREFIX}
$(ECHO) installing desktop file
......@@ -131,4 +141,4 @@ uninstall:
-include $(wildcard .depend/*.dep)
.PHONY: all options clean doc debug valgrind gdb dist doc install uninstall tests
.PHONY: all options clean doc debug valgrind gdb dist doc install uninstall test
......@@ -32,8 +32,9 @@ zathura_bookmark_add(zathura_t* zathura, const gchar* id, unsigned int page)
bookmark->id = g_strdup(id);
bookmark->page = page;
girara_list_append(zathura->bookmarks.bookmarks, bookmark);
if (zathura->database) {
if (!zathura_db_add_bookmark(zathura->database, zathura->document->file_path, bookmark)) {
if (zathura->database != NULL) {
if (zathura_db_add_bookmark(zathura->database, zathura->document->file_path, bookmark) == false) {
girara_warning("Failed to add bookmark to database.");
}
}
......@@ -48,15 +49,16 @@ zathura_bookmark_remove(zathura_t* zathura, const gchar* id)
g_return_val_if_fail(id, false);
zathura_bookmark_t* bookmark = zathura_bookmark_get(zathura, id);
if (!bookmark) {
if (bookmark == NULL) {
return false;
}
if (zathura->database) {
if (!zathura_db_remove_bookmark(zathura->database, zathura->document->file_path, bookmark->id)) {
if (zathura->database != NULL) {
if (zathura_db_remove_bookmark(zathura->database, zathura->document->file_path, bookmark->id) == false) {
girara_warning("Failed to remove bookmark from database.");
}
}
girara_list_remove(zathura->bookmarks.bookmarks, bookmark);
return true;
......@@ -74,7 +76,7 @@ zathura_bookmark_get(zathura_t* zathura, const gchar* id)
void
zathura_bookmark_free(zathura_bookmark_t* bookmark)
{
if (!bookmark) {
if (bookmark == NULL) {
return;
}
......@@ -86,17 +88,19 @@ bool
zathura_bookmarks_load(zathura_t* zathura, const gchar* file) {
g_return_val_if_fail(zathura, false);
g_return_val_if_fail(file, false);
if (zathura->database == NULL) {
return false;
}
girara_list_t* bookmarks = zathura_db_load_bookmarks(zathura->database, file);
if (!bookmarks) {
if (bookmarks == NULL) {
return false;
}
girara_list_free(zathura->bookmarks.bookmarks);
zathura->bookmarks.bookmarks = bookmarks;
return true;
}
......@@ -106,9 +110,11 @@ zathura_bookmarks_compare(zathura_bookmark_t* lhs, zathura_bookmark_t* rhs)
if (lhs == NULL && rhs == NULL) {
return 0;
}
if (lhs == NULL) {
return -1;
}
if (rhs == NULL) {
return 1;
}
......
......@@ -97,18 +97,25 @@ cb_view_vadjustment_value_changed(GtkAdjustment* GIRARA_UNUSED(adjustment), gpoi
}
void
cb_pages_per_row_value_changed(girara_session_t* UNUSED(session), const char* UNUSED(name), girara_setting_type_t UNUSED(type), void* value, void* data)
cb_pages_per_row_value_changed(girara_session_t* session, const char* UNUSED(name), girara_setting_type_t UNUSED(type), void* value, void* UNUSED(data))
{
g_return_if_fail(value != NULL);
g_return_if_fail(session != NULL);
g_return_if_fail(session->global.data != NULL);
zathura_t* zathura = session->global.data;
int pages_per_row = *(int*) value;
zathura_t* zathura = data;
if (pages_per_row < 1) {
pages_per_row = 1;
}
page_widget_set_mode(zathura, pages_per_row);
if (zathura->document != NULL) {
unsigned int current_page = zathura->document->current_page_number;
page_set_delayed(zathura, current_page);
}
}
void
......@@ -214,11 +221,16 @@ cb_file_monitor(GFileMonitor* monitor, GFile* file, GFile* UNUSED(other_file), G
g_return_if_fail(file != NULL);
g_return_if_fail(session != NULL);
if (event != G_FILE_MONITOR_EVENT_CHANGES_DONE_HINT) {
return;
switch (event) {
case G_FILE_MONITOR_EVENT_CHANGES_DONE_HINT:
case G_FILE_MONITOR_EVENT_CREATED:
gdk_threads_enter();
sc_reload(session, NULL, NULL, 0);
gdk_threads_leave();
break;
default:
return;
}
sc_reload(session, NULL, NULL, 0);
}
static gboolean
......@@ -256,13 +268,13 @@ cb_password_dialog(GtkEntry* entry, zathura_password_dialog_info_t* dialog)
g_free(input);
}
g_idle_add(password_dialog, dialog);
gdk_threads_add_idle(password_dialog, dialog);
return false;
}
/* try to open document again */
if (document_open(dialog->zathura, dialog->path, input) == false) {
g_idle_add(password_dialog, dialog);
gdk_threads_add_idle(password_dialog, dialog);
} else {
g_free(dialog->path);
free(dialog);
......@@ -283,14 +295,22 @@ error_ret:
}
bool
cb_view_resized(GtkWidget* UNUSED(widget), GtkAllocation* UNUSED(allocation), zathura_t* zathura)
cb_view_resized(GtkWidget* UNUSED(widget), GtkAllocation* allocation, zathura_t* zathura)
{
if (zathura == NULL || zathura->document == NULL) {
return false;
}
girara_argument_t argument = { zathura->document->adjust_mode, NULL };
sc_adjust_window(zathura->ui.session, &argument, NULL, 0);
static int height = -1;
static int width = -1;
return true;
/* adjust only if the allocation changed */
if (width != allocation->width || height != allocation->height) {
girara_argument_t argument = { zathura->document->adjust_mode, NULL };
sc_adjust_window(zathura->ui.session, &argument, NULL, 0);
width = allocation->width;
height = allocation->height;
}
return false;
}
......@@ -116,7 +116,7 @@ cmd_close(girara_session_t* session, girara_list_t* UNUSED(argument_list))
return true;
}
document_close(zathura);
document_close(zathura, false);
return true;
}
......@@ -157,11 +157,6 @@ cmd_info(girara_session_t* session, girara_list_t* UNUSED(argument_list))
char* tmp = zathura_document_meta_get(zathura->document, meta_fields[i].field, NULL);
if (tmp != NULL) {
char* text = g_strdup_printf("<b>%s:</b> %s\n", meta_fields[i].name, tmp);
if (text == NULL) {
g_free(tmp);
return true;
}
g_string_append(string, text);
g_free(text);
......@@ -198,8 +193,8 @@ cmd_open(girara_session_t* session, girara_list_t* argument_list)
girara_notify(session, GIRARA_ERROR, "Too many arguments.");
return false;
} else if (argc >= 1) {
if (zathura->document) {
document_close(zathura);
if (zathura->document != NULL) {
document_close(zathura, false);
}
document_open(zathura, girara_list_nth(argument_list, 0), (argc == 2) ? girara_list_nth(argument_list, 1) : NULL);
......@@ -286,6 +281,8 @@ cmd_search(girara_session_t* session, const char* input, girara_argument_t* argu
}
bool firsthit = true;
zathura_plugin_error_t error = ZATHURA_PLUGIN_ERROR_OK;
for (unsigned int page_id = 0; page_id < zathura->document->number_of_pages; ++page_id) {
zathura_page_t* page = zathura->document->pages[(page_id + zathura->document->current_page_number) % zathura->document->number_of_pages];
if (page == NULL) {
......@@ -294,11 +291,16 @@ cmd_search(girara_session_t* session, const char* input, girara_argument_t* argu
g_object_set(page->drawing_area, "draw-links", FALSE, NULL);
girara_list_t* result = zathura_page_search_text(page, input, 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);
continue;
if (error == ZATHURA_PLUGIN_ERROR_NOT_IMPLEMENTED) {
break;
} else {
continue;
}
}
g_object_set(page->drawing_area, "search-results", result, NULL);
......@@ -332,14 +334,20 @@ cmd_export(girara_session_t* session, girara_list_t* argument_list)
}
const char* attachment_name = girara_list_nth(argument_list, 0);
const char* file_name = girara_list_nth(argument_list, 1);
const char* file_name = girara_list_nth(argument_list, 1);
if (file_name == NULL || attachment_name == NULL) {
return false;
}
char* file_name2 = girara_fix_path(file_name);
if (!zathura_document_attachment_save(zathura->document, attachment_name, file_name)) {
if (zathura_document_attachment_save(zathura->document, attachment_name, file_name) == false) {
girara_notify(session, GIRARA_ERROR, "Couldn't write attachment '%s' to '%s'.", attachment_name, file_name);
} else {
girara_notify(session, GIRARA_INFO, "Wrote attachment '%s' to '%s'.", attachment_name, file_name2);
}
g_free(file_name2);
return true;
}
......@@ -11,6 +11,7 @@
#include "utils.h"
#include <girara/session.h>
#include <girara/settings.h>
#include <girara/completion.h>
#include <girara/utils.h>
#include <girara/datastructures.h>
......@@ -29,6 +30,10 @@ compare_case_insensitive(const char* str1, const char* str2)
static girara_list_t*
list_files(zathura_t* zathura, const char* current_path, const char* current_file, int current_file_length, bool is_dir)
{
if (zathura == NULL || zathura->ui.session == NULL || current_path == NULL) {
return NULL;
}
/* read directory */
GDir* dir = g_dir_open(current_path, 0, NULL);
if (dir == NULL) {
......@@ -38,6 +43,9 @@ list_files(zathura_t* zathura, const char* current_path, const char* current_fil
girara_list_t* res = girara_sorted_list_new2((girara_compare_function_t)compare_case_insensitive,
(girara_free_function_t)g_free);
bool show_hidden = false;
girara_setting_get(zathura->ui.session, "show-hidden", &show_hidden);
/* read files */
char* name = NULL;
while ((name = (char*) g_dir_read_name(dir)) != NULL) {
......@@ -45,20 +53,26 @@ list_files(zathura_t* zathura, const char* current_path, const char* current_fil
if (e_name == NULL) {
goto error_free;
}
int e_length = strlen(e_name);
if ((current_file_length > e_length) || strncmp(current_file, e_name,
current_file_length)) {
int e_length = strlen(e_name);
if (show_hidden == false && e_name[0] == '.') {
g_free(e_name);
continue;
}
char* full_path = g_strdup_printf("%s%s%s", current_path, is_dir ? "" : "/", e_name);
if (full_path == NULL) {
if ((current_file_length > e_length) || strncmp(current_file, e_name, current_file_length)) {
g_free(e_name);
goto error_free;
continue;
}
char* tmp = "/";
if (is_dir == true || g_strcmp0(current_path, "/") == 0) {
tmp = "";
};
char* full_path = g_strdup_printf("%s%s%s", current_path, tmp, e_name);
if (g_file_test(full_path, G_FILE_TEST_IS_DIR) == true) {
char* tmp_path = full_path;
full_path = g_strdup_printf("%s/", full_path);
......@@ -120,9 +134,6 @@ cc_open(girara_session_t* session, const char* input)
}
char* tmp_path = g_strdup_printf("%s/%s", cwd, path);
if (tmp_path == NULL) {
goto error_free;
}
g_free(path);
path = tmp_path;
......@@ -132,10 +143,6 @@ cc_open(girara_session_t* session, const char* input)
bool is_dir = (path[strlen(path) - 1] == '/') ? true : false;
if ((g_file_test(path, G_FILE_TEST_IS_DIR) == TRUE) && !is_dir) {
char* tmp_path = g_strdup_printf("%s/", path);
if (tmp_path == NULL) {
goto error_free;
}
g_free(path);
path = tmp_path;
is_dir = true;
......
This diff is collapsed.
......@@ -3,6 +3,9 @@
VERSION = 0.0.8.1
# the GTK version to use
ZATHURA_GTK_VERSION ?= 2
# paths
PREFIX ?= /usr
MANPREFIX ?= ${PREFIX}/share/man
......@@ -13,11 +16,11 @@ PLUGINDIR ?= ${PREFIX}/lib/zathura
# libs
# set this to 0 if you don't need to link against dl
GTK_INC ?= $(shell pkg-config --cflags gtk+-2.0)
GTK_LIB ?= $(shell pkg-config --libs gtk+-2.0 gthread-2.0)
GTK_INC ?= $(shell pkg-config --cflags gtk+-${ZATHURA_GTK_VERSION}.0)
GTK_LIB ?= $(shell pkg-config --libs gtk+-${ZATHURA_GTK_VERSION}.0 gthread-2.0)
GIRARA_INC ?= $(shell pkg-config --cflags girara-gtk2)
GIRARA_LIB ?= $(shell pkg-config --libs girara-gtk2)
GIRARA_INC ?= $(shell pkg-config --cflags girara-gtk${ZATHURA_GTK_VERSION})
GIRARA_LIB ?= $(shell pkg-config --libs girara-gtk${ZATHURA_GTK_VERSION})
SQLITE_INC ?= $(shell pkg-config --cflags sqlite3)
SQLITE_LIB ?= $(shell pkg-config --libs sqlite3)
......
......@@ -234,9 +234,6 @@ zathura_db_set_fileinfo(zathura_database_t* db, const char* file, unsigned int
}
char* tmp = g_strdup_printf("%f", scale);
if (tmp == NULL) {
return false;
}
g_key_file_set_integer(db->history, file, KEY_PAGE, page);
g_key_file_set_integer(db->history, file, KEY_OFFSET, offset);
......
......@@ -216,8 +216,6 @@ zathura_document_open(zathura_t* zathura, const char* path, const char* password
return NULL;
}
char* file_uri = NULL;
/* determine real path */
long path_max;
#ifdef PATH_MAX
......@@ -328,39 +326,24 @@ zathura_document_open(zathura_t* zathura, const char* path, const char* password
document->pages[page_id] = page;
}
/* install file monitor */
file_uri = g_filename_to_uri(real_path, NULL, NULL);
if (file_uri == NULL) {
goto error_free;
}
document->file_monitor.file = g_file_new_for_uri(file_uri);
if (document->file_monitor.file == NULL) {
goto error_free;
}
document->file_monitor.monitor = g_file_monitor_file(document->file_monitor.file, G_FILE_MONITOR_NONE, NULL, NULL);
if (document->file_monitor.monitor == NULL) {
goto error_free;
}
g_signal_connect(G_OBJECT(document->file_monitor.monitor), "changed", G_CALLBACK(cb_file_monitor), zathura->ui.session);
/* apply open adjustment */
int adjust_open = ADJUST_BESTFIT;
girara_setting_get(zathura->ui.session, "adjust-open", &adjust_open);
g_free(file_uri);
char* adjust_open = "best-fit";
document->adjust_mode = ADJUST_BESTFIT;
if (girara_setting_get(zathura->ui.session, "adjust-open", &(adjust_open)) == true) {
if (g_strcmp0(adjust_open, "best-fit") == 0) {
document->adjust_mode = ADJUST_BESTFIT;
} else if (g_strcmp0(adjust_open, "width") == 0) {
document->adjust_mode = ADJUST_WIDTH;
} else {
document->adjust_mode = ADJUST_NONE;
}
g_free(adjust_open);
}
return document;
error_free:
if (file_uri != NULL) {
g_free(file_uri);
}
free(real_path);
if (document != NULL && document->pages != NULL) {
......@@ -378,7 +361,7 @@ error_free:
zathura_plugin_error_t
zathura_document_free(zathura_document_t* document)
{
if (document == NULL) {
if (document == NULL || document->zathura == NULL || document->zathura->ui.session == NULL) {
return false;
}
......@@ -393,6 +376,7 @@ zathura_document_free(zathura_document_t* document)
/* free document */
bool r = true;
if (document->functions.document_free == NULL) {
girara_notify(document->zathura->ui.session, GIRARA_WARNING, "%s not implemented", __FUNCTION__);
girara_error("%s not implemented", __FUNCTION__);
} else {
r = document->functions.document_free(document);
......@@ -410,11 +394,12 @@ zathura_document_free(zathura_document_t* document)
zathura_plugin_error_t
zathura_document_save_as(zathura_document_t* document, const char* path)
{
if (document == NULL || path == NULL) {
if (document == NULL || path == NULL || document->zathura == NULL || document->zathura->ui.session == NULL) {
return false;
}
if (document->functions.document_save_as == NULL) {
girara_notify(document->zathura->ui.session, GIRARA_WARNING, "%s not implemented", __FUNCTION__);
girara_error("%s not implemented", __FUNCTION__);
return false;
}
......@@ -425,11 +410,12 @@ zathura_document_save_as(zathura_document_t* document, const char* path)
girara_tree_node_t*
zathura_document_index_generate(zathura_document_t* document, zathura_plugin_error_t* error)
{
if (document == NULL) {
if (document == NULL || document->zathura == NULL || document->zathura->ui.session == NULL) {
return NULL;
}
if (document->functions.document_index_generate == NULL) {
girara_notify(document->zathura->ui.session, GIRARA_WARNING, "%s not implemented", __FUNCTION__);
girara_error("%s not implemented", __FUNCTION__);
return NULL;
}
......@@ -440,11 +426,12 @@ zathura_document_index_generate(zathura_document_t* document, zathura_plugin_err
girara_list_t*
zathura_document_attachments_get(zathura_document_t* document, zathura_plugin_error_t* error)
{
if (document == NULL) {
if (document == NULL || document->zathura == NULL || document->zathura->ui.session == NULL) {
return NULL;
}
if (document->functions.document_attachments_get == NULL) {
girara_notify(document->zathura->ui.session, GIRARA_WARNING, "%s not implemented", __FUNCTION__);
girara_error("%s not implemented", __FUNCTION__);
return NULL;
}
......@@ -455,11 +442,13 @@ zathura_document_attachments_get(zathura_document_t* document, zathura_plugin_er
zathura_plugin_error_t
zathura_document_attachment_save(zathura_document_t* document, const char* attachment, const char* file)
{
if (document == NULL) {
if (document == NULL || document->zathura == NULL || document->zathura->ui.session == NULL) {
return ZATHURA_PLUGIN_ERROR_INVALID_ARGUMENTS;
}
if (document->functions.document_attachment_save == NULL) {
girara_notify(document->zathura->ui.session, GIRARA_WARNING, "%s not implemented", __FUNCTION__);
girara_error("%s not implemented", __FUNCTION__);
return ZATHURA_PLUGIN_ERROR_NOT_IMPLEMENTED;
}
......@@ -469,9 +458,9 @@ zathura_document_attachment_save(zathura_document_t* document, const char* attac
char*
zathura_document_meta_get(zathura_document_t* document, zathura_document_meta_t meta, zathura_plugin_error_t* error)
{
if (document == NULL) {
if (document == NULL || document->zathura == NULL || document->zathura->ui.session == NULL) {
if (error != NULL) {
*error = ZATHURA_PLUGIN_ERROR_NOT_IMPLEMENTED;
*error = ZATHURA_PLUGIN_ERROR_INVALID_ARGUMENTS;
}
return NULL;
}
......@@ -480,6 +469,8 @@ zathura_document_meta_get(zathura_document_t* document, zathura_document_meta_t
if (error != NULL) {
*error = ZATHURA_PLUGIN_ERROR_NOT_IMPLEMENTED;
}
girara_notify(document->zathura->ui.session, GIRARA_WARNING, "%s not implemented", __FUNCTION__);
girara_error("%s not implemented", __FUNCTION__);
return NULL;
}
......@@ -489,12 +480,19 @@ zathura_document_meta_get(zathura_document_t* document, zathura_document_meta_t
zathura_page_t*
zathura_page_get(zathura_document_t* document, unsigned int page_id, zathura_plugin_error_t* error)
{
if (document == NULL) {
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;
}
......@@ -504,6 +502,12 @@ zathura_page_get(zathura_document_t* document, unsigned int page_id, zathura_plu
page->number = page_id;