more GTK+3 support

This commit is contained in:
Sebastian Ramacher 2012-02-14 13:53:26 +01:00
parent c1d97710e4
commit 69b5cb0be5
2 changed files with 15 additions and 4 deletions

View File

@ -3,6 +3,9 @@
VERSION = 0.0.8.1
# the GTK version to use
ZATHURA_GTK_VERSION ?= 2
# paths
PREFIX ?= /usr
MANPREFIX ?= ${PREFIX}/share/man
@ -13,11 +16,11 @@ PLUGINDIR ?= ${PREFIX}/lib/zathura
# libs
# set this to 0 if you don't need to link against dl
GTK_INC ?= $(shell pkg-config --cflags gtk+-2.0)
GTK_LIB ?= $(shell pkg-config --libs gtk+-2.0 gthread-2.0)
GTK_INC ?= $(shell pkg-config --cflags gtk+-${ZATHURA_GTK_VERSION}.0)
GTK_LIB ?= $(shell pkg-config --libs gtk+-${ZATHURA_GTK_VERSION}.0 gthread-2.0)
GIRARA_INC ?= $(shell pkg-config --cflags girara-gtk2)
GIRARA_LIB ?= $(shell pkg-config --libs girara-gtk2)
GIRARA_INC ?= $(shell pkg-config --cflags girara-gtk${ZATHURA_GTK_VERSION})
GIRARA_LIB ?= $(shell pkg-config --libs girara-gtk${ZATHURA_GTK_VERSION})
SQLITE_INC ?= $(shell pkg-config --cflags sqlite3)
SQLITE_LIB ?= $(shell pkg-config --libs sqlite3)

View File

@ -38,12 +38,17 @@ zathura_t*
zathura_init(int argc, char* argv[])
{
/* parse command line options */
#if (GTK_MAJOR_VERSION == 2)
GdkNativeWindow embed = 0;
#endif
gchar* config_dir = NULL, *data_dir = NULL, *plugin_path = NULL;
bool forkback = false;
GOptionEntry entries[] =
{
#if (GTK_MAJOR_VERSION == 2)
{ "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" },
{ "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" },
@ -162,7 +167,10 @@ zathura_init(int argc, char* argv[])
g_free(configuration_file);
/* initialize girara */
#if (GTK_MAJOR_VERSION == 2)
zathura->ui.session->gtk.embed = embed;
#endif
if (girara_session_init(zathura->ui.session, "zathura") == false) {
goto error_out;
}