diff --git a/demos/gtk-demo/dialog.c b/demos/gtk-demo/dialog.c index 3b355fef3e..b5a709ad38 100644 --- a/demos/gtk-demo/dialog.c +++ b/demos/gtk-demo/dialog.c @@ -8,6 +8,8 @@ #include #include +G_GNUC_BEGIN_IGNORE_DEPRECATIONS + static GtkWidget *window = NULL; static GtkWidget *entry1 = NULL; static GtkWidget *entry2 = NULL; diff --git a/demos/gtk-demo/expander.c b/demos/gtk-demo/expander.c index 6a36b52302..7b3d792915 100644 --- a/demos/gtk-demo/expander.c +++ b/demos/gtk-demo/expander.c @@ -10,6 +10,8 @@ #include #include +G_GNUC_BEGIN_IGNORE_DEPRECATIONS + static GtkWidget *window = NULL; static void diff --git a/gtk/gtkmessagedialog.h b/gtk/deprecated/gtkmessagedialog.h similarity index 96% rename from gtk/gtkmessagedialog.h rename to gtk/deprecated/gtkmessagedialog.h index a1de879493..afbe0319f8 100644 --- a/gtk/gtkmessagedialog.h +++ b/gtk/deprecated/gtkmessagedialog.h @@ -78,7 +78,7 @@ typedef enum GDK_AVAILABLE_IN_ALL GType gtk_message_dialog_get_type (void) G_GNUC_CONST; -GDK_AVAILABLE_IN_ALL +GDK_DEPRECATED_IN_4_10 GtkWidget* gtk_message_dialog_new (GtkWindow *parent, GtkDialogFlags flags, GtkMessageType type, @@ -86,7 +86,7 @@ GtkWidget* gtk_message_dialog_new (GtkWindow *parent, const char *message_format, ...) G_GNUC_PRINTF (5, 6); -GDK_AVAILABLE_IN_ALL +GDK_DEPRECATED_IN_4_10 GtkWidget* gtk_message_dialog_new_with_markup (GtkWindow *parent, GtkDialogFlags flags, GtkMessageType type, @@ -94,21 +94,21 @@ GtkWidget* gtk_message_dialog_new_with_markup (GtkWindow *parent, const char *message_format, ...) G_GNUC_PRINTF (5, 6); -GDK_AVAILABLE_IN_ALL +GDK_DEPRECATED_IN_4_10 void gtk_message_dialog_set_markup (GtkMessageDialog *message_dialog, const char *str); -GDK_AVAILABLE_IN_ALL +GDK_DEPRECATED_IN_4_10 void gtk_message_dialog_format_secondary_text (GtkMessageDialog *message_dialog, const char *message_format, ...) G_GNUC_PRINTF (2, 3); -GDK_AVAILABLE_IN_ALL +GDK_DEPRECATED_IN_4_10 void gtk_message_dialog_format_secondary_markup (GtkMessageDialog *message_dialog, const char *message_format, ...) G_GNUC_PRINTF (2, 3); -GDK_AVAILABLE_IN_ALL +GDK_DEPRECATED_IN_4_10 GtkWidget *gtk_message_dialog_get_message_area (GtkMessageDialog *message_dialog); G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkMessageDialog, g_object_unref) diff --git a/gtk/deprecated/meson.build b/gtk/deprecated/meson.build index 3e1051825d..def0f5da5e 100644 --- a/gtk/deprecated/meson.build +++ b/gtk/deprecated/meson.build @@ -77,6 +77,7 @@ gtk_deprecated_headers = [ 'deprecated/gtkfontchooserwidget.h', 'deprecated/gtkiconview.h', 'deprecated/gtkliststore.h', + 'deprecated/gtkmessagedialog.h', 'deprecated/gtkrender.h', 'deprecated/gtkstylecontext.h', 'deprecated/gtktreednd.h', diff --git a/gtk/gtk.h b/gtk/gtk.h index 1444da20ed..5a6ed8ca3e 100644 --- a/gtk/gtk.h +++ b/gtk/gtk.h @@ -183,7 +183,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/gtk/gtkalertdialog.c b/gtk/gtkalertdialog.c index c1fbcd413f..4048c6bb1f 100644 --- a/gtk/gtkalertdialog.c +++ b/gtk/gtkalertdialog.c @@ -22,7 +22,7 @@ #include "gtkalertdialog.h" #include "gtkbutton.h" -#include "gtkmessagedialog.h" +#include "deprecated/gtkmessagedialog.h" #include /** diff --git a/gtk/gtkmessagedialog.c b/gtk/gtkmessagedialog.c index 477f9c405a..07e2c0e2c2 100644 --- a/gtk/gtkmessagedialog.c +++ b/gtk/gtkmessagedialog.c @@ -25,7 +25,7 @@ #include "config.h" -#include "gtkmessagedialog.h" +#include "deprecated/gtkmessagedialog.h" #include "gtkbox.h" #include "gtkbuildable.h" @@ -37,6 +37,8 @@ #include +G_GNUC_BEGIN_IGNORE_DEPRECATIONS + /** * GtkMessageDialog: * @@ -96,6 +98,8 @@ * * The `GtkMessageDialog` implementation of the `GtkBuildable` interface exposes * the message area as an internal child with the name “message_area”. + * + * Deprecated: 4.10: Use [class@Gtk.AlertDialog] instead */ typedef struct @@ -479,6 +483,8 @@ gtk_message_dialog_init (GtkMessageDialog *dialog) * for more details. * * Returns: (transfer none): a new `GtkMessageDialog` + * + * Deprecated: 4.10: Use [class@Gtk.AlertDialog] instead */ GtkWidget* gtk_message_dialog_new (GtkWindow *parent, @@ -565,6 +571,8 @@ gtk_message_dialog_new (GtkWindow *parent, * ``` * * Returns: a new `GtkMessageDialog` + * + * Deprecated: 4.10: Use [class@Gtk.AlertDialog] instead **/ GtkWidget* gtk_message_dialog_new_with_markup (GtkWindow *parent, @@ -602,6 +610,8 @@ gtk_message_dialog_new_with_markup (GtkWindow *parent, * @str: string with Pango markup * * Sets the text of the message dialog. + * + * Deprecated: 4.10: Use [class@Gtk.AlertDialog] instead */ void gtk_message_dialog_set_markup (GtkMessageDialog *message_dialog, @@ -622,6 +632,8 @@ gtk_message_dialog_set_markup (GtkMessageDialog *message_dialog, * @...: arguments for @message_format * * Sets the secondary text of the message dialog. + * + * Deprecated: 4.10: Use [class@Gtk.AlertDialog] instead */ void gtk_message_dialog_format_secondary_text (GtkMessageDialog *message_dialog, @@ -679,6 +691,8 @@ gtk_message_dialog_format_secondary_text (GtkMessageDialog *message_dialog, * "%s", msg); * g_free (msg); * ``` + * + * Deprecated: 4.10: Use [class@Gtk.AlertDialog] instead */ void gtk_message_dialog_format_secondary_markup (GtkMessageDialog *message_dialog, @@ -726,6 +740,8 @@ gtk_message_dialog_format_secondary_markup (GtkMessageDialog *message_dialog, * * Returns: (transfer none): A `GtkBox` corresponding to the * “message area” in the @message_dialog + * + * Deprecated: 4.10: Use [class@Gtk.AlertDialog] instead */ GtkWidget * gtk_message_dialog_get_message_area (GtkMessageDialog *message_dialog) diff --git a/gtk/gtkprintoperation-unix.c b/gtk/gtkprintoperation-unix.c index 297840d7f8..4fbcd77c1c 100644 --- a/gtk/gtkprintoperation-unix.c +++ b/gtk/gtkprintoperation-unix.c @@ -31,7 +31,6 @@ #include #include "gtkprintoperation-private.h" #include "gtkprintoperation-portal.h" -#include "gtkmessagedialog.h" #include #include diff --git a/gtk/gtkprintoperation.c b/gtk/gtkprintoperation.c index 399faf328d..a2f0a3d7bd 100644 --- a/gtk/gtkprintoperation.c +++ b/gtk/gtkprintoperation.c @@ -29,7 +29,7 @@ #include "gtkmarshalers.h" #include #include "gtkprivate.h" -#include "gtkmessagedialog.h" +#include "deprecated/gtkmessagedialog.h" #include "gtkwindowgroup.h" #include "gtktypebuiltins.h" @@ -2848,15 +2848,17 @@ print_pages (GtkPrintOperation *op, { GtkWidget *progress; - progress = gtk_message_dialog_new (parent, 0, - GTK_MESSAGE_OTHER, - GTK_BUTTONS_CANCEL, - _("Preparing")); - g_signal_connect (progress, "response", - G_CALLBACK (handle_progress_response), op); +G_GNUC_BEGIN_IGNORE_DEPRECATIONS + progress = gtk_message_dialog_new (parent, 0, + GTK_MESSAGE_OTHER, + GTK_BUTTONS_CANCEL, + _("Preparing")); +G_GNUC_END_IGNORE_DEPRECATIONS + g_signal_connect (progress, "response", + G_CALLBACK (handle_progress_response), op); - priv->show_progress_timeout_id = - g_timeout_add (SHOW_PROGRESS_TIME, + priv->show_progress_timeout_id = + g_timeout_add (SHOW_PROGRESS_TIME, (GSourceFunc) show_progress_timeout, data); gdk_source_set_static_name_by_id (priv->show_progress_timeout_id, "[gtk] show_progress_timeout"); @@ -2878,6 +2880,7 @@ print_pages (GtkPrintOperation *op, { GtkWidget *error_dialog; +G_GNUC_BEGIN_IGNORE_DEPRECATIONS error_dialog = gtk_message_dialog_new (parent, GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_ERROR, @@ -2886,6 +2889,7 @@ print_pages (GtkPrintOperation *op, gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (error_dialog), _("The most probable reason is that a temporary file could not be created.")); +G_GNUC_END_IGNORE_DEPRECATIONS if (parent && gtk_window_has_group (parent)) gtk_window_group_add_window (gtk_window_get_group (parent), diff --git a/gtk/gtkprintunixdialog.c b/gtk/gtkprintunixdialog.c index a2823abfdf..dd950c31ff 100644 --- a/gtk/gtkprintunixdialog.c +++ b/gtk/gtkprintunixdialog.c @@ -44,7 +44,7 @@ #include "gtkframe.h" #include "gtklabel.h" #include "gtkbuildable.h" -#include "gtkmessagedialog.h" +#include "deprecated/gtkmessagedialog.h" #include "gtkbutton.h" #include "gtksnapshot.h" #include "gtkrenderbackgroundprivate.h" @@ -637,6 +637,7 @@ error_dialogs (GtkPrintUnixDialog *dialog, dirname = g_file_get_parse_name (parent); g_object_unref (parent); +G_GNUC_BEGIN_IGNORE_DEPRECATIONS message_dialog = gtk_message_dialog_new (toplevel, GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, @@ -658,6 +659,7 @@ error_dialogs (GtkPrintUnixDialog *dialog, GTK_RESPONSE_ACCEPT); gtk_dialog_set_default_response (GTK_DIALOG (message_dialog), GTK_RESPONSE_ACCEPT); +G_GNUC_END_IGNORE_DEPRECATIONS if (gtk_window_has_group (toplevel)) gtk_window_group_add_window (gtk_window_get_group (toplevel), diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index 6b4e2d77a7..d5141c10b6 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -47,7 +47,7 @@ #include #include "gtkmain.h" #include "gtkmarshalers.h" -#include "gtkmessagedialog.h" +#include "deprecated/gtkmessagedialog.h" #include "gtkpointerfocusprivate.h" #include "gtkprivate.h" #include "gtkroot.h" @@ -6130,6 +6130,7 @@ gtk_window_set_debugging (GdkDisplay *display, if (warn) { +G_GNUC_BEGIN_IGNORE_DEPRECATIONS dialog = gtk_message_dialog_new (GTK_WINDOW (inspector_window), GTK_DIALOG_MODAL|GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_QUESTION, @@ -6141,6 +6142,7 @@ gtk_window_set_debugging (GdkDisplay *display, "application to break or crash.")); area = gtk_message_dialog_get_message_area (GTK_MESSAGE_DIALOG (dialog)); +G_GNUC_END_IGNORE_DEPRECATIONS check = gtk_check_button_new_with_label (_("Don’t show this message again")); gtk_widget_set_margin_start (check, 10); gtk_widget_show (check); diff --git a/gtk/inspector/logs.c b/gtk/inspector/logs.c index d0e6fc9b3d..14fcfe49ef 100644 --- a/gtk/inspector/logs.c +++ b/gtk/inspector/logs.c @@ -27,7 +27,6 @@ #include "window.h" #include "gtktextview.h" -#include "gtkmessagedialog.h" #include "gtkfilechooserdialog.h" #include "gtkcheckbutton.h" #include "gtklabel.h" diff --git a/gtk/meson.build b/gtk/meson.build index 7b294cbaa4..d47249005b 100644 --- a/gtk/meson.build +++ b/gtk/meson.build @@ -535,7 +535,6 @@ gtk_public_headers = files([ 'gtkmediafile.h', 'gtkmediastream.h', 'gtkmenubutton.h', - 'gtkmessagedialog.h', 'gtkmountoperation.h', 'gtkmultifilter.h', 'gtkmultiselection.h', diff --git a/tests/testfilechooser.c b/tests/testfilechooser.c index c06f636884..65f15e49d6 100644 --- a/tests/testfilechooser.c +++ b/tests/testfilechooser.c @@ -35,6 +35,8 @@ # endif #endif +G_GNUC_BEGIN_IGNORE_DEPRECATIONS + #if 0 static GtkWidget *preview_label; static GtkWidget *preview_image; diff --git a/tests/testvolumebutton.c b/tests/testvolumebutton.c index 0291d3d7b4..982d5c285d 100644 --- a/tests/testvolumebutton.c +++ b/tests/testvolumebutton.c @@ -17,6 +17,8 @@ #include +G_GNUC_BEGIN_IGNORE_DEPRECATIONS + static void value_changed (GtkWidget *button, double volume,