summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcorvid <corvid@lavabit.com>2009-11-16 04:08:27 +0000
committercorvid <corvid@lavabit.com>2009-11-16 04:08:27 +0000
commit27c5e68d73ba6ad4c65b21865fb1a5f6734a1a6c (patch)
tree403e7e197f4e8b30bcc34c13e39928ffc92fe3ba
parent016e87f8eae5b1358153504d09b99e38e5a8ef99 (diff)
DilloLinkImage -> DilloHtmlImage
-rw-r--r--src/html.cc32
-rw-r--r--src/html_common.hh6
2 files changed, 18 insertions, 20 deletions
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 <DilloHtmlForm*> (1);
inputs_outside_form = new misc::SimpleVector <DilloHtmlInput*> (1);
links = new misc::SimpleVector <DilloUrl*> (64);
- images = new misc::SimpleVector <DilloLinkImage*> (16);
- //a_Dw_image_map_list_init(&maps);
+ images = new misc::SimpleVector <DilloHtmlImage*> (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<DilloHtmlForm*> *forms;
lout::misc::SimpleVector<DilloHtmlInput*> *inputs_outside_form;
lout::misc::SimpleVector<DilloUrl*> *links;
- lout::misc::SimpleVector<DilloLinkImage*> *images;
+ lout::misc::SimpleVector<DilloHtmlImage*> *images;
dw::ImageMapsList maps;
private: