Commit 78205781 authored by Sebastian Ramacher's avatar Sebastian Ramacher

Merge branch 'release/0.4.4'

parents f9adb25f 33042286
Copyright (c) 2009-2018 pwmt.org
Copyright (c) 2009-2019 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
......
......@@ -7,20 +7,32 @@ girara user interface library and several document libraries.
Requirements
------------
meson (>= 0.47)
gtk3 (>= 3.22)
glib (>= 2.50)
girara (>= 0.3.2)
sqlite3 (optional, >= 3.5.9)
check (optional build dependency, for tests)
libmagic from file(1) (optional, for mime-type detection)
libsynctex from TeXLive (optional, for SyncTeX support)
libseccomp (optional, for sandbox support)
librvsg-bin (optional build dependency, for icons)
Sphinx (optional build dependency, for manpages and HTML documentation)
doxygen (optional build dependency, for HTML documentation)
breathe (optional build dependency, for HTML documentation)
sphinx_rtd_theme (optional build dependency, for HTML documentation)
The following dependencies are required:
* gtk3 (>= 3.22)
* glib (>= 2.50)
* girara (>= 0.3.2)
The following dependencies are optional:
* sqlite3 (>= 3.6.23): splite3 database backend
* libmagic from file(1): for mime-type detection
* libsynctex from TeXLive (>= 1.19): SyncTeX support
* libseccomp: sandbox support
For building zathura, the following dependencies are also required:
* meson (>= 0.47)
* gettext
The following dependencies are optional build-time only dependencies:
* check: for tests
* librvsg-bin: PNG icons
* Sphinx: manpages and HTML documentation
* doxygen: HTML documentation
* breathe: for HTML documentation
* sphinx_rtd_theme: for HTML documentation
Note that Sphinx is needed to build the manpages. If it is not installed, the
man pages won't be built. For building the HTML documentation, doxygen, breathe
......
......@@ -5,10 +5,10 @@ _zathura() {
for PLUGIN in @PLUGINDIR@/lib*.so; do
case ${PLUGIN##*/} in
libpdf-poppler.so)
EXTS="$EXTS|pdf"
EXTS="$EXTS|pdf|PDF"
;;
libpdf-mupdf.so)
EXTS="$EXTS|pdf|epub|oxps"
EXTS="$EXTS|pdf|PDF|epub|oxps"
;;
libps.so)
EXTS="$EXTS|ps|eps|epsi|epsf"
......@@ -19,7 +19,7 @@ _zathura() {
libcb.so)
EXTS="$EXTS|cb7|cbr|cbz|cbt|rar|zip|7z|tar"
;;
esac
esac
done
_filedir "${EXTS#|}"
......
# Complete custom suffix based on libraries installed
function __fish_complete_zathura
for plugin in @PLUGINDIR@/*.so
switch (basename $plugin)
case libpdf-poppler.so
__fish_complete_suffix .pdf
case libpdf-mupdf.so
__fish_complete_suffix .pdf
__fish_complete_suffix .epub
__fish_complete_suffix .oxps
case libps.so
__fish_complete_suffix .ps
__fish_complete_suffix .eps
__fish_complete_suffix .epsi
__fish_complete_suffix .epsf
case libdjvu.so
__fish_complete_suffix .djvu
__fish_complete_suffix .djv
case libcb.so
__fish_complete_suffix .cb7
__fish_complete_suffix .cbr
__fish_complete_suffix .cbz
__fish_complete_suffix .cbt
__fish_complete_suffix .rar
__fish_complete_suffix .zip
__fish_complete_suffix .7z
__fish_complete_suffix .tar
end
end
end
complete -c zathura -x -a '(__fish_complete_zathura)'
complete -c zathura -s e -l reparent -d 'Reparents to window specified by xid'
complete -c zathura -s c -l config-dir -d 'Path to config directory' \
-x -a '(__fish_complete_directories (commandline -ct) "Config directory")'
complete -c zathura -s d -l data-dir -d 'Path to data directory' \
-x -a '(__fish_complete_directories (commandline -ct) "Data directory")'
complete -c zathura -l cache-dir -d 'Path to cache directory' \
-x -a '(__fish_complete_directories (commandline -ct) "Cache directory")'
complete -c zathura -s p -l plugins-dir -d 'Path to plugins directory' \
-x -a '(__fish_complete_directories (commandline -ct) "Plugins directory")'
complete -c zathura -s w -l password -d 'Document password'
complete -c zathura -s P -l page -d 'Page number to go to'
complete -c zathura -s l -l log-level -d 'Log level' -x -a 'debug info warning error'
complete -c zathura -s x -l synctex-editor-command -d 'Synctex editor (forwarded to the synctex command)' -x
complete -c zathura -l synctex-forward -d 'Move to given synctex position' -x
complete -c zathura -l synctex-pid -d 'Highlight position in given process' -x -a '(__fish_complete_pids)'
complete -c zathura -l mode -d 'Start in a non-default mode' -x -a 'presentation fullscreen'
complete -c zathura -l fork -d 'Fork into the background'
complete -c zathura -s h -l help -d 'Show help options'
complete -c zathura -s v -l version -d 'Print version information'
......@@ -64,6 +64,12 @@ zsh_completion = configure_file(
output: '_zathura',
configuration: conf_data
)
fish_completion = configure_file(
input: 'fish-completion.in',
output: 'zathura.fish',
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'))
install_data(zsh_completion, install_dir: join_paths(datadir, 'zsh', 'site-functions'))
install_data(fish_completion, install_dir: join_paths(datadir, 'fish', 'completions'))
......@@ -16,7 +16,7 @@ all_opts=(
'--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]'
'-v --version[Print version information]'
'*:file:->files'
)
......@@ -28,10 +28,10 @@ local exts
for PLUGIN in @PLUGINDIR@/lib*.so; do
case ${PLUGIN##*/} in
libpdf-poppler.so)
exts="$exts|pdf"
exts="$exts|pdf|PDF"
;;
libpdf-mupdf.so)
exts="$exts|pdf|epub|oxps"
exts="$exts|pdf|PDF|epub|oxps"
;;
libps.so)
exts="$exts|ps|eps|epsi|epsf"
......@@ -42,7 +42,7 @@ for PLUGIN in @PLUGINDIR@/lib*.so; do
libcb.so)
exts="$exts|cb7|cbr|cbz|cbt|rar|zip|7z|tar"
;;
esac
esac
done
case $state in
......
......@@ -35,6 +35,9 @@
Instead of looking for an instance having the correct file opened, try only
the instance with the given PID. Note that if the given PID does not have the
correct file open or does not exist, no new instance will be spanned.
--mode=mode
Start in a non-default mode
--fork
Fork into background
......
......@@ -62,16 +62,6 @@ accordingly or to escape the hash symbol.
set default-fg "#CCBBCC"
set default-fg \#CCBBCC
map - Mapping a shortcut
------------------------
It is possible to map or remap new key bindings to shortcut functions which
allows a high level of customization. The ``:map`` command can also be used in
the *zathurarc* file to make those changes permanent:
::
map [mode] <binding> <shortcut function> <argument>
include - Including another config file
---------------------------------------
This commands allows one to include other configuration files. If a relative
......@@ -82,6 +72,16 @@ is currently processed.
include another-config
map - Mapping a shortcut
------------------------
It is possible to map or remap new key bindings to shortcut functions which
allows a high level of customization. The ``:map`` command can also be used in
the *zathurarc* file to make those changes permanent:
::
map [mode] <binding> <shortcut function> <argument>
Mode
^^^^
The ``map`` command expects several arguments where only the ``binding`` as well as
......@@ -104,14 +104,14 @@ hand it is possible to just assign single letters, numbers or signs to it:
::
map a shortcut_function
map b shortcut_function
map c shortcut_function
map 1 shortcut_function
map 2 shortcut_function
map 3 shortcut_function
map ! shortcut_function
map ? shortcut_function
map a shortcut_function optional_argument
map b shortcut_function optional_argument
map c shortcut_function optional_argument
map 1 shortcut_function optional_argument
map 2 shortcut_function optional_argument
map 3 shortcut_function optional_argument
map ! shortcut_function optional_argument
map ? shortcut_function optional_argument
Using modifiers
^^^^^^^^^^^^^^^
......@@ -122,7 +122,8 @@ keyboard. It is possible to use the following modifiers:
* C - Control
* S - Shift
Now it is required to define the ``binding`` with the following structure:
If any of the modifiers should be used for a binding, it is required to define
the ``binding`` with the following structure:
::
......@@ -244,7 +245,8 @@ The following shortcut functions can be mapped:
* ``jumplist``
Move forwards/backwards in the jumplist.
Move forwards/backwards in the jumplist. Pass ``forward`` as argument to
move to the next entry and ``backward`` to move to the previous one.
* ``navigate``
......@@ -313,11 +315,19 @@ The following shortcut functions can be mapped:
Zoom in or out.
* ``mark_add``
Set a quickmark.
* ``mark_evaluate``
Go to a quickmark.
* ``feedkeys``
Simulate key presses. Note that all keys will be interpreted as if pressing a
key on the keyboard. To input uppercase letters, follow the same convention as
for key bindings, i.e. for ``X``, use ``<S-X>``.
Pass arguments
^^^^^^^^^^^^^^
......@@ -333,12 +343,14 @@ Possible arguments are:
* best-fit
* bottom
* backward
* collapse
* collapse-all
* default
* down
* expand
* expand-all
* forward
* full-down
* full-up
* half-down
......@@ -891,13 +903,6 @@ Defines if scrolling by half or full pages stops at page boundaries.
* Value type: Boolean
* Default value: false
smooth-scroll
^^^^^^^^^^^^^
Defines if scrolling via touchpad should be smooth.
* Value type: Boolean
* Default value: false
link-zoom
^^^^^^^^^
En/Disables the ability of changing zoom when following links.
......@@ -1055,7 +1060,7 @@ sandbox
Defines the sandbox mode to use for the seccomp syscall filter. Possible
values are "none", "normal" and "strict". If "none" is used, the sandbox
will be disabled. The use of "normal" will provide minimal protection and
allow normal use of seccomp with support for all features. The "strict" mode
allow normal use of zathura with support for all features. The "strict" mode
is a read only sandbox that is intended for viewing documents only.
* Value type: String
......@@ -1070,6 +1075,9 @@ Some features are disabled when using strict sandbox mode:
No feature regressions are expected when using normal sandbox mode.
When running under WSL, the default is "none" since seccomp is not supported in
that environment.
window-icon-document
^^^^^^^^^^^^^^^^^^^^
Defines whether the window document should be updated based on the first page of
......
project('zathura', 'c',
version: '0.4.3',
version: '0.4.4',
meson_version: '>=0.47',
default_options: 'c_std=c11',
)
......@@ -37,7 +37,7 @@ plugindir = join_paths(get_option('libdir'), 'zathura')
# required dependencies
libm = cc.find_library('m', required: false)
girara = dependency('girara-gtk3', version: '>=0.3.2')
girara = dependency('girara-gtk3', version: '>=0.3.3')
glib = dependency('glib-2.0', version: '>=2.50')
gio = dependency('gio-unix-2.0', required: host_machine.system() != 'windows')
gthread = dependency('gthread-2.0', version: '>=2.50')
......@@ -68,8 +68,8 @@ flags = cc.get_supported_arguments(flags)
# optional dependencies
additional_sources = []
sqlite = dependency('sqlite3', version: '>=3.5.9', required: get_option('sqlite'))
synctex = dependency('synctex', required: get_option('synctex'))
sqlite = dependency('sqlite3', version: '>=3.6.23', required: get_option('sqlite'))
synctex = dependency('synctex', version: '>=1.19', required: get_option('synctex'))
magic = cc.find_library('magic', required: get_option('magic'))
seccomp = dependency('libseccomp', required: get_option('seccomp'))
......@@ -82,12 +82,8 @@ endif
if synctex.found()
build_dependencies += synctex
defines += '-DWITH_SYNCTEX'
if synctex.version() < '2.0.0'
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
if synctex.version() < '2.0.0' and 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.')
endif
endif
......
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.
This diff is collapsed.
This diff is collapsed.
......@@ -256,15 +256,17 @@ cb_widget_screen_changed(GtkWidget* widget, GdkScreen* previous_screen, gpointer
zathura_update_view_ppi(zathura);
}
void
gboolean
cb_widget_configured(GtkWidget* UNUSED(widget), GdkEvent* UNUSED(event), gpointer data)
{
zathura_t* zathura = data;
if (zathura == NULL) {
return;
return false;
}
zathura_update_view_ppi(zathura);
return false;
}
void
......@@ -292,7 +294,7 @@ cb_scale_factor(GObject* object, GParamSpec* UNUSED(pspec), gpointer data)
}
void
cb_page_layout_value_changed(girara_session_t* session, const char* name, girara_setting_type_t UNUSED(type), void* value, void* UNUSED(data))
cb_page_layout_value_changed(girara_session_t* session, const char* name, girara_setting_type_t UNUSED(type), const void* value, void* UNUSED(data))
{
g_return_if_fail(value != NULL);
g_return_if_fail(session != NULL);
......@@ -301,7 +303,7 @@ cb_page_layout_value_changed(girara_session_t* session, const char* name, girara
/* pages-per-row must not be 0 */
if (g_strcmp0(name, "pages-per-row") == 0) {
unsigned int pages_per_row = *((unsigned int*) value);
unsigned int pages_per_row = *((const unsigned int*) value);
if (pages_per_row == 0) {
pages_per_row = 1;
girara_setting_set(session, name, &pages_per_row);
......@@ -557,7 +559,7 @@ cb_view_resized(GtkWidget* UNUSED(widget), GtkAllocation* UNUSED(allocation), za
void
cb_setting_recolor_change(girara_session_t* session, const char* name,
girara_setting_type_t UNUSED(type), void* value, void* UNUSED(data))
girara_setting_type_t UNUSED(type), const void* value, void* UNUSED(data))
{
g_return_if_fail(value != NULL);
g_return_if_fail(session != NULL);
......@@ -565,7 +567,7 @@ cb_setting_recolor_change(girara_session_t* session, const char* name,
g_return_if_fail(name != NULL);
zathura_t* zathura = session->global.data;
const bool bool_value = *((bool*) value);
const bool bool_value = *((const bool*) value);
if (zathura->sync.render_thread != NULL && zathura_renderer_recolor_enabled(zathura->sync.render_thread) != bool_value) {
zathura_renderer_enable_recolor(zathura->sync.render_thread, bool_value);
......@@ -575,7 +577,7 @@ cb_setting_recolor_change(girara_session_t* session, const char* name,
void
cb_setting_recolor_keep_hue_change(girara_session_t* session, const char* name,
girara_setting_type_t UNUSED(type), void* value, void* UNUSED(data))
girara_setting_type_t UNUSED(type), const void* value, void* UNUSED(data))
{
g_return_if_fail(value != NULL);
g_return_if_fail(session != NULL);
......@@ -583,7 +585,7 @@ cb_setting_recolor_keep_hue_change(girara_session_t* session, const char* name,
g_return_if_fail(name != NULL);
zathura_t* zathura = session->global.data;
const bool bool_value = *((bool*) value);
const bool bool_value = *((const bool*) value);
if (zathura->sync.render_thread != NULL && zathura_renderer_recolor_hue_enabled(zathura->sync.render_thread) != bool_value) {
zathura_renderer_enable_recolor_hue(zathura->sync.render_thread, bool_value);
......@@ -593,7 +595,7 @@ cb_setting_recolor_keep_hue_change(girara_session_t* session, const char* name,
void
cb_setting_recolor_keep_reverse_video_change(girara_session_t* session, const char* name,
girara_setting_type_t UNUSED(type), void* value, void* UNUSED(data))
girara_setting_type_t UNUSED(type), const void* value, void* UNUSED(data))
{
g_return_if_fail(value != NULL);
g_return_if_fail(session != NULL);
......@@ -601,7 +603,7 @@ cb_setting_recolor_keep_reverse_video_change(girara_session_t* session, const ch
g_return_if_fail(name != NULL);
zathura_t* zathura = session->global.data;
const bool bool_value = *((bool*) value);
const bool bool_value = *((const bool*) value);
if (zathura->sync.render_thread != NULL && zathura_renderer_recolor_reverse_video_enabled(zathura->sync.render_thread) != bool_value) {
zathura_renderer_enable_recolor_reverse_video(zathura->sync.render_thread, bool_value);
......
......@@ -116,8 +116,9 @@ void cb_widget_screen_changed(GtkWidget* widget, GdkScreen* previous_screen, gpo
* @param widget The main window widget
* @param event The configure event
* @param gpointer The zathura instance
* @return true if no error occurred and the event has been handled
*/
void cb_widget_configured(GtkWidget* widget, GdkEvent* event, gpointer data);
gboolean cb_widget_configured(GtkWidget* widget, GdkEvent* event, gpointer data);
/**
* This function gets called when the view widget scale factor changes (e.g.
......@@ -142,7 +143,7 @@ void cb_scale_factor(GObject* object, GParamSpec* pspec, gpointer data);
* @param data Custom data
*/
void cb_page_layout_value_changed(girara_session_t* session, const char* name,
girara_setting_type_t type, void* value, void* data);
girara_setting_type_t type, const void* value, void* data);
/**
* Called when an index element is activated (e.g.: double click)
......@@ -210,7 +211,7 @@ gboolean cb_view_resized(GtkWidget* widget, GtkAllocation* allocation, zathura_t
* @param data Custom data
*/
void cb_setting_recolor_change(girara_session_t* session, const char* name,
girara_setting_type_t type, void* value, void* data);
girara_setting_type_t type, const void* value, void* data);
/**
* Emitted when the 'recolor-keephue' setting is changed
......@@ -222,7 +223,7 @@ void cb_setting_recolor_change(girara_session_t* session, const char* name,
* @param data Custom data
*/
void cb_setting_recolor_keep_hue_change(girara_session_t* session, const char* name,
girara_setting_type_t type, void* value, void* data);
girara_setting_type_t type, const void* value, void* data);
/**
* Emitted when the 'recolor-reverse-video' setting is changed
......@@ -234,7 +235,7 @@ void cb_setting_recolor_keep_hue_change(girara_session_t* session, const char* n
* @param data Custom data
*/
void cb_setting_recolor_keep_reverse_video_change(girara_session_t* session,
const char* name, girara_setting_type_t type, void* value, void* data);
const char* name, girara_setting_type_t type, const void* value, void* data);
/**
* Unknown command handler which is used to handle the strict numeric goto
......
This diff is collapsed.
This diff is collapsed.
......@@ -32,7 +32,7 @@ zathura_content_type_new(void)
#ifdef WITH_MAGIC
/* creat magic cookie */
const int flags =
static const int flags =
MAGIC_MIME_TYPE |
MAGIC_SYMLINK |
MAGIC_NO_CHECK_APPTYPE |
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -88,7 +88,7 @@ run_synctex_forward(const char* synctex_fwd, const char* filename,
static zathura_t*
init_zathura(const char* config_dir, const char* data_dir,
const char* cache_dir, const char* plugin_path, char** argv,
char* synctex_editor, Window embed)
const char* synctex_editor, Window embed)
{
/* create zathura session */
zathura_t* zathura = zathura_create();
......
......@@ -1123,11 +1123,7 @@ zathura_page_widget_popup_menu(GtkWidget* widget, GdkEventButton* event)
/* attach and popup */
gtk_menu_attach_to_widget(GTK_MENU(menu), widget, NULL);
#if GTK_CHECK_VERSION(3, 22, 0)
gtk_menu_popup_at_pointer(GTK_MENU(menu), (GdkEvent*) event);
#else
gtk_menu_popup(GTK_MENU(menu), NULL, NULL, NULL, NULL, event->button, event->time);
#endif
}
static gboolean
......
......@@ -16,14 +16,6 @@
#include "adjustment.h"
#ifdef WITH_SYNCTEX
#ifdef WITH_SYNCTEX1
typedef synctex_scanner_t synctex_scanner_p;
typedef synctex_node_t synctex_node_p;
#define synctex_scanner_next_result(scanner) synctex_next_result(scanner)
#define synctex_display_query(scanner, file, line, column, page) synctex_display_query(scanner, file, line, column)
#endif
bool
synctex_get_input_line_column(const char* filename, unsigned int page, int x, int y,
char** input_file, unsigned int* line, unsigned int* column)
......
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