diff options
author | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2008-10-23 20:03:33 +0200 |
---|---|---|
committer | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2008-10-23 20:03:33 +0200 |
commit | 85f1ef95dd6e46909f034184bc095a577b79970d (patch) | |
tree | d2e69cb9c42eee766d1d13208a03270f1069389e | |
parent | c8b131d5f2d84b92ca9f9fa68dd36aefcbd1a5b1 (diff) |
add StyleEngine
-rw-r--r-- | src/css.cc | 3 | ||||
-rw-r--r-- | src/css.hh | 8 | ||||
-rw-r--r-- | src/html.cc | 2 | ||||
-rw-r--r-- | src/html_common.hh | 3 |
4 files changed, 9 insertions, 7 deletions
@@ -11,8 +11,7 @@ #include "css.hh" -StyleEngine::StyleEngine (DilloHtml *html) { - this->html = html; +StyleEngine::StyleEngine () { } StyleEngine::~StyleEngine () { @@ -2,19 +2,17 @@ #define __CSS_HH__ #include "dw/core.hh" -#include "html_common.hh" class StyleEngine { private: - DilloHtml *html; dw::core::style::Style *currentStyle; public: - StyleEngine (DilloHtml *html); + StyleEngine (); ~StyleEngine (); - void startElement (const char *name); - void endElement (const char *name); + void startElement (int tag, const char *id, const char *style); + void endElement (int tag); inline dw::core::style::Style *style () { return currentStyle; }; }; diff --git a/src/html.cc b/src/html.cc index aaac51d8..e79c7160 100644 --- a/src/html.cc +++ b/src/html.cc @@ -481,6 +481,8 @@ DilloHtml::DilloHtml(BrowserWindow *p_bw, const DilloUrl *url, stack->getRef(0)->current_bg_color = prefs.bg_color; stack->getRef(0)->hand_over_break = false; + styleEngine = new StyleEngine (); + InFlags = IN_NONE; Stash = dStr_new(""); diff --git a/src/html_common.hh b/src/html_common.hh index eafbbb2b..b4ecb58d 100644 --- a/src/html_common.hh +++ b/src/html_common.hh @@ -13,6 +13,8 @@ #include "form.hh" +#include "css.hh" + /* * Macros */ @@ -174,6 +176,7 @@ public: //BUG: for now everything is public float DocTypeVersion; /* HTML or XHTML version number */ lout::misc::SimpleVector<DilloHtmlState> *stack; + StyleEngine *styleEngine; int InFlags; /* tracks which elements we are in */ |