[gtk/wip/baedert/gl-rework: 2/4] cssimagescaled: Implement is_computed()



commit 5e2c61196d482f5aad40c3430f3889e1e500b690
Author: Timm Bäder <mail baedert org>
Date:   Mon Jan 20 09:26:08 2020 +0100

    cssimagescaled: Implement is_computed()

 gtk/gtkcssimagescaled.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
---
diff --git a/gtk/gtkcssimagescaled.c b/gtk/gtkcssimagescaled.c
index 5fce72949b..6dd3b05b4e 100644
--- a/gtk/gtkcssimagescaled.c
+++ b/gtk/gtkcssimagescaled.c
@@ -203,6 +203,15 @@ gtk_css_image_scaled_parse (GtkCssImage  *image,
   return TRUE;
 }
 
+static gboolean
+gtk_css_image_scaled_is_computed (GtkCssImage *image)
+{
+  GtkCssImageScaled *self = GTK_CSS_IMAGE_SCALED (image);
+
+  return self->n_images == 1 &&
+         gtk_css_image_is_computed (self->images[0]);
+}
+
 static void
 _gtk_css_image_scaled_class_init (GtkCssImageScaledClass *klass)
 {
@@ -216,6 +225,7 @@ _gtk_css_image_scaled_class_init (GtkCssImageScaledClass *klass)
   image_class->parse = gtk_css_image_scaled_parse;
   image_class->compute = gtk_css_image_scaled_compute;
   image_class->print = gtk_css_image_scaled_print;
+  image_class->is_computed = gtk_css_image_scaled_is_computed;
 
   object_class->dispose = gtk_css_image_scaled_dispose;
 }


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