comparison src/styleengine.hh @ 1035:474b9814a8fa

support CSS @import directive
author Johannes Hofmann <Johannes.Hofmann@gmx.de>
date Wed, 08 Apr 2009 16:33:02 +0200
parents 36d9fee90159
children 4ed33b76809c
comparison
equal deleted inserted replaced
1034:03ac3106d5ac 1035:474b9814a8fa
1 #ifndef __STYLEENGINE_HH__ 1 #ifndef __STYLEENGINE_HH__
2 #define __STYLEENGINE_HH__ 2 #define __STYLEENGINE_HH__
3
4 class StyleEngine;
3 5
4 #include "dw/core.hh" 6 #include "dw/core.hh"
5 #include "doctree.hh" 7 #include "doctree.hh"
6 #include "css.hh" 8 #include "css.hh"
7 #include "cssparser.hh" 9 #include "cssparser.hh"
18 20
19 dw::core::Layout *layout; 21 dw::core::Layout *layout;
20 lout::misc::SimpleVector <Node> *stack; 22 lout::misc::SimpleVector <Node> *stack;
21 CssContext *cssContext; 23 CssContext *cssContext;
22 int num; 24 int num;
25 int importDepth;
23 26
24 dw::core::style::Style *style0 (CssPropertyList *nonCssHints = NULL); 27 dw::core::style::Style *style0 (CssPropertyList *nonCssHints = NULL);
25 dw::core::style::Style *wordStyle0 (CssPropertyList *nonCssHints = NULL); 28 dw::core::style::Style *wordStyle0 (CssPropertyList *nonCssHints = NULL);
26 void apply (dw::core::style::StyleAttrs *attrs, CssPropertyList *props); 29 void apply (dw::core::style::StyleAttrs *attrs, CssPropertyList *props);
27 bool computeValue (int *dest, CssLength value, dw::core::style::Font *font); 30 bool computeValue (int *dest, CssLength value, dw::core::style::Font *font);
44 return stack->getRef (n->depth - 1); 47 return stack->getRef (n->depth - 1);
45 else 48 else
46 return NULL; 49 return NULL;
47 }; 50 };
48 51
49 void parse (const char *buf, int buflen, CssOrigin origin); 52 void parse (DilloHtml *html, DilloUrl *url, const char *buf, int buflen, CssOrigin origin);
50 void startElement (int tag); 53 void startElement (int tag);
51 void startElement (const char *tagname); 54 void startElement (const char *tagname);
52 void setId (const char *id); 55 void setId (const char *id);
53 const char * getId () { return top ()->id; }; 56 const char * getId () { return top ()->id; };
54 void setClass (const char *klass); 57 void setClass (const char *klass);