[java-atk-wrapper/wip] JNI: create jaw_table_add_column_selection



commit 81d962ae874e756abc149b679f4731f80082215a
Author: Magdalen Berns <m berns thismagpie com>
Date:   Mon Jun 15 18:06:07 2015 +0100

    JNI: create jaw_table_add_column_selection
    
    Bug: https://bugzilla.gnome.org/show_bug.cgi?id=751008

 jni/src/jawtable.c                            |   21 +++++++++++++++++++++
 wrapper/org/GNOME/Accessibility/AtkTable.java |    6 +++---
 2 files changed, 24 insertions(+), 3 deletions(-)
---
diff --git a/jni/src/jawtable.c b/jni/src/jawtable.c
index 7173d5c..eb82114 100644
--- a/jni/src/jawtable.c
+++ b/jni/src/jawtable.c
@@ -67,6 +67,8 @@ static gboolean                       jaw_table_is_selected                   (AtkTable     
  *table,
                                                                         gint           column);
 static gboolean jaw_table_add_row_selection(AtkTable  *table,
                                             gint       row);
+static gboolean jaw_table_add_column_selection(AtkTable  *table,
+                                               gint      column);
 
 typedef struct _TableData {
        jobject atk_table;
@@ -97,6 +99,7 @@ jaw_table_interface_init (AtkTableIface *iface)
        iface->is_row_selected = jaw_table_is_row_selected;
        iface->is_selected = jaw_table_is_selected;
   iface->add_row_selection= jaw_table_add_row_selection;
+  iface->add_column_selection= jaw_table_add_column_selection;
 }
 
 gpointer
@@ -524,3 +527,21 @@ jaw_table_add_row_selection(AtkTable *table, gint row)
 
   return FALSE;
 }
+
+static gboolean
+jaw_table_add_column_selection(AtkTable *table, gint column)
+{
+  JawObject *jaw_obj = JAW_OBJECT(table);
+  TableData *data = jaw_object_get_interface_data(jaw_obj, INTERFACE_TABLE);
+  jobject atk_table = data->atk_table;
+
+  JNIEnv *jniEnv = jaw_util_get_jni_env();
+  jclass classAtkTable = (*jniEnv)->FindClass(jniEnv, "org/GNOME/Accessibility/AtkTable");
+  jmethodID jmid = (*jniEnv)->GetMethodID(jniEnv, classAtkTable, "addColumnSelection", "(I)Z");
+  jboolean jselected = (*jniEnv)->CallBooleanMethod(jniEnv, atk_table, jmid, (jint)column);
+
+  if (jselected == JNI_TRUE)
+    return TRUE;
+
+  return FALSE;
+}
diff --git a/wrapper/org/GNOME/Accessibility/AtkTable.java b/wrapper/org/GNOME/Accessibility/AtkTable.java
index ac8739a..285f95c 100644
--- a/wrapper/org/GNOME/Accessibility/AtkTable.java
+++ b/wrapper/org/GNOME/Accessibility/AtkTable.java
@@ -179,9 +179,9 @@ public class AtkTable {
                return acc_table.isAccessibleSelected(row, column);
        }
 
-       public boolean add_column_selection (int column) {
-               return false;
-       }
+  public boolean addColumnSelection (int column) {
+    return is_column_selected(column);
+  }
 
   public boolean addRowSelection (int row) {
     return is_row_selected(row);


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