Add support for setting and getting accessible-value property.
authorPadraig O'Briain <padraigo@src.gnome.org>
Fri, 1 Jun 2001 15:22:33 +0000 (15:22 +0000)
committerPadraig O'Briain <padraigo@src.gnome.org>
Fri, 1 Jun 2001 15:22:33 +0000 (15:22 +0000)
* atk/atkobject.c: Add support for setting and getting
accessible-value property.
* atk/atkvalue.[ch] Make GValue in atk_value_set_current_value const

ChangeLog
atk/atkobject.c
atk/atkvalue.c
atk/atkvalue.h

index 28d12e3..4d2edfd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2001-06-01  Padraig O'Briain  <padraig.obriain@sun.com>
+
+       * atk/atkobject.c: Add support for setting and getting 
+       accessible-value property.
+       * atk/atkvalue.[ch] Make GValue in atk_value_set_current_value const
 
 Fri Jun 01  Brian Cameron <brian.cameron@sun.com>
 
index 37e3782..7be969b 100755 (executable)
@@ -184,17 +184,14 @@ atk_object_class_init (AtkObjectClass *klass)
                                                         "Is used to notify that the selection has been changed ",
                                                         ATK_TYPE_OBJECT,
                                                         G_PARAM_READWRITE));
-  /*
-   * XXX We need to reconsider the value type for this
-   */
   g_object_class_install_property (gobject_class,
                                    PROP_VALUE,
-                                   g_param_spec_int    (atk_object_name_property_value,
+                                   g_param_spec_double (atk_object_name_property_value,
                                                         "Accessible Value",
                                                         "Is used to notify that the value has been changed ",
-                                                        0,
-                                                        G_MAXINT,
-                                                        0,
+                                                        0.0,
+                                                        G_MAXDOUBLE,
+                                                        0.0,
                                                         G_PARAM_READWRITE));
   /*
    * The signal "children_changed" supports two details:
@@ -675,6 +672,10 @@ atk_object_real_set_property (GObject      *object,
     case PROP_STATE:
       g_print ("This interface does not support setting the state set of an accessible object\n");
       break;
+    case PROP_VALUE:
+      if (ATK_IS_VALUE (accessible))
+        atk_value_set_current_value (ATK_VALUE (accessible), value);
+      break;
     default:
       break;
   }
@@ -698,6 +699,10 @@ atk_object_real_get_property (GObject      *object,
     case PROP_DESCRIPTION:
       g_value_set_string (value, atk_object_get_description (accessible));
       break;
+    case PROP_VALUE:
+      if (ATK_IS_VALUE (accessible))
+        atk_value_get_current_value (ATK_VALUE (accessible), value);
+      break;
     default:
       break;
   }
index c85faa0..ac559f4 100755 (executable)
@@ -130,8 +130,8 @@ atk_value_get_minimum_value (AtkValue *obj,
  * Returns: %TRUE if new value is successfully set, %FALSE otherwise.
  **/
 gboolean
-atk_value_set_current_value (AtkValue *obj, 
-                             GValue   *value)
+atk_value_set_current_value (AtkValue       *obj, 
+                             const GValue   *value)
 {
   AtkValueIface *iface;
 
index 42f9a28..b4b3122 100755 (executable)
@@ -56,7 +56,7 @@ struct _AtkValueIface
   void     (* get_minimum_value) (AtkValue     *obj,
                                   GValue       *value);
   gboolean (* set_current_value) (AtkValue     *obj,
-                                  GValue       *value);
+                                  const GValue *value);
 
 };
 
@@ -73,7 +73,7 @@ void     atk_value_get_minimum_value  (AtkValue     *obj,
                                        GValue       *value);
 
 gboolean atk_value_set_current_value  (AtkValue     *obj,
-                                       GValue       *value);
+                                       const GValue *value);
 
 /*
  * Additional GObject properties exported by GaccessibleValue: