[gnome-builder] libide/tweaks: add expected type helper for binding



commit ee699a5644ccb76d19cf33e5252a46dc2852f379
Author: Christian Hergert <chergert redhat com>
Date:   Wed Aug 24 21:49:44 2022 -0700

    libide/tweaks: add expected type helper for binding

 src/libide/tweaks/ide-tweaks-binding.c | 15 ++++++++++++++-
 src/libide/tweaks/ide-tweaks-binding.h | 23 +++++++++++++----------
 2 files changed, 27 insertions(+), 11 deletions(-)
---
diff --git a/src/libide/tweaks/ide-tweaks-binding.c b/src/libide/tweaks/ide-tweaks-binding.c
index 8c5331c3c..dd09fee2a 100644
--- a/src/libide/tweaks/ide-tweaks-binding.c
+++ b/src/libide/tweaks/ide-tweaks-binding.c
@@ -108,7 +108,20 @@ binding_set (Binding      *binding,
   return TRUE;
 }
 
-static gboolean
+/**
+ * ide_tweaks_binding_get_expected_type:
+ * @self: a #IdeTweaksBinding
+ * @type: (out): a #GType
+ *
+ * Gets the expected type for a binding.
+ *
+ * This is a best effort to determine the type and may end up being
+ * different based on how bindings are applied.
+ *
+ * Returns: %TRUE if succesful and @type is set, otherwise %FALSE and
+ *   @type is set to %G_TYPE_INVALID.
+ */
+gboolean
 ide_tweaks_binding_get_expected_type (IdeTweaksBinding *self,
                                       GType            *type)
 {
diff --git a/src/libide/tweaks/ide-tweaks-binding.h b/src/libide/tweaks/ide-tweaks-binding.h
index b4b3e7843..5c5b399ae 100644
--- a/src/libide/tweaks/ide-tweaks-binding.h
+++ b/src/libide/tweaks/ide-tweaks-binding.h
@@ -50,19 +50,19 @@ struct _IdeTweaksBindingClass
 };
 
 IDE_AVAILABLE_IN_ALL
-void     ide_tweaks_binding_changed             (IdeTweaksBinding *self);
+void     ide_tweaks_binding_changed             (IdeTweaksBinding          *self);
 IDE_AVAILABLE_IN_ALL
-gboolean ide_tweaks_binding_get_value           (IdeTweaksBinding *self,
-                                                 GValue           *value);
+gboolean ide_tweaks_binding_get_value           (IdeTweaksBinding          *self,
+                                                 GValue                    *value);
 IDE_AVAILABLE_IN_ALL
-void     ide_tweaks_binding_set_value           (IdeTweaksBinding *self,
-                                                 const GValue     *value);
+void     ide_tweaks_binding_set_value           (IdeTweaksBinding          *self,
+                                                 const GValue              *value);
 IDE_AVAILABLE_IN_ALL
-char    *ide_tweaks_binding_dup_string          (IdeTweaksBinding *self);
+char    *ide_tweaks_binding_dup_string          (IdeTweaksBinding          *self);
 IDE_AVAILABLE_IN_ALL
-void     ide_tweaks_binding_bind                (IdeTweaksBinding *self,
-                                                 gpointer          instance,
-                                                 const char       *property_name);
+void     ide_tweaks_binding_bind                (IdeTweaksBinding          *self,
+                                                 gpointer                   instance,
+                                                 const char                *property_name);
 IDE_AVAILABLE_IN_ALL
 void     ide_tweaks_binding_bind_with_transform (IdeTweaksBinding          *self,
                                                  gpointer                   instance,
@@ -72,6 +72,9 @@ void     ide_tweaks_binding_bind_with_transform (IdeTweaksBinding          *self
                                                  gpointer                   user_data,
                                                  GDestroyNotify             notify);
 IDE_AVAILABLE_IN_ALL
-void     ide_tweaks_binding_unbind              (IdeTweaksBinding *self);
+void     ide_tweaks_binding_unbind              (IdeTweaksBinding          *self);
+IDE_AVAILABLE_IN_ALL
+gboolean ide_tweaks_binding_get_expected_type   (IdeTweaksBinding          *self,
+                                                 GType                     *type);
 
 G_END_DECLS


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