Port RISC OS front end to browser_window_get_contextual_content. Adds support for saving link pointed to from imagemap. Fixes behaviour with frames.

svn path=/trunk/netsurf/; revision=12758
This commit is contained in:
Michael Drake 2011-09-06 19:06:04 +00:00
parent a8a28345dd
commit 5af1284c73

View File

@ -2124,15 +2124,15 @@ bool ro_gui_window_menu_prepare(wimp_w w, wimp_i i, wimp_menu *menu,
{ {
struct gui_window *g; struct gui_window *g;
struct browser_window *bw; struct browser_window *bw;
hlcache_handle *h;
struct toolbar *toolbar; struct toolbar *toolbar;
struct contextual_content cont;
hlcache_handle *h = NULL;
bool export_sprite, export_draw; bool export_sprite, export_draw;
os_coord pos; os_coord pos;
g = (struct gui_window *) ro_gui_wimp_event_get_user_data(w); g = (struct gui_window *) ro_gui_wimp_event_get_user_data(w);
toolbar = g->toolbar; toolbar = g->toolbar;
bw = g->bw; bw = g->bw;
h = bw->current_content;
/* If this is the form select menu, handle it now and then exit. /* If this is the form select menu, handle it now and then exit.
* Otherwise, carry on to the main browser window menu. * Otherwise, carry on to the main browser window menu.
@ -2156,25 +2156,14 @@ bool ro_gui_window_menu_prepare(wimp_w w, wimp_i i, wimp_menu *menu,
current_menu_object = NULL; current_menu_object = NULL;
current_menu_url = NULL; current_menu_url = NULL;
if (h != NULL && if (ro_gui_window_to_window_pos(g, pointer->pos.x,
ro_gui_window_to_window_pos(g, pointer->pos.x,
pointer->pos.y, &pos)) { pointer->pos.y, &pos)) {
switch (content_get_type(h)) { browser_window_get_contextual_content(bw,
case CONTENT_HTML: { pos.x, pos.y, &cont);
struct box *box; h = cont.main;
box = box_object_at_point(h, pos.x, pos.y);
current_menu_object = box ? box->object : NULL; current_menu_object = cont.object;
box = box_href_at_point(h, pos.x, pos.y); current_menu_url = cont.link_url;
current_menu_url = box ? box->href : NULL;
}
break;
case CONTENT_TEXTPLAIN:
/* no object, no url */
break;
default:
current_menu_object = h;
break;
}
} }
} }