From 8fd13d8825c14b28787a106acb47e1e3ef47d0f4 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Wed, 26 Nov 2014 13:19:26 +0100 Subject: html: Rename rule and style (match) structs. --- include/mupdf/html.h | 45 +++++++++++++++++++-------------------------- 1 file changed, 19 insertions(+), 26 deletions(-) (limited to 'include') diff --git a/include/mupdf/html.h b/include/mupdf/html.h index 2b1d127f..35d4be8d 100644 --- a/include/mupdf/html.h +++ b/include/mupdf/html.h @@ -4,9 +4,8 @@ #include "mupdf/fitz.h" typedef struct fz_html_font_set_s fz_html_font_set; -typedef struct rule fz_css; -typedef struct property fz_css_property; -typedef struct box fz_html; +typedef struct fz_css_rule_s fz_css_rule; +typedef struct fz_css_match_s fz_css_match; struct fz_html_font_set_s { @@ -24,11 +23,11 @@ enum CSS_URI, }; -struct rule +struct fz_css_rule_s { struct selector *selector; struct property *declaration; - struct rule *next; + fz_css_rule *next; }; struct selector @@ -57,9 +56,17 @@ struct property struct property *next; }; -struct style +struct value { - struct style *up; + int type; + const char *data; + struct value *args; /* function arguments */ + struct value *next; +}; + +struct fz_css_match_s +{ + fz_css_match *up; int count; struct { const char *name; @@ -68,14 +75,6 @@ struct style } prop[64]; }; -struct value -{ - int type; - const char *data; - struct value *args; /* function arguments */ - struct value *next; -}; - enum { DIS_NONE, DIS_BLOCK, DIS_INLINE, DIS_LIST_ITEM }; enum { POS_STATIC, POS_RELATIVE, POS_ABSOLUTE, POS_FIXED }; enum { WS_NORMAL, WS_PRE, WS_NOWRAP, WS_PRE_WRAP, WS_PRE_LINE }; @@ -153,20 +152,14 @@ struct flow struct flow *next; }; -struct rule *fz_parse_css(fz_context *ctx, struct rule *old, const char *source); +fz_css_rule *fz_parse_css(fz_context *ctx, fz_css_rule *old, const char *source); struct property *fz_parse_css_properties(fz_context *ctx, const char *source); -struct rule *fz_new_css_rule(fz_context *ctx, struct selector *selector, struct property *declaration); -struct selector *fz_new_css_selector(fz_context *ctx, const char *name); -struct condition *fz_new_css_condition(fz_context *ctx, int type, const char *key, const char *val); -struct property *fz_new_css_property(fz_context *ctx, const char *name, struct value *value, int spec); -struct value *fz_new_css_value(fz_context *ctx, int type, const char *value); - -int fz_get_css_style_property_display(struct style *node); +void fz_match_css(fz_context *ctx, fz_css_match *match, fz_css_rule *rule, fz_xml *node); -void apply_styles(fz_context *ctx, struct style *style, struct rule *rule, fz_xml *node); -void default_computed_style(struct computed_style *cstyle); -void compute_style(fz_context *ctx, fz_html_font_set *set, struct computed_style *cstyle, struct style *style); +int fz_get_css_match_display(fz_css_match *node); +void fz_default_css_style(fz_context *ctx, struct computed_style *style); +void fz_apply_css_style(fz_context *ctx, fz_html_font_set *set, struct computed_style *style, fz_css_match *match); float fz_from_css_number(struct number, float em, float width); float fz_from_css_number_scale(struct number number, float scale, float em, float width); -- cgit v1.2.3