[cairo] insufficiency of gdkcairo
Owen Taylor
otaylor at redhat.com
Thu Jan 19 19:42:58 PST 2006
On Thu, 2006-01-19 at 19:26 -0800, Vladimir Vukicevic wrote:
> Owen can probably reply more authoratitively, but AFAIK it's not
> possible to fix this without breaking backwards compatability with GTK
> 2
Exactly. If someone says gdk_pixmap_new() they are asking for a
windowing system buffer, and it is exposed that it is a windowing
system buffer in many ways (gdk_window_set_back_pixmap(),
GDK_DRAWABLE_XDRAWABLE(), and so forth.)
Similarly, if someone makes GDK drawing calls, like gdk_draw_line(),
they want and deserve to get exactly the same (ugly) results as
they've always gotten. Substituting some similar, but not identical
cairo call wouldn't be compatible.
A purely cairo-based GDK doesn't make sense, since GDK covers many
things that aren't in cairo: toplevel window manipulation, mouse
events, drag and drop, and so forth and so on. You could make
a much *more* cairo based GDK. Use only top-level windows and do
everything within those windows with Cairo. But that would be a new
X backend, a new Win32 backend, and so forth ... not compatible with
what we have now.
> this will probably only be possible with a backwards compat break
> with GTK 3. The problem is that many gtk programs assume things about
> the underlying implementation; that is, they use native X calls when
> running under X11, and assume that they can pull out a Drawable/Pixmap
> from a GdkPixmap, etc. I'm pretty sure that the gtk folks want to
> get to a mostly-cairo world for any drawing... but it's not possible
> to do so right now, so it's happening in incremental steps.
The mostly cairo based world is there now. Just don't use GDK rendering
calls, use Cairo rendering calls instead.
There are, as Jason observes, places in the GTK+ widgets that expect
GdkPixbuf, and this can be awkward with Cairo; in some places additional
API would help. (Support in GtkTreeView was discussed last night)
In other place, what would be most useful is to be able to draw on a
GdkPixbuf with cairo. The path to this is straightforward ... someone
just has to write the code to support GdkPixbuf format for
libpixmap. (And then we have to decide on the name.)
Regards,
Owen
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.freedesktop.org/archives/cairo/attachments/20060119/61a46565/attachment.pgp
More information about the cairo
mailing list