gtk-css-engine r122 - in trunk: . libccd/ccd



Author: robsta
Date: Tue Sep 23 11:40:46 2008
New Revision: 122
URL: http://svn.gnome.org/viewvc/gtk-css-engine?rev=122&view=rev

Log:
* TODO: account for progress.
* libccd/ccd/Makefile.am:
* libccd/ccd/ccd-background.c:
* libccd/ccd/ccd-background.h:
* libccd/ccd/ccd-block.h:
* libccd/ccd/ccd-border.c:
* libccd/ccd/ccd-border.h:
* libccd/ccd/ccd-parser.c:
* libccd/ccd/ccd-style.c:
* libccd/ccd/ccd-style.h:
* libccd/ccd/ccd-tinge.c:
* libccd/ccd/ccd-tinge.h:
* libccd/ccd/ccd.h:
Rename `color' to `tinge' in preparation of color properties.


Added:
   trunk/libccd/ccd/ccd-tinge.c
      - copied, changed from r121, /trunk/libccd/ccd/ccd-color.c
   trunk/libccd/ccd/ccd-tinge.h
      - copied, changed from r121, /trunk/libccd/ccd/ccd-color.h
Removed:
   trunk/libccd/ccd/ccd-color.c
   trunk/libccd/ccd/ccd-color.h
Modified:
   trunk/   (props changed)
   trunk/ChangeLog
   trunk/TODO
   trunk/libccd/ccd/Makefile.am
   trunk/libccd/ccd/ccd-background.c
   trunk/libccd/ccd/ccd-background.h
   trunk/libccd/ccd/ccd-block.h
   trunk/libccd/ccd/ccd-border.c
   trunk/libccd/ccd/ccd-border.h
   trunk/libccd/ccd/ccd-parser.c
   trunk/libccd/ccd/ccd-style.c
   trunk/libccd/ccd/ccd-style.h
   trunk/libccd/ccd/ccd.h

Modified: trunk/TODO
==============================================================================
--- trunk/TODO	(original)
+++ trunk/TODO	Tue Sep 23 11:40:46 2008
@@ -5,31 +5,36 @@
 0.2 "Correctness"
 -----------------
 
-Features:
-* Background image: repeating, tiling, position.
+-- Features --
 * Add a `fixup' stage when the stylesheet is loaded, handle things like 
   single `background-size: <length>;' there. Possibly piggy-back on the
   stylesheet reading/walking API.
+* Background attachment.
 * Border images, c.f. http://ejohn.org/blog/border-image-in-firefox/
 * Unit tests.
 * Test using the theme torturer.
 * Test using valgrind.
 * Gilouche-CSS theme pretty much matches the original.
 * Bugzilla module.
+
+Done:
 * Border radius.
+* Background image: position, repeat, size.
 
-Internals:
+-- Internals --
 * Embed `property' struct in all properties, implement ccd_selector_apply()
   in a generic manner.
 * Create `color' property and use it for bg- and fg-color (in block, style, ...).
-* Have an internal instance of `block' with default values, ccd_style_init() 
-  initialises the style to those. Then drawing functions don't have to check
-  for NULL pointers any more, or, at least not handle them functionally.
 * Check all list iterators for const-ness.
 * Make all string comparisons case insensitive?
 * Get rid of the _match() functions all toghether?
 * Check 80 column code width.
 
+Done:
+* Have an internal instance of `block' with default values, ccd_style_init() 
+  initialises the style to those. Then drawing functions don't have to check
+  for NULL pointers any more, or, at least not handle them functionally.
+
 0.3 "Features"
 --------------
 

Modified: trunk/libccd/ccd/Makefile.am
==============================================================================
--- trunk/libccd/ccd/Makefile.am	(original)
+++ trunk/libccd/ccd/Makefile.am	Tue Sep 23 11:40:46 2008
@@ -16,7 +16,7 @@
 	ccd-background.h \
 	ccd-block.h \
 	ccd-border.h \
-	ccd-color.h \
+	ccd-tinge.h \
 	ccd-features.h \
 	ccd-function.h \
 	ccd.h \
@@ -43,8 +43,8 @@
 	ccd-block.h \
 	ccd-border.c \
 	ccd-border.h \
-	ccd-color.c \
-	ccd-color.h \
+	ccd-tinge.c \
+	ccd-tinge.h \
 	ccd-features.h \
 	ccd-function.c \
 	ccd-function.h \

Modified: trunk/libccd/ccd/ccd-background.c
==============================================================================
--- trunk/libccd/ccd/ccd-background.c	(original)
+++ trunk/libccd/ccd/ccd-background.c	Tue Sep 23 11:40:46 2008
@@ -86,7 +86,7 @@
 		return false;
 	}
 
-	self->spec = ccd_color_parse (&self->color, values);
+	self->spec = ccd_tinge_parse (&self->color, values);
 	return self->spec == CCD_PROPERTY_SPEC_SET;
 }
 
@@ -565,7 +565,7 @@
 		ccd_property_spec_dump (self->spec);
 		/* fall thru */
 	case CCD_PROPERTY_SPEC_SET:
-		ccd_color_dump (&self->color);
+		ccd_tinge_dump (&self->color);
 		break;
 	}
 }

Modified: trunk/libccd/ccd/ccd-background.h
==============================================================================
--- trunk/libccd/ccd/ccd-background.h	(original)
+++ trunk/libccd/ccd/ccd-background.h	Tue Sep 23 11:40:46 2008
@@ -26,10 +26,10 @@
 #include <glib.h>
 #include <libcroco/libcroco.h>
 #include <ccd/ccd-features.h>
-#include <ccd/ccd-color.h>
 #include <ccd/ccd-image.h>
 #include <ccd/ccd-position.h>
 #include <ccd/ccd-property.h>
+#include <ccd/ccd-tinge.h>
 
 G_BEGIN_DECLS
 
@@ -43,7 +43,7 @@
 
 typedef struct {
 	ccd_property_spec_t	spec;
-	ccd_color_t		color;
+	ccd_tinge_t		color;
 } ccd_background_color_t;
 
 typedef struct {

Modified: trunk/libccd/ccd/ccd-block.h
==============================================================================
--- trunk/libccd/ccd/ccd-block.h	(original)
+++ trunk/libccd/ccd/ccd-block.h	Tue Sep 23 11:40:46 2008
@@ -23,7 +23,7 @@
 #include <glib.h>
 #include <cairo.h>
 #include <ccd/ccd-features.h>
-#include <ccd/ccd-color.h>
+#include <ccd/ccd-tinge.h>
 #include <ccd/ccd-background.h>
 #include <ccd/ccd-border.h>
 #include <ccd/ccd-property.h>
@@ -34,7 +34,7 @@
 	/*< private >*/
 	ccd_background_t	background;
 	ccd_border_t		border;
-	ccd_color_t		color;
+	ccd_tinge_t		color;
 	ccd_property_spec_t	color_spec;
 } ccd_block_t;
 

Modified: trunk/libccd/ccd/ccd-border.c
==============================================================================
--- trunk/libccd/ccd/ccd-border.c	(original)
+++ trunk/libccd/ccd/ccd-border.c	Tue Sep 23 11:40:46 2008
@@ -146,7 +146,7 @@
  * Map between border style css string and internal value.
  */
 static const struct {
-	ccd_border_style_t border_style;
+	ccd_border_style_type_t border_style;
 	char const *css;
 } _border_style_map[] = {
 	{ CCD_BORDER_STYLE_HIDDEN,	"hidden" },
@@ -162,7 +162,7 @@
 
 static bool
 match_style (char const		*css_border_style,
-	     ccd_border_style_t	*style)
+	     ccd_border_style_type_t	*style)
 {
 	g_return_val_if_fail (css_border_style && *css_border_style, false);
 
@@ -177,7 +177,7 @@
 }
 
 static char const *
-lookup_name (ccd_border_style_t border_style)
+lookup_name (ccd_border_style_type_t border_style)
 {
 	for (unsigned int i = 0; i < G_N_ELEMENTS (_border_style_map); i++) {
 		if (_border_style_map[i].border_style == border_style) {
@@ -221,7 +221,7 @@
 
 static ccd_property_spec_t
 parse_style (CRTerm const		**value,
-	     ccd_border_style_t		 *style)
+	     ccd_border_style_type_t		 *style)
 {
 	ccd_property_spec_t spec;
 
@@ -241,7 +241,7 @@
 
 static ccd_property_spec_t
 parse_color (CRTerm const		**value,
-	     ccd_color_t		 *color)
+	     ccd_tinge_t		 *color)
 {
 	ccd_property_spec_t spec;
 
@@ -249,9 +249,9 @@
 	color->red = color->green = color->blue = 0;
 	if (CCD_PROPERTY_SPEC_SET == spec &&
 	    *value &&
-	    ccd_color_parse (color, value)) {
+	    ccd_tinge_parse (color, value)) {
 
-		/* iter is advanced by ccd_color_parse() */
+		/* iter is advanced by ccd_tinge_parse() */
 		spec = CCD_PROPERTY_SPEC_SET;
 	}
 
@@ -284,8 +284,8 @@
 {
 	ccd_property_spec_t	 spec;
 	double			 width;
-	ccd_border_style_t	 style;
-	ccd_color_t		 color;
+	ccd_border_style_type_t	 style;
+	ccd_tinge_t		 color;
 
 	if (0 == strcmp ("width", property)) {
 
@@ -327,8 +327,8 @@
 	CRTerm const		*iter;
 	double			 radius;
 	double			 width;
-	ccd_border_style_t	 style;
-	ccd_color_t		 color;
+	ccd_border_style_type_t	 style;
+	ccd_tinge_t		 color;
 	ccd_property_spec_t	 radius_spec;
 	ccd_property_spec_t	 width_spec;
 	ccd_property_spec_t	 color_spec;
@@ -955,7 +955,7 @@
 	}
 
 	if (self->color_spec != CCD_PROPERTY_SPEC_UNSET) {
-		ccd_color_dump (&self->color);
+		ccd_tinge_dump (&self->color);
 	}
 
 	printf (";\n");

Modified: trunk/libccd/ccd/ccd-border.h
==============================================================================
--- trunk/libccd/ccd/ccd-border.h	(original)
+++ trunk/libccd/ccd/ccd-border.h	Tue Sep 23 11:40:46 2008
@@ -25,7 +25,7 @@
 #include <cairo.h>
 #include <glib.h>
 #include <ccd/ccd-features.h>
-#include <ccd/ccd-color.h>
+#include <ccd/ccd-tinge.h>
 #include <ccd/ccd-property.h>
 
 G_BEGIN_DECLS
@@ -40,7 +40,7 @@
 	CCD_BORDER_STYLE_RIDGE,
 	CCD_BORDER_STYLE_INSET,
 	CCD_BORDER_STYLE_OUTSET
-} ccd_border_style_t;
+} ccd_border_style_type_t;
 
 typedef enum {
 	CCD_BORDER_VISIBILITY_SHOW_ALL		= 0,
@@ -74,9 +74,9 @@
 typedef struct {
 	double			width;
 	ccd_property_spec_t	width_spec;
-	ccd_border_style_t	style;
+	ccd_border_style_type_t	style;
 	ccd_property_spec_t	style_spec;
-	ccd_color_t		color;
+	ccd_tinge_t		color;
 	ccd_property_spec_t	color_spec;
 	unsigned int		flags;
 } ccd_border_stroke_t; 
@@ -112,7 +112,7 @@
 void		ccd_border_free	(ccd_border_t *self);
 
 bool ccd_border_parse (ccd_border_t *self, char const *property, 
-				CRTerm const *values);
+		       CRTerm const *values);
 
 void ccd_border_clamp_radii (double x, double y, double width, double height,
 			     double *left_top, double *top_right,

Modified: trunk/libccd/ccd/ccd-parser.c
==============================================================================
--- trunk/libccd/ccd/ccd-parser.c	(original)
+++ trunk/libccd/ccd/ccd-parser.c	Tue Sep 23 11:40:46 2008
@@ -21,11 +21,11 @@
 #include <string.h>
 #include <libcroco/libcroco.h>
 #include "ccd-block.h"
-#include "ccd-color.h"
 #include "ccd-parser.h"
 #include "ccd-property.h"
 #include "ccd-selector.h"
 #include "ccd-selector-group-priv.h"
+#include "ccd-tinge.h"
 
 typedef struct {
 	GSList		*blocks;
@@ -181,7 +181,7 @@
 		   0 == strncmp ("border-", property, sizeof ("border-") - 1)) {
 		ccd_border_parse (&info->block->border, property, values);
 	} else if (0 == strcmp ("color", property)) {
-		info->block->color_spec = ccd_color_parse (&info->block->color, 
+		info->block->color_spec = ccd_tinge_parse (&info->block->color, 
 							   (CRTerm const **) &values);
 	}
 }

Modified: trunk/libccd/ccd/ccd-style.c
==============================================================================
--- trunk/libccd/ccd/ccd-style.c	(original)
+++ trunk/libccd/ccd/ccd-style.c	Tue Sep 23 11:40:46 2008
@@ -51,7 +51,7 @@
 	.height = { CCD_POSITION_AUTO, 0 }
 };
 
-static const ccd_color_t const _color = {
+static const ccd_tinge_t const _color = {
 	0., 0., 0.
 };
 

Modified: trunk/libccd/ccd/ccd-style.h
==============================================================================
--- trunk/libccd/ccd/ccd-style.h	(original)
+++ trunk/libccd/ccd/ccd-style.h	Tue Sep 23 11:40:46 2008
@@ -26,7 +26,7 @@
 #include <ccd/ccd-features.h>
 #include <ccd/ccd-background.h>
 #include <ccd/ccd-border.h>
-#include <ccd/ccd-color.h>
+#include <ccd/ccd-tinge.h>
 #include <ccd/ccd-property.h>
 
 G_BEGIN_DECLS
@@ -55,7 +55,7 @@
 	ccd_border_join_t			 right_bottom;
 	ccd_border_stroke_t			 bottom;
 	ccd_border_join_t			 bottom_left;
-	ccd_color_t const			*color;
+	ccd_tinge_t const			*color;
 	ccd_property_spec_t			 color_spec;
 } ccd_style_t;
 

Copied: trunk/libccd/ccd/ccd-tinge.c (from r121, /trunk/libccd/ccd/ccd-color.c)
==============================================================================
--- /trunk/libccd/ccd/ccd-color.c	(original)
+++ trunk/libccd/ccd/ccd-tinge.c	Tue Sep 23 11:40:46 2008
@@ -23,11 +23,11 @@
 #include <ctype.h>
 #include <stdio.h>
 #include <string.h>
-#include "ccd-color.h"
+#include "ccd-tinge.h"
 
 static const struct {
 	char const		*name;
-	const ccd_color_t	color;
+	const ccd_tinge_t	color;
 } _color_map[] = {
   { "aliceblue",		{ 0xf0/255., 0xf8/255., 0xff/255. } },
   { "antiquewhite",		{ 0xfa/255., 0xeb/255., 0xd7/255. } },
@@ -179,7 +179,7 @@
 };
 
 static bool
-parse_name (ccd_color_t	*self,
+parse_name (ccd_tinge_t	*self,
 	    char const	*css_color_name)
 {
 	g_return_val_if_fail (css_color_name && self, false);
@@ -216,8 +216,8 @@
 }
 
 static bool
-parse_hex (ccd_color_t	*self,
-		     char const		*color)
+parse_hex (ccd_tinge_t	*self,
+	   char const	*color)
 {
 	size_t		len;
 	unsigned int	r, g, b;
@@ -255,7 +255,7 @@
 }
 
 ccd_property_spec_t
-ccd_color_parse (ccd_color_t	 *self,
+ccd_tinge_parse (ccd_tinge_t	 *self,
 		 CRTerm	const	**value)
 {
 	ccd_property_spec_t	 type;
@@ -309,7 +309,7 @@
 #ifdef CCD_DEBUG
 
 void
-ccd_color_dump (ccd_color_t const *self)
+ccd_tinge_dump (ccd_tinge_t const *self)
 {
 	printf ("rgb(%.3f,%.3f,%.3f)", self->red, self->green, self->blue);
 }

Copied: trunk/libccd/ccd/ccd-tinge.h (from r121, /trunk/libccd/ccd/ccd-color.h)
==============================================================================
--- /trunk/libccd/ccd/ccd-color.h	(original)
+++ trunk/libccd/ccd/ccd-tinge.h	Tue Sep 23 11:40:46 2008
@@ -17,8 +17,8 @@
  * MA 02110-1301, USA.
  */
 
-#ifndef CCD_COLOR_H
-#define CCD_COLOR_H
+#ifndef CCD_TINGE_H
+#define CCD_TINGE_H
 
 #include <stdbool.h>
 #include <glib.h>
@@ -38,15 +38,15 @@
 	double red;
 	double green;
 	double blue;
-} ccd_color_t;
+} ccd_tinge_t;
 
-ccd_property_spec_t ccd_color_parse (ccd_color_t *self, CRTerm const **value);
+ccd_property_spec_t ccd_tinge_parse (ccd_tinge_t *self, CRTerm const **value);
 
 #ifdef CCD_DEBUG
-void ccd_color_dump (ccd_color_t const *self);
+void ccd_tinge_dump (ccd_tinge_t const *self);
 #endif
 
 G_END_DECLS
 
-#endif /* CCD_COLOR_H */
+#endif /* CCD_TINGE_H */
 

Modified: trunk/libccd/ccd/ccd.h
==============================================================================
--- trunk/libccd/ccd/ccd.h	(original)
+++ trunk/libccd/ccd/ccd.h	Tue Sep 23 11:40:46 2008
@@ -28,7 +28,7 @@
 #include <ccd/ccd-function.h>
 #include <ccd/ccd-background.h>
 #include <ccd/ccd-border.h>
-#include <ccd/ccd-color.h>
+#include <ccd/ccd-tinge.h>
 #include <ccd/ccd-function.h>
 #include <ccd/ccd-node.h>
 #include <ccd/ccd-style.h>



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