[java-atk-wrapper] Fixed bug 593261 - Slider bar can not be controled by gok



commit fd325d7d893ed656c515695cd2c0af7d51f9ce36
Author: Ke Wang <ke wang sun com>
Date:   Fri Aug 28 12:55:00 2009 +0800

    Fixed bug 593261 - Slider bar can not be controled by gok

 jni/src/jawutil.c  |    2 +-
 jni/src/jawvalue.c |   38 +++++++++++++++++++++++++++++++++++++-
 2 files changed, 38 insertions(+), 2 deletions(-)
---
diff --git a/jni/src/jawutil.c b/jni/src/jawutil.c
index 407e96e..60a417c 100644
--- a/jni/src/jawutil.c
+++ b/jni/src/jawutil.c
@@ -757,7 +757,7 @@ jaw_util_get_atk_state_type_from_java_state (JNIEnv *jniEnv,
 	}
 
 	if (is_same_java_state( jniEnv, jobj, "COLLAPSED" )) {
-		return ATK_STATE_EXPANDED;
+		return ATK_STATE_INVALID;
 	}
 
 	if (is_same_java_state( jniEnv, jobj, "EDITABLE" )) {
diff --git a/jni/src/jawvalue.c b/jni/src/jawvalue.c
index 8836e8e..840a3c0 100644
--- a/jni/src/jawvalue.c
+++ b/jni/src/jawvalue.c
@@ -34,6 +34,8 @@ 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);
 
 typedef struct _ValueData {
 	jobject atk_value;
@@ -46,6 +48,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;
 }
 
 gpointer
@@ -209,6 +212,10 @@ jaw_value_set_current_value (AtkValue *obj, const GValue *value)
 		return FALSE;
 	}
 
+	if (!G_TYPE_IS_FUNDAMENTAL (G_VALUE_TYPE (value))) {
+		return FALSE;
+	}
+
 	JawObject *jaw_obj = JAW_OBJECT(obj);
 	ValueData *data = jaw_object_get_interface_data(jaw_obj, INTERFACE_VALUE);
 	jobject atk_value = data->atk_value;
@@ -221,7 +228,7 @@ jaw_value_set_current_value (AtkValue *obj, const GValue *value)
 	jclass klass;
 	jmethodID jmidInit;
 	jobject o;
-	switch (g_value_get_gtype(value)) {
+	switch (value->g_type) {
 		case G_TYPE_CHAR:
 		{
 			gchar c = g_value_get_char(value);
@@ -274,3 +281,32 @@ 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)
+{
+	if (!value) {
+		return;
+	}
+
+	GValue curValue = {0,};
+	atk_value_get_current_value(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);
+}
+



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