Commit 8332807e authored by Sebastian Ramacher's avatar Sebastian Ramacher

New upstream version 0.4.1

parent 548e4749
......@@ -33,9 +33,11 @@ The use of magic to detect mime types is optional and can be disabled by
configuring the build system with -Denable-magic=false.
The use of seccomp to create a sandboxed environment is optional and can be
enabled by configure the build system with -Denable-seccomp=true. Note that the
sandbox is currently only available as experimental preview. Some commands,
shortcuts and other functionality might break.
disabled by configure the build system with -Denable-seccomp=false. The sandbox
will by default be set to "normal" mode, which should not interfere with the
normal operation of zathura. For strict sandbox mode set "sandbox strict" in
zathurarc. Strict sandbox mode will reduce the available functionality of
zathura and provide a read only document viewer.
Installation
------------
......
_zathura() {
_init_completion || return
local EXTS=""
for PLUGIN in @PLUGINDIR@/lib*.so; do
case ${PLUGIN##*/} in
libpdf-poppler.so)
EXTS="$EXTS|pdf"
;;
libpdf-mupdf.so)
EXTS="$EXTS|pdf|epub|oxps"
;;
libps.so)
EXTS="$EXTS|ps|eps|epsi|epsf"
;;
libdjvu.so)
EXTS="$EXTS|djvu|djv"
;;
libcb.so)
EXTS="$EXTS|cb7|cbr|cbz|cbt|rar|zip|7z|tar"
;;
esac
done
_filedir "${EXTS#|}"
}
complete -F _zathura zathura
......@@ -44,3 +44,19 @@ if appstream_util.found()
args: ['validate-relax', appdata.full_path()]
)
endif
conf_data = configuration_data()
conf_data.set('PLUGINDIR', join_paths(prefix, plugindir))
bash_completion = configure_file(
input: 'bash-completion.in',
output: 'zathura',
configuration: conf_data
)
zsh_completion = configure_file(
input: 'zsh-completion.in',
output: '_zathura',
configuration: conf_data
)
install_data(bash_completion, install_dir: join_paths(datadir, 'bash-completion', 'completions'))
install_data(zsh_completion, install_dir: join_paths(datadir, 'zsh', 'vendor-completions'))
#compdef zathura
local -a all_opts
all_opts=(
'(-c --config-dir=DIR)'{-c,--config-dir}'[Path to config directory]:config directory:_files -/'
'(-d --data-dir=DIR)'{-d,--data-dir}'[Path to data directory]:data directory:_files -/'
'--cache-dir=DIR[Path to cache directory]:cache directory:_files -/'
'(-p --plugins-dir=DIR)'{-p,--plugins-dir}'[Path to plugins directory]:plugins directory:_files -/'
'(-e --reparent=XID)'{-e,--reparent}'[Reparents to window specified by XID (X11)]:xid'
'(-w --password=password)'{-w,--password}'[Document password]:password'
'(-P --page=page)'{-p,--page}'[Page number to go to]:page number'
'(-l --log-level=level)'{-l,--log-level}'[Log level]:level:(error warning info debug)'
'(-x --snyctex-editor-command=cmd)'{-x,--synxtec-editor-command}'[Synctex editor (forwarded to the synctex command)]:command'
'--synctex-forward=position[Move to given synctex position]:position'
'--synctex-pid=pid[Highlight position in given process]:pid'
'--mode=mode[Start in a non-default mode]:mode:(presentation fullscreen)'
'--fork[Fork into the background]'
'-h --help[Show help message]'
'-V --version[Print version information]'
'*:file:->files'
)
local context state state_descr line
typeset -A opt_args
_arguments -S "$all_opts[@]" && return 0
local exts
for PLUGIN in @PLUGINDIR@/lib*.so; do
case ${PLUGIN##*/} in
libpdf-poppler.so)
exts="$exts|pdf"
;;
libpdf-mupdf.so)
exts="$exts|pdf|epub|oxps"
;;
libps.so)
exts="$exts|ps|eps|epsi|epsf"
;;
libdjvu.so)
exts="$exts|djvu|djv"
;;
libcb.so)
exts="$exts|cb7|cbr|cbz|cbt|rar|zip|7z|tar"
;;
esac
done
case $state in
(files)
_files -g "*.($exts)"
;;
esac
ZATHURA_PLUGINS_PATH
Path to the directory containing plugins. This directory is only considered if
no other directory was specified using --plugins-dir.
......@@ -12,8 +12,8 @@
-w, --password=password
The documents password. If multiple documents are opened at once, the
password will be used for the first one and zathura will ask for the
passwords of the remaining files if needed .
password will be used for the first one and zathura will ask for the
passwords of the remaining files if needed.
-P, --page=number
Opens the document at the given page number. Pages are numbered starting
......
......@@ -5,7 +5,7 @@ interface. To support synctex backwards synchronization, zathura provides a
D-Bus interface that can be called by the editor. For convince zathura also
knows how to parse the output of the *synctex view* command. It is enough to
pass the arguments to *synctex view*'s *-i* option to zathura via
*--syntex-forward* and zathura will pass the information to the correct
*--synctex-forward* and zathura will pass the information to the correct
instance.
For gvim forward and backwards synchronization support can be set up as follows:
......
......@@ -25,7 +25,7 @@ today = time.strftime('%Y-%m-%d', time.gmtime(maxdate))
# -- Project configuration ------------------------------------------------
project = 'zathura'
copyright = '2009-2015, pwmt.org'
copyright = '2009-2018, pwmt.org'
version = '0.2.7'
release = '0.2.7'
......
......@@ -16,6 +16,11 @@ Options
.. include:: _options.txt
Environment variables
---------------------
.. include:: _env.txt
Mouse and key bindings
----------------------
......
......@@ -685,8 +685,9 @@ synchronization is not available.
filemonitor
^^^^^^^^^^^
Defines the filemonitor backend. Possible values are "glib" and "signal" (if
signal handling is supported).
Defines the file monitor backend used to check for changes in files. Possible
values are "glib", "signal" (if signal handling is supported), and "noop". The
"noop" file monitor does not trigger reloads.
* Value type: String
* Default value: glib
......@@ -766,7 +767,10 @@ the following pattern <1 page per row>:[<2 pages per row>[: ...]]. The last
value in the list will be used for all other number of pages per row if not set
explicitly.
Per default, the first column is set to 2 for double-page layout.
Per default, the first column is set to 2 for double-page layout, i.e. the faule
is set to 1:2. A value of 1:1:3 would put the first page in dual-page layour in
the first column, and for layouts with more columns the first page would be put
in the 3rd column.
* Value type: String
* Default value: 1:2
......@@ -1057,6 +1061,30 @@ is a read only sandbox that is intended for viewing documents only.
* Value type: String
* Default value: normal
Some features are disabled when using strict sandbox mode:
* saving/writing files
* use of input methods like ibus
* printing
* bookmarks and history
No feature regressions are expected when using normal sandbox mode.
window-icon-document
^^^^^^^^^^^^^^^^^^^^
Defines whether the window document should be updated based on the first page of
a dcument.
* Value type: Boolean
* Default value: false
page-right-to-left
^^^^^^^^^^^^^^^^^^
Defines whether pages in multi-column view should start from the right side.
* Value type: Boolean
* Default value: false
SEE ALSO
========
......
sphinx = find_program('sphinx-build')
custom_target('man pages',
command: [sphinx, '-b', 'man', join_paths(meson.current_source_dir(), 'man'), meson.current_build_dir()],
command: [
sphinx,
'-b', 'man',
'-D', 'version=' + version,
'-D', 'release=' + version,
join_paths(meson.current_source_dir(), 'man'),
meson.current_build_dir()],
output: ['zathura.1', 'zathurarc.5'],
input: [
'man/conf.py',
......
project('zathura', 'c',
version: '0.4.0',
version: '0.4.1',
meson_version: '>=0.45',
default_options: 'c_std=c11',
)
......@@ -25,7 +25,7 @@ conf_data.set('ZVAPI', plugin_api_version)
conf_data.set('ZVABI', plugin_abi_version)
conf_data.set('version', version)
cc = meson.get_compiler('c', required: false)
cc = meson.get_compiler('c')
prefix = get_option('prefix')
localedir = get_option('localedir')
......@@ -83,7 +83,11 @@ if get_option('enable-synctex') and synctex.found()
build_dependencies += synctex
defines += '-DWITH_SYNCTEX'
if synctex.version() < '2.0.0'
defines += '-DWITH_SYNCTEX1'
if synctex.version() >= '1.19.0'
warning('You are using a synctex version pre-SONAME bump, but post-ABI-break. Please make sure to always run zathura using the correct synctex version.')
else
defines += '-DWITH_SYNCTEX1'
endif
endif
endif
......@@ -127,6 +131,7 @@ sources = files(
'zathura/document.c',
'zathura/file-monitor.c',
'zathura/file-monitor-glib.c',
'zathura/file-monitor-noop.c',
'zathura/file-monitor-signal.c',
'zathura/jumplist.c',
'zathura/links.c',
......
......@@ -15,6 +15,6 @@ option('enable-magic',
)
option('enable-seccomp',
type: 'boolean',
value: false,
value: true,
description: 'Enable experimental seccomp support if available.'
)
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.
This diff is collapsed.
......@@ -7,20 +7,39 @@ if check.found()
include_directories += [ include_directories('../zathura') ]
test_sources = [
'tests.c',
'test_document.c',
'test_session.c',
'test_utils.c'
]
document = executable('test_document', ['test_document.c', 'tests.c'],
dependencies: build_dependencies + test_dependencies,
include_directories: include_directories,
c_args: defines + flags
)
test('document', document,
timeout: 60*60
)
session = executable('test_session', ['test_session.c', 'tests.c'],
dependencies: build_dependencies + test_dependencies,
include_directories: include_directories,
c_args: defines + flags
)
test('session', session,
timeout: 60*60
)
tests = executable('tests', test_sources,
utils = executable('test_utils', ['test_utils.c', 'tests.c'],
dependencies: build_dependencies + test_dependencies,
include_directories: include_directories,
c_args: defines + flags
)
test('utils', utils,
timeout: 60*60
)
test('tests', tests,
types = executable('test_types', ['test_types.c', 'tests.c'],
dependencies: build_dependencies + test_dependencies,
include_directories: include_directories,
c_args: defines + flags
)
test('types', types,
timeout: 60*60
)
endif
......@@ -3,6 +3,7 @@
#include <check.h>
#include "document.h"
#include "tests.h"
START_TEST(test_open) {
fail_unless(zathura_document_open(NULL, NULL, NULL, NULL, NULL) == NULL, "Could create document", NULL);
......@@ -11,7 +12,7 @@ START_TEST(test_open) {
fail_unless(zathura_document_open(NULL, "fl", NULL, "pw", NULL) == NULL, "Could create document", NULL);
} END_TEST
Suite* suite_document()
static Suite* suite_document(void)
{
TCase* tcase = NULL;
Suite* suite = suite_create("Document");
......@@ -23,3 +24,8 @@ Suite* suite_document()
return suite;
}
int main()
{
return run_suite(suite_document());
}
......@@ -3,6 +3,7 @@
#include <check.h>
#include "zathura.h"
#include "tests.h"
START_TEST(test_create) {
zathura_t* zathura = zathura_create();
......@@ -11,15 +12,21 @@ START_TEST(test_create) {
zathura_free(zathura);
} END_TEST
Suite* suite_session()
static Suite* suite_session(void)
{
TCase* tcase = NULL;
Suite* suite = suite_create("Session");
/* basic */
tcase = tcase_create("basic");
tcase_add_checked_fixture(tcase, setup, NULL);
tcase_add_test(tcase, test_create);
suite_add_tcase(suite, tcase);
return suite;
}
int main()
{
return run_suite(suite_session());
}
/* See LICENSE file for license and copyright information */
#include <check.h>
#include <limits.h>
#include "types.h"
#include "tests.h"
START_TEST(test_image_buffer_fail) {
fail_unless(zathura_image_buffer_create(UINT_MAX, UINT_MAX) == NULL, NULL);
} END_TEST
START_TEST(test_image_buffer) {
zathura_image_buffer_t* buffer = zathura_image_buffer_create(1, 1);
fail_unless(buffer != NULL, NULL);
zathura_image_buffer_free(buffer);
} END_TEST
static Suite* suite_types(void)
{
TCase* tcase = NULL;
Suite* suite = suite_create("Types");
/* file valid extension */
tcase = tcase_create("Image buffer");
tcase_add_test(tcase, test_image_buffer_fail);
tcase_add_test(tcase, test_image_buffer);
suite_add_tcase(suite, tcase);
return suite;
}
int main()
{
return run_suite(suite_types());
}
......@@ -3,6 +3,7 @@
#include <check.h>
#include "utils.h"
#include "tests.h"
START_TEST(test_file_valid_extension_null) {
fail_unless(file_valid_extension(NULL, NULL) == false, NULL);
......@@ -10,7 +11,7 @@ START_TEST(test_file_valid_extension_null) {
fail_unless(file_valid_extension(NULL, "pdf") == false, NULL);
} END_TEST
Suite* suite_utils()
static Suite* suite_utils(void)
{
TCase* tcase = NULL;
Suite* suite = suite_create("Utils");
......@@ -22,3 +23,8 @@ Suite* suite_utils()
return suite;
}
int main()
{
return run_suite(suite_utils());
}
This diff is collapsed.
/* See LICENSE file for license and copyright information */
#ifndef ZATHURA_TESTS_H
#define ZATHURA_TESTS_H
#include <check.h>
int run_suite(Suite* suite);
void setup(void);
#endif
This diff is collapsed.
......@@ -262,11 +262,14 @@ void cb_page_widget_image_selected(ZathuraPage* page, GdkPixbuf* pixbuf,
void cb_page_widget_scaled_button_release(ZathuraPage* page,
GdkEventButton* event, void* data);
void
cb_page_widget_link(ZathuraPage* page, void* data);
void cb_page_widget_link(ZathuraPage* page, void* data);
void
update_visible_pages(zathura_t* zathura);
void update_visible_pages(zathura_t* zathura);
/**
* Update window icon from cairo surface.
*/
void cb_window_update_icon(ZathuraRenderRequest* request, cairo_surface_t* surface, void* data);
#endif // CALLBACKS_H
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -15,6 +15,7 @@ typedef struct zathura_fileinfo_s {
double zoom;
unsigned int rotation;
unsigned int pages_per_row;
bool page_right_to_left;
char* first_page_column_list;
double position_x;
double position_y;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -55,7 +55,8 @@ GType zathura_filemonitor_get_type(void) G_GNUC_CONST;
*/
typedef enum zathura_filemonitor_type_e {
ZATHURA_FILEMONITOR_GLIB, /**< Use filemonitor from GLib */
ZATHURA_FILEMONITOR_SIGNAL /**< Reload when receiving SIGHUP */
ZATHURA_FILEMONITOR_SIGNAL, /**< Reload when receiving SIGHUP */
ZATHURA_FILEMONITOR_NOOP /**< Monitor that does nothing */
} zathura_filemonitor_type_t;
/**
......
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.
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