From aa9bb7d8e4cf9ef9d47f6dad6aa9deb2f30723a1 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Wed, 9 Sep 2009 09:00:15 -0400 Subject: [PATCH] Deprecate gdk_event_get_graphics exposes This function is only used in deprecated, broken widgets. Also, fix up some of its implmentation that clang was complaining about. --- gdk/gdk.symbols | 2 ++ gdk/gdkevents.h | 2 ++ gdk/x11/gdkevents-x11.c | 27 +++++++-------------------- 3 files changed, 11 insertions(+), 20 deletions(-) diff --git a/gdk/gdk.symbols b/gdk/gdk.symbols index 593059a7a4..8ea2eea6c1 100644 --- a/gdk/gdk.symbols +++ b/gdk/gdk.symbols @@ -22,7 +22,9 @@ #if IN_HEADER(__GDK_EVENTS_H__) #if IN_FILE(__GDK_EVENTS_X11_C__) gdk_add_client_message_filter +#ifndef GDK_DISABLE_DEPRECATED gdk_event_get_graphics_expose +#endif gdk_events_pending #endif #endif diff --git a/gdk/gdkevents.h b/gdk/gdkevents.h index 5d8e28915b..e6c516c780 100644 --- a/gdk/gdkevents.h +++ b/gdk/gdkevents.h @@ -519,7 +519,9 @@ gboolean gdk_events_pending (void); GdkEvent* gdk_event_get (void); GdkEvent* gdk_event_peek (void); +#ifndef GDK_DISABLE_DEPRECATED GdkEvent* gdk_event_get_graphics_expose (GdkWindow *window); +#endif void gdk_event_put (const GdkEvent *event); GdkEvent* gdk_event_new (GdkEventType type); diff --git a/gdk/x11/gdkevents-x11.c b/gdk/x11/gdkevents-x11.c index eb8bab710e..e2cae06410 100644 --- a/gdk/x11/gdkevents-x11.c +++ b/gdk/x11/gdkevents-x11.c @@ -305,6 +305,8 @@ graphics_expose_predicate (Display *display, * * Return value: a #GdkEventExpose if a GraphicsExpose was received, or %NULL if a * NoExpose event was received. + * + * Deprecated:2.18 **/ GdkEvent* gdk_event_get_graphics_expose (GdkWindow *window) @@ -1598,13 +1600,13 @@ gdk_event_translate (GdkDisplay *display, xevent->xexpose.x, xevent->xexpose.y, xevent->xexpose.width, xevent->xexpose.height, event->any.send_event ? " (send)" : "")); - + if (window_private == NULL) { return_val = FALSE; break; } - + { GdkRectangle expose_rect; @@ -1613,25 +1615,10 @@ gdk_event_translate (GdkDisplay *display, expose_rect.width = xevent->xexpose.width; expose_rect.height = xevent->xexpose.height; - if (return_exposes) - { - event->expose.type = GDK_EXPOSE; - event->expose.area = expose_rect; - event->expose.region = gdk_region_rectangle (&expose_rect); - event->expose.window = window; - event->expose.count = xevent->xexpose.count; - - return_val = TRUE; - } - else - { - _gdk_window_process_expose (window, xevent->xexpose.serial, &expose_rect); - return_val = FALSE; - } - - return_val = FALSE; + _gdk_window_process_expose (window, xevent->xexpose.serial, &expose_rect); + return_val = FALSE; } - + break; case GraphicsExpose: