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




commit 0781429dc5adbd890fed70ee8810f50c93d0dc07
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]