From 30039a06ee5d35714a10d9405c95142bc7283304 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sun, 16 Nov 2014 14:50:48 +0000 Subject: Fix amiga/context_menu.c for new struct --- amiga/context_menu.c | 80 ++++++++++++++++++++++++++-------------------------- 1 file changed, 40 insertions(+), 40 deletions(-) (limited to 'amiga') diff --git a/amiga/context_menu.c b/amiga/context_menu.c index 2385f1b42..e9d10851f 100644 --- a/amiga/context_menu.c +++ b/amiga/context_menu.c @@ -558,12 +558,12 @@ BOOL ami_context_menu_mouse_trap(struct gui_window_2 *gwin, BOOL trap) if((nsoption_bool(kiosk_mode) == false) && (trap == FALSE)) { - if(browser_window_back_available(gwin->bw) && + if(browser_window_back_available(gwin->gw->bw) && ami_gadget_hit(gwin->objects[GID_BACK], gwin->win->MouseX, gwin->win->MouseY)) trap = TRUE; - if(browser_window_forward_available(gwin->bw) && + if(browser_window_forward_available(gwin->gw->bw) && ami_gadget_hit(gwin->objects[GID_FORWARD], gwin->win->MouseX, gwin->win->MouseY)) trap = TRUE; @@ -579,7 +579,7 @@ BOOL ami_context_menu_mouse_trap(struct gui_window_2 *gwin, BOOL trap) void ami_context_menu_show(struct gui_window_2 *gwin,int x,int y) { - struct hlcache_handle *cc = gwin->bw->current_content; + struct hlcache_handle *cc = gwin->gw->bw->current_content; bool no_more_menus = false; bool menuhascontent = false; struct browser_window_features ccdata; @@ -595,12 +595,12 @@ void ami_context_menu_show(struct gui_window_2 *gwin,int x,int y) PMA_MenuHandler, &ctxmenuhook, TAG_DONE); - if(gwin->bw && gwin->bw->history && + if(gwin->gw->bw && gwin->gw->bw->history && ami_gadget_hit(gwin->objects[GID_BACK], gwin->win->MouseX, gwin->win->MouseY)) { gwin->temp = 0; - browser_window_history_enumerate_back(gwin->bw, ami_context_menu_history, gwin); + browser_window_history_enumerate_back(gwin->gw->bw, ami_context_menu_history, gwin); IDoMethod(ctxmenuobj, PM_INSERT, NewObject(POPUPMENU_GetItemClass(), NULL, @@ -618,12 +618,12 @@ void ami_context_menu_show(struct gui_window_2 *gwin,int x,int y) menuhascontent = true; } - else if(gwin->bw && gwin->bw->history && + else if(gwin->gw->bw && gwin->gw->bw->history && ami_gadget_hit(gwin->objects[GID_FORWARD], gwin->win->MouseX, gwin->win->MouseY)) { gwin->temp = 0; - browser_window_history_enumerate_forward(gwin->bw, ami_context_menu_history, gwin); + browser_window_history_enumerate_forward(gwin->gw->bw, ami_context_menu_history, gwin); IDoMethod(ctxmenuobj, PM_INSERT, NewObject(POPUPMENU_GetItemClass(), NULL, @@ -645,7 +645,7 @@ void ami_context_menu_show(struct gui_window_2 *gwin,int x,int y) { if(no_more_menus == false) { - browser_window_get_features(gwin->bw, x, y, &ccdata); + browser_window_get_features(gwin->gw->bw, x, y, &ccdata); ami_context_menu_add_submenu(ctxmenuobj, CMSUB_PAGE, cc); menuhascontent = true; @@ -673,19 +673,19 @@ void ami_context_menu_show(struct gui_window_2 *gwin,int x,int y) struct ami_file_input_menu_data file_input = { .x = x, .y = y, - .bw = gwin->bw + .bw = gwin->gw->bw }; ami_context_menu_add_submenu(ctxmenuobj, CMID_SELECTFILE, &file_input); menuhascontent = true; } - ami_context_menu_add_submenu(ctxmenuobj, CMSUB_NAVIGATE, gwin->bw); + ami_context_menu_add_submenu(ctxmenuobj, CMSUB_NAVIGATE, gwin->gw->bw); menuhascontent = true; if(content_get_type(cc) == CONTENT_HTML || content_get_type(cc) == CONTENT_TEXTPLAIN) { - ami_context_menu_add_submenu(ctxmenuobj, CMSUB_SEL, gwin->bw); + ami_context_menu_add_submenu(ctxmenuobj, CMSUB_SEL, gwin->gw->bw); menuhascontent = true; } } @@ -693,7 +693,7 @@ void ami_context_menu_show(struct gui_window_2 *gwin,int x,int y) if(!menuhascontent) return; - gui_window_set_pointer(gwin->bw->window, GUI_POINTER_DEFAULT); + gui_window_set_pointer(gwin->gw->bw->window, GUI_POINTER_DEFAULT); IDoMethod(ctxmenuobj, PM_OPEN, gwin->win); } @@ -743,7 +743,7 @@ static uint32 ami_context_menu_hook(struct Hook *hook,Object *item,APTR reserved break; case CMID_PAGECLOSE: - browser_window_destroy(gwin->bw); + browser_window_destroy(gwin->gw->bw); break; case CMID_URLHOTLIST: @@ -770,8 +770,8 @@ static uint32 ami_context_menu_hook(struct Hook *hook,Object *item,APTR reserved if (error == NSERROR_OK) { error = browser_window_create(BW_CREATE_CLONE | BW_CREATE_HISTORY, url, - hlcache_handle_get_url(gwin->bw->current_content), - gwin->bw, + hlcache_handle_get_url(gwin->gw->bw->current_content), + gwin->gw->bw, &bw); nsurl_unref(url); } @@ -788,8 +788,8 @@ static uint32 ami_context_menu_hook(struct Hook *hook,Object *item,APTR reserved if (error == NSERROR_OK) { error = browser_window_create(BW_CREATE_CLONE | BW_CREATE_HISTORY | BW_CREATE_TAB, url, - hlcache_handle_get_url(gwin->bw->current_content), - gwin->bw, + hlcache_handle_get_url(gwin->gw->bw->current_content), + gwin->gw->bw, &bw); nsurl_unref(url); } @@ -806,9 +806,9 @@ static uint32 ami_context_menu_hook(struct Hook *hook,Object *item,APTR reserved if (nsurl_create(userdata, &url) != NSERROR_OK) { warn_user("NoMemory", 0); } else { - browser_window_navigate(gwin->bw, + browser_window_navigate(gwin->gw->bw, url, - hlcache_handle_get_url(gwin->bw->current_content), + hlcache_handle_get_url(gwin->gw->bw->current_content), BW_NAVIGATE_DOWNLOAD, NULL, NULL, @@ -820,9 +820,9 @@ static uint32 ami_context_menu_hook(struct Hook *hook,Object *item,APTR reserved case CMID_FRAMESHOW: case CMID_SHOWOBJ: - browser_window_navigate(gwin->bw, + browser_window_navigate(gwin->gw->bw, hlcache_handle_get_url(userdata), - hlcache_handle_get_url(gwin->bw->current_content), + hlcache_handle_get_url(gwin->gw->bw->current_content), BW_NAVIGATE_HISTORY, NULL, NULL, @@ -836,9 +836,9 @@ static uint32 ami_context_menu_hook(struct Hook *hook,Object *item,APTR reserved if (nsurl_create(userdata, &url) != NSERROR_OK) { warn_user("NoMemory", 0); } else { - browser_window_navigate(gwin->bw, + browser_window_navigate(gwin->gw->bw, url, - hlcache_handle_get_url(gwin->bw->current_content), + hlcache_handle_get_url(gwin->gw->bw->current_content), BW_NAVIGATE_HISTORY, NULL, NULL, @@ -852,7 +852,7 @@ static uint32 ami_context_menu_hook(struct Hook *hook,Object *item,APTR reserved case CMID_RELOADOBJ: object = (struct hlcache_handle *)userdata; content_invalidate_reuse_data(object); - browser_window_reload(gwin->bw, false); + browser_window_reload(gwin->gw->bw, false); break; case CMID_CLIPOBJ: @@ -895,11 +895,11 @@ static uint32 ami_context_menu_hook(struct Hook *hook,Object *item,APTR reserved case CMID_HISTORY: if(userdata == NULL) { - ami_history_open(gwin->bw, gwin->bw->history); + ami_history_open(gwin->gw->bw, gwin->gw->bw->history); } else { - browser_window_history_go(gwin->bw, + browser_window_history_go(gwin->gw->bw, (struct history_entry *)userdata, false); } break; @@ -911,7 +911,7 @@ static uint32 ami_context_menu_hook(struct Hook *hook,Object *item,APTR reserved if (nsurl_create(nsoption_charp(homepage_url), &url) != NSERROR_OK) { warn_user("NoMemory", 0); } else { - browser_window_navigate(gwin->bw, + browser_window_navigate(gwin->gw->bw, url, NULL, BW_NAVIGATE_HISTORY, @@ -933,35 +933,35 @@ static uint32 ami_context_menu_hook(struct Hook *hook,Object *item,APTR reserved break; case CMID_NAVSTOP: - if(browser_window_stop_available(gwin->bw)) - browser_window_stop(gwin->bw); + if(browser_window_stop_available(gwin->gw->bw)) + browser_window_stop(gwin->gw->bw); break; case CMID_NAVRELOAD: - if(browser_window_reload_available(gwin->bw)) - browser_window_reload(gwin->bw, true); + if(browser_window_reload_available(gwin->gw->bw)) + browser_window_reload(gwin->gw->bw, true); break; case CMID_SELCUT: - browser_window_key_press(gwin->bw, KEY_CUT_SELECTION); + browser_window_key_press(gwin->gw->bw, KEY_CUT_SELECTION); break; case CMID_SELCOPY: - browser_window_key_press(gwin->bw, KEY_COPY_SELECTION); - browser_window_key_press(gwin->bw, KEY_CLEAR_SELECTION); + browser_window_key_press(gwin->gw->bw, KEY_COPY_SELECTION); + browser_window_key_press(gwin->gw->bw, KEY_CLEAR_SELECTION); break; case CMID_SELPASTE: - browser_window_key_press(gwin->bw, KEY_PASTE); + browser_window_key_press(gwin->gw->bw, KEY_PASTE); break; case CMID_SELALL: - browser_window_key_press(gwin->bw, KEY_SELECT_ALL); - gui_start_selection(gwin->bw->window); + browser_window_key_press(gwin->gw->bw, KEY_SELECT_ALL); + gui_start_selection(gwin->gw->bw->window); break; case CMID_SELCLEAR: - browser_window_key_press(gwin->bw, KEY_CLEAR_SELECTION); + browser_window_key_press(gwin->gw->bw, KEY_CLEAR_SELECTION); break; case CMID_SELSAVE: @@ -972,7 +972,7 @@ static uint32 ami_context_menu_hook(struct Hook *hook,Object *item,APTR reserved { char *sel; - if((sel = browser_window_get_selection(gwin->bw))) + if((sel = browser_window_get_selection(gwin->gw->bw))) { nserror ret; nsurl *url; @@ -980,7 +980,7 @@ static uint32 ami_context_menu_hook(struct Hook *hook,Object *item,APTR reserved ret = search_web_omni(sel, SEARCH_WEB_OMNI_SEARCHONLY, &url); free(sel); if (ret == NSERROR_OK) { - ret = browser_window_navigate(gwin->bw, + ret = browser_window_navigate(gwin->gw->bw, url, NULL, BW_NAVIGATE_HISTORY, -- cgit v1.2.3