[java-atk-wrapper] JNI: Create jaw_object_get_object_locale



commit 73b1a6911e87ff0e6102b8836e7e483764c1d945
Author: Magdalen Berns <m berns thismagpie com>
Date:   Sun Jun 21 20:29:00 2015 +0100

    JNI: Create jaw_object_get_object_locale
    
    Patch 3cb0b94 does not apply
    
    Bug: https://bugzilla.gnome.org/show_bug.cgi?id=745340

 jni/src/jawobject.c |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)
---
diff --git a/jni/src/jawobject.c b/jni/src/jawobject.c
index 8bd30f3..aa81c64 100644
--- a/jni/src/jawobject.c
+++ b/jni/src/jawobject.c
@@ -22,6 +22,7 @@
 #include <glib.h>
 #include "jawobject.h"
 #include "jawutil.h"
+#include "jawimpl.h"
 #include "jawtoplevel.h"
 
 static void jaw_object_class_init(JawObjectClass *klass);
@@ -46,6 +47,7 @@ static void jaw_object_set_name (AtkObject *atk_obj, const gchar *name);
 static void jaw_object_set_description (AtkObject *atk_obj, const gchar *description);
 static void jaw_object_set_parent(AtkObject *atk_obj, AtkObject *parent);
 static void jaw_object_set_role (AtkObject *atk_obj, AtkRole role);
+static const gchar *jaw_object_get_object_locale (AtkObject *atk_obj);
 
 static gpointer parent_class = NULL;
 
@@ -99,6 +101,7 @@ jaw_object_class_init (JawObjectClass *klass)
   atk_class->get_parent = jaw_object_get_parent;
   atk_class->set_parent = jaw_object_set_parent;
   atk_class->set_role = jaw_object_set_role;
+  atk_class->get_object_locale = jaw_object_get_object_locale;
 
   atk_class->ref_state_set = jaw_object_ref_state_set;
   atk_class->initialize = jaw_object_initialize;
@@ -474,3 +477,23 @@ jaw_object_ref_state_set (AtkObject *atk_obj)
   return state_set;
 }
 
+static const gchar *jaw_object_get_object_locale (AtkObject *atk_obj)
+{
+  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,
+                                          "getLocale",
+                                          "()Ljavax/accessibility/AccessibleContext;");
+  jobject locale = (*jniEnv)->CallObjectMethod( jniEnv, ac, jmid );
+  JawImpl *target_obj = jaw_impl_get_instance(jniEnv, locale);
+  if(target_obj == NULL)
+    return NULL;
+
+  return atk_object_get_object_locale((AtkObject*) target_obj);
+}
+


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