mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2025-01-30 18:54:56 +01:00
more GTK+3 support
This commit is contained in:
parent
c1d97710e4
commit
69b5cb0be5
2 changed files with 15 additions and 4 deletions
11
config.mk
11
config.mk
|
@ -3,6 +3,9 @@
|
||||||
|
|
||||||
VERSION = 0.0.8.1
|
VERSION = 0.0.8.1
|
||||||
|
|
||||||
|
# the GTK version to use
|
||||||
|
ZATHURA_GTK_VERSION ?= 2
|
||||||
|
|
||||||
# paths
|
# paths
|
||||||
PREFIX ?= /usr
|
PREFIX ?= /usr
|
||||||
MANPREFIX ?= ${PREFIX}/share/man
|
MANPREFIX ?= ${PREFIX}/share/man
|
||||||
|
@ -13,11 +16,11 @@ PLUGINDIR ?= ${PREFIX}/lib/zathura
|
||||||
# libs
|
# libs
|
||||||
|
|
||||||
# set this to 0 if you don't need to link against dl
|
# set this to 0 if you don't need to link against dl
|
||||||
GTK_INC ?= $(shell pkg-config --cflags gtk+-2.0)
|
GTK_INC ?= $(shell pkg-config --cflags gtk+-${ZATHURA_GTK_VERSION}.0)
|
||||||
GTK_LIB ?= $(shell pkg-config --libs gtk+-2.0 gthread-2.0)
|
GTK_LIB ?= $(shell pkg-config --libs gtk+-${ZATHURA_GTK_VERSION}.0 gthread-2.0)
|
||||||
|
|
||||||
GIRARA_INC ?= $(shell pkg-config --cflags girara-gtk2)
|
GIRARA_INC ?= $(shell pkg-config --cflags girara-gtk${ZATHURA_GTK_VERSION})
|
||||||
GIRARA_LIB ?= $(shell pkg-config --libs girara-gtk2)
|
GIRARA_LIB ?= $(shell pkg-config --libs girara-gtk${ZATHURA_GTK_VERSION})
|
||||||
|
|
||||||
SQLITE_INC ?= $(shell pkg-config --cflags sqlite3)
|
SQLITE_INC ?= $(shell pkg-config --cflags sqlite3)
|
||||||
SQLITE_LIB ?= $(shell pkg-config --libs sqlite3)
|
SQLITE_LIB ?= $(shell pkg-config --libs sqlite3)
|
||||||
|
|
|
@ -38,12 +38,17 @@ zathura_t*
|
||||||
zathura_init(int argc, char* argv[])
|
zathura_init(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
/* parse command line options */
|
/* parse command line options */
|
||||||
|
#if (GTK_MAJOR_VERSION == 2)
|
||||||
GdkNativeWindow embed = 0;
|
GdkNativeWindow embed = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
gchar* config_dir = NULL, *data_dir = NULL, *plugin_path = NULL;
|
gchar* config_dir = NULL, *data_dir = NULL, *plugin_path = NULL;
|
||||||
bool forkback = false;
|
bool forkback = false;
|
||||||
GOptionEntry entries[] =
|
GOptionEntry entries[] =
|
||||||
{
|
{
|
||||||
|
#if (GTK_MAJOR_VERSION == 2)
|
||||||
{ "reparent", 'e', 0, G_OPTION_ARG_INT, &embed, "Reparents to window specified by xid", "xid" },
|
{ "reparent", 'e', 0, G_OPTION_ARG_INT, &embed, "Reparents to window specified by xid", "xid" },
|
||||||
|
#endif
|
||||||
{ "config-dir", 'c', 0, G_OPTION_ARG_FILENAME, &config_dir, "Path to the config directory", "path" },
|
{ "config-dir", 'c', 0, G_OPTION_ARG_FILENAME, &config_dir, "Path to the config directory", "path" },
|
||||||
{ "data-dir", 'd', 0, G_OPTION_ARG_FILENAME, &data_dir, "Path to the data directory", "path" },
|
{ "data-dir", 'd', 0, G_OPTION_ARG_FILENAME, &data_dir, "Path to the data directory", "path" },
|
||||||
{ "plugins-dir", 'p', 0, G_OPTION_ARG_STRING, &plugin_path, "Path to the directories containing plugins", "path" },
|
{ "plugins-dir", 'p', 0, G_OPTION_ARG_STRING, &plugin_path, "Path to the directories containing plugins", "path" },
|
||||||
|
@ -162,7 +167,10 @@ zathura_init(int argc, char* argv[])
|
||||||
g_free(configuration_file);
|
g_free(configuration_file);
|
||||||
|
|
||||||
/* initialize girara */
|
/* initialize girara */
|
||||||
|
#if (GTK_MAJOR_VERSION == 2)
|
||||||
zathura->ui.session->gtk.embed = embed;
|
zathura->ui.session->gtk.embed = embed;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (girara_session_init(zathura->ui.session, "zathura") == false) {
|
if (girara_session_init(zathura->ui.session, "zathura") == false) {
|
||||||
goto error_out;
|
goto error_out;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue