Mercurial > dillo_port1.3
comparison src/styleengine.hh @ 644:9e4ad941cbdc
add wordStyle() method to StyleEngine
author | Johannes Hofmann <Johannes.Hofmann@gmx.de> |
---|---|
date | Thu, 04 Dec 2008 18:39:19 +0100 |
parents | eb0279297fde |
children | ea961706be66 |
comparison
equal
deleted
inserted
replaced
643:eb0279297fde | 644:9e4ad941cbdc |
---|---|
9 class StyleEngine : public Doctree { | 9 class StyleEngine : public Doctree { |
10 private: | 10 private: |
11 class Node : public DoctreeNode { | 11 class Node : public DoctreeNode { |
12 public: | 12 public: |
13 dw::core::style::Style *style; | 13 dw::core::style::Style *style; |
14 dw::core::style::Style *wordStyle; | |
14 const char *styleAttribute; | 15 const char *styleAttribute; |
15 bool inheritBackgroundColor; | 16 bool inheritBackgroundColor; |
16 }; | 17 }; |
17 | 18 |
18 dw::core::Layout *layout; | 19 dw::core::Layout *layout; |
19 lout::misc::SimpleVector <Node> *stack; | 20 lout::misc::SimpleVector <Node> *stack; |
20 CssContext *cssContext; | 21 CssContext *cssContext; |
21 | 22 |
22 dw::core::style::Style *style0 (CssPropertyList *nonCssHints = NULL); | 23 dw::core::style::Style *style0 (CssPropertyList *nonCssHints = NULL); |
24 dw::core::style::Style *wordStyle0 (CssPropertyList *nonCssHints = NULL); | |
23 void apply (dw::core::style::StyleAttrs *attrs, CssPropertyList *props); | 25 void apply (dw::core::style::StyleAttrs *attrs, CssPropertyList *props); |
24 int computeValue (CssLength value, dw::core::style::Font *font); | 26 int computeValue (CssLength value, dw::core::style::Font *font); |
25 | 27 |
26 public: | 28 public: |
27 StyleEngine (dw::core::Layout *layout); | 29 StyleEngine (dw::core::Layout *layout); |
54 if (s) | 56 if (s) |
55 return s; | 57 return s; |
56 else | 58 else |
57 return style0 (); | 59 return style0 (); |
58 }; | 60 }; |
61 inline dw::core::style::Style *wordStyle () { | |
62 dw::core::style::Style *s = stack->getRef (stack->size () - 1)->wordStyle; | |
63 if (s) | |
64 return s; | |
65 else | |
66 return wordStyle0 (); | |
67 }; | |
68 | |
59 }; | 69 }; |
60 | 70 |
61 #endif | 71 #endif |