From c31c4babe172ab581a3196536d47fc2558a01acd Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Sun, 2 Nov 2014 15:46:42 +0000 Subject: Change contextual content retrieval to browser features. Update the API which allows frontends to acquire the page features (images, link urls or form elements) present at the given coordinates within a browser window. By making this an explicit browser_window API and using the browser.h header for the associated data structure with a more appropriate API naming the usage is much more obvious and contained. Additionally the link url is now passed around as a nsurl stopping it being converted from nsurl to text and back again several times. --- amiga/context_menu.c | 8 ++++---- amiga/gui.c | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'amiga') diff --git a/amiga/context_menu.c b/amiga/context_menu.c index a9a5f63f7..0e5512e8f 100644 --- a/amiga/context_menu.c +++ b/amiga/context_menu.c @@ -585,7 +585,7 @@ void ami_context_menu_show(struct gui_window_2 *gwin,int x,int y) struct hlcache_handle *cc = gwin->bw->current_content; bool no_more_menus = false; bool menuhascontent = false; - struct contextual_content ccdata; + struct browser_window_features ccdata; if(!cc) return; if(ctxmenuobj) DisposeObject(ctxmenuobj); @@ -648,7 +648,7 @@ void ami_context_menu_show(struct gui_window_2 *gwin,int x,int y) { if(no_more_menus == false) { - browser_window_get_contextual_content(gwin->bw, x, y, &ccdata); + browser_window_get_features(gwin->bw, x, y, &ccdata); ami_context_menu_add_submenu(ctxmenuobj, CMSUB_PAGE, cc); menuhascontent = true; @@ -659,9 +659,9 @@ void ami_context_menu_show(struct gui_window_2 *gwin,int x,int y) menuhascontent = true; } - if(ccdata.link_url) + if(ccdata.link) { - ami_context_menu_add_submenu(ctxmenuobj, CMSUB_URL, (char *)ccdata.link_url); + ami_context_menu_add_submenu(ctxmenuobj, CMSUB_URL, (char *)nsurl_access(ccdata.link)); menuhascontent = true; } diff --git a/amiga/gui.c b/amiga/gui.c index aef075967..1c15b4a83 100644 --- a/amiga/gui.c +++ b/amiga/gui.c @@ -5032,7 +5032,7 @@ bool ami_text_box_at_point(struct gui_window_2 *gwin, ULONG *x, ULONG *y) { struct IBox *bbox; ULONG xs, ys, width, height; - struct contextual_content data; + struct browser_window_features data; GetAttr(SPACE_AreaBox, (Object *)gwin->objects[GID_BROWSER], (ULONG *)&bbox); @@ -5046,7 +5046,7 @@ bool ami_text_box_at_point(struct gui_window_2 *gwin, ULONG *x, ULONG *y) width=bbox->Width; height=bbox->Height; - browser_window_get_contextual_content(gwin->bw, *x, *y, &data); + browser_window_get_features(gwin->bw, *x, *y, &data); if (data.form_features == CTX_FORM_TEXT) return true; -- cgit v1.2.3