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 462216 - Add gdk_cairo_set_source_drawable()
Add gdk_cairo_set_source_drawable()
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: X11
unspecified
Other All
: Normal enhancement
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2007-07-31 17:16 UTC by Behdad Esfahbod
Modified: 2010-09-27 04:27 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Behdad Esfahbod 2007-07-31 17:16:35 UTC
Currently there are the following gdkcairo functions:

cairo_t *gdk_cairo_create (GdkDrawable *drawable);

void gdk_cairo_set_source_color  (cairo_t      *cr,
                                  GdkColor     *color);
void gdk_cairo_set_source_pixbuf (cairo_t      *cr,
                                  GdkPixbuf    *pixbuf,
                                  double        pixbuf_x,
                                  double        pixbuf_y);
void gdk_cairo_set_source_pixmap (cairo_t   *cr,
                                  GdkPixmap *pixmap,
                                  double     pixmap_x,
                                  double     pixmap_y);

void gdk_cairo_rectangle (cairo_t      *cr,
                          GdkRectangle *rectangle);
void gdk_cairo_region    (cairo_t      *cr,
                          GdkRegion    *region);


One obviously missing is a function returning a cairo_surface_t for a drawable.  That still can be achieved externally by using gdk_cairo_create() and cairo_get_target() on the result.

So one way to improve it is to add something like gdk_cairo_create_surface_for_drawable() or something.  But I personally don't like that function, for one reason because the drawable is rather temporary.

Another way to improve the bindings and reduce the need for that function is to add gdk_cairo_set_source_drawable().  That goes really nice with the other set_source functions already there.
Comment 1 Matthias Clasen 2010-09-27 04:27:50 UTC
We now have gdk_cairo_set_source_window (and gdk_cairo_set_source_pixmap is gone)