[gtk] cssimage: Add gtk_css_image_to_string()



commit 1a56a10fc171d52552921237a5aa8f61974179be
Author: Timm Bäder <mail baedert org>
Date:   Fri Jan 24 11:21:38 2020 +0100

    cssimage: Add gtk_css_image_to_string()
    
    In line with all the other _to_string() implementations

 gtk/gtkcssimage.c        | 11 +++++++++++
 gtk/gtkcssimageprivate.h |  1 +
 2 files changed, 12 insertions(+)
---
diff --git a/gtk/gtkcssimage.c b/gtk/gtkcssimage.c
index 4b9c781d80..f4cb6c59ee 100644
--- a/gtk/gtkcssimage.c
+++ b/gtk/gtkcssimage.c
@@ -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
  */
diff --git a/gtk/gtkcssimageprivate.h b/gtk/gtkcssimageprivate.h
index b467112e6e..0366d45557 100644
--- a/gtk/gtkcssimageprivate.h
+++ b/gtk/gtkcssimageprivate.h
@@ -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,


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