[java-atk-wrapper/delegate] TODO: delegate



commit 6000c50f9aa3c303894dd1c3fc6dabed6a24d347
Author: Samuel Thibault <samuel thibault ens-lyon org>
Date:   Fri Jun 14 09:08:02 2019 +0200

    TODO: delegate

 jni/src/jawimpl.c   |  7 +++++++
 jni/src/jawobject.c | 21 +++++++++++++++++++++
 jni/src/jawutil.c   |  4 ++++
 3 files changed, 32 insertions(+)
---
diff --git a/jni/src/jawimpl.c b/jni/src/jawimpl.c
index 3492b82..7596950 100644
--- a/jni/src/jawimpl.c
+++ b/jni/src/jawimpl.c
@@ -67,6 +67,7 @@ object_table_insert (JNIEnv *jniEnv, jobject ac, JawImpl* jaw_impl)
                                           classAccessibleContext,
                                           "hashCode",
                                           "()I");
+  // XXX delegate
   jaw_impl->hash_key = (gint)(*jniEnv)->CallIntMethod(jniEnv, ac, jmid);
   g_mutex_lock(&objectTableMutex);
   g_hash_table_insert(objectTable, GINT_TO_POINTER(jaw_impl->hash_key), jaw_impl);
@@ -82,6 +83,7 @@ object_table_lookup (JNIEnv *jniEnv, jobject ac)
                                           classAccessibleContext,
                                           "hashCode",
                                           "()I" );
+  // XXX delegate
   gint hash_key = (gint)(*jniEnv)->CallIntMethod( jniEnv, ac, jmid );
   gpointer value = NULL;
   g_mutex_lock(&objectTableMutex);
@@ -589,6 +591,7 @@ jaw_impl_initialize (AtkObject *atk_obj, gpointer data)
                                                 classAtkWrapper,
                                                 "registerPropertyChangeListener",
                                                 "(Ljavax/accessibility/AccessibleContext;)V");
+  // XXX delegate
   (*jniEnv)->CallStaticVoidMethod(jniEnv, classAtkWrapper, jmid, ac);
   (*jniEnv)->DeleteGlobalRef(jniEnv, ac);
 }
@@ -614,6 +617,7 @@ jaw_impl_get_parent (AtkObject *atk_obj)
                                           classAccessibleContext,
                                           "getAccessibleParent",
                                           "()Ljavax/accessibility/Accessible;");
+  // XXX delegate
   jobject jparent = (*jniEnv)->CallObjectMethod( jniEnv, ac, jmid );
   (*jniEnv)->DeleteGlobalRef(jniEnv, ac);
   if (jparent != NULL )
@@ -624,6 +628,7 @@ jaw_impl_get_parent (AtkObject *atk_obj)
                                   classAccessible,
                                   "getAccessibleContext",
                                   "()Ljavax/accessibility/AccessibleContext;");
+  // XXX delegate
     jobject parent_ac = (*jniEnv)->CallObjectMethod( jniEnv, jparent, jmid );
 
     AtkObject *obj = (AtkObject*) object_table_lookup( jniEnv, parent_ac );
@@ -651,6 +656,7 @@ jaw_impl_ref_child (AtkObject *atk_obj, gint i)
                                           classAccessibleContext,
                                           "getAccessibleChild",
                                           "(I)Ljavax/accessibility/Accessible;" );
+  // XXX delegate
   jobject jchild = (*jniEnv)->CallObjectMethod( jniEnv, ac, jmid, i );
   (*jniEnv)->DeleteGlobalRef(jniEnv, ac);
   if (jchild == NULL)
@@ -663,6 +669,7 @@ jaw_impl_ref_child (AtkObject *atk_obj, gint i)
                                 classAccessible,
                                 "getAccessibleContext",
                                 "()Ljavax/accessibility/AccessibleContext;" );
+  // XXX delegate
   jobject child_ac = (*jniEnv)->CallObjectMethod( jniEnv, jchild, jmid );
 
   AtkObject *obj = (AtkObject*) jaw_impl_get_instance_from_jaw( jniEnv, child_ac );
diff --git a/jni/src/jawobject.c b/jni/src/jawobject.c
index 5d52fb5..8eae761 100644
--- a/jni/src/jawobject.c
+++ b/jni/src/jawobject.c
@@ -215,6 +215,7 @@ static AtkObject* jaw_object_get_parent(AtkObject *atk_obj)
                                           classAccessibleContext,
                                           "getAccessibleParent",
                                           "()Ljavax/accessibility/AccessibleContext;");
+  // XXX delegate
   jobject jparent = (*jniEnv)->CallObjectMethod( jniEnv, ac, jmid );
   (*jniEnv)->DeleteGlobalRef(jniEnv, ac);
   if (jparent != NULL )
@@ -225,6 +226,7 @@ static AtkObject* jaw_object_get_parent(AtkObject *atk_obj)
                                   classAccessible,
                                   "getAccessibleContext",
                                   "()Ljavax/accessibility/AccessibleContext;");
+  // XXX delegate
     jobject parent_ac = (*jniEnv)->CallObjectMethod(jniEnv, jparent, jmid);
     AtkObject *parent_obj = (AtkObject*) jaw_object_table_lookup( jniEnv, parent_ac );
     if (parent_obj != NULL )
@@ -249,6 +251,7 @@ jaw_object_set_parent(AtkObject *atk_obj, AtkObject *parent)
                                           classAccessibleContext,
                                           "setAccessibleParent",
                                           "(Ljavax/accessibility/AccessibleContext;)");
+  // XXX delegate
   jobject jparent = (*jniEnv)->CallObjectMethod( jniEnv, ac, jmid );
   (*jniEnv)->DeleteGlobalRef(jniEnv, ac);
   if (jparent != NULL )
@@ -259,6 +262,7 @@ jaw_object_set_parent(AtkObject *atk_obj, AtkObject *parent)
                                   classAccessible,
                                   "getAccessibleContext",
                                   "()Ljavax/accessibility/AccessibleContext;");
+  // XXX delegate
     jobject parent_ac = (*jniEnv)->CallObjectMethod(jniEnv, jparent, jmid);
     AtkObject *parent_obj = (AtkObject*) jaw_object_table_lookup( jniEnv, parent_ac );
     if (parent_obj == NULL)
@@ -299,6 +303,7 @@ jaw_object_get_name (AtkObject *atk_obj)
                                           classAccessibleContext,
                                           "getAccessibleName",
                                           "()Ljava/lang/String;");
+  // XXX delegate
   jstring jstr = (*jniEnv)->CallObjectMethod( jniEnv, ac, jmid );
   (*jniEnv)->DeleteGlobalRef(jniEnv, ac);
 
@@ -341,6 +346,7 @@ static void jaw_object_set_name (AtkObject *atk_obj, const gchar *name)
                                           classAccessibleContext,
                                           "setAccessibleName",
                                           "(Ljava/lang/String;)");
+  // XXX delegate
   (*jniEnv)->CallVoidMethod( jniEnv, ac, jmid, jstr );
   (*jniEnv)->DeleteGlobalRef(jniEnv, ac);
 
@@ -377,6 +383,7 @@ jaw_object_get_description (AtkObject *atk_obj)
                                           classAccessibleContext,
                                           "getAccessibleDescription",
                                           "()Ljava/lang/String;");
+  // XXX delegate
   jstring jstr = (*jniEnv)->CallObjectMethod( jniEnv, ac, jmid );
   (*jniEnv)->DeleteGlobalRef(jniEnv, ac);
 
@@ -419,6 +426,7 @@ static void jaw_object_set_description (AtkObject *atk_obj, const gchar *descrip
                                           classAccessibleContext,
                                           "setAccessibleDescription",
                                           "(Ljava/lang/String;)");
+  // XXX delegate
   (*jniEnv)->CallVoidMethod( jniEnv, ac, jmid, jstr );
   (*jniEnv)->DeleteGlobalRef(jniEnv, ac);
 
@@ -456,6 +464,7 @@ jaw_object_get_n_children (AtkObject *atk_obj)
                                           classAccessibleContext,
                                           "getAccessibleChildrenCount",
                                           "()I");
+  // XXX delegate
   jint count = (*jniEnv)->CallIntMethod( jniEnv, ac, jmid );
   (*jniEnv)->DeleteGlobalRef(jniEnv, ac);
 
@@ -483,6 +492,7 @@ jaw_object_get_index_in_parent (AtkObject *atk_obj)
                                           classAccessibleContext,
                                           "getAccessibleIndexInParent",
                                           "()I");
+  // XXX delegate
   jint index = (*jniEnv)->CallIntMethod( jniEnv, ac, jmid );
   (*jniEnv)->DeleteGlobalRef(jniEnv, ac);
 
@@ -529,6 +539,7 @@ jaw_object_ref_state_set (AtkObject *atk_obj)
                                           classAccessibleContext,
                                           "getAccessibleStateSet",
                                           "()Ljavax/accessibility/AccessibleStateSet;" );
+  // XXX delegate
   jobject jstate_set = (*jniEnv)->CallObjectMethod( jniEnv, ac, jmid );
   (*jniEnv)->DeleteGlobalRef(jniEnv, ac);
   if (jstate_set == NULL)
@@ -541,6 +552,7 @@ jaw_object_ref_state_set (AtkObject *atk_obj)
                                 "toArray",
                                 "()[Ljavax/accessibility/AccessibleState;");
 
+  // XXX delegate
   jobjectArray jstate_arr = (*jniEnv)->CallObjectMethod( jniEnv, jstate_set, jmid );
 
   jsize jarr_size = (*jniEnv)->GetArrayLength(jniEnv, jstate_arr);
@@ -577,6 +589,7 @@ static const gchar *jaw_object_get_object_locale (AtkObject *atk_obj)
                                           classAccessibleContext,
                                           "getLocale",
                                           "()Ljavax/accessibility/AccessibleContext;");
+  // XXX delegate
   jobject locale = (*jniEnv)->CallObjectMethod( jniEnv, ac, jmid );
   (*jniEnv)->DeleteGlobalRef(jniEnv, ac);
   JawImpl *target_obj = jaw_impl_get_instance_from_jaw(jniEnv, locale);
@@ -608,6 +621,7 @@ jaw_object_ref_relation_set (AtkObject *atk_obj)
                                           classAccessibleContext,
                                           "getAccessibleRelationSet",
                                           "()Ljavax/accessibility/AccessibleRelationSet;" );
+  // XXX delegate
   jobject jrel_set = (*jniEnv)->CallObjectMethod( jniEnv, ac, jmid );
   (*jniEnv)->DeleteGlobalRef(jniEnv, ac);
 
@@ -617,6 +631,7 @@ jaw_object_ref_relation_set (AtkObject *atk_obj)
                                 classAccessibleRelationSet,
                                 "toArray",
                                 "()[Ljavax/accessibility/AccessibleRelation;");
+  // XXX delegate
   jobjectArray jrel_arr = (*jniEnv)->CallObjectMethod(jniEnv, jrel_set, jmid);
   jsize jarr_size = (*jniEnv)->GetArrayLength(jniEnv, jrel_arr);
 
@@ -630,6 +645,7 @@ jaw_object_ref_relation_set (AtkObject *atk_obj)
                                   classAccessibleRelation,
                                   "getKey",
                                   "()Ljava/lang/String;");
+  // XXX delegate
     jstring jrel_key = (*jniEnv)->CallObjectMethod( jniEnv, jrel, jmid );
     AtkRelationType rel_type = jaw_impl_get_atk_relation_type(jniEnv, jrel_key);
 
@@ -637,6 +653,7 @@ jaw_object_ref_relation_set (AtkObject *atk_obj)
                                   classAccessibleRelation,
                                   "getTarget",
                                   "()[Ljava/lang/Object;");
+  // XXX delegate
     jobjectArray jtarget_arr = (*jniEnv)->CallObjectMethod(jniEnv, jrel, jmid);
     jsize jtarget_size = (*jniEnv)->GetArrayLength(jniEnv, jtarget_arr);
 
@@ -652,6 +669,7 @@ jaw_object_ref_relation_set (AtkObject *atk_obj)
                                       classAccessible,
                                       "getAccessibleContext",
                                       "()Ljavax/accessibility/AccessibleContext;");
+  // XXX delegate
         jobject target_ac = (*jniEnv)->CallObjectMethod(jniEnv, jtarget, jmid);
 
         JawImpl *target_obj = jaw_impl_get_instance_from_jaw(jniEnv, target_ac);
@@ -685,6 +703,7 @@ jaw_object_ref_child(AtkObject *atk_obj, gint i)
                                           classAccessibleContext,
                                           "getAccessibleChild",
                                           "(I)Ljavax/accessibility/Accessible;" );
+  // XXX delegate
   jobject jchild = (*jniEnv)->CallObjectMethod( jniEnv, ac, jmid, i );
   (*jniEnv)->DeleteGlobalRef(jniEnv, ac);
   if (jchild == NULL)
@@ -697,6 +716,7 @@ jaw_object_ref_child(AtkObject *atk_obj, gint i)
                                 classAccessible,
                                 "getAccessibleContext",
                                 "()Ljavax/accessibility/AccessibleContext;" );
+  // XXX delegate
   jobject child_ac = (*jniEnv)->CallObjectMethod( jniEnv, jchild, jmid );
 
   AtkObject *obj = (AtkObject*) jaw_impl_get_instance_from_jaw( jniEnv, child_ac );
@@ -717,6 +737,7 @@ jaw_object_table_lookup (JNIEnv *jniEnv, jobject ac)
                                           classAccessibleContext,
                                           "hashCode",
                                           "()I" );
+  // XXX delegate
   gint hash_key = (gint)(*jniEnv)->CallIntMethod( jniEnv, ac, jmid );
   gpointer value = NULL;
   if (object_table == NULL)
diff --git a/jni/src/jawutil.c b/jni/src/jawutil.c
index b25c38e..8cb64a8 100644
--- a/jni/src/jawutil.c
+++ b/jni/src/jawutil.c
@@ -433,6 +433,7 @@ jaw_util_get_atk_role_from_jobj (jobject jobj)
     ac = jobj;
   } else if ((*jniEnv)->IsInstanceOf(jniEnv, jobj, classAccessible))
   {
+  // XXX delegate
     ac = (*jniEnv)->CallObjectMethod(jniEnv, jobj, jmidGetContext);
   } else {
     return ATK_ROLE_INVALID;
@@ -442,6 +443,7 @@ jaw_util_get_atk_role_from_jobj (jobject jobj)
                                                  classAccessibleContext,
                                                  "getAccessibleRole",
                                                  "()Ljavax/accessibility/AccessibleRole;");
+  // XXX delegate
   jobject ac_role = (*jniEnv)->CallObjectMethod(jniEnv, ac, jmidGetRole);
 
   if (jaw_util_is_java_acc_role(jniEnv, ac_role, "ALERT"))
@@ -575,6 +577,7 @@ jaw_util_get_atk_role_from_jobj (jobject jobj)
                                             "getAccessibleParent",
                                             "()Ljavax/accessibility/Accessible;");
 
+  // XXX delegate
     jobject parent_obj = (*jniEnv)->CallObjectMethod(jniEnv, ac, jmid);
     if (!parent_obj)
       return ATK_ROLE_RADIO_BUTTON;
@@ -645,6 +648,7 @@ jaw_util_get_atk_role_from_jobj (jobject jobj)
                                             classAccessibleContext,
                                             "getAccessibleParent",
                                             "()Ljavax/accessibility/Accessible;");
+  // XXX delegate
     jobject parent_obj = (*jniEnv)->CallObjectMethod(jniEnv, ac, jmid);
 
     if (parent_obj == NULL)


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