From 5bb5cedec5170ac2aa06a340159256b55505c427 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sun, 28 Mar 2010 15:51:05 +0000 Subject: [PATCH] Changes required for new-cache svn path=/trunk/netsurf/; revision=10186 --- amiga/arexx.c | 11 +++--- amiga/clipboard.c | 10 ++++-- amiga/clipboard.h | 2 +- amiga/context_menu.c | 66 +++++++++++++++++++++--------------- amiga/download.c | 46 ++++++++++++++----------- amiga/download.h | 2 +- amiga/fetch_file.c | 13 +------ amiga/gui.c | 79 +++++++++++++++++++++++-------------------- amiga/gui.h | 2 +- amiga/gui_options.c | 4 +-- amiga/hotlist.c | 24 ++++++------- amiga/hotlist.h | 2 +- amiga/iff_dr2d.c | 7 ++-- amiga/iff_dr2d.h | 4 +-- amiga/login.c | 6 ++-- amiga/menu.c | 50 ++++++++++++++------------- amiga/print.c | 10 +++--- amiga/print.h | 6 ++-- amiga/save_complete.h | 2 +- amiga/save_pdf.c | 2 +- amiga/save_pdf.h | 6 ++-- amiga/search.c | 6 ++-- amiga/sslcert.c | 4 +-- amiga/thumbnail.c | 19 ++++++----- 24 files changed, 205 insertions(+), 178 deletions(-) diff --git a/amiga/arexx.c b/amiga/arexx.c index 308d1190c..a85b8cc0d 100755 --- a/amiga/arexx.c +++ b/amiga/arexx.c @@ -148,15 +148,18 @@ STATIC VOID rx_open(struct ARexxCmd *cmd, struct RexxMsg *rxm __attribute__((unu STATIC VOID rx_save(struct ARexxCmd *cmd, struct RexxMsg *rxm __attribute__((unused))) { BPTR fh = 0; - + ULONG source_size; + char *source_data; if(!curbw) return; ami_update_pointer(curbw->window->shared->win,GUI_POINTER_WAIT); if(fh = FOpen(cmd->ac_ArgList[0],MODE_NEWFILE,0)) { - FWrite(fh,curbw->current_content->source_data,1,curbw->current_content->source_size); + if(source_data = content_get_source_data(curbw->current_content, &source_size)) + FWrite(fh, source_data, 1, source_size); + FClose(fh); - SetComment(cmd->ac_ArgList[0],curbw->current_content->url); + SetComment(cmd->ac_ArgList[0], content_get_url(curbw->current_content)); } ami_update_pointer(curbw->window->shared->win,GUI_POINTER_DEFAULT); @@ -176,7 +179,7 @@ STATIC VOID rx_geturl(struct ARexxCmd *cmd, struct RexxMsg *rxm __attribute__((u { if(curbw && curbw->current_content) { - strcpy(result,curbw->current_content->url); + strcpy(result, content_get_url(curbw->current_content)); } else { diff --git a/amiga/clipboard.c b/amiga/clipboard.c index 3dba6b325..a2dc926d0 100755 --- a/amiga/clipboard.c +++ b/amiga/clipboard.c @@ -248,13 +248,17 @@ bool ami_easy_clipboard_bitmap(struct bitmap *bitmap) } #ifdef WITH_NS_SVG -bool ami_easy_clipboard_svg(struct content *c) +bool ami_easy_clipboard_svg(struct hlcache_handle *c) { - if(c->type != CONTENT_SVG) return false; + char *source_data; + ULONG source_size; + + if(content_get_type(c) != CONTENT_SVG) return false; + if((source_data = content_get_source_data(c, &source_size)) == NULL) return false; if(!(OpenIFF(iffh,IFFF_WRITE))) { - ami_svg_to_dr2d(iffh,c->source_data,c->source_size,c->url); + ami_svg_to_dr2d(iffh, source_data, source_size, content_get_url(c)); CloseIFF(iffh); } diff --git a/amiga/clipboard.h b/amiga/clipboard.h index 6a4f4c3aa..887015d21 100755 --- a/amiga/clipboard.h +++ b/amiga/clipboard.h @@ -24,6 +24,6 @@ void ami_clipboard_free(void); bool ami_easy_clipboard(char *text); bool ami_easy_clipboard_bitmap(struct bitmap *bitmap); #ifdef WITH_NS_SVG -bool ami_easy_clipboard_svg(struct content *c); +bool ami_easy_clipboard_svg(struct hlcache_handle *c); #endif #endif diff --git a/amiga/context_menu.c b/amiga/context_menu.c index ab0d9a446..704bd8c0c 100755 --- a/amiga/context_menu.c +++ b/amiga/context_menu.c @@ -73,14 +73,14 @@ void ami_context_menu_free(void) void ami_context_menu_show(struct gui_window_2 *gwin,int x,int y) { - struct content *cc = gwin->bw->current_content; + struct hlcache_handle *cc = gwin->bw->current_content; struct box *curbox; int box_x=0; int box_y=0; bool menuhascontent = false; if(!cc) return; - if(cc->type != CONTENT_HTML) return; + if(content_get_type(cc) != CONTENT_HTML) return; if(gwin->objects[OID_MENU]) DisposeObject(gwin->objects[OID_MENU]); @@ -91,7 +91,7 @@ void ami_context_menu_show(struct gui_window_2 *gwin,int x,int y) PMA_MenuHandler, &gwin->popuphook, TAG_DONE); - curbox = gwin->bw->current_content->data.html.layout; + curbox = html_get_box_tree(gwin->bw->current_content); while(curbox = box_at_point(curbox,x,y,&box_x,&box_y,&cc)) { @@ -139,12 +139,12 @@ void ami_context_menu_show(struct gui_window_2 *gwin,int x,int y) PMA_AddItem,NewObject(POPUPMENU_GetItemClass(), NULL, PMIA_Title, (ULONG)ctxmenulab[CMID_SHOWOBJ], PMIA_ID,CMID_SHOWOBJ, - PMIA_UserData,curbox->object->url, + PMIA_UserData, content_get_url(curbox->object), TAG_DONE), PMA_AddItem,NewObject(POPUPMENU_GetItemClass(), NULL, PMIA_Title, (ULONG)ctxmenulab[CMID_COPYOBJ], PMIA_ID,CMID_COPYOBJ, - PMIA_UserData,curbox->object->url, + PMIA_UserData, content_get_url(curbox->object), TAG_DONE), PMA_AddItem,NewObject(POPUPMENU_GetItemClass(), NULL, PMIA_Title, (ULONG)ctxmenulab[CMID_CLIPOBJ], @@ -222,7 +222,10 @@ uint32 ami_context_menu_hook(struct Hook *hook,Object *item,APTR reserved) struct gui_window_2 *gwin = hook->h_Data; APTR userdata = NULL; struct browser_window *bw; - struct content *object; + struct hlcache_handle *object; + char *source_data; + ULONG source_size; + struct bitmap *bm; if(GetAttrs(item,PMIA_ID,&itemid, PMIA_UserData,&userdata, @@ -267,31 +270,35 @@ uint32 ami_context_menu_hook(struct Hook *hook,Object *item,APTR reserved) break; case CMID_URLOPENWIN: - bw = browser_window_create(userdata,gwin->bw, gwin->bw->current_content->url, true, false); + bw = browser_window_create(userdata, gwin->bw, + content_get_url(gwin->bw->current_content), true, false); break; case CMID_URLOPENTAB: - bw = browser_window_create(userdata,gwin->bw, gwin->bw->current_content->url, true, true); + bw = browser_window_create(userdata, gwin->bw, + content_get_url(gwin->bw->current_content), true, true); break; case CMID_SAVEURL: - browser_window_download(gwin->bw,userdata,gwin->bw->current_content->url); + browser_window_download(gwin->bw, userdata, + content_get_url(gwin->bw->current_content)); break; case CMID_SHOWOBJ: - browser_window_go(gwin->bw,userdata,gwin->bw->current_content->url,true); + browser_window_go(gwin->bw, userdata, + content_get_url(gwin->bw->current_content), true); break; case CMID_CLIPOBJ: - object = (struct content *)userdata; - if(object->bitmap) + object = (struct hlcache_handle *)userdata; + if((bm = content_get_bitmap(object))) { - object->bitmap->url = object->url; - object->bitmap->title = object->title; - ami_easy_clipboard_bitmap(object->bitmap); + bm->url = content_get_url(object); + bm->title = content_get_title(object); + ami_easy_clipboard_bitmap(bm); } #ifdef WITH_NS_SVG - else if(object->type == CONTENT_SVG) + else if(content_get_type(object) == CONTENT_SVG) { ami_easy_clipboard_svg(object); } @@ -299,12 +306,12 @@ uint32 ami_context_menu_hook(struct Hook *hook,Object *item,APTR reserved) break; case CMID_SAVEOBJ: - object = (struct content *)userdata; + object = (struct hlcache_handle *)userdata; if(AslRequestTags(savereq, ASLFR_TitleText,messages_get("NetSurf"), ASLFR_Screen,scrn, - ASLFR_InitialFile,FilePart(object->url), + ASLFR_InitialFile,FilePart(content_get_url(object)), TAG_DONE)) { BPTR fh = 0; @@ -314,40 +321,43 @@ uint32 ami_context_menu_hook(struct Hook *hook,Object *item,APTR reserved) ami_update_pointer(gwin->win,GUI_POINTER_WAIT); if(fh = FOpen(fname,MODE_NEWFILE,0)) { - FWrite(fh,object->source_data,1,object->source_size); + if((source_data = content_get_source_data(object, &source_size))) + FWrite(fh, source_data, 1, source_size); + FClose(fh); - SetComment(fname,object->url); + SetComment(fname, content_get_url(object)); } ami_update_pointer(gwin->win,GUI_POINTER_DEFAULT); } break; case CMID_SAVEIFFOBJ: - object = (struct content *)userdata; + object = (struct hlcache_handle *)userdata; if(AslRequestTags(savereq, ASLFR_TitleText,messages_get("NetSurf"), ASLFR_Screen,scrn, - ASLFR_InitialFile,FilePart(object->url), + ASLFR_InitialFile,FilePart(content_get_url(object)), TAG_DONE)) { BPTR fh = 0; char fname[1024]; + strlcpy(&fname,savereq->fr_Drawer,1024); AddPart(fname,savereq->fr_File,1024); - if(object->bitmap) + if((bm = content_get_bitmap(object))) { - object->bitmap->url = object->url; - object->bitmap->title = object->title; - bitmap_save(object->bitmap,fname,0); + bm->url = content_get_url(object); + bm->title = content_get_title(object); + bitmap_save(bm, fname, 0); } #ifdef WITH_NS_SVG - else if(object->type == CONTENT_SVG) + else if(content_get_type(object) == CONTENT_SVG) { ami_save_svg(object,fname); } #endif - SetComment(fname,object->url); + SetComment(fname, content_get_url(object)); ami_update_pointer(gwin->win,GUI_POINTER_DEFAULT); } break; diff --git a/amiga/download.c b/amiga/download.c index 064923eff..6970096a7 100644 --- a/amiga/download.c +++ b/amiga/download.c @@ -296,7 +296,7 @@ gui_window_save_link(struct gui_window *g, const char *url, const char *title) } } -void gui_drag_save_object(gui_save_type type, struct content *c, +void gui_drag_save_object(gui_save_type type, hlcache_handle *c, struct gui_window *g) { if(strcmp(option_use_pubscreen,"Workbench")) return; @@ -320,6 +320,8 @@ void ami_drag_save(struct Window *win) { ULONG which,type; char path[1025],dpath[1025]; + char *source_data; + ULONG source_size; which = WhichWorkbenchObject(NULL,scrn->MouseX,scrn->MouseY, WBOBJA_Type,&type, @@ -354,15 +356,17 @@ void ami_drag_save(struct Window *win) case GUI_SAVE_OBJECT_ORIG: // object case GUI_SAVE_SOURCE: { - struct content *c = drag_save_data; + struct hlcache_handle *c = drag_save_data; BPTR fh = 0; - AddPart(path,c->title,1024); + AddPart(path, content_get_title(c), 1024); if(fh = FOpen(path,MODE_NEWFILE,0)) { - FWrite(fh,c->source_data,1,c->source_size); + if((source_data = content_get_source_data(c, &source_size))) + FWrite(fh, source_data, 1, source_size); + FClose(fh); - SetComment(path,c->url); + SetComment(path, content_get_url(c)); } } break; @@ -374,15 +378,15 @@ void ami_drag_save(struct Window *win) case GUI_SAVE_COMPLETE: { - struct content *c = drag_save_data; + struct hlcache_handle *c = drag_save_data; BPTR lock = 0; - AddPart(path,c->title,1024); + AddPart(path, content_get_title(c), 1024); if(lock = CreateDir(path)) { UnLock(lock); save_complete(c,path); - SetComment(path,c->url); + SetComment(path, content_get_url(c)); } ami_superimpose_favicon(path, drag_save_gui->favicon, NULL); @@ -391,18 +395,20 @@ void ami_drag_save(struct Window *win) case GUI_SAVE_OBJECT_NATIVE: { - struct content *c = drag_save_data; - AddPart(path,c->title,1024); - if(c->bitmap) + hlcache_handle *c = drag_save_data; + struct bitmap *bm; + + AddPart(path, content_get_title(c), 1024); + if(bm = content_get_bitmap(c)) { - c->bitmap->url = c->url; - c->bitmap->title = c->title; - bitmap_save(c->bitmap,path,0); + bm->url = content_get_url(c); + bm->title = content_get_title(c); + bitmap_save(bm, path, 0); } #ifdef WITH_NS_SVG - else if(c->type == CONTENT_SVG) + else if(content_get_type(c) == CONTENT_SVG) { - ami_save_svg(c,path); + ami_save_svg(c, path); } #endif } @@ -414,7 +420,7 @@ void ami_drag_save(struct Window *win) ami_update_pointer(win,GUI_POINTER_DEFAULT); } -void ami_superimpose_favicon(STRPTR path, struct content *icon, STRPTR type) +void ami_superimpose_favicon(STRPTR path, struct hlcache_handle *icon, STRPTR type) { struct DiskObject *dobj = NULL; struct BitMap *bm = NULL; @@ -449,14 +455,14 @@ void ami_superimpose_favicon(STRPTR path, struct content *icon, STRPTR type) * and OS4 default icons should all be truecolour anyway. */ if(format == IDFMT_DIRECTMAPPED) { - if ((icon != NULL) && (icon->type == CONTENT_ICO)) + if ((icon != NULL) && (content_get_type(icon) == CONTENT_ICO)) { nsico_set_bitmap_from_size(icon, 16, 16); } - if ((icon != NULL) && (icon->bitmap != NULL)) + if ((icon != NULL) && (content_get_bitmap(icon) != NULL)) { - bm = ami_getcachenativebm(icon->bitmap, 16, 16, NULL); + bm = ami_getcachenativebm(content_get_bitmap(icon), 16, 16, NULL); } if(bm) diff --git a/amiga/download.h b/amiga/download.h index 6c37853c3..a9b53c420 100755 --- a/amiga/download.h +++ b/amiga/download.h @@ -49,5 +49,5 @@ struct gui_window *drag_save_gui; void ami_download_window_abort(struct gui_download_window *dw); void ami_drag_save(struct Window *win); void ami_free_download_list(struct List *dllist); -void ami_superimpose_favicon(STRPTR path, struct content *icon, STRPTR type); +void ami_superimpose_favicon(STRPTR path, struct hlcache_handle *icon, STRPTR type); #endif diff --git a/amiga/fetch_file.c b/amiga/fetch_file.c index bc03962ab..f0b509203 100755 --- a/amiga/fetch_file.c +++ b/amiga/fetch_file.c @@ -49,7 +49,6 @@ struct ami_file_fetch_info { int httpcode; int64 len; char *mimetype; - struct cache_data cachedata; }; static bool ami_fetch_file_initialise(const char *scheme); @@ -170,16 +169,6 @@ bool ami_fetch_file_start(void *vfetch) /* LOG(("ami file fetcher start")); */ - fetch->cachedata.req_time = time(NULL); - fetch->cachedata.res_time = time(NULL); - fetch->cachedata.date = 0; - fetch->cachedata.expires = 0; - fetch->cachedata.age = INVALID_AGE; - fetch->cachedata.max_age = 0; - fetch->cachedata.no_cache = true; - fetch->cachedata.etag = NULL; - fetch->cachedata.last_modified = 0; - return true; } @@ -268,7 +257,7 @@ void ami_fetch_file_poll(const char *scheme_ignored) if((len<1024) && (!fetch->aborted)) { ami_fetch_file_send_callback(FETCH_FINISHED, - fetch, &fetch->cachedata, 0, + fetch, NULL, 0, errorcode); fetch->aborted = true; diff --git a/amiga/gui.c b/amiga/gui.c index 886185ac8..8d989c5c8 100755 --- a/amiga/gui.c +++ b/amiga/gui.c @@ -404,7 +404,12 @@ void ami_amiupdate(void) int main(int argc, char** argv) { setbuf(stderr, NULL); - return netsurf_main(argc, argv); + + netsurf_init(argc, argv); + netsurf_main_loop(); + netsurf_exit(); + + return 0; } void gui_init(int argc, char** argv) @@ -1341,8 +1346,8 @@ void ami_handle_msg(void) case KEY_TEXT_END: // end gui_window_set_scroll(gwin->bw->window, - gwin->bw->current_content->width, - gwin->bw->current_content->height); + content_get_width(gwin->bw->current_content), + content_get_height(gwin->bw->current_content)); break; case KEY_WORD_RIGHT: // alt+right @@ -1476,7 +1481,7 @@ void ami_handle_appmsg(void) struct WBArg *appwinargs; STRPTR filename; struct box *box,*file_box=0,*text_box=0; - struct content *content; + hlcache_handle *content; int box_x=0,box_y=0; BPTR fh = 0; char *utf8text,*urlfilename; @@ -1522,7 +1527,9 @@ void ami_handle_appmsg(void) AddPart(filename,appwinargs->wa_Name,1024); - if((!gwin->bw->current_content || gwin->bw->current_content->type != CONTENT_HTML) || (!((x>=xs) && (y>=ys) && (xbw->current_content || + content_get_type(gwin->bw->current_content) != CONTENT_HTML) || + (!((x>=xs) && (y>=ys) && (xbw,urlfilename,NULL,true); @@ -1531,7 +1538,7 @@ void ami_handle_appmsg(void) else { content = gwin->bw->current_content; - box = content->data.html.layout; + box = html_get_box_tree(content); while ((box = box_at_point(box, x, y, &box_x, &box_y, &content))) { if (box->style && css_computed_visibility(box->style) == CSS_VISIBILITY_HIDDEN) continue; @@ -1824,8 +1831,8 @@ void ami_switch_tab(struct gui_window_2 *gwin,bool redraw) gui_window_set_scroll(gwin->bw->window,gwin->bw->window->scrollx,gwin->bw->window->scrolly); gwin->redraw_scroll = false; - browser_window_refresh_url_bar(gwin->bw,gwin->bw->current_content->url, - gwin->bw->frag_id); + browser_window_refresh_url_bar(gwin->bw, + content_get_url(gwin->bw->current_content), gwin->bw->frag_id); } } @@ -2915,7 +2922,7 @@ void gui_window_set_title(struct gui_window *g, const char *title) * \param sy vertical scroller position */ -void ami_do_redraw_limits(struct gui_window *g, struct content *c,int x0, int y0, int x1, int y1, ULONG sx, ULONG sy) +void ami_do_redraw_limits(struct gui_window *g, hlcache_handle *c,int x0, int y0, int x1, int y1, ULONG sx, ULONG sy) { ULONG xoffset,yoffset,width=800,height=600; ULONG htemp,vtemp; @@ -2935,7 +2942,7 @@ void ami_do_redraw_limits(struct gui_window *g, struct content *c,int x0, int y0 GetAttr(SPACE_AreaBox, g->shared->objects[GID_BROWSER], (ULONG *)&bbox); if(!c) return; - if (c->locked) return; +// if (c->locked) return; current_redraw_browser = g->shared->bw; @@ -2995,7 +3002,7 @@ void ami_do_redraw_limits(struct gui_window *g, struct content *c,int x0, int y0 void gui_window_redraw(struct gui_window *g, int x0, int y0, int x1, int y1) { ULONG sx,sy; - struct content *c; + hlcache_handle *c; c = g->shared->bw->current_content; ami_get_hscroll_pos(g->shared, (ULONG *)&sx); @@ -3038,7 +3045,7 @@ void ami_do_redraw(struct gui_window_2 *g) { struct Region *reg = NULL; struct Rectangle rect; - struct content *c; + hlcache_handle *c; ULONG hcurrent,vcurrent,xoffset,yoffset,width=800,height=600,x0=0,y0=0; struct IBox *bbox; ULONG oldh=g->oldh,oldv=g->oldv; @@ -3051,7 +3058,7 @@ void ami_do_redraw(struct gui_window_2 *g) c = g->bw->current_content; if(!c) return; - if (c->locked) return; +// if (c->locked) return; current_redraw_browser = g->bw; // currp = &browserglob.rp; @@ -3080,7 +3087,7 @@ void ami_do_redraw(struct gui_window_2 *g) // if (c->type == CONTENT_HTML) scale = 1; - if(g->redraw_scroll && c->type == CONTENT_HTML) + if(g->redraw_scroll && content_get_type(c) == CONTENT_HTML) { g->bw->window->c_h_temp = g->bw->window->c_h; gui_window_remove_caret(g->bw->window); @@ -3127,7 +3134,7 @@ void ami_do_redraw(struct gui_window_2 *g) ami_clg(0xffffff); glob->scale = g->bw->scale; - if(c->type == CONTENT_HTML) + if(content_get_type(c) == CONTENT_HTML) { content_redraw(c, -hcurrent, -vcurrent, @@ -3143,8 +3150,8 @@ void ami_do_redraw(struct gui_window_2 *g) -vcurrent /* * g->bw->scale */, (width / g->bw->scale) - hcurrent, (height / g->bw->scale) - vcurrent, - 0,0,c->width /* * g->bw->scale */, - c->height /* * g->bw->scale */, + 0,0, content_get_width(c) /* * g->bw->scale */, + content_get_height(c) /* * g->bw->scale */, g->bw->scale,0xFFFFFF); } @@ -3199,8 +3206,8 @@ void gui_window_set_scroll(struct gui_window *g, int sx, int sy) if(sx<0) sx=0; if(sy<0) sy=0; if(!g->shared->bw || !g->shared->bw->current_content) return; - if(sx > g->shared->bw->current_content->width) sx = g->shared->bw->current_content->width; - if(sy > g->shared->bw->current_content->height) sy = g->shared->bw->current_content->height; + if(sx > content_get_width(g->shared->bw->current_content)) sx = content_get_width(g->shared->bw->current_content); + if(sy > content_get_height(g->shared->bw->current_content)) sy = content_get_height(g->shared->bw->current_content); if(g->tab_node && (g->shared->tabs > 1)) GetAttr(CLICKTAB_Current, @@ -3289,7 +3296,7 @@ void gui_window_update_extent(struct gui_window *g) (ULONG *)&bbox); RefreshSetGadgetAttrs((struct Gadget *)(APTR)g->shared->objects[OID_VSCROLL],g->shared->win,NULL, - SCROLLER_Total, (ULONG)(g->shared->bw->current_content->height * g->shared->bw->scale), + SCROLLER_Total, (ULONG)(content_get_height(g->shared->bw->current_content) * g->shared->bw->scale), SCROLLER_Visible, bbox->Height, TAG_DONE); @@ -3297,7 +3304,7 @@ void gui_window_update_extent(struct gui_window *g) { RefreshSetGadgetAttrs((struct Gadget *)(APTR)g->shared->objects[GID_HSCROLL], g->shared->win, NULL, - PGA_Total, (ULONG)(g->shared->bw->current_content->width * g->shared->bw->scale), + PGA_Total, (ULONG)(content_get_width(g->shared->bw->current_content) * g->shared->bw->scale), PGA_Visible, bbox->Width, TAG_DONE); } @@ -3305,7 +3312,7 @@ void gui_window_update_extent(struct gui_window *g) { RefreshSetGadgetAttrs((struct Gadget *)(APTR)g->shared->objects[OID_HSCROLL], g->shared->win, NULL, - SCROLLER_Total, (ULONG)(g->shared->bw->current_content->width * g->shared->bw->scale), + SCROLLER_Total, (ULONG)(content_get_width(g->shared->bw->current_content) * g->shared->bw->scale), SCROLLER_Visible, bbox->Width, TAG_DONE); } @@ -3373,7 +3380,7 @@ void gui_window_set_url(struct gui_window *g, const char *url) /** * function to add retrieved favicon to gui */ -void gui_window_set_icon(struct gui_window *g, struct content *icon) +void gui_window_set_icon(struct gui_window *g, hlcache_handle *icon) { struct BitMap *bm = NULL; struct IBox *bbox; @@ -3387,17 +3394,17 @@ void gui_window_set_icon(struct gui_window *g, struct content *icon) (ULONG *)&cur_tab); if ((icon != NULL) && - (icon->status != CONTENT_STATUS_READY) && - (icon->status != CONTENT_STATUS_DONE)) return; + (content_get_status(icon) != CONTENT_STATUS_READY) && + (content_get_status(icon) != CONTENT_STATUS_DONE)) return; - if ((icon != NULL) && (icon->type == CONTENT_ICO)) + if ((icon != NULL) && (content_get_type(icon) == CONTENT_ICO)) { nsico_set_bitmap_from_size(icon, 16, 16); } - if ((icon != NULL) && (icon->bitmap != NULL)) + if ((icon != NULL) && (content_get_bitmap(icon) != NULL)) { - bm = ami_getcachenativebm(icon->bitmap, 16, 16, + bm = ami_getcachenativebm(content_get_bitmap(icon), 16, 16, g->shared->win->RPort->BitMap); } @@ -3434,7 +3441,7 @@ void gui_window_set_icon(struct gui_window *g, struct content *icon) * \param ico may be NULL for local calls; then access current cache from * search_web_ico() */ -void gui_window_set_search_ico(struct content *ico) +void gui_window_set_search_ico(hlcache_handle *ico) { struct BitMap *bm = NULL; struct IBox *bbox; @@ -3447,14 +3454,14 @@ void gui_window_set_search_ico(struct content *ico) if(option_kiosk_mode == true) return; if (ico == NULL) ico = search_web_ico(); - if ((ico != NULL) && (ico->type == CONTENT_ICO)) + if ((ico != NULL) && (content_get_type(ico) == CONTENT_ICO)) { nsico_set_bitmap_from_size(ico, 16, 16); } - if ((ico != NULL) && (ico->bitmap != NULL)) + if ((ico != NULL) && (content_get_bitmap(ico) != NULL)) { - bm = ami_getcachenativebm(ico->bitmap, 16, 16, NULL); + bm = ami_getcachenativebm(content_get_bitmap(ico), 16, 16, NULL); } node = (struct nsObject *)GetHead((struct List *)window_list); @@ -3543,7 +3550,7 @@ void gui_window_remove_caret(struct gui_window *g) void gui_window_new_content(struct gui_window *g) { - struct content *c; + hlcache_handle *c; if(g && g->shared && g->shared->bw && g->shared->bw->current_content) c = g->shared->bw->current_content; @@ -3560,7 +3567,7 @@ void gui_window_new_content(struct gui_window *g) if(g->shared->bw->browser_window_type != BROWSER_WINDOW_NORMAL || option_kiosk_mode == true) return; - if(c->type <= CONTENT_CSS) + if(content_get_type(c) <= CONTENT_CSS) { OnMenu(g->shared->win,AMI_MENU_SAVEAS_TEXT); OnMenu(g->shared->win,AMI_MENU_SAVEAS_COMPLETE); @@ -3583,9 +3590,9 @@ void gui_window_new_content(struct gui_window *g) OffMenu(g->shared->win,AMI_MENU_FIND); #ifdef WITH_NS_SVG - if(c->bitmap || c->type == CONTENT_SVG) + if(content_get_bitmap(c) || content_get_type(c) == CONTENT_SVG) #else - if(c->bitmap) + if(content_get_bitmap(c)) #endif { OnMenu(g->shared->win,AMI_MENU_COPY); diff --git a/amiga/gui.h b/amiga/gui.h index 5509c0314..cac5143e5 100755 --- a/amiga/gui.h +++ b/amiga/gui.h @@ -117,7 +117,7 @@ struct gui_window int scrolly; struct history_window *hw; struct List dllist; - struct content *favicon; + hlcache_handle *favicon; bool throbbing; char *tabtitle; }; diff --git a/amiga/gui_options.c b/amiga/gui_options.c index c365e7fd9..7b24ccc51 100755 --- a/amiga/gui_options.c +++ b/amiga/gui_options.c @@ -1611,8 +1611,8 @@ BOOL ami_gui_opts_event(void) case GID_OPTS_HOMEPAGE_CURRENT: if(curbw) RefreshSetGadgetAttrs((struct Gadget *)gow->objects[GID_OPTS_HOMEPAGE], - gow->win,NULL,STRINGA_TextVal, - curbw->current_content->url,TAG_DONE); + gow->win, NULL, STRINGA_TextVal, + content_get_url(curbw->current_content), TAG_DONE); break; case GID_OPTS_FROMLOCALE: diff --git a/amiga/hotlist.c b/amiga/hotlist.c index 0ebea301d..da1fe2399 100755 --- a/amiga/hotlist.c +++ b/amiga/hotlist.c @@ -24,7 +24,7 @@ #include "amiga/hotlist.h" #include "amiga/tree.h" -void ami_gui_hotlist_visited(struct content *content, struct tree *tree, +void ami_gui_hotlist_visited(hlcache_handle *content, struct tree *tree, struct node *node); static const struct { @@ -43,9 +43,9 @@ static const struct { }; #define ENTRIES_COUNT (sizeof(default_entries) / sizeof(default_entries[0])) -void hotlist_visited(struct content *content) +void hotlist_visited(hlcache_handle *content) { - if ((!content) || (!content->url) || (!hotlist)) + if ((!content) || (!content_get_url(content)) || (!hotlist)) return; ami_gui_hotlist_visited(content, hotlist, hotlist->root); } @@ -57,7 +57,7 @@ void hotlist_visited(struct content *content) * \param tree the tree to find the URL data from * \param node the node to update siblings and children of */ -void ami_gui_hotlist_visited(struct content *content, struct tree *tree, +void ami_gui_hotlist_visited(hlcache_handle *content, struct tree *tree, struct node *node) { struct node_element *element; @@ -66,8 +66,8 @@ void ami_gui_hotlist_visited(struct content *content, struct tree *tree, if (!node->folder) { element = tree_find_element(node, TREE_ELEMENT_URL); if ((element) && (!strcmp(element->text, - content->url))) { - tree_update_URL_node(node, content->url, NULL); + content_get_url(content)))) { + tree_update_URL_node(node, content_get_url(content), NULL); tree_handle_node_changed(tree, node, true, false); } @@ -129,21 +129,21 @@ void ami_hotlist_init(struct tree **hotlist) tree_initialise(hotlist_tree); } -void ami_hotlist_add(struct node *node,struct content *c) +void ami_hotlist_add(struct node *node, struct hlcache_handle *c) { const struct url_data *data; - data = urldb_get_url_data(c->url); + data = urldb_get_url_data(content_get_url(c)); if (!data) { - urldb_add_url(c->url); - urldb_set_url_persistence(c->url,true); - data = urldb_get_url_data(c->url); + urldb_add_url(content_get_url(c)); + urldb_set_url_persistence(content_get_url(c),true); + data = urldb_get_url_data(content_get_url(c)); } if (data) { - tree_create_URL_node(node,c->url,data,c->title); + tree_create_URL_node(node,content_get_url(c),data,content_get_title(c)); } tree_handle_node_changed(hotlist,node,false,true); diff --git a/amiga/hotlist.h b/amiga/hotlist.h index 9ecd998c0..eed5b0eed 100755 --- a/amiga/hotlist.h +++ b/amiga/hotlist.h @@ -21,7 +21,7 @@ #include "desktop/tree.h" void ami_hotlist_init(struct tree **hotlist); -void ami_hotlist_add(struct node *node,struct content *c); +void ami_hotlist_add(struct node *node, struct hlcache_handle *c); struct tree *hotlist; #endif diff --git a/amiga/iff_dr2d.c b/amiga/iff_dr2d.c index 0d22511aa..44b3fdae4 100644 --- a/amiga/iff_dr2d.c +++ b/amiga/iff_dr2d.c @@ -301,9 +301,11 @@ bool ami_svg_to_dr2d(struct IFFHandle *iffh,char *buffer, uint32 size, char *url } #ifndef AMIGA_DR2D_STANDALONE -bool ami_save_svg(struct content *c,char *filename) +bool ami_save_svg(struct hlcache_handle *c,char *filename) { struct IFFHandle *iffh; + char *source_data; + ULONG source_size; if(iffh = AllocIFF()) { @@ -316,7 +318,8 @@ bool ami_save_svg(struct content *c,char *filename) if((OpenIFF(iffh,IFFF_WRITE))) return false; - ami_svg_to_dr2d(iffh,c->source_data,c->source_size,c->url); + if((source_data = content_get_source_data(c, &source_size))) + ami_svg_to_dr2d(iffh, source_data, source_size, content_get_url(c)); if(iffh) CloseIFF(iffh); if(iffh->iff_Stream) Close((BPTR)iffh->iff_Stream); diff --git a/amiga/iff_dr2d.h b/amiga/iff_dr2d.h index 19286a62b..fcd1f505e 100644 --- a/amiga/iff_dr2d.h +++ b/amiga/iff_dr2d.h @@ -97,9 +97,9 @@ struct dash_struct { // IEEE Dashes[NumDashes]; /* On-off pattern */ }; -bool ami_svg_to_dr2d(struct IFFHandle *iffh,char *buffer, uint32 size, char *url); +bool ami_svg_to_dr2d(struct IFFHandle *iffh, char *buffer, uint32 size, char *url); #ifndef AMIGA_DR2D_STANDALONE -bool ami_save_svg(struct content *c,char *filename); +bool ami_save_svg(struct hlcache_handle *c, char *filename); #endif #endif // AMIGA_IFF_DR2D_H #endif // WITH_NS_SVG diff --git a/amiga/login.c b/amiga/login.c index a5dc35871..19885d83f 100755 --- a/amiga/login.c +++ b/amiga/login.c @@ -39,15 +39,15 @@ #include #include -void gui_401login_open(struct browser_window *bw, struct content *c, +void gui_401login_open(struct browser_window *bw, hlcache_handle *c, const char *realm) { struct gui_login_window *lw = AllocVec(sizeof(struct gui_login_window),MEMF_PRIVATE | MEMF_CLEAR); char *host; - url_host(c->url, &host); + url_host(content_get_url(c), &host); lw->host = host; - lw->url = c->url; + lw->url = content_get_url(c); lw->realm = (char *)realm; lw->bw = bw; diff --git a/amiga/menu.c b/amiga/menu.c index 624c21071..4c5c67ac8 100755 --- a/amiga/menu.c +++ b/amiga/menu.c @@ -416,6 +416,9 @@ void ami_menupick(ULONG code,struct gui_window_2 *gwin,struct MenuItem *item) bool opentab=true; char *temp; BPTR lock = 0; + char *source_data; + ULONG source_size; + struct bitmap *bm; tgw.tab_node = NULL; tgw.tab = 0; @@ -427,7 +430,7 @@ void ami_menupick(ULONG code,struct gui_window_2 *gwin,struct MenuItem *item) switch(itemnum) { case 0: // new window - bw = browser_window_create(NULL, gwin->bw, 0, true, openwin); + bw = browser_window_create(option_homepage_url, gwin->bw, 0, true, openwin); break; case 1: // new tab @@ -468,7 +471,7 @@ void ami_menupick(ULONG code,struct gui_window_2 *gwin,struct MenuItem *item) if(AslRequestTags(savereq, ASLFR_TitleText,messages_get("NetSurf"), ASLFR_Screen,scrn, - ASLFR_InitialFile,FilePart(gwin->bw->current_content->url), + ASLFR_InitialFile,FilePart(content_get_url(gwin->bw->current_content)), TAG_DONE)) { strlcpy(&fname,savereq->fr_Drawer,1024); @@ -476,9 +479,10 @@ void ami_menupick(ULONG code,struct gui_window_2 *gwin,struct MenuItem *item) ami_update_pointer(gwin->win,GUI_POINTER_WAIT); if(fh = FOpen(fname,MODE_NEWFILE,0)) { - FWrite(fh,gwin->bw->current_content->source_data,1,gwin->bw->current_content->source_size); + if((source_data = content_get_source_data(gwin->bw->current_content, &source_size))) + FWrite(fh,source_data, 1, source_size); FClose(fh); - SetComment(fname,gwin->bw->current_content->url); + SetComment(fname, content_get_url(gwin->bw->current_content)); } ami_update_pointer(gwin->win,GUI_POINTER_DEFAULT); } @@ -488,14 +492,14 @@ void ami_menupick(ULONG code,struct gui_window_2 *gwin,struct MenuItem *item) if(AslRequestTags(savereq, ASLFR_TitleText,messages_get("NetSurf"), ASLFR_Screen,scrn, - ASLFR_InitialFile,FilePart(gwin->bw->current_content->url), + ASLFR_InitialFile,FilePart(content_get_url(gwin->bw->current_content)), TAG_DONE)) { strlcpy(&fname,savereq->fr_Drawer,1024); AddPart(fname,savereq->fr_File,1024); ami_update_pointer(gwin->win,GUI_POINTER_WAIT); save_as_text(gwin->bw->current_content,fname); - SetComment(fname,gwin->bw->current_content->url); + SetComment(fname,content_get_url(gwin->bw->current_content)); ami_update_pointer(gwin->win,GUI_POINTER_DEFAULT); } break; @@ -504,7 +508,7 @@ void ami_menupick(ULONG code,struct gui_window_2 *gwin,struct MenuItem *item) if(AslRequestTags(savereq, ASLFR_TitleText,messages_get("NetSurf"), ASLFR_Screen,scrn, - ASLFR_InitialFile,FilePart(gwin->bw->current_content->url), + ASLFR_InitialFile,FilePart(content_get_url(gwin->bw->current_content)), TAG_DONE)) { strlcpy(&fname,savereq->fr_Drawer,1024); @@ -514,7 +518,7 @@ void ami_menupick(ULONG code,struct gui_window_2 *gwin,struct MenuItem *item) { UnLock(lock); save_complete(gwin->bw->current_content,fname); - SetComment(fname,gwin->bw->current_content->url); + SetComment(fname,content_get_url(gwin->bw->current_content)); ami_superimpose_favicon(fname, gwin->bw->window->favicon, NULL); } @@ -527,14 +531,14 @@ void ami_menupick(ULONG code,struct gui_window_2 *gwin,struct MenuItem *item) if(AslRequestTags(savereq, ASLFR_TitleText,messages_get("NetSurf"), ASLFR_Screen,scrn, - ASLFR_InitialFile,FilePart(gwin->bw->current_content->url), + ASLFR_InitialFile,FilePart(content_get_url(gwin->bw->current_content)), TAG_DONE)) { strlcpy(&fname,savereq->fr_Drawer,1024); AddPart(fname,savereq->fr_File,1024); ami_update_pointer(gwin->win,GUI_POINTER_WAIT); save_as_pdf(gwin->bw->current_content,fname); - SetComment(fname,gwin->bw->current_content->url); + SetComment(fname, content_get_url(gwin->bw->current_content)); ami_superimpose_favicon(fname, gwin->bw->window->favicon, "pdf"); ami_update_pointer(gwin->win,GUI_POINTER_DEFAULT); @@ -546,25 +550,25 @@ void ami_menupick(ULONG code,struct gui_window_2 *gwin,struct MenuItem *item) if(AslRequestTags(savereq, ASLFR_TitleText,messages_get("NetSurf"), ASLFR_Screen,scrn, - ASLFR_InitialFile,FilePart(gwin->bw->current_content->url), + ASLFR_InitialFile,FilePart(content_get_url(gwin->bw->current_content)), TAG_DONE)) { strlcpy(&fname,savereq->fr_Drawer,1024); AddPart(fname,savereq->fr_File,1024); ami_update_pointer(gwin->win,GUI_POINTER_WAIT); - if(gwin->bw->current_content->bitmap) + if((bm = content_get_bitmap(gwin->bw->current_content))) { - gwin->bw->current_content->bitmap->url = gwin->bw->current_content->url; - gwin->bw->current_content->bitmap->title = gwin->bw->current_content->title; - bitmap_save(gwin->bw->current_content->bitmap,fname,0); + bm->url = content_get_url(gwin->bw->current_content); + bm->title = content_get_title(gwin->bw->current_content); + bitmap_save(bm, fname, 0); } #ifdef WITH_NS_SVG - else if(gwin->bw->current_content->type == CONTENT_SVG) + else if(content_get_type(gwin->bw->current_content) == CONTENT_SVG) { ami_save_svg(gwin->bw->current_content,fname); } #endif - SetComment(fname,gwin->bw->current_content->url); + SetComment(fname, content_get_url(gwin->bw->current_content)); ami_update_pointer(gwin->win,GUI_POINTER_DEFAULT); } break; @@ -625,19 +629,19 @@ void ami_menupick(ULONG code,struct gui_window_2 *gwin,struct MenuItem *item) switch(itemnum) { case 0: // copy - if(gwin->bw->current_content->type <= CONTENT_CSS) + if(content_get_type(gwin->bw->current_content) <= CONTENT_CSS) { browser_window_key_press(gwin->bw, KEY_COPY_SELECTION); browser_window_key_press(gwin->bw, KEY_CLEAR_SELECTION); } - else if(gwin->bw->current_content->bitmap) + else if(bm = content_get_bitmap(gwin->bw->current_content)) { - gwin->bw->current_content->bitmap->url = gwin->bw->current_content->url; - gwin->bw->current_content->bitmap->title = gwin->bw->current_content->title; - ami_easy_clipboard_bitmap(gwin->bw->current_content->bitmap); + bm->url = content_get_url(gwin->bw->current_content); + bm->title = content_get_title(gwin->bw->current_content); + ami_easy_clipboard_bitmap(bm); } #ifdef WITH_NS_SVG - else if(gwin->bw->current_content->type == CONTENT_SVG) + else if(content_get_type(gwin->bw->current_content) == CONTENT_SVG) { ami_easy_clipboard_svg(gwin->bw->current_content); } diff --git a/amiga/print.c b/amiga/print.c index 6e040666f..9f18a76d8 100644 --- a/amiga/print.c +++ b/amiga/print.c @@ -73,7 +73,7 @@ struct ami_printer_info struct PrinterData *PD; struct PrinterExtendedData *PED; struct MsgPort *msgport; - struct content *c; + struct hlcache_handle *c; struct print_settings *ps; int page; int pages; @@ -206,7 +206,7 @@ BOOL ami_print_readunit(CONST_STRPTR filename, char name[], return TRUE; } -void ami_print_ui(struct content *c) +void ami_print_ui(struct hlcache_handle *c) { char filename[30]; int i; @@ -328,7 +328,7 @@ BOOL ami_print_event(struct ami_print_window *pw) /* return TRUE if window destroyed */ ULONG class,result; uint16 code; - struct content *c; + struct hlcache_handle *c; int copies; while((result = RA_HandleInput(pw->objects[OID_MAIN],&code)) != WMHI_LASTMSG) @@ -368,7 +368,7 @@ BOOL ami_print_event(struct ami_print_window *pw) return FALSE; } -void ami_print(struct content *c, int copies) +void ami_print(struct hlcache_handle *c, int copies) { double height, print_height; float scale = option_print_scale / 100.0; @@ -392,7 +392,7 @@ void ami_print(struct content *c, int copies) ami_print_info.PD = (struct PrinterData *)ami_print_info.PReq->io_Device; ami_print_info.PED = &ami_print_info.PD->pd_SegmentData->ps_PED; - ami_print_info.ps = print_make_settings(PRINT_DEFAULT, c->url, &nsfont); + ami_print_info.ps = print_make_settings(PRINT_DEFAULT, content_get_url(c), &nsfont); ami_print_info.ps->page_width = ami_print_info.PED->ped_MaxXDots; ami_print_info.ps->page_height = ami_print_info.PED->ped_MaxYDots; ami_print_info.ps->scale = scale; diff --git a/amiga/print.h b/amiga/print.h index 3afa9e688..9091a6b63 100755 --- a/amiga/print.h +++ b/amiga/print.h @@ -27,11 +27,11 @@ struct ami_print_window { Object *objects[OID_LAST]; struct Gadget *gadgets[GID_LAST]; struct nsObject *node; - struct content *c; + struct hlcache_handle *c; }; -void ami_print(struct content *c, int copies); -void ami_print_ui(struct content *c); +void ami_print(struct hlcache_handle *c, int copies); +void ami_print_ui(struct hlcache_handle *c); BOOL ami_print_event(struct ami_print_window *pw); bool ami_print_cont(void); struct MsgPort *ami_print_init(void); diff --git a/amiga/save_complete.h b/amiga/save_complete.h index b8a34ad86..cb6c26643 100755 --- a/amiga/save_complete.h +++ b/amiga/save_complete.h @@ -27,6 +27,6 @@ #include "content/content.h" void save_complete_init(void); -bool save_complete(struct content *c, const char *path); +bool save_complete(hlcache_handle *c, const char *path); #endif diff --git a/amiga/save_pdf.c b/amiga/save_pdf.c index f446da1e4..1be2c56d0 100644 --- a/amiga/save_pdf.c +++ b/amiga/save_pdf.c @@ -40,7 +40,7 @@ * \param path path to save PDF as * \return true on success, false on error and error reported */ -bool save_as_pdf(struct content *c, const char *path) +bool save_as_pdf(struct hlcache_handle *c, const char *path) { struct print_settings *psettings; diff --git a/amiga/save_pdf.h b/amiga/save_pdf.h index 5a204bf02..4a5a7edde 100644 --- a/amiga/save_pdf.h +++ b/amiga/save_pdf.h @@ -16,15 +16,15 @@ * along with this program. If not, see . */ -#ifndef _NETSURF_RISCOS_SAVE_PDF_H_ -#define _NETSURF_RISCOS_SAVE_PDF_H_ +#ifndef _NETSURF_AMIGA_SAVE_PDF_H_ +#define _NETSURF_AMIGA_SAVE_PDF_H_ #include "utils/config.h" #ifdef WITH_PDF_EXPORT struct content; -bool save_as_pdf(struct content *c, const char *path); +bool save_as_pdf(struct hlcache_handle *c, const char *path); #endif /* WITH_PDF_EXPORT */ diff --git a/amiga/search.c b/amiga/search.c index ea506b242..5c595c619 100755 --- a/amiga/search.c +++ b/amiga/search.c @@ -99,11 +99,11 @@ static struct search_callbacks ami_search_callbacks = { */ void ami_search_open(struct gui_window *gwin) { - struct content *c = gwin->shared->bw->current_content; + struct hlcache_handle *c = gwin->shared->bw->current_content; /* only handle html/textplain contents */ - if ((!c) || (c->type != CONTENT_HTML && - c->type != CONTENT_TEXTPLAIN)) + if ((!c) || (content_get_type(c) != CONTENT_HTML && + content_get_type(c) != CONTENT_TEXTPLAIN)) return; if (gwin->shared->bw->search_context == NULL) diff --git a/amiga/sslcert.c b/amiga/sslcert.c index 0f26aa0a6..41b51a20a 100644 --- a/amiga/sslcert.c +++ b/amiga/sslcert.c @@ -47,7 +47,7 @@ struct session_cert { void ami_gui_cert_close(struct session_data *data); bool ami_gui_cert_apply(struct session_data *session); -void gui_cert_verify(struct browser_window *bw, struct content *c, +void gui_cert_verify(struct browser_window *bw, hlcache_handle *c, const struct ssl_cert_info *certs, unsigned long num) { const struct ssl_cert_info *from; @@ -68,7 +68,7 @@ void gui_cert_verify(struct browser_window *bw, struct content *c, warn_user("NoMemory", 0); return; } - data->url = strdup(c->url); + data->url = strdup(content_get_url(c)); if (!data->url) { free(data); warn_user("NoMemory", 0); diff --git a/amiga/thumbnail.c b/amiga/thumbnail.c index d9abf477f..a590a71b6 100755 --- a/amiga/thumbnail.c +++ b/amiga/thumbnail.c @@ -28,7 +28,7 @@ #include "content/urldb.h" #include "desktop/plotters.h" -bool thumbnail_create(struct content *content, struct bitmap *bitmap, +bool thumbnail_create(hlcache_handle *content, struct bitmap *bitmap, const char *url) { struct BitScaleArgs bsa; @@ -42,8 +42,9 @@ bool thumbnail_create(struct content *content, struct bitmap *bitmap, ami_clearclipreg(&browserglob); current_redraw_browser = curbw; plot = amiplot; - content_redraw(content, 0, 0, content->width, content->width, - 0, 0, content->width, content->width, 1.0, 0xFFFFFF); + content_redraw(content, 0, 0, content_get_width(content), + content_get_width(content), 0, 0, content_get_width(content), + content_get_width(content), 1.0, 0xFFFFFF); current_redraw_browser = NULL; if(GfxBase->lib_Version >= 53) // AutoDoc says v52, but this function isn't in OS4.0, so checking for v53 (OS4.1) @@ -52,8 +53,8 @@ bool thumbnail_create(struct content *content, struct bitmap *bitmap, if(option_scale_quality) flags |= COMPFLAG_SrcFilter; CompositeTags(COMPOSITE_Src,browserglob.bm,bitmap->nativebm, - COMPTAG_ScaleX,COMP_FLOAT_TO_FIX(bitmap->width/content->width), - COMPTAG_ScaleY,COMP_FLOAT_TO_FIX(bitmap->height/content->width), + COMPTAG_ScaleX,COMP_FLOAT_TO_FIX(bitmap->width/content_get_width(content)), + COMPTAG_ScaleY,COMP_FLOAT_TO_FIX(bitmap->height/content_get_width(content)), COMPTAG_Flags,flags, COMPTAG_DestX,0, COMPTAG_DestY,0, @@ -67,15 +68,15 @@ bool thumbnail_create(struct content *content, struct bitmap *bitmap, { bsa.bsa_SrcX = 0; bsa.bsa_SrcY = 0; - bsa.bsa_SrcWidth = content->width; - bsa.bsa_SrcHeight = content->width; + bsa.bsa_SrcWidth = content_get_width(content); + bsa.bsa_SrcHeight = content_get_width(content); bsa.bsa_DestX = 0; bsa.bsa_DestY = 0; // bsa.bsa_DestWidth = width; // bsa.bsa_DestHeight = height; - bsa.bsa_XSrcFactor = content->width; + bsa.bsa_XSrcFactor = content_get_width(content); bsa.bsa_XDestFactor = bitmap->width; - bsa.bsa_YSrcFactor = content->width; + bsa.bsa_YSrcFactor = content_get_width(content); bsa.bsa_YDestFactor = bitmap->height; bsa.bsa_SrcBitMap = browserglob.bm; bsa.bsa_DestBitMap = bitmap->nativebm;