[gtk/shortcuts-rebased-again: 13/135] bindings: Add more variant types



commit 292dc35ada95fa6bddb5f779a750d47e7726e62d
Author: Benjamin Otte <otte redhat com>
Date:   Sat Aug 4 12:27:30 2018 +0200

    bindings: Add more variant types
    
    Also marshal types that the code in gtkbindings.c doesn't use. These
    will be used by gtk_widget_class_add_binding_signal().

 gtk/gtkbindings.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
---
diff --git a/gtk/gtkbindings.c b/gtk/gtkbindings.c
index ad93fb51a2..3ec2a4054c 100644
--- a/gtk/gtkbindings.c
+++ b/gtk/gtkbindings.c
@@ -441,10 +441,22 @@ binding_compose_params (GObject         *object,
 
       switch ((guint) g_variant_classify (tmp_variant))
         {
+        case G_VARIANT_CLASS_BOOLEAN:
+          g_value_init (&tmp_value, G_TYPE_BOOLEAN);
+          g_value_set_boolean (&tmp_value, g_variant_get_boolean (tmp_variant));
+          break;
         case G_VARIANT_CLASS_DOUBLE:
           g_value_init (&tmp_value, G_TYPE_DOUBLE);
           g_value_set_double (&tmp_value, g_variant_get_double (tmp_variant));
           break;
+        case G_VARIANT_CLASS_INT32:
+          g_value_init (&tmp_value, G_TYPE_LONG);
+          g_value_set_long (&tmp_value, g_variant_get_int32 (tmp_variant));
+          break;
+        case G_VARIANT_CLASS_UINT32:
+          g_value_init (&tmp_value, G_TYPE_LONG);
+          g_value_set_long (&tmp_value, g_variant_get_uint32 (tmp_variant));
+          break;
         case G_VARIANT_CLASS_INT64:
           g_value_init (&tmp_value, G_TYPE_LONG);
           g_value_set_long (&tmp_value, g_variant_get_int64 (tmp_variant));


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