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



commit a0ee5323c94477818320aae04eae3205eb46a415
Author: Timm Bäder <mail baedert org>
Date:   Mon Jan 20 10:20:26 2020 +0100

    cssimagepaintable: Implement is_computed()

 gtk/gtkcssimagepaintable.c | 9 +++++++++
 1 file changed, 9 insertions(+)
---
diff --git a/gtk/gtkcssimagepaintable.c b/gtk/gtkcssimagepaintable.c
index 327ca90862..d4056ab263 100644
--- a/gtk/gtkcssimagepaintable.c
+++ b/gtk/gtkcssimagepaintable.c
@@ -150,6 +150,14 @@ gtk_css_image_paintable_dispose (GObject *object)
   G_OBJECT_CLASS (gtk_css_image_paintable_parent_class)->dispose (object);
 }
 
+static gboolean
+gtk_css_image_paintable_is_computed (GtkCssImage *image)
+{
+  GtkCssImagePaintable *self = GTK_CSS_IMAGE_PAINTABLE (image);
+
+  return (gdk_paintable_get_flags (self->paintable) & GDK_PAINTABLE_IMMUTABLE) == GDK_PAINTABLE_IMMUTABLE;
+}
+
 static void
 gtk_css_image_paintable_class_init (GtkCssImagePaintableClass *klass)
 {
@@ -164,6 +172,7 @@ gtk_css_image_paintable_class_init (GtkCssImagePaintableClass *klass)
   image_class->compute = gtk_css_image_paintable_compute;
   image_class->equal = gtk_css_image_paintable_equal;
   image_class->is_dynamic = gtk_css_image_paintable_is_dynamic;
+  image_class->is_computed = gtk_css_image_paintable_is_computed;
   image_class->get_dynamic_image = gtk_css_image_paintable_get_dynamic_image;
 
   object_class->dispose = gtk_css_image_paintable_dispose;


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