[cairo] Add get_width()/get_height() to pycairo svg surfaces

Bill Spitzak spitzak at thefoundry.co.uk
Wed Jul 30 16:36:49 PDT 2008


I think all the specialized surfaces should have a get function for 
anything that can be set on them. If there is a surface type xyz with 
these functions:

	cairo_xyz_surface_create(bling, level, dimensions)
	cairo_xyz_surface_set_twiddle_factor(surface, value)

Then these functions should exist:

	cairo_xyz_surface_get_bling(surface)
	cairo_xyz_surface_get_level(surface)
	cairo_xyz_surface_get_dimensions(surface)
	cairo_xyz_surface_get_twiddle_factor(surface)

This does mean that some surfaces will have to keep around a copy of 
data that it otherwise does not need after the surface is created. 
However I think in most cases this is minor and it is better than the 
user having to keep them in parallel variables.

This would mean the get_width methods described below would exist. It 
also means you could retrieve everything about the X11 surface such as 
the visual.

Steve wrote:
> On Tue, 2008-07-29 at 01:03 -0700, cairo-request at cairographics.org
> wrote:
> This addition looks useful, but if getting the width and height from SVG
> surfaces is useful for Python users then it would probably be useful for
> other language bindings and C cairo users too. In that case it would be
> better to add new functions
>   cairo_svg_surface_get_width
>   cairo_svg_surface_get_height
> into cairo itself so that they become available to all language
> bindings.

-- 
Bill Spitzak, Senior Software Engineer
The Foundry, 1 Wardour Street, London, W1D 6PA, UK
Tel: +44 (0)20 7434 0449 * Fax: +44 (0)20 7434 1550 * Web: 
www.thefoundry.co.uk
The Foundry Visionmongers Ltd * Registered in England and Wales No: 4642027



More information about the cairo mailing list