Commit d36c10bc authored by Matthias Clasen's avatar Matthias Clasen

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.
parent e580c79a
......@@ -28,6 +28,7 @@
#define __GDK_APP_LAUNCH_CONTEXT_H__
#include <gio/gio.h>
#include <gdk/gdkversionmacros.h>
#include <gdk/gdktypes.h>
#include <gdk/gdkscreen.h>
......@@ -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,
......
......@@ -24,6 +24,7 @@
#ifndef __GDK_CAIRO_H__
#define __GDK_CAIRO_H__
#include <gdk/gdkversionmacros.h>
#include <gdk/gdkcolor.h>
#include <gdk/gdkrgba.h>
#include <gdk/gdkpixbuf.h>
......@@ -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);
......
......@@ -31,6 +31,7 @@
#ifndef __GDK_CURSOR_H__
#define __GDK_CURSOR_H__
#include <gdk/gdkversionmacros.h>
#include <gdk/gdktypes.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
......@@ -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);
......
......@@ -28,6 +28,7 @@
#ifndef __GDK_DISPLAY_H__
#define __GDK_DISPLAY_H__
#include <gdk/gdkversionmacros.h>
#include <gdk/gdktypes.h>
#include <gdk/gdkevents.h>
#include <gdk/gdkdevicemanager.h>
......@@ -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,
......
......@@ -31,6 +31,7 @@
#ifndef __GDK_EVENTS_H__
#define __GDK_EVENTS_H__
#include <gdk/gdkversionmacros.h>
#include <gdk/gdkcolor.h>
#include <gdk/gdktypes.h>
#include <gdk/gdkdnd.h>
......@@ -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,
......
......@@ -31,6 +31,7 @@
#ifndef __GDK_KEYS_H__
#define __GDK_KEYS_H__
#include <gdk/gdkversionmacros.h>
#include <gdk/gdktypes.h>
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);
......
......@@ -31,6 +31,7 @@
#ifndef __GDK_MAIN_H__
#define __GDK_MAIN_H__
#include <gdk/gdkversionmacros.h>
#include <gdk/gdktypes.h>
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 */
......
......@@ -29,6 +29,7 @@
#define __GDK_SCREEN_H__
#include <cairo.h>
#include <gdk/gdkversionmacros.h>
#include <gdk/gdktypes.h>
#include <gdk/gdkdisplay.h>
......@@ -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);
......
......@@ -31,6 +31,7 @@
#ifndef __GDK_WINDOW_H__
#define __GDK_WINDOW_H__
#include <gdk/gdkversionmacros.h>
#include <gdk/gdktypes.h>
#include <gdk/gdkevents.h>
......@@ -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,
......
......@@ -28,6 +28,7 @@
G_BEGIN_DECLS
GDK_AVAILABLE_IN_3_2
gint gdk_x11_device_get_id (GdkDevice *device);
G_END_DECLS
......
......@@ -31,6 +31,7 @@
G_BEGIN_DECLS
GDK_AVAILABLE_IN_3_2
GdkDevice * gdk_x11_device_manager_lookup (GdkDeviceManager *device_manager,
gint device_id);
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment