diff options
author | Benjamin Otte <otte@redhat.com> | 2010-11-23 01:46:03 +0100 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2010-12-02 20:21:03 +0100 |
commit | d1700d6e3cf5d31b41abf78be5609cd886daf579 (patch) | |
tree | c39ed52729e96542b04c28a8b24817bbbe5254aa | |
parent | 62d004cf8f0e431310c0ee551d203b1ba70d9dfe (diff) | |
download | gtk+-d1700d6e3cf5d31b41abf78be5609cd886daf579.tar.gz |
gdk: Move ref_cairo_surface from GdkDrawable to GdkWindowImpl
Also make it take the actual GdkWindow, not the implementation, like all
the other vfuncs do.
-rw-r--r-- | gdk/gdkdrawable.h | 2 | ||||
-rw-r--r-- | gdk/gdkoffscreenwindow.c | 8 | ||||
-rw-r--r-- | gdk/gdkwindow.c | 2 | ||||
-rw-r--r-- | gdk/gdkwindowimpl.h | 3 | ||||
-rw-r--r-- | gdk/x11/gdkwindow-x11.c | 22 |
5 files changed, 16 insertions, 21 deletions
diff --git a/gdk/gdkdrawable.h b/gdk/gdkdrawable.h index 9e75d15806..c8d8146968 100644 --- a/gdk/gdkdrawable.h +++ b/gdk/gdkdrawable.h @@ -59,8 +59,6 @@ struct _GdkDrawableClass { GObjectClass parent_class; - cairo_surface_t *(*ref_cairo_surface) (GdkDrawable *drawable); - /* Padding for future expansion */ void (*_gdk_reserved7) (void); void (*_gdk_reserved9) (void); diff --git a/gdk/gdkoffscreenwindow.c b/gdk/gdkoffscreenwindow.c index 04770e57da..018af47023 100644 --- a/gdk/gdkoffscreenwindow.c +++ b/gdk/gdkoffscreenwindow.c @@ -135,9 +135,9 @@ is_parent_of (GdkWindow *parent, } static cairo_surface_t * -gdk_offscreen_window_ref_cairo_surface (GdkDrawable *drawable) +gdk_offscreen_window_ref_cairo_surface (GdkWindow *window) { - GdkOffscreenWindow *offscreen = GDK_OFFSCREEN_WINDOW (drawable); + GdkOffscreenWindow *offscreen = GDK_OFFSCREEN_WINDOW (window->impl); return cairo_surface_reference (get_surface (offscreen)); } @@ -694,13 +694,11 @@ static void gdk_offscreen_window_class_init (GdkOffscreenWindowClass *klass) { GdkWindowImplClass *impl_class = GDK_WINDOW_IMPL_CLASS (klass); - GdkDrawableClass *drawable_class = GDK_DRAWABLE_CLASS (klass); GObjectClass *object_class = G_OBJECT_CLASS (klass); object_class->finalize = gdk_offscreen_window_finalize; - drawable_class->ref_cairo_surface = gdk_offscreen_window_ref_cairo_surface; - + impl_class->ref_cairo_surface = gdk_offscreen_window_ref_cairo_surface; impl_class->show = gdk_offscreen_window_show; impl_class->hide = gdk_offscreen_window_hide; impl_class->withdraw = gdk_offscreen_window_withdraw; diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c index 15c864fdcc..c746764756 100644 --- a/gdk/gdkwindow.c +++ b/gdk/gdkwindow.c @@ -2736,7 +2736,7 @@ gdk_window_begin_implicit_paint (GdkWindow *window, GdkRectangle *rect) static cairo_surface_t * gdk_window_ref_impl_surface (GdkWindow *window) { - return GDK_DRAWABLE_GET_CLASS (window->impl)->ref_cairo_surface (window->impl); + return GDK_WINDOW_IMPL_GET_CLASS (window->impl)->ref_cairo_surface (window); } static cairo_t * diff --git a/gdk/gdkwindowimpl.h b/gdk/gdkwindowimpl.h index 3df0095956..ece83a226e 100644 --- a/gdk/gdkwindowimpl.h +++ b/gdk/gdkwindowimpl.h @@ -50,6 +50,9 @@ struct _GdkWindowImplClass { GdkDrawableClass parent_class; + cairo_surface_t * + (* ref_cairo_surface) (GdkWindow *window); + void (* show) (GdkWindow *window, gboolean already_mapped); void (* hide) (GdkWindow *window); diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdkwindow-x11.c index 82fa879552..d7eed9e75f 100644 --- a/gdk/x11/gdkwindow-x11.c +++ b/gdk/x11/gdkwindow-x11.c @@ -188,11 +188,10 @@ gdk_x11_cairo_surface_destroy (void *data) } static cairo_surface_t * -gdk_x11_create_cairo_surface (GdkDrawable *drawable, +gdk_x11_create_cairo_surface (GdkWindowImplX11 *impl, int width, int height) { - GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (drawable); GdkVisual *visual; visual = gdk_window_get_visual (impl->wrapper); @@ -203,23 +202,22 @@ gdk_x11_create_cairo_surface (GdkDrawable *drawable, } static cairo_surface_t * -gdk_x11_ref_cairo_surface (GdkDrawable *drawable) +gdk_x11_ref_cairo_surface (GdkWindow *window) { - GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (drawable); + GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (window->impl); - if (GDK_IS_WINDOW_IMPL_X11 (drawable) && - GDK_WINDOW_DESTROYED (impl->wrapper)) + if (GDK_WINDOW_DESTROYED (window)) return NULL; if (!impl->cairo_surface) { - impl->cairo_surface = gdk_x11_create_cairo_surface (drawable, - gdk_window_get_width (impl->wrapper), - gdk_window_get_height (impl->wrapper)); + impl->cairo_surface = gdk_x11_create_cairo_surface (impl, + gdk_window_get_width (window), + gdk_window_get_height (window)); if (impl->cairo_surface) cairo_surface_set_user_data (impl->cairo_surface, &gdk_x11_cairo_key, - drawable, gdk_x11_cairo_surface_destroy); + impl, gdk_x11_cairo_surface_destroy); } else cairo_surface_reference (impl->cairo_surface); @@ -5567,13 +5565,11 @@ static void gdk_window_impl_x11_class_init (GdkWindowImplX11Class *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); - GdkDrawableClass *drawable_class = GDK_DRAWABLE_CLASS (klass); GdkWindowImplClass *impl_class = GDK_WINDOW_IMPL_CLASS (klass); object_class->finalize = gdk_window_impl_x11_finalize; - drawable_class->ref_cairo_surface = gdk_x11_ref_cairo_surface; - + impl_class->ref_cairo_surface = gdk_x11_ref_cairo_surface; impl_class->show = gdk_window_x11_show; impl_class->hide = gdk_window_x11_hide; impl_class->withdraw = gdk_window_x11_withdraw; |