summaryrefslogtreecommitdiff
path: root/image
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2009-12-17 23:55:02 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2009-12-17 23:55:02 +0000
commit355799ce0bbb078237dfc1ae9874bbc5342acbc4 (patch)
tree7ca980c01c0d4d1d55a3b7b15418c95c5618afae /image
parent4346b2b62b940182575e6612e46234355afa083c (diff)
downloadnetsurf-355799ce0bbb078237dfc1ae9874bbc5342acbc4.tar.gz
netsurf-355799ce0bbb078237dfc1ae9874bbc5342acbc4.tar.bz2
Merge branches/MarkieB/gtkmain to trunk.
svn path=/trunk/netsurf/; revision=9729
Diffstat (limited to 'image')
-rw-r--r--image/ico.c12
-rw-r--r--image/ico.h1
2 files changed, 13 insertions, 0 deletions
diff --git a/image/ico.c b/image/ico.c
index 5416e612a..e2fce245a 100644
--- a/image/ico.c
+++ b/image/ico.c
@@ -115,6 +115,18 @@ bool nsico_redraw(struct content *c, int x, int y,
background_colour, BITMAPF_NONE);
}
+/** sets the bitmap for an ico according to the dimensions */
+
+bool nsico_set_bitmap_from_size(struct content *c, int width, int height)
+{
+ struct bmp_image *bmp = ico_find(c->data.ico.ico, width, height);
+ if (bmp == NULL)
+ return false;
+ if ((bmp->decoded == false) && (bmp_decode(bmp) != BMP_OK))
+ return false;
+ c->bitmap = bmp->bitmap;
+ return true;
+}
bool nsico_redraw_tiled(struct content *c, int x, int y,
int width, int height,
diff --git a/image/ico.h b/image/ico.h
index cd7b0b432..f3686c0c5 100644
--- a/image/ico.h
+++ b/image/ico.h
@@ -48,6 +48,7 @@ bool nsico_redraw_tiled(struct content *c, int x, int y,
int clip_x0, int clip_y0, int clip_x1, int clip_y1,
float scale, colour background_colour,
bool repeat_x, bool repeat_y);
+bool nsico_set_bitmap_from_size(struct content *c, int width, int height);
#endif /* WITH_BMP */