From 27c5e68d73ba6ad4c65b21865fb1a5f6734a1a6c Mon Sep 17 00:00:00 2001 From: corvid Date: Mon, 16 Nov 2009 04:08:27 +0000 Subject: DilloLinkImage -> DilloHtmlImage --- src/html.cc | 32 +++++++++++++++----------------- src/html_common.hh | 6 +++--- 2 files changed, 18 insertions(+), 20 deletions(-) (limited to 'src') diff --git a/src/html.cc b/src/html.cc index 3f5a10ba..447a4a3c 100644 --- a/src/html.cc +++ b/src/html.cc @@ -285,19 +285,20 @@ static int Html_set_new_link(DilloHtml *html, DilloUrl **url) } /* - * Add a new image. + * Add a new image to our list. + * image is NULL if dillo will try to load the image immediately. */ -static void Html_add_new_linkimage(DilloHtml *html, +static void Html_add_new_htmlimage(DilloHtml *html, DilloUrl **url, DilloImage *image) { - DilloLinkImage *li = dNew(DilloLinkImage, 1); - li->url = *url; - li->image = image; + DilloHtmlImage *hi = dNew(DilloHtmlImage, 1); + hi->url = *url; + hi->image = image; a_Image_ref(image); - int ni = html->images->size(); + int n = html->images->size(); html->images->increase(); - html->images->set(ni, li); + html->images->set(n, hi); } /* @@ -464,8 +465,7 @@ DilloHtml::DilloHtml(BrowserWindow *p_bw, const DilloUrl *url, forms = new misc::SimpleVector (1); inputs_outside_form = new misc::SimpleVector (1); links = new misc::SimpleVector (64); - images = new misc::SimpleVector (16); - //a_Dw_image_map_list_init(&maps); + images = new misc::SimpleVector (16); /* Initialize the main widget */ initDw(); @@ -518,16 +518,14 @@ DilloHtml::~DilloHtml() delete (links); for (int i = 0; i < images->size(); i++) { - DilloLinkImage *li = images->get(i); - a_Url_free(li->url); - a_Image_unref(li->image); - dFree(li); + DilloHtmlImage *img = images->get(i); + a_Url_free(img->url); + a_Image_unref(img->image); + dFree(img); } delete (images); delete styleEngine; - - //a_Dw_image_map_list_free(&maps); } /* @@ -2074,7 +2072,7 @@ DilloImage *a_Html_image_new(DilloHtml *html, const char *tag, } /* x_img is an index to a list of {url,image} pairs. - * We know Html_add_new_linkimage() will use size() as its next index */ + * We know Html_add_new_htmlimage() will use size() as its next index */ props.set (PROPERTY_X_IMG, CSS_TYPE_INTEGER, html->images->size()); html->styleEngine->setNonCssHints(&props); @@ -2086,7 +2084,7 @@ DilloImage *a_Html_image_new(DilloHtml *html, const char *tag, load_now = prefs.load_images || (a_Capi_get_flags_with_redirection(url) & CAPI_IsCached); - Html_add_new_linkimage(html, &url, load_now ? NULL : Image); + Html_add_new_htmlimage(html, &url, load_now ? NULL : Image); if (load_now) Html_load_image(html->bw, url, Image); diff --git a/src/html_common.hh b/src/html_common.hh index 933274fe..3cca82de 100644 --- a/src/html_common.hh +++ b/src/html_common.hh @@ -38,7 +38,7 @@ * Typedefs */ -typedef struct _DilloLinkImage DilloLinkImage; +typedef struct _DilloHtmlImage DilloHtmlImage; typedef struct _DilloHtmlState DilloHtmlState; typedef enum { @@ -88,7 +88,7 @@ typedef enum { * Data Structures */ -struct _DilloLinkImage { +struct _DilloHtmlImage { DilloUrl *url; DilloImage *image; }; @@ -188,7 +188,7 @@ public: //BUG: for now everything is public lout::misc::SimpleVector *forms; lout::misc::SimpleVector *inputs_outside_form; lout::misc::SimpleVector *links; - lout::misc::SimpleVector *images; + lout::misc::SimpleVector *images; dw::ImageMapsList maps; private: -- cgit v1.2.3