r5305 jmb - /trunk/libcss/src/stylesheet.h

netsurf at semichrome.net netsurf at semichrome.net
Fri Sep 12 14:27:47 BST 2008


Author: jmb
Date: Fri Sep 12 08:27:46 2008
New Revision: 5305

URL: http://source.netsurf-browser.org?rev=5305&view=rev
Log:
Some idle API poking.

Modified:
    trunk/libcss/src/stylesheet.h

Modified: trunk/libcss/src/stylesheet.h
URL: http://source.netsurf-browser.org/trunk/libcss/src/stylesheet.h?rev=5305&r1=5304&r2=5305&view=diff
==============================================================================
--- trunk/libcss/src/stylesheet.h (original)
+++ trunk/libcss/src/stylesheet.h Fri Sep 12 08:27:46 2008
@@ -10,6 +10,7 @@
 
 #include <inttypes.h>
 
+#include <libcss/errors.h>
 #include <libcss/types.h>
 
 typedef struct css_rule css_rule;
@@ -38,11 +39,8 @@
 	css_selector_type type;			/**< Type of selector */
 
 	struct {
-		const uint8_t *name;
-		size_t name_len;
-
-		const uint8_t *value;
-		size_t value_len;
+		css_string name;
+		css_string value;
 	} data;					/**< Selector data */
 
 	uint32_t specificity;			/**< Specificity of selector */
@@ -80,7 +78,8 @@
 		struct {
 			uint32_t media;
 			uint32_t rule_count;
-			css_rule **rules;
+			css_rule **rules;	/** \todo why this? isn't the 
+						 * child list sufficient? */
 		} media;
 		struct {
 			css_style *style;
@@ -94,7 +93,7 @@
 			css_stylesheet *sheet;
 		} import;
 		struct {
-			char *encoding;
+			char *encoding;		/** \todo use MIB enum? */
 		} charset;
 	} data;					/**< Rule data */
 
@@ -134,5 +133,26 @@
 	css_stylesheet *prev;			/**< Previous in sibling list */
 };
 
+css_selector *css_stylesheet_selector_create(css_stylesheet *sheet,
+		css_selector_type type, css_string *name, css_string *value);
+void css_stylesheet_selector_destroy(css_stylesheet *sheet,
+		css_selector *selector);
+
+css_error css_stylesheet_selector_append_specific(css_stylesheet *sheet,
+		css_selector *parent, css_selector *specific);
+
+css_error css_stylesheet_selector_combine(css_stylesheet *sheet,
+		css_combinator type, css_selector *a, css_selector *b);
+
+/** \todo something about adding style declarations to a selector */
+
+css_rule *css_stylesheet_rule_create(css_stylesheet *sheet, css_rule_type type);
+void css_stylesheet_rule_destroy(css_stylesheet *sheet, css_rule *rule);
+
+css_error css_stylesheet_rule_add_selector(css_stylesheet *sheet, 
+		css_rule *rule, css_selector *selector);
+
+/** \todo registering other rule-type data with css_rules */
+
 #endif
 




More information about the netsurf-commits mailing list