diff options
author | Benjamin Otte <otte@redhat.com> | 2016-10-08 01:16:46 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2016-10-16 18:17:21 +0200 |
commit | 9b9b475f0a1d15999cdd03e90693e87fbc3e16e2 (patch) | |
tree | 94a9fe67e28db578285ba66d09d6f69187505c11 /gtk/gtkwidgetpath.c | |
parent | 1a7dcb2053bae92abfa3388d71ed4679bc5c13a0 (diff) | |
download | gtk+-9b9b475f0a1d15999cdd03e90693e87fbc3e16e2.tar.gz |
API: stylecontext: Remove regions
Diffstat (limited to 'gtk/gtkwidgetpath.c')
-rw-r--r-- | gtk/gtkwidgetpath.c | 255 |
1 files changed, 0 insertions, 255 deletions
diff --git a/gtk/gtkwidgetpath.c b/gtk/gtkwidgetpath.c index ae4d0576df..8f15f148de 100644 --- a/gtk/gtkwidgetpath.c +++ b/gtk/gtkwidgetpath.c @@ -292,7 +292,6 @@ gtk_widget_path_to_string (const GtkWidgetPath *path) GtkPathElement *elem; GtkStateFlags state; const GQuark *classes; - GList *list, *regions; elem = &g_array_index (path->elems, GtkPathElement, i); @@ -339,34 +338,6 @@ gtk_widget_path_to_string (const GtkWidgetPath *path) g_string_append_c (string, '.'); g_string_append (string, g_quark_to_string (classes[j])); } - - regions = gtk_css_node_declaration_list_regions (elem->decl); - for (list = regions; list; list = list->next) - { - static const char *flag_names[] = { - "even", - "odd", - "first", - "last", - "only", - "sorted" - }; - GtkRegionFlags flags; - GQuark region = GPOINTER_TO_UINT (regions->data); - - gtk_css_node_declaration_has_region (elem->decl, region, &flags); - g_string_append_c (string, ' '); - g_string_append (string, g_quark_to_string (region)); - for (j = 0; j < G_N_ELEMENTS(flag_names); j++) - { - if (flags & (1 << j)) - { - g_string_append_c (string, ':'); - g_string_append (string, flag_names[j]); - } - } - } - g_list_free (regions); } return g_string_free (string, FALSE); @@ -1027,232 +998,6 @@ gtk_widget_path_iter_has_class (const GtkWidgetPath *path, } /** - * gtk_widget_path_iter_add_region: - * @path: a #GtkWidgetPath - * @pos: position to modify, -1 for the path head - * @name: region name - * @flags: flags affecting the region - * - * Adds the region @name to the widget at position @pos in - * the hierarchy defined in @path. See - * gtk_style_context_add_region(). - * - * Region names must only contain lowercase letters - * 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, - gint pos, - const gchar *name, - GtkRegionFlags flags) -{ - GtkPathElement *elem; - GQuark qname; - - gtk_internal_return_if_fail (path != NULL); - gtk_internal_return_if_fail (path->elems->len != 0); - gtk_internal_return_if_fail (name != NULL); - gtk_internal_return_if_fail (_gtk_style_context_check_region_name (name)); - - if (pos < 0 || pos >= path->elems->len) - pos = path->elems->len - 1; - - elem = &g_array_index (path->elems, GtkPathElement, pos); - qname = g_quark_from_string (name); - - gtk_css_node_declaration_add_region (&elem->decl, qname, flags); -} - -/** - * gtk_widget_path_iter_remove_region: - * @path: a #GtkWidgetPath - * @pos: position to modify, -1 for the path head - * @name: region name - * - * Removes the region @name from the widget at position @pos in - * 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, - gint pos, - const gchar *name) -{ - GtkPathElement *elem; - GQuark qname; - - gtk_internal_return_if_fail (path != NULL); - gtk_internal_return_if_fail (path->elems->len != 0); - gtk_internal_return_if_fail (name != NULL); - - if (pos < 0 || pos >= path->elems->len) - pos = path->elems->len - 1; - - elem = &g_array_index (path->elems, GtkPathElement, pos); - qname = g_quark_try_string (name); - if (qname == 0) - return; - - gtk_css_node_declaration_remove_region (&elem->decl, qname); -} - -/** - * gtk_widget_path_iter_clear_regions: - * @path: a #GtkWidgetPath - * @pos: position to modify, -1 for the path head - * - * Removes all regions from the widget at position @pos in the - * 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, - gint pos) -{ - GtkPathElement *elem; - - gtk_internal_return_if_fail (path != NULL); - gtk_internal_return_if_fail (path->elems->len != 0); - - if (pos < 0 || pos >= path->elems->len) - pos = path->elems->len - 1; - - elem = &g_array_index (path->elems, GtkPathElement, pos); - - gtk_css_node_declaration_clear_regions (&elem->decl); -} - -/** - * gtk_widget_path_iter_list_regions: - * @path: a #GtkWidgetPath - * @pos: position to query, -1 for the path head - * - * Returns a list with all the region names defined for the widget - * at position @pos in the hierarchy defined in @path. - * - * Returns: (transfer container) (element-type utf8): The list of - * regions, This is a list of strings, the #GSList contents - * are owned by GTK+, but you should use g_slist_free() to - * 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, - gint pos) -{ - GtkPathElement *elem; - GSList *list = NULL; - GList *l, *wrong_list; - - gtk_internal_return_val_if_fail (path != NULL, NULL); - gtk_internal_return_val_if_fail (path->elems->len != 0, NULL); - - if (pos < 0 || pos >= path->elems->len) - pos = path->elems->len - 1; - - elem = &g_array_index (path->elems, GtkPathElement, pos); - - wrong_list = gtk_css_node_declaration_list_regions (elem->decl); - for (l = wrong_list; l; l = l->next) - { - list = g_slist_prepend (list, (char *) g_quark_to_string (GPOINTER_TO_UINT (l->data))); - } - g_list_free (wrong_list); - - return list; -} - -/** - * gtk_widget_path_iter_has_qregion: - * @path: a #GtkWidgetPath - * @pos: position to query, -1 for the path head - * @qname: region name as a #GQuark - * @flags: (out): return location for the region flags - * - * See gtk_widget_path_iter_has_region(). This is a version that operates - * with GQuarks. - * - * 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, - gint pos, - GQuark qname, - GtkRegionFlags *flags) -{ - GtkPathElement *elem; - - gtk_internal_return_val_if_fail (path != NULL, FALSE); - gtk_internal_return_val_if_fail (path->elems->len != 0, FALSE); - gtk_internal_return_val_if_fail (qname != 0, FALSE); - - if (pos < 0 || pos >= path->elems->len) - pos = path->elems->len - 1; - - elem = &g_array_index (path->elems, GtkPathElement, pos); - - return gtk_css_node_declaration_has_region (elem->decl, qname, flags); -} - -/** - * gtk_widget_path_iter_has_region: - * @path: a #GtkWidgetPath - * @pos: position to query, -1 for the path head - * @name: region name - * @flags: (out): return location for the region flags - * - * Returns %TRUE if the widget at position @pos has the class @name - * defined, %FALSE otherwise. - * - * 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, - gint pos, - const gchar *name, - GtkRegionFlags *flags) -{ - GQuark qname; - - gtk_internal_return_val_if_fail (path != NULL, FALSE); - gtk_internal_return_val_if_fail (path->elems->len != 0, FALSE); - gtk_internal_return_val_if_fail (name != NULL, FALSE); - - if (pos < 0 || pos >= path->elems->len) - pos = path->elems->len - 1; - - qname = g_quark_try_string (name); - - 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 -} - -/** * gtk_widget_path_get_object_type: * @path: a #GtkWidget * |