[gtk/wip/otte/widgetfactory-dnd: 2/7] builder: Add support for GdkContentFormats




commit caa515cbde04141ff45c04eca6076635e29185b7
Author: Benjamin Otte <otte redhat com>
Date:   Mon Jul 26 02:33:54 2021 +0200

    builder: Add support for GdkContentFormats

 gtk/gtkbuilder.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
---
diff --git a/gtk/gtkbuilder.c b/gtk/gtkbuilder.c
index 02d87ea30d..9d85e6f2ed 100644
--- a/gtk/gtkbuilder.c
+++ b/gtk/gtkbuilder.c
@@ -2242,6 +2242,23 @@ gtk_builder_value_from_string_type (GtkBuilder   *builder,
               ret = FALSE;
             }
         }
+      else if (G_VALUE_HOLDS (value, GDK_TYPE_CONTENT_FORMATS))
+        {
+          GdkContentFormats *formats;
+
+          formats = gdk_content_formats_parse (string);
+          if (formats)
+            g_value_take_boxed (value, formats);
+          else
+            {
+              g_set_error (error,
+                           GTK_BUILDER_ERROR,
+                           GTK_BUILDER_ERROR_INVALID_VALUE,
+                           "Could not parse GdkContentFormats '%s'",
+                           string);
+              ret = FALSE;
+            }
+        }
       else if (G_VALUE_HOLDS (value, GSK_TYPE_TRANSFORM))
         {
           GskTransform *transform;


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