[glibmm/glibmm-2-62] Glib::Binding: Explain why SlotTransform takes GValue*



commit 75ebabf75153d0b2ea55f6d274dc2c9225216f39
Author: Kjell Ahlstedt <kjellahlstedt gmail com>
Date:   Fri Nov 15 17:01:03 2019 +0100

    Glib::Binding: Explain why SlotTransform takes GValue*
    
    Fixes #61

 glib/src/binding.hg | 10 ++++++++++
 1 file changed, 10 insertions(+)
---
diff --git a/glib/src/binding.hg b/glib/src/binding.hg
index cd219fcb..9f192727 100644
--- a/glib/src/binding.hg
+++ b/glib/src/binding.hg
@@ -126,6 +126,16 @@ public:
   template <typename T_from, typename T_to>
   using SlotTypedTransform = sigc::slot<bool, const T_from&, T_to&>;
 
+  // GValue* or Glib::ValueBase& in SlotTransform?
+  // Binding_transform_callback_common() is simpler and faster with GValue*.
+  // No need to copy between GValue and Glib::ValueBase. ValueBase would only
+  // be marginally better for users of bind_property_value(). Users would want
+  // Value<T_source> and Value<T_target>, meaning that bind_property_value()
+  // would have to be a template function. Most users would probably still
+  // prefer bind_property(). bind_property_value() is public partly because
+  // it's a good place to present documentation common to all the
+  // bind_property() overloads.
+  // See also https://gitlab.gnome.org/GNOME/glibmm/issues/61
   /** Creates a binding between @a source_property and @a target_property,
    * allowing you to set the transformation functions to be used by the binding.
    *


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