Restructure gui_window and gui_window_2 to avoid accessing browser_window to find out which gui_window is currently displayed.

This commit is contained in:
Chris Young 2014-11-16 15:02:33 +00:00
commit 12d25c56af
11 changed files with 302 additions and 320 deletions

View File

@ -152,7 +152,7 @@ static struct browser_window *ami_find_tab_gwin(struct gui_window_2 *gwin, int t
struct Node *ntab;
struct browser_window *bw;
if((tab == 0) || (gwin->tabs == 0)) return gwin->bw;
if((tab == 0) || (gwin->tabs == 0)) return gwin->gw->bw;
ctab = GetHead(&gwin->tab_list);
@ -573,7 +573,7 @@ STATIC VOID rx_active(struct ARexxCmd *cmd, struct RexxMsg *rxm __attribute__((u
if(node->Type == AMINS_WINDOW)
{
windows++;
if(gwin->bw == bw)
if(gwin->gw->bw == bw)
{
window = windows;
break;

View File

@ -89,7 +89,7 @@ void gui_start_selection(struct gui_window *g)
OnMenu(g->shared->win, AMI_MENU_CLEAR);
OnMenu(g->shared->win, AMI_MENU_COPY);
if (browser_window_get_editor_flags(g->shared->bw) & BW_EDITOR_CAN_CUT)
if (browser_window_get_editor_flags(g->bw) & BW_EDITOR_CAN_CUT)
OnMenu(g->shared->win, AMI_MENU_CUT);
}
@ -285,9 +285,9 @@ void ami_drag_selection(struct gui_window *g)
{
iffh = ami_clipboard_init_internal(1);
browser_window_key_press(g->shared->bw, KEY_COPY_SELECTION);
browser_window_mouse_click(gwin->bw, BROWSER_MOUSE_PRESS_1, x, y);
browser_window_key_press(gwin->bw, KEY_PASTE);
browser_window_key_press(g->bw, KEY_COPY_SELECTION);
browser_window_mouse_click(gwin->gw->bw, BROWSER_MOUSE_PRESS_1, x, y);
browser_window_key_press(gwin->gw->bw, KEY_PASTE);
ami_clipboard_free_internal(iffh);
iffh = old_iffh;
@ -299,7 +299,7 @@ void ami_drag_selection(struct gui_window *g)
if(ami_gadget_hit(gwin->objects[GID_URL], x, y))
{
if((sel = browser_window_get_selection(g->shared->bw)))
if((sel = browser_window_get_selection(g->bw)))
{
utf8text = ami_utf8_easy(sel);
RefreshSetGadgetAttrs((struct Gadget *)gwin->objects[GID_URL],
@ -310,7 +310,7 @@ void ami_drag_selection(struct gui_window *g)
}
else if(ami_gadget_hit(gwin->objects[GID_SEARCHSTRING], x, y))
{
if((sel = browser_window_get_selection(g->shared->bw)))
if((sel = browser_window_get_selection(g->bw)))
{
utf8text = ami_utf8_easy(sel);
RefreshSetGadgetAttrs((struct Gadget *)gwin->objects[GID_SEARCHSTRING],

View File

@ -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,

View File

@ -134,7 +134,7 @@ static struct gui_download_window *gui_download_window_create(download_context *
if(dl_filename) ami_utf8_free(dl_filename);
dw->size = total_size;
dw->downloaded = 0;
if(gui) dw->bw = gui->shared->bw;
if(gui) dw->bw = gui->bw;
dw->url = url;
va[0] = (APTR)dw->downloaded;

View File

@ -165,7 +165,7 @@ void ami_drag_save(struct Window *win)
case GUI_SAVE_TEXT_SELECTION: // selection
AddPart(path,"netsurf_text_selection",1024);
struct gui_window *g = (struct gui_window *) drag_save_data;
ami_file_save(AMINS_SAVE_SELECTION, path, win, NULL, NULL, g->shared->bw);
ami_file_save(AMINS_SAVE_SELECTION, path, win, NULL, NULL, g->bw);
break;
case GUI_SAVE_COMPLETE:

View File

@ -98,7 +98,7 @@ void ami_file_open(struct gui_window_2 *gwin)
if (netsurf_path_to_nsurl(temp, &url) != NSERROR_OK) {
warn_user("NoMemory", 0);
} else {
browser_window_navigate(gwin->bw,
browser_window_navigate(gwin->gw->bw,
url,
NULL,
BW_NAVIGATE_HISTORY,
@ -235,7 +235,7 @@ void ami_file_save_req(int type, struct gui_window_2 *gwin,
strlcpy(fname, savereq->fr_Drawer, 1024);
AddPart(fname, savereq->fr_File, 1024);
ami_file_save(type, fname, gwin->win, object, gwin->bw->window->favicon, gwin->bw);
ami_file_save(type, fname, gwin->win, object, gwin->gw->favicon, gwin->gw->bw);
}
if(fname) FreeVec(fname);

File diff suppressed because it is too large Load Diff

View File

@ -85,7 +85,7 @@ struct gui_window_2 {
struct nsObject *node;
struct Window *win;
Object *objects[GID_LAST];
struct browser_window *bw;
struct gui_window *gw; /* currently-displayed gui_window */
bool redraw_required;
int throbber_frame;
struct List tab_list;
@ -151,6 +151,7 @@ struct gui_window
bool throbbing;
char *tabtitle;
struct MinList *deferred_rects;
struct browser_window *bw;
};
void ami_get_msg(void);

View File

@ -687,7 +687,7 @@ void ami_menu_update_disabled(struct gui_window *g, hlcache_handle *c)
#ifdef WITH_PDF_EXPORT
OnMenu(win,AMI_MENU_SAVEAS_PDF);
#endif
if(browser_window_get_editor_flags(g->shared->bw) & BW_EDITOR_CAN_COPY)
if(browser_window_get_editor_flags(g->bw) & BW_EDITOR_CAN_COPY)
{
OnMenu(win,AMI_MENU_COPY);
OnMenu(win,AMI_MENU_CLEAR);
@ -696,12 +696,12 @@ void ami_menu_update_disabled(struct gui_window *g, hlcache_handle *c)
OffMenu(win,AMI_MENU_CLEAR);
}
if(browser_window_get_editor_flags(g->shared->bw) & BW_EDITOR_CAN_CUT)
if(browser_window_get_editor_flags(g->bw) & BW_EDITOR_CAN_CUT)
OnMenu(win,AMI_MENU_CUT);
else
OffMenu(win,AMI_MENU_CUT);
if(browser_window_get_editor_flags(g->shared->bw) & BW_EDITOR_CAN_PASTE)
if(browser_window_get_editor_flags(g->bw) & BW_EDITOR_CAN_PASTE)
OnMenu(win,AMI_MENU_PASTE);
else
OffMenu(win,AMI_MENU_PASTE);
@ -788,7 +788,7 @@ static void ami_menu_item_project_save(struct Hook *hook, APTR window, struct In
GetAttr(WINDOW_UserData, (Object *)window, (ULONG *)&gwin);
ami_file_save_req(type, gwin, gwin->bw->current_content);
ami_file_save_req(type, gwin, gwin->gw->bw->current_content);
}
static void ami_menu_item_project_closetab(struct Hook *hook, APTR window, struct IntuiMessage *msg)
@ -796,7 +796,7 @@ static void ami_menu_item_project_closetab(struct Hook *hook, APTR window, struc
struct gui_window_2 *gwin;
GetAttr(WINDOW_UserData, (Object *)window, (ULONG *)&gwin);
browser_window_destroy(gwin->bw);
browser_window_destroy(gwin->gw->bw);
}
static void ami_menu_item_project_closewin(struct Hook *hook, APTR window, struct IntuiMessage *msg)
@ -813,7 +813,7 @@ static void ami_menu_item_project_print(struct Hook *hook, APTR window, struct I
GetAttr(WINDOW_UserData, (Object *)window, (ULONG *)&gwin);
ami_set_pointer(gwin, GUI_POINTER_WAIT, false);
ami_print_ui(gwin->bw->current_content);
ami_print_ui(gwin->gw->bw->current_content);
ami_reset_pointer(gwin);
}
@ -880,7 +880,7 @@ static void ami_menu_item_edit_cut(struct Hook *hook, APTR window, struct IntuiM
struct gui_window_2 *gwin;
GetAttr(WINDOW_UserData, (Object *)window, (ULONG *)&gwin);
browser_window_key_press(gwin->bw, KEY_CUT_SELECTION);
browser_window_key_press(gwin->gw->bw, KEY_CUT_SELECTION);
}
static void ami_menu_item_edit_copy(struct Hook *hook, APTR window, struct IntuiMessage *msg)
@ -889,22 +889,22 @@ static void ami_menu_item_edit_copy(struct Hook *hook, APTR window, struct Intui
struct gui_window_2 *gwin;
GetAttr(WINDOW_UserData, (Object *)window, (ULONG *)&gwin);
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);
if(content_get_type(gwin->gw->bw->current_content) <= CONTENT_CSS) {
browser_window_key_press(gwin->gw->bw, KEY_COPY_SELECTION);
browser_window_key_press(gwin->gw->bw, KEY_CLEAR_SELECTION);
}
else if((bm = content_get_bitmap(gwin->bw->current_content))) {
else if((bm = content_get_bitmap(gwin->gw->bw->current_content))) {
/** @todo It should be checked that the lifetime of
* the objects containing the values returned (and the
* constness cast away) is safe.
*/
bm->url = (char *)nsurl_access(browser_window_get_url(gwin->bw));
bm->title = (char *)browser_window_get_title(gwin->bw);
bm->url = (char *)nsurl_access(browser_window_get_url(gwin->gw->bw));
bm->title = (char *)browser_window_get_title(gwin->gw->bw);
ami_easy_clipboard_bitmap(bm);
}
#ifdef WITH_NS_SVG
else if(ami_mime_compare(gwin->bw->current_content, "svg") == true) {
ami_easy_clipboard_svg(gwin->bw->current_content);
else if(ami_mime_compare(gwin->gw->bw->current_content, "svg") == true) {
ami_easy_clipboard_svg(gwin->gw->bw->current_content);
}
#endif
}
@ -914,7 +914,7 @@ static void ami_menu_item_edit_paste(struct Hook *hook, APTR window, struct Intu
struct gui_window_2 *gwin;
GetAttr(WINDOW_UserData, (Object *)window, (ULONG *)&gwin);
browser_window_key_press(gwin->bw, KEY_PASTE);
browser_window_key_press(gwin->gw->bw, KEY_PASTE);
}
static void ami_menu_item_edit_selectall(struct Hook *hook, APTR window, struct IntuiMessage *msg)
@ -922,8 +922,8 @@ static void ami_menu_item_edit_selectall(struct Hook *hook, APTR window, struct
struct gui_window_2 *gwin;
GetAttr(WINDOW_UserData, (Object *)window, (ULONG *)&gwin);
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);
}
static void ami_menu_item_edit_clearsel(struct Hook *hook, APTR window, struct IntuiMessage *msg)
@ -931,7 +931,7 @@ static void ami_menu_item_edit_clearsel(struct Hook *hook, APTR window, struct I
struct gui_window_2 *gwin;
GetAttr(WINDOW_UserData, (Object *)window, (ULONG *)&gwin);
browser_window_key_press(gwin->bw, KEY_CLEAR_SELECTION);
browser_window_key_press(gwin->gw->bw, KEY_CLEAR_SELECTION);
}
static void ami_menu_item_edit_undo(struct Hook *hook, APTR window, struct IntuiMessage *msg)
@ -939,7 +939,7 @@ static void ami_menu_item_edit_undo(struct Hook *hook, APTR window, struct Intui
struct gui_window_2 *gwin;
GetAttr(WINDOW_UserData, (Object *)window, (ULONG *)&gwin);
browser_window_key_press(gwin->bw, KEY_UNDO);
browser_window_key_press(gwin->gw->bw, KEY_UNDO);
}
static void ami_menu_item_edit_redo(struct Hook *hook, APTR window, struct IntuiMessage *msg)
@ -947,7 +947,7 @@ static void ami_menu_item_edit_redo(struct Hook *hook, APTR window, struct Intui
struct gui_window_2 *gwin;
GetAttr(WINDOW_UserData, (Object *)window, (ULONG *)&gwin);
browser_window_key_press(gwin->bw, KEY_REDO);
browser_window_key_press(gwin->gw->bw, KEY_REDO);
}
static void ami_menu_item_browser_find(struct Hook *hook, APTR window, struct IntuiMessage *msg)
@ -955,7 +955,7 @@ static void ami_menu_item_browser_find(struct Hook *hook, APTR window, struct In
struct gui_window_2 *gwin;
GetAttr(WINDOW_UserData, (Object *)window, (ULONG *)&gwin);
ami_search_open(gwin->bw->window);
ami_search_open(gwin->gw->bw->window);
}
static void ami_menu_item_browser_localhistory(struct Hook *hook, APTR window, struct IntuiMessage *msg)
@ -963,8 +963,8 @@ static void ami_menu_item_browser_localhistory(struct Hook *hook, APTR window, s
struct gui_window_2 *gwin;
GetAttr(WINDOW_UserData, (Object *)window, (ULONG *)&gwin);
if(gwin->bw && gwin->bw->history)
ami_history_open(gwin->bw, gwin->bw->history);
if(gwin->gw->bw && gwin->gw->bw->history)
ami_history_open(gwin->gw->bw, gwin->gw->bw->history);
}
static void ami_menu_item_browser_globalhistory(struct Hook *hook, APTR window, struct IntuiMessage *msg)
@ -1018,8 +1018,8 @@ static void ami_menu_item_browser_scale_decrease(struct Hook *hook, APTR window,
struct gui_window_2 *gwin;
GetAttr(WINDOW_UserData, (Object *)window, (ULONG *)&gwin);
if(browser_window_get_scale(gwin->bw) > 0.1)
browser_window_set_scale(gwin->bw, browser_window_get_scale(gwin->bw) - 0.1, false);
if(browser_window_get_scale(gwin->gw->bw) > 0.1)
browser_window_set_scale(gwin->gw->bw, browser_window_get_scale(gwin->gw->bw) - 0.1, false);
}
static void ami_menu_item_browser_scale_normal(struct Hook *hook, APTR window, struct IntuiMessage *msg)
@ -1027,7 +1027,7 @@ static void ami_menu_item_browser_scale_normal(struct Hook *hook, APTR window, s
struct gui_window_2 *gwin;
GetAttr(WINDOW_UserData, (Object *)window, (ULONG *)&gwin);
browser_window_set_scale(gwin->bw, 1.0, false);
browser_window_set_scale(gwin->gw->bw, 1.0, false);
}
static void ami_menu_item_browser_scale_increase(struct Hook *hook, APTR window, struct IntuiMessage *msg)
@ -1035,7 +1035,7 @@ static void ami_menu_item_browser_scale_increase(struct Hook *hook, APTR window,
struct gui_window_2 *gwin;
GetAttr(WINDOW_UserData, (Object *)window, (ULONG *)&gwin);
browser_window_set_scale(gwin->bw, browser_window_get_scale(gwin->bw) + 0.1, false);
browser_window_set_scale(gwin->gw->bw, browser_window_get_scale(gwin->gw->bw) + 0.1, false);
}
static void ami_menu_item_browser_redraw(struct Hook *hook, APTR window, struct IntuiMessage *msg)
@ -1053,7 +1053,7 @@ static void ami_menu_item_hotlist_add(struct Hook *hook, APTR window, struct Int
struct gui_window_2 *gwin;
GetAttr(WINDOW_UserData, (Object *)window, (ULONG *)&gwin);
bw = gwin->bw;
bw = gwin->gw->bw;
if (bw == NULL || bw->current_content == NULL ||
nsurl_access(hlcache_handle_get_url(bw->current_content)) == NULL)
@ -1076,7 +1076,7 @@ static void ami_menu_item_hotlist_entries(struct Hook *hook, APTR window, struct
if(url == NULL) return;
browser_window_navigate(gwin->bw,
browser_window_navigate(gwin->gw->bw,
url,
NULL,
BW_NAVIGATE_HISTORY,

View File

@ -94,7 +94,7 @@ void ami_search_open(struct gui_window *gwin)
if(fwin)
{
browser_window_search_clear(fwin->gwin->shared->bw);
browser_window_search_clear(fwin->gwin->bw);
fwin->gwin->shared->searchwin = NULL;
fwin->gwin = gwin;
gwin->shared->searchwin = fwin;
@ -179,7 +179,7 @@ void ami_search_open(struct gui_window *gwin)
void ami_search_close(void)
{
browser_window_search_clear(fwin->gwin->shared->bw);
browser_window_search_clear(fwin->gwin->bw);
fwin->gwin->shared->searchwin = NULL;
DisposeObject(fwin->objects[OID_MAIN]);
DelObject(fwin->node);
@ -201,7 +201,7 @@ BOOL ami_search_event(void)
switch(result & WMHI_GADGETMASK)
{
case GID_SEARCHSTRING:
browser_window_search_clear(fwin->gwin->shared->bw);
browser_window_search_clear(fwin->gwin->bw);
RefreshSetGadgetAttrs((struct Gadget *)fwin->objects[GID_PREV],
fwin->win, NULL,
@ -220,7 +220,7 @@ BOOL ami_search_event(void)
flags = SEARCH_FLAG_FORWARDS |
ami_search_flags();
browser_window_search(
fwin->gwin->shared->bw,
fwin->gwin->bw,
NULL,
flags, ami_search_string());
ActivateWindow(fwin->gwin->shared->win);
@ -231,7 +231,7 @@ BOOL ami_search_event(void)
flags = ~SEARCH_FLAG_FORWARDS &
ami_search_flags();
browser_window_search(
fwin->gwin->shared->bw,
fwin->gwin->bw,
NULL,
flags, ami_search_string());
ActivateWindow(fwin->gwin->shared->win);

View File

@ -489,7 +489,7 @@ static void ami_tree_drag_end(struct treeview_window *twin, int x, int y)
DisplayBeep(scrn);
} else if(url) {
if((gwin = ami_window_at_pointer(AMINS_WINDOW))) {
browser_window_navigate(gwin->bw,
browser_window_navigate(gwin->gw->bw,
url,
NULL,
BW_NAVIGATE_HISTORY,