From d36c10bc03ae113d24d60314d900e68be0fbb7b1 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 27 Feb 2012 07:07:48 -0500 Subject: [PATCH] gdk: Use versioned deprecations This patch changes all uses of GDK_DEPRECATED(_FOR) in gdk headers by the versioned variants, GDK_DEPRECATED_IN_3_x(_FOR). At the same time, we add GDK_AVAILABLE_IN_3_x annotations for all API additions in 3.2 and 3.4. --- gdk/gdkapplaunchcontext.h | 5 +++-- gdk/gdkcairo.h | 3 ++- gdk/gdkcursor.h | 5 +++-- gdk/gdkdisplay.h | 15 ++++++++------- gdk/gdkevents.h | 7 +++++++ gdk/gdkkeys.h | 3 +++ gdk/gdkmain.h | 11 ++++++----- gdk/gdkscreen.h | 2 ++ gdk/gdkwindow.h | 9 ++++++--- gdk/x11/gdkx11device.h | 1 + gdk/x11/gdkx11devicemanager.h | 1 + gdk/x11/gdkx11window.h | 2 ++ 12 files changed, 44 insertions(+), 20 deletions(-) diff --git a/gdk/gdkapplaunchcontext.h b/gdk/gdkapplaunchcontext.h index 3e4dc16ac9..2ad1fc793a 100644 --- a/gdk/gdkapplaunchcontext.h +++ b/gdk/gdkapplaunchcontext.h @@ -28,6 +28,7 @@ #define __GDK_APP_LAUNCH_CONTEXT_H__ #include +#include #include #include @@ -40,9 +41,9 @@ G_BEGIN_DECLS GType gdk_app_launch_context_get_type (void); -GDK_DEPRECATED_FOR(gdk_display_get_app_launch_context) +GDK_DEPRECATED_IN_3_0_FOR(gdk_display_get_app_launch_context) GdkAppLaunchContext *gdk_app_launch_context_new (void); -GDK_DEPRECATED_FOR(gdk_display_get_app_launch_context) +GDK_DEPRECATED_IN_3_0_FOR(gdk_display_get_app_launch_context) void gdk_app_launch_context_set_display (GdkAppLaunchContext *context, GdkDisplay *display); void gdk_app_launch_context_set_screen (GdkAppLaunchContext *context, diff --git a/gdk/gdkcairo.h b/gdk/gdkcairo.h index 20c995bbe7..65fd59d654 100644 --- a/gdk/gdkcairo.h +++ b/gdk/gdkcairo.h @@ -24,6 +24,7 @@ #ifndef __GDK_CAIRO_H__ #define __GDK_CAIRO_H__ +#include #include #include #include @@ -55,7 +56,7 @@ cairo_region_t * gdk_cairo_region_create_from_surface (cairo_surface_t *surface); -GDK_DEPRECATED_FOR(gdk_cairo_set_source_rgba) +GDK_DEPRECATED_IN_3_4_FOR(gdk_cairo_set_source_rgba) void gdk_cairo_set_source_color (cairo_t *cr, const GdkColor *color); diff --git a/gdk/gdkcursor.h b/gdk/gdkcursor.h index c49c61cceb..3f8b613eb8 100644 --- a/gdk/gdkcursor.h +++ b/gdk/gdkcursor.h @@ -31,6 +31,7 @@ #ifndef __GDK_CURSOR_H__ #define __GDK_CURSOR_H__ +#include #include #include @@ -228,9 +229,9 @@ GdkCursor* gdk_cursor_new_from_pixbuf (GdkDisplay *display, GdkCursor* gdk_cursor_new_from_name (GdkDisplay *display, const gchar *name); GdkDisplay* gdk_cursor_get_display (GdkCursor *cursor); -GDK_DEPRECATED_FOR(g_object_ref) +GDK_DEPRECATED_IN_3_0_FOR(g_object_ref) GdkCursor * gdk_cursor_ref (GdkCursor *cursor); -GDK_DEPRECATED_FOR(g_object_unref) +GDK_DEPRECATED_IN_3_0_FOR(g_object_unref) void gdk_cursor_unref (GdkCursor *cursor); GdkPixbuf* gdk_cursor_get_image (GdkCursor *cursor); GdkCursorType gdk_cursor_get_cursor_type (GdkCursor *cursor); diff --git a/gdk/gdkdisplay.h b/gdk/gdkdisplay.h index 9f24d038af..14f5fa6713 100644 --- a/gdk/gdkdisplay.h +++ b/gdk/gdkdisplay.h @@ -28,6 +28,7 @@ #ifndef __GDK_DISPLAY_H__ #define __GDK_DISPLAY_H__ +#include #include #include #include @@ -52,13 +53,13 @@ GdkScreen * gdk_display_get_screen (GdkDisplay *display, GdkScreen * gdk_display_get_default_screen (GdkDisplay *display); #ifndef GDK_MULTIDEVICE_SAFE -GDK_DEPRECATED_FOR(gdk_device_ungrab) +GDK_DEPRECATED_IN_3_0_FOR(gdk_device_ungrab) void gdk_display_pointer_ungrab (GdkDisplay *display, guint32 time_); -GDK_DEPRECATED_FOR(gdk_device_ungrab) +GDK_DEPRECATED_IN_3_0_FOR(gdk_device_ungrab) void gdk_display_keyboard_ungrab (GdkDisplay *display, guint32 time_); -GDK_DEPRECATED_FOR(gdk_display_device_is_grabbed) +GDK_DEPRECATED_IN_3_0_FOR(gdk_display_device_is_grabbed) gboolean gdk_display_pointer_is_grabbed (GdkDisplay *display); #endif /* GDK_MULTIDEVICE_SAFE */ @@ -71,7 +72,7 @@ void gdk_display_flush (GdkDisplay *display); void gdk_display_close (GdkDisplay *display); gboolean gdk_display_is_closed (GdkDisplay *display); -GDK_DEPRECATED_FOR(gdk_device_manager_list_devices) +GDK_DEPRECATED_IN_3_0_FOR(gdk_device_manager_list_devices) GList * gdk_display_list_devices (GdkDisplay *display); GdkEvent* gdk_display_get_event (GdkDisplay *display); @@ -88,17 +89,17 @@ void gdk_display_set_double_click_distance (GdkDisplay *display, GdkDisplay *gdk_display_get_default (void); #ifndef GDK_MULTIDEVICE_SAFE -GDK_DEPRECATED_FOR(gdk_device_get_position) +GDK_DEPRECATED_IN_3_0_FOR(gdk_device_get_position) void gdk_display_get_pointer (GdkDisplay *display, GdkScreen **screen, gint *x, gint *y, GdkModifierType *mask); -GDK_DEPRECATED_FOR(gdk_device_get_window_at_position) +GDK_DEPRECATED_IN_3_0_FOR(gdk_device_get_window_at_position) GdkWindow * gdk_display_get_window_at_pointer (GdkDisplay *display, gint *win_x, gint *win_y); -GDK_DEPRECATED_FOR(gdk_device_warp) +GDK_DEPRECATED_IN_3_0_FOR(gdk_device_warp) void gdk_display_warp_pointer (GdkDisplay *display, GdkScreen *screen, gint x, diff --git a/gdk/gdkevents.h b/gdk/gdkevents.h index 197b03ed55..0ee58f9e73 100644 --- a/gdk/gdkevents.h +++ b/gdk/gdkevents.h @@ -31,6 +31,7 @@ #ifndef __GDK_EVENTS_H__ #define __GDK_EVENTS_H__ +#include #include #include #include @@ -1109,14 +1110,19 @@ gboolean gdk_event_get_coords (const GdkEvent *event, gboolean gdk_event_get_root_coords (const GdkEvent *event, gdouble *x_root, gdouble *y_root); +GDK_AVAILABLE_IN_3_2 gboolean gdk_event_get_button (const GdkEvent *event, guint *button); +GDK_AVAILABLE_IN_3_2 gboolean gdk_event_get_click_count (const GdkEvent *event, guint *click_count); +GDK_AVAILABLE_IN_3_2 gboolean gdk_event_get_keyval (const GdkEvent *event, guint *keyval); +GDK_AVAILABLE_IN_3_2 gboolean gdk_event_get_keycode (const GdkEvent *event, guint16 *keycode); +GDK_AVAILABLE_IN_3_2 gboolean gdk_event_get_scroll_direction (const GdkEvent *event, GdkScrollDirection *direction); gboolean gdk_event_get_axis (const GdkEvent *event, @@ -1129,6 +1135,7 @@ void gdk_event_set_source_device (GdkEvent *event, GdkDevice *device); GdkDevice* gdk_event_get_source_device (const GdkEvent *event); void gdk_event_request_motions (const GdkEventMotion *event); +GDK_AVAILABLE_IN_3_4 gboolean gdk_event_triggers_context_menu (const GdkEvent *event); gboolean gdk_events_get_distance (GdkEvent *event1, diff --git a/gdk/gdkkeys.h b/gdk/gdkkeys.h index 91fbd3d179..0c100e139b 100644 --- a/gdk/gdkkeys.h +++ b/gdk/gdkkeys.h @@ -31,6 +31,7 @@ #ifndef __GDK_KEYS_H__ #define __GDK_KEYS_H__ +#include #include G_BEGIN_DECLS @@ -110,11 +111,13 @@ PangoDirection gdk_keymap_get_direction (GdkKeymap *keymap) gboolean gdk_keymap_have_bidi_layouts (GdkKeymap *keymap); gboolean gdk_keymap_get_caps_lock_state (GdkKeymap *keymap); gboolean gdk_keymap_get_num_lock_state (GdkKeymap *keymap); +GDK_AVAILABLE_IN_3_4 guint gdk_keymap_get_modifier_state (GdkKeymap *keymap); void gdk_keymap_add_virtual_modifiers (GdkKeymap *keymap, GdkModifierType *state); gboolean gdk_keymap_map_virtual_modifiers (GdkKeymap *keymap, GdkModifierType *state); +GDK_AVAILABLE_IN_3_4 GdkModifierType gdk_keymap_get_modifier_mask (GdkKeymap *keymap, GdkModifierIntent intent); diff --git a/gdk/gdkmain.h b/gdk/gdkmain.h index 219c968e39..82b71813f3 100644 --- a/gdk/gdkmain.h +++ b/gdk/gdkmain.h @@ -31,6 +31,7 @@ #ifndef __GDK_MAIN_H__ #define __GDK_MAIN_H__ +#include #include G_BEGIN_DECLS @@ -78,14 +79,14 @@ const gchar * gdk_get_display_arg_name (void); gchar* gdk_get_display (void); #ifndef GDK_MULTIDEVICE_SAFE -GDK_DEPRECATED_FOR(gdk_device_grab) +GDK_DEPRECATED_IN_3_0_FOR(gdk_device_grab) GdkGrabStatus gdk_pointer_grab (GdkWindow *window, gboolean owner_events, GdkEventMask event_mask, GdkWindow *confine_to, GdkCursor *cursor, guint32 time_); -GDK_DEPRECATED_FOR(gdk_device_grab) +GDK_DEPRECATED_IN_3_0_FOR(gdk_device_grab) GdkGrabStatus gdk_keyboard_grab (GdkWindow *window, gboolean owner_events, guint32 time_); @@ -94,11 +95,11 @@ GdkGrabStatus gdk_keyboard_grab (GdkWindow *window, #ifndef GDK_MULTIHEAD_SAFE #ifndef GDK_MULTIDEVICE_SAFE -GDK_DEPRECATED_FOR(gdk_device_ungrab) +GDK_DEPRECATED_IN_3_0_FOR(gdk_device_ungrab) void gdk_pointer_ungrab (guint32 time_); -GDK_DEPRECATED_FOR(gdk_device_ungrab) +GDK_DEPRECATED_IN_3_0_FOR(gdk_device_ungrab) void gdk_keyboard_ungrab (guint32 time_); -GDK_DEPRECATED_FOR(gdk_display_device_is_grabbed) +GDK_DEPRECATED_IN_3_0_FOR(gdk_display_device_is_grabbed) gboolean gdk_pointer_is_grabbed (void); #endif /* GDK_MULTIDEVICE_SAFE */ diff --git a/gdk/gdkscreen.h b/gdk/gdkscreen.h index eeec65485d..664359a930 100644 --- a/gdk/gdkscreen.h +++ b/gdk/gdkscreen.h @@ -29,6 +29,7 @@ #define __GDK_SCREEN_H__ #include +#include #include #include @@ -62,6 +63,7 @@ gint gdk_screen_get_primary_monitor (GdkScreen *screen); void gdk_screen_get_monitor_geometry (GdkScreen *screen, gint monitor_num, GdkRectangle *dest); +GDK_AVAILABLE_IN_3_4 void gdk_screen_get_monitor_workarea (GdkScreen *screen, gint monitor_num, GdkRectangle *dest); diff --git a/gdk/gdkwindow.h b/gdk/gdkwindow.h index f6b2be79a7..c240dfba14 100644 --- a/gdk/gdkwindow.h +++ b/gdk/gdkwindow.h @@ -31,6 +31,7 @@ #ifndef __GDK_WINDOW_H__ #define __GDK_WINDOW_H__ +#include #include #include @@ -503,7 +504,7 @@ GdkVisual * gdk_window_get_visual (GdkWindow *window); GdkScreen * gdk_window_get_screen (GdkWindow *window); GdkDisplay * gdk_window_get_display (GdkWindow *window); #ifndef GDK_MULTIDEVICE_SAFE -GDK_DEPRECATED_FOR(gdk_device_get_window_at_position) +GDK_DEPRECATED_IN_3_0_FOR(gdk_device_get_window_at_position) GdkWindow* gdk_window_at_pointer (gint *win_x, gint *win_y); #endif /* GDK_MULTIDEVICE_SAFE */ @@ -657,7 +658,7 @@ void gdk_window_set_startup_id (GdkWindow *window, const gchar *startup_id); void gdk_window_set_transient_for (GdkWindow *window, GdkWindow *parent); -GDK_DEPRECATED_FOR(gdk_window_set_background_rgba) +GDK_DEPRECATED_IN_3_4_FOR(gdk_window_set_background_rgba) void gdk_window_set_background (GdkWindow *window, const GdkColor *color); void gdk_window_set_background_rgba (GdkWindow *window, @@ -712,7 +713,7 @@ void gdk_window_get_frame_extents (GdkWindow *window, GdkRectangle *rect); #ifndef GDK_MULTIDEVICE_SAFE -GDK_DEPRECATED_FOR(gdk_window_get_device_position) +GDK_DEPRECATED_IN_3_0_FOR(gdk_window_get_device_position) GdkWindow * gdk_window_get_pointer (GdkWindow *window, gint *x, gint *y, @@ -793,6 +794,7 @@ void gdk_window_begin_resize_drag (GdkWindow *window, gint root_x, gint root_y, guint32 timestamp); +GDK_AVAILABLE_IN_3_4 void gdk_window_begin_resize_drag_for_device (GdkWindow *window, GdkWindowEdge edge, GdkDevice *device, @@ -805,6 +807,7 @@ void gdk_window_begin_move_drag (GdkWindow *window, gint root_x, gint root_y, guint32 timestamp); +GDK_AVAILABLE_IN_3_4 void gdk_window_begin_move_drag_for_device (GdkWindow *window, GdkDevice *device, gint button, diff --git a/gdk/x11/gdkx11device.h b/gdk/x11/gdkx11device.h index 4a55540f5c..bf28230b28 100644 --- a/gdk/x11/gdkx11device.h +++ b/gdk/x11/gdkx11device.h @@ -28,6 +28,7 @@ G_BEGIN_DECLS +GDK_AVAILABLE_IN_3_2 gint gdk_x11_device_get_id (GdkDevice *device); G_END_DECLS diff --git a/gdk/x11/gdkx11devicemanager.h b/gdk/x11/gdkx11devicemanager.h index bc5b5c590c..61b04a8a9e 100644 --- a/gdk/x11/gdkx11devicemanager.h +++ b/gdk/x11/gdkx11devicemanager.h @@ -31,6 +31,7 @@ G_BEGIN_DECLS +GDK_AVAILABLE_IN_3_2 GdkDevice * gdk_x11_device_manager_lookup (GdkDeviceManager *device_manager, gint device_id); diff --git a/gdk/x11/gdkx11window.h b/gdk/x11/gdkx11window.h index 68784ed6d5..9b13aa1c0f 100644 --- a/gdk/x11/gdkx11window.h +++ b/gdk/x11/gdkx11window.h @@ -60,8 +60,10 @@ void gdk_x11_window_set_user_time (GdkWindow *window, void gdk_x11_window_set_utf8_property (GdkWindow *window, const gchar *name, const gchar *value); +GDK_AVAILABLE_IN_3_2 void gdk_x11_window_set_theme_variant (GdkWindow *window, char *variant); +GDK_AVAILABLE_IN_3_4 void gdk_x11_window_set_hide_titlebar_when_maximized (GdkWindow *window, gboolean hide_titlebar_when_maximized); void gdk_x11_window_move_to_current_desktop (GdkWindow *window);