comparison src/styleengine.hh @ 1733:f39cfc38ea10

rework nonCssHints API of StyleEngine * Instead of passing the nonCssHints as a CssPropertyList, set the hints separately and create the list in StyleEngine. * The CssPropertyList holding the nonCssHints is now completely managed by StyleEngine and kept on the stack. * Replace the table_cell_props mechanic in html.cc/table.cc with a new method inheritNonCssHints() in StyleEngine.
author Johannes Hofmann <Johannes.Hofmann@gmx.de>
date Mon, 11 Oct 2010 21:35:53 +0200
parents 3e3630a58627
children 90feb0de4310
comparison
equal deleted inserted replaced
1732:3e3630a58627 1733:f39cfc38ea10
31 lout::misc::SimpleVector <Node> *stack; 31 lout::misc::SimpleVector <Node> *stack;
32 CssContext *cssContext; 32 CssContext *cssContext;
33 Doctree *doctree; 33 Doctree *doctree;
34 int importDepth; 34 int importDepth;
35 35
36 dw::core::style::Style *style0 (CssPropertyList *nonCssHints = NULL); 36 dw::core::style::Style *style0 ();
37 dw::core::style::Style *wordStyle0 (CssPropertyList *nonCssHints = NULL); 37 dw::core::style::Style *wordStyle0 ();
38 void setNonCssHint(CssPropertyName name, CssValueType type,
39 CssPropertyValue value);
38 void preprocessAttrs (dw::core::style::StyleAttrs *attrs); 40 void preprocessAttrs (dw::core::style::StyleAttrs *attrs);
39 void postprocessAttrs (dw::core::style::StyleAttrs *attrs); 41 void postprocessAttrs (dw::core::style::StyleAttrs *attrs);
40 void apply (dw::core::style::StyleAttrs *attrs, CssPropertyList *props); 42 void apply (dw::core::style::StyleAttrs *attrs, CssPropertyList *props);
41 bool computeValue (int *dest, CssLength value, 43 bool computeValue (int *dest, CssLength value,
42 dw::core::style::Font *font); 44 dw::core::style::Font *font);
60 void setClass (const char *klass); 62 void setClass (const char *klass);
61 void setStyle (const char *style); 63 void setStyle (const char *style);
62 void endElement (int tag); 64 void endElement (int tag);
63 void setPseudoLink (); 65 void setPseudoLink ();
64 void setPseudoVisited (); 66 void setPseudoVisited ();
65 void setNonCssHints (CssPropertyList *nonCssHints); 67 void setNonCssHint(CssPropertyName name, CssValueType type,
66 void setNonCssHint(CssPropertyName name, CssPropertyValue value); 68 int value) {
69 CssPropertyValue v;
70 v.intVal = value;
71 setNonCssHint (name, type, v);
72 }
73 void setNonCssHint(CssPropertyName name, CssValueType type,
74 const char *value) {
75 CssPropertyValue v;
76 v.strVal = dStrdup(value);
77 setNonCssHint (name, type, v);
78 }
79 void inheritNonCssHints ();
80 void clearNonCssHints ();
67 void inheritBackgroundColor (); /* \todo get rid of this somehow */ 81 void inheritBackgroundColor (); /* \todo get rid of this somehow */
68 dw::core::style::Style *backgroundStyle (); 82 dw::core::style::Style *backgroundStyle ();
69 83
70 inline dw::core::style::Style *style () { 84 inline dw::core::style::Style *style () {
71 dw::core::style::Style *s = stack->getRef (stack->size () - 1)->style; 85 dw::core::style::Style *s = stack->getRef (stack->size () - 1)->style;