[atkmm] Value: deprecate get_minimum/maximum_range().



commit adc909c8872c3fae8601b5e050eff94048114169
Author: Murray Cumming <murrayc murrayc com>
Date:   Mon Jun 29 09:49:11 2015 +0200

    Value: deprecate get_minimum/maximum_range().
    
    Adding Range so we can add get_range() as their replacement.

 atk/src/filelist.am       |    1 +
 atk/src/range.ccg         |   30 ++++++++++++++++++++++++++++
 atk/src/range.hg          |   48 +++++++++++++++++++++++++++++++++++++++++++++
 atk/src/value.hg          |    7 ++++-
 codegen/m4/convert_atk.m4 |    2 +
 5 files changed, 86 insertions(+), 2 deletions(-)
---
diff --git a/atk/src/filelist.am b/atk/src/filelist.am
index 853c970..8dd0a1b 100644
--- a/atk/src/filelist.am
+++ b/atk/src/filelist.am
@@ -21,6 +21,7 @@ atkmm_files_hg =              \
        noopobject.hg           \
        object.hg               \
        objectaccessible.hg     \
+       range.hg                \
        relation.hg             \
        relationset.hg          \
        selection.hg            \
diff --git a/atk/src/range.ccg b/atk/src/range.ccg
new file mode 100644
index 0000000..cfa036b
--- /dev/null
+++ b/atk/src/range.ccg
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2015 The atkmm Development Team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include <atk/atk.h>
+
+namespace Atk
+{
+
+Range::Range(double lower_limit, double upper_limit, const Glib::ustring& description)
+{
+  gobject_ = atk_range_new(lower_limit, upper_limit, description.c_str());
+}
+
+} //namespace Atk
+
diff --git a/atk/src/range.hg b/atk/src/range.hg
new file mode 100644
index 0000000..73749d2
--- /dev/null
+++ b/atk/src/range.hg
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2015 The atkmm Development Team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include <glibmm/value.h>
+#include <atk/atk.h>
+
+_DEFS(atkmm,atk)
+
+namespace Atk
+{
+
+/** A given range or subrange, to be used with Atk::Value.
+ * This represents the full range of a given component (for example a slider or a range control),
+ * or, to define each individual subrange, this full range is split if available.
+ *
+ * @newin{2,24}
+ */
+class Range
+{
+  _CLASS_BOXEDTYPE(Range, AtkRange, NONE, atk_range_copy, atk_range_free)
+  _IGNORE(atk_range_copy, atk_range_free)
+public:
+ 
+  Range(double lower_limit, double upper_limit, const Glib::ustring& description);
+  _IGNORE(atk_range_new)
+
+  _WRAP_METHOD(double get_lower_limit() const, atk_range_get_lower_limit)
+  _WRAP_METHOD(double get_upper_limit() const, atk_range_get_upper_limit)
+  _WRAP_METHOD(Glib::ustring _get_description() const, atk_range_get_description)
+};
+
+} // namespace Atk
+
diff --git a/atk/src/value.hg b/atk/src/value.hg
index f7eb820..9b93e9c 100644
--- a/atk/src/value.hg
+++ b/atk/src/value.hg
@@ -20,6 +20,7 @@
 _DEFS(atkmm,atk)
 
 #include <glibmm/interface.h>
+#include <atkmm/range.h>
 
 #ifndef DOXYGEN_SHOULD_SKIP_THIS
 extern "C"
@@ -45,8 +46,8 @@ class Value : public Glib::Interface
 
 public:
   _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(void get_maximum_value(Glib::ValueBase& value) const, atk_value_get_maximum_value, deprecated 
"Use get_range() instead.")
+  _WRAP_METHOD(void get_minimum_value(Glib::ValueBase& value) const, atk_value_get_minimum_value, deprecated 
"Use get_range() instead.")
   _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.
@@ -56,6 +57,8 @@ public:
   void get_value_and_text(double& value, Glib::ustring& text);
   _IGNORE(atk_value_get_value_and_text)
 
+  _WRAP_METHOD(Range get_range() const, atk_value_get_range)
+
   _WRAP_METHOD(double get_increment(), atk_value_get_increment)
 
   _WRAP_METHOD(void set_value(const gdouble new_value), atk_value_set_value)
diff --git a/codegen/m4/convert_atk.m4 b/codegen/m4/convert_atk.m4
index df03f45..9e78ce3 100644
--- a/codegen/m4/convert_atk.m4
+++ b/codegen/m4/convert_atk.m4
@@ -40,5 +40,7 @@ _CONVERSION(`GIOChannel*',`Glib::RefPtr<Glib::IOChannel>',Glib::wrap($3))
 _CONVERSION(`Rectangle&', `AtkTextRectangle*', `&($3)')
 _CONVERSION(`const Rectangle&', `AtkTextRectangle*', `const_cast<AtkTextRectangle*>(&($3))')
 
+_CONVERSION(`AtkRange*',`Range',Glib::wrap($3))
+
 
 


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