[cairo] Questions about new region API in Cairo 1.9.2

Anne et Damien Carbonne aetdcarbonne at free.fr
Mon Jul 13 03:24:56 PDT 2009


Hi,

I started to have a look at the new APIs in snapshot 1.9.2 for the Ada 
binding.
Aren't some 'const' missing ?

For example, shouldn't the following functions:

   cairo_public int
   cairo_region_num_rectangles (cairo_region_t *region);

   cairo_public void
   cairo_region_get_rectangle (cairo_region_t        *region,
                               int                    nth_rectangle,
                               cairo_rectangle_int_t *rectangle);

be declared like this:

   cairo_public int
   cairo_region_num_rectangles (*const* cairo_region_t *region);

   cairo_public void
   cairo_region_get_rectangle (*const* cairo_region_t  *region,
                               int                    nth_rectangle,
                               cairo_rectangle_int_t *rectangle);

???

The same question applies to:
  - cairo_region_is_empty
  - cairo_region_contains_rectangle
  - cairo_region_contains_point
  - cairo_region_status
  - cairo_region_get_extents

And also to:
   cairo_public cairo_status_t
   cairo_region_subtract (cairo_region_t *dst, *<const>* cairo_region_t 
*other);
  
   cairo_public cairo_status_t
   cairo_region_intersect (cairo_region_t *dst, *<const>* cairo_region_t 
*other);
  
   cairo_public cairo_status_t
   cairo_region_union (cairo_region_t *dst, <*const>* cairo_region_t 
*other);


Or do you consider that this is only "functionally" true but that the 
implementation could
do some internal stuffs (caching results, ...) that require that *const* 
can not be used ?

Regards,
Damien Carbonne


More information about the cairo mailing list