[gtk+/wip/cssvalue: 36/165] cssmatcher: Use quarks for classes
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/cssvalue: 36/165] cssmatcher: Use quarks for classes
- Date: Fri, 13 Apr 2012 23:05:49 +0000 (UTC)
commit 0822f9085c96dadc1855be99b6f460aa8ac2e1e3
Author: Benjamin Otte <otte redhat com>
Date: Sat Mar 24 01:13:50 2012 +0100
cssmatcher: Use quarks for classes
gtk/gtkcssmatcher.c | 10 +++++-----
gtk/gtkcssmatcherprivate.h | 4 ++--
gtk/gtkcssselector.c | 6 +++---
3 files changed, 10 insertions(+), 10 deletions(-)
---
diff --git a/gtk/gtkcssmatcher.c b/gtk/gtkcssmatcher.c
index 7c09d0c..e67c9ef 100644
--- a/gtk/gtkcssmatcher.c
+++ b/gtk/gtkcssmatcher.c
@@ -78,15 +78,15 @@ gtk_css_matcher_widget_path_has_name (const GtkCssMatcher *matcher,
static gboolean
gtk_css_matcher_widget_path_has_class (const GtkCssMatcher *matcher,
- const char *class_name)
+ GQuark class_name)
{
const GtkWidgetPath *siblings;
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))
- return gtk_widget_path_iter_has_class (siblings, matcher->path.sibling_index, class_name);
+ return gtk_widget_path_iter_has_qclass (siblings, matcher->path.sibling_index, class_name);
else
- return gtk_widget_path_iter_has_class (matcher->path.path, matcher->path.index, class_name);
+ return gtk_widget_path_iter_has_qclass (matcher->path.path, matcher->path.index, class_name);
}
static gboolean
@@ -238,7 +238,7 @@ gtk_css_matcher_any_has_name (const GtkCssMatcher *matcher,
static gboolean
gtk_css_matcher_any_has_class (const GtkCssMatcher *matcher,
- const char *class_name)
+ GQuark class_name)
{
return TRUE;
}
@@ -336,7 +336,7 @@ gtk_css_matcher_superset_has_name (const GtkCssMatcher *matcher,
static gboolean
gtk_css_matcher_superset_has_class (const GtkCssMatcher *matcher,
- const char *class_name)
+ GQuark class_name)
{
if (matcher->superset.relevant & GTK_CSS_CHANGE_CLASS)
return _gtk_css_matcher_has_class (matcher->superset.subset, class_name);
diff --git a/gtk/gtkcssmatcherprivate.h b/gtk/gtkcssmatcherprivate.h
index b562127..121e286 100644
--- a/gtk/gtkcssmatcherprivate.h
+++ b/gtk/gtkcssmatcherprivate.h
@@ -39,7 +39,7 @@ struct _GtkCssMatcherClass {
gboolean (* has_name) (const GtkCssMatcher *matcher,
const char *name);
gboolean (* has_class) (const GtkCssMatcher *matcher,
- const char *class_name);
+ GQuark class_name);
gboolean (* has_id) (const GtkCssMatcher *matcher,
const char *id);
gboolean (* has_regions) (const GtkCssMatcher *matcher);
@@ -110,7 +110,7 @@ _gtk_css_matcher_has_name (const GtkCssMatcher *matcher,
static inline gboolean
_gtk_css_matcher_has_class (const GtkCssMatcher *matcher,
- const char *class_name)
+ GQuark class_name)
{
return matcher->klass->has_class (matcher, class_name);
}
diff --git a/gtk/gtkcssselector.c b/gtk/gtkcssselector.c
index 1c1ae6b..c124bcf 100644
--- a/gtk/gtkcssselector.c
+++ b/gtk/gtkcssselector.c
@@ -351,14 +351,14 @@ gtk_css_selector_class_print (const GtkCssSelector *selector,
GString *string)
{
g_string_append_c (string, '.');
- g_string_append (string, selector->data);
+ g_string_append (string, g_quark_to_string (GPOINTER_TO_UINT (selector->data)));
}
static gboolean
gtk_css_selector_class_match (const GtkCssSelector *selector,
const GtkCssMatcher *matcher)
{
- if (!_gtk_css_matcher_has_class (matcher, selector->data))
+ if (!_gtk_css_matcher_has_class (matcher, GPOINTER_TO_UINT (selector->data)))
return FALSE;
return gtk_css_selector_match (gtk_css_selector_previous (selector), matcher);
@@ -764,7 +764,7 @@ parse_selector_class (GtkCssParser *parser, GtkCssSelector *selector)
selector = gtk_css_selector_new (>K_CSS_SELECTOR_CLASS,
selector,
- g_intern_string (name));
+ GUINT_TO_POINTER (g_quark_from_string (name)));
g_free (name);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]