[java-atk-wrapper] Delegate setAccessibleDescription call to EDT
- From: Samuel Thibault <sthibaul src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [java-atk-wrapper] Delegate setAccessibleDescription call to EDT
- Date: Mon, 17 Jun 2019 22:00:20 +0000 (UTC)
commit ea356c397a26359f43179cb8a8ff7ce45b435561
Author: Giuseppe <giuseppecapaldo93 gmail com>
Date: Mon Jun 17 23:58:21 2019 +0200
Delegate setAccessibleDescription call to EDT
jni/src/jawobject.c | 27 ++++----------------------
wrapper/org/GNOME/Accessibility/AtkObject.java | 4 ++++
2 files changed, 8 insertions(+), 23 deletions(-)
---
diff --git a/jni/src/jawobject.c b/jni/src/jawobject.c
index d6c7e40..965f469 100644
--- a/jni/src/jawobject.c
+++ b/jni/src/jawobject.c
@@ -379,30 +379,11 @@ static void jaw_object_set_description (AtkObject *atk_obj, const gchar *descrip
jstr = (*jniEnv)->NewStringUTF(jniEnv, description);
}
- jclass classAccessibleContext = (*jniEnv)->FindClass( jniEnv,
- "javax/accessibility/AccessibleContext" );
- jmethodID jmid = (*jniEnv)->GetMethodID(jniEnv,
- classAccessibleContext,
- "setAccessibleDescription",
- "(Ljava/lang/String;)");
- (*jniEnv)->CallVoidMethod( jniEnv, ac, jmid, jstr );
- (*jniEnv)->DeleteGlobalRef(jniEnv, ac);
-
- if (description != NULL)
- {
- (*jniEnv)->ReleaseStringUTFChars(jniEnv, jaw_obj->jstrDescription, description);
- (*jniEnv)->DeleteGlobalRef(jniEnv, jaw_obj->jstrDescription);
- jaw_obj->jstrDescription = NULL;
- atk_obj->description = NULL;
- }
+ jclass atkObject = (*jniEnv)->FindClass (jniEnv, "org/GNOME/Accessibility/AtkObject");
+ jmethodID jmid = (*jniEnv)->GetStaticMethodID (jniEnv, atkObject, "setAccessibleDescription",
"(Ljavax/accessibility/AccessibleContext;Ljava/lang/String;)");
+ (*jniEnv)->CallStaticVoidMethod (jniEnv, atkObject, jmid, ac, jstr);
- if (jstr != NULL)
- {
- jaw_obj->jstrDescription = (*jniEnv)->NewGlobalRef(jniEnv, jstr);
- atk_obj->description = (gchar*)(*jniEnv)->GetStringUTFChars(jniEnv,
- jaw_obj->jstrDescription,
- NULL);
- }
+ (*jniEnv)->DeleteGlobalRef(jniEnv, ac);
}
diff --git a/wrapper/org/GNOME/Accessibility/AtkObject.java b/wrapper/org/GNOME/Accessibility/AtkObject.java
index c4f0453..3d9f1b5 100644
--- a/wrapper/org/GNOME/Accessibility/AtkObject.java
+++ b/wrapper/org/GNOME/Accessibility/AtkObject.java
@@ -59,6 +59,10 @@ public class AtkObject{
return AtkUtil.invokeInSwing( () -> { return ac.getAccessibleDescription(); }, "");
}
+ public static void setAccessibleDescription(AccessibleContext ac, String description){
+ AtkUtil.invokeInSwing( () -> { ac.setAccessibleDescription(description); } );
+ }
+
public static int hashCode(AccessibleContext ac){
return AtkUtil.invokeInSwing( () -> { return ac.hashCode(); }, 0);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]