diff options
author | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2010-10-11 21:35:53 +0200 |
---|---|---|
committer | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2010-10-11 21:35:53 +0200 |
commit | 1200c9668c531f0f6e97bc14faecfadc0c12fdcf (patch) | |
tree | e17985c020c8327bb96faeb607638ec1c70225a4 /src/styleengine.hh | |
parent | 39c2aa181193c4f28118cbdcf54ae9a778460334 (diff) |
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.
Diffstat (limited to 'src/styleengine.hh')
-rw-r--r-- | src/styleengine.hh | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/src/styleengine.hh b/src/styleengine.hh index 3dcf63b5..214a6397 100644 --- a/src/styleengine.hh +++ b/src/styleengine.hh @@ -33,8 +33,10 @@ class StyleEngine { Doctree *doctree; int importDepth; - dw::core::style::Style *style0 (CssPropertyList *nonCssHints = NULL); - dw::core::style::Style *wordStyle0 (CssPropertyList *nonCssHints = NULL); + dw::core::style::Style *style0 (); + dw::core::style::Style *wordStyle0 (); + void setNonCssHint(CssPropertyName name, CssValueType type, + CssPropertyValue value); void preprocessAttrs (dw::core::style::StyleAttrs *attrs); void postprocessAttrs (dw::core::style::StyleAttrs *attrs); void apply (dw::core::style::StyleAttrs *attrs, CssPropertyList *props); @@ -62,8 +64,20 @@ class StyleEngine { void endElement (int tag); void setPseudoLink (); void setPseudoVisited (); - void setNonCssHints (CssPropertyList *nonCssHints); - void setNonCssHint(CssPropertyName name, CssPropertyValue value); + void setNonCssHint(CssPropertyName name, CssValueType type, + int value) { + CssPropertyValue v; + v.intVal = value; + setNonCssHint (name, type, v); + } + void setNonCssHint(CssPropertyName name, CssValueType type, + const char *value) { + CssPropertyValue v; + v.strVal = dStrdup(value); + setNonCssHint (name, type, v); + } + void inheritNonCssHints (); + void clearNonCssHints (); void inheritBackgroundColor (); /* \todo get rid of this somehow */ dw::core::style::Style *backgroundStyle (); |