[glibmm] Gio::Action: Fix API for get_state() and get_state_hint().



commit a1814c0f54682bac0437c94ecfb84c02345867f7
Author: Andrew Potter <agpotter gmail com>
Date:   Mon Jul 29 10:45:34 2013 +0200

    Gio::Action: Fix API for get_state() and get_state_hint().
    
    * glib/src/action.hg: get_state() and get_state_hint() now return
    a VariantBase instead of void. Bug #690134.

 gio/src/action.hg |   69 +---------------------------------------------------
 1 files changed, 2 insertions(+), 67 deletions(-)
---
diff --git a/gio/src/action.hg b/gio/src/action.hg
index 5b7152b..db2ca59 100644
--- a/gio/src/action.hg
+++ b/gio/src/action.hg
@@ -77,74 +77,9 @@ public:
   _WRAP_METHOD(Glib::ustring get_name() const, g_action_get_name)
   _WRAP_METHOD(Glib::VariantType get_parameter_type() const, g_action_get_parameter_type)
   _WRAP_METHOD(Glib::VariantType get_state_type() const, g_action_get_state_type)
-
-  //TODO: Change the return type of get_state_hint() when we can break ABI.
-  // See https://bugzilla.gnome.org/show_bug.cgi?id=690134
-  /** Requests a hint about the valid range of values for the state of
-   *  @a action.
-   *
-   * @note
-   * This method is useless in its present form. It should return Glib::VariantBase,
-   * but it returns @c void. This bug cannot be fixed until the ABI of glibmm can be broken.
-   * Meanwhile you can use the C function in glib like so:
-   * @code
-   * Glib::VariantBase state_hint = Glib::wrap(g_action_get_state_hint(myAction.gobj()));
-   * @endcode
-   * If myAction is a const object:
-   * @code
-   * Glib::VariantBase state_hint = 
Glib::wrap(g_action_get_state_hint(const_cast<GAction*>(myAction.gobj())));
-   * @endcode
-   *
-   * If <tt>0</tt> is returned it either means that the action is not stateful
-   * or that there is no hint about the valid range of values for the
-   * state of the action.
-   * 
-   * If a Variant array is returned then each item in the array is a
-   * possible value for the state.  If a Variant pair (ie: two-tuple) is
-   * returned then the tuple specifies the inclusive lower and upper bound
-   * of valid values for the state.
-   * 
-   * In any case, the information is merely a hint.  It may be possible to
-   * have a state value outside of the hinted range and setting a value
-   * within the range may fail.
-   * 
-   * @newin{2,28}
-   * @return The state range hint.
-   */
-  _WRAP_METHOD(void get_state_hint() const, g_action_get_state_hint)
-
+  _WRAP_METHOD(Glib::VariantBase get_state_hint() const, g_action_get_state_hint)
   _WRAP_METHOD(bool get_enabled() const, g_action_get_enabled)
-
-  //TODO: Change the return type of get_state() when we can break ABI.
-  // See https://bugzilla.gnome.org/show_bug.cgi?id=690134
-  // TODO: Surely it wouldn't really be an ABI break to change the return type,
-  // because nobody could possibly be using this method yet, because it is so utterly useless. murrayc
-  /** Queries the current state of @a action.
-   *
-   * @note
-   * This method is useless in its present form. It should return Glib::VariantBase,
-   * but it returns @c void. This bug cannot be fixed until the ABI of glibmm can be broken.
-   * Meanwhile you can use property_state() like so:
-   * @code
-   * Glib::VariantBase state = myAction.property_state();
-   * @endcode
-   * You can also use the C function in glib like so:
-   * @code
-   * Glib::VariantBase state = Glib::wrap(g_action_get_state(myAction.gobj()));
-   * @endcode
-   * If myAction is a const object:
-   * @code
-   * Glib::VariantBase state = Glib::wrap(g_action_get_state(const_cast<GAction*>(myAction.gobj())));
-   * @endcode
-   *
-   * If the action is not stateful then <tt>0</tt> will be returned.  If the
-   * action is stateful then the type of the return value is the type
-   * given by get_state_type().
-   * 
-   * @newin{2,28}
-   * @return The current state of the action.
-   */
-  _WRAP_METHOD(void get_state() const, g_action_get_state)
+  _WRAP_METHOD(Glib::VariantBase get_state() const, g_action_get_state)
 
   //TODO: Docs
   bool get_state_bool() const;


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