[gtk+/wip/otte/gadget: 3/22] cssmatcher: Remove matching API for regions
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/otte/gadget: 3/22] cssmatcher: Remove matching API for regions
- Date: Sun, 11 Oct 2015 19:33:20 +0000 (UTC)
commit 15f208579433069b15d74b6e931bbfd47c816d7d
Author: Benjamin Otte <otte redhat com>
Date: Tue Sep 8 19:31:37 2015 +0200
cssmatcher: Remove matching API for regions
gtk/gtkcssmatcher.c | 148 --------------------------------------------
gtk/gtkcssmatcherprivate.h | 19 ------
2 files changed, 0 insertions(+), 167 deletions(-)
---
diff --git a/gtk/gtkcssmatcher.c b/gtk/gtkcssmatcher.c
index cb9f733..36b6872 100644
--- a/gtk/gtkcssmatcher.c
+++ b/gtk/gtkcssmatcher.c
@@ -120,73 +120,6 @@ gtk_css_matcher_widget_path_has_id (const GtkCssMatcher *matcher,
}
static gboolean
-gtk_css_matcher_widget_path_has_regions (const GtkCssMatcher *matcher)
-{
- const GtkWidgetPath *siblings;
- GSList *regions;
- gboolean result;
-
- if (matcher->path.decl)
- {
- GList *list = gtk_css_node_declaration_list_regions (matcher->path.decl);
- if (list)
- {
- g_list_free (list);
- return TRUE;
- }
- }
-
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
- siblings = gtk_widget_path_iter_get_siblings (matcher->path.path, matcher->path.index);
- if (siblings && matcher->path.sibling_index != gtk_widget_path_iter_get_sibling_index (matcher->path.path,
matcher->path.index))
- regions = gtk_widget_path_iter_list_regions (siblings, matcher->path.sibling_index);
- else
- regions = gtk_widget_path_iter_list_regions (matcher->path.path, matcher->path.index);
- result = regions != NULL;
- g_slist_free (regions);
-
- return result;
-G_GNUC_END_IGNORE_DEPRECATIONS
-}
-
-static gboolean
-gtk_css_matcher_widget_path_has_region (const GtkCssMatcher *matcher,
- const char *region,
- GtkRegionFlags flags)
-{
- const GtkWidgetPath *siblings;
- GtkRegionFlags region_flags;
-
- if (matcher->path.decl)
- {
- GQuark q = g_quark_try_string (region);
-
- if (q && gtk_css_node_declaration_has_region (matcher->path.decl, q, ®ion_flags))
- goto found;
- }
-
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
- siblings = gtk_widget_path_iter_get_siblings (matcher->path.path, matcher->path.index);
- if (siblings && matcher->path.sibling_index != gtk_widget_path_iter_get_sibling_index (matcher->path.path,
matcher->path.index))
- {
- if (!gtk_widget_path_iter_has_region (siblings, matcher->path.sibling_index, region, ®ion_flags))
- return FALSE;
- }
- else
- {
- if (!gtk_widget_path_iter_has_region (matcher->path.path, matcher->path.index, region, ®ion_flags))
- return FALSE;
- }
-G_GNUC_END_IGNORE_DEPRECATIONS
-
-found:
- if ((flags & region_flags) != flags)
- return FALSE;
-
- return TRUE;
-}
-
-static gboolean
gtk_css_matcher_widget_path_has_position (const GtkCssMatcher *matcher,
gboolean forward,
int a,
@@ -222,8 +155,6 @@ static const GtkCssMatcherClass GTK_CSS_MATCHER_WIDGET_PATH = {
gtk_css_matcher_widget_path_has_name,
gtk_css_matcher_widget_path_has_class,
gtk_css_matcher_widget_path_has_id,
- gtk_css_matcher_widget_path_has_regions,
- gtk_css_matcher_widget_path_has_region,
gtk_css_matcher_widget_path_has_position,
FALSE
};
@@ -328,40 +259,6 @@ gtk_css_matcher_node_has_id (const GtkCssMatcher *matcher,
}
static gboolean
-gtk_css_matcher_node_has_regions (const GtkCssMatcher *matcher)
-{
- GList *regions;
- gboolean result;
-
- regions = gtk_css_node_list_regions (matcher->node.node);
- result = regions != NULL;
- g_list_free (regions);
-
- return result;
-}
-
-static gboolean
-gtk_css_matcher_node_has_region (const GtkCssMatcher *matcher,
- const char *region,
- GtkRegionFlags flags)
-{
- GtkRegionFlags region_flags;
- GQuark region_quark;
-
- region_quark = g_quark_try_string (region);
- if (!region_quark)
- return FALSE;
-
- if (!gtk_css_node_has_region (matcher->node.node, region_quark, ®ion_flags))
- return FALSE;
-
- if ((flags & region_flags) != flags)
- return FALSE;
-
- return TRUE;
-}
-
-static gboolean
gtk_css_matcher_node_nth_child (GtkCssNode *node,
GtkCssNode *(* prev_node_func) (GtkCssNode *),
int a,
@@ -414,8 +311,6 @@ static const GtkCssMatcherClass GTK_CSS_MATCHER_NODE = {
gtk_css_matcher_node_has_name,
gtk_css_matcher_node_has_class,
gtk_css_matcher_node_has_id,
- gtk_css_matcher_node_has_regions,
- gtk_css_matcher_node_has_region,
gtk_css_matcher_node_has_position,
FALSE
};
@@ -482,20 +377,6 @@ gtk_css_matcher_any_has_id (const GtkCssMatcher *matcher,
}
static gboolean
-gtk_css_matcher_any_has_regions (const GtkCssMatcher *matcher)
-{
- return TRUE;
-}
-
-static gboolean
-gtk_css_matcher_any_has_region (const GtkCssMatcher *matcher,
- const char *region,
- GtkRegionFlags flags)
-{
- return TRUE;
-}
-
-static gboolean
gtk_css_matcher_any_has_position (const GtkCssMatcher *matcher,
gboolean forward,
int a,
@@ -511,8 +392,6 @@ static const GtkCssMatcherClass GTK_CSS_MATCHER_ANY = {
gtk_css_matcher_any_has_name,
gtk_css_matcher_any_has_class,
gtk_css_matcher_any_has_id,
- gtk_css_matcher_any_has_regions,
- gtk_css_matcher_any_has_region,
gtk_css_matcher_any_has_position,
TRUE
};
@@ -589,31 +468,6 @@ gtk_css_matcher_superset_has_id (const GtkCssMatcher *matcher,
}
static gboolean
-gtk_css_matcher_superset_has_regions (const GtkCssMatcher *matcher)
-{
- if (matcher->superset.relevant & GTK_CSS_CHANGE_NAME)
- return _gtk_css_matcher_has_regions (matcher->superset.subset);
- else
- return TRUE;
-}
-
-static gboolean
-gtk_css_matcher_superset_has_region (const GtkCssMatcher *matcher,
- const char *region,
- GtkRegionFlags flags)
-{
- if (matcher->superset.relevant & GTK_CSS_CHANGE_NAME)
- {
- if (matcher->superset.relevant & GTK_CSS_CHANGE_POSITION)
- return _gtk_css_matcher_has_region (matcher->superset.subset, region, flags);
- else
- return _gtk_css_matcher_has_region (matcher->superset.subset, region, 0);
- }
- else
- return TRUE;
-}
-
-static gboolean
gtk_css_matcher_superset_has_position (const GtkCssMatcher *matcher,
gboolean forward,
int a,
@@ -632,8 +486,6 @@ static const GtkCssMatcherClass GTK_CSS_MATCHER_SUPERSET = {
gtk_css_matcher_superset_has_name,
gtk_css_matcher_superset_has_class,
gtk_css_matcher_superset_has_id,
- gtk_css_matcher_superset_has_regions,
- gtk_css_matcher_superset_has_region,
gtk_css_matcher_superset_has_position,
FALSE
};
diff --git a/gtk/gtkcssmatcherprivate.h b/gtk/gtkcssmatcherprivate.h
index dce57b2..82be762 100644
--- a/gtk/gtkcssmatcherprivate.h
+++ b/gtk/gtkcssmatcherprivate.h
@@ -43,10 +43,6 @@ struct _GtkCssMatcherClass {
GQuark class_name);
gboolean (* has_id) (const GtkCssMatcher *matcher,
const char *id);
- gboolean (* has_regions) (const GtkCssMatcher *matcher);
- gboolean (* has_region) (const GtkCssMatcher *matcher,
- const char *region,
- GtkRegionFlags flags);
gboolean (* has_position) (const GtkCssMatcher *matcher,
gboolean forward,
int a,
@@ -133,21 +129,6 @@ _gtk_css_matcher_has_id (const GtkCssMatcher *matcher,
return matcher->klass->has_id (matcher, id);
}
-
-static inline gboolean
-_gtk_css_matcher_has_regions (const GtkCssMatcher *matcher)
-{
- return matcher->klass->has_regions (matcher);
-}
-
-static inline gboolean
-_gtk_css_matcher_has_region (const GtkCssMatcher *matcher,
- const char *region,
- GtkRegionFlags flags)
-{
- return matcher->klass->has_region (matcher, region, flags);
-}
-
static inline guint
_gtk_css_matcher_has_position (const GtkCssMatcher *matcher,
gboolean forward,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]