[gtk/wip/otte/css: 74/79] builder: Parse GskTransform properties



commit b2399e33330afeddbda4518d1da9992e704d5011
Author: Benjamin Otte <otte redhat com>
Date:   Fri Apr 12 05:13:30 2019 +0200

    builder: Parse GskTransform properties
    
    In particular, this allows parsing the GtkFixed position properties.

 gtk/gtkbuilder.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
---
diff --git a/gtk/gtkbuilder.c b/gtk/gtkbuilder.c
index cbbed790b9..bac38f2aca 100644
--- a/gtk/gtkbuilder.c
+++ b/gtk/gtkbuilder.c
@@ -2061,6 +2061,22 @@ gtk_builder_value_from_string_type (GtkBuilder   *builder,
               ret = FALSE;
             }
         }
+      else if (G_VALUE_HOLDS (value, GSK_TYPE_TRANSFORM))
+        {
+          GskTransform *transform;
+
+          if (gsk_transform_parse (string, &transform))
+            g_value_take_boxed (value, transform);
+          else
+            {
+              g_set_error (error,
+                           GTK_BUILDER_ERROR,
+                           GTK_BUILDER_ERROR_INVALID_VALUE,
+                           "Could not parse transform '%s'",
+                           string);
+              ret = FALSE;
+            }
+        }
       else if (G_VALUE_HOLDS (value, G_TYPE_STRV))
         {
           gchar **vector = g_strsplit (string, "\n", 0);


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