Add stubs for property_changed virtual functions
authorSøren Sandmann Pedersen <sandmann@redhat.com>
Sun, 3 May 2009 02:00:25 +0000 (22:00 -0400)
committerSøren Sandmann Pedersen <sandmann@redhat.com>
Sat, 16 May 2009 19:12:35 +0000 (15:12 -0400)
pixman/pixman-bits-image.c
pixman/pixman-conical-gradient.c
pixman/pixman-image.c
pixman/pixman-linear-gradient.c
pixman/pixman-private.h
pixman/pixman-radial-gradient.c
pixman/pixman-solid-fill.c

index 7df159f..9b0f224 100644 (file)
 #include <stdlib.h>
 #include "pixman-private.h"
 
+static void
+bits_image_property_changed (pixman_image_t *image)
+{
+    
+}
+
 static uint32_t *
 create_bits (pixman_format_code_t format,
             int                  width,
@@ -113,6 +119,11 @@ pixman_image_create_bits (pixman_format_code_t  format,
     pixman_region32_init_rect (&image->common.full_region, 0, 0,
                               image->bits.width, image->bits.height);
 
+    image->common.property_changed = bits_image_property_changed;
+    
+    bits_image_property_changed (image);
+    
     _pixman_image_reset_clip_region (image);
+
     return image;
 }
index 0b041f0..7f8853c 100644 (file)
 #include <stdlib.h>
 #include "pixman-private.h"
 
+static void
+conical_gradient_property_changed (pixman_image_t *image)
+{
+    
+}
+
 PIXMAN_EXPORT pixman_image_t *
-pixman_image_create_conical_gradient (pixman_point_fixed_t *center,
-                                     pixman_fixed_t angle,
+pixman_image_create_conical_gradient (pixman_point_fixed_t         *center,
+                                     pixman_fixed_t                angle,
                                      const pixman_gradient_stop_t *stops,
-                                     int n_stops)
+                                     int                           n_stops)
 {
     pixman_image_t *image = _pixman_image_allocate();
     conical_gradient_t *conical;
@@ -48,5 +54,9 @@ pixman_image_create_conical_gradient (pixman_point_fixed_t *center,
     conical->center = *center;
     conical->angle = angle;
 
+    image->common.property_changed = conical_gradient_property_changed;
+
+    conical_gradient_property_changed (image);
+    
     return image;
 }
index 1ee7529..42362eb 100644 (file)
@@ -240,6 +240,12 @@ _pixman_image_get_storer (pixman_image_t *image,
     }
 }
 
+static void
+image_property_changed (pixman_image_t *image)
+{
+    image->common.property_changed (image);
+}
+
 /* Ref Counting */
 PIXMAN_EXPORT pixman_image_t *
 pixman_image_ref (pixman_image_t *image)
@@ -320,17 +326,22 @@ pixman_image_set_clip_region32 (pixman_image_t *image,
                                pixman_region32_t *region)
 {
     image_common_t *common = (image_common_t *)image;
+    pixman_bool_t result;
 
     if (region)
     {
-       return pixman_region32_copy (&common->clip_region, region);
+       result = pixman_region32_copy (&common->clip_region, region);
     }
     else
     {
        _pixman_image_reset_clip_region (image);
 
-       return TRUE;
+       result = TRUE;
     }
+
+    image_property_changed (image);
+
+    return result;
 }
 
 
@@ -339,17 +350,22 @@ pixman_image_set_clip_region (pixman_image_t    *image,
                              pixman_region16_t *region)
 {
     image_common_t *common = (image_common_t *)image;
+    pixman_bool_t result;
 
     if (region)
     {
-       return pixman_region32_copy_from_region16 (&common->clip_region, region);
+       result = pixman_region32_copy_from_region16 (&common->clip_region, region);
     }
     else
     {
        _pixman_image_reset_clip_region (image);
 
-       return TRUE;
+       result = TRUE;
     }
+
+    image_property_changed (image);
+
+    return result;
 }
 
 /* Sets whether the clip region includes a clip region set by the client
@@ -359,6 +375,8 @@ pixman_image_set_has_client_clip (pixman_image_t *image,
                                  pixman_bool_t   client_clip)
 {
     image->common.has_client_clip = client_clip;
+
+    image_property_changed (image);
 }
 
 PIXMAN_EXPORT pixman_bool_t
@@ -374,6 +392,7 @@ pixman_image_set_transform (pixman_image_t           *image,
     };
 
     image_common_t *common = (image_common_t *)image;
+    pixman_bool_t result;
 
     if (common->transform == transform)
        return TRUE;
@@ -382,16 +401,24 @@ pixman_image_set_transform (pixman_image_t           *image,
     {
        free(common->transform);
        common->transform = NULL;
-       return TRUE;
+       result = TRUE;
+       goto out;
     }
 
     if (common->transform == NULL)
        common->transform = malloc (sizeof (pixman_transform_t));
+
     if (common->transform == NULL)
-       return FALSE;
+    {
+       result = FALSE;
+       goto out;
+    }
 
     memcpy(common->transform, transform, sizeof(pixman_transform_t));
 
+out:
+    image_property_changed (image);
+    
     return TRUE;
 }
 
@@ -400,6 +427,8 @@ pixman_image_set_repeat (pixman_image_t  *image,
                         pixman_repeat_t  repeat)
 {
     image->common.repeat = repeat;
+
+    image_property_changed (image);
 }
 
 PIXMAN_EXPORT pixman_bool_t
@@ -432,6 +461,8 @@ pixman_image_set_filter (pixman_image_t       *image,
 
     common->filter_params = new_params;
     common->n_filter_params = n_params;
+
+    image_property_changed (image);
     return TRUE;
 }
 
@@ -445,6 +476,8 @@ pixman_image_set_source_clipping (pixman_image_t  *image,
        common->src_clip = &common->clip_region;
     else
        common->src_clip = &common->full_region;
+
+    image_property_changed (image);
 }
 
 /* Unlike all the other property setters, this function does not
@@ -458,6 +491,8 @@ pixman_image_set_indexed (pixman_image_t     *image,
     bits_image_t *bits = (bits_image_t *)image;
 
     bits->indexed = indexed;
+
+    image_property_changed (image);
 }
 
 PIXMAN_EXPORT void
@@ -483,6 +518,8 @@ pixman_image_set_alpha_map (pixman_image_t *image,
 
     common->alpha_origin.x = x;
     common->alpha_origin.y = y;
+
+    image_property_changed (image);
 }
 
 PIXMAN_EXPORT void
@@ -490,6 +527,8 @@ pixman_image_set_component_alpha   (pixman_image_t       *image,
                                    pixman_bool_t         component_alpha)
 {
     image->common.component_alpha = component_alpha;
+
+    image_property_changed (image);
 }
 
 
@@ -502,6 +541,8 @@ pixman_image_set_accessors (pixman_image_t             *image,
 
     image->common.read_func = read_func;
     image->common.write_func = write_func;
+
+    image_property_changed (image);
 }
 
 PIXMAN_EXPORT uint32_t *
index 04bd796..2a8605c 100644 (file)
@@ -83,6 +83,12 @@ linear_gradient_classify (pixman_image_t *image,
     return image->source.class;
 }
 
+static void
+linear_gradient_property_changed (pixman_image_t *image)
+{
+    
+}
+
 PIXMAN_EXPORT pixman_image_t *
 pixman_image_create_linear_gradient (pixman_point_fixed_t         *p1,
                                     pixman_point_fixed_t         *p2,
@@ -113,6 +119,9 @@ pixman_image_create_linear_gradient (pixman_point_fixed_t         *p1,
     image->type = LINEAR;
     image->source.class = SOURCE_IMAGE_CLASS_UNKNOWN;
     image->common.classify = linear_gradient_classify;
+    image->common.property_changed = linear_gradient_property_changed;
+
+    linear_gradient_property_changed (image);
     
     return image;
 }
index 1bde4b9..9a9ec59 100644 (file)
@@ -277,12 +277,6 @@ typedef enum
     SOURCE_IMAGE_CLASS_VERTICAL,
 } source_pict_class_t;
 
-typedef source_pict_class_t (* classify_func_t) (pixman_image_t *image,
-                                                int             x,
-                                                int             y,
-                                                int             width,
-                                                int             height);
-
 typedef void (*scanStoreProc)(pixman_image_t *, int, int, int, uint32_t *);
 typedef void (*scanFetchProc)(pixman_image_t *, int, int, int, uint32_t *,
                              uint32_t *, uint32_t);
@@ -316,6 +310,13 @@ struct point
     int16_t x, y;
 };
 
+typedef source_pict_class_t (* classify_func_t) (pixman_image_t *image,
+                                                int             x,
+                                                int             y,
+                                                int             width,
+                                                int             height);
+typedef void (* property_changed_func_t)        (pixman_image_t *image);
+
 struct image_common
 {
     image_type_t               type;
@@ -335,6 +336,7 @@ struct image_common
     pixman_read_memory_func_t  read_func;
     pixman_write_memory_func_t write_func;
     classify_func_t            classify;
+    property_changed_func_t    property_changed;
 };
 
 struct source_image
index b1e617d..ca52c11 100644 (file)
 #include <stdlib.h>
 #include "pixman-private.h"
 
+static void
+radial_gradient_property_changed (pixman_image_t *image)
+{
+    
+}
+
 PIXMAN_EXPORT pixman_image_t *
 pixman_image_create_radial_gradient (pixman_point_fixed_t         *inner,
                                     pixman_point_fixed_t         *outer,
@@ -65,6 +71,10 @@ pixman_image_create_radial_gradient (pixman_point_fixed_t         *inner,
                 + radial->cdy * radial->cdy
                 - radial->dr  * radial->dr);
 
+    image->common.property_changed = radial_gradient_property_changed;
+
+    radial_gradient_property_changed (image);
+    
     return image;
 }
 
index af32d5a..2663012 100644 (file)
@@ -34,6 +34,12 @@ solid_fill_classify (pixman_image_t *image,
     return (image->source.class = SOURCE_IMAGE_CLASS_HORIZONTAL);
 }
 
+static void
+solid_fill_property_changed (pixman_image_t *image)
+{
+    
+}
+
 static uint32_t
 color_to_uint32 (const pixman_color_t *color)
 {
@@ -52,11 +58,14 @@ pixman_image_create_solid_fill (pixman_color_t *color)
     if (!img)
        return NULL;
 
-    img->source.class = SOURCE_IMAGE_CLASS_UNKNOWN;
-    img->common.classify = solid_fill_classify;
-    
     img->type = SOLID;
     img->solid.color = color_to_uint32 (color);
 
+    img->source.class = SOURCE_IMAGE_CLASS_UNKNOWN;
+    img->common.classify = solid_fill_classify;
+    img->common.property_changed = solid_fill_property_changed;
+
+    solid_fill_property_changed (img);
+    
     return img;
 }