[cairo] "operator" keyword in libcairo

Carl Worth cworth at cworth.org
Wed Jan 19 05:06:21 PST 2005


On Wed, 29 Dec 2004 11:07:31 -0800, Stuart Parmenter wrote:
> The problem is that the GDI+ backend code needs the cairoint code to
> not use operator anywhere.  I never checked in that patch cause keith
> and carl didn't really want it, but it needs to go in at some point to
> allow backends to ever be written using C++.

I don't recall the specific conversation, but I can certainly imagine
grumbling about C++ requirements forcing me to change my C code. In
spite of that, I certainly don't want the build to be broken for some
users.

I notice that cairoint.h currently doesn't have the extern "C" stuff
that cairo.h has. Would that help? If so, I'd be happy to add that
rather than renaming things.

Fixing cairo.h to use "op" in place of "operator" was simple as it's
just a change to a prototype. We could do something similar in
cairoint.h, but that would change a field in a structure which would
ripple through every usage of gstate->operator in the implementation.

I can accept that if there's no other way, but I don't have to like
it. I really prefer to have consistent naming for a line of code like:

	cairo_operator_t operator = CAIRO_OPERATOR_OVER;

I'd almost prefer to find a substitute word rather than do
inconsistent abbreviation like:

	cairo_operator_t op = CAIRO_OPERATOR_OVER;

But "operator" really is the right word, (both mathematically and from
following the Porter/Duff paper).

-Carl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/cairo/attachments/20050119/1af9f561/attachment.pgp


More information about the cairo mailing list