Commit f66fc6a9 authored by Moritz Lipp's avatar Moritz Lipp

Merge branch 'develop'

parents d7cc98cd 5fac8f49
zathura-pdf-poppler is written by:
Moritz Lipp <mlq@pwmt.org>
Sebastian Ramacher <s.ramacher@gmx.at>
Sebastian Ramacher <sebastian+dev@ramacher.at>
Other contributors are (in no particular order):
oblique <psyberbits@gmail.com>
Benoît Knecht <benoit.knecht@fsfe.org>
Copyright (c) 2011-2012 pwmt.org
Copyright (c) 2011-2013 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,7 +63,8 @@ debug: options ${PLUGIN}-debug.so
dist: clean
$(QUIET)mkdir -p ${PROJECT}-${VERSION}
$(QUIET)cp -R LICENSE Makefile config.mk common.mk Doxyfile \
${HEADER} ${SOURCE} AUTHORS ${PROJECT}-${VERSION}
${HEADER} ${SOURCE} AUTHORS ${PROJECT}.desktop \
${PROJECT}-${VERSION}
$(QUIET)tar -cf ${PROJECT}-${VERSION}.tar ${PROJECT}-${VERSION}
$(QUIET)gzip ${PROJECT}-${VERSION}.tar
$(QUIET)rm -rf ${PROJECT}-${VERSION}
......@@ -75,11 +76,17 @@ install: all
$(ECHO) installing ${PLUGIN} plugin
$(QUIET)mkdir -p ${DESTDIR}${PLUGINDIR}
$(QUIET)cp -f ${PLUGIN}.so ${DESTDIR}${PLUGINDIR}
$(QUIET)mkdir -m 755 -p ${DESTDIR}${DESKTOPPREFIX}
$(ECHO) installing desktop file
$(QUIET)install -m 644 ${PROJECT}.desktop ${DESTDIR}${DESKTOPPREFIX}
uninstall:
$(ECHO) uninstalling ${PLUGIN} plugin
$(QUIET)rm -f ${DESTDIR}${PLUGINDIR}/${PLUGIN}.so
$(QUIET)rmdir ${DESTDIR}${PLUGINDIR} 2> /dev/null || /bin/true
$(QUIET)rmdir --ignore-fail-on-non-empty ${DESTDIR}${PLUGINDIR} 2> /dev/null
$(ECHO) removing desktop file
$(QUIET)rm -f ${DESTDIR}${DESKTOPPREFIX}/${PROJECT}.desktop
$(QUIET)rmdir --ignore-fail-on-non-empty ${DESTDIR}${DESKTOPPREFIX} 2> /dev/null
-include $(wildcard .depend/*.dep)
......
......@@ -2,7 +2,7 @@
VERSION_MAJOR = 0
VERSION_MINOR = 2
VERSION_REV = 2
VERSION_REV = 3
VERSION = ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REV}
# minimum required zathura version
......@@ -13,6 +13,7 @@ ZATHURA_GTK_VERSION ?= $(shell pkg-config --variable=GTK_VERSION zathura)
# paths
PREFIX ?= /usr
LIBDIR ?= ${PREFIX}/lib
DESKTOPPREFIX ?= ${PREFIX}/share/applications
# libs
CAIRO_INC ?= $(shell pkg-config --cflags cairo)
......
......@@ -28,6 +28,9 @@ poppler_link_to_zathura_link(PopplerDocument* poppler_document, PopplerAction*
/* extract link */
switch (poppler_action->type) {
case POPPLER_ACTION_NONE:
type = ZATHURA_LINK_NONE;
break;
case POPPLER_ACTION_GOTO_DEST: {
PopplerDest* poppler_destination = poppler_action->goto_dest.dest;
if (poppler_destination == NULL) {
......@@ -43,7 +46,7 @@ poppler_link_to_zathura_link(PopplerDocument* poppler_document, PopplerAction*
}
}
PopplerPage* poppler_page = poppler_document_get_page(poppler_document, poppler_destination->page_num);
PopplerPage* poppler_page = poppler_document_get_page(poppler_document, poppler_destination->page_num - 1);
double height = 0;
poppler_page_get_size(poppler_page, NULL, &height);
......@@ -51,9 +54,15 @@ poppler_link_to_zathura_link(PopplerDocument* poppler_document, PopplerAction*
case POPPLER_DEST_XYZ:
target.destination_type = ZATHURA_LINK_DESTINATION_XYZ;
target.page_number = poppler_destination->page_num - 1;
target.scale = poppler_destination->zoom;
target.left = poppler_destination->left;
target.top = height - MIN(height, poppler_destination->top);
if (poppler_destination->change_zoom != 0) {
target.scale = poppler_destination->zoom;
}
if (poppler_destination->change_left != 0) {
target.left = poppler_destination->left;
}
if (poppler_destination->change_top != 0) {
target.top = height - MIN(height, poppler_destination->top);
}
break;
case POPPLER_DEST_FIT:
target.destination_type = ZATHURA_LINK_DESTINATION_FIT;
......@@ -62,18 +71,26 @@ poppler_link_to_zathura_link(PopplerDocument* poppler_document, PopplerAction*
case POPPLER_DEST_FITH:
target.destination_type = ZATHURA_LINK_DESTINATION_FITH;
target.page_number = poppler_destination->page_num - 1;
target.top = height - MIN(height, poppler_destination->top);
if (poppler_destination->change_top != 0) {
target.top = height - MIN(height, poppler_destination->top);
}
break;
case POPPLER_DEST_FITV:
target.destination_type = ZATHURA_LINK_DESTINATION_FITV;
target.page_number = poppler_destination->page_num - 1;
target.left = poppler_destination->left;
if (poppler_destination->change_left != 0) {
target.left = poppler_destination->left;
}
break;
case POPPLER_DEST_FITR:
target.destination_type = ZATHURA_LINK_DESTINATION_FITR;
target.page_number = poppler_destination->page_num - 1;
target.left = poppler_destination->left;
target.top = height - MIN(height, poppler_destination->top);
if (poppler_destination->change_left != 0) {
target.left = poppler_destination->left;
}
if (poppler_destination->change_top != 0) {
target.top = height - MIN(height, poppler_destination->top);
}
target.right = poppler_destination->right;
target.bottom = height - MIN(height, poppler_destination->bottom);
break;
......@@ -84,7 +101,9 @@ poppler_link_to_zathura_link(PopplerDocument* poppler_document, PopplerAction*
case POPPLER_DEST_FITBH:
target.destination_type = ZATHURA_LINK_DESTINATION_FITBH;
target.page_number = poppler_destination->page_num - 1;
target.top = height - MIN(height, poppler_destination->top);
if (poppler_destination->change_top != 0) {
target.top = height - MIN(height, poppler_destination->top);
}
break;
case POPPLER_DEST_FITBV:
target.destination_type = ZATHURA_LINK_DESTINATION_FITBV;
......@@ -223,11 +242,6 @@ error_free:
g_free(file_uri);
}
if (poppler_document != NULL) {
g_free(poppler_document);
zathura_document_set_data(document, NULL);
}
return error;
}
......@@ -554,7 +568,7 @@ pdf_document_get_information(zathura_document_t* document, PopplerDocument*
if (tmp != NULL) {
string_value = g_strndup(tmp, strlen(tmp) - 1);
zathura_document_information_entry_t* entry = zathura_document_information_entry_new(
string_values[i].type, string_value);
time_values[i].type, string_value);
if (entry != NULL) {
girara_list_append(list, entry);
}
......@@ -820,8 +834,8 @@ pdf_page_render(zathura_page_t* page, PopplerPage* poppler_page,
/* calculate sizes */
double scale = zathura_document_get_scale(document);
unsigned int page_width = scale * zathura_page_get_width(page);
unsigned int page_height = scale * zathura_page_get_height(page);
unsigned int page_width = ceil(scale * zathura_page_get_width(page));
unsigned int page_height = ceil(scale * zathura_page_get_height(page));
/* create pixbuf */
GdkPixbuf* pixbuf = gdk_pixbuf_new(GDK_COLORSPACE_RGB, FALSE, 8,
......
[Desktop Entry]
Version=1.0
Type=Application
Name=Zathura
Comment=A minimalistic document viewer
Comment[ca]=Un visualitzador de documents minimalista
Comment[de]=Ein minimalistischer Dokumenten-Betrachter
Comment[el]=Ένας ελαφρύς προβολέας κειμένων
Comment[eo]=Malpeza dokumento spektanto
Comment[es_CL]=Un visor de documentos minimalista
Comment[fr]=Un visionneur de document minimaliste
Comment[he]=מציג מסמכים מינימליסטי
Comment[id_ID]=Pembaca dokumen minimalis
Comment[it]=Un visualizzatore di documenti minimalista
Comment[pl]=Minimalistyczna przeglądarka dokumentów
Comment[pt_BR]=Um visualizador de documentos minimalista
Comment[ru]=Минималистичный просмотрщик документов
Comment[tr]=Minimalist bir belge görüntüleyicisi
Comment[uk_UA]=Легкий переглядач документів
Exec=zathura %f
Terminal=false
NoDisplay=true
Categories=Office;Viewer;
MimeType=application/pdf;
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