From 21f85b39f22ff0f5cd373a4cfedba115ee533e98 Mon Sep 17 00:00:00 2001 From: corvid Date: Thu, 29 Oct 2009 02:21:08 +0000 Subject: move link signal emitter/receiver from Widget to Layout http://lists.auriga.wearlab.de/pipermail/dillo-dev/2009-October/006936.html --- src/html.cc | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) (limited to 'src/html.cc') diff --git a/src/html.cc b/src/html.cc index 2b318123..dcc2363e 100644 --- a/src/html.cc +++ b/src/html.cc @@ -382,9 +382,6 @@ static void Html_add_textblock(DilloHtml *html, int space) HT2TB(html)->addParbreak (space, html->styleEngine->wordStyle ()); S_TOP(html)->textblock = html->dw = textblock; S_TOP(html)->hand_over_break = true; - - /* Handle it when the user clicks on a link */ - html->connectSignals(textblock); } /* @@ -393,15 +390,16 @@ static void Html_add_textblock(DilloHtml *html, int space) DilloHtml::DilloHtml(BrowserWindow *p_bw, const DilloUrl *url, const char *content_type) { - /* Init event receiver */ - linkReceiver.html = this; - /* Init main variables */ bw = p_bw; page_url = a_Url_dup(url); base_url = a_Url_dup(url); dw = NULL; + /* Init event receiver */ + linkReceiver.html = this; + HT2LT(this)->connectLink (&linkReceiver); + a_Bw_add_doc(p_bw, this); /* Init for-parsing variables */ @@ -485,9 +483,6 @@ void DilloHtml::initDw() /* Create the main widget */ dw = stack->getRef(0)->textblock = new Textblock (prefs.limit_text_width); - /* Handle it when the user clicks on a link */ - connectSignals(dw); - bw->num_page_bugs = 0; dStr_truncate(bw->page_bugs, 0); } @@ -535,14 +530,6 @@ DilloHtml::~DilloHtml() //a_Dw_image_map_list_free(&maps); } -/* - * Connect all signals of a textblock or an image. - */ -void DilloHtml::connectSignals(Widget *dw) -{ - dw->connectLink (&linkReceiver); -} - /* * Process the newly arrived html and put it into the page structure. * (This function is called by Html_callback whenever there's new data) @@ -2171,7 +2158,6 @@ static void Html_tag_open_img(DilloHtml *html, const char *tag, int tagsize) new ::object::String(URL_STR(usemap_url))); a_Url_free (usemap_url); } - html->connectSignals((Widget*)Image->dw); } /* @@ -2635,8 +2621,6 @@ static void Html_tag_open_li(DilloHtml *html, const char *tag, int tagsize) HT2TB(html)->addParbreak (0, wordStyle); *ref_list_item = list_item; S_TOP(html)->textblock = html->dw = list_item; - /* Handle it when the user clicks on a link */ - html->connectSignals(list_item); if (style->listStyleType == LIST_STYLE_TYPE_NONE) { // none -- cgit v1.2.3