annotate src/styleengine.hh @ 506:03de2284bfa6

switch to original enum names from dillo-0.8.0-css-3
author Johannes Hofmann <Johannes.Hofmann@gmx.de>
date Wed, 29 Oct 2008 18:19:19 +0100
parents 00b31843839b
children fd2454cd0120
rev   line source
497
96713a0f5d8b css.[ch][ch] -> styleengine.[ch][ch]
Johannes Hofmann <Johannes.Hofmann@gmx.de>
parents: 495
diff changeset
1 #ifndef __STYLEENGINE_HH__
96713a0f5d8b css.[ch][ch] -> styleengine.[ch][ch]
Johannes Hofmann <Johannes.Hofmann@gmx.de>
parents: 495
diff changeset
2 #define __STYLEENGINE_HH__
493
03e0cacbb994 add css.hh css.cc
Johannes Hofmann <Johannes.Hofmann@gmx.de>
parents:
diff changeset
3
03e0cacbb994 add css.hh css.cc
Johannes Hofmann <Johannes.Hofmann@gmx.de>
parents:
diff changeset
4 #include "dw/core.hh"
501
424e4f409636 add doctree.hh
Johannes Hofmann <Johannes.Hofmann@gmx.de>
parents: 499
diff changeset
5 #include "doctree.hh"
506
03de2284bfa6 switch to original enum names from dillo-0.8.0-css-3
Johannes Hofmann <Johannes.Hofmann@gmx.de>
parents: 503
diff changeset
6 #include "css.hh"
493
03e0cacbb994 add css.hh css.cc
Johannes Hofmann <Johannes.Hofmann@gmx.de>
parents:
diff changeset
7
503
00b31843839b implement various apply() methods
Johannes Hofmann <Johannes.Hofmann@gmx.de>
parents: 501
diff changeset
8 class StyleEngine : public Doctree {
493
03e0cacbb994 add css.hh css.cc
Johannes Hofmann <Johannes.Hofmann@gmx.de>
parents:
diff changeset
9 private:
503
00b31843839b implement various apply() methods
Johannes Hofmann <Johannes.Hofmann@gmx.de>
parents: 501
diff changeset
10 class Node : public DoctreeNode {
00b31843839b implement various apply() methods
Johannes Hofmann <Johannes.Hofmann@gmx.de>
parents: 501
diff changeset
11 public:
00b31843839b implement various apply() methods
Johannes Hofmann <Johannes.Hofmann@gmx.de>
parents: 501
diff changeset
12 dw::core::style::Style *style;
00b31843839b implement various apply() methods
Johannes Hofmann <Johannes.Hofmann@gmx.de>
parents: 501
diff changeset
13 };
00b31843839b implement various apply() methods
Johannes Hofmann <Johannes.Hofmann@gmx.de>
parents: 501
diff changeset
14
00b31843839b implement various apply() methods
Johannes Hofmann <Johannes.Hofmann@gmx.de>
parents: 501
diff changeset
15 lout::misc::SimpleVector <Node> *stack;
493
03e0cacbb994 add css.hh css.cc
Johannes Hofmann <Johannes.Hofmann@gmx.de>
parents:
diff changeset
16
506
03de2284bfa6 switch to original enum names from dillo-0.8.0-css-3
Johannes Hofmann <Johannes.Hofmann@gmx.de>
parents: 503
diff changeset
17 dw::core::style::Style *style0 ();
03de2284bfa6 switch to original enum names from dillo-0.8.0-css-3
Johannes Hofmann <Johannes.Hofmann@gmx.de>
parents: 503
diff changeset
18
493
03e0cacbb994 add css.hh css.cc
Johannes Hofmann <Johannes.Hofmann@gmx.de>
parents:
diff changeset
19 public:
495
7224de9c34b7 add StyleEngine
Johannes Hofmann <Johannes.Hofmann@gmx.de>
parents: 493
diff changeset
20 StyleEngine ();
493
03e0cacbb994 add css.hh css.cc
Johannes Hofmann <Johannes.Hofmann@gmx.de>
parents:
diff changeset
21 ~StyleEngine ();
503
00b31843839b implement various apply() methods
Johannes Hofmann <Johannes.Hofmann@gmx.de>
parents: 501
diff changeset
22
00b31843839b implement various apply() methods
Johannes Hofmann <Johannes.Hofmann@gmx.de>
parents: 501
diff changeset
23 /* Doctree interface */
506
03de2284bfa6 switch to original enum names from dillo-0.8.0-css-3
Johannes Hofmann <Johannes.Hofmann@gmx.de>
parents: 503
diff changeset
24 inline const DoctreeNode *top () {
503
00b31843839b implement various apply() methods
Johannes Hofmann <Johannes.Hofmann@gmx.de>
parents: 501
diff changeset
25 return stack->getRef (stack->size () - 1);
00b31843839b implement various apply() methods
Johannes Hofmann <Johannes.Hofmann@gmx.de>
parents: 501
diff changeset
26 };
506
03de2284bfa6 switch to original enum names from dillo-0.8.0-css-3
Johannes Hofmann <Johannes.Hofmann@gmx.de>
parents: 503
diff changeset
27
03de2284bfa6 switch to original enum names from dillo-0.8.0-css-3
Johannes Hofmann <Johannes.Hofmann@gmx.de>
parents: 503
diff changeset
28 inline const DoctreeNode *parent (const DoctreeNode *n) {
503
00b31843839b implement various apply() methods
Johannes Hofmann <Johannes.Hofmann@gmx.de>
parents: 501
diff changeset
29 if (n->depth > 0)
00b31843839b implement various apply() methods
Johannes Hofmann <Johannes.Hofmann@gmx.de>
parents: 501
diff changeset
30 return stack->getRef (n->depth - 1);
00b31843839b implement various apply() methods
Johannes Hofmann <Johannes.Hofmann@gmx.de>
parents: 501
diff changeset
31 else
00b31843839b implement various apply() methods
Johannes Hofmann <Johannes.Hofmann@gmx.de>
parents: 501
diff changeset
32 return NULL;
00b31843839b implement various apply() methods
Johannes Hofmann <Johannes.Hofmann@gmx.de>
parents: 501
diff changeset
33 };
493
03e0cacbb994 add css.hh css.cc
Johannes Hofmann <Johannes.Hofmann@gmx.de>
parents:
diff changeset
34
506
03de2284bfa6 switch to original enum names from dillo-0.8.0-css-3
Johannes Hofmann <Johannes.Hofmann@gmx.de>
parents: 503
diff changeset
35 void startElement (int tag, const char *id, const char *klass,
03de2284bfa6 switch to original enum names from dillo-0.8.0-css-3
Johannes Hofmann <Johannes.Hofmann@gmx.de>
parents: 503
diff changeset
36 const char *style);
495
7224de9c34b7 add StyleEngine
Johannes Hofmann <Johannes.Hofmann@gmx.de>
parents: 493
diff changeset
37 void endElement (int tag);
506
03de2284bfa6 switch to original enum names from dillo-0.8.0-css-3
Johannes Hofmann <Johannes.Hofmann@gmx.de>
parents: 503
diff changeset
38 void setNonCssProperties (CssPropertyList *props);
503
00b31843839b implement various apply() methods
Johannes Hofmann <Johannes.Hofmann@gmx.de>
parents: 501
diff changeset
39
00b31843839b implement various apply() methods
Johannes Hofmann <Johannes.Hofmann@gmx.de>
parents: 501
diff changeset
40 inline dw::core::style::Style *style () {
506
03de2284bfa6 switch to original enum names from dillo-0.8.0-css-3
Johannes Hofmann <Johannes.Hofmann@gmx.de>
parents: 503
diff changeset
41 dw::core::style::Style *s = stack->getRef (stack->size () - 1)->style;
03de2284bfa6 switch to original enum names from dillo-0.8.0-css-3
Johannes Hofmann <Johannes.Hofmann@gmx.de>
parents: 503
diff changeset
42 if (s)
03de2284bfa6 switch to original enum names from dillo-0.8.0-css-3
Johannes Hofmann <Johannes.Hofmann@gmx.de>
parents: 503
diff changeset
43 return s;
03de2284bfa6 switch to original enum names from dillo-0.8.0-css-3
Johannes Hofmann <Johannes.Hofmann@gmx.de>
parents: 503
diff changeset
44 else
03de2284bfa6 switch to original enum names from dillo-0.8.0-css-3
Johannes Hofmann <Johannes.Hofmann@gmx.de>
parents: 503
diff changeset
45 return style0 ();
503
00b31843839b implement various apply() methods
Johannes Hofmann <Johannes.Hofmann@gmx.de>
parents: 501
diff changeset
46 };
493
03e0cacbb994 add css.hh css.cc
Johannes Hofmann <Johannes.Hofmann@gmx.de>
parents:
diff changeset
47 };
03e0cacbb994 add css.hh css.cc
Johannes Hofmann <Johannes.Hofmann@gmx.de>
parents:
diff changeset
48
03e0cacbb994 add css.hh css.cc
Johannes Hofmann <Johannes.Hofmann@gmx.de>
parents:
diff changeset
49 #endif