Commit e5f36e40 authored by Moritz Lipp's avatar Moritz Lipp

Merge branch 'release/0.2.4'

parents b17c05c9 3978dc30
......@@ -22,9 +22,7 @@ And also note that rst2man from python-docutils is needed to build the man pages
If it is not installed, the man pages won't be built.
If you don't want to build with support for sqlite databases, you can set
WITH_SQLITE=0 and sqlite support won't be available. Please note that sqlite3
with meta data support is required, i.e. sqlite3 has to be built with
SQLITE_ENABLE_COLUMN_METADATA defined.
WITH_SQLITE=0 and sqlite support won't be available.
The use of magic to detect mime types is optional and can be disabled by setting
WITH_MAGIC=0.
......
......@@ -4,9 +4,11 @@
#include "bookmarks.h"
#include "database.h"
#include "document.h"
#include "adjustment.h"
#include <girara/datastructures.h>
#include <girara/utils.h>
#include <girara/session.h>
static int
bookmark_compare_find(const void* item, const void* data)
......@@ -23,14 +25,35 @@ zathura_bookmark_add(zathura_t* zathura, const gchar* id, unsigned int page)
g_return_val_if_fail(zathura && zathura->document && zathura->bookmarks.bookmarks, NULL);
g_return_val_if_fail(id, NULL);
zathura_bookmark_t* old = girara_list_find(zathura->bookmarks.bookmarks, bookmark_compare_find, id);
double x = zathura_adjustment_get_ratio(gtk_scrolled_window_get_hadjustment(GTK_SCROLLED_WINDOW(zathura->ui.session->gtk.view)));
double y = zathura_adjustment_get_ratio(gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(zathura->ui.session->gtk.view)));
zathura_bookmark_t* old = zathura_bookmark_get(zathura, id);
if (old != NULL) {
return NULL;
old->page = page;
old->x = x;
old->y = y;
if (zathura->database != NULL) {
const char* path = zathura_document_get_path(zathura->document);
if (zathura_db_remove_bookmark(zathura->database, path, old->id) == false) {
girara_warning("Failed to remove old bookmark from database.");
}
if (zathura_db_add_bookmark(zathura->database, path, old) == false) {
girara_warning("Failed to add new bookmark to database.");
}
}
return old;
}
zathura_bookmark_t* bookmark = g_malloc0(sizeof(zathura_bookmark_t));
bookmark->id = g_strdup(id);
bookmark->page = page;
bookmark->x = x;
bookmark->y = y;
girara_list_append(zathura->bookmarks.bookmarks, bookmark);
if (zathura->database != NULL) {
......
......@@ -10,6 +10,8 @@ struct zathura_bookmark_s
{
gchar* id;
unsigned int page;
double x;
double y;
};
typedef struct zathura_bookmark_s zathura_bookmark_t;
......
......@@ -95,9 +95,9 @@ cb_view_vadjustment_value_changed(GtkAdjustment* GIRARA_UNUSED(adjustment), gpoi
if (gdk_rectangle_intersect(&view_rect, &page_rect, NULL) == TRUE) {
if (zathura_page_get_visibility(page) == false) {
zathura_page_set_visibility(page, true);
zathura_page_widget_update_view_time(ZATHURA_PAGE(page_widget));
zathura_page_cache_add(zathura, zathura_page_get_index(page));
zathura_page_set_visibility(page, true);
zathura_page_widget_update_view_time(ZATHURA_PAGE(page_widget));
zathura_page_cache_add(zathura, zathura_page_get_index(page));
}
if (zathura->global.update_page_number == true && updated == false
&& gdk_rectangle_intersect(&center, &page_rect, NULL) == TRUE) {
......@@ -106,6 +106,19 @@ cb_view_vadjustment_value_changed(GtkAdjustment* GIRARA_UNUSED(adjustment), gpoi
}
} else {
zathura_page_set_visibility(page, false);
/* if the page is not visible and not cached, but still has a surface, we
* need to get rid of the surface */
if (zathura_page_widget_have_surface(ZATHURA_PAGE(page_widget)) == true &&
zathura_page_cache_is_cached(zathura, zathura_page_get_index(page)) == false) {
zathura_page_widget_update_surface(ZATHURA_PAGE(page_widget), NULL);
}
girara_list_t* results = NULL;
g_object_get(page_widget, "search-results", &results, NULL);
if (results != NULL) {
g_object_set(page_widget, "search-current", 0, NULL);
}
}
}
......@@ -267,10 +280,7 @@ cb_index_row_activated(GtkTreeView* tree_view, GtkTreePath* path,
}
sc_toggle_index(zathura->ui.session, NULL, NULL, 0);
/* zathura_jumplist_save is called when entering index mode */
zathura_link_evaluate(zathura, index_element->link);
zathura_jumplist_add(zathura);
}
g_object_unref(model);
......@@ -326,9 +336,7 @@ handle_link(GtkEntry* entry, girara_session_t* session,
invalid_index = false;
switch (action) {
case ZATHURA_LINK_ACTION_FOLLOW:
zathura_jumplist_save(zathura);
zathura_link_evaluate(zathura, link);
zathura_jumplist_add(zathura);
break;
case ZATHURA_LINK_ACTION_DISPLAY:
zathura_link_display(zathura, link);
......@@ -527,7 +535,7 @@ cb_unknown_command(girara_session_t* session, const char* input)
}
}
zathura_jumplist_save(zathura);
zathura_jumplist_add(zathura);
page_set(zathura, atoi(input) - 1);
zathura_jumplist_add(zathura);
......
......@@ -18,6 +18,7 @@
#include "plugin.h"
#include "internal.h"
#include "render.h"
#include "adjustment.h"
#include <girara/session.h>
#include <girara/settings.h>
......@@ -44,19 +45,24 @@ cmd_bookmark_create(girara_session_t* session, girara_list_t* argument_list)
const char* bookmark_name = girara_list_nth(argument_list, 0);
zathura_bookmark_t* bookmark = zathura_bookmark_get(zathura, bookmark_name);
if (bookmark != NULL) {
bookmark->page = zathura_document_get_current_page_number(zathura->document) + 1;
girara_notify(session, GIRARA_INFO, _("Bookmark successfuly updated: %s"), bookmark_name);
return true;
}
bool update = bookmark != NULL ? true : false;
bookmark = zathura_bookmark_add(zathura, bookmark_name, zathura_document_get_current_page_number(zathura->document) + 1);
if (bookmark == NULL) {
girara_notify(session, GIRARA_ERROR, _("Could not create bookmark: %s"), bookmark_name);
if (update == true) {
girara_notify(session, GIRARA_ERROR, _("Could not update bookmark: %s"), bookmark_name);
} else {
girara_notify(session, GIRARA_ERROR, _("Could not create bookmark: %s"), bookmark_name);
}
return false;
} else {
if (update == true) {
girara_notify(session, GIRARA_INFO, _("Bookmark successfully updated: %s"), bookmark_name);
} else {
girara_notify(session, GIRARA_INFO, _("Bookmark successfully created: %s"), bookmark_name);
}
}
girara_notify(session, GIRARA_INFO, _("Bookmark successfuly created: %s"), bookmark_name);
return true;
}
......@@ -111,7 +117,20 @@ cmd_bookmark_open(girara_session_t* session, girara_list_t* argument_list)
return false;
}
return page_set(zathura, bookmark->page - 1);
zathura_jumplist_add(zathura);
if (bookmark->x != DBL_MIN && bookmark->y != DBL_MIN) {
GtkAdjustment* hadjustment = gtk_scrolled_window_get_hadjustment(GTK_SCROLLED_WINDOW(zathura->ui.session->gtk.view));
GtkAdjustment* vadjustment = gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(zathura->ui.session->gtk.view));
zathura_adjustment_set_value_from_ratio(hadjustment, bookmark->x);
zathura_adjustment_set_value_from_ratio(vadjustment, bookmark->y);
zathura_document_set_current_page_number(zathura->document, bookmark->page - 1);
statusbar_page_number_update(zathura);
} else {
page_set(zathura, bookmark->page - 1);
}
zathura_jumplist_add(zathura);
return true;
}
bool
......@@ -339,7 +358,6 @@ cmd_search(girara_session_t* session, const char* input, girara_argument_t* argu
return false;
}
bool firsthit = true;
zathura_error_t error = ZATHURA_ERROR_OK;
/* set search direction */
......@@ -352,10 +370,6 @@ cmd_search(girara_session_t* session, const char* input, girara_argument_t* argu
bool nohlsearch = false;
girara_setting_get(session, "nohlsearch", &nohlsearch);
if (nohlsearch == false) {
document_draw_search_results(zathura, true);
}
/* search pages */
for (unsigned int page_id = 0; page_id < number_of_pages; ++page_id) {
unsigned int index = (page_id + current_page_number) % number_of_pages;
......@@ -383,20 +397,21 @@ cmd_search(girara_session_t* session, const char* input, girara_argument_t* argu
}
g_object_set(page_widget, "search-results", result, NULL);
if (firsthit == true) {
if (page_id != 0) {
page_set_delayed(zathura, zathura_page_get_index(page));
}
if (argument->n == BACKWARD) {
/* start at bottom hit in page */
g_object_set(page_widget, "search-current", girara_list_size(result) - 1, NULL);
} else {
g_object_set(page_widget, "search-current", 0, NULL);
}
firsthit = false;
if (argument->n == BACKWARD) {
/* start at bottom hit in page */
g_object_set(page_widget, "search-current", girara_list_size(result) - 1, NULL);
} else {
g_object_set(page_widget, "search-current", 0, NULL);
}
}
girara_argument_t* arg = g_malloc0(sizeof(girara_argument_t));
arg->n = FORWARD;
sc_search(session, arg, NULL, 0);
g_free(arg);
return true;
}
......
......@@ -27,10 +27,18 @@ cb_jumplist_change(girara_session_t* session, const char* name,
g_return_if_fail(session->global.data != NULL);
g_return_if_fail(name != NULL);
zathura_t* zathura = session->global.data;
if (g_strcmp0(name, "jumplist-size") == 0) {
int* max_size = (int*) value;
zathura->jumplist.max_size = *max_size;
if (g_strcmp0(name, "jumplist-size") != 0) {
return;
}
if (*(int *)value < 0) {
zathura->jumplist.max_size = 0;
} else {
zathura->jumplist.max_size = *(int *)value;
}
zathura_jumplist_trim(zathura);
}
static void
......@@ -157,7 +165,7 @@ config_load_default(zathura_t* zathura)
girara_setting_add(gsession, "zoom-max", &int_value, INT, false, _("Zoom maximum"), NULL, NULL);
int_value = ZATHURA_PAGE_CACHE_DEFAULT_SIZE;
girara_setting_add(gsession, "page-cache-size", &int_value, INT, true, _("Maximum number of pages to keep in the cache"), NULL, NULL);
int_value = 20;
int_value = 2000;
girara_setting_add(gsession, "jumplist-size", &int_value, INT, false, _("Number of positions to remember in the jumplist"), cb_jumplist_change, NULL);
girara_setting_add(gsession, "recolor-darkcolor", NULL, STRING, false, _("Recoloring (dark color)"), cb_color_change, NULL);
......@@ -209,6 +217,8 @@ config_load_default(zathura_t* zathura)
bool_value = false;
girara_setting_add(gsession, "window-title-basename", &bool_value, BOOLEAN, false, _("Use basename of the file in the window title"), NULL, NULL);
bool_value = false;
girara_setting_add(gsession, "window-title-page", &bool_value, BOOLEAN, false, _("Display the page number in the window title"), NULL, NULL);
bool_value = false;
girara_setting_add(gsession, "statusbar-basename", &bool_value, BOOLEAN, false, _("Use basename of the file in the statusbar"), NULL, NULL);
bool_value = false;
girara_setting_add(gsession, "synctex", &bool_value, BOOLEAN, false, _("Enable synctex support"), NULL, NULL);
......
......@@ -3,7 +3,7 @@
ZATHURA_VERSION_MAJOR = 0
ZATHURA_VERSION_MINOR = 2
ZATHURA_VERSION_REV = 3
ZATHURA_VERSION_REV = 4
# If the API changes, the API version and the ABI version have to be bumped.
ZATHURA_API_VERSION = 2
# If the ABI breaks for any reason, this has to be bumped.
......
This diff is collapsed.
This diff is collapsed.
......@@ -35,6 +35,22 @@ zathura_db_load_bookmarks(zathura_database_t* db, const char* file)
return ZATHURA_DATABASE_GET_INTERFACE(db)->load_bookmarks(db, file);
}
girara_list_t*
zathura_db_load_jumplist(zathura_database_t* db, const char* file)
{
g_return_val_if_fail(ZATHURA_IS_DATABASE(db) && file != NULL, NULL);
return ZATHURA_DATABASE_GET_INTERFACE(db)->load_jumplist(db, file);
}
bool
zathura_db_save_jumplist(zathura_database_t* db, const char* file, girara_list_t* jumplist)
{
g_return_val_if_fail(ZATHURA_IS_DATABASE(db) && file != NULL && jumplist != NULL, NULL);
return ZATHURA_DATABASE_GET_INTERFACE(db)->save_jumplist(db, file, jumplist);
}
bool
zathura_db_set_fileinfo(zathura_database_t* db, const char* file,
zathura_fileinfo_t* file_info)
......
......@@ -43,6 +43,10 @@ struct _ZathuraDatabaseInterface
girara_list_t* (*load_bookmarks)(ZathuraDatabase* db, const char* file);
girara_list_t* (*load_jumplist)(ZathuraDatabase* db, const char* file);
bool (*save_jumplist)(ZathuraDatabase* db, const char* file, girara_list_t* jumplist);
bool (*set_fileinfo)(ZathuraDatabase* db, const char* file, zathura_fileinfo_t* file_info);
bool (*get_fileinfo)(ZathuraDatabase* db, const char* file, zathura_fileinfo_t* file_info);
......@@ -54,7 +58,7 @@ GType zathura_database_get_type(void);
* Add or update bookmark in the database.
*
* @param db The database instance
* @param file The file to which the bookmark belongs to.
* @param file The file to which the bookmark belongs.
* @param bookmark The bookmark instance.
* @return true on success, false otherwise
*/
......@@ -62,10 +66,10 @@ bool zathura_db_add_bookmark(zathura_database_t* db, const char* file,
zathura_bookmark_t* bookmark);
/**
* Add or update bookmark in the database.
* Remove a bookmark from the database.
*
* @param db The database instance
* @param file The file to which the bookmark belongs to.
* @param file The file to which the bookmark belongs.
* @param id The id of the bookmark
* @return true on success, false otherwise
*/
......@@ -82,11 +86,32 @@ bool zathura_db_remove_bookmark(zathura_database_t* db, const char* file, const
girara_list_t* zathura_db_load_bookmarks(zathura_database_t* db, const char*
file);
/**
* Load the jumplist belonging to the specified file from the database.
*
* @param db The database instance.
* @param file The file to which the jumplist belongs.
*
* return A linked list constituting the jumplist of the specified file.
*/
girara_list_t* zathura_db_load_jumplist(ZathuraDatabase* db, const char* file);
/**
* Save the jumplist belonging to the specified file to the database.
*
* @param db The database instance.
* @param file The file to which the jumplist belongs.
* @param jumplist The jumplist to be saved
*
* return true on success, false otherwise.
*/
bool zathura_db_save_jumplist(ZathuraDatabase* db, const char* file, girara_list_t* jumplist);
/**
* Set file info (last site, ...) in the database.
*
* @param db The database instance
* @param file The file to which the file info belongs to.
* @param file The file to which the file info belongs.
* @param file_info The file info
* @return true on success, false otherwise.
*/
......@@ -96,7 +121,7 @@ bool zathura_db_set_fileinfo(zathura_database_t* db, const char* file,
/* Get file info (last site, ...) from the database.
*
* @param db The database instance
* @param file The file to which the file info belongs to.
* @param file The file to which the file info belongs.
* @param file_info The file info
* @return true on success, false otherwise.
*/
......
......@@ -14,6 +14,7 @@
#ifdef WITH_MAGIC
#include <magic.h>
#endif
#include <unistd.h>
#include <girara/datastructures.h>
#include <girara/utils.h>
......@@ -40,6 +41,7 @@ static const gchar* guess_type(const char* path);
*/
struct zathura_document_s {
char* file_path; /**< File path of the document */
char* basename; /**< Basename of the document */
const char* password; /**< Password of the document */
unsigned int current_page_number; /**< Current page number */
unsigned int number_of_pages; /**< Number of pages */
......@@ -110,12 +112,14 @@ zathura_document_open(zathura_plugin_manager_t* plugin_manager, const char*
if (plugin == NULL) {
girara_error("unknown file type\n");
*error = ZATHURA_ERROR_UNKNOWN;
goto error_free;
}
document = g_malloc0(sizeof(zathura_document_t));
document->file_path = real_path;
document->basename = g_path_get_basename(real_path);
document->password = password;
document->scale = 1.0;
document->plugin = plugin;
......@@ -198,6 +202,7 @@ zathura_document_free(zathura_document_t* document)
if (document->file_path != NULL) {
free(document->file_path);
}
g_free(document->basename);
g_free(document);
......@@ -214,6 +219,16 @@ zathura_document_get_path(zathura_document_t* document)
return document->file_path;
}
const char*
zathura_document_get_basename(zathura_document_t* document)
{
if (document == NULL) {
return NULL;
}
return document->basename;
}
const char*
zathura_document_get_password(zathura_document_t* document)
{
......
......@@ -38,6 +38,14 @@ zathura_error_t zathura_document_free(zathura_document_t* document);
*/
const char* zathura_document_get_path(zathura_document_t* document);
/**
* Returns the basename of the document
*
* @param document The document
* @return The basename of the document
*/
const char* zathura_document_get_basename(zathura_document_t* document);
/**
* Returns the password of the document
*
......
......@@ -108,7 +108,7 @@ zathura_link_target_t
zathura_link_get_target(zathura_link_t* link)
{
if (link == NULL) {
zathura_link_target_t target = { 0 };
zathura_link_target_t target = { 0, NULL, 0, 0, 0, 0, 0, 0 };
return target;
}
......@@ -149,6 +149,8 @@ zathura_link_evaluate(zathura_t* zathura, zathura_link_t* link)
}
}
zathura_jumplist_add(zathura);
/* jump to the page */
page_set(zathura, link->target.page_number);
......@@ -157,10 +159,12 @@ zathura_link_evaluate(zathura_t* zathura, zathura_link_t* link)
girara_setting_get(zathura->ui.session, "link-hadjust", &link_hadjust);
if (link_hadjust == true) {
position_set_delayed(zathura, offset.x, offset.y);
position_set(zathura, offset.x, offset.y);
} else {
position_set_delayed(zathura, -1, offset.y);
position_set(zathura, -1, offset.y);
}
zathura_jumplist_add(zathura);
}
break;
case ZATHURA_LINK_GOTO_REMOTE:
......
......@@ -6,6 +6,7 @@
#include <glib/gi18n.h>
#include <girara/utils.h>
#include <locale.h>
#include <unistd.h>
#include "zathura.h"
#include "utils.h"
......
......@@ -238,7 +238,9 @@ mark_evaluate(zathura_t* zathura, int key)
zathura_document_set_scale(zathura->document, mark->scale);
render_all(zathura);
position_set_delayed(zathura, mark->position_x, mark->position_y);
zathura_jumplist_add(zathura);
position_set(zathura, mark->position_x, mark->position_y);
zathura_jumplist_add(zathura);
cb_view_vadjustment_value_changed(NULL, zathura);
......
......@@ -86,7 +86,7 @@ enum properties_e {
PROP_SEARCH_RESULTS,
PROP_SEARCH_RESULTS_LENGTH,
PROP_SEARCH_RESULTS_CURRENT,
PROP_DRAW_SEACH_RESULTS,
PROP_DRAW_SEARCH_RESULTS,
PROP_LAST_VIEW,
};
......@@ -131,8 +131,8 @@ zathura_page_widget_class_init(ZathuraPageClass* class)
g_param_spec_int("search-current", "search-current", "The current search result", -1, INT_MAX, 0, G_PARAM_WRITABLE | G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property(object_class, PROP_SEARCH_RESULTS_LENGTH,
g_param_spec_int("search-length", "search-length", "The number of search results", -1, INT_MAX, 0, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property(object_class, PROP_DRAW_SEACH_RESULTS,
g_param_spec_boolean("draw-search-results", "draw-search-results", "Set to true if search results should be drawn", FALSE, G_PARAM_WRITABLE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property(object_class, PROP_DRAW_SEARCH_RESULTS,
g_param_spec_boolean("draw-search-results", "draw-search-results", "Set to true if search results should be drawn", FALSE, G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property(object_class, PROP_LAST_VIEW,
g_param_spec_int64("last-view", "last-view", "Last time the page has been viewed", -1, G_MAXINT64, 0, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
}
......@@ -154,7 +154,7 @@ zathura_page_widget_init(ZathuraPage* widget)
priv->search.list = NULL;
priv->search.current = INT_MAX;
priv->search.draw = true;
priv->search.draw = false;
priv->images.list = NULL;
priv->images.retrieved = false;
......@@ -269,8 +269,19 @@ zathura_page_widget_set_property(GObject* object, guint prop_id, const GValue* v
}
break;
}
case PROP_DRAW_SEACH_RESULTS:
case PROP_DRAW_SEARCH_RESULTS:
priv->search.draw = g_value_get_boolean(value);
/*
* we do the following instead of only redrawing the rectangles of the
* search results in order to avoid the rectangular margins that appear
* around the search terms after their highlighted rectangular areas are
* redrawn without highlighting.
*/
if (priv->search.list != NULL && zathura_page_get_visibility(priv->page)) {
gtk_widget_queue_draw(GTK_WIDGET(object));
}
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
......@@ -299,6 +310,9 @@ zathura_page_widget_get_property(GObject* object, guint prop_id, GValue* value,
case PROP_LAST_VIEW:
g_value_set_int64(value, priv->last_view);
break;
case PROP_DRAW_SEARCH_RESULTS:
g_value_set_boolean(value, priv->search.draw);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
}
......@@ -491,11 +505,18 @@ zathura_page_widget_update_surface(ZathuraPage* widget, cairo_surface_t* surface
zathura_page_widget_private_t* priv = ZATHURA_PAGE_GET_PRIVATE(widget);
mutex_lock(&(priv->lock));
if (priv->surface != NULL) {
cairo_surface_finish(priv->surface);
cairo_surface_destroy(priv->surface);
priv->surface = NULL;
}
priv->render_requested = false;
priv->surface = surface;
if (surface != NULL) {
/* if we're not visible or not cached, we don't care about the surface */
if (zathura_page_get_visibility(priv->page) == true ||
zathura_page_cache_is_cached(priv->zathura, zathura_page_get_index(priv->page)) == true) {
priv->surface = surface;
cairo_surface_reference(surface);
}
}
mutex_unlock(&(priv->lock));
/* force a redraw here */
if (priv->surface != NULL) {
......@@ -860,3 +881,12 @@ zathura_page_widget_update_view_time(ZathuraPage* widget)
priv->last_view = g_get_real_time();
}
}
bool
zathura_page_widget_have_surface(ZathuraPage* widget)
{
g_return_val_if_fail(ZATHURA_IS_PAGE(widget) == TRUE, false);
zathura_page_widget_private_t* priv = ZATHURA_PAGE_GET_PRIVATE(widget);
return priv->surface != NULL;
}
......@@ -88,4 +88,12 @@ zathura_link_t* zathura_page_widget_link_get(ZathuraPage* widget, unsigned int i
*/
void zathura_page_widget_update_view_time(ZathuraPage* widget);
/**
* Check if we have a surface.
*
* @param widget the widget
* @returns true if the widget has a surface, false otherwise
*/
bool zathura_page_widget_have_surface(ZathuraPage* widget);
#endif
......@@ -400,6 +400,6 @@ zathura_plugin_get_version(zathura_plugin_t* plugin)
return plugin->version;
}
zathura_plugin_version_t version = { 0 };
zathura_plugin_version_t version = { 0, 0, 0 };
return version;
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -266,10 +266,10 @@ render(zathura_t* zathura, zathura_page_t* page)
GtkWidget* widget = zathura_page_get_widget(zathura, page);
zathura_page_widget_update_surface(ZATHURA_PAGE(widget), surface);
gdk_threads_leave();
} else {
cairo_surface_destroy(surface);
}
cairo_surface_destroy(surface);
return true;
}
......
This diff is collapsed.
This diff is collapsed.
......@@ -17,6 +17,6 @@ Comment[pt_BR]=Um visualizador de documentos minimalista
Comment[ru]=Минималистичный просмотрщик документов
Comment[tr]=Minimalist bir belge görüntüleyicisi
Comment[uk_UA]=Легкий переглядач документів
Exec=zathura
Exec=zathura %f
Terminal=false
Categories=Office;Viewer;
......@@ -28,7 +28,7 @@ enum {
ZATHURA_PAGE_NUMBER_UNSPECIFIED = INT_MIN
};
/* forward declaration for types form database.h */
/* forward declaration for types from database.h */
typedef struct _ZathuraDatabase zathura_database_t;
/* forward declaration for types from render.h */
......@@ -163,6 +163,15 @@ struct zathura_s
unsigned int size;
unsigned int num_cached_pages;
} page_cache;
/**
* Bisect stage
*/
struct {
unsigned int last_jump; /**< Page jumped to by bisect */
unsigned int start; /**< Bisection range - start */
unsigned int end; /**< Bisection range - end */
} bisect;
};
/**
......@@ -313,9 +322,17 @@ bool page_set_delayed(zathura_t* zathura, unsigned int page_id);
* @param zathura Zathura session
* @param position_x X coordinate
* @param position_y Y coordinate
* @return If no error occured true, otherwise false, is returned.
*/
bool position_set_delayed(zathura_t* zathura, double position_x, double position_y);
void position_set_delayed(zathura_t* zathura, double position_x, double position_y);
/**
* Moves to the given position
*
* @param zathura Zathura session
* @param position_x X coordinate
* @param position_y Y coordinate
*/
void position_set(zathura_t* zathura, double position_x, double position_y);
/**
* Builds the box structure to show the rendered pages
......@@ -373,25 +390,28 @@ void zathura_jumplist_forward(zathura_t* zathura);
void zathura_jumplist_backward(zathura_t* zathura);
/**
* Save current page to the jumplist at current position
* Add current page as a new item to the jumplist after current position
*
* @param zathura The zathura session
*/
void zathura_jumplist_save