aboutsummaryrefslogtreecommitdiff
path: root/src/cssparser.hh
diff options
context:
space:
mode:
authorJorge Arellano Cid <jcid@dillo.org>2009-01-16 14:32:20 -0300
committerJorge Arellano Cid <jcid@dillo.org>2009-01-16 14:32:20 -0300
commitf299f4f66e50a861309677c9c650eb9079a18236 (patch)
tree221f5e2c6547788837b8bf223759031d637e0bcd /src/cssparser.hh
parent1a0384f130cbbbbdef8c315ee31f6b772ebf2f4a (diff)
parent69e11e3ec87aa36e47100d4e9db02fdc039b5242 (diff)
merge with CSS branch
Diffstat (limited to 'src/cssparser.hh')
-rw-r--r--src/cssparser.hh63
1 files changed, 63 insertions, 0 deletions
diff --git a/src/cssparser.hh b/src/cssparser.hh
new file mode 100644
index 00000000..6638496d
--- /dev/null
+++ b/src/cssparser.hh
@@ -0,0 +1,63 @@
+#ifndef __CSSPARSER_HH__
+#define __CSSPARSER_HH__
+
+#include "css.hh"
+
+/* The last three ones are never parsed. */
+#define CSS_NUM_INTERNAL_PROPERTIES 3
+#define CSS_NUM_PARSED_PROPERTIES \
+ (CssProperty::CSS_PROPERTY_LAST - CSS_NUM_INTERNAL_PROPERTIES)
+
+
+typedef enum {
+ CSS_TYPE_INTEGER, /* This type is only used internally, for x-*
+ properties. */
+ CSS_TYPE_ENUM, /* Value is i, if represented by
+ enum_symbols[i]. */
+ CSS_TYPE_MULTI_ENUM, /* For all enum_symbols[i], 1 << i are
+ combined. */
+ CSS_TYPE_LENGTH_PERCENTAGE, /* <length> or <percentage>. Represented by
+ CssLength. */
+ CSS_TYPE_LENGTH, /* <length>, represented as CssLength.
+ Note: In some cases, CSS_TYPE_LENGTH is used
+ instead of CSS_TYPE_LENGTH_PERCENTAGE,
+ only because Dw cannot handle percentages
+ in this particular case (e.g.
+ 'margin-*-width'). */
+ CSS_TYPE_COLOR, /* Represented as integer. */
+ CSS_TYPE_FONT_WEIGHT, /* this very special and only used by
+ 'font-weight' */
+ CSS_TYPE_STRING, /* <string> */
+ CSS_TYPE_SYMBOL, /* Symbols, which are directly copied (as
+ opposed to CSS_TYPE_ENUM and
+ CSS_TYPE_MULTI_ENUM). Used for
+ 'font-family'. */
+ CSS_TYPE_UNUSED /* Not yet used. Will itself get unused some
+ day. */
+} CssValueType;
+
+typedef enum {
+ CSS_ORIGIN_USER_AGENT,
+ CSS_ORIGIN_USER,
+ CSS_ORIGIN_AUTHOR,
+} CssOrigin;
+
+typedef struct {
+ const char *symbol;
+ CssValueType type;
+ const char **enum_symbols;
+} CssPropertyInfo;
+
+
+void a_Css_init (void);
+void a_Css_freeall (void);
+
+void a_Css_parse (CssContext *context,
+ const char *buf,
+ int buflen,
+ int order_count,
+ CssOrigin origin);
+
+extern CssPropertyInfo Css_property_info[CssProperty::CSS_PROPERTY_LAST];
+
+#endif // __CSS_H__