summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--backend/comics/meson.build49
-rw-r--r--backend/djvu/meson.build36
-rw-r--r--backend/dvi/mdvi-lib/meson.build67
-rw-r--r--backend/dvi/meson.build41
-rw-r--r--backend/epub/meson.build35
-rw-r--r--backend/epub/minizip/meson.build21
-rw-r--r--backend/meson.build5
-rw-r--r--backend/pdf/meson.build30
-rw-r--r--backend/pixbuf/meson.build30
-rw-r--r--backend/ps/meson.build31
-rw-r--r--backend/tiff/meson.build34
-rw-r--r--backend/xps/meson.build31
-rw-r--r--cut-n-paste/toolbar-editor/meson.build98
-rw-r--r--cut-n-paste/zoom-control/meson.build28
-rw-r--r--data/icons/meson.build73
-rw-r--r--data/meson.build55
-rw-r--r--help/meson.build35
-rw-r--r--help/reference/libdocument/meson.build30
-rw-r--r--help/reference/libview/meson.build31
-rw-r--r--help/reference/shell/meson.build31
-rw-r--r--install-scripts/meson.build21
-rw-r--r--install-scripts/meson_install_schemas.py10
-rw-r--r--install-scripts/meson_update_icon_cache.py10
-rw-r--r--install-scripts/meson_update_mime_database.py10
-rw-r--r--libdocument/meson.build172
-rw-r--r--libmisc/meson.build28
-rw-r--r--libview/meson.build116
-rw-r--r--meson.build301
-rw-r--r--meson_options.txt105
-rw-r--r--po/meson.build3
-rw-r--r--previewer/meson.build34
-rw-r--r--shell/meson.build146
-rwxr-xr-xtest-driver148
-rw-r--r--test/meson.build25
-rwxr-xr-xtest/testBookmarksMenu.py24
-rw-r--r--test/testCommon.py26
-rwxr-xr-xtest/testEditMenu.py51
-rwxr-xr-xtest/testEncryptedFile.py33
-rwxr-xr-xtest/testFileMenu.py45
-rwxr-xr-xtest/testFileReloading.py27
-rwxr-xr-xtest/testGoMenu.py30
-rwxr-xr-xtest/testHelpMenu.py28
-rwxr-xr-xtest/testWrongFileExtension.py18
-rwxr-xr-xtest/testZoom.py26
-rw-r--r--thumbnailer/meson.build32
45 files changed, 2260 insertions, 0 deletions
diff --git a/backend/comics/meson.build b/backend/comics/meson.build
new file mode 100644
index 00000000..bcb935eb
--- /dev/null
+++ b/backend/comics/meson.build
@@ -0,0 +1,49 @@
+backend_desktop_conf = configuration_data()
+backend_desktop_conf.set('COMICS_MIME_TYPES', comic_mimetypes)
+
+backend_desktop = configure_file(
+ input: 'comicsdocument.xreader-backend.in',
+ output: 'comicsdocument.xreader-backend',
+ configuration: backend_desktop_conf,
+ install: true,
+ install_dir: backendsdir,
+)
+
+comics_sources = files(
+ 'comics-document.c',
+ 'ev-archive.c',
+)
+
+comics_deps = [
+ cairo,
+ glib,
+ gtk,
+ libarchive_dep,
+]
+
+shared_module(
+ 'comicsdocument',
+ comics_sources,
+ link_with: [libdocument],
+ link_args: ['-Wl,-Bsymbolic', '-Wl,-z,relro', '-Wl,-z,now'],
+ include_directories: include_dirs,
+ dependencies: comics_deps,
+ install: true,
+ install_dir: backendsdir
+)
+
+
+
+test_name = 'test-ev-archive'
+
+test_sources = files(
+ 'ev-archive.c',
+ 'test-ev-archive.c',
+)
+
+executable(
+ test_name,
+ test_sources,
+ include_directories: include_dirs,
+ dependencies: comics_deps,
+)
diff --git a/backend/djvu/meson.build b/backend/djvu/meson.build
new file mode 100644
index 00000000..2b4cfc2e
--- /dev/null
+++ b/backend/djvu/meson.build
@@ -0,0 +1,36 @@
+djvu_sources = [
+ 'djvu-document.c',
+ 'djvu-document.h',
+ 'djvu-document-private.h',
+ 'djvu-links.c',
+ 'djvu-links.h',
+ 'djvu-text-page.c',
+ 'djvu-text-page.h',
+]
+
+djvu_deps = [
+ cairo,
+ djvu,
+ glib,
+ gtk
+]
+
+shared_module(
+ 'djvudocument',
+ djvu_sources,
+ link_with: [libdocument],
+ link_args: ['-Wl,-Bsymbolic', '-Wl,-z,relro', '-Wl,-z,now'],
+ include_directories: include_dirs,
+ dependencies: djvu_deps,
+ install: true,
+ install_dir: backendsdir,
+)
+
+custom_target(
+ 'djvu_backend',
+ input: 'djvudocument.xreader-backend.in',
+ output: 'djvudocument.xreader-backend',
+ command: [intltool_merge, '-d', '-u', po_dir, '@INPUT@', '@OUTPUT@'],
+ install: true,
+ install_dir: backendsdir,
+)
diff --git a/backend/dvi/mdvi-lib/meson.build b/backend/dvi/mdvi-lib/meson.build
new file mode 100644
index 00000000..6b9848ba
--- /dev/null
+++ b/backend/dvi/mdvi-lib/meson.build
@@ -0,0 +1,67 @@
+mdvi_sources = [
+ 'afmparse.c',
+ 'afmparse.h',
+ 'bitmap.c',
+ 'bitmap.h',
+ 'color.c',
+ 'color.h',
+ 'common.c',
+ 'common.h',
+ 'defaults.h',
+ 'dviopcodes.h',
+ 'dviread.c',
+ 'files.c',
+ 'font.c',
+ 'fontmap.c',
+ 'fontmap.h',
+ 'fontsrch.c',
+ 'gf.c',
+ 'hash.c',
+ 'hash.h',
+ 'list.c',
+ 'mdvi.h',
+ 'pagesel.c',
+ 'paper.c',
+ 'paper.h',
+ 'pk.c',
+ 'private.h',
+ 'setup.c',
+ 'special.c',
+ 'sp-epsf.c',
+ 'sysdeps.h',
+ 't1.c',
+ 'tfm.c',
+ 'tfmfile.c',
+ 'tt.c',
+ 'util.c',
+ 'vf.c',
+]
+
+mdvi_c_args = [
+ '-DSIZEOF_INT=__SIZEOF_INT__',
+ '-DSIZEOF_LONG=__SIZEOF_LONG__',
+ '-DSIZEOF_SHORT=__SIZEOF_SHORT__',
+ '-DSIZEOF_VOID_P=__SIZEOF_POINTER__',
+]
+
+mdvi_deps = [
+ kpathsea,
+]
+
+if t1_enabled
+ mdvi_c_args += '-DWITH_TYPE1_FONTS'
+ mdvi_deps += t1lib
+endif
+
+libmdvi = static_library(
+ 'mdvi',
+ mdvi_sources,
+ c_args: mdvi_c_args,
+ include_directories: include_dirs,
+ dependencies: mdvi_deps,
+)
+
+libmdvi_dep = declare_dependency(
+ include_directories: include_directories('.'),
+ link_with: libmdvi,
+)
diff --git a/backend/dvi/meson.build b/backend/dvi/meson.build
new file mode 100644
index 00000000..612477eb
--- /dev/null
+++ b/backend/dvi/meson.build
@@ -0,0 +1,41 @@
+subdir('mdvi-lib')
+
+dvi_sources = [
+ 'dvi-document.c',
+ 'dvi-document.h',
+ 'cairo-device.c',
+ 'cairo-device.h',
+ 'fonts.c',
+ 'fonts.h',
+]
+
+dvi_deps = [
+ cairo,
+ glib,
+ gtk,
+ libmdvi_dep,
+ math,
+ spectre,
+ mdvi_deps,
+]
+
+shared_module(
+ 'dvidocument',
+ dvi_sources,
+ link_with: [libdocument],
+ link_whole: libmdvi,
+ c_args: mdvi_c_args,
+ include_directories: include_dirs,
+ dependencies: dvi_deps,
+ install: true,
+ install_dir: backendsdir,
+)
+
+custom_target(
+ 'dvi_backend',
+ input: 'dvidocument.xreader-backend.in',
+ output: 'dvidocument.xreader-backend',
+ command: [intltool_merge, '-d', '-u', po_dir, '@INPUT@', '@OUTPUT@'],
+ install: true,
+ install_dir: backendsdir,
+)
diff --git a/backend/epub/meson.build b/backend/epub/meson.build
new file mode 100644
index 00000000..f16b918b
--- /dev/null
+++ b/backend/epub/meson.build
@@ -0,0 +1,35 @@
+subdir('minizip')
+
+epub_sources = [
+ 'epub-document.c',
+ 'epub-document.h',
+]
+
+epub_deps = [
+ cairo,
+ glib,
+ gtk,
+ xml,
+ minizip_dep,
+]
+
+shared_module(
+ 'epubdocument',
+ epub_sources,
+ link_with: [libdocument],
+ link_whole: minizip,
+ link_args: ['-Wl,-Bsymbolic', '-Wl,-z,relro', '-Wl,-z,now'],
+ include_directories: include_dirs,
+ dependencies: epub_deps,
+ install: true,
+ install_dir: backendsdir,
+)
+
+custom_target(
+ 'epub_backend',
+ input: 'epubdocument.atril-backend.desktop.in',
+ output: 'epubdocument.atril-backend',
+ command: [intltool_merge, '-d', '-u', po_dir, '@INPUT@', '@OUTPUT@'],
+ install: true,
+ install_dir: backendsdir,
+)
diff --git a/backend/epub/minizip/meson.build b/backend/epub/minizip/meson.build
new file mode 100644
index 00000000..838bac4e
--- /dev/null
+++ b/backend/epub/minizip/meson.build
@@ -0,0 +1,21 @@
+minizip_sources = [
+ 'unzip.c',
+ 'ioapi.c',
+ 'unzip.h',
+ 'ioapi.h',
+]
+
+minizip_deps = [
+ zlib
+]
+
+minizip = static_library(
+ 'minizip',
+ minizip_sources,
+ dependencies: minizip_deps,
+)
+
+minizip_dep = declare_dependency(
+ include_directories: include_directories('.'),
+ link_with: minizip,
+)
diff --git a/backend/meson.build b/backend/meson.build
new file mode 100644
index 00000000..ca9108db
--- /dev/null
+++ b/backend/meson.build
@@ -0,0 +1,5 @@
+backendsdir = join_paths(prefix, libdir, meson.project_name(), binary_major_version, 'backends')
+
+foreach sub : backend_subdirs
+ subdir(sub)
+endforeach
diff --git a/backend/pdf/meson.build b/backend/pdf/meson.build
new file mode 100644
index 00000000..7fd40eda
--- /dev/null
+++ b/backend/pdf/meson.build
@@ -0,0 +1,30 @@
+pdf_sources = [
+ 'ev-poppler.cc',
+ 'ev-poppler.h'
+]
+
+pdf_deps = [
+ gtk,
+ xml,
+ poppler,
+]
+
+shared_module(
+ 'pdfdocument',
+ pdf_sources,
+ link_with: [libdocument],
+ link_args: ['-Wl,-Bsymbolic', '-Wl,-z,relro', '-Wl,-z,now'],
+ include_directories: include_dirs,
+ dependencies: pdf_deps,
+ install: true,
+ install_dir: backendsdir,
+)
+
+custom_target(
+ 'pdf_backend',
+ input: 'pdfdocument.atril-backend.desktop.in',
+ output: 'pdfdocument.atril-backend',
+ command: [intltool_merge, '-d', '-u', po_dir, '@INPUT@', '@OUTPUT@'],
+ install: true,
+ install_dir: backendsdir,
+)
diff --git a/backend/pixbuf/meson.build b/backend/pixbuf/meson.build
new file mode 100644
index 00000000..146a5105
--- /dev/null
+++ b/backend/pixbuf/meson.build
@@ -0,0 +1,30 @@
+pixbuf_sources = [
+ 'pixbuf-document.c',
+ 'pixbuf-document.h'
+]
+
+pixbuf_deps = [
+ cairo,
+ glib,
+ gtk,
+]
+
+shared_module(
+ 'pixbufdocument',
+ pixbuf_sources,
+ link_with: [libdocument],
+ link_args: ['-Wl,-Bsymbolic', '-Wl,-z,relro', '-Wl,-z,now'],
+ include_directories: include_dirs,
+ dependencies: pixbuf_deps,
+ install: true,
+ install_dir: backendsdir,
+)
+
+custom_target(
+ 'pixbuf_backend',
+ input: 'pixbufdocument.xreader-backend.in',
+ output: 'pixbufdocument.xreader-backend',
+ command: [intltool_merge, '-d', '-u', po_dir, '@INPUT@', '@OUTPUT@'],
+ install: true,
+ install_dir: backendsdir,
+)
diff --git a/backend/ps/meson.build b/backend/ps/meson.build
new file mode 100644
index 00000000..b09fe662
--- /dev/null
+++ b/backend/ps/meson.build
@@ -0,0 +1,31 @@
+ps_sources = [
+ 'ev-spectre.c',
+ 'ev-spectre.h'
+]
+
+ps_deps = [
+ cairo,
+ glib,
+ gtk,
+ spectre,
+]
+
+shared_module(
+ 'psdocument',
+ ps_sources,
+ link_with: [libdocument],
+ link_args: ['-Wl,-Bsymbolic', '-Wl,-z,relro', '-Wl,-z,now'],
+ include_directories: include_dirs,
+ dependencies: ps_deps,
+ install: true,
+ install_dir: backendsdir,
+)
+
+custom_target(
+ 'ps_backend',
+ input: 'psdocument.atril-backend.desktop.in',
+ output: 'psdocument.atril-backend',
+ command: [intltool_merge, '-d', '-u', po_dir, '@INPUT@', '@OUTPUT@'],
+ install: true,
+ install_dir: backendsdir,
+)
diff --git a/backend/tiff/meson.build b/backend/tiff/meson.build
new file mode 100644
index 00000000..b0eb52bf
--- /dev/null
+++ b/backend/tiff/meson.build
@@ -0,0 +1,34 @@
+tiff_sources = [
+ 'tiff-document.c',
+ 'tiff-document.h',
+ 'tiff2ps.c',
+ 'tiff2ps.h',
+]
+
+tiff_deps = [
+ cairo,
+ glib,
+ gtk,
+ math,
+ tiff,
+]
+
+shared_module(
+ 'tiffdocument',
+ tiff_sources,
+ link_with: [libdocument],
+ link_args: ['-Wl,-Bsymbolic', '-Wl,-z,relro', '-Wl,-z,now'],
+ include_directories: include_dirs,
+ dependencies: tiff_deps,
+ install: true,
+ install_dir: backendsdir,
+)
+
+custom_target(
+ 'tiff_backend',
+ input: 'tiffdocument.atril-backend.desktop.in',
+ output: 'tiffdocument.atril-backend',
+ command: [intltool_merge, '-d', '-u', po_dir, '@INPUT@', '@OUTPUT@'],
+ install: true,
+ install_dir: backendsdir,
+)
diff --git a/backend/xps/meson.build b/backend/xps/meson.build
new file mode 100644
index 00000000..f7ac1991
--- /dev/null
+++ b/backend/xps/meson.build
@@ -0,0 +1,31 @@
+xps_sources = [
+ 'xps-document.c',
+ 'xps-document.h',
+]
+
+xps_deps = [
+ cairo,
+ glib,
+ gtk,
+ xps,
+]
+
+shared_module(
+ 'xpsdocument',
+ xps_sources,
+ link_with: [libdocument],
+ link_args: ['-Wl,-Bsymbolic', '-Wl,-z,relro', '-Wl,-z,now'],
+ include_directories: include_dirs,
+ dependencies: xps_deps,
+ install: true,
+ install_dir: backendsdir,
+)
+
+custom_target(
+ 'xps_backend',
+ input: 'xpsdocument.xreader-backend.in',
+ output: 'xpsdocument.xreader-backend',
+ command: [intltool_merge, '-d', '-u', po_dir, '@INPUT@', '@OUTPUT@'],
+ install: true,
+ install_dir: backendsdir,
+)
diff --git a/cut-n-paste/toolbar-editor/meson.build b/cut-n-paste/toolbar-editor/meson.build
new file mode 100644
index 00000000..cb3f55cd
--- /dev/null
+++ b/cut-n-paste/toolbar-editor/meson.build
@@ -0,0 +1,98 @@
+glib_genmarshal = find_program('glib-genmarshal')
+glib_mkenums = find_program('glib-mkenums')
+
+eggsources = [
+ 'egg-editable-toolbar.c',
+ 'egg-toolbars-model.c',
+ 'egg-toolbar-editor.c'
+]
+
+eggheaders = [
+ 'egg-editable-toolbar.h',
+ 'egg-toolbars-model.h',
+ 'egg-toolbar-editor.h'
+]
+
+noinst_headers = [
+ 'eggmarshalers.h'
+]
+
+eggmarshalers_h = custom_target('eggmarshalers.h',
+ output: 'eggmarshalers.h',
+ input: 'eggmarshalers.list',
+ command: [
+ glib_genmarshal,
+ '--prefix=_egg_marshal',
+ '@INPUT@',
+ '--header'
+ ],
+ capture: true
+)
+
+eggmarshalers_c = custom_target('eggmarshalers.c',
+ output: 'eggmarshalers.c',
+ input: 'eggmarshalers.list',
+ command: [
+ glib_genmarshal,
+ '--prefix=_egg_marshal',
+ '@INPUT@',
+ '--body',
+ '--prototypes'
+ ],
+ capture: true
+)
+
+eggtypebuiltins_h = custom_target('eggtypebuiltins.h',
+ output: 'eggtypebuiltins.h',
+ input: eggheaders,
+ command: [
+ glib_mkenums,
+ '--fhead', '#ifndef __EGGTYPEBUILTINS_H__\n#define __EGGTYPEBUILTINS_H__ 1\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n\n',
+ '--ftail', 'G_END_DECLS\n\n#endif /* __EGGTYPEBUILTINS_H__ */\n',
+ '--fprod', '\n/* --- @filename@ --- */',
+ '--eprod', '#define EGG_TYPE_@ENUMSHORT@ @enum_name@_get_type()\nGType @enum_name@_get_type (void);\n',
+ '@INPUT@'
+ ],
+ capture: true
+)
+
+eggtypebuiltins_c = custom_target('eggtypebuiltins.c',
+ output: 'eggtypebuiltins.c',
+ input: eggheaders,
+ command: [
+ glib_mkenums,
+ '--fhead', '#include <config.h>\n\n#include "eggtypebuiltins.h"\n\n',
+ '--fprod', '\n/* enumerations from "@filename@" */\n#include "@filename@"',
+ '--vhead', 'static const G@Type@Value _@enum_name@_values[] = {',
+ '--vprod', ' { @VALUENAME@, "@VALUENAME@", "@valuenick@" },',
+ '--vtail', ' { 0, NULL, NULL }\n};\n\nGType\n@enum_name@_get_type (void)\n{\n static GType type = 0;\n\n if (G_UNLIKELY (type == 0))\n type = g_@type@_register_static ("@EnumName@", _@enum_name@_values);\n\n return type;\n}\n\n',
+ '@INPUT@'
+ ],
+ capture: true
+)
+
+built_sources = [
+ eggmarshalers_c,
+ eggmarshalers_h,
+ eggtypebuiltins_c,
+ eggtypebuiltins_h
+]
+
+# Define the library
+libtoolbareditor = static_library('toolbareditor',
+ sources: [
+ eggsources,
+ eggheaders,
+ built_sources
+ ],
+ c_args: [
+ '-DCURSOR_DIR="' + join_paths(get_option('prefix'), get_option('datadir'), meson.project_name()) + '"',
+ ],
+ include_directories: include_directories('.'),
+ dependencies: shell_core_deps
+)
+
+libtoolbareditor_dep = declare_dependency(
+ link_with: libtoolbareditor,
+ include_directories: include_directories('.')
+)
diff --git a/cut-n-paste/zoom-control/meson.build b/cut-n-paste/zoom-control/meson.build
new file mode 100644
index 00000000..2c3320ac
--- /dev/null
+++ b/cut-n-paste/zoom-control/meson.build
@@ -0,0 +1,28 @@
+zoom_sources = [
+ 'ephy-zoom-action.h',
+ 'ephy-zoom-action.c',
+ 'ephy-zoom-control.c',
+ 'ephy-zoom-control.h',
+ 'ephy-zoom.c',
+ 'ephy-zoom.h',
+]
+
+zoom_deps = [
+ config_h,
+ glib,
+ gtk,
+ math
+]
+
+libephyzoom = static_library(
+ 'libephyzoom',
+ zoom_sources,
+ include_directories: include_root,
+ dependencies: zoom_deps,
+)
+
+libephyzoom_dep = declare_dependency(
+ link_with: libephyzoom,
+ include_directories: [include_root, include_directories('.')],
+ dependencies: zoom_deps,
+)
diff --git a/data/icons/meson.build b/data/icons/meson.build
new file mode 100644
index 00000000..237b63ae
--- /dev/null
+++ b/data/icons/meson.build
@@ -0,0 +1,73 @@
+icons = [
+ '16x16/actions/object-rotate-right.png',
+ '16x16/actions/zoom.png',
+ '16x16/actions/zoom-fit-width.png',
+ '16x16/actions/view-page-facing.png',
+ '16x16/actions/view-page-continuous.png',
+ '16x16/actions/object-rotate-left.png',
+ '16x16/actions/zoom-fit-height.png',
+ '16x16/mimetypes/x-office-presentation.png',
+ '22x22/actions/object-rotate-right.png',
+ '22x22/actions/zoom-fit-page.png',
+ '22x22/actions/zoom.png',
+ '22x22/actions/zoom-fit-width.png',
+ '22x22/actions/view-page-facing.png',
+ '22x22/actions/view-page-continuous.png',
+ '22x22/actions/object-rotate-left.png',
+ '22x22/actions/eye.png',
+ '22x22/mimetypes/x-office-presentation.png',
+ '24x24/actions/object-rotate-right.png',
+ '24x24/actions/stock_filters-invert.png',
+ '24x24/actions/zoom.png',
+ '24x24/actions/zoom-fit-width.png',
+ '24x24/actions/view-page-facing.png',
+ '24x24/actions/view-page-continuous.png',
+ '24x24/actions/object-rotate-left.png',
+ '24x24/actions/zoom-fit-height.png',
+ '24x24/mimetypes/x-office-presentation.png',
+ '32x32/actions/object-rotate-right.png',
+ '32x32/actions/view-page-facing.png',
+ '32x32/actions/view-page-continuous.png',
+ '32x32/actions/object-rotate-left.png',
+ '32x32/mimetypes/x-office-presentation.png',
+ '48x48/actions/resize-se.png',
+ '48x48/actions/resize-sw.png',
+ '48x48/actions/view-page-facing.png',
+ '48x48/actions/view-page-continuous.png',
+ '48x48/actions/close.png',
+ 'scalable/actions/object-rotate-left.svg',
+ 'scalable/actions/object-rotate-right.svg',
+ 'scalable/mimetypes/x-office-presentation.svg',
+]
+
+foreach icon : icons
+ parts = icon.split('/')
+ size = parts[0]
+ context = parts[1]
+ filename = parts[2]
+
+ install_data(
+ icon,
+ install_dir: join_paths(datadir, meson.project_name(), 'icons', 'hicolor', size, context)
+ )
+endforeach
+
+app_icons = [
+ '16x16/apps/atril.png',
+ '22x22/apps/atril.png',
+ '24x24/apps/atril.png',
+ '48x48/apps/atril.png',
+ 'scalable/apps/atril.svg',
+]
+
+foreach icon : app_icons
+ parts = icon.split('/')
+ size = parts[0]
+ context = parts[1]
+ filename = parts[2]
+
+ install_data(
+ icon,
+ install_dir: join_paths(datadir, 'icons', 'hicolor', size, context)
+ )
+endforeach
diff --git a/data/meson.build b/data/meson.build
new file mode 100644
index 00000000..ea61da21
--- /dev/null
+++ b/data/meson.build
@@ -0,0 +1,55 @@
+subdir('icons')
+
+data_dir = include_directories('.')
+
+install_data(
+ 'atril.1',
+ install_dir : join_paths(get_option('prefix'), get_option('mandir'), 'man1')
+)
+
+service_conf = configuration_data()
+service_conf.set('libexecdir', join_paths(prefix, libexecdir))
+
+configure_file(
+ input: 'org.mate.atril.Daemon.service.in',
+ output: 'org.mate.atril.Daemon.service',
+ configuration: service_conf,
+ install_dir: join_paths(datadir, 'dbus-1', 'services')
+)
+
+schema_file = install_data(
+ 'org.mate.Atril.gschema.xml',
+ install_dir: join_paths(datadir, 'glib-2.0', 'schemas')
+)
+
+desktop_conf = configuration_data()
+desktop_conf.set('ATRIL_MIME_TYPES', atril_mime_types)
+
+desktop = configure_file(
+ input: 'atril.desktop.in.in',
+ output: 'atril.desktop.in',
+ configuration: desktop_conf,
+)
+
+custom_target(
+ 'desktop',
+ input: desktop,
+ output: 'atril.desktop',
+ command: [intltool_merge, '-d', '-u', po_dir, '@INPUT@', '@OUTPUT@'],
+ install: true,
+ install_dir: desktopdir,
+)
+
+appdata = custom_target(
+ 'appdata',
+ input: 'atril.appdata.xml.in',
+ output: 'atril.appdata.xml',
+ command: [intltool_merge, '-x', '-u', po_dir, '@INPUT@', '@OUTPUT@'],
+ install: true,
+ install_dir: join_paths(datadir, 'metainfo'),
+)
+
+install_data(
+ 'hand-open.png',
+ install_dir: join_paths(prefix, datadir, meson.project_name())
+)
diff --git a/help/meson.build b/help/meson.build
new file mode 100644
index 00000000..fd21cffd
--- /dev/null
+++ b/help/meson.build
@@ -0,0 +1,35 @@
+# developer docs
+if get_option('docs')
+ glib_prefix = glib.get_pkgconfig_variable('prefix')
+ gtk_prefix = gtk.get_pkgconfig_variable('prefix')
+
+ fixref_args = [
+ '--extra-dir=' + join_paths(glib_prefix, gnome.gtkdoc_html_dir('glib')),
+ '--extra-dir=' + join_paths(glib_prefix, gnome.gtkdoc_html_dir('gio')),
+ '--extra-dir=' + join_paths(gtk_prefix, gnome.gtkdoc_html_dir('gdk')),
+ '--extra-dir=' + join_paths(gtk_prefix, gnome.gtkdoc_html_dir('gdk-pixbuf')),
+ '--extra-dir=' + join_paths(gtk_prefix, gnome.gtkdoc_html_dir('gtk')),
+ ]
+
+ subdir('reference/libdocument')
+ subdir('reference/libview')
+ subdir('reference/shell')
+endif
+
+# help files
+if get_option('help_files')
+ help_sources = [
+ 'index.docbook',
+ 'legal.xml',
+ ]
+
+ help_media = [
+ 'figures/xreader_start_window.png',
+ ]
+
+ gnome.yelp(
+ meson.project_name(),
+ sources: help_sources,
+ media: help_media,
+ )
+endif
diff --git a/help/reference/libdocument/meson.build b/help/reference/libdocument/meson.build
new file mode 100644
index 00000000..6f4720a4
--- /dev/null
+++ b/help/reference/libdocument/meson.build
@@ -0,0 +1,30 @@
+version_conf = configuration_data()
+version_conf.set('VERSION', version)
+
+version_xml = configure_file(
+ input: 'version.xml.in',
+ output: 'version.xml',
+ configuration: version_conf,
+)
+
+libdoc_doc_deps = declare_dependency(
+ include_directories: [libdoc_include, include_directories('.')],
+ link_with: libdocument,
+ dependencies: libdocument_deps,
+)
+
+gnome.gtkdoc(
+ 'libxreaderdocument',
+ mode: 'xml',
+ main_xml: 'libxreaderdocument-docs.xml',
+ gobject_typesfile: files('libxreaderdocument.types'),
+ src_dir: [
+ join_paths(meson.source_root(), 'libdocument'),
+ ],
+ ignore_headers: [libdocument_private_headers],
+ dependencies: libdoc_doc_deps,
+ mkdb_args: ['--xml-mode', '--output-format=xml', '--name-space=ev'],
+ fixxref_args: fixref_args,
+ install: true,
+ install_dir: 'libxreaderdocument-' + api_version,
+)
diff --git a/help/reference/libview/meson.build b/help/reference/libview/meson.build
new file mode 100644
index 00000000..cc7e546c
--- /dev/null
+++ b/help/reference/libview/meson.build
@@ -0,0 +1,31 @@
+version_conf = configuration_data()
+version_conf.set('VERSION', version)
+
+version_xml = configure_file(
+ input: 'version.xml.in',
+ output: 'version.xml',
+ configuration: version_conf,
+)
+
+libview_doc_deps = declare_dependency(
+ include_directories: [include_root, libdoc_include, libview_include, include_directories('.')],
+ link_with: libview,
+ dependencies: libdoc_deps,
+)
+
+gnome.gtkdoc(
+ 'libxreaderview',
+ mode: 'xml',
+ main_xml: 'libxreaderview-docs.xml',
+ gobject_typesfile: files('libxreaderview.types'),
+ src_dir: [
+ join_paths(meson.source_root(), 'libview'),
+ ],
+ ignore_headers: [libview_private_headers],
+ dependencies: libview_doc_deps,
+ mkdb_args: ['--xml-mode', '--output-format=xml', '--name-space=ev'],
+ cflags: '-DATRIL_COMPILATION',
+ fixxref_args: fixref_args,
+ install: true,
+ install_dir: 'libxreaderview-' + api_version,
+)
diff --git a/help/reference/shell/meson.build b/help/reference/shell/meson.build
new file mode 100644
index 00000000..9b2f6c43
--- /dev/null
+++ b/help/reference/shell/meson.build
@@ -0,0 +1,31 @@
+version_conf = configuration_data()
+version_conf.set('VERSION', version)
+
+version_xml = configure_file(
+ input: 'version.xml.in',
+ output: 'version.xml',
+ configuration: version_conf,
+)
+
+atril_doc_deps = declare_dependency(
+ include_directories: [include_root, libdoc_include, libview_include, include_directories('.')],
+ link_with: [libdocument, libview],
+ dependencies: atril_deps,
+)
+
+gnome.gtkdoc(
+ meson.project_name(),
+ mode: 'xml',
+ main_xml: 'atril-docs.xml',
+ gobject_typesfile: files('atril.types'),
+ src_dir: [
+ join_paths(meson.project_source_root(), 'libview'),
+ ],
+ ignore_headers: [libview_private_headers],
+ dependencies: atril_doc_deps,
+ mkdb_args: ['--xml-mode', '--output-format=xml', '--name-space=ev'],
+ cflags: '-DATRIL_COMPILATION',
+ fixxref_args: fixref_args,
+ install: true,
+ install_dir: meson.project_name(),
+)
diff --git a/install-scripts/meson.build b/install-scripts/meson.build
new file mode 100644
index 00000000..e27404dd
--- /dev/null
+++ b/install-scripts/meson.build
@@ -0,0 +1,21 @@
+# These scripts run as post-installation scripts.
+
+# They're designed to do nothing if DESTDIR is set, which happens
+# during debian builds for instance - there's a fake install target
+# so running these would be pointless.
+
+# When using deb packaging, these aren't needed, as these operations
+# are run automatically by the package manager.
+
+# They're really only necessary in straight builds where 'ninja install'
+# will be run directly, to install the program onto the system.
+
+
+# Re-compile gsettings
+meson.add_install_script('meson_install_schemas.py')
+
+# Update mime info
+meson.add_install_script('meson_update_mime_database.py')
+
+# Update the Gtk icon cache
+meson.add_install_script('meson_update_icon_cache.py')
diff --git a/install-scripts/meson_install_schemas.py b/install-scripts/meson_install_schemas.py
new file mode 100644
index 00000000..6b2bbe2d
--- /dev/null
+++ b/install-scripts/meson_install_schemas.py
@@ -0,0 +1,10 @@
+#!/usr/bin/python3
+
+import os
+import subprocess
+
+schemadir = os.path.join(os.environ['MESON_INSTALL_PREFIX'], 'share', 'glib-2.0', 'schemas')
+
+if not os.environ.get('DESTDIR'):
+ print('Compiling gsettings schemas...')
+ subprocess.call(['glib-compile-schemas', schemadir])
diff --git a/install-scripts/meson_update_icon_cache.py b/install-scripts/meson_update_icon_cache.py
new file mode 100644
index 00000000..d618191a
--- /dev/null
+++ b/install-scripts/meson_update_icon_cache.py
@@ -0,0 +1,10 @@
+#!/usr/bin/python3
+
+import os
+import subprocess
+
+themedir = os.path.join(os.environ['MESON_INSTALL_PREFIX'], 'share', 'icons', 'hicolor')
+
+if not os.environ.get('DESTDIR'):
+ print('Updating gtk icon cache... %s' % themedir)
+ subprocess.call(['gtk-update-icon-cache', '-f', '-t', themedir])
diff --git a/install-scripts/meson_update_mime_database.py b/install-scripts/meson_update_mime_database.py
new file mode 100644
index 00000000..a997dbca
--- /dev/null
+++ b/install-scripts/meson_update_mime_database.py
@@ -0,0 +1,10 @@
+#!/usr/bin/python3
+
+import os
+import subprocess
+
+mimedir = os.path.join(os.environ['MESON_INSTALL_PREFIX'], 'share', 'mime')
+
+if not os.environ.get('DESTDIR'):
+ print('Updating mime database...')
+ subprocess.call(['update-mime-database', mimedir])
diff --git a/libdocument/meson.build b/libdocument/meson.build
new file mode 100644
index 00000000..a8b7d387
--- /dev/null
+++ b/libdocument/meson.build
@@ -0,0 +1,172 @@
+libdocument_private_headers = [
+ 'ev-debug.h',
+ 'ev-module.h'
+]
+
+libdocument_headers = [
+ 'ev-annotation.h',
+ 'ev-async-renderer.h',
+ 'ev-attachment.h',
+ 'ev-backends-manager.h',
+ 'ev-document-factory.h',
+ 'ev-document-annotations.h',
+ 'ev-document-attachments.h',
+ 'ev-document-find.h',
+ 'ev-document-fonts.h',
+ 'ev-document-forms.h',
+ 'ev-document.h',
+ 'ev-document-images.h',
+ 'ev-document-info.h',
+ 'ev-document-layers.h',
+ 'ev-document-links.h',
+ 'ev-document-misc.h',
+ 'ev-document-print.h',
+ 'ev-document-security.h',
+ 'ev-document-thumbnails.h',
+ 'ev-document-transition.h',
+ 'ev-document-text.h',
+ 'ev-file-exporter.h',
+ 'ev-file-helpers.h',
+ 'ev-form-field.h',
+ 'ev-image.h',
+ 'ev-init.h',
+ 'ev-layer.h',
+ 'ev-link-action.h',
+ 'ev-link-dest.h',
+ 'ev-link.h',
+ 'ev-macros.h',
+ 'ev-mapping-list.h',
+ 'ev-page.h',
+ 'ev-render-context.h',
+ 'ev-selection.h',
+ 'ev-transition-effect.h',
+]
+
+libdocument_sources = [
+ 'ev-annotation.c',
+ 'ev-async-renderer.c',
+ 'ev-attachment.c',
+ 'ev-backends-manager.c',
+ 'ev-layer.c',
+ 'ev-link.c',
+ 'ev-link-action.c',
+ 'ev-link-dest.c',
+ 'ev-image.c',
+ 'ev-init.c',
+ 'ev-document.c',
+ 'ev-document-annotations.c',
+ 'ev-document-attachments.c',
+ 'ev-document-factory.c',
+ 'ev-document-thumbnails.c',
+ 'ev-document-fonts.c',
+ 'ev-document-layers.c',
+ 'ev-document-links.c',
+ 'ev-document-images.c',
+ 'ev-document-print.c',
+ 'ev-document-security.c',
+ 'ev-document-find.c',
+ 'ev-document-transition.c',
+ 'ev-document-forms.c',
+ 'ev-document-text.c',
+ 'ev-form-field.c',
+ 'ev-debug.c',
+ 'ev-file-exporter.c',
+ 'ev-file-helpers.c',
+ 'ev-mapping-list.c',
+ 'ev-module.c',
+ 'ev-page.c',
+ 'ev-render-context.c',
+ 'ev-selection.c',
+ 'ev-transition-effect.c',
+ 'ev-document-misc.c',
+ libdocument_headers,
+]
+
+libdoc_header_dir = join_paths(header_dir, 'libdocument')
+
+libdoc_include = include_directories('.')
+
+libdoc_enums = gnome.mkenums(
+ 'ev-document-type-builtins',
+ sources : libdocument_headers,
+ c_template : 'ev-document-type-builtins.c.template',
+ h_template : 'ev-document-type-builtins.h.template',
+ identifier_prefix : 'Ev',
+ symbol_prefix : 'ev',
+ install_header: true,
+ install_dir: join_paths(includedir, libdoc_header_dir),
+)
+
+libdocument_sources += libdoc_enums
+
+libdoc_version_conf = configuration_data()
+libdoc_version_conf.set('EV_MAJOR_VERSION', major_version)
+libdoc_version_conf.set('EV_MINOR_VERSION', minor_version)
+libdoc_version_conf.set('EV_MICRO_VERSION', micro_version)
+
+libdoc_version = configure_file(
+ input: 'ev-version.h.in',
+ output: 'ev-version.h',
+ configuration: libdoc_version_conf,
+ install: true,
+ install_dir: join_paths(includedir, libdoc_header_dir),
+)
+
+libdocument_sources += libdoc_version
+
+libdocument_deps = [
+ config_h,
+ cairo,
+ glib,
+ gmodule,
+ gtk,
+ math,
+]
+
+libdocument = library(
+ 'xreaderdocument',
+ libdocument_private_headers + libdocument_sources,
+ dependencies: libdocument_deps,
+ include_directories: include_root,
+ soversion: binary_major_version,
+ version: binary_version,
+ install: true,
+)
+
+# this is needed so targets that depend on generated headers can do so
+libdocument_dep = declare_dependency(
+ link_with: libdocument,
+ dependencies: libdocument_deps,
+ include_directories: include_root,
+ sources: libdoc_enums[1]
+)
+
+install_headers(
+ libdocument_headers,
+ subdir: libdoc_header_dir,
+)
+
+if get_option('introspection')
+ introspection_includes = [
+ 'Gdk-3.0',
+ 'GdkPixbuf-2.0',
+ 'Gio-2.0',
+ 'GLib-2.0',
+ 'GObject-2.0',
+ 'Gtk-3.0',
+ ]
+
+ libdocument_gir = gnome.generate_gir(
+ libdocument,
+ namespace: 'XreaderDocument',
+ nsversion: api_version,
+ sources: libdocument_sources,
+ identifier_prefix: 'Ev',
+ symbol_prefix: 'ev',
+ includes: introspection_includes,
+ install: true,
+ install_dir_typelib: join_paths(libdir, 'girepository-1.0'),
+ install_dir_gir: join_paths(datadir, 'gir-1.0'),
+ export_packages: 'xreader-document-' + api_version,
+ )
+endif
diff --git a/libmisc/meson.build b/libmisc/meson.build
new file mode 100644
index 00000000..e0140736
--- /dev/null
+++ b/libmisc/meson.build
@@ -0,0 +1,28 @@
+libmisc_sources = [
+ 'ev-page-action.c',
+ 'ev-page-action.h',
+ 'ev-page-action-widget.c',
+ 'ev-page-action-widget.h',
+ libdoc_enums,
+ libview_enums,
+]
+
+libmisc_deps = [
+ libdocument_dep,
+ glib,
+ gtk,
+]
+
+libmisc = static_library(
+ 'misc',
+ libmisc_sources,
+ link_with: libview,
+ include_directories: include_dirs,
+ dependencies: libmisc_deps,
+)
+
+libmisc_dep = declare_dependency(
+ link_with: libmisc,
+ include_directories: include_dirs,
+ dependencies: libmisc_deps,
+)
diff --git a/libview/meson.build b/libview/meson.build
new file mode 100644
index 00000000..4699ee26
--- /dev/null
+++ b/libview/meson.build
@@ -0,0 +1,116 @@
+libview_private_headers = [
+ 'ev-annotation-window.h',
+ 'ev-link-accessible.h',
+ 'ev-page-cache.h',
+ 'ev-pixbuf-cache.h',
+ 'ev-timeline.h',
+ 'ev-transition-animation.h',
+ 'ev-view-accessible.h',
+ 'ev-view-cursor.h',
+ 'ev-view-private.h',
+]
+
+libview_headers = [
+ 'ev-document-model.h',
+ 'ev-jobs.h',
+ 'ev-job-scheduler.h',
+ 'ev-print-operation.h',
+ 'ev-stock-icons.h',
+ 'ev-view.h',
+ 'ev-web-view.h',
+ 'ev-view-presentation.h',
+]
+
+libview_sources = [
+ 'ev-annotation-window.c',
+ 'ev-document-model.c',
+ 'ev-jobs.c',
+ 'ev-job-scheduler.c',
+ 'ev-link-accessible.c',
+ 'ev-page-cache.c',
+ 'ev-pixbuf-cache.c',
+ 'ev-print-operation.c',
+ 'ev-stock-icons.c',
+ 'ev-timeline.c',
+ 'ev-transition-animation.c',
+ 'ev-view.c',
+ 'ev-web-view.c',
+ 'ev-view-accessible.c',
+ 'ev-view-cursor.c',
+ 'ev-view-presentation.c',
+ libview_headers,
+]
+
+libview_header_dir = join_paths(header_dir, 'libview')
+
+libview_include = include_directories('.')
+
+libview_enums = gnome.mkenums(
+ 'ev-view-type-builtins',
+ sources : libview_headers,
+ c_template : 'ev-view-type-builtins.c.template',
+ h_template : 'ev-view-type-builtins.h.template',
+ identifier_prefix : 'Ev',
+ symbol_prefix : 'ev',
+ install_header: true,
+ install_dir: join_paths(includedir, libview_header_dir),
+)
+
+libview_sources += libview_enums
+
+libview_marshal = gnome.genmarshal(
+ 'ev-view-marshal',
+ sources: 'ev-view-marshal.list',
+ prefix: 'ev_view_marshal'
+)
+
+libview_deps = [
+ libdocument_dep,
+ config_h,
+ gail,
+ glib,
+ gtk,
+ gtk_unix_print,
+ math,
+]
+
+if get_option('epub')
+ libview_deps += webkit
+endif
+
+libview = library(
+ 'xreaderview',
+ libview_sources + libview_private_headers + libdoc_enums + libview_marshal,
+ include_directories: include_dirs,
+ dependencies: libview_deps,
+ soversion: binary_major_version,
+ version: binary_version,
+ install: true,
+)
+
+libview_dep = declare_dependency(
+ link_with: libview,
+ include_directories: include_dirs,
+ dependencies: libview_deps,
+)
+
+install_headers(
+ libview_headers,
+ subdir: libview_header_dir,
+)
+
+if get_option('introspection')
+ libview_gir = gnome.generate_gir(
+ libview,
+ namespace: 'XreaderView',
+ nsversion: api_version,
+ sources: libview_sources,
+ identifier_prefix: 'Ev',
+ symbol_prefix: 'ev',
+ includes: [introspection_includes, libdocument_gir[0]],
+ install: true,
+ install_dir_typelib: join_paths(libdir, 'girepository-1.0'),
+ install_dir_gir: join_paths(datadir, 'gir-1.0'),
+ export_packages: ['xreader-view-' + api_version, 'xreader-document-' + api_version],
+ )
+endif
diff --git a/meson.build b/meson.build
new file mode 100644
index 00000000..c2d9d1c1
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,301 @@
+project('atril', 'c', 'cpp', version : '1.28.1')
+
+gnome = import('gnome')
+i18n = import('i18n')
+pkgconfig = import('pkgconfig')
+
+cc = meson.get_compiler('c')
+
+version = meson.project_version()
+version_list = version.split('.')
+major_version = version_list[0]
+minor_version = version_list[1]
+micro_version = version_list[2]
+
+api_version = '1.5'
+binary_version = '3.0.0'
+binary_major_version = binary_version.split('.')[0]
+
+atril_conf = configuration_data()
+atril_conf.set_quoted('VERSION', version)
+atril_conf.set_quoted('GETTEXT_PACKAGE', meson.project_name())
+
+if get_option('enable_dbus')
+ atril_conf.set('ENABLE_DBUS', '')
+endif
+
+# directories
+prefix = get_option('prefix')
+bindir = get_option('bindir')
+datadir = get_option('datadir')
+libdir = get_option('libdir')
+includedir = get_option('includedir')
+libexecdir = get_option('libexecdir')
+desktopdir = join_paths(datadir, 'applications')
+schema_dir = join_paths(datadir, 'glib-2.0', 'schemas')
+header_dir = join_paths(meson.project_name(), api_version)
+
+po_dir = join_paths(meson.project_source_root(), 'po')
+
+# dependencies
+cairo = dependency('cairo', version: '>= 1.14.0')
+gail = dependency('gail-3.0')
+gio = dependency('gio-2.0', version: '>= 2.36.0')
+glib_version = '2.36.0'
+glib = dependency('glib-2.0', version: '>= ' + glib_version)
+gmodule = dependency('gmodule-2.0')
+gtk_version = '3.14.0'
+gtk_api_version = '3.0'
+gtk = dependency('gtk+-' + gtk_api_version, version: '>= ' + gtk_version)
+ice = dependency('ice')
+sm = dependency('sm')
+X11 = dependency('x11')
+xml = dependency('libxml-2.0', version: '>= 2.5.0')
+zlib = dependency('zlib')
+libsecret = dependency('libsecret-1', version: '>= 0.5', required: get_option('keyring'))
+gtk_unix_print = dependency('gtk+-unix-print-3.0', version: '>= ' + gtk_version, required: get_option('gtk_unix_print'))
+
+enabled_backend_names = []
+backend_subdirs = []
+atril_mime_types = ''
+
+if get_option('pdf')
+ poppler = dependency('poppler-glib')
+ backend_subdirs += 'pdf'
+ atril_mime_types += 'application/pdf;application/x-bzpdf;application/x-gzpdf;application/x-xzpdf;'
+endif
+if get_option('ps')
+ spectre = dependency('libspectre', version: '>= 0.2.0')
+ backend_subdirs += 'ps'
+ atril_mime_types += 'application/postscript;application/x-bzpostscript;application/x-gzpostscript;image/x-eps;image/x-bzeps;image/x-gzeps;application/illustrator;'
+endif
+if get_option('dvi')
+ kpathsea = dependency('kpathsea')
+ spectre = dependency('libspectre', version: '>= 0.2.0')
+ if get_option('t1lib')
+ t1lib = cc.find_library('t1', required: false)
+ t1_enabled = t1lib.found()
+ else
+ t1_enabled = false
+ endif
+ backend_subdirs += 'dvi'
+ atril_mime_types += 'application/x-dvi;application/x-bzdvi;application/x-gzdvi;'
+endif
+if get_option('djvu')
+ djvu = dependency('ddjvuapi', version: '>= 3.5.17')
+ backend_subdirs += 'djvu'
+ atril_mime_types += 'image/vnd.djvu;image/vnd.djvu+multipage;'
+endif
+if get_option('tiff')
+ tiff = dependency('libtiff-4')
+ backend_subdirs += 'tiff'
+ atril_mime_types += 'image/tiff;'
+endif
+if get_option('pixbuf')
+ backend_subdirs += 'pixbuf'
+ atril_mime_types += 'image/*;'
+ atril_conf.set10('ENABLE_PIXBUF', true)
+endif
+if get_option('comics')
+ libarchive_req_version = '>= 3.6.0'
+ libarchive_dep = dependency('libarchive', version: '>= 3.6.0', required: true)
+ backend_subdirs += 'comics'
+ comic_mimetypes = ';'.join([
+ 'application/vnd.comicbook-rar',
+ 'application/vnd.comicbook+zip',
+ 'application/x-cb7',
+ 'application/x-cbr',
+ 'application/x-cbt',
+ 'application/x-cbz',
+ 'application/x-ext-cb7',
+ 'application/x-ext-cbr',
+ 'application/x-ext-cbt',
+ 'application/x-ext-cbz',
+ ]) + ';'
+ atril_mime_types += comic_mimetypes
+endif
+if get_option('xps')
+ xps = dependency('libgxps', version: '>= 0.2.1')
+ backend_subdirs += 'xps'
+ atril_mime_types += 'application/oxps;application/vnd.ms-xpsdocument;'
+endif
+
+thumbnailer_mime_types = atril_mime_types
+
+if get_option('epub')
+ webkit = dependency('webkit2gtk-4.1', version: '>= 2.4.3', required: false)
+ backend_subdirs += 'epub'
+ atril_mime_types += 'application/epub+zip;'
+endif
+
+atril_conf.set_quoted('SUPPORTED_MIMETYPES', atril_mime_types) # This is generated by backends/meson.build
+
+# on some systems we need to find the math lib to make sure it builds
+math = cc.find_library('m', required: false)
+
+intltool_merge = find_program('intltool-merge')
+
+mathjax_directory = get_option('mathjax-directory')
+if mathjax_directory == ''
+ foreach dir: [
+ # Arch Linux
+ '/usr/share/mathjax',
+ # Debian
+ '/usr/share/javascript/mathjax'
+ ]
+ if run_command('test', ['-f', join_paths(dir, 'MathJax.js')]).returncode() == 0
+ mathjax_directory = dir
+ # break would require meson_version >= 0.49.0 so just let the last one win
+ endif
+ endforeach
+endif
+
+if mathjax_directory != ''
+ atril_conf.set_quoted('MATHJAX_DIRECTORY', mathjax_directory)
+elif get_option('epub')
+ error('"mathjax-directory" is undefined and could not be autodetected')
+endif
+
+# generate config.h
+config_h_file = configure_file(
+ output : 'config.h',
+ configuration : atril_conf
+)
+
+config_h = declare_dependency(
+ sources: config_h_file
+)
+
+include_dirs = include_directories('.', 'libdocument', 'libview', 'libmisc')
+include_root = include_directories('.')
+
+atril_document_header = [
+ 'atril-document.h'
+]
+
+atril_view_header = [
+ 'atril-view.h'
+]
+
+# compiler flags
+c_args = [
+ '-DDATADIR="@0@"'.format(join_paths(prefix, datadir)),
+ '-DLIBDIR="@0@"'.format(join_paths(prefix, libdir)),
+ '-DBINDIR="@0@"'.format(join_paths(prefix, bindir)),
+ '-DEV_BACKENDSDIR="@0@"'.format(join_paths(prefix, libdir, meson.project_name(), binary_major_version, 'backends')),
+ '-DATRILDATADIR="@0@"'.format(join_paths(prefix, datadir, meson.project_name())),
+ '-Werror=implicit-function-declaration'
+]
+
+cpp_args = [
+ '-DATRIL_LOCALE_DIR="@0@"'.format(join_paths(prefix, datadir, 'locale')),
+ '-DATRIL_COMPILATION',
+ '-DHAVE_CONFIG_H',
+]
+
+if get_option('enable_debug')
+ c_args += '-DEV_ENABLE_DEBUG'
+endif
+
+if get_option('epub')
+ c_args += '-DENABLE_EPUB'
+endif
+
+if not get_option('deprecated_warnings')
+ c_args += [
+ '-Wno-deprecated-declarations',
+ '-Wno-deprecated',
+ '-Wno-declaration-after-statement',
+ ]
+endif
+
+add_global_arguments(c_args, language: 'c')
+add_global_arguments(cpp_args, language: ['c', 'cpp'])
+
+subdir('libdocument')
+subdir('libview')
+subdir('libmisc')
+# 'backend' needs to be run before 'data' because the mimetypes defined in 'backend'
+# are used to generate the .desktop file
+subdir('backend')
+subdir('data')
+if get_option('thumbnailer')
+ subdir('thumbnailer')
+endif
+if get_option('previewer')
+ subdir('previewer')
+endif
+
+# Define shell_core_deps
+shell_core_deps = [
+ glib,
+ gtk,
+ gio,
+]
+subdir('cut-n-paste/smclient')
+subdir('cut-n-paste/toolbar-editor')
+subdir('cut-n-paste/zoom-control')
+
+subdir('shell')
+subdir('po')
+subdir('help')
+subdir('install-scripts')
+
+# The tests use an option that doesn't exist in meson before 0.46.
+# Since they aren't strictly necessary, we'll just skip them for earlier versions
+# rather than making 0.46 a hard requirement. This condition can be removed once we
+# no longer need to worry about building on 0.45 or earlier
+if meson.version().version_compare('>=0.46')
+ subdir('test')
+endif
+
+atril_headers = [
+ 'atril-document.h',
+ 'atril-view.h',
+]
+
+install_headers(
+ atril_headers,
+ subdir: header_dir
+)
+
+pc_conf = configuration_data()
+pc_conf.set('prefix', prefix)
+pc_conf.set('exec_prefix', '${prefix}')
+pc_conf.set('libdir', join_paths('${prefix}', libdir))
+pc_conf.set('includedir', join_paths('${prefix}', includedir))
+pc_conf.set('EV_API_VERSION', api_version)
+pc_conf.set('EV_BINARY_VERSION', binary_major_version)
+pc_conf.set('VERSION', version)
+pc_conf.set('GLIB_REQUIRED', glib_version)
+pc_conf.set('GTK_API_VERSION', gtk_api_version)
+pc_conf.set('GTK_REQUIRED', gtk_version)
+
+configure_file(
+ input: 'atril-document.pc.in',
+ output: 'atril-document-@[email protected]'.format(api_version),
+ configuration: pc_conf,
+ install_dir: join_paths(libdir, 'pkgconfig')
+)
+
+configure_file(
+ input: 'atril-view.pc.in',
+ output: 'atril-view-@[email protected]'.format(api_version),
+ configuration: pc_conf,
+ install_dir: join_paths(libdir, 'pkgconfig')
+)
+
+message('prefix = @0@'.format(prefix))
+message('bindir = @0@'.format(bindir))
+message('datadir = @0@'.format(datadir))
+message('libdir = @0@'.format(libdir))
+message('includedir = @0@'.format(includedir))
+message('libexecdir = @0@'.format(libexecdir))
+message('desktopdir = @0@'.format(desktopdir))
+message('schema_dir = @0@'.format(schema_dir))
+message('ENABLE_DBUS = @0@'.format(get_option('enable_dbus')))
+message('MathJax directory = @0@'.format(mathjax_directory))
+message('Backends enabled:')
+foreach backend_name : backend_subdirs
+ message(' @0@'.format(backend_name))
+endforeach
diff --git a/meson_options.txt b/meson_options.txt
new file mode 100644
index 00000000..d4e9e283
--- /dev/null
+++ b/meson_options.txt
@@ -0,0 +1,105 @@
+option('comics',
+ type: 'boolean',
+ value: false,
+ description: 'Support for the comic book (cbr) backend'
+)
+option('djvu',
+ type: 'boolean',
+ value: false,
+ description: 'Support for the djvu backend'
+)
+option('dvi',
+ type: 'boolean',
+ value: false,
+ description: 'Support for the dvi backend'
+)
+option('t1lib',
+ type: 'boolean',
+ value: false,
+ description: 'Compile with t1lib for type1 font support in the dvi backend'
+)
+option('epub',
+ type: 'boolean',
+ value: true,
+ description: 'Support for the epub backend'
+)
+option('pdf',
+ type: 'boolean',
+ value: true,
+ description: 'Support for the PDF backend'
+)
+option('pixbuf',
+ type: 'boolean',
+ value: false,
+ description: 'Support for the generic pixbuf image backend'
+)
+option('ps',
+ type: 'boolean',
+ value: true,
+ description: 'Support for the PostScript backend'
+)
+option('tiff',
+ type: 'boolean',
+ value: true,
+ description: 'Support for the tiff backend'
+)
+option('xps',
+ type: 'boolean',
+ value: false,
+ description: 'Support for the xps backend'
+)
+option('gtk_unix_print',
+ type: 'boolean',
+ value: true,
+ description: 'Print support'
+)
+option('keyring',
+ type: 'boolean',
+ value: true,
+ description: 'Keyring support for password-protected documents'
+)
+option('mathjax-directory',
+ type: 'string',
+ value: '',
+ description: 'Path to the system mathjax installation.'
+)
+option('previewer',
+ type: 'boolean',
+ value: true,
+ description: 'Build the print previewer program'
+)
+option('thumbnailer',
+ type: 'boolean',
+ value: true,
+ description: 'Build the thumbnailer program'
+)
+option('docs',
+ type: 'boolean',
+ value: false,
+ description: 'Build the API references (requires gtk-doc)'
+)
+option('help_files',
+ type: 'boolean',
+ value: false,
+ description: 'Build the help files'
+)
+option('introspection',
+ type: 'boolean',
+ value: false,
+ description: 'Enable GObject introspection'
+)
+option('enable_dbus',
+ type: 'boolean',
+ value: true,
+ description: 'Enable D-Bus support'
+)
+option('deprecated_warnings',
+ type: 'boolean',
+ value: false,
+ description: 'Show build warnings for deprecations'
+)
+option('enable_debug',
+ type: 'boolean',
+ value: false,
+ description: 'Enable the runtime debugger'
+)
diff --git a/po/meson.build b/po/meson.build
new file mode 100644
index 00000000..554ceaf2
--- /dev/null
+++ b/po/meson.build
@@ -0,0 +1,3 @@
+i18n.gettext(meson.project_name(),
+ preset: 'glib'
+)
diff --git a/previewer/meson.build b/previewer/meson.build
new file mode 100644
index 00000000..e5f68919
--- /dev/null
+++ b/previewer/meson.build
@@ -0,0 +1,34 @@
+previewer_sources = [
+ 'ev-previewer.c',
+ 'ev-previewer-window.h',
+ 'ev-previewer-window.c',
+ libdoc_enums,
+ libview_enums,
+]
+
+previewer_sources += gnome.compile_resources(
+ 'previewer-resources', 'previewer.gresource.xml',
+ source_dir: ['.', join_paths(meson.project_source_root(), 'data')],
+ c_name: 'ev_previewer'
+)
+
+previewer_deps = [
+ libdocument_dep,
+ gio,
+ gtk,
+ gtk_unix_print
+]
+
+executable(
+ 'atril-previewer',
+ previewer_sources,
+ dependencies: previewer_deps,
+ link_with: [libview, libmisc],
+ include_directories: include_dirs,
+ install: true,
+)
+
+install_data(
+ 'atril-previewer.1',
+ install_dir : join_paths(prefix, get_option('mandir'), 'man1')
+)
diff --git a/shell/meson.build b/shell/meson.build
new file mode 100644
index 00000000..b3afb75c
--- /dev/null
+++ b/shell/meson.build
@@ -0,0 +1,146 @@
+shell_sources = [
+ 'eggfindbar.c',
+ 'eggfindbar.h',
+ 'ev-annotation-properties-dialog.h',
+ 'ev-annotation-properties-dialog.c',
+ 'ev-bookmarks.h',
+ 'ev-bookmarks.c',
+ 'ev-bookmark-action.h',
+ 'ev-bookmark-action.c',
+ 'ev-application.c',
+ 'ev-application.h',
+ 'ev-file-monitor.h',
+ 'ev-file-monitor.c',
+ 'ev-history.c',
+ 'ev-history.h',
+ 'ev-keyring.h',
+ 'ev-keyring.c',
+ 'ev-message-area.c',
+ 'ev-message-area.h',
+ 'ev-metadata.c',
+ 'ev-metadata.h',
+ 'ev-password-view.h',
+ 'ev-password-view.c',
+ 'ev-progress-message-area.h',
+ 'ev-progress-message-area.c',
+ 'ev-properties-dialog.c',
+ 'ev-properties-dialog.h',
+ 'ev-properties-fonts.c',
+ 'ev-properties-fonts.h',
+ 'ev-properties-license.c',
+ 'ev-properties-license.h',
+ 'ev-open-recent-action.c',
+ 'ev-open-recent-action.h',
+ 'ev-utils.c',
+ 'ev-utils.h',
+ 'ev-window.c',
+ 'ev-window.h',
+ 'ev-window-title.c',
+ 'ev-window-title.h',
+ 'ev-sidebar.c',
+ 'ev-sidebar.h',
+ 'ev-sidebar-annotations.c',
+ 'ev-sidebar-annotations.h',
+ 'ev-sidebar-attachments.c',
+ 'ev-sidebar-attachments.h',
+ 'ev-sidebar-bookmarks.h',
+ 'ev-sidebar-bookmarks.c',
+ 'ev-sidebar-layers.c',
+ 'ev-sidebar-layers.h',
+ 'ev-sidebar-links.c',
+ 'ev-sidebar-links.h',
+ 'ev-sidebar-page.c',
+ 'ev-sidebar-page.h',
+ 'ev-sidebar-thumbnails.c',
+ 'ev-sidebar-thumbnails.h',
+]
+
+ev_marshal = gnome.genmarshal(
+ 'ev-marshal',
+ sources: 'ev-marshal.list',
+ prefix: 'ev_marshal'
+)
+
+shell_sources += ev_marshal
+
+ev_resources = gnome.compile_resources(
+ 'atril-resources',
+ 'atril.gresource.xml',
+ source_dir: '../data',
+ c_name: 'ev',
+)
+
+shell_sources += ev_resources
+
+atril_deps = [
+ libdocument_dep,
+ config_h,
+ gio,
+ glib,
+ gtk,
+ libsecret,
+ math,
+]
+
+if get_option('enable_dbus')
+ dbus_generated = gnome.gdbus_codegen(
+ 'ev-gdbus-generated',
+ 'ev-gdbus.xml',
+ interface_prefix: 'org.x.reader',
+ namespace: 'Ev',
+ object_manager: true,
+ )
+
+ dbus_daemon_generated = gnome.gdbus_codegen(
+ 'ev-daemon-gdbus-generated',
+ 'ev-daemon-gdbus.xml',
+ interface_prefix: 'org.x.reader',
+ namespace: 'Ev',
+ object_manager: true,
+ )
+
+ shell_sources += dbus_generated
+
+ atrild_sources = [
+ 'ev-daemon.c',
+ ]
+
+ atrild_sources += dbus_daemon_generated
+
+ executable(
+ 'atrild',
+ atrild_sources,
+ include_directories: include_dirs,
+ dependencies: atril_deps,
+ install: true,
+ install_dir: libexecdir,
+ )
+endif
+
+libshell_deps = [
+ atril_deps,
+ libview_dep,
+ libmisc_dep,
+ libsmclient_dep,
+ libephyzoom_dep,
+]
+
+libshell = static_library(
+ 'shell',
+ shell_sources,
+ dependencies: libshell_deps,
+ include_directories: include_dirs,
+)
+
+libshell_dep = declare_dependency(
+ link_whole: libshell, # Need the whole lib for gresource lookup
+ dependencies: libshell_deps,
+ include_directories: include_dirs,
+)
+
+atril = executable(
+ 'atril',
+ 'main.c',
+ dependencies: libshell_dep,
+ install: true,
+)
diff --git a/test-driver b/test-driver
new file mode 100755
index 00000000..b8521a48
--- /dev/null
+++ b/test-driver
@@ -0,0 +1,148 @@
+#! /bin/sh
+# test-driver - basic testsuite driver script.
+
+scriptversion=2018-03-07.03; # UTC
+
+# Copyright (C) 2011-2018 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# This file is maintained in Automake, please report
+# bugs to <[email protected]> or send patches to
+
+# Make unconditional expansion of undefined variables an error. This
+# helps a lot in preventing typo-related bugs.
+set -u
+
+usage_error ()
+{
+ echo "$0: $*" >&2
+ print_usage >&2
+ exit 2
+}
+
+print_usage ()
+{
+ cat <<END
+Usage:
+ test-driver --test-name=NAME --log-file=PATH --trs-file=PATH
+ [--expect-failure={yes|no}] [--color-tests={yes|no}]
+ [--enable-hard-errors={yes|no}] [--]
+ TEST-SCRIPT [TEST-SCRIPT-ARGUMENTS]
+The '--test-name', '--log-file' and '--trs-file' options are mandatory.
+END
+}
+
+test_name= # Used for reporting.
+log_file= # Where to save the output of the test script.
+trs_file= # Where to save the metadata of the test run.
+expect_failure=no
+color_tests=no
+enable_hard_errors=yes
+while test $# -gt 0; do
+ case $1 in
+ --help) print_usage; exit $?;;
+ --version) echo "test-driver $scriptversion"; exit $?;;
+ --test-name) test_name=$2; shift;;
+ --log-file) log_file=$2; shift;;
+ --trs-file) trs_file=$2; shift;;
+ --color-tests) color_tests=$2; shift;;
+ --expect-failure) expect_failure=$2; shift;;
+ --enable-hard-errors) enable_hard_errors=$2; shift;;
+ --) shift; break;;
+ -*) usage_error "invalid option: '$1'";;
+ *) break;;
+ esac
+ shift
+done
+
+missing_opts=
+test x"$test_name" = x && missing_opts="$missing_opts --test-name"
+test x"$log_file" = x && missing_opts="$missing_opts --log-file"
+test x"$trs_file" = x && missing_opts="$missing_opts --trs-file"
+if test x"$missing_opts" != x; then
+ usage_error "the following mandatory options are missing:$missing_opts"
+fi
+
+if test $# -eq 0; then
+ usage_error "missing argument"
+fi
+
+if test $color_tests = yes; then
+ # Keep this in sync with 'lib/am/check.am:$(am__tty_colors)'.
+ red='' # Red.
+ grn='' # Green.
+ lgn='' # Light green.
+ blu='' # Blue.
+ mgn='' # Magenta.
+ std='' # No color.
+else
+ red= grn= lgn= blu= mgn= std=
+fi
+
+do_exit='rm -f $log_file $trs_file; (exit $st); exit $st'
+trap "st=129; $do_exit" 1
+trap "st=130; $do_exit" 2
+trap "st=141; $do_exit" 13
+trap "st=143; $do_exit" 15
+
+# Test script is run here.
+"$@" >$log_file 2>&1
+estatus=$?
+
+if test $enable_hard_errors = no && test $estatus -eq 99; then
+ tweaked_estatus=1
+else
+ tweaked_estatus=$estatus
+fi
+
+case $tweaked_estatus:$expect_failure in
+ 0:yes) col=$red res=XPASS recheck=yes gcopy=yes;;
+ 0:*) col=$grn res=PASS recheck=no gcopy=no;;
+ 77:*) col=$blu res=SKIP recheck=no gcopy=yes;;
+ 99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;;
+ *:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;;
+ *:*) col=$red res=FAIL recheck=yes gcopy=yes;;
+esac
+
+# Report the test outcome and exit status in the logs, so that one can
+# know whether the test passed or failed simply by looking at the '.log'
+# file, without the need of also peaking into the corresponding '.trs'
+# file (automake bug#11814).
+echo "$res $test_name (exit status: $estatus)" >>$log_file
+
+# Report outcome to console.
+echo "${col}${res}${std}: $test_name"
+
+# Register the test result, and other relevant metadata.
+echo ":test-result: $res" > $trs_file
+echo ":global-test-result: $res" >> $trs_file
+echo ":recheck: $recheck" >> $trs_file
+echo ":copy-in-global-log: $gcopy" >> $trs_file
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'before-save-hook 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC0"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/test/meson.build b/test/meson.build
new file mode 100644
index 00000000..edf23189
--- /dev/null
+++ b/test/meson.build
@@ -0,0 +1,25 @@
+test_cases = [
+ 'testFileMenu.py',
+ 'testEditMenu.py',
+ 'testHelpMenu.py',
+ 'testZoom.py',
+ 'testGoMenu.py',
+ 'testBookmarksMenu.py',
+ 'testEncryptedFile.py',
+ 'testFileReloading.py',
+ 'testWrongFileExtension.py'
+]
+
+foreach case : test_cases
+ test_script = find_program(case)
+
+ test(
+ case,
+ test_script,
+ args: [atril.full_path()],
+ is_parallel: false,
+ depends: atril,
+ workdir: join_paths(prefix, bindir),
+ timeout: 120,
+ )
+endforeach
diff --git a/test/testBookmarksMenu.py b/test/testBookmarksMenu.py
new file mode 100755
index 00000000..2f2a5324
--- /dev/null
+++ b/test/testBookmarksMenu.py
@@ -0,0 +1,24 @@
+#!/usr/bin/python3
+
+# This test opens the Bookmarks menu.
+
+from testCommon import run_app, bail
+
+from dogtail.procedural import *
+
+try:
+ run_app(file='test-links.pdf')
+
+ focus.frame('test-links.pdf')
+ click('Bookmarks', roleName='menu')
+ click('Add Bookmark', roleName='menu item')
+
+ click('Bookmarks', roleName='menu')
+ click('Page 1', roleName='menu item')
+
+ # Close
+ click('File', roleName='menu')
+ click('Close', roleName='menu item')
+
+except:
+ bail()
diff --git a/test/testCommon.py b/test/testCommon.py
new file mode 100644
index 00000000..8e95bf58
--- /dev/null
+++ b/test/testCommon.py
@@ -0,0 +1,26 @@
+#!/usr/bin/python3
+
+import os
+import sys
+import signal
+
+os.environ['LANG'] = 'C'
+
+from dogtail.config import config
+config.logDebugToStdOut = True
+config.logDebugToFile = False
+
+import dogtail.procedural as dt
+
+def run_app(file=None):
+ global pid
+
+ if file is not None:
+ arguments = os.path.join(os.path.dirname(__file__), file)
+ else:
+ arguments = ''
+ pid = dt.run(sys.argv[1], arguments=arguments, appName='xreader')
+
+def bail():
+ os.kill(pid, signal.SIGTERM)
+ sys.exit(1)
diff --git a/test/testEditMenu.py b/test/testEditMenu.py
new file mode 100755
index 00000000..5d9c672e
--- /dev/null
+++ b/test/testEditMenu.py
@@ -0,0 +1,51 @@
+#!/usr/bin/python3
+
+# This test opens the Edit menu and runs through the menu items.
+
+from testCommon import run_app, bail
+
+from dogtail.procedural import *
+
+try:
+ run_app(file='test-links.pdf')
+
+ # Begin to run through Edit options
+ focus.frame('test-links.pdf')
+ click('Edit', roleName='menu')
+
+ click('Select All', roleName='menu item')
+
+ click('Edit', roleName='menu')
+ click('Find…', roleName='menu item')
+
+ focus.frame('test-links.pdf')
+ type('link')
+ click('Find Previous', roleName='push button')
+
+ click('Edit', roleName='menu')
+ click('Find Next', roleName='menu item')
+
+ click('Edit', roleName='menu')
+ click('Find Previous', roleName='menu item')
+
+ click('Edit', roleName='menu')
+ click('Rotate Left', roleName='menu item')
+
+ click('Edit', roleName='menu')
+ click('Rotate Right', roleName='menu item')
+
+ click('Edit', roleName='menu')
+ click('Save Current Settings as Default', roleName='menu item')
+
+ click('Edit', roleName='menu')
+ click('Preferences', roleName='menu item')
+
+ focus.frame('Preferences')
+ click('Close', roleName='push button')
+
+ focus.frame('test-links.pdf')
+ click('File', roleName='menu')
+ click('Close', roleName='menu item')
+
+except:
+ bail()
diff --git a/test/testEncryptedFile.py b/test/testEncryptedFile.py
new file mode 100755
index 00000000..9b2741e5
--- /dev/null
+++ b/test/testEncryptedFile.py
@@ -0,0 +1,33 @@
+#!/usr/bin/python3
+
+# Test opening a password encrypted file and unlocking it.
+
+from testCommon import run_app, bail
+
+from dogtail.procedural import *
+
+try:
+
+ run_app(file='test-encrypt.pdf')
+
+ # Try an incorrect password first
+ focus.dialog('Enter password')
+ type('wrong password')
+ click('Unlock Document', roleName='push button')
+ focus.dialog('Enter password')
+ click('Cancel', roleName='push button')
+
+ # Try again with the correct password
+ focus.frame('test-encrypt.pdf — Password Required')
+ click('Unlock Document', roleName='push button')
+ type('Foo')
+ focus.dialog('Enter password')
+ click('Unlock Document', roleName='push button')
+
+ # Close xreader
+ focus.frame('test-encrypt.pdf — Dokument1')
+ click('File', roleName='menu')
+ click('Close', roleName='menu item')
+
+except:
+ bail()
diff --git a/test/testFileMenu.py b/test/testFileMenu.py
new file mode 100755
index 00000000..b944b83f
--- /dev/null
+++ b/test/testFileMenu.py
@@ -0,0 +1,45 @@
+#!/usr/bin/python3
+
+# Test that the File menu and menu items work correctly.
+
+from testCommon import run_app, bail
+
+from dogtail.procedural import *
+
+try:
+ run_app(file='test-links.pdf')
+
+ # Open a file
+ click('File', roleName='menu')
+ click('Open…', roleName='menu item')
+ click('Cancel', roleName='push button')
+
+ # Save a Copy
+ focus.frame('test-links.pdf')
+ click('File', roleName='menu')
+ click('Save a Copy…', roleName='menu item')
+ click('Cancel', roleName='push button')
+
+ # Print
+ focus.frame('test-links.pdf')
+ click('File', roleName='menu')
+ click('Print…', roleName='menu item')
+ focus.dialog('Print')
+ click('Cancel', roleName='push button')
+
+ # Properties
+ focus.frame('test-links.pdf')
+ click('File', roleName='menu')
+ click('Properties', roleName='menu item')
+ click('Fonts', roleName='page tab')
+ click('General', roleName='page tab')
+ focus.dialog('Properties')
+ click('Close', roleName='push button')
+
+ # Close All Windows
+ focus.frame('test-links.pdf')
+ click('File', roleName='menu')
+ click('Close All Windows', roleName='menu item')
+
+except:
+ bail()
diff --git a/test/testFileReloading.py b/test/testFileReloading.py
new file mode 100755
index 00000000..66ca2ec7
--- /dev/null
+++ b/test/testFileReloading.py
@@ -0,0 +1,27 @@
+#!/usr/bin/python3
+
+# Test reloading a document.
+
+from testCommon import run_app, bail
+
+from dogtail.procedural import *
+
+try:
+
+ run_app(file='test-page-labels.pdf')
+
+ focus.widget('page-label-entry')
+ focus.widget.text = "iii"
+ activate()
+
+ if focus.widget.text != "III":
+ click('File', roleName='menu')
+ click('Close', roleName='menu item')
+ exit (1)
+
+ # Close xreader
+ click('File', roleName='menu')
+ click('Close', roleName='menu item')
+
+except:
+ bail()
diff --git a/test/testGoMenu.py b/test/testGoMenu.py
new file mode 100755
index 00000000..3ba753b1
--- /dev/null
+++ b/test/testGoMenu.py
@@ -0,0 +1,30 @@
+#!/usr/bin/python3
+
+# This test opens the Go menu and test menu items.
+
+from testCommon import run_app, bail
+
+from dogtail.procedural import *
+
+try:
+ run_app(file='test-links.pdf')
+
+ focus.frame('test-links.pdf')
+ click('Go', roleName='menu')
+ click('Next Page', roleName='menu item')
+
+ click('Go', roleName='menu')
+ click('Previous Page', roleName='menu item')
+
+ click('Go', roleName='menu')
+ click('Last Page', roleName='menu item')
+
+ click('Go', roleName='menu')
+ click('First Page', roleName='menu item')
+
+ # Close
+ click('File', roleName='menu')
+ click('Close', roleName='menu item')
+
+except:
+ bail()
diff --git a/test/testHelpMenu.py b/test/testHelpMenu.py
new file mode 100755
index 00000000..72c1c4b1
--- /dev/null
+++ b/test/testHelpMenu.py
@@ -0,0 +1,28 @@
+#!/usr/bin/python3
+
+# This test opens the Help menu and runs through the menu items.
+
+from testCommon import run_app, bail
+
+from dogtail.procedural import *
+
+try:
+ run_app()
+
+ click('Help', roleName='menu')
+ click('About', roleName='menu item')
+ focus.dialog('About Xreader')
+ click('License', roleName='toggle button')
+ click('Close', roleName='push button')
+
+ focus.frame('Recent Documents')
+ click('Help', roleName='menu')
+ click('Contents', roleName='menu item')
+
+ keyCombo('<Control>w')
+
+ focus.frame('Recent Documents')
+ click('File', roleName='menu')
+ click('Close', roleName='menu item')
+except:
+ bail()
diff --git a/test/testWrongFileExtension.py b/test/testWrongFileExtension.py
new file mode 100755
index 00000000..3b866f6e
--- /dev/null
+++ b/test/testWrongFileExtension.py
@@ -0,0 +1,18 @@
+#!/usr/bin/python3
+
+# Test opening a file with wrong extenstion.
+
+from testCommon import run_app, bail
+
+from dogtail.procedural import *
+
+try:
+
+ run_app(file='test-mime.bin')
+
+ # Close xreader
+ click('File', roleName='menu')
+ click('Close', roleName='menu item')
+
+except:
+ bail()
diff --git a/test/testZoom.py b/test/testZoom.py
new file mode 100755
index 00000000..994a2ee9
--- /dev/null
+++ b/test/testZoom.py
@@ -0,0 +1,26 @@
+#!/usr/bin/python3
+
+# This test opens the View menu and test zoom features.
+
+from testCommon import run_app, bail
+
+from dogtail.procedural import *
+
+try:
+ run_app(file='test-links.pdf')
+
+ # Zoom In
+ focus.frame('test-links.pdf')
+ click('View', roleName='menu')
+ click('Zoom In', roleName='menu item')
+
+ # Zoom Out
+ click('View', roleName='menu')
+ click('Zoom Out', roleName='menu item')
+
+ # Close
+ click('File', roleName='menu')
+ click('Close', roleName='menu item')
+
+except:
+ bail()
diff --git a/thumbnailer/meson.build b/thumbnailer/meson.build
new file mode 100644
index 00000000..0d9cfef8
--- /dev/null
+++ b/thumbnailer/meson.build
@@ -0,0 +1,32 @@
+thumbnailer_sources = [
+ 'atril-thumbnailer.c',
+]
+
+thumbnailer_deps = [
+ libdocument_dep,
+ glib,
+ gtk,
+]
+
+executable(
+ 'atril-thumbnailer',
+ thumbnailer_sources,
+ include_directories: include_dirs,
+ dependencies: thumbnailer_deps,
+ install: true,
+)
+
+install_data(
+ 'atril-thumbnailer.1',
+ install_dir : join_paths(prefix, get_option('mandir'), 'man1')
+)
+
+mime_conf = configuration_data()
+mime_conf.set('THUMBNAILER_MIME_TYPES', thumbnailer_mime_types)
+
+mime_file = configure_file(
+ input: 'atril.thumbnailer.in',
+ output: 'atril.thumbnailer',
+ configuration: mime_conf,
+ install_dir: join_paths(datadir, 'thumbnailers')
+)