NetSurf
gui_menu.h
Go to the documentation of this file.
1/*
2 * Copyright 2008-2024 Chris Young <chris@unsatisfactorysoftware.co.uk>
3 *
4 * This file is part of NetSurf, http://www.netsurf-browser.org/
5 *
6 * NetSurf is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * NetSurf is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19#ifndef AMIGA_GUI_MENU_H
20#define AMIGA_GUI_MENU_H
21
22/** Maximum number of hotlist items (somewhat arbitrary value) */
23#define AMI_HOTLIST_ITEMS 200
24
25/** Maximum number of ARexx menu items (somewhat arbitrary value) */
26#define AMI_MENU_AREXX_ITEMS 20
27
28/** enum menu structure, has to be here as we need it below. */
29enum {
30 /* Project menu */
41#ifdef WITH_PDF_EXPORT
42 M_SAVEPDF,
43#endif
53 /* Edit menu */
64 /* Browser menu */
84 /* Hotlist menu */
88 M_BAR_H1, // 48
89 AMI_MENU_HOTLIST, /* Where the hotlist entries start */
91 /* Settings menu */
97 /* ARexx menu */
104
105/* We can get away with AMI_MENU_MAX falling short as it is
106 * only used for freeing the UTF-8 converted menu labels */
107#define AMI_MENU_MAX AMI_MENU_AREXX
108
109struct gui_window;
110struct gui_window_2;
111struct hlcache_handle;
112struct Window;
113struct ami_menu_data;
114
115ULONG ami_gui_menu_number(int item);
116struct Menu *ami_gui_menu_create(struct gui_window_2 *gwin);
117void ami_gui_menu_free(struct gui_window_2 *gwin);
118
121
122/**
123 * Sets that an item linked to a toggle menu item has been changed.
124 */
126
127/**
128 * Gets if the menu needs updating because an item linked
129 * to a toggle menu item has been changed.
130 * NB: This also *clears* the state
131 *
132 * \return true if the menus need refreshing
133 */
135
136/**
137 * Set checked state of a menu item
138 * almost generic, but not quite
139 */
140void ami_gui_menu_set_checked(struct Menu *menu, int item, bool check);
141
142/**
143 * Set disabled state of a menu item
144 * almost generic, but not quite
145 */
146void ami_gui_menu_set_disabled(struct Window *win, struct Menu *menu, int item, bool disable);
147
148/**
149 * Refresh the Hotlist menu
150 */
152
153/**
154 * Gets if NetSurf has been quit from the menu
155 *
156 * \return true if NetSurf has been quit
157 */
159
160/**
161 * Frees a menu. Only used on OS3 and old OS4.
162 */
163void ami_gui_menu_freemenus(struct Menu *menu, struct ami_menu_data **md);
164#endif
165
void ami_gui_menu_update_checked(struct gui_window_2 *gwin)
Definition: gui_menu.c:691
void ami_gui_menu_refresh_hotlist(void)
Refresh the Hotlist menu.
Definition: gui_menu.c:1163
void ami_gui_menu_update_disabled(struct gui_window *g, struct hlcache_handle *c)
Definition: gui_menu.c:735
struct Menu * ami_gui_menu_create(struct gui_window_2 *gwin)
Definition: gui_menu.c:1062
void ami_gui_menu_set_check_toggled(void)
Sets that an item linked to a toggle menu item has been changed.
Definition: gui_menu.c:808
bool ami_gui_menu_get_check_toggled(void)
Gets if the menu needs updating because an item linked to a toggle menu item has been changed.
Definition: gui_menu.c:818
void ami_gui_menu_freemenus(struct Menu *menu, struct ami_menu_data **md)
Frees a menu.
Definition: gui_menu.c:1127
bool ami_gui_menu_quit_selected(void)
Gets if NetSurf has been quit from the menu.
Definition: gui_menu.c:1158
ULONG ami_gui_menu_number(int item)
Definition: gui_menu.c:528
void ami_gui_menu_free(struct gui_window_2 *gwin)
Definition: gui_menu.c:1138
void ami_gui_menu_set_disabled(struct Window *win, struct Menu *menu, int item, bool disable)
Set disabled state of a menu item almost generic, but not quite.
Definition: gui_menu.c:679
#define AMI_MENU_AREXX_ITEMS
Maximum number of ARexx menu items (somewhat arbitrary value)
Definition: gui_menu.h:26
void ami_gui_menu_set_checked(struct Menu *menu, int item, bool check)
Set checked state of a menu item almost generic, but not quite.
Definition: gui_menu.c:644
@ M_SAVECOMP
Definition: gui_menu.h:39
@ M_BAR_A1
Definition: gui_menu.h:100
@ AMI_MENU_AREXX
Definition: gui_menu.h:101
@ M_PRSAVE
Definition: gui_menu.h:96
@ AMI_MENU_AREXX_MAX
Definition: gui_menu.h:102
@ M_QUIT
Definition: gui_menu.h:52
@ M_CLOSETAB
Definition: gui_menu.h:47
@ M_HISTGLBL
Definition: gui_menu.h:69
@ M_IMGFORE
Definition: gui_menu.h:78
@ M_SCALEDEC
Definition: gui_menu.h:74
@ M_PASTE
Definition: gui_menu.h:57
@ M_REDO
Definition: gui_menu.h:63
@ M_HISTLOCL
Definition: gui_menu.h:68
@ M_AREXXEX
Definition: gui_menu.h:99
@ M_NEWTAB
Definition: gui_menu.h:33
@ M_BAR_B2
Definition: gui_menu.h:70
@ M_REDRAW
Definition: gui_menu.h:83
@ M_SCALENRM
Definition: gui_menu.h:75
@ M_CLOSEWIN
Definition: gui_menu.h:48
@ M_BAR_E1
Definition: gui_menu.h:58
@ M_HOTLIST
Definition: gui_menu.h:85
@ M_PRINT
Definition: gui_menu.h:45
@ M_BAR_S1
Definition: gui_menu.h:94
@ M_EDIT
Definition: gui_menu.h:54
@ M_SNAPSHOT
Definition: gui_menu.h:95
@ M_IMAGES
Definition: gui_menu.h:77
@ M_HLSHOW
Definition: gui_menu.h:87
@ M_BAR_B1
Definition: gui_menu.h:67
@ M_SAVEIFF
Definition: gui_menu.h:40
@ M_SAVESRC
Definition: gui_menu.h:37
@ M_JS
Definition: gui_menu.h:80
@ M_IMGBACK
Definition: gui_menu.h:79
@ M_BAR_E2
Definition: gui_menu.h:61
@ M_BAR_B3
Definition: gui_menu.h:72
@ M_BAR_P1
Definition: gui_menu.h:34
@ M_PROJECT
Definition: gui_menu.h:31
@ M_BAR_H1
Definition: gui_menu.h:88
@ M_BAR_P2
Definition: gui_menu.h:44
@ M_OPEN
Definition: gui_menu.h:35
@ M_CSS
Definition: gui_menu.h:81
@ M_SELALL
Definition: gui_menu.h:59
@ M_UNDO
Definition: gui_menu.h:62
@ M_CUT
Definition: gui_menu.h:55
@ M_AREXX
Definition: gui_menu.h:98
@ M_PREDIT
Definition: gui_menu.h:93
@ M_NEWWIN
Definition: gui_menu.h:32
@ M_BROWSER
Definition: gui_menu.h:65
@ M_COOKIES
Definition: gui_menu.h:71
@ M_SCALE
Definition: gui_menu.h:73
@ M_CLEAR
Definition: gui_menu.h:60
@ M_ABOUT
Definition: gui_menu.h:50
@ M_BAR_P5
Definition: gui_menu.h:51
@ M_BAR_P4
Definition: gui_menu.h:49
@ M_FIND
Definition: gui_menu.h:66
@ M_SAVETXT
Definition: gui_menu.h:38
@ M_COPY
Definition: gui_menu.h:56
@ M_SCALEINC
Definition: gui_menu.h:76
@ AMI_MENU_HOTLIST_MAX
Definition: gui_menu.h:90
@ M_SAVEAS
Definition: gui_menu.h:36
@ M_BAR_B4
Definition: gui_menu.h:82
@ AMI_MENU_HOTLIST
Definition: gui_menu.h:89
@ M_HLADD
Definition: gui_menu.h:86
@ M_BAR_P3
Definition: gui_menu.h:46
@ M_PREFS
Definition: gui_menu.h:92
#define AMI_HOTLIST_ITEMS
Maximum number of hotlist items (somewhat arbitrary value)
Definition: gui_menu.h:23
first entry in window list
Definition: gui.c:297
High-level cache handle.
Definition: hlcache.c:66