[gtk+] widgetpath: Deprecate regions



commit 93b31790424cbc2face0a885b5dd49889c2f297e
Author: Benjamin Otte <otte redhat com>
Date:   Sat Jun 21 15:38:38 2014 +0200

    widgetpath: Deprecate regions
    
    This is a foolowup to d80bf0790d0903ba2825f306b6f7435529f922e2

 gtk/gtknotebook.c            |    4 ++++
 gtk/gtkstylecontext.c        |    2 ++
 gtk/gtktreeview.c            |    2 ++
 gtk/gtkwidgetpath.c          |   14 ++++++++++++++
 gtk/gtkwidgetpath.h          |   12 ++++++------
 testsuite/gtk/stylecontext.c |    3 +++
 6 files changed, 31 insertions(+), 6 deletions(-)
---
diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c
index 7361671..3e1dee6 100644
--- a/gtk/gtknotebook.c
+++ b/gtk/gtknotebook.c
@@ -4603,10 +4603,12 @@ gtk_notebook_get_path_for_child (GtkContainer *container,
   if (!c)
     return path;
 
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
   gtk_widget_path_iter_add_region (path, 
                                    gtk_widget_path_length (path) - 2,
                                    GTK_STYLE_REGION_TAB,
                                    _gtk_notebook_get_tab_flags (notebook, page));
+G_GNUC_END_IGNORE_DEPRECATIONS
 
   return path;
 }
@@ -6680,6 +6682,7 @@ gtk_notebook_update_tab_states (GtkNotebook *notebook)
         {
           GtkRegionFlags current_flags;
 
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
           /* FIXME: We should store these flags somewhere instead of poking
            * the widget's path */
           if (!gtk_widget_path_iter_has_region (gtk_widget_get_path (page->tab_label),
@@ -6688,6 +6691,7 @@ gtk_notebook_update_tab_states (GtkNotebook *notebook)
                                                 &current_flags)
               || current_flags != _gtk_notebook_get_tab_flags (notebook, page))
             _gtk_widget_invalidate_style_context (page->tab_label, GTK_CSS_CHANGE_PARENT_STATE);
+G_GNUC_END_IGNORE_DEPRECATIONS
         }
     }
 }
diff --git a/gtk/gtkstylecontext.c b/gtk/gtkstylecontext.c
index 45fcb9c..1ca31bc 100644
--- a/gtk/gtkstylecontext.c
+++ b/gtk/gtkstylecontext.c
@@ -730,9 +730,11 @@ create_query_path (GtkStyleContext *context,
       GtkRegion *region;
 
       region = &g_array_index (info->regions, GtkRegion, i);
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
       gtk_widget_path_iter_add_region (path, pos,
                                        g_quark_to_string (region->class_quark),
                                        region->flags);
+G_GNUC_END_IGNORE_DEPRECATIONS
     }
 
   /* Set widget classes */
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c
index 83537c9..addac50 100644
--- a/gtk/gtktreeview.c
+++ b/gtk/gtktreeview.c
@@ -8751,7 +8751,9 @@ gtk_tree_view_get_path_for_child (GtkContainer *container,
       if (!list->next)
         flags |= GTK_REGION_LAST;
 
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
       gtk_widget_path_iter_add_region (path, gtk_widget_path_length (path) - 2, 
GTK_STYLE_REGION_COLUMN_HEADER, flags);
+G_GNUC_END_IGNORE_DEPRECATIONS
       break;
     }
   g_list_free (visible_columns);
diff --git a/gtk/gtkwidgetpath.c b/gtk/gtkwidgetpath.c
index ca324d9..221e93c 100644
--- a/gtk/gtkwidgetpath.c
+++ b/gtk/gtkwidgetpath.c
@@ -981,6 +981,8 @@ gtk_widget_path_iter_has_class (const GtkWidgetPath *path,
  * and “-”, starting always with a lowercase letter.
  *
  * Since: 3.0
+ *
+ * Deprecated: 3.14: The use of regions is deprecated.
  **/
 void
 gtk_widget_path_iter_add_region (GtkWidgetPath  *path,
@@ -1020,6 +1022,8 @@ gtk_widget_path_iter_add_region (GtkWidgetPath  *path,
  * the hierarchy defined in @path.
  *
  * Since: 3.0
+ *
+ * Deprecated: 3.14: The use of regions is deprecated.
  **/
 void
 gtk_widget_path_iter_remove_region (GtkWidgetPath *path,
@@ -1056,6 +1060,8 @@ gtk_widget_path_iter_remove_region (GtkWidgetPath *path,
  * hierarchy defined in @path.
  *
  * Since: 3.0
+ *
+ * Deprecated: 3.14: The use of regions is deprecated.
  **/
 void
 gtk_widget_path_iter_clear_regions (GtkWidgetPath *path,
@@ -1089,6 +1095,8 @@ gtk_widget_path_iter_clear_regions (GtkWidgetPath *path,
  *          free the list itself.
  *
  * Since: 3.0
+ *
+ * Deprecated: 3.14: The use of regions is deprecated.
  **/
 GSList *
 gtk_widget_path_iter_list_regions (const GtkWidgetPath *path,
@@ -1136,6 +1144,8 @@ gtk_widget_path_iter_list_regions (const GtkWidgetPath *path,
  * Returns: %TRUE if the widget at @pos has the region defined.
  *
  * Since: 3.0
+ *
+ * Deprecated: 3.14: The use of regions is deprecated.
  **/
 gboolean
 gtk_widget_path_iter_has_qregion (const GtkWidgetPath *path,
@@ -1182,6 +1192,8 @@ gtk_widget_path_iter_has_qregion (const GtkWidgetPath *path,
  * Returns: %TRUE if the class @name is defined for the widget at @pos
  *
  * Since: 3.0
+ *
+ * Deprecated: 3.14: The use of regions is deprecated.
  **/
 gboolean
 gtk_widget_path_iter_has_region (const GtkWidgetPath *path,
@@ -1203,7 +1215,9 @@ gtk_widget_path_iter_has_region (const GtkWidgetPath *path,
   if (qname == 0)
     return FALSE;
 
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
   return gtk_widget_path_iter_has_qregion (path, pos, qname, flags);
+G_GNUC_END_IGNORE_DEPRECATIONS
 }
 
 /**
diff --git a/gtk/gtkwidgetpath.h b/gtk/gtkwidgetpath.h
index ea40469..7a70557 100644
--- a/gtk/gtkwidgetpath.h
+++ b/gtk/gtkwidgetpath.h
@@ -119,29 +119,29 @@ gboolean gtk_widget_path_iter_has_qclass    (const GtkWidgetPath *path,
                                              gint                 pos,
                                              GQuark               qname);
 
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_14
 void     gtk_widget_path_iter_add_region    (GtkWidgetPath      *path,
                                              gint                pos,
                                              const gchar        *name,
                                              GtkRegionFlags     flags);
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_14
 void     gtk_widget_path_iter_remove_region (GtkWidgetPath      *path,
                                              gint                pos,
                                              const gchar        *name);
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_14
 void     gtk_widget_path_iter_clear_regions (GtkWidgetPath      *path,
                                              gint                pos);
 
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_14
 GSList * gtk_widget_path_iter_list_regions  (const GtkWidgetPath *path,
                                              gint                 pos);
 
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_14
 gboolean gtk_widget_path_iter_has_region    (const GtkWidgetPath *path,
                                              gint                 pos,
                                              const gchar         *name,
                                              GtkRegionFlags      *flags);
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_14
 gboolean gtk_widget_path_iter_has_qregion   (const GtkWidgetPath *path,
                                              gint                 pos,
                                              GQuark               qname,
diff --git a/testsuite/gtk/stylecontext.c b/testsuite/gtk/stylecontext.c
index 7348df9..89d395a 100644
--- a/testsuite/gtk/stylecontext.c
+++ b/testsuite/gtk/stylecontext.c
@@ -115,6 +115,7 @@ test_path (void)
   gtk_widget_path_iter_clear_classes (path, 1);
   g_assert (!gtk_widget_path_iter_has_class (path, 1, "class1"));
 
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
   gtk_widget_path_iter_add_region (path, 1, "tab", 0);
   gtk_widget_path_iter_add_region (path, 1, "title", GTK_REGION_EVEN | GTK_REGION_FIRST);
 
@@ -130,6 +131,8 @@ test_path (void)
   g_assert (gtk_widget_path_iter_has_region (path2, 1, "title", &flags) &&
             flags == (GTK_REGION_EVEN | GTK_REGION_FIRST));
   g_assert (!gtk_widget_path_iter_has_region (path2, 1, "extension", NULL));
+G_GNUC_END_IGNORE_DEPRECATIONS
+
   gtk_widget_path_free (path2);
 
   gtk_widget_path_free (path);


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