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 This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages
......
...@@ -12,7 +12,7 @@ LIBS += $(SQLITE_LIB) ...@@ -12,7 +12,7 @@ LIBS += $(SQLITE_LIB)
SOURCE = $(OSOURCE) SOURCE = $(OSOURCE)
CPPFLAGS += -DWITH_SQLITE CPPFLAGS += -DWITH_SQLITE
else else
SOURCE = $(filter-out database-sqlite.c,$(OSOURCE)) SOURCE = $(filter-out ${PROJECT}/database-sqlite.c,$(OSOURCE))
endif endif
ifneq ($(WITH_MAGIC),0) ifneq ($(WITH_MAGIC),0)
...@@ -68,8 +68,8 @@ all: options ${PROJECT} po build-manpages ...@@ -68,8 +68,8 @@ all: options ${PROJECT} po build-manpages
# pkg-config based version checks # pkg-config based version checks
.version-checks/%: config.mk .version-checks/%: config.mk
$(QUIET)test $($(*)_VERSION_CHECK) -eq 0 || \ $(QUIET)test $($(*)_VERSION_CHECK) -eq 0 || \
pkg-config --atleast-version $($(*)_MIN_VERSION) $($(*)_PKG_CONFIG_NAME) || ( \ ${PKG_CONFIG} --atleast-version $($(*)_MIN_VERSION) $($(*)_PKG_CONFIG_NAME) || ( \
echo "The minium required version of $(*) is $($(*)_MIN_VERSION)" && \ echo "The minimum required version of $(*) is $($(*)_MIN_VERSION)" && \
false \ false \
) )
@mkdir -p .version-checks @mkdir -p .version-checks
...@@ -87,8 +87,8 @@ ${PROJECT}/version.h: ${PROJECT}/version.h.in config.mk ...@@ -87,8 +87,8 @@ ${PROJECT}/version.h: ${PROJECT}/version.h.in config.mk
-e 's/ZVMINOR/${ZATHURA_VERSION_MINOR}/' \ -e 's/ZVMINOR/${ZATHURA_VERSION_MINOR}/' \
-e 's/ZVREV/${ZATHURA_VERSION_REV}/' \ -e 's/ZVREV/${ZATHURA_VERSION_REV}/' \
-e 's/ZVAPI/${ZATHURA_API_VERSION}/' \ -e 's/ZVAPI/${ZATHURA_API_VERSION}/' \
-e 's/ZVABI/${ZATHURA_ABI_VERSION}/' ${PROJECT}/version.h.in > version.h.tmp -e 's/ZVABI/${ZATHURA_ABI_VERSION}/' ${PROJECT}/version.h.in > ${PROJECT}/version.h.tmp
$(QUIET)mv version.h.tmp ${PROJECT}/version.h $(QUIET)mv ${PROJECT}/version.h.tmp ${PROJECT}/version.h
${PROJECT}/dbus-interface-definitions.c: data/org.pwmt.zathura.xml ${PROJECT}/dbus-interface-definitions.c: data/org.pwmt.zathura.xml
$(QUIET)echo '#include "dbus-interface-definitions.h"' > $@.tmp $(QUIET)echo '#include "dbus-interface-definitions.h"' > $@.tmp
...@@ -143,8 +143,8 @@ ${BUILDDIR_DEBUG}/%.o: %.c ...@@ -143,8 +143,8 @@ ${BUILDDIR_DEBUG}/%.o: %.c
${BUILDDIR_DEBUG}/${BINDIR}/${PROJECT}: ${OBJECTS_DEBUG} ${BUILDDIR_DEBUG}/${BINDIR}/${PROJECT}: ${OBJECTS_DEBUG}
$(call colorecho,CC,$@) $(call colorecho,CC,$@)
@mkdir -p ${BUILDDIR_DEBUG}/${BINDIR} @mkdir -p ${BUILDDIR_DEBUG}/${BINDIR}
$(QUIET)${CC} ${SFLAGS} ${LDFLAGS} \ $(QUIET)${CC} ${LDFLAGS} \
-o ${BUILDDIR_DEBUG}/${BINDIR}/${PROJECT} ${OBJECTS} ${LIBS} -o ${BUILDDIR_DEBUG}/${BINDIR}/${PROJECT} ${OBJECTS_DEBUG} ${LIBS}
debug: ${BUILDDIR_DEBUG}/${BINDIR}/${PROJECT} debug: ${BUILDDIR_DEBUG}/${BINDIR}/${PROJECT}
...@@ -166,8 +166,8 @@ ${BUILDDIR_GCOV}/%.o: %.c ...@@ -166,8 +166,8 @@ ${BUILDDIR_GCOV}/%.o: %.c
${BUILDDIR_GCOV}/${BINDIR}/${PROJECT}: ${OBJECTS_GCOV} ${BUILDDIR_GCOV}/${BINDIR}/${PROJECT}: ${OBJECTS_GCOV}
$(call colorecho,CC,$@) $(call colorecho,CC,$@)
@mkdir -p ${BUILDDIR_GCOV}/${BINDIR} @mkdir -p ${BUILDDIR_GCOV}/${BINDIR}
$(QUIET)${CC} ${SFLAGS} ${LDFLAGS} ${GCOV_CFLAGS} ${GCOV_LDFLAGS} \ $(QUIET)${CC} ${LDFLAGS} ${GCOV_CFLAGS} ${GCOV_LDFLAGS} \
-o ${BUILDDIR_GCOV}/${BINDIR}/${PROJECT} ${OBJECTS} ${LIBS} -o ${BUILDDIR_GCOV}/${BINDIR}/${PROJECT} ${OBJECTS_GCOv} ${LIBS}
gcov: options ${BUILDDIR_GCOV}/${BINDIR}/${PROJECT} gcov: options ${BUILDDIR_GCOV}/${BINDIR}/${PROJECT}
$(QUIET)${MAKE} -C tests run-gcov $(QUIET)${MAKE} -C tests run-gcov
...@@ -188,8 +188,8 @@ clean: ...@@ -188,8 +188,8 @@ clean:
${TARFILE} \ ${TARFILE} \
${TARDIR} \ ${TARDIR} \
${PROJECT}.pc \ ${PROJECT}.pc \
version.h \ ${PROJECT}/version.h \
version.h.tmp \ ${PROJECT}/version.h.tmp \
${PROJECT}/dbus-interface-definitions.c \ ${PROJECT}/dbus-interface-definitions.c \
${PROJECT}/dbus-interface-definitions.c.tmp \ ${PROJECT}/dbus-interface-definitions.c.tmp \
${PROJECT}/css-definitions.c \ ${PROJECT}/css-definitions.c \
...@@ -213,13 +213,13 @@ ${PROJECT}.pc: ${PROJECT}.pc.in config.mk ...@@ -213,13 +213,13 @@ ${PROJECT}.pc: ${PROJECT}.pc.in config.mk
valgrind: debug valgrind: debug
$(QUIET)G_SLICE=always-malloc G_DEBUG=gc-friendly ${VALGRIND} ${VALGRIND_ARGUMENTS} \ $(QUIET)G_SLICE=always-malloc G_DEBUG=gc-friendly ${VALGRIND} ${VALGRIND_ARGUMENTS} \
./${PROJECT}-debug ${BUILDDIR_DEBUG}/${BINDIR}/${PROJECT}
gdb: debug gdb: debug
$(QUIET)cgdb ${PROJECT}-debug $(QUIET)cgdb ${BUILDDIR_DEBUG}/${BINDIR}/${PROJECT}
test: ${OBJECTS} test: ${OBJECTS}
$(QUIET)make -C tests run $(QUIET)$(MAKE) -C tests run
dist: clean build-manpages dist: clean build-manpages
$(QUIET)tar -czf $(TARFILE) --exclude=.gitignore \ $(QUIET)tar -czf $(TARFILE) --exclude=.gitignore \
...@@ -228,7 +228,7 @@ dist: clean build-manpages ...@@ -228,7 +228,7 @@ dist: clean build-manpages
doc/_build/$(PROJECT).1 doc/_build/$(PROJECT)rc.5 doc/_build/$(PROJECT).1 doc/_build/$(PROJECT)rc.5
doc: doc:
$(QUIET)make -C doc $(QUIET)$(MAKE) -C doc
po: po:
$(QUIET)${MAKE} -C po $(QUIET)${MAKE} -C po
...@@ -298,7 +298,7 @@ uninstall: uninstall-headers ...@@ -298,7 +298,7 @@ uninstall: uninstall-headers
$(QUIET)rm -f $(DESTDIR)$(APPDATAPREFIX)/$(PROJECT).appdata.xml $(QUIET)rm -f $(DESTDIR)$(APPDATAPREFIX)/$(PROJECT).appdata.xml
$(MAKE) -C po uninstall $(MAKE) -C po uninstall
-include $(wildcard .depend/*.dep) -include $(wildcard ${DEPENDDIR}/*.dep)
.PHONY: all options clean doc debug valgrind gdb dist doc install uninstall \ .PHONY: all options clean doc debug valgrind gdb dist doc install uninstall \
test po install-headers uninstall-headers update-po install-manpages \ test po install-headers uninstall-headers update-po install-manpages \
......
...@@ -7,7 +7,7 @@ Requirements ...@@ -7,7 +7,7 @@ Requirements
------------ ------------
gtk3 gtk3
glib (>= 2.28) glib (>= 2.28)
girara (>= 0.2.0) girara (>= 0.2.4)
sqlite3 (optional, >= 3.5.9) sqlite3 (optional, >= 3.5.9)
check (for tests) check (for tests)
intltool intltool
......
...@@ -6,7 +6,7 @@ PROJECT = zathura ...@@ -6,7 +6,7 @@ PROJECT = zathura
ZATHURA_VERSION_MAJOR = 0 ZATHURA_VERSION_MAJOR = 0
ZATHURA_VERSION_MINOR = 3 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. # If the API changes, the API version and the ABI version have to be bumped.
ZATHURA_API_VERSION = 2 ZATHURA_API_VERSION = 2
# If the ABI breaks for any reason, this has to be bumped. # 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 ...@@ -18,7 +18,7 @@ VERSION = ${ZATHURA_VERSION_MAJOR}.${ZATHURA_VERSION_MINOR}.${ZATHURA_VERSION_RE
# girara # girara
GIRARA_VERSION_CHECK ?= 1 GIRARA_VERSION_CHECK ?= 1
GIRARA_MIN_VERSION = 0.2.3 GIRARA_MIN_VERSION = 0.2.4
GIRARA_PKG_CONFIG_NAME = girara-gtk3 GIRARA_PKG_CONFIG_NAME = girara-gtk3
# glib # glib
GLIB_VERSION_CHECK ?= 1 GLIB_VERSION_CHECK ?= 1
...@@ -29,13 +29,16 @@ GTK_VERSION_CHECK ?= 1 ...@@ -29,13 +29,16 @@ GTK_VERSION_CHECK ?= 1
GTK_MIN_VERSION = 3.0 GTK_MIN_VERSION = 3.0
GTK_PKG_CONFIG_NAME = gtk+-3.0 GTK_PKG_CONFIG_NAME = gtk+-3.0
# pkg-config binary
PKG_CONFIG ?= pkg-config
# database # database
# To disable support for the sqlite backend set WITH_SQLITE to 0. # 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 # synctex
# To use the embedded copy of the syntex parser set WITH_SYSTEM_SYNCTEX to 0. # 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 # mimetype detection
# To disable support for mimetype detction with libmagic set WITH_MAGIC to 0. # To disable support for mimetype detction with libmagic set WITH_MAGIC to 0.
...@@ -63,24 +66,24 @@ PLUGINDIR ?= ${LIBDIR}/zathura ...@@ -63,24 +66,24 @@ PLUGINDIR ?= ${LIBDIR}/zathura
LOCALEDIR ?= ${PREFIX}/share/locale LOCALEDIR ?= ${PREFIX}/share/locale
# libs # libs
GTK_INC ?= $(shell pkg-config --cflags gtk+-3.0) GTK_INC ?= $(shell ${PKG_CONFIG} --cflags gtk+-3.0)
GTK_LIB ?= $(shell pkg-config --libs gtk+-3.0) GTK_LIB ?= $(shell ${PKG_CONFIG} --libs gtk+-3.0)
GTHREAD_INC ?= $(shell pkg-config --cflags gthread-2.0) GTHREAD_INC ?= $(shell ${PKG_CONFIG} --cflags gthread-2.0)
GTHREAD_LIB ?= $(shell pkg-config --libs gthread-2.0) GTHREAD_LIB ?= $(shell ${PKG_CONFIG} --libs gthread-2.0)
GMODULE_INC ?= $(shell pkg-config --cflags 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) GMODULE_LIB ?= $(shell ${PKG_CONFIG} --libs gmodule-no-export-2.0)
GLIB_INC ?= $(shell pkg-config --cflags glib-2.0) GLIB_INC ?= $(shell ${PKG_CONFIG} --cflags glib-2.0)
GLIB_LIB ?= $(shell pkg-config --libs glib-2.0) GLIB_LIB ?= $(shell ${PKG_CONFIG} --libs glib-2.0)
GIRARA_INC ?= $(shell pkg-config --cflags girara-gtk3) GIRARA_INC ?= $(shell ${PKG_CONFIG} --cflags girara-gtk3)
GIRARA_LIB ?= $(shell pkg-config --libs girara-gtk3) GIRARA_LIB ?= $(shell ${PKG_CONFIG} --libs girara-gtk3)
ifneq (${WITH_SQLITE},0) ifneq (${WITH_SQLITE},0)
SQLITE_INC ?= $(shell pkg-config --cflags sqlite3) SQLITE_INC ?= $(shell ${PKG_CONFIG} --cflags sqlite3)
SQLITE_LIB ?= $(shell pkg-config --libs sqlite3) SQLITE_LIB ?= $(shell ${PKG_CONFIG} --libs sqlite3)
endif endif
ifneq (${WITH_MAGIC},0) ifneq (${WITH_MAGIC},0)
...@@ -89,11 +92,11 @@ MAGIC_LIB ?= -lmagic ...@@ -89,11 +92,11 @@ MAGIC_LIB ?= -lmagic
endif endif
ifneq ($(WITH_SYSTEM_SYNCTEX),0) ifneq ($(WITH_SYSTEM_SYNCTEX),0)
SYNCTEX_INC ?= $(shell pkg-config --cflags synctex) SYNCTEX_INC ?= $(shell ${PKG_CONFIG} --cflags synctex)
SYNCTEX_LIB ?= $(shell pkg-config --libs synctex) SYNCTEX_LIB ?= $(shell ${PKG_CONFIG} --libs synctex)
else else
ZLIB_INC ?= $(shell pkg-config --cflags zlib) ZLIB_INC ?= $(shell ${PKG_CONFIG} --cflags zlib)
ZLIB_LIB ?= $(shell pkg-config --libs zlib) ZLIB_LIB ?= $(shell ${PKG_CONFIG} --libs zlib)
endif endif
INCS = ${GIRARA_INC} ${GTK_INC} ${GTHREAD_INC} ${GMODULE_INC} ${GLIB_INC} INCS = ${GIRARA_INC} ${GTK_INC} ${GTHREAD_INC} ${GMODULE_INC} ${GLIB_INC}
......
If GDK_NATIVE_WINDOWS is enabled you will experience problems with large If GDK_NATIVE_WINDOWS is enabled you will experience problems with large
documents. In this case zathura might crash or pages cannot be rendered 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(!) ...@@ -33,3 +33,6 @@ write(!)
export export
Export attachments Export attachments
dump
Write values, descriptions, etc. of all current settings to a file.
...@@ -11,7 +11,7 @@ templates_path = ['_templates'] ...@@ -11,7 +11,7 @@ templates_path = ['_templates']
# -- Project configuration ------------------------------------------------ # -- Project configuration ------------------------------------------------
project = 'zathura' project = 'zathura'
copyright = '2014, pwmt.org' copyright = '2009-2015, pwmt.org'
version = '0.2.7' version = '0.2.7'
release = '0.2.7' release = '0.2.7'
...@@ -19,5 +19,5 @@ release = '0.2.7' ...@@ -19,5 +19,5 @@ release = '0.2.7'
man_pages = [ man_pages = [
('zathura.1', 'zathura', 'a document viewer', ['pwmt.org'], 1), ('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 @@ ...@@ -2,14 +2,6 @@
zathurarc zathurarc
========= =========
--------------------------
zathura configuration file
--------------------------
:Author: pwmt.org
:Date: VERSION
:Manual section: 5
SYNOPSIS SYNOPSIS
======== ========
...@@ -80,6 +72,16 @@ the *zathurarc* file to make those changes permanent: ...@@ -80,6 +72,16 @@ the *zathurarc* file to make those changes permanent:
map [mode] <binding> <shortcut function> <argument> 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 Mode
^^^^ ^^^^
The ``map`` command expects several arguments where only the ``binding`` as well as 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 ...@@ -651,6 +653,14 @@ values are "plain", "sqlite" (if built with sqlite support) and "null". If
* Value type: String * Value type: String
* Default value: plain * 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 incremental-search
^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^
En/Disables incremental search (search while typing). En/Disables incremental search (search while typing).
...@@ -927,13 +937,6 @@ Defines the command executed for SyncTeX backward synchronization. ...@@ -927,13 +937,6 @@ Defines the command executed for SyncTeX backward synchronization.
* Value type: String * Value type: String
* Default value: * Default value:
syntex-dbus-service
^^^^^^^^^^^^^^^^^^^
En/Disables the D-Bus service required for SyncTeX forward synchronization.
* Value type: Boolean
* Default value: true
index-fg index-fg
^^^^^^^^ ^^^^^^^^
Defines the foreground color of the index mode. Defines the foreground color of the index mode.
......
...@@ -52,7 +52,7 @@ install: ${MOS} ...@@ -52,7 +52,7 @@ install: ${MOS}
uninstall: ${MOS} uninstall: ${MOS}
$(ECHO) removing translations $(ECHO) removing translations
$(QUIET)set -e && for f in $^ ; do \ $(QUIET)set -e && for f in $^ ; do \
rm -f $(LOCALEDIR)/$$f; \ rm -f $(DESTDIR)$(LOCALEDIR)/$$f; \
done done
.PHONY: all clean update-po install uninstall .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 ...@@ -34,6 +34,8 @@ CPPFLAGS += -DWITH_MAGIC
endif endif
ifneq ($(WITH_SYSTEM_SYNCTEX),0) ifneq ($(WITH_SYSTEM_SYNCTEX),0)
INCS += $(SYNCTEX_INC)
LIBS += $(SYNCTEX_LIB)
else else
ZATHURA_OBJECTS += $(wildcard ../${BUILDDIR_RELEASE}/zathura/synctex/*.o) ZATHURA_OBJECTS += $(wildcard ../${BUILDDIR_RELEASE}/zathura/synctex/*.o)
ZATHURA_OBJECTS_DEBUG += $(wildcard ../${BUILDDIR_DEBUG}/zathura/synctex/*.o) ZATHURA_OBJECTS_DEBUG += $(wildcard ../${BUILDDIR_DEBUG}/zathura/synctex/*.o)
...@@ -140,6 +142,6 @@ clean: ...@@ -140,6 +142,6 @@ clean:
$(QUIET)rm -rf ${BUILDDIR} $(QUIET)rm -rf ${BUILDDIR}
$(QUIET)rm -rf ${DEPENDDIR} $(QUIET)rm -rf ${DEPENDDIR}
.PHONY: all options clean debug run .PHONY: all clean debug run
-include $(wildcard ${DEPENDDIR}/*.dep) -include $(wildcard ${DEPENDDIR}/*.dep)
...@@ -12,8 +12,10 @@ ...@@ -12,8 +12,10 @@
* desired. * desired.
* *
* @param document the document * @param document the document
* @param height width the original height and width * @param height the original height
* @return page_height page_width the scaled and rotated height and width * @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 * @param rotate honor page's rotation
* @return real scale after rounding * @return real scale after rounding
*/ */
...@@ -26,8 +28,10 @@ double page_calc_height_width(zathura_document_t* document, double height, doubl ...@@ -26,8 +28,10 @@ double page_calc_height_width(zathura_document_t* document, double height, doubl
* relative to the entire document. * relative to the entire document.
* *
* @param document the document * @param document the document
* @param x y the x y coordinates on the unrotated page * @param x the x coordinates on the unrotated page
* @param xn yn the x y coordinates after rotation * @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, void page_calc_position(zathura_document_t* document, double x, double y,
double *xn, double *yn); double *xn, double *yn);
...@@ -36,7 +40,8 @@ void page_calc_position(zathura_document_t* document, double x, double y, ...@@ -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. * Converts a relative position within the document to a page number.
* *
* @param document The document * @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 * @return page sitting in that position
*/ */
unsigned int position_to_page_number(zathura_document_t* document, unsigned int position_to_page_number(zathura_document_t* document,
...@@ -54,8 +59,10 @@ 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 document The document
* @param page_number the given page number * @param page_number the given page number
* @param xalign yalign where to align the viewport and the page * @param xalign where to align the viewport and the page
* @return pos_x pos_y position that will lie at the center of the viewport. * @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, void page_number_to_position(zathura_document_t* document, unsigned int page_number,
double xalign, double yalign, double *pos_x, double *pos_y); double xalign, double yalign, double *pos_x, double *pos_y);
......
...@@ -79,9 +79,10 @@ update_visible_pages(zathura_t* zathura) ...@@ -79,9 +79,10 @@ update_visible_pages(zathura_t* zathura)
/* reset current search result */ /* reset current search result */
girara_list_t* results = NULL; 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) { 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, ...@@ -264,7 +265,7 @@ cb_index_row_activated(GtkTreeView* tree_view, GtkTreePath* path,
GtkTreeModel *model; GtkTreeModel *model;
GtkTreeIter iter; 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)) { if(gtk_tree_model_get_iter(model, &iter, path)) {
zathura_index_element_t* index_element; zathura_index_element_t* index_element;
...@@ -322,7 +323,7 @@ handle_link(GtkEntry* entry, girara_session_t* session, ...@@ -322,7 +323,7 @@ handle_link(GtkEntry* entry, girara_session_t* session,
} }
GtkWidget* page_widget = zathura_page_get_widget(zathura, page); 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) { if (eval == true) {
zathura_link_t* link = zathura_page_widget_link_get(ZATHURA_PAGE(page_widget), index); 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) ...@@ -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); girara_setting_get(zathura->ui.session, "selection-notification", &notification);
if (notification == true) { 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* stripped_text = g_strdelimit(g_strdup(text), "\n\t\r\n", ' ');
char* escaped_text = g_markup_printf_escaped( 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); g_free(stripped_text);
girara_notify(zathura->ui.session, GIRARA_INFO, "%s", escaped_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); ...@@ -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 * 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 text selected text
* @param data user data * @param data user data
*/ */
......
...@@ -373,7 +373,8 @@ cmd_search(girara_session_t* session, const char* input, girara_argument_t* argu ...@@ -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); 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); zathura_renderer_lock(zathura->sync.render_thread);
girara_list_t* result = zathura_page_search_text(page, input, &error); 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 ...@@ -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) { if (result == NULL || girara_list_size(result) == 0) {
girara_list_free(result); 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) { if (error == ZATHURA_ERROR_NOT_IMPLEMENTED) {
break; break;
...@@ -390,13 +391,13 @@ cmd_search(girara_session_t* session, const char* input, girara_argument_t* argu ...@@ -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) { if (argument->n == BACKWARD) {
/* start at bottom hit in page */ /* 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 { } 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); ...@@ -16,7 +16,6 @@ void config_load_default(zathura_t* zathura);
* Loads and evaluates a configuration file * Loads and evaluates a configuration file
* *
* @param zathura The zathura session * @param zathura The zathura session
* @param path Path to the configuration file
*/ */
void config_load_files(zathura_t* zathura); void config_load_files(zathura_t* zathura);
......
...@@ -611,7 +611,7 @@ sqlite_get_fileinfo(zathura_database_t* db, const char* file, ...@@ -611,7 +611,7 @@ sqlite_get_fileinfo(zathura_database_t* db, const char* file,
if (sqlite3_step(stmt) != SQLITE_ROW) { if (sqlite3_step(stmt) != SQLITE_ROW) {
sqlite3_finalize(stmt); sqlite3_finalize(stmt);
girara_info("No info for file %s available.", file); girara_debug("No info for file %s available.", file);
return false; return false;
} }
......
...@@ -94,15 +94,20 @@ zathura_document_open(zathura_plugin_manager_t* plugin_manager, const char* ...@@ -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); plugin = zathura_plugin_manager_get_plugin(plugin_manager, content_type);
g_free((void*)content_type);
content_type = NULL;
if (plugin == NULL) { if (plugin == NULL) {
girara_error("Unknown file type: '%s'", content_type); girara_error("Unknown file type: '%s'", content_type);
check_set_error(error, ZATHURA_ERROR_UNKNOWN); check_set_error(error, ZATHURA_ERROR_UNKNOWN);
g_free((void*)content_type);
content_type = NULL;
goto error_free; goto error_free;
} }
g_free((void*)content_type);
content_type = NULL;
document = g_try_malloc0(sizeof(zathura_document_t)); document = g_try_malloc0(sizeof(zathura_document_t));
if (document == NULL) { if (document == NULL) {
check_set_error(error, ZATHURA_ERROR_OUT_OF_MEMORY); check_set_error(error, ZATHURA_ERROR_OUT_OF_MEMORY);
......
...@@ -28,8 +28,8 @@ typedef struct zathura_page_widget_private_s { ...@@ -28,8 +28,8 @@ typedef struct zathura_page_widget_private_s {