diff options
author | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2019-05-08 00:16:06 +0100 |
---|---|---|
committer | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2019-05-08 00:16:06 +0100 |
commit | 4713e1c8af2e4defbc127150838bd35549038b7b (patch) | |
tree | 3e028473033812e72400ba7b5425c3f3834fd217 /frontends/amiga | |
parent | ca1a519cfad66978c18181b4a544b485f69aee90 (diff) | |
download | netsurf-4713e1c8af2e4defbc127150838bd35549038b7b.tar.gz netsurf-4713e1c8af2e4defbc127150838bd35549038b7b.tar.bz2 |
Accessor for the select menu control pointer
Diffstat (limited to 'frontends/amiga')
-rw-r--r-- | frontends/amiga/gui.c | 18 | ||||
-rw-r--r-- | frontends/amiga/gui.h | 10 | ||||
-rw-r--r-- | frontends/amiga/selectmenu.c | 4 |
3 files changed, 30 insertions, 2 deletions
diff --git a/frontends/amiga/gui.c b/frontends/amiga/gui.c index 55d57d52b..0d7299ffd 100644 --- a/frontends/amiga/gui.c +++ b/frontends/amiga/gui.c @@ -389,6 +389,24 @@ void ami_gui2_set_menu(struct gui_window_2 *gwin, struct Menu *menu) } } +struct form_control *ami_gui_get_control(struct gui_window *gw) +{ + /* TODO: does this need to be in the shared window? */ + assert(gw != NULL); + return gw->shared->control; +} + +/** + * Set control (for select menu) to gui_window + */ +void ami_gui_set_control(struct gui_window *gw, struct form_control *control) +{ + /* TODO: does this need to be in the shared window? */ + assert(gw != NULL); + gw->shared->control = control; +} + + STRPTR ami_locale_langs(int *codeset) { struct Locale *locale; diff --git a/frontends/amiga/gui.h b/frontends/amiga/gui.h index 6877bee9e..d5967de8e 100644 --- a/frontends/amiga/gui.h +++ b/frontends/amiga/gui.h @@ -338,5 +338,15 @@ struct Menu *ami_gui_get_menu(struct gui_window *gw); */ void ami_gui2_set_menu(struct gui_window_2 *gwin, struct Menu *menu); +/** + * Get control (for select menu) from gui_window + */ +struct form_control *ami_gui_get_control(struct gui_window *gw); + +/** + * Set control (for select menu) to gui_window + */ +void ami_gui_set_control(struct gui_window *gw, struct form_control *control); + #endif diff --git a/frontends/amiga/selectmenu.c b/frontends/amiga/selectmenu.c index 06f43ccf7..6fb3cf912 100644 --- a/frontends/amiga/selectmenu.c +++ b/frontends/amiga/selectmenu.c @@ -74,7 +74,7 @@ HOOKF(uint32, ami_popup_hook, Object *, item, APTR) struct gui_window *gwin = hook->h_Data; if(GetAttr(PMIA_ID, item, &itemid)) { - form_select_process_selection(ami_gui_get_gui_window_2(gwin)->control, itemid); + form_select_process_selection(ami_gui_get_control(gwin), itemid); } return itemid; @@ -111,7 +111,7 @@ void gui_create_form_select_menu(struct gui_window *g, selectmenuhook.h_SubEntry = NULL; selectmenuhook.h_Data = g; - ami_gui_get_gui_window_2(g)->control = control; + ami_gui_set_control(g, control); selectmenuobj = PMMENU(form_control_get_name(control)), PMA_MenuHandler, &selectmenuhook, End; |