[cairo] X extensions

Carl Worth cworth at cworth.org
Mon Aug 8 09:30:12 PDT 2005


On Tue, 09 Aug 2005 02:15:24 +1000, Russell Shaw wrote:
> I want to add tiltable ellipses, bezier curves, and other graphic primitives as
> an X extension. I already have code for them that works. Is there an active
> developers list for X hacking?

This list sounds like an interesting place to start. We talk a lot
about how to draw things like ellipses, curves, etc. with X here.

> Does cairo replace the X graphics primitives for drawing lines and circles etc?

Cairo provides drawing primitives for stroked and filled paths, (made
up of lines, cubic Bézier splines, elliptical arcs, etc.). When
drawing to X it draws these things through the X Render extension when
available, and falls back to client-side rendering based on XPutImage
otherwise.

As far as "replacing" the X graphics primitives, I think cairo
provides an excellent replacement in terms of what is available to
programmers. I would definitely recommend anyone use cairo rather than
the X graphics primitives for drawing with X.

But, in a technical sense, cairo does not "replace" those graphics
primitives. That is, the X server still implements the same primitives
it always has, and if you call XDrawArc you'll still get the same ugly
result you would have always gotten, (as mandated by the X
specification), and you won't get something drawn with cairo.

> Is cairo used for text, or is there another api for that?

Yes, cairo has support for text rendering.

> What headers do i need to use cairo?

Using cairo with Xlib just requires the following:

	#include <cairo.h>
	#include <cairo-xlib.h>

> Does cairo have extra Xlib commands?

I'm not sure I understand that question.

> I'm programming in Xlib directly (no widget toolkit).

You might find some of our cairo-xlib demo programs useful as
reference:

	http://cvs.cairographics.org/cairo-demo/X11/

-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/20050808/e9e6be34/attachment.pgp


More information about the cairo mailing list