[java-atk-wrapper] update to jaw_value_get_increment



commit 52d950500ca75ef3d8adbc22caae3a8d6daa7d90
Author: Magdalen Berns <m berns thismagpie com>
Date:   Mon Nov 17 23:29:17 2014 +0000

    update to jaw_value_get_increment
    
    Before the deprecated method atk_value_get_minimum_increment
    was being wrapped, it is better to wrap the current API so as
    part of the update jaw_value_get_increment replaces
    jaw_value_get_minimum_increment in this case
    
    Bug: https://bugzilla.gnome.org/show_bug.cgi?id=740282

 jni/src/jawvalue.c |   34 +++++-----------------------------
 1 files changed, 5 insertions(+), 29 deletions(-)
---
diff --git a/jni/src/jawvalue.c b/jni/src/jawvalue.c
index 75cc068..e5909fd 100644
--- a/jni/src/jawvalue.c
+++ b/jni/src/jawvalue.c
@@ -34,8 +34,7 @@ static void                   jaw_value_get_minimum_value             (AtkValue       *obj,
                                                                         GValue         *value);
 static gboolean                        jaw_value_set_current_value             (AtkValue       *obj,
                                                                         const GValue   *value);
-static void                    jaw_value_get_minimum_increment         (AtkValue       *obj,
-                                                                        GValue         *value);
+static gdouble jaw_value_get_increment (AtkValue *obj);
 
 typedef struct _ValueData {
        jobject atk_value;
@@ -48,7 +47,7 @@ jaw_value_interface_init (AtkValueIface *iface)
        iface->get_maximum_value = jaw_value_get_maximum_value;
        iface->get_minimum_value = jaw_value_get_minimum_value;
        iface->set_current_value = jaw_value_set_current_value;
-       iface->get_minimum_increment = jaw_value_get_minimum_increment;
+       iface->get_increment = jaw_value_get_increment;
 }
 
 gpointer
@@ -281,32 +280,9 @@ jaw_value_set_current_value (AtkValue *obj, const GValue *value)
        return (jbool == JNI_TRUE) ? TRUE : FALSE;
 }
 
-static void
-jaw_value_get_minimum_increment (AtkValue *obj, GValue *value)
+static gdouble
+jaw_value_get_increment (AtkValue *obj)
 {
-       if (!value) {
-               return;
-       }
-
-       GValue curValue = {0,};
-       atk_value_get_current_value_and_text(obj, &curValue);
-
-       if (G_TYPE_IS_FUNDAMENTAL (G_VALUE_TYPE (&curValue))) {
-               switch (curValue.g_type) {
-                       case G_TYPE_CHAR:
-                       case G_TYPE_INT:
-                       case G_TYPE_INT64:
-                       {
-                               g_value_init(value, G_TYPE_INT);
-                               g_value_set_int(value, 1);
-                               return;
-                       }
-                       default:
-                               break;
-               }
-       }
-
-       g_value_init(value, G_TYPE_DOUBLE);
-       g_value_set_double(value, 0.0);
+ return atk_value_get_increment(obj);
 }
 


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