diff 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
line wrap: on
line diff
--- a/src/styleengine.hh	Mon Oct 11 18:23:33 2010 +0200
+++ b/src/styleengine.hh	Mon Oct 11 21:35:53 2010 +0200
@@ -33,8 +33,10 @@
       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 @@
       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 ();