From 6d48b29c2bc7ce93eb6ac30f594bdcfb3aa97e11 Mon Sep 17 00:00:00 2001 From: James Bursa Date: Mon, 22 Apr 2002 09:24:35 +0000 Subject: [project @ 2002-04-22 09:24:35 by bursa] Initial revision svn path=/import/netsurf/; revision=2 --- render/css.h | 87 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 render/css.h (limited to 'render/css.h') diff --git a/render/css.h b/render/css.h new file mode 100644 index 000000000..3e465fde1 --- /dev/null +++ b/render/css.h @@ -0,0 +1,87 @@ +/** + * $Id: css.h,v 1.1.1.1 2002/04/22 09:24:34 bursa Exp $ + */ + +#include "css_enum.h" + +/** + * structures and typedefs + */ + +typedef unsigned long colour; /* 0xrrggbb */ +#define TRANSPARENT 0x1000000 + +struct css_length { + float value; + css_unit unit; +}; + +struct css_style { + css_display display; + css_float float_; + + struct { + enum { CSS_FONT_SIZE_INHERIT, + CSS_FONT_SIZE_ABSOLUTE, + CSS_FONT_SIZE_LENGTH, + CSS_FONT_SIZE_PERCENT } size; + union { + float absolute; + struct css_length length; + float percent; + } value; + } font_size; + + struct { + enum { CSS_HEIGHT_AUTO, + CSS_HEIGHT_LENGTH } height; + struct css_length length; + } height; + + struct { + enum { CSS_WIDTH_AUTO, + CSS_WIDTH_LENGTH, + CSS_WIDTH_PERCENT } width; + union { + struct css_length length; + float percent; + } value; + } width; + + + enum { BACKGROUND_SCROLL = 1, BACKGROUND_FIXED } background_attachment; + colour background_color; + /* char background_image[100]; */ + /* background-position */ + enum { BACKGROUND_REPEAT = 1, BACKGROUND_REPEAT_X, + BACKGROUND_REPEAT_Y, BACKGROUND_NO_REPEAT } background_repeat; + /* borders */ + enum { CLEAR_NONE = 1, CLEAR_BOTH, CLEAR_LEFT, CLEAR_RIGHT } clear; + colour color; + /* font-family */ + enum { FONT_STRAIGHT, FONT_OBLIQUE, FONT_ITALIC } font_style; + enum { FONT_NORMAL, FONT_SMALLCAPS } font_variant; + struct { + enum { WEIGHT_ABSOLUTE, WEIGHT_BOLDER, WEIGHT_LIGHTER } weight; + unsigned int value; + } font_weight; +}; + +struct css_stylesheet; + +struct css_selector { + char * element; + char * class; + char * id; +}; + +/** + * interface + */ + +struct css_stylesheet * css_new_stylesheet(void); +void css_get_style(struct css_stylesheet * stylesheet, struct css_selector * selector, + unsigned int selectors, struct css_style * style); +void css_parse_stylesheet(struct css_stylesheet * stylesheet, char * str); +void css_dump_style(const struct css_style * const style); +void css_cascade(struct css_style * const style, const struct css_style * const apply); -- cgit v1.2.3