gtk-css-engine r165 - in trunk: . src



Author: robsta
Date: Thu Oct  9 09:30:35 2008
New Revision: 165
URL: http://svn.gnome.org/viewvc/gtk-css-engine?rev=165&view=rev

Log:
* src/gce-serialize.c (accumulate_state):
* src/gce-style.c (rectangle), (gap), (line):
Fix after ccss style API change.



Modified:
   trunk/ChangeLog
   trunk/src/gce-serialize.c
   trunk/src/gce-style.c

Modified: trunk/src/gce-serialize.c
==============================================================================
--- trunk/src/gce-serialize.c	(original)
+++ trunk/src/gce-serialize.c	Thu Oct  9 09:30:35 2008
@@ -101,28 +101,28 @@
 		  char const			*state_name,
 		  struct RcState		*state)
 {
-	ccss_style_t		 style;
-	Node			 node;
-	gboolean		 ret;
+	ccss_style_t		 *style;
+	Node			  node;
+	gboolean		  ret;
 
 	ccss_node_init ((ccss_node_t *) &node, &_node_class);
 	node.type_name = type_name;
 	node.id = NULL;
 	node.pseudo_class = state_name;
 	
-	ccss_style_init (&style);
+	style = ccss_style_new ();
 	ret = ccss_stylesheet_query_apply (stylesheet,
-					  (ccss_node_t const *) &node, &style);
+					  (ccss_node_t const *) &node, style);
 	if (!ret) {
 		return false;
 	}
 
-	ret = ccss_style_get_color (&style, &state->fg[RED], &state->fg[GREEN], &state->fg[BLUE]);
+	ret = ccss_style_get_color (style, &state->fg[RED], &state->fg[GREEN], &state->fg[BLUE]);
 	if (ret) {
 		state->flags |= FG_SET;
 	}
 
-	ret = ccss_style_get_background_color (&style, &state->bg[RED], &state->bg[GREEN], &state->bg[BLUE]);
+	ret = ccss_style_get_background_color (style, &state->bg[RED], &state->bg[GREEN], &state->bg[BLUE]);
 	if (ret) {
 		state->flags |= BG_SET;
 		/* FIXME: also setting "base" to the background color, let's see how this works out. */
@@ -132,6 +132,8 @@
 		state->flags |= BASE_SET;
 	}
 
+	ccss_style_free (style), style = NULL;
+
 	return (gboolean) state->flags;
 }
 

Modified: trunk/src/gce-style.c
==============================================================================
--- trunk/src/gce-style.c	(original)
+++ trunk/src/gce-style.c	Thu Oct  9 09:30:35 2008
@@ -78,13 +78,13 @@
 	   gboolean		 fill)
 {
 	ccss_selector_group_t	*group;
-	ccss_style_t		 style;
+	ccss_style_t		*style;
 	cairo_t			*cr;
 
 	group = setup (node, base);
 	if (group) {
 		cr = gdk_cairo_create (window);
-		ccss_style_init (&style);
+		style = ccss_style_new ();
 
 		if (area) {
 			gdk_cairo_rectangle (cr, area);
@@ -99,20 +99,21 @@
 			height = height == -1 ? h : height;
 		}
 
-		ccss_selector_group_apply (group, &style);
+		ccss_selector_group_apply (group, style);
 
 		/* Hackishly support "background-attachment: fixed". */
-		ccss_style_set_viewport (&style,
+		ccss_style_set_viewport (style,
 			widget->allocation.x, widget->allocation.y,
 			widget->allocation.width, widget->allocation.height);
 
 		if (fill) {
-			ccss_style_draw_rectangle (&style, cr, x, y, width, height);
+			ccss_style_draw_rectangle (style, cr, x, y, width, height);
 		} else {
-			ccss_style_draw_outline (&style, cr, x, y, width, height);
+			ccss_style_draw_outline (style, cr, x, y, width, height);
 		}
 
 		cairo_destroy (cr);
+		ccss_style_free (style);
 		ccss_selector_group_free (group);
 	}
 }
@@ -133,13 +134,13 @@
      gint		 gap_width)
 {
 	ccss_selector_group_t	*group;
-	ccss_style_t		 style;
+	ccss_style_t		*style;
 	cairo_t			*cr;
 
 	group = setup (node, base);
 	if (group) {
 		cr = gdk_cairo_create (window);
-		ccss_style_init (&style);
+		style = ccss_style_new ();
 
 		if (area) {
 			gdk_cairo_rectangle (cr, area);
@@ -154,16 +155,17 @@
 			height = height == -1 ? h : height;
 		}
 
-		ccss_selector_group_apply (group, &style);
+		ccss_selector_group_apply (group, style);
 
 		/* Hackishly support "background-attachment: fixed". */
-		ccss_style_set_viewport (&style,
+		ccss_style_set_viewport (style,
 			widget->allocation.x, widget->allocation.y,
 			widget->allocation.width, widget->allocation.height);
 
-		ccss_style_draw_gap (&style, cr, x, y, width, height, gap_side, gap_start, gap_width);
+		ccss_style_draw_gap (style, cr, x, y, width, height, gap_side, gap_start, gap_width);
 
 		cairo_destroy (cr);
+		ccss_style_free (style);
 		ccss_selector_group_free (group);
 	}
 }
@@ -181,29 +183,30 @@
       gint		 y2)
 {
 	ccss_selector_group_t	*group;
-	ccss_style_t		 style;
+	ccss_style_t		*style;
 	cairo_t			*cr;
 
 	group = setup (node, base);
 	if (group) {
 		cr = gdk_cairo_create (window);
-		ccss_style_init (&style);
+		style = ccss_style_new ();
 
 		if (area) {
 			gdk_cairo_rectangle (cr, area);
 			cairo_clip (cr);
 		}
 
-		ccss_selector_group_apply (group, &style);
+		ccss_selector_group_apply (group, style);
 
 		/* Hackishly support "background-attachment: fixed". */
-		ccss_style_set_viewport (&style,
+		ccss_style_set_viewport (style,
 			widget->allocation.x, widget->allocation.y,
 			widget->allocation.width, widget->allocation.height);
 
-		ccss_style_draw_line (&style, cr, x1, x2, y1, y2);
+		ccss_style_draw_line (style, cr, x1, x2, y1, y2);
 
 		cairo_destroy (cr);
+		ccss_style_free (style);
 		ccss_selector_group_free (group);
 	}
 }



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