[java-atk-wrapper] initialise using gnome_accessibility_module_init
- From: Magdalen Berns <mberns src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [java-atk-wrapper] initialise using gnome_accessibility_module_init
- Date: Fri, 2 Jan 2015 22:40:21 +0000 (UTC)
commit 86a937bf57b6a27bbfe5628e51308a4ab12b8159
Author: Magdalen Berns <m berns thismagpie com>
Date: Fri Jan 2 22:36:49 2015 +0000
initialise using gnome_accessibility_module_init
Relates to bug: https://bugzilla.gnome.org/show_bug.cgi?id=737125
configure.ac | 4 +++-
jni/src/AtkWrapper.c | 28 ++++++++++++++++++++++------
jni/src/Makefile.am | 6 ++++--
3 files changed, 29 insertions(+), 9 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 8e171f3..5a521f9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -43,12 +43,14 @@ PKG_CHECK_MODULES(JAW, [
gthread-2.0
gmodule-2.0 >= 2.0.0
gdk-2.0
- gdk-3.0
gconf-2.0
gobject-2.0
])
AC_SUBST(JAW_LIBS)
+GTK_MODULE_LIB_PATH="`pkg-config --variable=libdir gtk+-2.0`/gtk-2.0"
+AC_SUBST(GTK_MODULE_LIB_PATH)
+
case "${target_os}" in
cygwin*)
LIB_ATK_WRAPPER_LD_FLAGS="-avoid-version -no-undefined"
diff --git a/jni/src/AtkWrapper.c b/jni/src/AtkWrapper.c
index c80e343..8a20471 100644
--- a/jni/src/AtkWrapper.c
+++ b/jni/src/AtkWrapper.c
@@ -173,6 +173,28 @@ JNICALL Java_org_GNOME_Accessibility_AtkWrapper_initNativeLibrary(JNIEnv *jniEnv
return JNI_FALSE;
}
+ const gchar* gtk_module_path = g_getenv("GTK_PATH");
+ if (!gtk_module_path)
+ {
+ gtk_module_path = GTK_MODULE_LIB_PATH;
+ }
+
+ if (jaw_debug) {
+ printf("GTK_PATH=%s\n", gtk_module_path);
+ }
+
+ gtk_module_path = g_strconcat(gtk_module_path, "/modules", NULL);
+ const gchar* atk_bridge_file = g_module_build_path(gtk_module_path, "atk-bridge");
+
+ if (jaw_debug) {
+ printf("We are going to load %s\n", atk_bridge_file);
+ }
+
+ module_atk_bridge = g_module_open(atk_bridge_file, G_MODULE_BIND_LAZY);
+
+ if (!module_atk_bridge) {
+ return JNI_FALSE;
+ }
jaw_impl_init_mutex();
atk_bridge_mutex = g_new(GMutex, 1);
@@ -187,12 +209,6 @@ JNICALL Java_org_GNOME_Accessibility_AtkWrapper_initNativeLibrary(JNIEnv *jniEnv
key_dispatch_cond = g_new(GCond, 1);
g_cond_init(key_dispatch_cond);
- atk_bridge_adaptor_init(NULL,NULL);
- if (g_getenv ("AT_SPI_DEBUG"))
- {
- g_print ("Atk Accessibility bridge initialized\n");
- }
-
// Dummy idle function for jaw_idle_dispatch to get
// the address of gdk_threads_dispatch
gdk_threads_add_idle(jaw_dummy_idle_func, NULL);
diff --git a/jni/src/Makefile.am b/jni/src/Makefile.am
index b1bd59c..cd3d147 100644
--- a/jni/src/Makefile.am
+++ b/jni/src/Makefile.am
@@ -23,10 +23,12 @@ noinst_HEADERS = jawimpl.h \
jawutil.h
libatk_wrapper_la_CFLAGS = $(JNI_INCLUDES)\
- $(JAW_CFLAGS)
+ $(JAW_CFLAGS) \
+ -DGTK_MODULE_LIB_PATH=\"$(GTK_MODULE_LIB_PATH)\"
libatk_wrapper_la_CPPFLAGS = $(JNI_INCLUDES)\
- $(JAW_CFLAGS)
+ $(JAW_CFLAGS) \
+ -DGTK_MODULE_LIB_PATH=\"$(GTK_MODULE_LIB_PATH)\"
libatk_wrapper_la_LDFLAGS = $(LIB_ATK_WRAPPER_LD_FLAGS) \
$(LT_VERSION_INFO) \
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]