After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 502920 - gio read/write callbacks for cairo
gio read/write callbacks for cairo
Status: RESOLVED WONTFIX
Product: glib
Classification: Platform
Component: gio
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: Alexander Larsson
gtkdev
Depends on:
Blocks:
 
 
Reported: 2007-12-10 20:57 UTC by Behdad Esfahbod
Modified: 2013-02-03 03:54 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Behdad Esfahbod 2007-12-10 20:57:15 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?
Comment 1 Behdad Esfahbod 2008-09-09 07:16:39 UTC
In Berlin Alex said he doesn't mind adding this in gio proper.  Alex, did that every happen?
Comment 2 Christian Dywan 2008-09-09 09:31:29 UTC
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.
Comment 3 Behdad Esfahbod 2008-09-09 18:59:50 UTC
(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.
Comment 4 Behdad Esfahbod 2008-09-12 15:32:25 UTC
There is actually a change to put this in cairo itself.  The introspection guys seem to need some gobject features from cairo too...
Comment 5 Behdad Esfahbod 2008-09-15 04:37:42 UTC
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.
Comment 6 Matthias Clasen 2013-02-03 03:54:52 UTC
closing some old bugs