[gtk-css-engine] [node] Support ccss multiple CSS classes API.



commit d4f6f31f646e4a8ef42c673af567541b6b173203
Author: Robert Staudinger <robsta gnome org>
Date:   Tue Sep 8 15:07:42 2009 +0200

    [node] Support ccss multiple CSS classes API.

 configure.in    |    2 +-
 src/gce-node.c  |   13 +++++++------
 src/gce-style.c |    2 ++
 3 files changed, 10 insertions(+), 7 deletions(-)
---
diff --git a/configure.in b/configure.in
index 4f5c124..834c1b8 100644
--- a/configure.in
+++ b/configure.in
@@ -79,7 +79,7 @@ GTK_VERSION=`$PKG_CONFIG --variable=gtk_binary_version gtk+-2.0`
 AC_SUBST(GTK_VERSION) 
 
 # Maybe it would work with gtk+-2.8, the first sporting cairo, right?
-pkgs='ccss-gtk-1 >= 0.5.0'
+pkgs='ccss-gtk-1 >= 0.5.1'
 
 AC_MSG_CHECKING([for SVG support in ccss-cairo])
 with_rsvg=`$PKG_CONFIG --variable=ccss_with_rsvg ccss-cairo-1`
diff --git a/src/gce-node.c b/src/gce-node.c
index 7c11257..81f0b9c 100644
--- a/src/gce-node.c
+++ b/src/gce-node.c
@@ -29,7 +29,7 @@ struct GceNode_ {
 	ccss_node_t		 parent;
 	GtkWidget		*widget;
 	struct {
-		char const	*class_name;
+		char const	*classes[2];
 		char const	*pseudo_classes[2];
 		char const	*gap;
 		char const	*shadow;
@@ -96,7 +96,8 @@ gce_node_cache_fetch_node (GtkWidget	*widget,
 	node = fetch_node ();
 
 	node->widget = widget;
-	node->attribs.class_name = class_name;
+	node->attribs.classes[0] = class_name;
+	node->attribs.classes[1] = NULL;
 	node->attribs.pseudo_classes[0] = pseudo_class;
 	node->attribs.pseudo_classes[1] = NULL;
 	node->attribs.gap = gap;
@@ -275,12 +276,12 @@ get_type (GceNode const *node)
 	}
 }
 
-static char const *
-get_class (GceNode const *node)
+static char const **
+get_classes (GceNode const *node)
 {
 	g_return_val_if_fail (node, NULL);
 
-	return node->attribs.class_name;
+	return (char const **) node->attribs.classes;
 }
 
 static char const **
@@ -440,7 +441,7 @@ static ccss_node_class_t _node_class = {
 	.get_base_style		= (ccss_node_get_base_style_f) get_base_style,
 	.get_id			= (ccss_node_get_id_f) get_id,
 	.get_type		= (ccss_node_get_type_f) get_type,
-	.get_class		= (ccss_node_get_class_f) get_class,
+	.get_classes		= (ccss_node_get_classes_f) get_classes,
 	.get_pseudo_classes	= (ccss_node_get_pseudo_classes_f) get_pseudo_classes,
 	.get_attribute		= (ccss_node_get_attribute_f) get_attribute,
 	.get_viewport		= (ccss_node_get_viewport_f) get_viewport,
diff --git a/src/gce-style.c b/src/gce-style.c
index 0ac1b41..aeb2506 100644
--- a/src/gce-style.c
+++ b/src/gce-style.c
@@ -30,6 +30,7 @@ static GtkStyleClass *gce_style_parent_class = NULL;
 
 static GHashTable *_widget_aux_hash = NULL;
 
+/* TODO gtk_widget_queue_draw() */
 static void
 has_toplevel_focus_notify (GtkWindow	*window,
 			   GParamSpec	*pspec,
@@ -38,6 +39,7 @@ has_toplevel_focus_notify (GtkWindow	*window,
 	gtk_widget_queue_draw_area (widget, 0, 0, G_MAXINT, G_MAXINT);
 }
 
+/* TODO use "unrealized" instead. */
 static void
 widget_destroy_cb (GtkWidget	 *widget,
 		   GtkWidget	 *watchee)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]