[java-atk-wrapper] JNI: remove jaw_object_state_change



commit b4353ae7e5b1303111c35f9385c999802a109264
Author: Magdalen Berns <m berns thismagpie com>
Date:   Fri Jun 12 15:40:32 2015 +0100

    JNI: remove jaw_object_state_change
    
    A handler for state changes is already in AtkWrapper and
    there is a bug in jaw_object_state_change causing a
    crash so removing the wrapper function while it's not needed
    
    Bug: https://bugzilla.gnome.org/show_bug.cgi?id=750632

 jni/src/AtkWrapper.c |   18 +++++++++---------
 jni/src/jawobject.c  |   30 ------------------------------
 jni/src/jawobject.h  |    3 ---
 3 files changed, 9 insertions(+), 42 deletions(-)
---
diff --git a/jni/src/AtkWrapper.c b/jni/src/AtkWrapper.c
index 16db5ae..3a565ee 100644
--- a/jni/src/AtkWrapper.c
+++ b/jni/src/AtkWrapper.c
@@ -243,8 +243,8 @@ focus_notify_handler (gpointer p)
   }
 
   AtkObject* atk_obj = ATK_OBJECT(jaw_impl);
-  jaw_object_notify_state_change(atk_obj,
-                                 (const gchar*) ATK_STATE_SHOWING,
+  atk_object_notify_state_change(atk_obj,
+                                 ATK_STATE_SHOWING,
                                  1);
 
   free_callback_para(para);
@@ -1083,9 +1083,9 @@ object_state_change_handler (gpointer p)
     return G_SOURCE_REMOVE;
   }
 
-  jaw_object_notify_state_change(ATK_OBJECT(jaw_impl),
-                                 (const gchar*)para->atk_state,
-                                 para->state_value);
+  atk_object_notify_state_change(ATK_OBJECT(jaw_impl),
+                              para->atk_state,
+                              para->state_value);
 
   free_callback_para(para);
   return G_SOURCE_REMOVE;
@@ -1148,8 +1148,8 @@ component_added_handler (gpointer p)
   AtkObject* atk_obj = ATK_OBJECT(jaw_impl);
   if (atk_object_get_role(atk_obj) == ATK_ROLE_TOOL_TIP)
   {
-    jaw_object_notify_state_change(atk_obj,
-                                   (const gchar*)ATK_STATE_SHOWING,
+    atk_object_notify_state_change(atk_obj,
+                                   ATK_STATE_SHOWING,
                                    1);
   }
 
@@ -1210,8 +1210,8 @@ component_removed_handler (gpointer p)
     return G_SOURCE_REMOVE;
   }
   if (atk_object_get_role(atk_obj) == ATK_ROLE_TOOL_TIP)
-    jaw_object_notify_state_change(atk_obj,
-                                   (const gchar*) ATK_STATE_SHOWING,
+    atk_object_notify_state_change(atk_obj,
+                                   ATK_STATE_SHOWING,
                                    FALSE);
   free_callback_para(para);
 
diff --git a/jni/src/jawobject.c b/jni/src/jawobject.c
index 156ae25..82e5f42 100644
--- a/jni/src/jawobject.c
+++ b/jni/src/jawobject.c
@@ -41,9 +41,6 @@ static AtkRole jaw_object_get_role(AtkObject *atk_obj);
 static AtkStateSet* jaw_object_ref_state_set(AtkObject *atk_obj);
 static void jaw_object_initialize(AtkObject *jaw_obj, gpointer data);
 static AtkObject* jaw_object_get_parent(AtkObject *obj);
-static void jaw_object_state_change (AtkObject   *atk_obj,
-                                     const gchar *state,
-                                     gboolean    state_set);
 static AtkObject * jaw_object_ref_child (AtkObject *atk_obj, gint i);
 static AtkRelationSet* jaw_object_ref_relation_set(AtkObject *atk_obj);
 static void jaw_object_set_name (AtkObject *atk_obj, const gchar *name);
@@ -70,7 +67,6 @@ jaw_object_class_init (JawObjectClass *klass)
   atk_class->get_parent = jaw_object_get_parent;
   atk_class->ref_state_set = jaw_object_ref_state_set;
   atk_class->initialize = jaw_object_initialize;
-  atk_class->state_change = jaw_object_state_change;
   atk_class->ref_child = jaw_object_ref_child;
   atk_class->ref_relation_set = jaw_object_ref_relation_set;
   atk_class->set_name = jaw_object_set_name;
@@ -107,32 +103,6 @@ jaw_object_initialize(AtkObject *atk_obj, gpointer data)
  ATK_OBJECT_CLASS (jaw_object_parent_class)->initialize(atk_obj, data);
 }
 
-static void jaw_object_state_change (AtkObject   *atk_obj,
-                                            const gchar *state,
-                                            gboolean    state_set)
-{
-  JawObject *jaw_obj = JAW_OBJECT(atk_obj);
-  jobject ac = jaw_obj->acc_context;
-  JNIEnv *jniEnv = jaw_util_get_jni_env();
-
-  jclass classAccessibleContext = (*jniEnv)->FindClass(jniEnv,
-                                                       "javax/accessibility/AccessibleContext" );
-  jmethodID jmid = (*jniEnv)->GetMethodID(jniEnv,
-                                          classAccessibleContext,
-                                          "firePropertyChange",
-                                          "()Ljavax/accessibility/AccessibleContext;");
-  (*jniEnv)->CallVoidMethod( jniEnv, ac, jmid );
-
-  return;
-}
-
-void jaw_object_notify_state_change (AtkObject   *atk_obj,
-                                     const gchar *state,
-                                     gboolean    state_set)
-{
-  jaw_object_state_change(atk_obj, state, state_set);
-}
-
 static AtkObject* jaw_object_get_parent(AtkObject *atk_obj)
 {
   JawObject *jaw_obj = JAW_OBJECT(atk_obj);
diff --git a/jni/src/jawobject.h b/jni/src/jawobject.h
index 867ff93..1a05dba 100644
--- a/jni/src/jawobject.h
+++ b/jni/src/jawobject.h
@@ -55,9 +55,6 @@ struct _JawObjectClass
 };
 
 gpointer jaw_object_get_interface_data (JawObject*, guint);
-void jaw_object_notify_state_change(AtkObject   *atk_obj,
-                                    const gchar *state,
-                                    gboolean    state_set);
 AtkObject *jaw_object_peek_parent(AtkObject *atk_obj);
 
 G_END_DECLS


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