summaryrefslogtreecommitdiff
path: root/amiga
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2009-12-19 00:39:52 +0000
committerChris Young <chris@unsatisfactorysoftware.co.uk>2009-12-19 00:39:52 +0000
commitb53a3273c1eb192b66764e28b192d023388176ea (patch)
treef4a25a7acec2608ece805e8e08eaf31291574050 /amiga
parentd64f5102eb3bb7cb386698cb61a49d5c739b0d38 (diff)
downloadnetsurf-b53a3273c1eb192b66764e28b192d023388176ea.tar.gz
netsurf-b53a3273c1eb192b66764e28b192d023388176ea.tar.bz2
Preliminary favicon support - doesn't display properly due to endian issue in
libnsbmp svn path=/trunk/netsurf/; revision=9740
Diffstat (limited to 'amiga')
-rwxr-xr-xamiga/gui.c41
-rwxr-xr-xamiga/gui.h1
2 files changed, 42 insertions, 0 deletions
diff --git a/amiga/gui.c b/amiga/gui.c
index 5ced4ba76..0defc3f2c 100755
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -2341,6 +2341,14 @@ struct gui_window *gui_create_browser_window(struct browser_window *bw,
ButtonEnd,
CHILD_WeightedWidth,0,
CHILD_WeightedHeight,0,
+ LAYOUT_AddChild, gwin->shared->gadgets[GID_ICON] = SpaceObject,
+ GA_ID, GID_ICON,
+ SPACE_MinWidth, 16,
+ SPACE_MinHeight, 16,
+ SPACE_Transparent, TRUE,
+ SpaceEnd,
+ CHILD_WeightedWidth,0,
+ CHILD_WeightedHeight,0,
LAYOUT_AddChild, gwin->shared->gadgets[GID_URL] =
NewObject(urlStringClass, NULL,
STRINGA_MaxChars, 2000,
@@ -3429,6 +3437,39 @@ void gui_window_stop_throbber(struct gui_window *g)
*/
void gui_window_set_icon(struct gui_window *g, struct content *icon)
{
+ struct BitMap *bm = NULL;
+ struct IBox *bbox;
+
+ if ((icon != NULL) && (icon->type == CONTENT_ICO))
+ {
+ nsico_set_bitmap_from_size(icon, 16, 16);
+ }
+
+ if ((icon != NULL) && (icon->bitmap != NULL))
+ {
+ bm = ami_getcachenativebm(icon->bitmap, 16, 16, g->shared->win->RPort->BitMap);
+ }
+
+ GetAttr(SPACE_AreaBox, g->shared->gadgets[GID_ICON], (ULONG *)&bbox);
+
+ EraseRect(g->shared->win->RPort, bbox->Left, bbox->Top,
+ bbox->Left+16, bbox->Top+16);
+
+ if(bm)
+ {
+ BltBitMapTags(BLITA_SrcX, 0,
+ BLITA_SrcY, 0,
+ BLITA_DestX, bbox->Left,
+ BLITA_DestY, bbox->Top,
+ BLITA_Width, 16,
+ BLITA_Height, 16,
+ BLITA_Source, bm,
+ BLITA_Dest, g->shared->win->RPort,
+ BLITA_SrcType, BLITT_BITMAP,
+ BLITA_DestType, BLITT_RASTPORT,
+ BLITA_UseSrcAlpha, TRUE,
+ TAG_DONE);
+ }
}
/**
diff --git a/amiga/gui.h b/amiga/gui.h
index 47aace0db..b606c7f99 100755
--- a/amiga/gui.h
+++ b/amiga/gui.h
@@ -33,6 +33,7 @@ enum
GID_BROWSER,
GID_STATUS,
GID_URL,
+ GID_ICON,
GID_STOP,
GID_RELOAD,
GID_HOME,