Add gdk_cairo_set_source_window

And deprecate gdk_cairo_set_source_pixmap.
This commit is contained in:
Matthias Clasen 2010-09-27 19:00:10 -04:00
parent a2087c9095
commit 2e5251b405
4 changed files with 43 additions and 0 deletions

View File

@ -947,6 +947,7 @@ gdk_cairo_create
gdk_cairo_set_source_color
gdk_cairo_set_source_pixbuf
gdk_cairo_set_source_pixmap
gdk_cairo_set_source_window
gdk_cairo_rectangle
gdk_cairo_region
gdk_cairo_reset_clip

View File

@ -307,6 +307,7 @@ gdk_cairo_reset_clip
gdk_cairo_set_source_color
gdk_cairo_set_source_pixbuf
gdk_cairo_set_source_pixmap
gdk_cairo_set_source_window
gdk_cairo_rectangle
gdk_cairo_region
#endif

View File

@ -290,6 +290,10 @@ gdk_cairo_set_source_pixbuf (cairo_t *cr,
* so that the origin of @pixmap is @pixmap_x, @pixmap_y
*
* Since: 2.10
*
* Deprecated: 2.24: This function is being removed in GTK+ 3 (together
* with #GdkPixmap). Instead, use gdk_cairo_set_source_window() where
* appropriate.
**/
void
gdk_cairo_set_source_pixmap (cairo_t *cr,
@ -304,6 +308,39 @@ gdk_cairo_set_source_pixmap (cairo_t *cr,
cairo_surface_destroy (surface);
}
/**
* gdk_cairo_set_source_window:
* @cr: a #Cairo context
* @window: a #GdkWindow
* @x: X coordinate of location to place upper left corner of @window
* @y: Y coordinate of location to place upper left corner of @window
*
* Sets the given window as the source pattern for the Cairo context.
* The pattern has an extend mode of %CAIRO_EXTEND_NONE and is aligned
* so that the origin of @window is @x, @y. The window contains all its
* subwindows when rendering.
*
* Note that the contents of @window are undefined outside of the
* visible part of @window, so use this function with care.
*
* Since: 2.24
**/
void
gdk_cairo_set_source_window (cairo_t *cr,
GdkWindow *window,
double x,
double y)
{
cairo_surface_t *surface;
g_return_if_fail (cr != NULL);
g_return_if_fail (GDK_IS_WINDOW (window));
surface = _gdk_drawable_ref_cairo_surface (GDK_DRAWABLE (window));
cairo_set_source_surface (cr, surface, x, y);
cairo_surface_destroy (surface);
}
#define __GDK_CAIRO_C__
#include "gdkaliasdef.c"

View File

@ -44,6 +44,10 @@ void gdk_cairo_set_source_pixmap (cairo_t *cr,
GdkPixmap *pixmap,
double pixmap_x,
double pixmap_y);
void gdk_cairo_set_source_window (cairo_t *cr,
GdkWindow *window,
double x,
double y);
void gdk_cairo_rectangle (cairo_t *cr,
const GdkRectangle *rectangle);