GtkStyleContext: s/set/add/ and s/unset/remove/ for classes/regions.

Several classes and regions may be set to GtkStyleContext, so rename
the functions to be more intuitive.
This commit is contained in:
Carlos Garnacho 2010-10-20 19:02:41 +02:00
parent 161d5175e1
commit c9a3da5025
6 changed files with 68 additions and 68 deletions

View 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

View 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

View 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);
}

View 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;

View 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,

View 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
**/