diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2014-10-16 12:39:31 +0100 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2014-10-16 12:39:31 +0100 |
commit | 63645c4c322a392e6d5a72f34534a515653bac32 (patch) | |
tree | 601abafec7c3bf16f966260a738a02b2ad1e45e5 | |
parent | f4bac1e7df6fa5d9595d6852d986ba0b2b5366d7 (diff) | |
download | netsurf-63645c4c322a392e6d5a72f34534a515653bac32.tar.gz netsurf-63645c4c322a392e6d5a72f34534a515653bac32.tar.bz2 |
Fix core create_form_select_menu API to pass gw, rather than bw out to front ends.
-rw-r--r-- | amiga/context_menu.c | 6 | ||||
-rwxr-xr-x | amiga/context_menu.h | 2 | ||||
-rw-r--r-- | cocoa/gui.m | 4 | ||||
-rw-r--r-- | desktop/gui.h | 6 | ||||
-rw-r--r-- | desktop/gui_factory.c | 2 | ||||
-rw-r--r-- | gtk/gui.c | 2 | ||||
-rw-r--r-- | render/html_interaction.c | 8 | ||||
-rw-r--r-- | riscos/gui.h | 2 | ||||
-rw-r--r-- | riscos/window.c | 10 |
9 files changed, 24 insertions, 18 deletions
diff --git a/amiga/context_menu.c b/amiga/context_menu.c index b85824f2c..5e35f5d0e 100644 --- a/amiga/context_menu.c +++ b/amiga/context_menu.c @@ -1281,7 +1281,7 @@ static uint32 ami_popup_hook(struct Hook *hook,Object *item,APTR reserved) return itemid; } -void gui_create_form_select_menu(struct browser_window *bw, +void gui_create_form_select_menu(struct gui_window *g, struct form_control *control) { /* TODO: PMIA_Title memory leaks as we don't free the strings. @@ -1289,7 +1289,7 @@ void gui_create_form_select_menu(struct browser_window *bw, * improves we will probably start using this again. */ - struct gui_window *gwin = bw->window; + struct gui_window *gwin = g; struct form_option *opt = control->data.select.items; ULONG i = 0; @@ -1343,7 +1343,7 @@ void ami_context_menu_show(struct gui_window_2 *gwin, int x, int y) { } -void gui_create_form_select_menu(struct browser_window *bw, +void gui_create_form_select_menu(struct gui_window *g, struct form_control *control) { } diff --git a/amiga/context_menu.h b/amiga/context_menu.h index 69ccdff68..1bd7a84de 100755 --- a/amiga/context_menu.h +++ b/amiga/context_menu.h @@ -28,6 +28,6 @@ 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); void ami_context_menu_show_tree(struct tree *tree, struct Window *win, int type); -void gui_create_form_select_menu(struct browser_window *bw, struct form_control *control); +void gui_create_form_select_menu(struct gui_window *g, struct form_control *control); #endif diff --git a/cocoa/gui.m b/cocoa/gui.m index 33bd6f0a3..467805aa1 100644 --- a/cocoa/gui.m +++ b/cocoa/gui.m @@ -244,10 +244,10 @@ static void gui_window_new_content(struct gui_window *g) } -static void gui_create_form_select_menu(struct browser_window *bw, +static void gui_create_form_select_menu(struct gui_window *g, struct form_control *control) { - FormSelectMenu *menu = [[FormSelectMenu alloc] initWithControl: control forWindow: bw]; + FormSelectMenu *menu = [[FormSelectMenu alloc] initWithControl: control forWindow: g->bw]; [menu runInView: [(BrowserViewController *)bw->window browserView]]; [menu release]; } diff --git a/desktop/gui.h b/desktop/gui.h index 528f0c6d0..83e857474 100644 --- a/desktop/gui.h +++ b/desktop/gui.h @@ -497,8 +497,12 @@ struct gui_browser_table { /** * create a form select menu + * + * \param g gui window containing form control + * \param control form control of type GADGET_SELECT */ - void (*create_form_select_menu)(struct browser_window *bw, struct form_control *control); + void (*create_form_select_menu)(struct gui_window *g, + struct form_control *control); /** * verify certificate diff --git a/desktop/gui_factory.c b/desktop/gui_factory.c index 9ce868235..b978210e8 100644 --- a/desktop/gui_factory.c +++ b/desktop/gui_factory.c @@ -532,7 +532,7 @@ static nserror gui_default_launch_url(struct nsurl *url) return NSERROR_NO_FETCH_HANDLER; } -static void gui_default_create_form_select_menu(struct browser_window *bw, +static void gui_default_create_form_select_menu(struct gui_window *g, struct form_control *control) { } @@ -564,7 +564,7 @@ static void nsgtk_select_menu_clicked(GtkCheckMenuItem *checkmenuitem, (intptr_t)user_data); } -static void gui_create_form_select_menu(struct browser_window *bw, +static void gui_create_form_select_menu(struct gui_window *g, struct form_control *control) { diff --git a/render/html_interaction.c b/render/html_interaction.c index 0d05485f2..72ab22d81 100644 --- a/render/html_interaction.c +++ b/render/html_interaction.c @@ -656,8 +656,12 @@ void html_mouse_action(struct content *c, struct browser_window *bw, form_select_menu_callback, c); pointer = BROWSER_POINTER_DEFAULT; - } else if (mouse & BROWSER_MOUSE_CLICK_1) - guit->browser->create_form_select_menu(bw, gadget); + } else if (mouse & BROWSER_MOUSE_CLICK_1) { + struct browser_window *rbw = + browser_window_get_root(bw); + guit->browser->create_form_select_menu( + rbw->window, gadget); + } break; case GADGET_CHECKBOX: status = messages_get("FormCheckbox"); diff --git a/riscos/gui.h b/riscos/gui.h index 11c2cf995..e4a99ebc5 100644 --- a/riscos/gui.h +++ b/riscos/gui.h @@ -158,7 +158,7 @@ bool ro_gui_shift_pressed(void); bool ro_gui_ctrl_pressed(void); bool ro_gui_alt_pressed(void); void gui_window_set_pointer(struct gui_window *g, enum gui_pointer_shape shape); -void gui_create_form_select_menu(struct browser_window *bw, struct form_control *control); +void gui_create_form_select_menu(struct gui_window *g, struct form_control *control); /* in history.c */ void ro_gui_history_init(void); diff --git a/riscos/window.c b/riscos/window.c index a978ccbd6..3dffd1cb6 100644 --- a/riscos/window.c +++ b/riscos/window.c @@ -1354,25 +1354,23 @@ void gui_window_set_extent(struct gui_window *g, int width, int height) /** * Display a menu of options for a form select control. * - * \param bw browser window containing form control + * \param g gui window containing form control * \param control form control of type GADGET_SELECT */ -void gui_create_form_select_menu(struct browser_window *bw, +void gui_create_form_select_menu(struct gui_window *g, struct form_control *control) { os_error *error; wimp_pointer pointer; - bw = browser_window_get_root(bw); - /* The first time the menu is opened, control bypasses the normal * Menu Prepare event and so we prepare here. On any re-opens, * ro_gui_window_prepare_form_select_menu() is called from the * normal wimp event. */ - if (!ro_gui_window_prepare_form_select_menu(bw->window, control)) + if (!ro_gui_window_prepare_form_select_menu(g, control)) return; error = xwimp_get_pointer_info(&pointer); @@ -1386,7 +1384,7 @@ void gui_create_form_select_menu(struct browser_window *bw, gui_form_select_control = control; ro_gui_menu_create(gui_form_select_menu, - pointer.pos.x, pointer.pos.y, bw->window->window); + pointer.pos.x, pointer.pos.y, g->window); } |