GNOME Bugzilla – Bug 502920
gio read/write callbacks for cairo
Last modified: 2013-02-03 03:54:52 UTC
Someone should provide a pair of callback functions that can be passed to cairo to read from / write to gio files, so one can do: surface = cairo_pdf_surface_create_for_stream (gdk_cairo_ouput_stream_write, output_stream, width, height); But I'm not sure who should do that. Ideally gio, but it would need to drag in cairo.h (or hardcode a couple values from it). pangocairo is the first layer in the stack that has all the needed dependencies, but feels awkward to do it there. gdkcairo is the more natural place. Ideas?
In Berlin Alex said he doesn't mind adding this in gio proper. Alex, did that every happen?
Wouldn't it be more appropriate in GdkPixbuf, which already has gdk_pixbuf_new_from_stream? It certainly seems rather strange to implement this in Glib.
(In reply to comment #2) > Wouldn't it be more appropriate in GdkPixbuf, which already has > gdk_pixbuf_new_from_stream? It certainly seems rather strange to implement this > in Glib. It would be. But using cairo with glib to generate PS/PDF/SVG is a very legitimate usecase, and people are typically very hesitant to drag gtk+ in when not needed. It's just a couple small functions, no big deal.
There is actually a change to put this in cairo itself. The introspection guys seem to need some gobject features from cairo too...
My new take on this is to put it in the proposed cairo-glib feature/library being discussed on cairo list and gtk-devel-list right now.
closing some old bugs