Commit d9e74bb1 authored by Moritz Lipp's avatar Moritz Lipp

Merge branch 'release/0.3.3'

parents 722c219f c6e7be98
Copyright (c) 2009-2014 pwmt.org
Copyright (c) 2009-2015 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
......
......@@ -12,7 +12,7 @@ LIBS += $(SQLITE_LIB)
SOURCE = $(OSOURCE)
CPPFLAGS += -DWITH_SQLITE
else
SOURCE = $(filter-out database-sqlite.c,$(OSOURCE))
SOURCE = $(filter-out ${PROJECT}/database-sqlite.c,$(OSOURCE))
endif
ifneq ($(WITH_MAGIC),0)
......@@ -68,8 +68,8 @@ all: options ${PROJECT} po build-manpages
# pkg-config based version checks
.version-checks/%: config.mk
$(QUIET)test $($(*)_VERSION_CHECK) -eq 0 || \
pkg-config --atleast-version $($(*)_MIN_VERSION) $($(*)_PKG_CONFIG_NAME) || ( \
echo "The minium required version of $(*) is $($(*)_MIN_VERSION)" && \
${PKG_CONFIG} --atleast-version $($(*)_MIN_VERSION) $($(*)_PKG_CONFIG_NAME) || ( \
echo "The minimum required version of $(*) is $($(*)_MIN_VERSION)" && \
false \
)
@mkdir -p .version-checks
......@@ -87,8 +87,8 @@ ${PROJECT}/version.h: ${PROJECT}/version.h.in config.mk
-e 's/ZVMINOR/${ZATHURA_VERSION_MINOR}/' \
-e 's/ZVREV/${ZATHURA_VERSION_REV}/' \
-e 's/ZVAPI/${ZATHURA_API_VERSION}/' \
-e 's/ZVABI/${ZATHURA_ABI_VERSION}/' ${PROJECT}/version.h.in > version.h.tmp
$(QUIET)mv version.h.tmp ${PROJECT}/version.h
-e 's/ZVABI/${ZATHURA_ABI_VERSION}/' ${PROJECT}/version.h.in > ${PROJECT}/version.h.tmp
$(QUIET)mv ${PROJECT}/version.h.tmp ${PROJECT}/version.h
${PROJECT}/dbus-interface-definitions.c: data/org.pwmt.zathura.xml
$(QUIET)echo '#include "dbus-interface-definitions.h"' > $@.tmp
......@@ -143,8 +143,8 @@ ${BUILDDIR_DEBUG}/%.o: %.c
${BUILDDIR_DEBUG}/${BINDIR}/${PROJECT}: ${OBJECTS_DEBUG}
$(call colorecho,CC,$@)
@mkdir -p ${BUILDDIR_DEBUG}/${BINDIR}
$(QUIET)${CC} ${SFLAGS} ${LDFLAGS} \
-o ${BUILDDIR_DEBUG}/${BINDIR}/${PROJECT} ${OBJECTS} ${LIBS}
$(QUIET)${CC} ${LDFLAGS} \
-o ${BUILDDIR_DEBUG}/${BINDIR}/${PROJECT} ${OBJECTS_DEBUG} ${LIBS}
debug: ${BUILDDIR_DEBUG}/${BINDIR}/${PROJECT}
......@@ -166,8 +166,8 @@ ${BUILDDIR_GCOV}/%.o: %.c
${BUILDDIR_GCOV}/${BINDIR}/${PROJECT}: ${OBJECTS_GCOV}
$(call colorecho,CC,$@)
@mkdir -p ${BUILDDIR_GCOV}/${BINDIR}
$(QUIET)${CC} ${SFLAGS} ${LDFLAGS} ${GCOV_CFLAGS} ${GCOV_LDFLAGS} \
-o ${BUILDDIR_GCOV}/${BINDIR}/${PROJECT} ${OBJECTS} ${LIBS}
$(QUIET)${CC} ${LDFLAGS} ${GCOV_CFLAGS} ${GCOV_LDFLAGS} \
-o ${BUILDDIR_GCOV}/${BINDIR}/${PROJECT} ${OBJECTS_GCOv} ${LIBS}
gcov: options ${BUILDDIR_GCOV}/${BINDIR}/${PROJECT}
$(QUIET)${MAKE} -C tests run-gcov
......@@ -188,8 +188,8 @@ clean:
${TARFILE} \
${TARDIR} \
${PROJECT}.pc \
version.h \
version.h.tmp \
${PROJECT}/version.h \
${PROJECT}/version.h.tmp \
${PROJECT}/dbus-interface-definitions.c \
${PROJECT}/dbus-interface-definitions.c.tmp \
${PROJECT}/css-definitions.c \
......@@ -213,13 +213,13 @@ ${PROJECT}.pc: ${PROJECT}.pc.in config.mk
valgrind: debug
$(QUIET)G_SLICE=always-malloc G_DEBUG=gc-friendly ${VALGRIND} ${VALGRIND_ARGUMENTS} \
./${PROJECT}-debug
${BUILDDIR_DEBUG}/${BINDIR}/${PROJECT}
gdb: debug
$(QUIET)cgdb ${PROJECT}-debug
$(QUIET)cgdb ${BUILDDIR_DEBUG}/${BINDIR}/${PROJECT}
test: ${OBJECTS}
$(QUIET)make -C tests run
$(QUIET)$(MAKE) -C tests run
dist: clean build-manpages
$(QUIET)tar -czf $(TARFILE) --exclude=.gitignore \
......@@ -228,7 +228,7 @@ dist: clean build-manpages
doc/_build/$(PROJECT).1 doc/_build/$(PROJECT)rc.5
doc:
$(QUIET)make -C doc
$(QUIET)$(MAKE) -C doc
po:
$(QUIET)${MAKE} -C po
......@@ -298,7 +298,7 @@ uninstall: uninstall-headers
$(QUIET)rm -f $(DESTDIR)$(APPDATAPREFIX)/$(PROJECT).appdata.xml
$(MAKE) -C po uninstall
-include $(wildcard .depend/*.dep)
-include $(wildcard ${DEPENDDIR}/*.dep)
.PHONY: all options clean doc debug valgrind gdb dist doc install uninstall \
test po install-headers uninstall-headers update-po install-manpages \
......
......@@ -7,7 +7,7 @@ Requirements
------------
gtk3
glib (>= 2.28)
girara (>= 0.2.0)
girara (>= 0.2.4)
sqlite3 (optional, >= 3.5.9)
check (for tests)
intltool
......
......@@ -6,7 +6,7 @@ PROJECT = zathura
ZATHURA_VERSION_MAJOR = 0
ZATHURA_VERSION_MINOR = 3
ZATHURA_VERSION_REV = 2
ZATHURA_VERSION_REV = 3
# 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.
......@@ -18,7 +18,7 @@ VERSION = ${ZATHURA_VERSION_MAJOR}.${ZATHURA_VERSION_MINOR}.${ZATHURA_VERSION_RE
# girara
GIRARA_VERSION_CHECK ?= 1
GIRARA_MIN_VERSION = 0.2.3
GIRARA_MIN_VERSION = 0.2.4
GIRARA_PKG_CONFIG_NAME = girara-gtk3
# glib
GLIB_VERSION_CHECK ?= 1
......@@ -29,13 +29,16 @@ GTK_VERSION_CHECK ?= 1
GTK_MIN_VERSION = 3.0
GTK_PKG_CONFIG_NAME = gtk+-3.0
# pkg-config binary
PKG_CONFIG ?= pkg-config
# database
# To disable support for the sqlite backend set WITH_SQLITE to 0.
WITH_SQLITE ?= $(shell (pkg-config --atleast-version=3.5.9 sqlite3 && echo 1) || echo 0)
WITH_SQLITE ?= $(shell (${PKG_CONFIG} --atleast-version=3.5.9 sqlite3 && echo 1) || echo 0)
# synctex
# To use the embedded copy of the syntex parser set WITH_SYSTEM_SYNCTEX to 0.
WITH_SYSTEM_SYNCTEX ?= $(shell (pkg-config synctex && echo 1) || echo 0)
WITH_SYSTEM_SYNCTEX ?= $(shell (${PKG_CONFIG} synctex && echo 1) || echo 0)
# mimetype detection
# To disable support for mimetype detction with libmagic set WITH_MAGIC to 0.
......@@ -63,24 +66,24 @@ PLUGINDIR ?= ${LIBDIR}/zathura
LOCALEDIR ?= ${PREFIX}/share/locale
# libs
GTK_INC ?= $(shell pkg-config --cflags gtk+-3.0)
GTK_LIB ?= $(shell pkg-config --libs gtk+-3.0)
GTK_INC ?= $(shell ${PKG_CONFIG} --cflags gtk+-3.0)
GTK_LIB ?= $(shell ${PKG_CONFIG} --libs gtk+-3.0)
GTHREAD_INC ?= $(shell pkg-config --cflags gthread-2.0)
GTHREAD_LIB ?= $(shell pkg-config --libs gthread-2.0)
GTHREAD_INC ?= $(shell ${PKG_CONFIG} --cflags gthread-2.0)
GTHREAD_LIB ?= $(shell ${PKG_CONFIG} --libs gthread-2.0)
GMODULE_INC ?= $(shell pkg-config --cflags gmodule-no-export-2.0)
GMODULE_LIB ?= $(shell pkg-config --libs gmodule-no-export-2.0)
GMODULE_INC ?= $(shell ${PKG_CONFIG} --cflags gmodule-no-export-2.0)
GMODULE_LIB ?= $(shell ${PKG_CONFIG} --libs gmodule-no-export-2.0)
GLIB_INC ?= $(shell pkg-config --cflags glib-2.0)
GLIB_LIB ?= $(shell pkg-config --libs glib-2.0)
GLIB_INC ?= $(shell ${PKG_CONFIG} --cflags glib-2.0)
GLIB_LIB ?= $(shell ${PKG_CONFIG} --libs glib-2.0)
GIRARA_INC ?= $(shell pkg-config --cflags girara-gtk3)
GIRARA_LIB ?= $(shell pkg-config --libs girara-gtk3)
GIRARA_INC ?= $(shell ${PKG_CONFIG} --cflags girara-gtk3)
GIRARA_LIB ?= $(shell ${PKG_CONFIG} --libs girara-gtk3)
ifneq (${WITH_SQLITE},0)
SQLITE_INC ?= $(shell pkg-config --cflags sqlite3)
SQLITE_LIB ?= $(shell pkg-config --libs sqlite3)
SQLITE_INC ?= $(shell ${PKG_CONFIG} --cflags sqlite3)
SQLITE_LIB ?= $(shell ${PKG_CONFIG} --libs sqlite3)
endif
ifneq (${WITH_MAGIC},0)
......@@ -89,11 +92,11 @@ MAGIC_LIB ?= -lmagic
endif
ifneq ($(WITH_SYSTEM_SYNCTEX),0)
SYNCTEX_INC ?= $(shell pkg-config --cflags synctex)
SYNCTEX_LIB ?= $(shell pkg-config --libs synctex)
SYNCTEX_INC ?= $(shell ${PKG_CONFIG} --cflags synctex)
SYNCTEX_LIB ?= $(shell ${PKG_CONFIG} --libs synctex)
else
ZLIB_INC ?= $(shell pkg-config --cflags zlib)
ZLIB_LIB ?= $(shell pkg-config --libs zlib)
ZLIB_INC ?= $(shell ${PKG_CONFIG} --cflags zlib)
ZLIB_LIB ?= $(shell ${PKG_CONFIG} --libs zlib)
endif
INCS = ${GIRARA_INC} ${GTK_INC} ${GTHREAD_INC} ${GMODULE_INC} ${GLIB_INC}
......
If GDK_NATIVE_WINDOWS is enabled you will experience problems with large
documents. In this case zathura might crash or pages cannot be rendered
properly. Disabling GDK_NATIVE_WINDOWS fixes this issue.
properly. Disabling GDK_NATIVE_WINDOWS fixes this issue. The same issue may
appear, if overlay-scrollbar is enabled in GTK_MODULES.
......@@ -33,3 +33,6 @@ write(!)
export
Export attachments
dump
Write values, descriptions, etc. of all current settings to a file.
......@@ -11,7 +11,7 @@ templates_path = ['_templates']
# -- Project configuration ------------------------------------------------
project = 'zathura'
copyright = '2014, pwmt.org'
copyright = '2009-2015, pwmt.org'
version = '0.2.7'
release = '0.2.7'
......@@ -19,5 +19,5 @@ release = '0.2.7'
man_pages = [
('zathura.1', 'zathura', 'a document viewer', ['pwmt.org'], 1),
('zathurarc.5', 'zathurarc', 'a document viewer', ['pwmt.org'], 5)
('zathurarc.5', 'zathurarc', 'zathura configuration file', ['pwmt.org'], 5)
]
......@@ -2,14 +2,6 @@
zathurarc
=========
--------------------------
zathura configuration file
--------------------------
:Author: pwmt.org
:Date: VERSION
:Manual section: 5
SYNOPSIS
========
......@@ -80,6 +72,16 @@ the *zathurarc* file to make those changes permanent:
map [mode] <binding> <shortcut function> <argument>
include - Including another config file
---------------------------------------
This commands allows to include other configuration files. If a relative path is
given, the path will be resolved relative to the configuration file that is
currently processed.
::
include another-config
Mode
^^^^
The ``map`` command expects several arguments where only the ``binding`` as well as
......@@ -651,6 +653,14 @@ values are "plain", "sqlite" (if built with sqlite support) and "null". If
* Value type: String
* Default value: plain
dbus-service
^^^^^^^^^^^^^^^^^^^
En/Disables the D-Bus service. If the services is disabled, SyncTeX forward
synchronization is not available.
* Value type: Boolean
* Default value: true
incremental-search
^^^^^^^^^^^^^^^^^^
En/Disables incremental search (search while typing).
......@@ -927,13 +937,6 @@ Defines the command executed for SyncTeX backward synchronization.
* Value type: String
* Default value:
syntex-dbus-service
^^^^^^^^^^^^^^^^^^^
En/Disables the D-Bus service required for SyncTeX forward synchronization.
* Value type: Boolean
* Default value: true
index-fg
^^^^^^^^
Defines the foreground color of the index mode.
......
......@@ -52,7 +52,7 @@ install: ${MOS}
uninstall: ${MOS}
$(ECHO) removing translations
$(QUIET)set -e && for f in $^ ; do \
rm -f $(LOCALEDIR)/$$f; \
rm -f $(DESTDIR)$(LOCALEDIR)/$$f; \
done
.PHONY: all clean update-po install uninstall
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.
This diff is collapsed.
This diff is collapsed.
......@@ -34,6 +34,8 @@ CPPFLAGS += -DWITH_MAGIC
endif
ifneq ($(WITH_SYSTEM_SYNCTEX),0)
INCS += $(SYNCTEX_INC)
LIBS += $(SYNCTEX_LIB)
else
ZATHURA_OBJECTS += $(wildcard ../${BUILDDIR_RELEASE}/zathura/synctex/*.o)
ZATHURA_OBJECTS_DEBUG += $(wildcard ../${BUILDDIR_DEBUG}/zathura/synctex/*.o)
......@@ -140,6 +142,6 @@ clean:
$(QUIET)rm -rf ${BUILDDIR}
$(QUIET)rm -rf ${DEPENDDIR}
.PHONY: all options clean debug run
.PHONY: all clean debug run
-include $(wildcard ${DEPENDDIR}/*.dep)
......@@ -12,8 +12,10 @@
* desired.
*
* @param document the document
* @param height width the original height and width
* @return page_height page_width the scaled and rotated height and width
* @param height the original height
* @param width the original width
* @param page_height the scaled and rotated height
* @param page_width the scaled and rotated width
* @param rotate honor page's rotation
* @return real scale after rounding
*/
......@@ -26,8 +28,10 @@ double page_calc_height_width(zathura_document_t* document, double height, doubl
* relative to the entire document.
*
* @param document the document
* @param x y the x y coordinates on the unrotated page
* @param xn yn the x y coordinates after rotation
* @param x the x coordinates on the unrotated page
* @param y the y coordinates on the unrotated page
* @param xn the x coordinates after rotation
* @param yn the y coordinates after rotation
*/
void page_calc_position(zathura_document_t* document, double x, double y,
double *xn, double *yn);
......@@ -36,7 +40,8 @@ void page_calc_position(zathura_document_t* document, double x, double y,
* Converts a relative position within the document to a page number.
*
* @param document The document
* @param pos_x pos_y the position relative to the document
* @param pos_x the x position relative to the document
* @param pos_y the y position relative to the document
* @return page sitting in that position
*/
unsigned int position_to_page_number(zathura_document_t* document,
......@@ -54,8 +59,10 @@ unsigned int position_to_page_number(zathura_document_t* document,
*
* @param document The document
* @param page_number the given page number
* @param xalign yalign where to align the viewport and the page
* @return pos_x pos_y position that will lie at the center of the viewport.
* @param xalign where to align the viewport and the page
* @param yalign where to align the viewport and the page
* @param pos_x position that will lie at the center of the viewport.
* @param pos_y position that will lie at the center of the viewport.
*/
void page_number_to_position(zathura_document_t* document, unsigned int page_number,
double xalign, double yalign, double *pos_x, double *pos_y);
......
......@@ -79,9 +79,10 @@ update_visible_pages(zathura_t* zathura)
/* reset current search result */
girara_list_t* results = NULL;
g_object_get(page_widget, "search-results", &results, NULL);
GObject* obj_page_widget = G_OBJECT(page_widget);
g_object_get(obj_page_widget, "search-results", &results, NULL);
if (results != NULL) {
g_object_set(page_widget, "search-current", 0, NULL);
g_object_set(obj_page_widget, "search-current", 0, NULL);
}
}
}
......@@ -264,7 +265,7 @@ cb_index_row_activated(GtkTreeView* tree_view, GtkTreePath* path,
GtkTreeModel *model;
GtkTreeIter iter;
g_object_get(tree_view, "model", &model, NULL);
g_object_get(G_OBJECT(tree_view), "model", &model, NULL);
if(gtk_tree_model_get_iter(model, &iter, path)) {
zathura_index_element_t* index_element;
......@@ -322,7 +323,7 @@ handle_link(GtkEntry* entry, girara_session_t* session,
}
GtkWidget* page_widget = zathura_page_get_widget(zathura, page);
g_object_set(page_widget, "draw-links", FALSE, NULL);
g_object_set(G_OBJECT(page_widget), "draw-links", FALSE, NULL);
if (eval == true) {
zathura_link_t* link = zathura_page_widget_link_get(ZATHURA_PAGE(page_widget), index);
......@@ -579,9 +580,13 @@ cb_page_widget_text_selected(ZathuraPage* page, const char* text, void* data)
girara_setting_get(zathura->ui.session, "selection-notification", &notification);
if (notification == true) {
char* target = NULL;
girara_setting_get(zathura->ui.session, "selection-clipboard", &target);
char* stripped_text = g_strdelimit(g_strdup(text), "\n\t\r\n", ' ');
char* escaped_text = g_markup_printf_escaped(
_("Copied selected text to clipboard: %s"), stripped_text);
_("Copied selected text to selection %s: %s"), target, stripped_text);
g_free(target);
g_free(stripped_text);
girara_notify(zathura->ui.session, GIRARA_INFO, "%s", escaped_text);
......
......@@ -201,7 +201,7 @@ bool cb_unknown_command(girara_session_t* session, const char* input);
/**
* Emitted when text has been selected in the page widget
*
* @param widget page view widget
* @param page page view widget
* @param text selected text
* @param data user data
*/
......
......@@ -373,7 +373,8 @@ cmd_search(girara_session_t* session, const char* input, girara_argument_t* argu
}
GtkWidget* page_widget = zathura_page_get_widget(zathura, page);
g_object_set(page_widget, "draw-links", FALSE, NULL);
GObject* obj_page_widget = G_OBJECT(page_widget);
g_object_set(obj_page_widget, "draw-links", FALSE, NULL);
zathura_renderer_lock(zathura->sync.render_thread);
girara_list_t* result = zathura_page_search_text(page, input, &error);
......@@ -381,7 +382,7 @@ cmd_search(girara_session_t* session, const char* input, girara_argument_t* argu
if (result == NULL || girara_list_size(result) == 0) {
girara_list_free(result);
g_object_set(page_widget, "search-results", NULL, NULL);
g_object_set(obj_page_widget, "search-results", NULL, NULL);
if (error == ZATHURA_ERROR_NOT_IMPLEMENTED) {
break;
......@@ -390,13 +391,13 @@ cmd_search(girara_session_t* session, const char* input, girara_argument_t* argu
}
}
g_object_set(page_widget, "search-results", result, NULL);
g_object_set(obj_page_widget, "search-results", result, NULL);
if (argument->n == BACKWARD) {
/* start at bottom hit in page */
g_object_set(page_widget, "search-current", girara_list_size(result) - 1, NULL);
g_object_set(obj_page_widget, "search-current", girara_list_size(result) - 1, NULL);
} else {
g_object_set(page_widget, "search-current", 0, NULL);
g_object_set(obj_page_widget, "search-current", 0, NULL);
}
}
......
......@@ -16,7 +16,6 @@ void config_load_default(zathura_t* zathura);
* Loads and evaluates a configuration file
*
* @param zathura The zathura session
* @param path Path to the configuration file
*/
void config_load_files(zathura_t* zathura);
......
......@@ -611,7 +611,7 @@ sqlite_get_fileinfo(zathura_database_t* db, const char* file,
if (sqlite3_step(stmt) != SQLITE_ROW) {
sqlite3_finalize(stmt);
girara_info("No info for file %s available.", file);
girara_debug("No info for file %s available.", file);
return false;
}
......
......@@ -94,15 +94,20 @@ zathura_document_open(zathura_plugin_manager_t* plugin_manager, const char*
}
plugin = zathura_plugin_manager_get_plugin(plugin_manager, content_type);
g_free((void*)content_type);
content_type = NULL;
if (plugin == NULL) {
girara_error("Unknown file type: '%s'", content_type);
check_set_error(error, ZATHURA_ERROR_UNKNOWN);
g_free((void*)content_type);
content_type = NULL;
goto error_free;
}
g_free((void*)content_type);
content_type = NULL;
document = g_try_malloc0(sizeof(zathura_document_t));
if (document == NULL) {
check_set_error(error, ZATHURA_ERROR_OUT_OF_MEMORY);
......
......@@ -28,8 +28,8 @@ typedef struct zathura_page_widget_private_s {
struct {
girara_list_t* list; /**< List of links on the page */
bool retrieved; /**< True if we already tried to retrieve the list of links */
bool draw; /**< True if links should be drawn */
gboolean retrieved; /**< True if we already tried to retrieve the list of links */
gboolean draw; /**< True if links should be drawn */
unsigned int offset; /**< Offset to the links */
unsigned int n; /**< Number */
} links;
......@@ -37,12 +37,12 @@ typedef struct zathura_page_widget_private_s {
struct {
girara_list_t* list; /**< A list if there are search results that should be drawn */
int current; /**< The index of the current search result */
bool draw; /**< Draw search results */
gboolean draw; /**< Draw search results */
} search;
struct {
girara_list_t* list; /**< List of images on the page */
bool retrieved; /**< True if we already tried to retrieve the list of images */
gboolean retrieved; /**< True if we already tried to retrieve the list of images */
zathura_image_t* current; /**< Image data of selected image */
} images;
......@@ -52,7 +52,7 @@ typedef struct zathura_page_widget_private_s {
int x; /**< X coordinate */
int y; /**< Y coordinate */
} selection_basepoint;
bool over_link;
gboolean over_link;
} mouse;
} zathura_page_widget_private_t;
......@@ -313,13 +313,13 @@ zathura_page_widget_set_property(GObject* object, guint prop_id, const GValue* v
case PROP_DRAW_LINKS:
priv->links.draw = g_value_get_boolean(value);
/* get links */
if (priv->links.draw == true && priv->links.retrieved == false) {
if (priv->links.draw == TRUE && priv->links.retrieved == FALSE) {
priv->links.list = zathura_page_links_get(priv->page, NULL);
priv->links.retrieved = true;
priv->links.retrieved = TRUE;
priv->links.n = (priv->links.list == NULL) ? 0 : girara_list_size(priv->links.list);
}
if (priv->links.retrieved == true && priv->links.list != NULL) {
if (priv->links.retrieved == TRUE && priv->links.list != NULL) {
GIRARA_LIST_FOREACH(priv->links.list, zathura_link_t*, iter, link)
if (link != NULL) {
zathura_rectangle_t rectangle = recalc_rectangle(priv->page, zathura_link_get_position(link));
......@@ -338,7 +338,7 @@ zathura_page_widget_set_property(GObject* object, guint prop_id, const GValue* v
}
priv->search.list = g_value_get_pointer(value);
if (priv->search.list != NULL && priv->search.draw) {
priv->links.draw = false;
priv->links.draw = FALSE;
redraw_all_rects(pageview, priv->search.list);
}
priv->search.current = -1;
......@@ -355,7 +355,7 @@ zathura_page_widget_set_property(GObject* object, guint prop_id, const GValue* v
priv->search.current = girara_list_size(priv->search.list);
} else {
priv->search.current = val;
if (priv->search.draw == true && val >= 0 && val < (signed) girara_list_size(priv->search.list)) {
if (priv->search.draw == TRUE && val >= 0 && val < (signed) girara_list_size(priv->search.list)) {
zathura_rectangle_t* rect = girara_list_nth(priv->search.list, priv->search.current);
zathura_rectangle_t rectangle = recalc_rectangle(priv->page, *rect);
redraw_rect(pageview, &rectangle);
......
......@@ -83,6 +83,22 @@ zathura_plugin_manager_add_dir(zathura_plugin_manager_t* plugin_manager, const c
girara_list_append(plugin_manager->path, g_strdup(dir));
}
static bool
check_suffix(const char* path)
{
if (g_str_has_suffix(path, ".so") == TRUE) {
return true;
}
#ifdef __APPLE__
if (g_str_has_suffix(path, ".dylib") == TRUE) {
return true;
}
#endif
return false;
}
void
zathura_plugin_manager_load(zathura_plugin_manager_t* plugin_manager)
{
......@@ -108,7 +124,7 @@ zathura_plugin_manager_load(zathura_plugin_manager_t* plugin_manager)
continue;
}
if (g_str_has_suffix(path, ".so") == FALSE) {
if (check_suffix(path) == false) {
girara_debug("%s is not a plugin file. Skipping.", path);
g_free(path);
continue;
......
......@@ -195,7 +195,7 @@ void zathura_render_request(ZathuraRenderRequest* request,
/**
* Abort an existing render request.
*
* @param reqeust request that should be aborted
* @param request request that should be aborted
*/
void zathura_render_request_abort(ZathuraRenderRequest* request);
......
This diff is collapsed.
......@@ -229,11 +229,15 @@ GdkAtom* get_selection(zathura_t* zathura)
{
g_return_val_if_fail(zathura != NULL, NULL);
char* value;
char* value = NULL;
girara_setting_get(zathura->ui.session, "selection-clipboard", &value);
if (value == NULL) {
return NULL;
}
GdkAtom* selection = g_try_malloc(sizeof(GdkAtom));
if (selection == NULL) {
g_free(selection);
return NULL;
}
......
This diff is collapsed.
......@@ -284,6 +284,7 @@ void zathura_set_argv(zathura_t* zathura, char** argv);
* @param zathura The zathura session
* @param path The path to the file
* @param password The password of the file
* @param page_number Open given page number
*
* @return If no error occured true, otherwise false, is returned.
*/
......@@ -296,6 +297,8 @@ bool document_open(zathura_t* zathura, const char* path, const char* password,
* @param zathura The zathura session
* @param path The path to the file
* @param password The password of the file
* @param page_number Open given page number
* @param mode Open in given page mode
*/
void document_open_idle(zathura_t* zathura, const char* path,
const char* password, int page_number,
......
Markdown is supported
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