[java-atk-wrapper] JNI: Create jaw_table_cell_get_position
- From: Magdalen Berns <mberns src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [java-atk-wrapper] JNI: Create jaw_table_cell_get_position
- Date: Thu, 9 Jul 2015 14:29:00 +0000 (UTC)
commit 02f847d5841e631268b2d691a113e61c0f375557
Author: Magdalen Berns <m berns thismagpie com>
Date: Thu Jul 9 11:14:43 2015 +0100
JNI: Create jaw_table_cell_get_position
Bug https://bugzilla.gnome.org/show_bug.cgi?id=752174
jni/src/jawtablecell.c | 28 ++++++++++++++++++++++++++++
1 files changed, 28 insertions(+), 0 deletions(-)
---
diff --git a/jni/src/jawtablecell.c b/jni/src/jawtablecell.c
index b385991..f593c79 100644
--- a/jni/src/jawtablecell.c
+++ b/jni/src/jawtablecell.c
@@ -27,6 +27,7 @@ extern gpointer jaw_table_cell_data_init (jobject ac);
extern void jaw_table_cell_data_finalize (gpointer);
static AtkObject *jaw_table_cell_get_table (AtkTableCell *cell);
+static gboolean jaw_table_cell_get_position(AtkTableCell *cell, gint *row, gint *column);
typedef struct _TableCellData {
jobject atk_table_cell;
@@ -38,6 +39,7 @@ void
jaw_table_cell_interface_init (AtkTableCellIface *iface)
{
iface->get_table = jaw_table_cell_get_table;
+ iface->get_position = jaw_table_cell_get_position;
}
gpointer
@@ -99,3 +101,29 @@ jaw_table_cell_get_table(AtkTableCell *cell)
return ATK_OBJECT(jaw_impl);
}
+static gboolean
+jaw_table_cell_get_position(AtkTableCell *cell, gint *row, gint *column)
+{
+ JawObject *jaw_obj = JAW_OBJECT(cell);
+ TableCellData *data = jaw_object_get_interface_data(jaw_obj, INTERFACE_TABLE_CELL);
+ jobject jatk_table_cell = data->atk_table_cell;
+
+ JNIEnv *jniEnv = jaw_util_get_jni_env();
+ jclass classAtkTableCell = (*jniEnv)->FindClass(jniEnv,
+ "org/GNOME/Accessibility/AtkTableCell");
+ jmethodID jmid = (*jniEnv)->GetMethodID(jniEnv,
+ classAtkTableCell,
+ "getPosition",
+ "(II)Z;");
+ jboolean jposition = (*jniEnv)->CallBooleanMethod(jniEnv,
+ jatk_table_cell,
+ jmid,
+ (jint)GPOINTER_TO_INT(row),
+ (jint)GPOINTER_TO_INT(column));
+
+ if (jposition == JNI_TRUE)
+ return TRUE;
+
+ return FALSE;
+}
+
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]