Commit 9e0efc50 authored by Matthias Clasen's avatar Matthias Clasen
Browse files

Add deprecation annotations for deprecated functions

We define our own GDK_DEPRECATED[_FOR] macros for this
and allow it to be turned off by defining the
GDK_DISABLE_DEPRECATION_WARNINGS macro.
parent 8f078992
......@@ -39,7 +39,7 @@ AC_CONFIG_AUX_DIR([build-aux])
m4_define([gtk_binary_version], [3.0.0])
# required versions of other packages
m4_define([glib_required_version], [2.29.14])
m4_define([glib_required_version], [2.31.0])
m4_define([pango_required_version], [1.29.0])
m4_define([atk_required_version], [2.1.5])
m4_define([cairo_required_version], [1.10.0])
......@@ -1673,6 +1673,20 @@ AC_CONFIG_COMMANDS([gdk/gdkconfig.h], [
G_BEGIN_DECLS
/* These macros are used to mark deprecated functions in GDK and
* GTK+ headers, and thus have to be exposed in installed headers.
* But please do *not* use them in other projects. Instead, use
* G_DEPRECATED or define your own wrappers around it.
*/
#ifdef GDK_DISABLE_DEPRECATION_WARNINGS
#define GDK_DEPRECATED
#define GDK_DEPRECATED_FOR(f)
#else
#define GDK_DEPRECATED G_DEPRECATED
#define GDK_DEPRECATED_FOR(f) G_DEPRECATED_FOR(f)
#endif
_______EOF
cat >>$outfile <<_______EOF
......
......@@ -41,9 +41,11 @@ G_BEGIN_DECLS
GType gdk_app_launch_context_get_type (void);
#ifndef GDK_DISABLE_DEPRECATED
GdkAppLaunchContext *gdk_app_launch_context_new (void) G_GNUC_DEPRECATED_FOR(gdk_display_get_app_launch_context);
GDK_DEPRECATED_FOR(gdk_display_get_app_launch_context)
GdkAppLaunchContext *gdk_app_launch_context_new (void);
GDK_DEPRECATED_FOR(gdk_display_get_app_launch_context)
void gdk_app_launch_context_set_display (GdkAppLaunchContext *context,
GdkDisplay *display) G_GNUC_DEPRECATED_FOR(gdk_display_get_app_launch_context);
GdkDisplay *display);
#endif
void gdk_app_launch_context_set_screen (GdkAppLaunchContext *context,
GdkScreen *screen);
......
......@@ -229,8 +229,10 @@ GdkCursor* gdk_cursor_new_from_name (GdkDisplay *display,
const gchar *name);
GdkDisplay* gdk_cursor_get_display (GdkCursor *cursor);
#ifndef GDK_DISABLE_DEPRECATED
GdkCursor* gdk_cursor_ref (GdkCursor *cursor) G_GNUC_DEPRECATED_FOR(g_object_ref);
void gdk_cursor_unref (GdkCursor *cursor) G_GNUC_DEPRECATED_FOR(g_object_unref);
GDK_DEPRECATED_FOR(g_object_ref)
GdkCursor * gdk_cursor_ref (GdkCursor *cursor);
GDK_DEPRECATED_FOR(g_object_unref)
void gdk_cursor_unref (GdkCursor *cursor);
#endif
GdkPixbuf* gdk_cursor_get_image (GdkCursor *cursor);
GdkCursorType gdk_cursor_get_cursor_type (GdkCursor *cursor);
......
......@@ -53,11 +53,14 @@ GdkScreen * gdk_display_get_default_screen (GdkDisplay *display);
#ifndef GDK_MULTIDEVICE_SAFE
#ifndef GDK_DISABLE_DEPRECATED
GDK_DEPRECATED_FOR(gdk_device_ungrab)
void gdk_display_pointer_ungrab (GdkDisplay *display,
guint32 time_) G_GNUC_DEPRECATED_FOR(gdk_device_ungrab);
guint32 time_);
GDK_DEPRECATED_FOR(gdk_device_ungrab)
void gdk_display_keyboard_ungrab (GdkDisplay *display,
guint32 time_) G_GNUC_DEPRECATED_FOR(gdk_device_ungrab);
gboolean gdk_display_pointer_is_grabbed (GdkDisplay *display) G_GNUC_DEPRECATED_FOR(gdk_display_device_is_grabbed);
guint32 time_);
GDK_DEPRECATED_FOR(gdk_display_device_is_grabbed)
gboolean gdk_display_pointer_is_grabbed (GdkDisplay *display);
#endif /* GDK_DISABLE_DEPRECATED */
#endif /* GDK_MULTIDEVICE_SAFE */
......@@ -71,7 +74,8 @@ void gdk_display_close (GdkDisplay *display);
gboolean gdk_display_is_closed (GdkDisplay *display);
#ifndef GDK_DISABLE_DEPRECATED
GList * gdk_display_list_devices (GdkDisplay *display) G_GNUC_DEPRECATED_FOR(gdk_device_manager_list_devices);
GDK_DEPRECATED_FOR(gdk_device_manager_list_devices)
GList * gdk_display_list_devices (GdkDisplay *display);
#endif /* GDK_DISABLE_DEPRECATED */
GdkEvent* gdk_display_get_event (GdkDisplay *display);
......@@ -89,18 +93,21 @@ GdkDisplay *gdk_display_get_default (void);
#ifndef GDK_MULTIDEVICE_SAFE
#ifndef GDK_DISABLE_DEPRECATED
GDK_DEPRECATED_FOR(gdk_device_get_position)
void gdk_display_get_pointer (GdkDisplay *display,
GdkScreen **screen,
gint *x,
gint *y,
GdkModifierType *mask) G_GNUC_DEPRECATED_FOR(gdk_device_get_position);
GdkModifierType *mask);
GDK_DEPRECATED_FOR(gdk_device_get_window_at_position)
GdkWindow * gdk_display_get_window_at_pointer (GdkDisplay *display,
gint *win_x,
gint *win_y) G_GNUC_DEPRECATED_FOR(gdk_device_get_window_at_position);
gint *win_y);
GDK_DEPRECATED_FOR(gdk_device_warp)
void gdk_display_warp_pointer (GdkDisplay *display,
GdkScreen *screen,
gint x,
gint y) G_GNUC_DEPRECATED_FOR(gdk_device_warp);
gint y);
#endif /* GDK_DISABLE_DEPRECATED */
#endif /* GDK_MULTIDEVICE_SAFE */
......
......@@ -79,15 +79,17 @@ gchar* gdk_get_display (void);
#ifndef GDK_MULTIDEVICE_SAFE
#ifndef GDK_DISABLE_DEPRECATED
GDK_DEPRECATED_FOR(gdk_device_grab)
GdkGrabStatus gdk_pointer_grab (GdkWindow *window,
gboolean owner_events,
GdkEventMask event_mask,
GdkWindow *confine_to,
GdkCursor *cursor,
guint32 time_) G_GNUC_DEPRECATED_FOR(gdk_device_grab);
guint32 time_);
GDK_DEPRECATED_FOR(gdk_device_grab)
GdkGrabStatus gdk_keyboard_grab (GdkWindow *window,
gboolean owner_events,
guint32 time_) G_GNUC_DEPRECATED_FOR(gdk_device_grab);
guint32 time_);
#endif /* GDK_DISABLE_DEPRECATED */
#endif /* GDK_MULTIDEVICE_SAFE */
......@@ -95,9 +97,12 @@ GdkGrabStatus gdk_keyboard_grab (GdkWindow *window,
#ifndef GDK_MULTIDEVICE_SAFE
#ifndef GDK_DISABLE_DEPRECATED
void gdk_pointer_ungrab (guint32 time_) G_GNUC_DEPRECATED_FOR(gdk_device_ungrab);
void gdk_keyboard_ungrab (guint32 time_) G_GNUC_DEPRECATED_FOR(gdk_device_ungrab);
gboolean gdk_pointer_is_grabbed (void) G_GNUC_DEPRECATED_FOR(gdk_display_device_is_grabbed);
GDK_DEPRECATED_FOR(gdk_device_ungrab)
void gdk_pointer_ungrab (guint32 time_);
GDK_DEPRECATED_FOR(gdk_device_ungrab)
void gdk_keyboard_ungrab (guint32 time_);
GDK_DEPRECATED_FOR(gdk_display_device_is_grabbed)
gboolean gdk_pointer_is_grabbed (void);
#endif /* GDK_DISABLE_DEPRECATED */
#endif /* GDK_MULTIDEVICE_SAFE */
......
......@@ -503,8 +503,9 @@ 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)
GdkWindow* gdk_window_at_pointer (gint *win_x,
gint *win_y) G_GNUC_DEPRECATED_FOR(gdk_device_get_window_at_position);
gint *win_y);
#endif /* GDK_MULTIDEVICE_SAFE */
void gdk_window_show (GdkWindow *window);
void gdk_window_hide (GdkWindow *window);
......@@ -710,10 +711,11 @@ void gdk_window_get_frame_extents (GdkWindow *window,
GdkRectangle *rect);
#ifndef GDK_MULTIDEVICE_SAFE
GDK_DEPRECATED_FOR(gdk_window_get_device_position)
GdkWindow * gdk_window_get_pointer (GdkWindow *window,
gint *x,
gint *y,
GdkModifierType *mask) G_GNUC_DEPRECATED_FOR(gdk_window_get_device_position);
GdkModifierType *mask);
#endif /* GDK_MULTIDEVICE_SAFE */
GdkWindow * gdk_window_get_device_position (GdkWindow *window,
GdkDevice *device,
......
......@@ -157,14 +157,18 @@ const gchar * gtk_assistant_get_page_title (GtkAssistant
GtkWidget *page);
#if !defined (GTK_DISABLE_DEPRECATED) || defined (GTK_COMPILATION)
GDK_DEPRECATED
void gtk_assistant_set_page_header_image (GtkAssistant *assistant,
GtkWidget *page,
GdkPixbuf *pixbuf);
GDK_DEPRECATED
GdkPixbuf *gtk_assistant_get_page_header_image (GtkAssistant *assistant,
GtkWidget *page);
GDK_DEPRECATED
void gtk_assistant_set_page_side_image (GtkAssistant *assistant,
GtkWidget *page,
GdkPixbuf *pixbuf);
GDK_DEPRECATED
GdkPixbuf *gtk_assistant_get_page_side_image (GtkAssistant *assistant,
GtkWidget *page);
#endif
......
......@@ -181,6 +181,7 @@ void gtk_binding_entry_remove (GtkBindingSet *binding_set,
GdkModifierType modifiers);
#ifndef GTK_DISABLE_DEPRECATED
GDK_DEPRECATED
void gtk_binding_set_add_path (GtkBindingSet *binding_set,
GtkPathType path_type,
const gchar *path_pattern,
......
......@@ -81,13 +81,15 @@ GtkWidget* gtk_button_new (void);
GtkWidget* gtk_button_new_with_label (const gchar *label);
GtkWidget* gtk_button_new_from_stock (const gchar *stock_id);
GtkWidget* gtk_button_new_with_mnemonic (const gchar *label);
void gtk_button_clicked (GtkButton *button);
#ifndef GTK_DISABLE_DEPRECATED
GDK_DEPRECATED
void gtk_button_pressed (GtkButton *button);
GDK_DEPRECATED
void gtk_button_released (GtkButton *button);
#endif
void gtk_button_clicked (GtkButton *button);
#ifndef GTK_DISABLE_DEPRECATED
GDK_DEPRECATED
void gtk_button_enter (GtkButton *button);
GDK_DEPRECATED
void gtk_button_leave (GtkButton *button);
#endif
......
......@@ -189,13 +189,14 @@ void gtk_cell_renderer_get_aligned_area (GtkCellRend
GdkRectangle *aligned_area);
#ifndef GTK_DISABLE_DEPRECATED
GDK_DEPRECATED_FOR(gtk_cell_renderer_get_preferred_size)
void gtk_cell_renderer_get_size (GtkCellRenderer *cell,
GtkWidget *widget,
const GdkRectangle *cell_area,
gint *x_offset,
gint *y_offset,
gint *width,
gint *height);
GtkWidget *widget,
const GdkRectangle *cell_area,
gint *x_offset,
gint *y_offset,
gint *width,
gint *height);
#endif
void gtk_cell_renderer_render (GtkCellRenderer *cell,
cairo_t *cr,
......
......@@ -87,6 +87,7 @@ void gtk_cell_view_set_fit_model (GtkCellView *cell_v
gboolean fit_model);
#ifndef GTK_DISABLE_DEPRECATED
GDK_DEPRECATED_FOR(gtk_widget_get_preferred_size)
gboolean gtk_cell_view_get_size_of_row (GtkCellView *cell_view,
GtkTreePath *path,
GtkRequisition *requisition);
......
......@@ -12,7 +12,7 @@
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
......@@ -114,23 +114,36 @@ struct _GtkFontSelectionDialogClass
* see the comments in the GtkFontSelectionDialog functions.
*****************************************************************************/
GType gtk_font_selection_get_type (void) G_GNUC_CONST;
GType gtk_font_selection_get_type (void) G_GNUC_CONST;
GDK_DEPRECATED_FOR(GtkFontChooser)
GtkWidget * gtk_font_selection_new (void);
GDK_DEPRECATED_FOR(GtkFontChooser)
GtkWidget * gtk_font_selection_get_family_list (GtkFontSelection *fontsel);
GDK_DEPRECATED_FOR(GtkFontChooser)
GtkWidget * gtk_font_selection_get_face_list (GtkFontSelection *fontsel);
GDK_DEPRECATED_FOR(GtkFontChooser)
GtkWidget * gtk_font_selection_get_size_entry (GtkFontSelection *fontsel);
GDK_DEPRECATED_FOR(GtkFontChooser)
GtkWidget * gtk_font_selection_get_size_list (GtkFontSelection *fontsel);
GDK_DEPRECATED_FOR(GtkFontChooser)
GtkWidget * gtk_font_selection_get_preview_entry (GtkFontSelection *fontsel);
GDK_DEPRECATED_FOR(GtkFontChooser)
PangoFontFamily *
gtk_font_selection_get_family (GtkFontSelection *fontsel);
GDK_DEPRECATED_FOR(GtkFontChooser)
PangoFontFace *
gtk_font_selection_get_face (GtkFontSelection *fontsel);
GDK_DEPRECATED_FOR(GtkFontChooser)
gint gtk_font_selection_get_size (GtkFontSelection *fontsel);
GDK_DEPRECATED_FOR(GtkFontChooser)
gchar* gtk_font_selection_get_font_name (GtkFontSelection *fontsel);
GDK_DEPRECATED_FOR(GtkFontChooser)
gboolean gtk_font_selection_set_font_name (GtkFontSelection *fontsel,
const gchar *fontname);
GDK_DEPRECATED_FOR(GtkFontChooser)
const gchar* gtk_font_selection_get_preview_text (GtkFontSelection *fontsel);
GDK_DEPRECATED_FOR(GtkFontChooser)
void gtk_font_selection_set_preview_text (GtkFontSelection *fontsel,
const gchar *text);
......@@ -140,11 +153,15 @@ void gtk_font_selection_set_preview_text (GtkFontSelection *fontsel,
* GtkFontSelection.
*****************************************************************************/
GType gtk_font_selection_dialog_get_type (void) G_GNUC_CONST;
GtkWidget *gtk_font_selection_dialog_new (const gchar *title);
GType gtk_font_selection_dialog_get_type (void) G_GNUC_CONST;
GDK_DEPRECATED_FOR(GtkFontChooser)
GtkWidget *gtk_font_selection_dialog_new (const gchar *title);
GDK_DEPRECATED_FOR(GtkFontChooser)
GtkWidget *gtk_font_selection_dialog_get_ok_button (GtkFontSelectionDialog *fsd);
GDK_DEPRECATED_FOR(GtkFontChooser)
GtkWidget *gtk_font_selection_dialog_get_cancel_button (GtkFontSelectionDialog *fsd);
GDK_DEPRECATED_FOR(GtkFontChooser)
GtkWidget *gtk_font_selection_dialog_get_font_selection (GtkFontSelectionDialog *fsd);
/* This returns the X Logical Font Description fontname, or NULL if no font
......@@ -152,24 +169,28 @@ GtkWidget *gtk_font_selection_dialog_get_font_selection (GtkFontSelectionDialog
have been loaded OK. You should call gtk_font_selection_dialog_get_font()
to see if it has been loaded OK.
You should g_free() the returned font name after you're done with it. */
gchar* gtk_font_selection_dialog_get_font_name (GtkFontSelectionDialog *fsd);
GDK_DEPRECATED_FOR(GtkFontChooser)
gchar* gtk_font_selection_dialog_get_font_name (GtkFontSelectionDialog *fsd);
/* This sets the currently displayed font. It should be a valid X Logical
Font Description font name (anything else will be ignored), e.g.
"-adobe-courier-bold-o-normal--25-*-*-*-*-*-*-*"
"-adobe-courier-bold-o-normal--25-*-*-*-*-*-*-*"
It returns TRUE on success. */
GDK_DEPRECATED_FOR(GtkFontChooser)
gboolean gtk_font_selection_dialog_set_font_name (GtkFontSelectionDialog *fsd,
const gchar *fontname);
const gchar *fontname);
/* This returns the text in the preview entry. You should copy the returned
text if you need it. */
GDK_DEPRECATED_FOR(GtkFontChooser)
const gchar*
gtk_font_selection_dialog_get_preview_text (GtkFontSelectionDialog *fsd);
/* This sets the text in the preview entry. It will be copied by the entry,
so there's no need to g_strdup() it first. */
void gtk_font_selection_dialog_set_preview_text (GtkFontSelectionDialog *fsd,
const gchar *text);
GDK_DEPRECATED_FOR(GtkFontChooser)
void gtk_font_selection_dialog_set_preview_text (GtkFontSelectionDialog *fsd,
const gchar *text);
#endif /* GTK_DISABLE_DEPRECATED */
......
......@@ -61,6 +61,7 @@ struct _GtkHButtonBoxClass
GType gtk_hbutton_box_get_type (void) G_GNUC_CONST;
GDK_DEPRECATED_FOR(gtk_button_box_new)
GtkWidget* gtk_hbutton_box_new (void);
G_END_DECLS
......
......@@ -62,6 +62,7 @@ struct _GtkHBoxClass
GType gtk_hbox_get_type (void) G_GNUC_CONST;
GDK_DEPRECATED_FOR(gtk_box_new)
GtkWidget * gtk_hbox_new (gboolean homogeneous,
gint spacing);
......
......@@ -60,6 +60,7 @@ struct _GtkHPanedClass
GType gtk_hpaned_get_type (void) G_GNUC_CONST;
GDK_DEPRECATED_FOR(gtk_paned_new)
GtkWidget * gtk_hpaned_new (void);
G_END_DECLS
......
......@@ -61,7 +61,9 @@ struct _GtkHScaleClass
GType gtk_hscale_get_type (void) G_GNUC_CONST;
GDK_DEPRECATED_FOR(gtk_scale_new)
GtkWidget* gtk_hscale_new (GtkAdjustment *adjustment);
GDK_DEPRECATED_FOR(gtk_scale_new_with_range)
GtkWidget* gtk_hscale_new_with_range (gdouble min,
gdouble max,
gdouble step);
......
......@@ -62,6 +62,7 @@ struct _GtkHScrollbarClass
GType gtk_hscrollbar_get_type (void) G_GNUC_CONST;
GDK_DEPRECATED_FOR(gtk_scrollbar_new)
GtkWidget* gtk_hscrollbar_new (GtkAdjustment *adjustment);
......
......@@ -61,6 +61,7 @@ struct _GtkHSeparatorClass
GType gtk_hseparator_get_type (void) G_GNUC_CONST;
GDK_DEPRECATED_FOR(gtk_separator_new)
GtkWidget* gtk_hseparator_new (void);
......
......@@ -125,6 +125,7 @@ GtkIconSet* gtk_icon_set_copy (GtkIconSet *icon_set);
/* Get one of the icon variants in the set, creating the variant if
* necessary.
*/
GDK_DEPRECATED_FOR(gtk_icon_set_render_icon_pixbuf)
GdkPixbuf* gtk_icon_set_render_icon (GtkIconSet *icon_set,
GtkStyle *style,
GtkTextDirection direction,
......
......@@ -212,6 +212,7 @@ GdkPixbuf * gtk_icon_info_load_symbolic_for_context (GtkIconInfo
gboolean *was_symbolic,
GError **error);
#ifndef GTK_DISABLE_DEPRECATED
GDK_DEPRECATED_FOR(gtk_icon_info_load_symbol_for_context)
GdkPixbuf * gtk_icon_info_load_symbolic_for_style (GtkIconInfo *icon_info,
GtkStyle *style,
GtkStateType state,
......
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