[gtk/deprecate-entry-completion] Deprecate GtkEntryCompletion




commit 7e9ca5b41d522473941c5fb7017c8f1b9037c571
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Oct 3 22:45:52 2022 -0400

    Deprecate GtkEntryCompletion
    
    We want to drop cell renderers and tree models
    in GTK 5. The functionality of GtkEntryCompletion
    may be replaced by a new widget in GTK 5.

 demos/gtk-demo/entry_completion.c         |  2 ++
 gtk/{ => deprecated}/gtkentrycompletion.c | 50 +++++++++++++++++++++++++++++++
 gtk/{ => deprecated}/gtkentrycompletion.h | 48 ++++++++++++++---------------
 gtk/deprecated/meson.build                |  2 ++
 gtk/gtk.h                                 |  2 +-
 gtk/gtkentry.c                            | 20 ++++++++++++-
 gtk/gtkentry.h                            |  6 ++--
 gtk/gtkentryprivate.h                     |  2 +-
 gtk/gtkfilechooserentry.c                 |  2 ++
 gtk/gtkfilechooserwidget.c                |  8 +++++
 gtk/meson.build                           |  2 --
 tests/testentrycompletion.c               |  2 ++
 tests/testgtk.c                           |  6 ++++
 testsuite/gtk/cellarea.c                  |  2 ++
 14 files changed, 122 insertions(+), 32 deletions(-)
---
diff --git a/demos/gtk-demo/entry_completion.c b/demos/gtk-demo/entry_completion.c
index 9afa30f22b..979194d1c6 100644
--- a/demos/gtk-demo/entry_completion.c
+++ b/demos/gtk-demo/entry_completion.c
@@ -8,6 +8,8 @@
 #include <glib/gi18n.h>
 #include <gtk/gtk.h>
 
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+
 /* Creates a tree model containing the completions */
 static GtkTreeModel *
 create_completion_model (void)
diff --git a/gtk/gtkentrycompletion.c b/gtk/deprecated/gtkentrycompletion.c
similarity index 97%
rename from gtk/gtkentrycompletion.c
rename to gtk/deprecated/gtkentrycompletion.c
index bc37fe9ab1..ce3683908c 100644
--- a/gtk/gtkentrycompletion.c
+++ b/gtk/deprecated/gtkentrycompletion.c
@@ -91,6 +91,8 @@
 #define PAGE_STEP 14
 #define COMPLETION_TIMEOUT 100
 
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+
 /* signals */
 enum
 {
@@ -806,6 +808,8 @@ gtk_entry_completion_selection_changed (GtkTreeSelection *selection,
  * Creates a new `GtkEntryCompletion` object.
  *
  * Returns: A newly created `GtkEntryCompletion` object
+ *
+ * Deprecated: 4.10: GtkEntryCompletion will be removed in GTK 5.
  */
 GtkEntryCompletion *
 gtk_entry_completion_new (void)
@@ -828,6 +832,8 @@ gtk_entry_completion_new (void)
  * `GtkTreeViewColumn` for the drop-down menu.
  *
  * Returns: A newly created `GtkEntryCompletion` object
+ *
+ * Deprecated: 4.10: GtkEntryCompletion will be removed in GTK 5.
  */
 GtkEntryCompletion *
 gtk_entry_completion_new_with_area (GtkCellArea *area)
@@ -846,6 +852,8 @@ gtk_entry_completion_new_with_area (GtkCellArea *area)
  * Gets the entry @completion has been attached to.
  *
  * Returns: (transfer none): The entry @completion has been attached to
+ *
+ * Deprecated: 4.10: GtkEntryCompletion will be removed in GTK 5.
  */
 GtkWidget *
 gtk_entry_completion_get_entry (GtkEntryCompletion *completion)
@@ -865,6 +873,8 @@ gtk_entry_completion_get_entry (GtkEntryCompletion *completion)
  * If @completion already has a model set, it will remove it
  * before setting the new model. If model is %NULL, then it
  * will unset the model.
+ *
+ * Deprecated: 4.10: GtkEntryCompletion will be removed in GTK 5.
  */
 void
 gtk_entry_completion_set_model (GtkEntryCompletion *completion,
@@ -909,6 +919,8 @@ gtk_entry_completion_set_model (GtkEntryCompletion *completion,
  * Returns %NULL if the model is unset.
  *
  * Returns: (nullable) (transfer none): A `GtkTreeModel`
+ *
+ * Deprecated: 4.10: GtkEntryCompletion will be removed in GTK 5.
  */
 GtkTreeModel *
 gtk_entry_completion_get_model (GtkEntryCompletion *completion)
@@ -932,6 +944,8 @@ gtk_entry_completion_get_model (GtkEntryCompletion *completion)
  *
  * The match function is used to determine if a row should or
  * should not be in the completion list.
+ *
+ * Deprecated: 4.10: GtkEntryCompletion will be removed in GTK 5.
  */
 void
 gtk_entry_completion_set_match_func (GtkEntryCompletion          *completion,
@@ -960,6 +974,8 @@ gtk_entry_completion_set_match_func (GtkEntryCompletion          *completion,
  * This is useful for long lists, where completing using a small
  * key takes a lot of time and will come up with meaningless results anyway
  * (ie, a too large dataset).
+ *
+ * Deprecated: 4.10: GtkEntryCompletion will be removed in GTK 5.
  */
 void
 gtk_entry_completion_set_minimum_key_length (GtkEntryCompletion *completion,
@@ -984,6 +1000,8 @@ gtk_entry_completion_set_minimum_key_length (GtkEntryCompletion *completion,
  * Returns the minimum key length as set for @completion.
  *
  * Returns: The currently used minimum key length
+ *
+ * Deprecated: 4.10: GtkEntryCompletion will be removed in GTK 5.
  */
 int
 gtk_entry_completion_get_minimum_key_length (GtkEntryCompletion *completion)
@@ -1001,6 +1019,8 @@ gtk_entry_completion_get_minimum_key_length (GtkEntryCompletion *completion)
  * current list with completions, using the current key.
  *
  * The completion list view will be updated accordingly.
+ *
+ * Deprecated: 4.10: GtkEntryCompletion will be removed in GTK 5.
  */
 void
 gtk_entry_completion_complete (GtkEntryCompletion *completion)
@@ -1046,6 +1066,8 @@ gtk_entry_completion_complete (GtkEntryCompletion *completion)
  * column. If you need to set the text column, but don't want the cell
  * renderer, use g_object_set() to set the
  * [property@Gtk.EntryCompletion:text-column] property directly.
+ *
+ * Deprecated: 4.10: GtkEntryCompletion will be removed in GTK 5.
  */
 void
 gtk_entry_completion_set_text_column (GtkEntryCompletion *completion,
@@ -1078,6 +1100,8 @@ gtk_entry_completion_set_text_column (GtkEntryCompletion *completion,
  * Returns the column in the model of @completion to get strings from.
  *
  * Returns: the column containing the strings
+ *
+ * Deprecated: 4.10: GtkEntryCompletion will be removed in GTK 5.
  */
 int
 gtk_entry_completion_get_text_column (GtkEntryCompletion *completion)
@@ -1233,6 +1257,8 @@ gtk_entry_completion_cursor_on_match (GtkEntryCompletion *completion,
  *
  * Returns: (nullable) (transfer full): The common prefix all rows
  *   starting with @key
+ *
+ * Deprecated: 4.10: GtkEntryCompletion will be removed in GTK 5.
  */
 char *
 gtk_entry_completion_compute_prefix (GtkEntryCompletion *completion,
@@ -1339,6 +1365,8 @@ gtk_entry_completion_real_insert_prefix (GtkEntryCompletion *completion,
  * the completion or %NULL if there’s no completion ongoing.
  *
  * Returns: (nullable): the prefix for the current completion
+ *
+ * Deprecated: 4.10: GtkEntryCompletion will be removed in GTK 5.
  */
 const char *
 gtk_entry_completion_get_completion_prefix (GtkEntryCompletion *completion)
@@ -1400,6 +1428,8 @@ gtk_entry_completion_insert_completion (GtkEntryCompletion *completion,
  * @completion: a `GtkEntryCompletion`
  *
  * Requests a prefix insertion.
+ *
+ * Deprecated: 4.10: GtkEntryCompletion will be removed in GTK 5.
  */
 void
 gtk_entry_completion_insert_prefix (GtkEntryCompletion *completion)
@@ -1435,6 +1465,8 @@ gtk_entry_completion_insert_prefix (GtkEntryCompletion *completion)
  *
  * Sets whether the common prefix of the possible completions should
  * be automatically inserted in the entry.
+ *
+ * Deprecated: 4.10: GtkEntryCompletion will be removed in GTK 5.
  */
 void
 gtk_entry_completion_set_inline_completion (GtkEntryCompletion *completion,
@@ -1460,6 +1492,8 @@ gtk_entry_completion_set_inline_completion (GtkEntryCompletion *completion,
  * be automatically inserted in the entry.
  *
  * Returns: %TRUE if inline completion is turned on
+ *
+ * Deprecated: 4.10: GtkEntryCompletion will be removed in GTK 5.
  */
 gboolean
 gtk_entry_completion_get_inline_completion (GtkEntryCompletion *completion)
@@ -1475,6 +1509,8 @@ gtk_entry_completion_get_inline_completion (GtkEntryCompletion *completion)
  * @popup_completion: %TRUE to do popup completion
  *
  * Sets whether the completions should be presented in a popup window.
+ *
+ * Deprecated: 4.10: GtkEntryCompletion will be removed in GTK 5.
  */
 void
 gtk_entry_completion_set_popup_completion (GtkEntryCompletion *completion,
@@ -1500,6 +1536,8 @@ gtk_entry_completion_set_popup_completion (GtkEntryCompletion *completion,
  * Returns whether the completions should be presented in a popup window.
  *
  * Returns: %TRUE if popup completion is turned on
+ *
+ * Deprecated: 4.10: GtkEntryCompletion will be removed in GTK 5.
  */
 gboolean
 gtk_entry_completion_get_popup_completion (GtkEntryCompletion *completion)
@@ -1516,6 +1554,8 @@ gtk_entry_completion_get_popup_completion (GtkEntryCompletion *completion)
  *
  * Sets whether the completion popup window will be resized to be the same
  * width as the entry.
+ *
+ * Deprecated: 4.10: GtkEntryCompletion will be removed in GTK 5.
  */
 void
 gtk_entry_completion_set_popup_set_width (GtkEntryCompletion *completion,
@@ -1542,6 +1582,8 @@ gtk_entry_completion_set_popup_set_width (GtkEntryCompletion *completion,
  *
  * Returns: %TRUE if the popup window will be resized to the width of
  *   the entry
+ *
+ * Deprecated: 4.10: GtkEntryCompletion will be removed in GTK 5.
  */
 gboolean
 gtk_entry_completion_get_popup_set_width (GtkEntryCompletion *completion)
@@ -1562,6 +1604,8 @@ gtk_entry_completion_get_popup_set_width (GtkEntryCompletion *completion)
  *
  * You may want to set this to %FALSE if you
  * are using [property@Gtk.EntryCompletion:inline-completion].
+ *
+ * Deprecated: 4.10: GtkEntryCompletion will be removed in GTK 5.
  */
 void
 gtk_entry_completion_set_popup_single_match (GtkEntryCompletion *completion,
@@ -1588,6 +1632,8 @@ gtk_entry_completion_set_popup_single_match (GtkEntryCompletion *completion,
  *
  * Returns: %TRUE if the popup window will appear regardless of the
  *    number of matches
+ *
+ * Deprecated: 4.10: GtkEntryCompletion will be removed in GTK 5.
  */
 gboolean
 gtk_entry_completion_get_popup_single_match (GtkEntryCompletion *completion)
@@ -1604,6 +1650,8 @@ gtk_entry_completion_get_popup_single_match (GtkEntryCompletion *completion)
  *
  * Sets whether it is possible to cycle through the possible completions
  * inside the entry.
+ *
+ * Deprecated: 4.10: GtkEntryCompletion will be removed in GTK 5.
  */
 void
 gtk_entry_completion_set_inline_selection (GtkEntryCompletion *completion,
@@ -1628,6 +1676,8 @@ gtk_entry_completion_set_inline_selection (GtkEntryCompletion *completion,
  * Returns %TRUE if inline-selection mode is turned on.
  *
  * Returns: %TRUE if inline-selection mode is on
+ *
+ * Deprecated: 4.10: GtkEntryCompletion will be removed in GTK 5.
  */
 gboolean
 gtk_entry_completion_get_inline_selection (GtkEntryCompletion *completion)
diff --git a/gtk/gtkentrycompletion.h b/gtk/deprecated/gtkentrycompletion.h
similarity index 92%
rename from gtk/gtkentrycompletion.h
rename to gtk/deprecated/gtkentrycompletion.h
index f050c2e570..042b302ed7 100644
--- a/gtk/gtkentrycompletion.h
+++ b/gtk/deprecated/gtkentrycompletion.h
@@ -63,71 +63,71 @@ typedef gboolean (* GtkEntryCompletionMatchFunc) (GtkEntryCompletion *completion
 
 GDK_AVAILABLE_IN_ALL
 GType               gtk_entry_completion_get_type               (void) G_GNUC_CONST;
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_4_10
 GtkEntryCompletion *gtk_entry_completion_new                    (void);
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_4_10
 GtkEntryCompletion *gtk_entry_completion_new_with_area          (GtkCellArea                 *area);
 
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_4_10
 GtkWidget          *gtk_entry_completion_get_entry              (GtkEntryCompletion          *completion);
 
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_4_10
 void                gtk_entry_completion_set_model              (GtkEntryCompletion          *completion,
                                                                  GtkTreeModel                *model);
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_4_10
 GtkTreeModel       *gtk_entry_completion_get_model              (GtkEntryCompletion          *completion);
 
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_4_10
 void                gtk_entry_completion_set_match_func         (GtkEntryCompletion          *completion,
                                                                  GtkEntryCompletionMatchFunc  func,
                                                                  gpointer                     func_data,
                                                                  GDestroyNotify               func_notify);
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_4_10
 void                gtk_entry_completion_set_minimum_key_length (GtkEntryCompletion          *completion,
                                                                  int                          length);
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_4_10
 int                 gtk_entry_completion_get_minimum_key_length (GtkEntryCompletion          *completion);
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_4_10
 char *             gtk_entry_completion_compute_prefix         (GtkEntryCompletion          *completion,
                                                                  const char                  *key);
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_4_10
 void                gtk_entry_completion_complete               (GtkEntryCompletion          *completion);
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_4_10
 void                gtk_entry_completion_insert_prefix          (GtkEntryCompletion          *completion);
 
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_4_10
 void                gtk_entry_completion_set_inline_completion  (GtkEntryCompletion          *completion,
                                                                  gboolean                     
inline_completion);
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_4_10
 gboolean            gtk_entry_completion_get_inline_completion  (GtkEntryCompletion          *completion);
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_4_10
 void                gtk_entry_completion_set_inline_selection  (GtkEntryCompletion          *completion,
                                                                  gboolean                     
inline_selection);
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_4_10
 gboolean            gtk_entry_completion_get_inline_selection  (GtkEntryCompletion          *completion);
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_4_10
 void                gtk_entry_completion_set_popup_completion   (GtkEntryCompletion          *completion,
                                                                  gboolean                     
popup_completion);
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_4_10
 gboolean            gtk_entry_completion_get_popup_completion   (GtkEntryCompletion          *completion);
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_4_10
 void                gtk_entry_completion_set_popup_set_width    (GtkEntryCompletion          *completion,
                                                                  gboolean                     
popup_set_width);
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_4_10
 gboolean            gtk_entry_completion_get_popup_set_width    (GtkEntryCompletion          *completion);
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_4_10
 void                gtk_entry_completion_set_popup_single_match (GtkEntryCompletion          *completion,
                                                                  gboolean                     
popup_single_match);
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_4_10
 gboolean            gtk_entry_completion_get_popup_single_match (GtkEntryCompletion          *completion);
 
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_4_10
 const char          *gtk_entry_completion_get_completion_prefix (GtkEntryCompletion *completion);
 /* convenience */
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_4_10
 void                gtk_entry_completion_set_text_column        (GtkEntryCompletion          *completion,
                                                                  int                          column);
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_4_10
 int                 gtk_entry_completion_get_text_column        (GtkEntryCompletion          *completion);
 
 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkEntryCompletion, g_object_unref)
diff --git a/gtk/deprecated/meson.build b/gtk/deprecated/meson.build
index 98c454ef73..96b38bb53d 100644
--- a/gtk/deprecated/meson.build
+++ b/gtk/deprecated/meson.build
@@ -3,6 +3,7 @@ gtk_deprecated_sources = [
   'deprecated/gtkappchooserbutton.c',
   'deprecated/gtkappchooserdialog.c',
   'deprecated/gtkappchooserwidget.c',
+  'deprecated/gtkentrycompletion.c',
 ]
 
 gtk_deprecated_headers = [
@@ -10,4 +11,5 @@ gtk_deprecated_headers = [
   'deprecated/gtkappchooserbutton.h',
   'deprecated/gtkappchooserdialog.h',
   'deprecated/gtkappchooserwidget.h',
+  'deprecated/gtkentrycompletion.h',
 ]
diff --git a/gtk/gtk.h b/gtk/gtk.h
index ff0a3eff62..965c53e89f 100644
--- a/gtk/gtk.h
+++ b/gtk/gtk.h
@@ -106,7 +106,7 @@
 #include <gtk/gtkemojichooser.h>
 #include <gtk/gtkentry.h>
 #include <gtk/gtkentrybuffer.h>
-#include <gtk/gtkentrycompletion.h>
+#include <gtk/deprecated/gtkentrycompletion.h>
 #include <gtk/gtkenums.h>
 #include <gtk/gtkeventcontroller.h>
 #include <gtk/gtkeventcontrollerfocus.h>
diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c
index 3a73675052..51a8efe39e 100644
--- a/gtk/gtkentry.c
+++ b/gtk/gtkentry.c
@@ -845,11 +845,13 @@ gtk_entry_class_init (GtkEntryClass *class)
    * GtkEntry:completion: (attributes org.gtk.Property.get=gtk_entry_get_completion 
org.gtk.Property.set=gtk_entry_set_completion)
    *
    * The auxiliary completion object to use with the entry.
+   *
+   * Deprecated: 4.10: GtkEntryCompletion will be removed in GTK 5.
    */
   entry_props[PROP_COMPLETION] =
       g_param_spec_object ("completion", NULL, NULL,
                            GTK_TYPE_ENTRY_COMPLETION,
-                           GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
+                           GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY|G_PARAM_DEPRECATED);
 
   /**
    * GtkEntry:input-purpose: (attributes org.gtk.Property.get=gtk_entry_get_input_purpose 
org.gtk.Property.set=gtk_entry_set_input_purpose)
@@ -1169,7 +1171,9 @@ gtk_entry_set_property (GObject         *object,
       break;
 
     case PROP_COMPLETION:
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
       gtk_entry_set_completion (entry, GTK_ENTRY_COMPLETION (g_value_get_object (value)));
+G_GNUC_END_IGNORE_DEPRECATIONS
       break;
 
     case PROP_SHOW_EMOJI_ICON:
@@ -1329,7 +1333,9 @@ gtk_entry_get_property (GObject         *object,
       break;
 
     case PROP_COMPLETION:
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
       g_value_set_object (value, G_OBJECT (gtk_entry_get_completion (entry)));
+G_GNUC_END_IGNORE_DEPRECATIONS
       break;
 
     case PROP_SHOW_EMOJI_ICON:
@@ -1427,7 +1433,9 @@ gtk_entry_dispose (GObject *object)
   gtk_entry_set_icon_from_paintable (entry, GTK_ENTRY_ICON_SECONDARY, NULL);
   gtk_entry_set_icon_tooltip_markup (entry, GTK_ENTRY_ICON_SECONDARY, NULL);
 
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
   gtk_entry_set_completion (entry, NULL);
+G_GNUC_END_IGNORE_DEPRECATIONS
 
   if (priv->text)
     {
@@ -1780,11 +1788,13 @@ gtk_entry_size_allocate (GtkWidget *widget,
    */
   if (gtk_widget_get_realized (widget))
     {
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
       GtkEntryCompletion *completion;
 
       completion = gtk_entry_get_completion (entry);
       if (completion)
         _gtk_entry_completion_resize_popup (completion);
+G_GNUC_END_IGNORE_DEPRECATIONS
     }
 }
 
@@ -3191,6 +3201,8 @@ gtk_entry_query_tooltip (GtkWidget  *widget,
                                                                    tooltip);
 }
 
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+
 /**
  * gtk_entry_set_completion: (attributes org.gtk.Method.set_property=completion)
  * @entry: A `GtkEntry`
@@ -3202,6 +3214,8 @@ gtk_entry_query_tooltip (GtkWidget  *widget,
  * All further configuration of the completion mechanism is
  * done on @completion using the `GtkEntryCompletion` API.
  * Completion is disabled if @completion is set to %NULL.
+ *
+ * Deprecated: 4.10: GtkEntryCompletion will be removed in GTK 5.
  */
 void
 gtk_entry_set_completion (GtkEntry           *entry,
@@ -3248,6 +3262,8 @@ gtk_entry_set_completion (GtkEntry           *entry,
  *
  * Returns: (nullable) (transfer none): The auxiliary
  *   completion object currently in use by @entry
+ *
+ * Deprecated: 4.10: GtkEntryCompletion will be removed in GTK 5.
  */
 GtkEntryCompletion *
 gtk_entry_get_completion (GtkEntry *entry)
@@ -3261,6 +3277,8 @@ gtk_entry_get_completion (GtkEntry *entry)
   return completion;
 }
 
+G_GNUC_END_IGNORE_DEPRECATIONS
+
 static void
 gtk_entry_ensure_progress_widget (GtkEntry *entry)
 {
diff --git a/gtk/gtkentry.h b/gtk/gtkentry.h
index e330e99ac6..4e3d09fbf3 100644
--- a/gtk/gtkentry.h
+++ b/gtk/gtkentry.h
@@ -37,7 +37,7 @@
 #include <gtk/gtkeditable.h>
 #include <gtk/gtkimcontext.h>
 #include <gtk/gtkentrybuffer.h>
-#include <gtk/gtkentrycompletion.h>
+#include <gtk/deprecated/gtkentrycompletion.h>
 #include <gtk/gtkimage.h>
 
 
@@ -157,10 +157,10 @@ void       gtk_entry_set_alignment              (GtkEntry      *entry,
 GDK_AVAILABLE_IN_ALL
 float      gtk_entry_get_alignment              (GtkEntry      *entry);
 
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_4_10
 void                gtk_entry_set_completion (GtkEntry           *entry,
                                               GtkEntryCompletion *completion);
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_4_10
 GtkEntryCompletion *gtk_entry_get_completion (GtkEntry           *entry);
 
 /* Progress API
diff --git a/gtk/gtkentryprivate.h b/gtk/gtkentryprivate.h
index f6773aaec6..8415d5dd0b 100644
--- a/gtk/gtkentryprivate.h
+++ b/gtk/gtkentryprivate.h
@@ -20,7 +20,7 @@
 
 #include "gtkentry.h"
 
-#include "gtkentrycompletion.h"
+#include "deprecated/gtkentrycompletion.h"
 #include "gtkeventcontrollermotion.h"
 #include "gtkliststore.h"
 #include "gtktreemodelfilter.h"
diff --git a/gtk/gtkfilechooserentry.c b/gtk/gtkfilechooserentry.c
index 468dfd5a79..f70de025a8 100644
--- a/gtk/gtkfilechooserentry.c
+++ b/gtk/gtkfilechooserentry.c
@@ -36,6 +36,8 @@
 #include "gtkeventcontrollerfocus.h"
 #include "gtkprivate.h"
 
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+
 typedef struct _GtkFileChooserEntryClass GtkFileChooserEntryClass;
 
 #define GTK_FILE_CHOOSER_ENTRY_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), 
GTK_TYPE_FILE_CHOOSER_ENTRY, GtkFileChooserEntryClass))
diff --git a/gtk/gtkfilechooserwidget.c b/gtk/gtkfilechooserwidget.c
index 492cb7f1fd..e2bf702c04 100644
--- a/gtk/gtkfilechooserwidget.c
+++ b/gtk/gtkfilechooserwidget.c
@@ -4770,6 +4770,8 @@ update_chooser_entry (GtkFileChooserWidget *impl)
 
           if (change_entry && !impl->auto_selecting_first_row)
             {
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+
               GtkEntryCompletion *completion = gtk_entry_get_completion (GTK_ENTRY (impl->location_entry));
 
               if (completion)
@@ -4780,6 +4782,8 @@ update_chooser_entry (GtkFileChooserWidget *impl)
               if (completion)
                 gtk_entry_completion_set_popup_completion (completion, TRUE);
 
+G_GNUC_END_IGNORE_DEPRECATIONS
+
               if (impl->action == GTK_FILE_CHOOSER_ACTION_SAVE)
                 _gtk_file_chooser_entry_select_filename (GTK_FILE_CHOOSER_ENTRY (impl->location_entry));
             }
@@ -5125,12 +5129,16 @@ gtk_file_chooser_widget_set_current_name (GtkFileChooser *chooser,
 
   pending_select_files_free (impl);
 
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+
   completion = gtk_entry_get_completion (GTK_ENTRY (impl->location_entry));
   gtk_entry_completion_set_popup_completion (completion, FALSE);
 
   gtk_editable_set_text (GTK_EDITABLE (impl->location_entry), name);
 
   gtk_entry_completion_set_popup_completion (completion, TRUE);
+
+G_GNUC_END_IGNORE_DEPRECATIONS
 }
 
 static char *
diff --git a/gtk/meson.build b/gtk/meson.build
index 46a50717bf..6d5bfe873d 100644
--- a/gtk/meson.build
+++ b/gtk/meson.build
@@ -229,7 +229,6 @@ gtk_public_sources = files([
   'gtkemojicompletion.c',
   'gtkentry.c',
   'gtkentrybuffer.c',
-  'gtkentrycompletion.c',
   'gtkeventcontroller.c',
   'gtkeventcontrollerfocus.c',
   'gtkeventcontrollerkey.c',
@@ -514,7 +513,6 @@ gtk_public_headers = files([
   'gtkemojichooser.h',
   'gtkentry.h',
   'gtkentrybuffer.h',
-  'gtkentrycompletion.h',
   'gtkenums.h',
   'gtkeventcontroller.h',
   'gtkeventcontrollerfocus.h',
diff --git a/tests/testentrycompletion.c b/tests/testentrycompletion.c
index a62b40978d..8f0253b73b 100644
--- a/tests/testentrycompletion.c
+++ b/tests/testentrycompletion.c
@@ -21,6 +21,8 @@
 #include <string.h>
 #include <gtk/gtk.h>
 
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+
 /* Don't copy this bad example; inline RGB data is always a better
  * idea than inline XPMs.
  */
diff --git a/tests/testgtk.c b/tests/testgtk.c
index 1b8cbf4cbe..6de750e9b3 100644
--- a/tests/testgtk.c
+++ b/tests/testgtk.c
@@ -2934,11 +2934,17 @@ create_cursors (GtkWidget *widget)
       gtk_box_append (GTK_BOX (hbox), label);
 
       entry = gtk_entry_new ();
+
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+
       completion = gtk_entry_completion_new ();
       model = cursor_model ();
       gtk_entry_completion_set_model (completion, model);
       gtk_entry_completion_set_text_column (completion, 0);
       gtk_entry_set_completion (GTK_ENTRY (entry), completion);
+
+G_GNUC_END_IGNORE_DEPRECATIONS
+
       g_object_unref (model);
       gtk_widget_set_hexpand (entry, TRUE);
       gtk_box_append (GTK_BOX (hbox), entry);
diff --git a/testsuite/gtk/cellarea.c b/testsuite/gtk/cellarea.c
index 83995cbda2..5634b106f5 100644
--- a/testsuite/gtk/cellarea.c
+++ b/testsuite/gtk/cellarea.c
@@ -22,6 +22,8 @@
 #include <string.h>
 #include <math.h>
 
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+
 /* tests related to handling of the cell-area property in
  * GtkCellLayout implementations
  */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]