cssimage: Add gtk_css_image_to_string()
authorTimm Bäder <mail@baedert.org>
Fri, 24 Jan 2020 10:21:38 +0000 (11:21 +0100)
committerTimm Bäder <mail@baedert.org>
Sun, 26 Jan 2020 17:21:07 +0000 (18:21 +0100)
In line with all the other _to_string() implementations

gtk/gtkcssimage.c
gtk/gtkcssimageprivate.h

index 4b9c781d807851e805247375a58d177e389b44c5..f4cb6c59ee543997431e4b19448658be0216e11f 100644 (file)
@@ -340,6 +340,17 @@ _gtk_css_image_print (GtkCssImage *image,
   klass->print (image, string);
 }
 
+char *
+gtk_css_image_to_string (GtkCssImage *image)
+{
+  GString *str = g_string_new ("");
+
+  _gtk_css_image_print (image, str);
+
+  return g_string_free (str, FALSE);
+}
+
+
 /* Applies the algorithm outlined in
  * http://dev.w3.org/csswg/css3-images/#default-sizing
  */
index b467112e6e4e469b20ba2e1181555ac9b0d7b46c..0366d45557270c499a3462a38ca20054cff293fa 100644 (file)
@@ -127,6 +127,7 @@ GtkCssImage *  gtk_css_image_get_dynamic_image     (GtkCssImage                *
                                                     gint64                      monotonic_time);
 void           _gtk_css_image_print                (GtkCssImage                *image,
                                                     GString                    *string);
+char *         gtk_css_image_to_string             (GtkCssImage                *image);
 
 void           _gtk_css_image_get_concrete_size    (GtkCssImage                *image,
                                                     double                      specified_width,