[cairo] Basic cairomm questions

Carl Worth cworth at cworth.org
Fri Aug 8 12:47:46 PDT 2008


On Fri, 2008-08-08 at 15:27 -0300, Ian Britten wrote:
> Hi all,
> I'm new to Cairo (Looks pretty good though!), and had a couple of
> (basic) questions, mostly related to cairomm (And PDF, since
> that's where I'm starting).

Hi Ian!

Welcome to cairo. I hope you have lots of fun with it!

> - Is this an appropriate place for cairomm questions?  I found the
>    documentation for it
>    (http://www.cairographics.org/documentation/cairomm/reference/)
>    but couldn't seem to find any sort of project page for it.

Yes, this is a fine place to ask cairomm questions.

> - What's the relationship between cairo and cairomm (Other than
>    the obvious C++ wrapping)?  Is it maintained by the same people
>    at the same time as cairo, or is it some sort of unofficial
>    add-on, which might be lagging behind, abandoned someday, etc?
>    [ Asked another way I guess - If I'm a C++ developer, why
>      *wouldn't* I use cairomm?  What long-term risk/concern would
>      I introduce to my project by using it? ]

It's different people, but all the same cairo community. Of course
there's always a risk that the current people doing things might stop
doing things. But said another way, there's always an opportunity for
anybody new to step up and start doing things themselves! :-)

I don't think there's any significant cairomm-specific risk that cairo
itself doesn't have. Plus, it's "just" a binding, so there's really not
that much maintenance work needed on it. So, please, feel comfortable
using it! (..along with the assurance that if you ever need to add
bindings for a couple of new cairo API calls, you are free to do so.)

> - If cairo and cairomm are "together":
>    - Should there be a link somewhere from the Cairo page to the
>      cairomm docs (at least).  Sorry if I overlooked it.

Please feel free to add any link you might feel is appropriate. All of
the cairographics.org website is a wiki that anybody can edit. Again,
more opportunities for you to help. ;-)

>    - Are they sync'd/released together, or do they maintain their
>      own independent version numbers?

I don't know about cairomm specifically, (and I'm a bit lazy to check),
but I think the general practice for bindings is to use version numbers
that match the major release numbers of cairo. So shortly after the
cairo 1.6.0 release, say, most bindings will release their own 1.6
release. Note that subsequent minor cairo releases, (1.6.4 say),
generally won't need separate binding releases, since minor cairo
releases don't add API, so the bindings don't generally need to change.

On the other hand, I suppose the bindings authors might find a need to
tweak something, and need to make subsequent releases for that. So in
general, I would recommend taking the highest available 1.6.x cairo
release and the highest available 1.6.y binding release and not worry if
x and y don't match.

But again, I'm just proposing a scheme for bindings in general. If the
cairomm folks have already adopted some other scheme then they can say
so here, (and document it in their releases).

> - What strategy does cairo(mm) use for error handling?  As a
>    specific example, if an invalid path/filename is passed to
>    the PdfSurface constructor (such that it can't create the
>    requested file), how to I know that?  Exceptions?  Error
>    numbers somewhere (Like errno)?  Inference? (ie: I get a NULL
>    back, and guess what the problem might have been)  Other?

This one is a very specific question for cairomm, and I can't answer it
at all. Hopefulyl someone maintaining cairomm can answer for you.

> - As a graphics library, I realize encodings and Unicode aren't
>    really a big concern to Cairo, but is there any definitive
>    approach to this?  Again, using the filename passed to the
>    PdfSurface constructor, what encoding/codepage is that
>    expected to be in?  Current runtime?  UTF8?  ISO-8859-1?
>    [ All our text handling is in Unicode, so I'll need to
>      address this issue anywhere I'm interfacing with relevant
>      Cairo code. ]

This is an excellent question, and not cairomm-specific. You might
actually want to raise this again in a separate thread with a
descriptive subject for this issue. (I'm guessing that Owen, with his
glib experience, might have some comments here.)

I don't recall what discussions/decisions we might have made on this
topic in the past, but the functions that accept a string for a filename
don't appear to have anything specific documented for them. (On Linux,
it's easy to just say that the string is a byte sequence that will be
handed to open(2), but we might want a better cross-platform story than
that---I don't know.)

> Well, thanks for any info.  Keep up the great work!

I hope that's helpful, and thanks for your interest in cairo.

Have fun!

-Carl




More information about the cairo mailing list