]> Pileus Git - ~andy/gtk/commitdiff
GtkStyleContext: s/set/add/ and s/unset/remove/ for classes/regions.
authorCarlos Garnacho <carlosg@gnome.org>
Wed, 20 Oct 2010 17:02:41 +0000 (19:02 +0200)
committerCarlos Garnacho <carlosg@gnome.org>
Sat, 4 Dec 2010 14:38:24 +0000 (15:38 +0100)
Several classes and regions may be set to GtkStyleContext, so rename
the functions to be more intuitive.

docs/reference/gtk/gtk3-sections.txt
gtk/gtknotebook.c
gtk/gtkstyle.c
gtk/gtkstylecontext.c
gtk/gtkstylecontext.h
gtk/gtkwidgetpath.c

index d854ff5b507f8f4276f431762fc0e791dd10ec3c..2da137cf31a912f0f320adf7390439e1e270e038 100644 (file)
@@ -5380,12 +5380,8 @@ gtk_style_context_get_style
 gtk_style_context_get_style_property
 gtk_style_context_get_style_valist
 gtk_style_context_get_valist
-gtk_style_context_has_class
-gtk_style_context_has_region
 gtk_style_context_invalidate
 gtk_style_context_state_is_running
-gtk_style_context_list_classes
-gtk_style_context_list_regions
 gtk_style_context_lookup_color
 gtk_style_context_lookup_icon_set
 gtk_style_context_notify_state_change
@@ -5396,18 +5392,22 @@ gtk_style_context_remove_provider_for_screen
 gtk_style_context_reset_widgets
 gtk_style_context_restore
 gtk_style_context_save
-gtk_style_context_set_class
 gtk_style_context_set_direction
 gtk_style_context_set_junction_sides
 gtk_style_context_set_path
-gtk_style_context_set_region
+gtk_style_context_add_class
+gtk_style_context_remove_class
+gtk_style_context_has_class
+gtk_style_context_list_classes
+gtk_style_context_add_region
+gtk_style_context_remove_region
+gtk_style_context_has_region
+gtk_style_context_list_regions
 gtk_style_context_set_screen
 gtk_style_context_set_state
 gtk_style_context_state_transition_start
 gtk_style_context_state_transition_stop
 gtk_style_context_state_transition_update
-gtk_style_context_unset_class
-gtk_style_context_unset_region
 
 <SUBSECTION>
 gtk_render_arrow
index 3ce43ee9ab237f38b9ab04f5e25943815dc948be..708a8d0fffd363406c1ec85003e8f03cd9eb1e52 100644 (file)
@@ -5068,7 +5068,7 @@ gtk_notebook_draw_tab (GtkNotebook     *notebook,
     flags |= GTK_REGION_LAST;
 
   context = gtk_widget_get_style_context (widget);
-  gtk_style_context_set_region (context, "tab", flags);
+  gtk_style_context_add_region (context, "tab", flags);
 
   gtk_paint_extension (gtk_widget_get_style (widget), cr,
                        state_type, GTK_SHADOW_OUT,
@@ -5096,7 +5096,7 @@ gtk_notebook_draw_tab (GtkNotebook     *notebook,
                        allocation.height + 2 * focus_width);
     }
 
-  gtk_style_context_unset_region (context, "tab");
+  gtk_style_context_remove_region (context, "tab");
 }
 
 static void
index 44c3ed9731c74de0c0e7d9ff55fc72a7f160e9b3..38390c072fe0a8c2d9bb5afc5531c86175069176 100644 (file)
@@ -1740,69 +1740,69 @@ transform_detail_string (const gchar     *detail,
     return;
 
   if (strcmp (detail, "arrow") == 0)
-    gtk_style_context_set_class (context, "arrow");
+    gtk_style_context_add_class (context, "arrow");
   else if (strcmp (detail, "button") == 0)
-    gtk_style_context_set_class (context, "button");
+    gtk_style_context_add_class (context, "button");
   else if (strcmp (detail, "buttondefault") == 0)
     {
-      gtk_style_context_set_class (context, "button");
-      gtk_style_context_set_class (context, "default");
+      gtk_style_context_add_class (context, "button");
+      gtk_style_context_add_class (context, "default");
     }
   else if (strcmp (detail, "calendar") == 0)
-    gtk_style_context_set_class (context, "calendar");
+    gtk_style_context_add_class (context, "calendar");
   else if (strcmp (detail, "cellcheck") == 0)
     {
-      gtk_style_context_set_class (context, "cell");
-      gtk_style_context_set_class (context, "check");
+      gtk_style_context_add_class (context, "cell");
+      gtk_style_context_add_class (context, "check");
     }
   else if (strcmp (detail, "cellradio") == 0)
     {
-      gtk_style_context_set_class (context, "cell");
-      gtk_style_context_set_class (context, "radio");
+      gtk_style_context_add_class (context, "cell");
+      gtk_style_context_add_class (context, "radio");
     }
   else if (strcmp (detail, "checkbutton") == 0)
-    gtk_style_context_set_class (context, "check");
+    gtk_style_context_add_class (context, "check");
   else if (strcmp (detail, "check") == 0)
     {
-      gtk_style_context_set_class (context, "check");
-      gtk_style_context_set_class (context, "menu");
+      gtk_style_context_add_class (context, "check");
+      gtk_style_context_add_class (context, "menu");
     }
   else if (strcmp (detail, "option") == 0)
     {
-      gtk_style_context_set_class (context, "radio");
-      gtk_style_context_set_class (context, "menu");
+      gtk_style_context_add_class (context, "radio");
+      gtk_style_context_add_class (context, "menu");
     }
   else if (strcmp (detail, "entry") == 0 ||
            strcmp (detail, "entry_bg") == 0)
-    gtk_style_context_set_class (context, "entry");
+    gtk_style_context_add_class (context, "entry");
   else if (strcmp (detail, "expander") == 0)
-    gtk_style_context_set_class (context, "expander");
+    gtk_style_context_add_class (context, "expander");
   else if (strcmp (detail, "tooltip") == 0)
-    gtk_style_context_set_class (context, "tooltip");
+    gtk_style_context_add_class (context, "tooltip");
   else if (strcmp (detail, "frame") == 0)
-    gtk_style_context_set_class (context, "frame");
+    gtk_style_context_add_class (context, "frame");
   else if (strcmp (detail, "scrolled_window") == 0)
-    gtk_style_context_set_class (context, "scrolled-window");
+    gtk_style_context_add_class (context, "scrolled-window");
   else if (strcmp (detail, "viewport") == 0 ||
           strcmp (detail, "viewportbin") == 0)
-    gtk_style_context_set_class (context, "viewport");
+    gtk_style_context_add_class (context, "viewport");
   else if (strcmp (detail, "trough") == 0)
     {
-      gtk_style_context_set_class (context, "scrollbar");
-      gtk_style_context_set_class (context, "trough");
+      gtk_style_context_add_class (context, "scrollbar");
+      gtk_style_context_add_class (context, "trough");
     }
   else if (strcmp (detail, "spinbutton") == 0)
-    gtk_style_context_set_class (context, "spinbutton");
+    gtk_style_context_add_class (context, "spinbutton");
   else if (strcmp (detail, "spinbutton_up") == 0)
     {
-      gtk_style_context_set_class (context, "spinbutton");
-      gtk_style_context_set_class (context, "button");
+      gtk_style_context_add_class (context, "spinbutton");
+      gtk_style_context_add_class (context, "button");
       gtk_style_context_set_junction_sides (context, GTK_JUNCTION_BOTTOM);
     }
   else if (strcmp (detail, "spinbutton_down") == 0)
     {
-      gtk_style_context_set_class (context, "spinbutton");
-      gtk_style_context_set_class (context, "button");
+      gtk_style_context_add_class (context, "spinbutton");
+      gtk_style_context_add_class (context, "button");
       gtk_style_context_set_junction_sides (context, GTK_JUNCTION_TOP);
     }
   else if (g_str_has_prefix (detail, "cell_"))
@@ -1837,9 +1837,9 @@ transform_detail_string (const gchar     *detail,
       if (!ruled)
         row &= ~(GTK_REGION_EVEN | GTK_REGION_ODD);
 
-      gtk_style_context_set_class (context, "cell");
-      gtk_style_context_set_region (context, "row", row);
-      gtk_style_context_set_region (context, "column", col);
+      gtk_style_context_add_class (context, "cell");
+      gtk_style_context_add_region (context, "row", row);
+      gtk_style_context_add_region (context, "column", col);
 
       g_strfreev (tokens);
     }
index f0456a4d4c6c78ef344847d3e8a5a5b6f26536d5..284f8521a9c5b5a624d24ab86880a2641bdd58c6 100644 (file)
@@ -1436,8 +1436,8 @@ gtk_style_context_get_path (GtkStyleContext *context)
  * @context: a #GtkStyleContext
  *
  * Saves the @context state, so all modifications done through
- * gtk_style_context_set_class(), gtk_style_context_unset_class(),
- * gtk_style_context_set_region(), gtk_style_context_unset_region()
+ * gtk_style_context_add_class(), gtk_style_context_remove_class(),
+ * gtk_style_context_add_region(), gtk_style_context_remove_region()
  * or gtk_style_context_set_junction_sides() can be reverted in one
  * go through gtk_style_context_restore().
  *
@@ -1590,7 +1590,7 @@ region_find (GArray *array,
 }
 
 /**
- * gtk_style_context_set_class:
+ * gtk_style_context_add_class:
  * @context: a #GtkStyleContext
  * @class_name: class name to use in styling
  *
@@ -1614,7 +1614,7 @@ region_find (GArray *array,
  * Since: 3.0
  **/
 void
-gtk_style_context_set_class (GtkStyleContext *context,
+gtk_style_context_add_class (GtkStyleContext *context,
                              const gchar     *class_name)
 {
   GtkStyleContextPrivate *priv;
@@ -1641,7 +1641,7 @@ gtk_style_context_set_class (GtkStyleContext *context,
 }
 
 /**
- * gtk_style_context_unset_class:
+ * gtk_style_context_remove_class:
  * @context: a #GtkStyleContext
  * @class_name: class name to remove
  *
@@ -1650,8 +1650,8 @@ gtk_style_context_set_class (GtkStyleContext *context,
  * Since: 3.0
  **/
 void
-gtk_style_context_unset_class (GtkStyleContext *context,
-                               const gchar     *class_name)
+gtk_style_context_remove_class (GtkStyleContext *context,
+                                const gchar     *class_name)
 {
   GtkStyleContextPrivate *priv;
   GtkStyleInfo *info;
@@ -1802,7 +1802,7 @@ gtk_style_context_list_regions (GtkStyleContext *context)
 }
 
 /**
- * gtk_style_context_set_region:
+ * gtk_style_context_add_region:
  * @context: a #GtkStyleContext
  * @region_name: region name to use in styling
  * @flags: flags that apply to the region
@@ -1830,7 +1830,7 @@ gtk_style_context_list_regions (GtkStyleContext *context)
  * Since: 3.0
  **/
 void
-gtk_style_context_set_region (GtkStyleContext *context,
+gtk_style_context_add_region (GtkStyleContext *context,
                               const gchar     *region_name,
                               GtkRegionFlags   flags)
 {
@@ -1863,7 +1863,7 @@ gtk_style_context_set_region (GtkStyleContext *context,
 }
 
 /**
- * gtk_style_context_unset_region:
+ * gtk_style_context_remove_region:
  * @context: a #GtkStyleContext
  * @region_name: region name to unset
  *
@@ -1872,8 +1872,8 @@ gtk_style_context_set_region (GtkStyleContext *context,
  * Since: 3.0
  **/
 void
-gtk_style_context_unset_region (GtkStyleContext *context,
-                                const gchar     *region_name)
+gtk_style_context_remove_region (GtkStyleContext *context,
+                                 const gchar     *region_name)
 {
   GtkStyleContextPrivate *priv;
   GtkStyleInfo *info;
index 592d0e8c4a866ac6230036f885ca635325520389..a7c74b5489e50a6d4712a435dbdd785a9fd2fc8f 100644 (file)
@@ -94,23 +94,23 @@ G_CONST_RETURN GtkWidgetPath * gtk_style_context_get_path (GtkStyleContext *cont
 
 GList *  gtk_style_context_list_classes (GtkStyleContext *context);
 
-void     gtk_style_context_set_class   (GtkStyleContext *context,
-                                        const gchar     *class_name);
-void     gtk_style_context_unset_class (GtkStyleContext *context,
-                                        const gchar     *class_name);
-gboolean gtk_style_context_has_class   (GtkStyleContext *context,
-                                        const gchar     *class_name);
+void     gtk_style_context_add_class    (GtkStyleContext *context,
+                                         const gchar     *class_name);
+void     gtk_style_context_remove_class (GtkStyleContext *context,
+                                         const gchar     *class_name);
+gboolean gtk_style_context_has_class    (GtkStyleContext *context,
+                                         const gchar     *class_name);
 
 GList *  gtk_style_context_list_regions (GtkStyleContext *context);
 
-void     gtk_style_context_set_region   (GtkStyleContext    *context,
-                                         const gchar        *region_name,
-                                         GtkRegionFlags      flags);
-void     gtk_style_context_unset_region (GtkStyleContext    *context,
-                                         const gchar        *region_name);
-gboolean gtk_style_context_has_region   (GtkStyleContext    *context,
-                                         const gchar        *region_name,
-                                         GtkRegionFlags     *flags_return);
+void     gtk_style_context_add_region    (GtkStyleContext    *context,
+                                          const gchar        *region_name,
+                                          GtkRegionFlags      flags);
+void     gtk_style_context_remove_region (GtkStyleContext    *context,
+                                          const gchar        *region_name);
+gboolean gtk_style_context_has_region    (GtkStyleContext    *context,
+                                          const gchar        *region_name,
+                                          GtkRegionFlags     *flags_return);
 
 void gtk_style_context_get_style_property (GtkStyleContext *context,
                                            const gchar     *property_name,
index 578335b8e745d0a673202cecc2aa5cc2e567e16f..4b4e186ca89291dc8d092e0428b9b449975e2696 100644 (file)
@@ -436,7 +436,7 @@ gtk_widget_path_iter_has_name (const GtkWidgetPath *path,
  *
  * Adds the class @name to the widget at position @pos in
  * the hierarchy defined in @path. See
- * gtk_style_context_set_class().
+ * gtk_style_context_add_class().
  *
  * Since: 3.0
  **/
@@ -690,7 +690,7 @@ gtk_widget_path_iter_has_class (const GtkWidgetPath *path,
  *
  * Adds the region @name to the widget at position @pos in
  * the hierarchy defined in @path. See
- * gtk_style_context_set_region().
+ * gtk_style_context_add_region().
  *
  * Since: 3.0
  **/