[cairo] Porting GTK+ to use Cairo

Jost Boekemeier jost2345 at yahoo.de
Tue May 11 10:00:34 PDT 2004


has someone experience porting a toolkit to use Cairo?

* We could associate every container widget with a cairo surface. But
this may not work very well at the moment: cairo does not optimize at
all, so the picture that eventually gets send to the server will be
quite large.

So I think currently it is best to forget about transparency etc.,
render everything myself and use Cairo only to draw the visible surface
of the widget hierarchy, yes?

* If I understand Cairo correctly it renders all paths into trapezoids
and sends them to the server. This low-level protocol makes sense, but
doesn't it generate too much traffic? I fear that in the end we may get
rid of the latency but we may still not be able to run a client via a
e.g. 9600 baud connection because what we send is not much better than
compressed delta images (VNC).

Maybe someone has benchmark results that compare VNC with cairo?

* There are other issues (text rendering, object embedding), but I guess
I can ignore them for the moment.

* Not cairo related, but what do you think is the best way to route
events to the widgets and to associate a cursor with each widget?  I
think I need a "event grid" on the server-side, i.e. a grid composed of
input-only windows.  Or are there cheaper structures available on the
server side that provide such a functionality? But maybe this "event
grid" is nonsense, see below.

* gtk related: Why do most gtk widgets ask for pointer motion events?  I
can understand why someone wants button[x] motion events but why does
the menu or menuitem for example want motion events when no button is
pressed?  I think the only reason is that X has no "pointer moved less
than delta pixels, send tooltip event" so one has to implement this on
the client-side.  Or are there other reasons?

If we want the x/y position for most of the widgets anyway, we don't
need an "event grid", we can just select pointer motion events for the
top-level window to track the pointer -- setting the cursor for the
current position would require a message back to the server, but that's


More information about the cairo mailing list