From 36ce54878b7df02a7ff44e1f8d580cda051b0c12 Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Mon, 15 Dec 2008 14:55:53 +0100 Subject: [PATCH] Make _gdk_windowing_window_queue_translation a GdkWindiwImpl call --- gdk/gdkinternals.h | 5 ----- gdk/gdkoffscreenwindow.c | 10 ++++++++++ gdk/gdkwindow.c | 32 +++++++++++++------------------- gdk/gdkwindowimpl.h | 5 +++++ gdk/x11/gdkgeometry-x11.c | 8 ++++---- gdk/x11/gdkprivate-x11.h | 9 ++++++--- gdk/x11/gdkwindow-x11.c | 1 + 7 files changed, 39 insertions(+), 31 deletions(-) diff --git a/gdk/gdkinternals.h b/gdk/gdkinternals.h index ffa22375df..ecc9b097ee 100644 --- a/gdk/gdkinternals.h +++ b/gdk/gdkinternals.h @@ -359,11 +359,6 @@ gint _gdk_windowing_get_bits_for_depth (GdkDisplay *display, #define GDK_WINDOW_IS_MAPPED(window) ((((GdkWindowObject*)window)->state & GDK_WINDOW_STATE_WITHDRAWN) == 0) -void _gdk_windowing_window_queue_translation (GdkWindow *window, - GdkRegion *area, - gint dx, - gint dy); - /* Called to do the windowing system specific part of gdk_window_destroy(), * diff --git a/gdk/gdkoffscreenwindow.c b/gdk/gdkoffscreenwindow.c index 7f87b822bb..03b52a6b0b 100644 --- a/gdk/gdkoffscreenwindow.c +++ b/gdk/gdkoffscreenwindow.c @@ -1119,6 +1119,15 @@ gdk_offscreen_window_queue_antiexpose (GdkWindow *window, return FALSE; } +static void +gdk_offscreen_window_queue_translation (GdkWindow *window, + GdkRegion *area, + gint dx, + gint dy) +{ +} + + static void gdk_offscreen_window_class_init (GdkOffscreenWindowClass *klass) { @@ -1173,6 +1182,7 @@ gdk_offscreen_window_impl_iface_init (GdkWindowImplIface *iface) iface->merge_child_shapes = gdk_offscreen_window_merge_child_shapes; iface->set_static_gravities = gdk_offscreen_window_set_static_gravities; iface->queue_antiexpose = gdk_offscreen_window_queue_antiexpose; + iface->queue_translation = gdk_offscreen_window_queue_translation; iface->get_origin = gdk_offscreen_window_get_origin; } diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c index 81d8dd235e..8bcdd3739c 100644 --- a/gdk/gdkwindow.c +++ b/gdk/gdkwindow.c @@ -5559,9 +5559,8 @@ gdk_window_move_resize_internal (GdkWindow *window, /* The old_region area is moved and we queue translations for all expose events to it that will be sent before the copy operation */ - /* TODO: Make queue_translation a vtable call instead of hardcoding this crap */ - if (!gdk_window_is_offscreen (impl_window)) - _gdk_windowing_window_queue_translation ((GdkWindow *)impl_window, old_region, dx, dy); + GDK_WINDOW_IMPL_GET_IFACE (impl_window->impl)->queue_translation ((GdkWindow *)impl_window, + old_region, dx, dy); /* convert from parent coords to impl */ gdk_region_offset (copy_area, private->abs_x - private->x, private->abs_y - private->y); @@ -5732,15 +5731,13 @@ gdk_window_scroll (GdkWindow *window, /* Get window clip and convert to real window coords, this area is moved and we queue translations for all expose events to it that will be sent before the copy operation */ - /* TODO: Make queue_translation a vtable call instead of hardcoding this crap */ - if (!gdk_window_is_offscreen (impl_window)) - { - source_area = gdk_region_copy (private->clip_region); - /* convert from window coords to real parent */ - gdk_region_offset (source_area, private->abs_x, private->abs_y); - _gdk_windowing_window_queue_translation ((GdkWindow *)impl_window, source_area, dx, dy); - gdk_region_destroy (source_area); - } + + source_area = gdk_region_copy (private->clip_region); + /* convert from window coords to real parent */ + gdk_region_offset (source_area, private->abs_x, private->abs_y); + GDK_WINDOW_IMPL_GET_IFACE (impl_window->impl)->queue_translation ((GdkWindow *)impl_window, + source_area, dx, dy); + gdk_region_destroy (source_area); /* convert from window coords to impl */ gdk_region_offset (copy_area, private->abs_x, private->abs_y); @@ -5809,13 +5806,10 @@ gdk_window_move_region (GdkWindow *window, gdk_window_invalidate_region (window, nocopy_area, FALSE); gdk_region_destroy (nocopy_area); - /* TODO: Make queue_translation a vtable call instead of hardcoding this crap */ - if (!gdk_window_is_offscreen (impl_window)) - { - gdk_region_offset (source_area, private->abs_x, private->abs_y); - _gdk_windowing_window_queue_translation ((GdkWindow *)impl_window, source_area, dx, dy); - } - + gdk_region_offset (source_area, private->abs_x, private->abs_y); + GDK_WINDOW_IMPL_GET_IFACE (impl_window->impl)->queue_translation ((GdkWindow *)impl_window, + source_area, dx, dy); + /* convert from window coords to impl */ gdk_region_offset (copy_area, private->abs_x, private->abs_y); diff --git a/gdk/gdkwindowimpl.h b/gdk/gdkwindowimpl.h index 3509d87fac..ad1f6206e3 100644 --- a/gdk/gdkwindowimpl.h +++ b/gdk/gdkwindowimpl.h @@ -108,6 +108,11 @@ struct _GdkWindowImplIface */ gboolean (* queue_antiexpose) (GdkWindow *window, GdkRegion *update_area); + void (* queue_translation) (GdkWindow *window, + GdkRegion *area, + gint dx, + gint dy); + }; /* Interface Functions */ diff --git a/gdk/x11/gdkgeometry-x11.c b/gdk/x11/gdkgeometry-x11.c index 47f210bbcf..b88d4eecd3 100644 --- a/gdk/x11/gdkgeometry-x11.c +++ b/gdk/x11/gdkgeometry-x11.c @@ -357,10 +357,10 @@ gdk_window_queue (GdkWindow *window, } void -_gdk_windowing_window_queue_translation (GdkWindow *window, - GdkRegion *area, - gint dx, - gint dy) +_gdk_x11_window_queue_translation (GdkWindow *window, + GdkRegion *area, + gint dx, + gint dy) { GdkWindowQueueItem *item = g_new (GdkWindowQueueItem, 1); item->type = GDK_WINDOW_QUEUE_TRANSLATE; diff --git a/gdk/x11/gdkprivate-x11.h b/gdk/x11/gdkprivate-x11.h index ad1dfca7db..e1c4666f85 100644 --- a/gdk/x11/gdkprivate-x11.h +++ b/gdk/x11/gdkprivate-x11.h @@ -127,9 +127,12 @@ void _gdk_window_process_expose (GdkWindow *window, gulong serial, GdkRectangle *area); -gboolean _gdk_x11_window_queue_antiexpose (GdkWindow *window, - GdkRegion *area); - +gboolean _gdk_x11_window_queue_antiexpose (GdkWindow *window, + GdkRegion *area); +void _gdk_x11_window_queue_translation (GdkWindow *window, + GdkRegion *area, + gint dx, + gint dy); void _gdk_selection_window_destroyed (GdkWindow *window); gboolean _gdk_selection_filter_clear_event (XSelectionClearEvent *event); diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdkwindow-x11.c index 86d7586807..3b6d56300c 100644 --- a/gdk/x11/gdkwindow-x11.c +++ b/gdk/x11/gdkwindow-x11.c @@ -5925,6 +5925,7 @@ gdk_window_impl_iface_init (GdkWindowImplIface *iface) iface->merge_child_shapes = gdk_window_x11_merge_child_shapes; iface->set_static_gravities = gdk_window_x11_set_static_gravities; iface->queue_antiexpose = _gdk_x11_window_queue_antiexpose; + iface->queue_translation = _gdk_x11_window_queue_translation; } #define __GDK_WINDOW_X11_C__