aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/form.cc18
-rw-r--r--src/html.cc15
-rw-r--r--src/html_common.hh3
-rw-r--r--src/table.cc20
4 files changed, 21 insertions, 35 deletions
diff --git a/src/form.cc b/src/form.cc
index 6f7979be..bf706ebf 100644
--- a/src/form.cc
+++ b/src/form.cc
@@ -277,7 +277,7 @@ void Html_tag_open_form(DilloHtml *html, const char *tag, int tagsize)
char *charset, *first;
const char *attrbuf;
- DW2TB(html->dw)->addParbreak (9, S_TOP(html)->style);
+ DW2TB(html->dw)->addParbreak (9, html->styleEngine->style ());
if (html->InFlags & IN_FORM) {
BUG_MSG("nested forms\n");
@@ -540,7 +540,7 @@ void Html_tag_open_input(DilloHtml *html, const char *tag, int tagsize)
bg = Color::createShaded(HT2LT(html), S_TOP(html)->current_bg_color);
HTML_SET_TOP_ATTR(html, backgroundColor, bg);
- DW2TB(html->dw)->addWidget (embed, S_TOP(html)->style);
+ DW2TB(html->dw)->addWidget (embed, html->styleEngine->style ());
}
dFree(type);
dFree(name);
@@ -573,10 +573,10 @@ void Html_tag_open_isindex(DilloHtml *html, const char *tag, int tagsize)
html->charset);
html->InFlags |= IN_FORM;
- DW2TB(html->dw)->addParbreak (9, S_TOP(html)->style);
+ DW2TB(html->dw)->addParbreak (9, html->styleEngine->style ());
if ((attrbuf = a_Html_get_attr(html, tag, tagsize, "prompt")))
- DW2TB(html->dw)->addText(attrbuf, S_TOP(html)->style);
+ DW2TB(html->dw)->addText(attrbuf, html->styleEngine->style ());
ResourceFactory *factory = HT2LT(html)->getResourceFactory();
EntryResource *entryResource = factory->createEntryResource (20, false);
@@ -589,7 +589,7 @@ void Html_tag_open_isindex(DilloHtml *html, const char *tag, int tagsize)
else
bg = Color::createShaded(HT2LT(html), S_TOP(html)->current_bg_color);
HTML_SET_TOP_ATTR(html, backgroundColor, bg);
- DW2TB(html->dw)->addWidget (embed, S_TOP(html)->style);
+ DW2TB(html->dw)->addWidget (embed, html->styleEngine->style ());
a_Url_free(action);
html->InFlags &= ~IN_FORM;
@@ -658,7 +658,7 @@ void Html_tag_open_textarea(DilloHtml *html, const char *tag, int tagsize)
bg = Color::createShaded(HT2LT(html), S_TOP(html)->current_bg_color);
HTML_SET_TOP_ATTR(html, backgroundColor, bg);
- DW2TB(html->dw)->addWidget (embed, S_TOP(html)->style);
+ DW2TB(html->dw)->addWidget (embed, html->styleEngine->style ());
dFree(name);
}
@@ -740,7 +740,7 @@ void Html_tag_open_select(DilloHtml *html, const char *tag, int tagsize)
}
HTML_SET_TOP_ATTR(html, backgroundColor,
Color::createShaded (HT2LT(html), bg));
- DW2TB(html->dw)->addWidget (embed, S_TOP(html)->style);
+ DW2TB(html->dw)->addWidget (embed, html->styleEngine->style ());
// size = 0;
// if ((attrbuf = a_Html_get_attr(html, tag, tagsize, "size")))
@@ -861,7 +861,7 @@ void Html_tag_open_button(DilloHtml *html, const char *tag, int tagsize)
Embed *embed;
char *name, *value;
- style_attrs = *S_TOP(html)->style;
+ style_attrs = *html->styleEngine->style ();
style_attrs.margin.setVal(0);
style_attrs.borderWidth.setVal(0);
style_attrs.padding.setVal(0);
@@ -1904,7 +1904,7 @@ static Embed *Html_input_image(DilloHtml *html, const char *tag, int tagsize)
if ((attrbuf = a_Html_get_attr(html, tag, tagsize, "src")) &&
(url = a_Html_url_new(html, attrbuf, NULL, 0))) {
- style_attrs = *S_TOP(html)->style;
+ style_attrs = *html->styleEngine->style ();
style_attrs.cursor = CURSOR_POINTER;
style_attrs.backgroundColor =
style::Color::createShaded(HT2LT(html), S_TOP(html)->current_bg_color);
diff --git a/src/html.cc b/src/html.cc
index 4b7ea9b2..257be896 100644
--- a/src/html.cc
+++ b/src/html.cc
@@ -469,7 +469,6 @@ DilloHtml::DilloHtml(BrowserWindow *p_bw, const DilloUrl *url,
stack = new misc::SimpleVector <DilloHtmlState> (16);
stack->increase();
- stack->getRef(0)->style = NULL;
stack->getRef(0)->table_cell_style = NULL;
stack->getRef(0)->parse_mode = DILLO_HTML_PARSE_MODE_INIT;
stack->getRef(0)->table_mode = DILLO_HTML_TABLE_MODE_NONE;
@@ -528,25 +527,11 @@ DilloHtml::DilloHtml(BrowserWindow *p_bw, const DilloUrl *url,
*/
void DilloHtml::initDw()
{
- StyleAttrs style_attrs;
- FontAttrs font_attrs;
-
dReturn_if_fail (dw == NULL);
/* Create the main widget */
dw = stack->getRef(0)->textblock = new Textblock (prefs.limit_text_width);
- /* Create a dummy font, attribute, and tag for the bottom of the stack. */
- font_attrs.name = prefs.vw_fontname;
- font_attrs.size = Html_level_to_fontsize(FontSizesBase);
- font_attrs.weight = 400;
- font_attrs.style = FONT_STYLE_NORMAL;
-
- style_attrs.initValues ();
- style_attrs.font = Font::create (HT2LT(this), &font_attrs);
- style_attrs.color = Color::createSimple (HT2LT(this), prefs.text_color);
- stack->getRef(0)->style = Style::create (HT2LT(this), &style_attrs);
-
stack->getRef(0)->table_cell_style = NULL;
/* Handle it when the user clicks on a link */
diff --git a/src/html_common.hh b/src/html_common.hh
index 28ce5231..a35411ee 100644
--- a/src/html_common.hh
+++ b/src/html_common.hh
@@ -114,7 +114,8 @@ struct _DilloLinkImage {
};
struct _DilloHtmlState {
- dw::core::style::Style *style, *table_cell_style;
+// dw::core::style::Style *style, *table_cell_style;
+ dw::core::style::Style *table_cell_style;
DilloHtmlParseMode parse_mode;
DilloHtmlTableMode table_mode;
bool cell_text_align_set;
diff --git a/src/table.cc b/src/table.cc
index 589f7e1e..e0a0a624 100644
--- a/src/table.cc
+++ b/src/table.cc
@@ -49,7 +49,7 @@ void Html_tag_open_table(DilloHtml *html, const char *tag, int tagsize)
int32_t border = 0, cellspacing = 1, cellpadding = 2, bgcolor;
#endif
- DW2TB(html->dw)->addParbreak (0, S_TOP(html)->style);
+ DW2TB(html->dw)->addParbreak (0, html->styleEngine->style ());
#ifdef USE_TABLES
if ((attrbuf = a_Html_get_attr(html, tag, tagsize, "border")))
@@ -60,7 +60,7 @@ void Html_tag_open_table(DilloHtml *html, const char *tag, int tagsize)
cellpadding = strtol (attrbuf, NULL, 10);
/* The style for the table */
- style_attrs = *S_TOP(html)->style;
+ style_attrs = *html->styleEngine->style ();
/* When dillo was started with the --debug-rendering option, there
* is always a border around the table. */
@@ -101,7 +101,7 @@ void Html_tag_open_table(DilloHtml *html, const char *tag, int tagsize)
/* The style for the cells */
cell_style = Style::create (HT2LT(html), &style_attrs);
- style_attrs = *S_TOP(html)->style;
+ style_attrs = *html->styleEngine->style ();
/* When dillo was started with the --debug-rendering option, there
* is always a border around the cells. */
if (dillo_dbg_rendering)
@@ -157,7 +157,7 @@ void Html_tag_open_tr(DilloHtml *html, const char *tag, int tagsize)
if (bgcolor == 0xffffff && !prefs.allow_white_bg)
bgcolor = prefs.bg_color;
- style_attrs = *S_TOP(html)->style;
+ style_attrs = *html->styleEngine->style ();
style_attrs.backgroundColor =
Color::createShaded (HT2LT(html), bgcolor);
style = Style::create (HT2LT(html), &style_attrs);
@@ -194,7 +194,7 @@ void Html_tag_open_tr(DilloHtml *html, const char *tag, int tagsize)
S_TOP(html)->table_mode = DILLO_HTML_TABLE_MODE_TR;
#else
- DW2TB(html->dw)->addParbreak (0, S_TOP(html)->style);
+ DW2TB(html->dw)->addParbreak (0, html->styleEngine->style ());
#endif
}
@@ -259,7 +259,7 @@ static void Html_tag_open_table_cell(DilloHtml *html,
rowspan = MAX(1, strtol (attrbuf, NULL, 10));
/* text style */
- old_style = S_TOP(html)->style;
+ old_style = html->styleEngine->style ();
style_attrs = *old_style;
if (!S_TOP(html)->cell_text_align_set)
style_attrs.textAlign = text_align;
@@ -268,9 +268,9 @@ static void Html_tag_open_table_cell(DilloHtml *html,
else
style_attrs.whiteSpace = WHITE_SPACE_NORMAL;
- S_TOP(html)->style =
- Style::create (HT2LT(html), &style_attrs);
- old_style->unref ();
+// html->styleEngine->style () =
+// Style::create (HT2LT(html), &style_attrs);
+// old_style->unref ();
a_Html_tag_set_align_attr (html, tag, tagsize);
/* cell style */
@@ -299,7 +299,7 @@ static void Html_tag_open_table_cell(DilloHtml *html,
}
}
- if (S_TOP(html)->style->textAlign
+ if (html->styleEngine->style ()->textAlign
== TEXT_ALIGN_STRING)
col_tb = new dw::TableCell (((dw::Table*)S_TOP(html)->table)->getCellRef (),
prefs.limit_text_width);