summaryrefslogtreecommitdiff
path: root/gtk/gtkoffscreenwindow.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2010-08-26 13:46:34 +0200
committerBenjamin Otte <otte@redhat.com>2010-09-26 15:11:29 +0200
commit332652f702c3cd31a4bdccc709bef6922028185e (patch)
treeed0858cbe6b46ec909ce053741c4f805c741030f /gtk/gtkoffscreenwindow.c
parentebdf26e1d8b864e2f61b64840f4ee2d445d34009 (diff)
downloadgtk+-332652f702c3cd31a4bdccc709bef6922028185e.tar.gz
API: Change offscreen windows to use a cairo_surface_t
This requires changes to all the offscreen surface getters that used to return a GdkPixmap before.
Diffstat (limited to 'gtk/gtkoffscreenwindow.c')
-rw-r--r--gtk/gtkoffscreenwindow.c32
1 files changed, 17 insertions, 15 deletions
diff --git a/gtk/gtkoffscreenwindow.c b/gtk/gtkoffscreenwindow.c
index a2ea06c709..443a4c5ca8 100644
--- a/gtk/gtkoffscreenwindow.c
+++ b/gtk/gtkoffscreenwindow.c
@@ -37,7 +37,7 @@
*
* The idea is to take a widget and manually set the state of it,
* add it to a GtkOffscreenWindow and then retrieve the snapshot
- * as a #GdkPixmap or #GdkPixbuf.
+ * as a #cairo_surface_t or #GdkPixbuf.
*
* GtkOffscreenWindow derives from #GtkWindow only as an implementation
* detail. Applications should not use any API specific to #GtkWindow
@@ -270,24 +270,24 @@ gtk_offscreen_window_new (void)
}
/**
- * gtk_offscreen_window_get_pixmap:
+ * gtk_offscreen_window_get_surface:
* @offscreen: the #GtkOffscreenWindow contained widget.
*
* Retrieves a snapshot of the contained widget in the form of
- * a #GdkPixmap. If you need to keep this around over window
+ * a #cairo_surface_t. If you need to keep this around over window
* resizes then you should add a reference to it.
*
- * Returns: (transfer none): A #GdkPixmap pointer to the offscreen pixmap,
- * or %NULL.
+ * Returns: (transfer none): A #cairo_surface_t pointer to the offscreen
+ * surface, or %NULL.
*
* Since: 2.20
*/
-GdkPixmap *
-gtk_offscreen_window_get_pixmap (GtkOffscreenWindow *offscreen)
+cairo_surface_t *
+gtk_offscreen_window_get_surface (GtkOffscreenWindow *offscreen)
{
g_return_val_if_fail (GTK_IS_OFFSCREEN_WINDOW (offscreen), NULL);
- return gdk_offscreen_window_get_pixmap (gtk_widget_get_window (GTK_WIDGET (offscreen)));
+ return gdk_offscreen_window_get_surface (gtk_widget_get_window (GTK_WIDGET (offscreen)));
}
/**
@@ -306,22 +306,24 @@ gtk_offscreen_window_get_pixmap (GtkOffscreenWindow *offscreen)
GdkPixbuf *
gtk_offscreen_window_get_pixbuf (GtkOffscreenWindow *offscreen)
{
- GdkPixmap *pixmap = NULL;
+ cairo_surface_t *surface;
GdkPixbuf *pixbuf = NULL;
+ GdkWindow *window;
g_return_val_if_fail (GTK_IS_OFFSCREEN_WINDOW (offscreen), NULL);
- pixmap = gdk_offscreen_window_get_pixmap (gtk_widget_get_window (GTK_WIDGET (offscreen)));
+ window = gtk_widget_get_window (GTK_WIDGET (offscreen));
+ surface = gdk_offscreen_window_get_surface (window);
- if (pixmap != NULL)
+ if (surface != NULL)
{
gint width, height;
- gdk_drawable_get_size (pixmap, &width, &height);
+ gdk_drawable_get_size (window, &width, &height);
- pixbuf = gdk_pixbuf_get_from_drawable (NULL, pixmap, NULL,
- 0, 0, 0, 0,
- width, height);
+ pixbuf = gdk_pixbuf_get_from_surface (NULL, surface,
+ 0, 0, 0, 0,
+ width, height);
}
return pixbuf;