[java-atk-wrapper] JNI: create jaw_object_get_parent for JawObject
- From: Magdalen Berns <mberns src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [java-atk-wrapper] JNI: create jaw_object_get_parent for JawObject
- Date: Tue, 9 Jun 2015 10:49:53 +0000 (UTC)
commit 77d39979d1b1f3c361997e906504286ba4fb1be9
Author: Magdalen Berns <m berns thismagpie com>
Date: Tue Jun 9 11:47:41 2015 +0100
JNI: create jaw_object_get_parent for JawObject
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=750620
jni/src/jawobject.c | 19 +++++++++++++++++++
1 files changed, 19 insertions(+), 0 deletions(-)
---
diff --git a/jni/src/jawobject.c b/jni/src/jawobject.c
index 37054f2..e036579 100644
--- a/jni/src/jawobject.c
+++ b/jni/src/jawobject.c
@@ -39,6 +39,7 @@ static gint jaw_object_get_index_in_parent(AtkObject *atk_obj);
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 gpointer parent_class = NULL;
@@ -55,6 +56,7 @@ jaw_object_class_init (JawObjectClass *klass)
atk_class->get_n_children = jaw_object_get_n_children;
atk_class->get_index_in_parent = jaw_object_get_index_in_parent;
atk_class->get_role = jaw_object_get_role;
+ atk_class->get_parent = jaw_object_get_parent;
atk_class->get_layer = NULL;
atk_class->get_mdi_zorder = NULL;
atk_class->ref_state_set = jaw_object_ref_state_set;
@@ -101,6 +103,23 @@ jaw_object_initialize(AtkObject *atk_obj, gpointer data)
ATK_OBJECT_CLASS (jaw_object_parent_class)->initialize(atk_obj, data);
}
+static AtkObject* jaw_object_get_parent(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,
+ "getAccessibleParent",
+ "()Ljavax/accessibility/AccessibleContext;");
+ jobject jparent = (*jniEnv)->CallObjectMethod( jniEnv, ac, jmid );
+
+ return ATK_OBJECT(jparent);
+}
+
static const gchar*
jaw_object_get_name (AtkObject *atk_obj)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]