[atkmm] Value: Add get_value_and_text(), get_increment(), and set_value().



commit 2f08d6d191d4e0809100c21df804a8c72462c21a
Author: Murray Cumming <murrayc murrayc com>
Date:   Mon Jun 29 08:57:19 2015 +0200

    Value: Add get_value_and_text(), get_increment(), and set_value().
    
    Deprecating get_current_value() and set_current_value().

 atk/src/value.ccg |   15 +++++++++++++++
 atk/src/value.hg  |   16 ++++++++++++++--
 2 files changed, 29 insertions(+), 2 deletions(-)
---
diff --git a/atk/src/value.ccg b/atk/src/value.ccg
index 133564c..eb425fd 100644
--- a/atk/src/value.ccg
+++ b/atk/src/value.ccg
@@ -20,3 +20,18 @@
 
 #include <atk/atkvalue.h>
 
+namespace Atk
+{
+
+void Value::get_value_and_text(double& value, Glib::ustring& text)
+{
+  gchar* c_text = 0;
+  atk_value_get_value_and_text(gobj(), &(value), &c_text);
+  if (c_text) {
+    text = c_text;
+    g_free (c_text);
+  }
+}
+
+} //namespace
+
diff --git a/atk/src/value.hg b/atk/src/value.hg
index 7592e53..f7eb820 100644
--- a/atk/src/value.hg
+++ b/atk/src/value.hg
@@ -44,10 +44,22 @@ class Value : public Glib::Interface
   _CLASS_INTERFACE(Value, AtkValue, ATK_VALUE, AtkValueIface)
 
 public:
-  _WRAP_METHOD(void get_current_value(Glib::ValueBase& value) const, atk_value_get_current_value)
+  _WRAP_METHOD(void get_current_value(Glib::ValueBase& value) const, atk_value_get_current_value, deprecated 
"Use get_value_and_text() instead.")
   _WRAP_METHOD(void get_maximum_value(Glib::ValueBase& value) const, atk_value_get_maximum_value)
   _WRAP_METHOD(void get_minimum_value(Glib::ValueBase& value) const, atk_value_get_minimum_value)
-  _WRAP_METHOD(bool set_current_value(const Glib::ValueBase& value), atk_value_set_current_value)
+  _WRAP_METHOD(bool set_current_value(const Glib::ValueBase& value), atk_value_set_current_value, deprecated 
"Use set_value() instead.")
+
+  /** Gets the current value and the human readable text alternative.
+   *
+   * @newin{2,24}
+   */
+  void get_value_and_text(double& value, Glib::ustring& text);
+  _IGNORE(atk_value_get_value_and_text)
+
+  _WRAP_METHOD(double get_increment(), atk_value_get_increment)
+
+  _WRAP_METHOD(void set_value(const gdouble new_value), atk_value_set_value)
+
 
 protected:
   _WRAP_VFUNC(void get_current_value(Glib::ValueBase& value) const, get_current_value)


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