aboutsummaryrefslogtreecommitdiff
path: root/src/styleengine.hh
diff options
context:
space:
mode:
authorJohannes Hofmann <Johannes.Hofmann@gmx.de>2008-10-29 16:44:28 +0100
committerJohannes Hofmann <Johannes.Hofmann@gmx.de>2008-10-29 16:44:28 +0100
commitb8df95008c6a2e36aaac09f761e4c64a3520ac45 (patch)
treeb61ac3242a1170dc6ffdfe855d59e1369b22a929 /src/styleengine.hh
parent5fb38f8dd5c9b2203fe6d4323f7b10d7385e582c (diff)
implement various apply() methods
Diffstat (limited to 'src/styleengine.hh')
-rw-r--r--src/styleengine.hh27
1 files changed, 24 insertions, 3 deletions
diff --git a/src/styleengine.hh b/src/styleengine.hh
index af615a44..94792250 100644
--- a/src/styleengine.hh
+++ b/src/styleengine.hh
@@ -4,17 +4,38 @@
#include "dw/core.hh"
#include "doctree.hh"
-class StyleEngine {
+class StyleEngine : public Doctree {
private:
- dw::core::style::Style *currentStyle;
+ class Node : public DoctreeNode {
+ public:
+ dw::core::style::Style *style;
+
+
+ };
+
+ lout::misc::SimpleVector <Node> *stack;
public:
StyleEngine ();
~StyleEngine ();
+
+ /* Doctree interface */
+ const DoctreeNode *top () {
+ return stack->getRef (stack->size () - 1);
+ };
+ const DoctreeNode *parent (const DoctreeNode *n) {
+ if (n->depth > 0)
+ return stack->getRef (n->depth - 1);
+ else
+ return NULL;
+ };
void startElement (int tag, const char *id, const char *klass, const char *style);
void endElement (int tag);
- inline dw::core::style::Style *style () { return currentStyle; };
+
+ inline dw::core::style::Style *style () {
+ return stack->getRef (stack->size () - 1)->style;
+ };
};
#endif