aboutsummaryrefslogtreecommitdiff
path: root/src/form.cc
diff options
context:
space:
mode:
authorSebastian Geerken <devnull@localhost>2013-12-09 14:44:42 +0100
committerSebastian Geerken <devnull@localhost>2013-12-09 14:44:42 +0100
commit01f697091153846bdffc73b3150ba37c763301cc (patch)
tree84773dff07a8498e7cc62695d89a6ecb29378a82 /src/form.cc
parentee66f4f97e38d11e68b9515b7043aa8ac6f63c74 (diff)
parent6c7572f8bd23064f96ba716e1ba8ba8a34847001 (diff)
Merge (large!).
Diffstat (limited to 'src/form.cc')
-rw-r--r--src/form.cc32
1 files changed, 18 insertions, 14 deletions
diff --git a/src/form.cc b/src/form.cc
index 8476b73b..c5bb10af 100644
--- a/src/form.cc
+++ b/src/form.cc
@@ -340,7 +340,7 @@ void Html_tag_open_form(DilloHtml *html, const char *tag, int tagsize)
char *charset, *first;
const char *attrbuf;
- HT2TB(html)->addParbreak (9, html->styleEngine->wordStyle ());
+ HT2TB(html)->addParbreak (9, html->wordStyle ());
if (html->InFlags & IN_FORM) {
BUG_MSG("nested forms\n");
@@ -567,7 +567,7 @@ void Html_tag_open_input(DilloHtml *html, const char *tag, int tagsize)
html->styleEngine->setNonCssHint (PROPERTY_X_TOOLTIP, CSS_TYPE_STRING,
attrbuf);
}
- HT2TB(html)->addWidget (embed, html->styleEngine->backgroundStyle());
+ HT2TB(html)->addWidget (embed, html->backgroundStyle());
}
dFree(type);
dFree(name);
@@ -600,17 +600,17 @@ void Html_tag_open_isindex(DilloHtml *html, const char *tag, int tagsize)
html->charset);
html->InFlags |= IN_FORM;
- HT2TB(html)->addParbreak (9, html->styleEngine->wordStyle ());
+ HT2TB(html)->addParbreak (9, html->wordStyle ());
if ((attrbuf = a_Html_get_attr(html, tag, tagsize, "prompt")))
- HT2TB(html)->addText(attrbuf, html->styleEngine->wordStyle ());
+ HT2TB(html)->addText(attrbuf, html->wordStyle ());
ResourceFactory *factory = HT2LT(html)->getResourceFactory();
EntryResource *entryResource = factory->createEntryResource (20,false,NULL);
embed = new Embed (entryResource);
Html_add_input(html, DILLO_HTML_INPUT_INDEX, embed, NULL, NULL, FALSE);
- HT2TB(html)->addWidget (embed, html->styleEngine->backgroundStyle ());
+ HT2TB(html)->addWidget (embed, html->backgroundStyle ());
a_Url_free(action);
html->InFlags &= ~IN_FORM;
@@ -675,7 +675,7 @@ void Html_tag_content_textarea(DilloHtml *html, const char *tag, int tagsize)
textres->setEditable(false);
Html_add_input(html, DILLO_HTML_INPUT_TEXTAREA, embed, name, NULL, false);
- HT2TB(html)->addWidget (embed, html->styleEngine->backgroundStyle ());
+ HT2TB(html)->addWidget (embed, html->backgroundStyle ());
dFree(name);
}
@@ -766,7 +766,7 @@ void Html_tag_open_select(DilloHtml *html, const char *tag, int tagsize)
html->styleEngine->setNonCssHint (PROPERTY_X_TOOLTIP, CSS_TYPE_STRING,
attrbuf);
}
- HT2TB(html)->addWidget (embed, html->styleEngine->backgroundStyle ());
+ HT2TB(html)->addWidget (embed, html->backgroundStyle ());
Html_add_input(html, type, embed, name, NULL, false);
a_Html_stash_init(html);
@@ -938,16 +938,16 @@ void Html_tag_open_button(DilloHtml *html, const char *tag, int tagsize)
* but it caused 100% CPU usage.
*/
page = new Textblock (false);
- page->setStyle (html->styleEngine->backgroundStyle ());
+ page->setStyle (html->backgroundStyle ());
ResourceFactory *factory = HT2LT(html)->getResourceFactory();
Resource *resource = factory->createComplexButtonResource(page, true);
embed = new Embed(resource);
// a_Dw_button_set_sensitive (DW_BUTTON (button), FALSE);
- HT2TB(html)->addParbreak (5, html->styleEngine->wordStyle ());
- HT2TB(html)->addWidget (embed, html->styleEngine->backgroundStyle ());
- HT2TB(html)->addParbreak (5, html->styleEngine->wordStyle ());
+ HT2TB(html)->addParbreak (5, html->wordStyle ());
+ HT2TB(html)->addWidget (embed, html->backgroundStyle ());
+ HT2TB(html)->addParbreak (5, html->wordStyle ());
S_TOP(html)->textblock = html->dw = page;
@@ -2005,12 +2005,16 @@ static Embed *Html_input_image(DilloHtml *html, const char *tag, int tagsize)
/* create new image and add it to the button */
a_Html_image_attrs(html, tag, tagsize);
if ((Image = a_Html_image_new(html, tag, tagsize))) {
- IM2DW(Image)->setStyle (html->styleEngine->backgroundStyle ());
+ // At this point, we know that Image->ir represents an image
+ // widget. Notice that the order of the casts matters, because
+ // of multiple inheritance.
+ dw::Image *dwi = (dw::Image*)(dw::core::ImgRenderer*)Image->img_rndr;
+ dwi->setStyle (html->backgroundStyle ());
ResourceFactory *factory = HT2LT(html)->getResourceFactory();
ComplexButtonResource *complex_b_r =
- factory->createComplexButtonResource(IM2DW(Image), false);
+ factory->createComplexButtonResource(dwi, false);
button = new Embed(complex_b_r);
- HT2TB(html)->addWidget (button, html->styleEngine->style ());
+ HT2TB(html)->addWidget (button, html->style ());
}
if (!button)
MSG("Html_input_image: unable to create image submit.\n");