summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2019-05-08 17:29:14 +0100
committerChris Young <chris@unsatisfactorysoftware.co.uk>2019-05-08 17:29:14 +0100
commitdf5c18315ff13e215f661eacd2d81e3c0a758e57 (patch)
tree2e515d98cf90eb182566077fadc4e54e47c6c051
parentd0df3fa4b340071fbe54f9e7966f62b873b52b81 (diff)
downloadnetsurf-df5c18315ff13e215f661eacd2d81e3c0a758e57.tar.gz
netsurf-df5c18315ff13e215f661eacd2d81e3c0a758e57.tar.bz2
Pass ptr to clicktab var instead of func calls
-rw-r--r--frontends/amiga/ctxmenu.c8
-rw-r--r--frontends/amiga/ctxmenu.h5
-rw-r--r--frontends/amiga/gui.c2
-rw-r--r--frontends/amiga/gui.h2
4 files changed, 9 insertions, 8 deletions
diff --git a/frontends/amiga/ctxmenu.c b/frontends/amiga/ctxmenu.c
index e9ab0e6b4..92f399fe6 100644
--- a/frontends/amiga/ctxmenu.c
+++ b/frontends/amiga/ctxmenu.c
@@ -586,13 +586,13 @@ struct Menu *ami_ctxmenu_history_create(int direction, struct gui_window_2 *gwin
**************************/
/** Exported interface documented in ctxmenu.h **/
-struct Menu *ami_ctxmenu_clicktab_create(struct gui_window_2 *gwin)
+struct Menu *ami_ctxmenu_clicktab_create(struct gui_window_2 *gwin, Object **clicktab_obj)
{
Object *root_menu;
Object *clicktab;
- if(ami_gui2_get_ctxmenu_clicktab(gwin) != NULL) {
- return (struct Menu *)ami_gui2_get_ctxmenu_clicktab(gwin);
+ if(*clicktab_obj != NULL) {
+ return (struct Menu *)*clicktab_obj;
}
clicktab = MStrip,
@@ -604,7 +604,7 @@ struct Menu *ami_ctxmenu_clicktab_create(struct gui_window_2 *gwin)
MEnd,
MEnd;
- ami_gui2_set_ctxmenu_clicktab(gwin, clicktab);
+ *clicktab_obj = clicktab;
ami_ctxmenu_add_item(root_menu, AMI_CTX_ID_TABNEW, gwin);
ami_ctxmenu_add_item(root_menu, AMI_CTX_ID_TABCLOSE_OTHER, gwin);
diff --git a/frontends/amiga/ctxmenu.h b/frontends/amiga/ctxmenu.h
index 08a5fe582..39a838702 100644
--- a/frontends/amiga/ctxmenu.h
+++ b/frontends/amiga/ctxmenu.h
@@ -75,10 +75,11 @@ struct Menu *ami_ctxmenu_history_create(int direction, struct gui_window_2 *gwin
* Create ClickTab context menu
*
* \param gwin struct gui_window_2 *
- * \returns pointer to menu (for convenience, is also stored in gwin structure)
+ * \param clicktab_obj ptr to memory to hold clicktab menu object
+ * \returns pointer to menu (for convenience)
* The returned pointer MUST be disposed of with DisposeObject before program exit.
*/
-struct Menu *ami_ctxmenu_clicktab_create(struct gui_window_2 *gwin);
+struct Menu *ami_ctxmenu_clicktab_create(struct gui_window_2 *gwin, Object **clicktab_obj);
#else //__amigaos4__
inline void ami_ctxmenu_init(void) {}
diff --git a/frontends/amiga/gui.c b/frontends/amiga/gui.c
index 9832b1d26..1671e9db5 100644
--- a/frontends/amiga/gui.c
+++ b/frontends/amiga/gui.c
@@ -3660,7 +3660,7 @@ static void ami_toggletabbar(struct gui_window_2 *gwin, bool show)
GA_ID, GID_TABS,
GA_RelVerify, TRUE,
GA_Underscore, 13, // disable kb shortcuts
- GA_ContextMenu, ami_ctxmenu_clicktab_create(gwin),
+ GA_ContextMenu, ami_ctxmenu_clicktab_create(gwin, &gwin->clicktab_ctxmenu),
CLICKTAB_Labels, &gwin->tab_list,
CLICKTAB_LabelTruncate, TRUE,
CLICKTAB_CloseImage, gwin->objects[GID_CLOSETAB_BM],
diff --git a/frontends/amiga/gui.h b/frontends/amiga/gui.h
index f45d22e22..e3f0f4330 100644
--- a/frontends/amiga/gui.h
+++ b/frontends/amiga/gui.h
@@ -152,7 +152,7 @@ struct gui_window_2 {
struct Hook throbber_hook;
struct Hook *ctxmenu_hook;
Object *restrict history_ctxmenu[2];
- Object *restrict clicktab_ctxmenu;
+ Object *clicktab_ctxmenu;
gui_drag_type drag_op;
struct IBox *ptr_lock;
struct AppWindow *appwin;