Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
zathura
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Packages
Packages
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
David Levner
zathura
Commits
68eaadf1
Commit
68eaadf1
authored
May 20, 2018
by
Sebastian Ramacher
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'release/0.4.0'
parents
df34d8f1
6efed001
Changes
19
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
135 additions
and
151 deletions
+135
-151
AUTHORS
AUTHORS
+1
-0
data/meson.build
data/meson.build
+1
-1
doc/man/zathurarc.5.rst
doc/man/zathurarc.5.rst
+2
-0
meson.build
meson.build
+7
-3
po/de.po
po/de.po
+7
-2
tests/meson.build
tests/meson.build
+3
-1
zathura/database-plain.h
zathura/database-plain.h
+1
-1
zathura/database-sqlite.c
zathura/database-sqlite.c
+1
-1
zathura/database-sqlite.h
zathura/database-sqlite.h
+1
-1
zathura/database.h
zathura/database.h
+1
-1
zathura/document.c
zathura/document.c
+1
-1
zathura/plugin.c
zathura/plugin.c
+1
-1
zathura/print.c
zathura/print.c
+45
-72
zathura/render.c
zathura/render.c
+26
-45
zathura/seccomp-filters.c
zathura/seccomp-filters.c
+1
-0
zathura/shortcuts.c
zathura/shortcuts.c
+6
-6
zathura/synctex.c
zathura/synctex.c
+17
-9
zathura/utils.c
zathura/utils.c
+9
-2
zathura/zathura.c
zathura/zathura.c
+4
-4
No files found.
AUTHORS
View file @
68eaadf1
...
...
@@ -28,3 +28,4 @@ oblique
Maxime Chéramy <maxime.cheramy@gmail.com>
Alexander Shabalin <shabalyn.a@gmail.com>
Lingzhu Xiang <lingzhu@lingzhuxiang.com>
Jeremie Knuesel
data/meson.build
View file @
68eaadf1
...
...
@@ -7,7 +7,7 @@ zathura_resources = gnome.compile_resources(
)
install_data('org.pwmt.zathura.xml', install_dir: dbusinterfacesdir)
install_data('org.pwmt.zathura.png', install_dir: join_paths(datadir, 'icons', 'hicolor', '128x128'))
install_data('org.pwmt.zathura.png', install_dir: join_paths(datadir, 'icons', 'hicolor', '128x128'
, 'apps'
))
i18n = import('i18n')
podir = join_paths(meson.source_root(), 'po')
...
...
doc/man/zathurarc.5.rst
View file @
68eaadf1
...
...
@@ -324,6 +324,8 @@ Pass arguments
Some shortcut function require or have optional arguments which influence the
behaviour of them. Those can be passed as the last argument:
::
map <C-i> zoom in
map <C-o> zoom out
...
...
meson.build
View file @
68eaadf1
project('zathura', 'c',
version: '0.
3.9
',
version: '0.
4.0
',
meson_version: '>=0.45',
default_options: 'c_std=c11',
)
...
...
@@ -36,15 +36,16 @@ dbusinterfacesdir = join_paths(datadir, 'dbus-1', 'interfaces')
plugindir = join_paths(get_option('libdir'), 'zathura')
# required dependencies
libm = cc.find_library('libm')
libm = cc.find_library('libm'
, required: false
)
girara = dependency('girara-gtk3', version: '>=0.2.9')
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')
gmodule = dependency('gmodule-no-export-2.0', version: '>=2.50')
gtk3 = dependency('gtk+-3.0', version: '>=3.22')
cairo = dependency('cairo')
build_dependencies = [libm, girara, glib, gthread, gmodule, gtk3, cairo]
build_dependencies = [libm, girara, glib, g
io, g
thread, gmodule, gtk3, cairo]
# defines
defines = [
...
...
@@ -81,6 +82,9 @@ endif
if get_option('enable-synctex') and synctex.found()
build_dependencies += synctex
defines += '-DWITH_SYNCTEX'
if synctex.version() < '2.0.0'
defines += '-DWITH_SYNCTEX1'
endif
endif
if get_option('enable-magic') and magic.found()
...
...
po/de.po
View file @
68eaadf1
...
...
@@ -9,7 +9,7 @@ msgstr ""
"Project-Id-Version: zathura\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-03-16 01:11+0100\n"
"PO-Revision-Date: 2018-03-1
6 01:1
1+0100\n"
"PO-Revision-Date: 2018-03-1
8 17:2
1+0100\n"
"Last-Translator: Sebastian Ramacher <sebastian+dev@ramacher.at>\n"
"Language-Team: German (http://www.transifex.com/pwmt/zathura/language/de/)\n"
"Language: de\n"
...
...
@@ -17,6 +17,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 2.0.6\n"
#: data/org.pwmt.zathura.appdata.xml.in:7 data/org.pwmt.zathura.desktop.in:5
msgid "Zathura"
...
...
@@ -33,10 +34,14 @@ msgid ""
"mainly focuses on keyboard interaction. Zathura makes it possible to "
"completely view and navigate through documents without using a mouse."
msgstr ""
"Zathura ist ein anpassbarer und funktionaler Dokumentenbetrachter. Er bietet "
"eine minimalistische und platzsparende Oberfläche und Verwendung ist auf "
"Tastaturinteraktionen fokussiert. Zathura ermöglicht es ein Dokument "
"gänzlich ohne der Verwendung einer Maus zu betrachten."
#: data/org.pwmt.zathura.appdata.xml.in:21
msgid "SyncTeX forward and backward synchronization support."
msgstr "Unterstützung für SyncTeX-Synchronisation"
msgstr "Unterstützung für SyncTeX-Synchronisation
.
"
#: data/org.pwmt.zathura.appdata.xml.in:22
msgid "Quickmarks and bookmarks."
...
...
tests/meson.build
View file @
68eaadf1
...
...
@@ -20,5 +20,7 @@ if check.found()
c_args: defines + flags
)
test('tests', tests)
test('tests', tests,
timeout: 60*60
)
endif
zathura/database-plain.h
View file @
68eaadf1
...
...
@@ -6,7 +6,7 @@
#include "database.h"
#define ZATHURA_TYPE_PLAINDATABASE \
(zathura_plaindatabase_get_type
())
(zathura_plaindatabase_get_type())
#define ZATHURA_PLAINDATABASE(obj) \
(G_TYPE_CHECK_INSTANCE_CAST ((obj), ZATHURA_TYPE_PLAINDATABASE, ZathuraPlainDatabase))
#define ZATHURA_IS_PLAINDATABASE(obj) \
...
...
zathura/database-sqlite.c
View file @
68eaadf1
...
...
@@ -138,7 +138,7 @@ sqlite_db_init(ZathuraSQLDatabase* db, const char* path)
"vadj_ratio FLOAT,"
"PRIMARY KEY(file, id));"
;
/* ceate jumplist table */
/* c
r
eate jumplist table */
static
const
char
SQL_JUMPLIST_INIT
[]
=
"CREATE TABLE IF NOT EXISTS jumplist ("
"id INTEGER PRIMARY KEY AUTOINCREMENT,"
...
...
zathura/database-sqlite.h
View file @
68eaadf1
...
...
@@ -6,7 +6,7 @@
#include "database.h"
#define ZATHURA_TYPE_SQLDATABASE \
(zathura_sqldatabase_get_type
())
(zathura_sqldatabase_get_type())
#define ZATHURA_SQLDATABASE(obj) \
(G_TYPE_CHECK_INSTANCE_CAST ((obj), ZATHURA_TYPE_SQLDATABASE, ZathuraSQLDatabase))
#define ZATHURA_IS_SQLDATABASE(obj) \
...
...
zathura/database.h
View file @
68eaadf1
...
...
@@ -21,7 +21,7 @@ typedef struct zathura_fileinfo_s {
}
zathura_fileinfo_t
;
#define ZATHURA_TYPE_DATABASE \
(zathura_database_get_type
())
(zathura_database_get_type())
#define ZATHURA_DATABASE(obj) \
(G_TYPE_CHECK_INSTANCE_CAST ((obj), ZATHURA_TYPE_DATABASE, ZathuraDatabase))
#define ZATHURA_IS_DATABASE(obj) \
...
...
zathura/document.c
View file @
68eaadf1
...
...
@@ -549,7 +549,7 @@ zathura_document_set_device_factors(zathura_document_t* document,
return
;
}
if
(
fabs
(
x_factor
)
<
DBL_EPSILON
||
fabs
(
y_factor
)
<
DBL_EPSILON
)
{
girara_debug
(
"Ignoring new device factors %
f and %
f: too small"
,
girara_debug
(
"Ignoring new device factors %
0.2f and %0.2
f: too small"
,
x_factor
,
y_factor
);
return
;
}
...
...
zathura/plugin.c
View file @
68eaadf1
...
...
@@ -269,7 +269,7 @@ register_plugin(zathura_plugin_manager_t* plugin_manager, zathura_plugin_t* plug
if
(
plugin_mapping_new
(
plugin_manager
,
type
,
plugin
)
==
false
)
{
girara_error
(
"plugin: filetype already registered: %s"
,
type
);
}
else
{
girara_debug
(
"plugin: filetype mapping add
d
ed: %s"
,
type
);
girara_debug
(
"plugin: filetype mapping added: %s"
,
type
);
at_least_one
=
true
;
}
);
...
...
zathura/print.c
View file @
68eaadf1
...
...
@@ -10,65 +10,6 @@
#include <girara/session.h>
#include <glib/gi18n.h>
static
void
cb_print_draw_page
(
GtkPrintOperation
*
print_operation
,
GtkPrintContext
*
context
,
gint
page_number
,
zathura_t
*
zathura
);
static
void
cb_print_end
(
GtkPrintOperation
*
print_operation
,
GtkPrintContext
*
context
,
zathura_t
*
zathura
);
static
void
cb_print_request_page_setup
(
GtkPrintOperation
*
print_operation
,
GtkPrintContext
*
context
,
gint
page_number
,
GtkPageSetup
*
setup
,
zathura_t
*
zathura
);
static
void
cb_print_done
(
GtkPrintOperation
*
operation
,
GtkPrintOperationResult
result
,
zathura_t
*
zathura
);
void
print
(
zathura_t
*
zathura
)
{
g_return_if_fail
(
zathura
!=
NULL
);
g_return_if_fail
(
zathura
->
document
!=
NULL
);
GtkPrintOperation
*
print_operation
=
gtk_print_operation_new
();
/* print operation settings */
gtk_print_operation_set_job_name
(
print_operation
,
zathura_document_get_path
(
zathura
->
document
));
gtk_print_operation_set_allow_async
(
print_operation
,
TRUE
);
gtk_print_operation_set_n_pages
(
print_operation
,
zathura_document_get_number_of_pages
(
zathura
->
document
));
gtk_print_operation_set_current_page
(
print_operation
,
zathura_document_get_current_page_number
(
zathura
->
document
));
gtk_print_operation_set_use_full_page
(
print_operation
,
TRUE
);
if
(
zathura
->
print
.
settings
!=
NULL
)
{
gtk_print_operation_set_print_settings
(
print_operation
,
zathura
->
print
.
settings
);
}
if
(
zathura
->
print
.
page_setup
!=
NULL
)
{
gtk_print_operation_set_default_page_setup
(
print_operation
,
zathura
->
print
.
page_setup
);
}
gtk_print_operation_set_embed_page_setup
(
print_operation
,
TRUE
);
/* print operation signals */
g_signal_connect
(
print_operation
,
"draw-page"
,
G_CALLBACK
(
cb_print_draw_page
),
zathura
);
g_signal_connect
(
print_operation
,
"end-print"
,
G_CALLBACK
(
cb_print_end
),
zathura
);
g_signal_connect
(
print_operation
,
"request-page-setup"
,
G_CALLBACK
(
cb_print_request_page_setup
),
zathura
);
g_signal_connect
(
print_operation
,
"done"
,
G_CALLBACK
(
cb_print_done
),
zathura
);
/* print */
GError
*
error
=
NULL
;
GtkPrintOperationResult
result
=
gtk_print_operation_run
(
print_operation
,
GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG
,
NULL
,
&
error
);
if
(
result
==
GTK_PRINT_OPERATION_RESULT_ERROR
)
{
girara_notify
(
zathura
->
ui
.
session
,
GIRARA_ERROR
,
_
(
"Printing failed: %s"
),
error
->
message
);
g_error_free
(
error
);
}
g_object_unref
(
print_operation
);
}
static
void
cb_print_end
(
GtkPrintOperation
*
UNUSED
(
print_operation
),
GtkPrintContext
*
UNUSED
(
context
),
zathura_t
*
zathura
)
...
...
@@ -210,23 +151,55 @@ cb_print_request_page_setup(GtkPrintOperation* UNUSED(print_operation),
}
}
static
void
cb_print_done
(
GtkPrintOperation
*
operation
,
GtkPrintOperationResult
result
,
zathura_t
*
zathura
)
void
print
(
zathura_t
*
zathura
)
{
if
(
result
==
GTK_PRINT_OPERATION_RESULT_APPLY
)
{
g_clear_object
(
&
zathura
->
print
.
settings
);
g_clear_object
(
&
zathura
->
print
.
page_setup
);
g_return_if_fail
(
zathura
!=
NULL
);
g_return_if_fail
(
zathura
->
document
!=
NULL
);
/* save previous settings */
zathura
->
print
.
settings
=
g_object_ref
(
gtk_print_operation_get_print_settings
(
operation
));
zathura
->
print
.
page_setup
=
g_object_ref
(
gtk_print_operation_get_default_page_setup
(
operation
));
}
else
if
(
result
==
GTK_PRINT_OPERATION_RESULT_ERROR
)
{
GError
*
error
=
NULL
;
gtk_print_operation_get_error
(
operation
,
&
error
);
GtkPrintOperation
*
print_operation
=
gtk_print_operation_new
();
/* print operation settings */
gtk_print_operation_set_job_name
(
print_operation
,
zathura_document_get_path
(
zathura
->
document
));
gtk_print_operation_set_allow_async
(
print_operation
,
TRUE
);
gtk_print_operation_set_n_pages
(
print_operation
,
zathura_document_get_number_of_pages
(
zathura
->
document
));
gtk_print_operation_set_current_page
(
print_operation
,
zathura_document_get_current_page_number
(
zathura
->
document
));
gtk_print_operation_set_use_full_page
(
print_operation
,
TRUE
);
if
(
zathura
->
print
.
settings
!=
NULL
)
{
gtk_print_operation_set_print_settings
(
print_operation
,
zathura
->
print
.
settings
);
}
if
(
zathura
->
print
.
page_setup
!=
NULL
)
{
gtk_print_operation_set_default_page_setup
(
print_operation
,
zathura
->
print
.
page_setup
);
}
gtk_print_operation_set_embed_page_setup
(
print_operation
,
TRUE
);
/* print operation signals */
g_signal_connect
(
print_operation
,
"draw-page"
,
G_CALLBACK
(
cb_print_draw_page
),
zathura
);
g_signal_connect
(
print_operation
,
"end-print"
,
G_CALLBACK
(
cb_print_end
),
zathura
);
g_signal_connect
(
print_operation
,
"request-page-setup"
,
G_CALLBACK
(
cb_print_request_page_setup
),
zathura
);
/* print */
GError
*
error
=
NULL
;
GtkPrintOperationResult
result
=
gtk_print_operation_run
(
print_operation
,
GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG
,
GTK_WINDOW
(
zathura
->
ui
.
session
->
gtk
.
window
),
&
error
);
if
(
result
==
GTK_PRINT_OPERATION_RESULT_ERROR
)
{
girara_notify
(
zathura
->
ui
.
session
,
GIRARA_ERROR
,
_
(
"Printing failed: %s"
),
error
->
message
);
g_error_free
(
error
);
}
else
if
(
result
==
GTK_PRINT_OPERATION_RESULT_APPLY
)
{
g_clear_object
(
&
zathura
->
print
.
settings
);
g_clear_object
(
&
zathura
->
print
.
page_setup
);
/* save previous settings */
zathura
->
print
.
settings
=
g_object_ref
(
gtk_print_operation_get_print_settings
(
print_operation
));
zathura
->
print
.
page_setup
=
g_object_ref
(
gtk_print_operation_get_default_page_setup
(
print_operation
));
}
}
g_object_unref
(
print_operation
);
}
zathura/render.c
View file @
68eaadf1
...
...
@@ -541,36 +541,22 @@ emit_completed_signal(void* data)
Assumes that l is in the interval l1, l2 and corrects the value to
force u=0 on l1 and l2 */
static
double
colorumax
(
const
double
*
h
,
double
l
,
double
l1
,
double
l2
)
colorumax
(
const
double
h
[
3
]
,
double
l
,
double
l1
,
double
l2
)
{
if
(
h
[
0
]
==
0
&&
h
[
1
]
==
0
&&
h
[
2
]
==
0
)
{
if
(
fabs
(
h
[
0
])
<=
DBL_EPSILON
&&
fabs
(
h
[
1
])
<=
DBL_EPSILON
&&
fabs
(
h
[
2
])
<=
DBL_EPSILON
)
{
return
0
;
}
const
double
lv
=
(
l
-
l1
)
/
(
l2
-
l1
);
/* Remap l to the whole interval 0,1 */
double
u
=
1000000
;
double
v
=
u
;
for
(
int
k
=
0
;
k
<
3
;
k
++
)
{
if
(
h
[
k
]
>
0
)
{
const
double
uu
=
fabs
((
1
-
l
)
/
h
[
k
]);
const
double
vv
=
fabs
((
1
-
lv
)
/
h
[
k
]);
if
(
uu
<
u
)
{
u
=
uu
;
}
if
(
vv
<
v
)
{
v
=
vv
;
}
}
else
if
(
h
[
k
]
<
0
)
{
const
double
uu
=
fabs
(
l
/
h
[
k
]);
const
double
vv
=
fabs
(
lv
/
h
[
k
]);
if
(
uu
<
u
)
{
u
=
uu
;
}
if
(
vv
<
v
)
{
v
=
vv
;
}
const
double
lv
=
(
l
-
l1
)
/
(
l2
-
l1
);
/* Remap l to the whole interval [0,1] */
double
u
=
DBL_MAX
;
double
v
=
DBL_MAX
;
for
(
unsigned
int
k
=
0
;
k
<
3
;
++
k
)
{
if
(
h
[
k
]
>
DBL_EPSILON
)
{
u
=
fmin
(
fabs
((
1
-
l
)
/
h
[
k
]),
u
);
v
=
fmin
(
fabs
((
1
-
lv
)
/
h
[
k
]),
v
);
}
else
if
(
h
[
k
]
<
-
DBL_EPSILON
)
{
u
=
fmin
(
fabs
(
l
/
h
[
k
]),
u
);
v
=
fmin
(
fabs
(
lv
/
h
[
k
]),
v
);
}
}
...
...
@@ -595,7 +581,7 @@ recolor(private_t* priv, zathura_page_t* page, unsigned int page_width,
/* TODO: split handling of image handling off
* Ideally we would create a mask surface for the location of the images and
* we would blit the
the
recolored and unmodified surfaces together to get the
* we would blit the recolored and unmodified surfaces together to get the
* same effect.
*/
...
...
@@ -607,8 +593,9 @@ recolor(private_t* priv, zathura_page_t* page, unsigned int page_width,
/* RGB weights for computing lightness. Must sum to one */
static
const
double
a
[]
=
{
0
.
30
,
0
.
59
,
0
.
11
};
#define rgb1 priv->recolor.dark
#define rgb2 priv->recolor.light
const
GdkRGBA
rgb1
=
priv
->
recolor
.
dark
;
const
GdkRGBA
rgb2
=
priv
->
recolor
.
light
;
const
double
l1
=
a
[
0
]
*
rgb1
.
red
+
a
[
1
]
*
rgb1
.
green
+
a
[
2
]
*
rgb1
.
blue
;
const
double
l2
=
a
[
0
]
*
rgb2
.
red
+
a
[
1
]
*
rgb2
.
green
+
a
[
2
]
*
rgb2
.
blue
;
...
...
@@ -630,7 +617,7 @@ recolor(private_t* priv, zathura_page_t* page, unsigned int page_width,
rectangles
=
girara_list_new
();
if
(
rectangles
==
NULL
)
{
found_images
=
false
;
girara_warning
(
"Failed to retrieve images.
\n
"
);
girara_warning
(
"Failed to retrieve images."
);
}
if
(
found_images
==
true
)
{
...
...
@@ -687,20 +674,17 @@ recolor(private_t* priv, zathura_page_t* page, unsigned int page_width,
/* u is the maximum possible saturation for given h and l. s is a
* rescaled saturation between 0 and 1 */
double
u
=
colorumax
(
h
,
l
,
0
,
1
);
double
s
=
0
;
if
(
u
!=
0
)
{
s
=
1
/
u
;
}
const
double
u
=
colorumax
(
h
,
l
,
0
,
1
);
const
double
s
=
fabs
(
u
)
>
DBL_EPSILON
?
1
.
0
/
u
:
0
.
0
;
/* Interpolates lightness between light and dark colors. white goes to
* light, and black goes to dark. */
l
=
l
*
(
l2
-
l1
)
+
l1
;
u
=
colorumax
(
h
,
l
,
l1
,
l2
);
data
[
2
]
=
(
unsigned
char
)
round
(
255
.
*
(
l
+
s
*
u
*
h
[
0
]));
data
[
1
]
=
(
unsigned
char
)
round
(
255
.
*
(
l
+
s
*
u
*
h
[
1
]));
data
[
0
]
=
(
unsigned
char
)
round
(
255
.
*
(
l
+
s
*
u
*
h
[
2
]));
const
double
su
=
s
*
colorumax
(
h
,
l
,
l1
,
l2
);
data
[
2
]
=
(
unsigned
char
)
round
(
255
.
*
(
l
+
su
*
h
[
0
]));
data
[
1
]
=
(
unsigned
char
)
round
(
255
.
*
(
l
+
su
*
h
[
1
]));
data
[
0
]
=
(
unsigned
char
)
round
(
255
.
*
(
l
+
su
*
h
[
2
]));
}
else
{
/* linear interpolation between dark and light with color ligtness as
* a parameter */
...
...
@@ -719,9 +703,6 @@ recolor(private_t* priv, zathura_page_t* page, unsigned int page_width,
}
cairo_surface_mark_dirty
(
surface
);
#undef rgb1
#undef rgb2
}
static
bool
...
...
@@ -747,7 +728,7 @@ render(render_job_t* job, ZathuraRenderRequest* request, ZathuraRenderer* render
&
page_height
,
&
page_width
,
false
);
zathura_device_factors_t
device_factors
=
zathura_document_get_device_factors
(
document
);
const
zathura_device_factors_t
device_factors
=
zathura_document_get_device_factors
(
document
);
page_width
*=
device_factors
.
x
;
page_height
*=
device_factors
.
y
;
...
...
@@ -866,7 +847,7 @@ render_all(zathura_t* zathura)
const
double
width
=
zathura_page_get_width
(
page
);
page_calc_height_width
(
zathura
->
document
,
height
,
width
,
&
page_height
,
&
page_width
,
true
);
girara_debug
(
"Queuing resize for page %u to %u x %u (%
f x %
f)."
,
page_id
,
page_width
,
page_height
,
width
,
height
);
girara_debug
(
"Queuing resize for page %u to %u x %u (%
0.2f x %0.2
f)."
,
page_id
,
page_width
,
page_height
,
width
,
height
);
GtkWidget
*
widget
=
zathura_page_get_widget
(
zathura
,
page
);
if
(
widget
!=
NULL
)
{
gtk_widget_set_size_request
(
widget
,
page_width
,
page_height
);
...
...
@@ -892,7 +873,7 @@ render_thread_sort(gconstpointer a, gconstpointer b, gpointer UNUSED(data))
(
priv_a
->
last_view_time
>
priv_b
->
last_view_time
?
1
:
0
);
}
/* sort aborted entries earlier so that the are thrown out of the queue */
/* sort aborted entries earlier so that the
y
are thrown out of the queue */
return
job_a
->
aborted
?
1
:
-
1
;
}
...
...
zathura/seccomp-filters.c
View file @
68eaadf1
...
...
@@ -155,6 +155,7 @@ seccomp_enable_strict_filter(void)
ALLOW_RULE
(
getresgid
);
ALLOW_RULE
(
getresuid
);
ALLOW_RULE
(
getrlimit
);
ALLOW_RULE
(
getpeername
);
/* ALLOW_RULE (getsockname); */
/* ALLOW_RULE (getsockopt); needed for access to x11 socket in network namespace (without abstract sockets) */
ALLOW_RULE
(
inotify_add_watch
);
...
...
zathura/shortcuts.c
View file @
68eaadf1
...
...
@@ -1383,22 +1383,22 @@ sc_zoom(girara_session_t* session, girara_argument_t* argument, girara_event_t*
/* specify new zoom value */
if
(
argument
->
n
==
ZOOM_IN
)
{
girara_debug
(
"Increasing zoom by %f."
,
zoom_step
-
1
.
0
);
girara_debug
(
"Increasing zoom by %
0.2
f."
,
zoom_step
-
1
.
0
);
zathura_document_set_zoom
(
zathura
->
document
,
old_zoom
*
zoom_step
);
}
else
if
(
argument
->
n
==
ZOOM_OUT
)
{
girara_debug
(
"Decreasing zoom by %f."
,
zoom_step
-
1
.
0
);
girara_debug
(
"Decreasing zoom by %
0.2
f."
,
zoom_step
-
1
.
0
);
zathura_document_set_zoom
(
zathura
->
document
,
old_zoom
/
zoom_step
);
}
else
if
(
argument
->
n
==
ZOOM_SPECIFIC
)
{
if
(
t
==
0
)
{
girara_debug
(
"Setting zoom to 1."
);
zathura_document_set_zoom
(
zathura
->
document
,
1
.
0
);
}
else
{
girara_debug
(
"Setting zoom to %f."
,
t
/
100
.
0
);
girara_debug
(
"Setting zoom to %
0.2
f."
,
t
/
100
.
0
);
zathura_document_set_zoom
(
zathura
->
document
,
t
/
100
.
0
);
}
}
else
if
(
argument
->
n
==
ZOOM_SMOOTH
)
{
const
double
dy
=
(
event
!=
NULL
)
?
event
->
y
:
1
.
0
;
girara_debug
(
"Increasing zoom by %f."
,
zoom_step
*
dy
-
1
.
0
);
girara_debug
(
"Increasing zoom by %
0.2
f."
,
zoom_step
*
dy
-
1
.
0
);
zathura_document_set_zoom
(
zathura
->
document
,
old_zoom
+
zoom_step
*
dy
);
}
else
{
girara_debug
(
"Setting zoom to 1."
);
...
...
@@ -1411,11 +1411,11 @@ sc_zoom(girara_session_t* session, girara_argument_t* argument, girara_event_t*
const
double
new_zoom
=
zathura_document_get_zoom
(
zathura
->
document
);
if
(
fabs
(
new_zoom
-
old_zoom
)
<=
DBL_EPSILON
)
{
girara_debug
(
"New and old zoom level are too close: %
f vs. %f, diff = %f"
,
new_zoom
,
old_zoom
,
fabs
(
new_zoom
-
old_zoom
)
);
girara_debug
(
"New and old zoom level are too close: %
0.2f vs. %0.2f"
,
new_zoom
,
old_zoom
);
return
false
;
}
girara_debug
(
"Re-rendering with new zoom level %f."
,
new_zoom
);
girara_debug
(
"Re-rendering with new zoom level %
0.2
f."
,
new_zoom
);
render_all
(
zathura
);
refresh_view
(
zathura
);
...
...
zathura/synctex.c
View file @
68eaadf1
...
...
@@ -16,6 +16,14 @@
#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
)
...
...
@@ -24,13 +32,13 @@ synctex_get_input_line_column(const char* filename, unsigned int page, int x, in
return
false
;
}
synctex_scanner_
t
scanner
=
synctex_scanner_new_with_output_file
(
filename
,
NULL
,
1
);
synctex_scanner_
p
scanner
=
synctex_scanner_new_with_output_file
(
filename
,
NULL
,
1
);
if
(
scanner
==
NULL
)
{
girara_debug
(
"Failed to create synctex scanner."
);
return
false
;
}
synctex_scanner_
t
temp
=
synctex_scanner_parse
(
scanner
);
synctex_scanner_
p
temp
=
synctex_scanner_parse
(
scanner
);
if
(
temp
==
NULL
)
{
girara_debug
(
"Failed to parse synctex file."
);
synctex_scanner_free
(
scanner
);
...
...
@@ -41,7 +49,7 @@ synctex_get_input_line_column(const char* filename, unsigned int page, int x, in
if
(
synctex_edit_query
(
scanner
,
page
+
1u
,
x
,
y
)
>
0
)
{
/* Assume that a backward search returns at most one result. */
synctex_node_
t
node
=
synctex
_next_result
(
scanner
);
synctex_node_
p
node
=
synctex_scanner
_next_result
(
scanner
);
if
(
node
!=
NULL
)
{
if
(
input_file
!=
NULL
)
{
*
input_file
=
g_strdup
(
synctex_scanner_get_name
(
scanner
,
synctex_node_tag
(
node
)));
...
...
@@ -127,13 +135,13 @@ synctex_rectangles_from_position(const char* filename, const char* input_file,
++
line
;
++
column
;
synctex_scanner_
t
scanner
=
synctex_scanner_new_with_output_file
(
filename
,
NULL
,
1
);
synctex_scanner_
p
scanner
=
synctex_scanner_new_with_output_file
(
filename
,
NULL
,
1
);
if
(
scanner
==
NULL
)
{
girara_debug
(
"Failed to create synctex scanner."
);
return
NULL
;
}
synctex_scanner_
t
temp
=
synctex_scanner_parse
(
scanner
);
synctex_scanner_
p
temp
=
synctex_scanner_parse
(
scanner
);
if
(
temp
==
NULL
)
{
girara_debug
(
"Failed to parse synctex file."
);
synctex_scanner_free
(
scanner
);
...
...
@@ -143,11 +151,11 @@ synctex_rectangles_from_position(const char* filename, const char* input_file,
girara_list_t
*
hitlist
=
girara_list_new2
(
g_free
);
girara_list_t
*
other_rects
=
girara_list_new2
(
g_free
);
if
(
synctex_display_query
(
scanner
,
input_file
,
line
,
column
)
>
0
)
{
synctex_node_
t
node
=
NULL
;
if
(
synctex_display_query
(
scanner
,
input_file
,
line
,
column
,
-
1
)
>
0
)
{
synctex_node_
p
node
=
NULL
;
bool
got_page
=
false
;
while
((
node
=
synctex_
next_result
(
scanner
))
!=
NULL
)
{
while
((
node
=
synctex_
scanner_next_result
(
scanner
))
!=
NULL
)
{
const
unsigned
int
current_page
=
synctex_node_page
(
node
)
-
1
;
if
(
got_page
==
false
)
{
got_page
=
true
;
...
...
@@ -314,7 +322,7 @@ synctex_highlight_rects(zathura_t* zathura, unsigned int page,
}
/* move to position */
girara_debug
(
"Jumping to page %u position (%
f, %
f)."
,
page
,
pos_x
,
pos_y
);
girara_debug
(
"Jumping to page %u position (%
0.2f, %0.2
f)."
,
page
,
pos_x
,
pos_y
);
zathura_jumplist_add
(
zathura
);
position_set
(
zathura
,
pos_x
,
pos_y
);
zathura_jumplist_add
(
zathura
);
...
...
zathura/utils.c
View file @
68eaadf1
...
...
@@ -63,6 +63,13 @@ file_valid_extension(zathura_t* zathura, const char* path)
return
(
plugin
==
NULL
)
?
false
:
true
;
}
static
void
index_element_free
(
void
*
data
,
GObject
*
UNUSED
(
object
))
{
zathura_index_element_t
*
element
=
data
;
zathura_index_element_free
(
element
);
}
void
document_index_build
(
GtkTreeModel
*
model
,
GtkTreeIter
*
parent
,
girara_tree_node_t
*
tree
)
...
...
@@ -70,7 +77,7 @@ document_index_build(GtkTreeModel* model, GtkTreeIter* parent,
girara_list_t
*
list
=
girara_node_get_children
(
tree
);
GIRARA_LIST_FOREACH_BODY
(
list
,
girara_tree_node_t
*
,
node
,
zathura_index_element_t
*
index_element
=
(
zathura_index_element_t
*
)
girara_node_get_data
(
node
);
zathura_index_element_t
*
index_element
=
girara_node_get_data
(
node
);
zathura_link_type_t
type
=
zathura_link_get_type
(
index_element
->
link
);
zathura_link_target_t
target
=
zathura_link_get_target
(
index_element
->
link
);
...
...
@@ -87,7 +94,7 @@ document_index_build(GtkTreeModel* model, GtkTreeIter* parent,
gchar
*
markup
=
g_markup_escape_text
(
index_element
->
title
,
-
1
);
gtk_tree_store_set
(
GTK_TREE_STORE
(
model
),
&
tree_iter
,
0
,
markup
,
1
,
description
,
2
,
index_element
,
-
1
);
g_free
(
markup
);
g_object_weak_ref
(
G_OBJECT
(
model
),
(
GWeakNotify
)
zathura_
index_element_free
,
index_element
);
g_object_weak_ref
(
G_OBJECT
(
model
),
index_element_free
,
index_element
);
g_free
(
description
);
if
(
girara_node_get_num_children
(
node
)
>
0
)
{
...
...
zathura/zathura.c
View file @
68eaadf1
...
...
@@ -163,7 +163,7 @@ zathura_update_view_ppi(zathura_t* zathura)
}
/* physical width of monitor */
int
width_mm
=
gdk_monitor_get_width_mm
(
monitor
);
const
int
width_mm
=
gdk_monitor_get_width_mm
(
monitor
);
/* size of monitor in pixels */
GdkRectangle
monitor_geom
;
...
...
@@ -184,7 +184,7 @@ zathura_update_view_ppi(zathura_t* zathura)
{
/* not using the cached value for the scale factor here to avoid issues
* if this function is called before the cached value is updated */
int
device_factor
=
gtk_widget_get_scale_factor
(
zathura
->
ui
.
session
->
gtk
.
view
);
const
int
device_factor
=
gtk_widget_get_scale_factor
(
zathura
->
ui
.
session
->
gtk
.
view
);
girara_debug
(
"on Wayland, correcting PPI for device scale factor = %d"
,
device_factor
);
if
(
device_factor
!=
0
)
{
ppi
/=
device_factor
;
...
...
@@ -192,9 +192,9 @@ zathura_update_view_ppi(zathura_t* zathura)
}
#endif
double
current_ppi
=
zathura_document_get_viewport_ppi
(
zathura
->
document
);
const
double
current_ppi
=
zathura_document_get_viewport_ppi
(
zathura
->
document
);
if
(
fabs
(
ppi
-
current_ppi
)
>
DBL_EPSILON
)
{
girara_debug
(
"monitor width: %d mm, pixels: %d, ppi: %f"
,
width_mm
,
monitor_geom
.
width
,
ppi
);
girara_debug
(
"monitor width: %d mm, pixels: %d, ppi: %
0.2
f"
,
width_mm
,
monitor_geom
.
width
,
ppi
);
zathura_document_set_viewport_ppi
(
zathura
->
document
,
ppi
);
render_all
(
zathura
);
refresh_view
(
zathura
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment