Merge branch 'feature/osx_integration' into 'develop'

enable OSX dock integration

See merge request pwmt/zathura!34
This commit is contained in:
Sebastian Ramacher 2021-01-05 08:41:14 +00:00
commit bf3d1d820d
3 changed files with 37 additions and 0 deletions

View File

@ -47,6 +47,13 @@ cairo = dependency('cairo')
build_dependencies = [libm, girara, glib, gio, gthread, gmodule, gtk3, cairo] build_dependencies = [libm, girara, glib, gio, gthread, gmodule, gtk3, cairo]
if host_machine.system() == 'darwin'
gtk_mac_integration = dependency('gtk-mac-integration-gtk3')
build_dependencies += gtk_mac_integration
conf_data.set('GTKOSXAPPLICATION', true)
endif
# defines # defines
defines = [ defines = [
'-DGETTEXT_PACKAGE="zathura"', '-DGETTEXT_PACKAGE="zathura"',
@ -101,6 +108,13 @@ version_header = configure_file(
output: 'zathura-version.h', output: 'zathura-version.h',
configuration: conf_data configuration: conf_data
) )
os_dependency_header = configure_file(
input: 'zathura/os-dependency.h.in',
output: 'zathura-os-dependency.h',
configuration: conf_data
)
include_directories = [ include_directories = [
include_directories('.') include_directories('.')
] ]
@ -153,6 +167,7 @@ headers = files(
'zathura/types.h', 'zathura/types.h',
) )
headers += version_header headers += version_header
headers += os_dependency_header
# zathura helper library # zathura helper library
libzathura = static_library('zathura', libzathura = static_library('zathura',

View File

@ -1,5 +1,6 @@
/* SPDX-License-Identifier: Zlib */ /* SPDX-License-Identifier: Zlib */
#include "zathura-os-dependency.h"
#include <girara/settings.h> #include <girara/settings.h>
#include <girara/log.h> #include <girara/log.h>
@ -307,6 +308,19 @@ main(int argc, char* argv[])
goto free_and_ret; goto free_and_ret;
} }
#ifdef GTKOSXAPPLICATION
GtkosxApplication *zathuraApp;
zathuraApp = g_object_new (GTKOSX_TYPE_APPLICATION, NULL);
gtkosx_application_set_use_quartz_accelerators (zathuraApp, FALSE);
gtkosx_application_ready (zathuraApp);
{
const gchar *id = gtkosx_application_get_bundle_id ();
if (id != NULL)
{
g_print ("TestIntegration Error! Bundle Has ID %s\n", id);
}
}
#endif //GTKOSXAPPLICATION
/* run zathura */ /* run zathura */
gtk_main(); gtk_main();

View File

@ -0,0 +1,8 @@
/* SPDX-License-Identifier: Zlib */
#mesondefine GTKOSXAPPLICATION
#ifdef GTKOSXAPPLICATION
#include <gtkosxapplication.h>
#endif