[java-atk-wrapper] Don't use GTK+



commit 6ea0835061d502721afac4e9aa176164e84b8183
Author: Fridrich Štrba <fridrich strba bluewin ch>
Date:   Wed Nov 8 10:55:40 2017 +0100

    Don't use GTK+

 configure.ac         | 25 +++++++++++++++++++------
 jni/src/AtkWrapper.c | 33 +++++++++++++++------------------
 2 files changed, 34 insertions(+), 24 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index fbd8211..eee4403 100644
--- a/configure.ac
+++ b/configure.ac
@@ -32,11 +32,8 @@ PKG_CHECK_MODULES(JAW, [
   dbus-1
   glib-2.0 >= 2.32.0
   gthread-2.0
-  gdk-2.0
-  gdk-3.0
   gobject-2.0
 ])
-AC_SUBST(JAW_LIBS)
 
 LIB_ATK_WRAPPER_LD_FLAGS="-avoid-version -no-undefined"
 AC_SUBST(LIB_ATK_WRAPPER_LD_FLAGS)
@@ -68,6 +65,13 @@ if test "x$with_jdk_auto_detect" = "xyes"; then
 else
   if test -z "$JDK_SRC"; then
     AC_MSG_ERROR("You should specify JDK_SRC")
+  else
+    if test -z "$JAVA_HOME"; then
+      JAVA_HOME="${JDK_SRC}/jre"
+      if test ! -d ${JAVA_HOME}; then
+        JAVA_HOME="${JDK_SRC}"
+         fi
+       fi
   fi
 fi
 
@@ -77,7 +81,7 @@ AC_SUBST(JAVA_HOME)
 if test -z "$JAVA_HOME"; then
   JAVA_PATH=${PATH}
 else
-  JAVA_PATH=${JAVA_HOME}:${JAVA_HOME}/jre/bin:${JAVA_HOME}/bin:${JAVA_HOME}/../bin:${PATH}
+  JAVA_PATH=${JDK_SRC}:${JDK_SRC}/bin:${PATH}
 fi
 
 AC_PATH_PROG(JAVA,java,,${JAVA_PATH})
@@ -151,7 +155,11 @@ AC_SUBST(XPROP)
 AC_ARG_WITH(jardir, AS_HELP_STRING([--with-jardir=[dirname]],[Directory for installing the 
java-atk-wrapper.jar file]))
 if test -z "$with_jardir" ; then
     if test -d ${JAVA_HOME}/lib/ext ; then
-        JARDIR=${libdir}/jvm/$(basename ${JAVA_HOME})/lib/ext
+           if test "x$(basename ${JAVA_HOME})" = xjre; then
+            JARDIR=${libdir}/jvm/$(basename ${JDK_SRC})/jre/lib/ext
+               else
+                   JARDIR=${libdir}/jvm/$(basename ${JAVA_HOME})/lib/ext
+               fi
     else
         JARDIR=${libdir}/jvm/$(basename ${JAVA_HOME})/lib
     fi
@@ -165,7 +173,11 @@ if test -z "$with_propertiesdir" ; then
     if test -d ${JAVA_HOME}/conf ; then
         PROPERTIESDIR=${libdir}/jvm/$(basename ${JAVA_HOME})/conf
     else
-        PROPERTIESDIR=${libdir}/jvm/$(basename ${JAVA_HOME})/lib
+           if test "x$(basename ${JAVA_HOME})" = xjre; then
+            PROPERTIESDIR=${libdir}/jvm/$(basename ${JDK_SRC})/jre/lib
+           else
+            PROPERTIESDIR=${libdir}/jvm/$(basename ${JAVA_HOME})/lib
+               fi
     fi
 else
     PROPERTIESDIR=$with_propertiesdir
@@ -194,6 +206,7 @@ Build configuration:
        Source code location:                   ${srcdir}
        Compiler:                               ${CC}
        JDK src:                                ${JDK_SRC}
+       JAVA home:                              ${JAVA_HOME}
        Host OS:                                ${host_os}
        JNI includes:                           ${JNI_INCLUDES}
        Warn flags:                             ${WARN_CFLAGS}
diff --git a/jni/src/AtkWrapper.c b/jni/src/AtkWrapper.c
index cb2bc35..1322d45 100644
--- a/jni/src/AtkWrapper.c
+++ b/jni/src/AtkWrapper.c
@@ -23,9 +23,6 @@
 #include <stdlib.h>
 #include <glib.h>
 #include <atk-bridge.h>
-#include <gdk/gdk.h>
-#include <gdk/gdkx.h>
-#include <gtk/gtk.h>
 #include <X11/Xlib.h>
 #include "jawutil.h"
 #include "jawimpl.h"
@@ -259,7 +256,7 @@ JNICALL Java_org_GNOME_Accessibility_AtkWrapper_focusNotify(JNIEnv *jniEnv,
 {
   jobject global_ac = (*jniEnv)->NewGlobalRef(jniEnv, jAccContext);
   CallbackPara *para = alloc_callback_para(global_ac);
-  gdk_threads_add_idle(focus_notify_handler, para);
+  g_idle_add(focus_notify_handler, para);
 }
 
 static gboolean
@@ -337,7 +334,7 @@ JNICALL Java_org_GNOME_Accessibility_AtkWrapper_windowOpen(JNIEnv *jniEnv,
   jobject global_ac = (*jniEnv)->NewGlobalRef(jniEnv, jAccContext);
   CallbackPara *para = alloc_callback_para(global_ac);
   para->is_toplevel = (jIsToplevel == JNI_TRUE) ? TRUE : FALSE;
-  gdk_threads_add_idle(window_open_handler, para);
+  g_idle_add(window_open_handler, para);
 }
 
 static gboolean
@@ -414,7 +411,7 @@ JNICALL Java_org_GNOME_Accessibility_AtkWrapper_windowClose(JNIEnv *jniEnv,
   jobject global_ac = (*jniEnv)->NewGlobalRef(jniEnv, jAccContext);
   CallbackPara *para = alloc_callback_para(global_ac);
   para->is_toplevel = (jIsToplevel == JNI_TRUE) ? TRUE : FALSE;
-  gdk_threads_add_idle(window_close_handler, para);
+  g_idle_add(window_close_handler, para);
 }
 
 static gboolean
@@ -463,7 +460,7 @@ JNICALL Java_org_GNOME_Accessibility_AtkWrapper_windowMinimize(JNIEnv *jniEnv,
 {
   jobject global_ac = (*jniEnv)->NewGlobalRef(jniEnv, jAccContext);
   CallbackPara *para = alloc_callback_para(global_ac);
-  gdk_threads_add_idle(window_minimize_handler, para);
+  g_idle_add(window_minimize_handler, para);
 }
 
 static gboolean
@@ -512,7 +509,7 @@ JNIEXPORT void JNICALL Java_org_GNOME_Accessibility_AtkWrapper_windowMaximize(JN
 {
   jobject global_ac = (*jniEnv)->NewGlobalRef(jniEnv, jAccContext);
   CallbackPara *para = alloc_callback_para(global_ac );
-  gdk_threads_add_idle(window_maximize_handler, para);
+  g_idle_add(window_maximize_handler, para);
 }
 
 static gboolean
@@ -562,7 +559,7 @@ JNIEXPORT void JNICALL Java_org_GNOME_Accessibility_AtkWrapper_windowRestore(JNI
 
   jobject global_ac = (*jniEnv)->NewGlobalRef(jniEnv, jAccContext);
   CallbackPara *para = alloc_callback_para(global_ac);
-  gdk_threads_add_idle(window_restore_handler, para);
+  g_idle_add(window_restore_handler, para);
 }
 
 static gboolean
@@ -610,7 +607,7 @@ JNIEXPORT void JNICALL Java_org_GNOME_Accessibility_AtkWrapper_windowActivate(JN
 
   jobject global_ac = (*jniEnv)->NewGlobalRef(jniEnv, jAccContext);
   CallbackPara *para = alloc_callback_para(global_ac);
-  gdk_threads_add_idle(window_activate_handler, para);
+  g_idle_add(window_activate_handler, para);
 }
 
 static gboolean
@@ -660,7 +657,7 @@ JNICALL Java_org_GNOME_Accessibility_AtkWrapper_windowDeactivate(JNIEnv *jniEnv,
 
   jobject global_ac = (*jniEnv)->NewGlobalRef(jniEnv, jAccContext);
   CallbackPara *para = alloc_callback_para(global_ac);
-  gdk_threads_add_idle(window_deactivate_handler, para);
+  g_idle_add(window_deactivate_handler, para);
 }
 
 static gboolean
@@ -711,7 +708,7 @@ JNICALL Java_org_GNOME_Accessibility_AtkWrapper_windowStateChange(JNIEnv *jniEnv
 
   jobject global_ac = (*jniEnv)->NewGlobalRef(jniEnv, jAccContext);
   CallbackPara *para = alloc_callback_para(global_ac);
-  gdk_threads_add_idle(window_state_change_handler, para);
+  g_idle_add(window_state_change_handler, para);
 }
 
 static gint
@@ -1017,7 +1014,7 @@ JNICALL Java_org_GNOME_Accessibility_AtkWrapper_emitSignal(JNIEnv *jniEnv,
   CallbackPara *para = alloc_callback_para(global_ac);
   para->signal_id = (gint)id;
   para->args = global_args;
-  gdk_threads_add_idle(signal_emit_handler, para);
+  g_idle_add(signal_emit_handler, para);
 }
 
 static gboolean
@@ -1076,7 +1073,7 @@ JNICALL Java_org_GNOME_Accessibility_AtkWrapper_objectStateChange(JNIEnv *jniEnv
   } else {
     para->state_value = FALSE;
   }
-  gdk_threads_add_idle(object_state_change_handler, para);
+  g_idle_add(object_state_change_handler, para);
 }
 
 static gboolean
@@ -1133,7 +1130,7 @@ JNICALL Java_org_GNOME_Accessibility_AtkWrapper_componentAdded(JNIEnv *jniEnv,
 {
   jobject global_ac = (*jniEnv)->NewGlobalRef(jniEnv, jAccContext);
   CallbackPara *para = alloc_callback_para(global_ac);
-  gdk_threads_add_idle(component_added_handler, para);
+  g_idle_add(component_added_handler, para);
 }
 
 static gboolean
@@ -1192,7 +1189,7 @@ JNICALL Java_org_GNOME_Accessibility_AtkWrapper_componentRemoved(JNIEnv *jniEnv,
 {
   jobject global_ac = (*jniEnv)->NewGlobalRef(jniEnv, jAccContext);
   CallbackPara *para = alloc_callback_para(global_ac);
-  gdk_threads_add_idle(component_removed_handler, para);
+  g_idle_add(component_removed_handler, para);
 }
 
 /**
@@ -1253,7 +1250,7 @@ JNICALL Java_org_GNOME_Accessibility_AtkWrapper_boundsChanged(JNIEnv *jniEnv,
 {
   jobject global_ac = (*jniEnv)->NewGlobalRef(jniEnv, jAccContext);
   CallbackPara *para = alloc_callback_para(global_ac);
-  gdk_threads_add_idle(bounds_changed_handler, para);
+  g_idle_add(bounds_changed_handler, para);
 }
 
 static gboolean
@@ -1371,7 +1368,7 @@ JNICALL Java_org_GNOME_Accessibility_AtkWrapper_dispatchKeyEvent(JNIEnv *jniEnv,
 {
   jboolean key_consumed;
   jobject global_key_event = (*jniEnv)->NewGlobalRef(jniEnv, jAtkKeyEvent);
-  gdk_threads_add_idle(key_dispatch_handler, (gpointer)global_key_event);
+  g_idle_add(key_dispatch_handler, (gpointer)global_key_event);
 
   if(jaw_debug)
     printf("key_dispatch_result saved = %d\n ", key_dispatch_result);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]