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 */
96 /* ARexx menu */
103
104/* We can get away with AMI_MENU_MAX falling short as it is
105 * only used for freeing the UTF-8 converted menu labels */
106#define AMI_MENU_MAX AMI_MENU_AREXX
107
108struct gui_window;
109struct gui_window_2;
110struct hlcache_handle;
111struct Window;
112struct ami_menu_data;
113
114ULONG ami_gui_menu_number(int item);
115struct Menu *ami_gui_menu_create(struct gui_window_2 *gwin);
116void ami_gui_menu_free(struct gui_window_2 *gwin);
117
120
121/**
122 * Sets that an item linked to a toggle menu item has been changed.
123 */
125
126/**
127 * Gets if the menu needs updating because an item linked
128 * to a toggle menu item has been changed.
129 * NB: This also *clears* the state
130 *
131 * \return true if the menus need refreshing
132 */
134
135/**
136 * Set checked state of a menu item
137 * almost generic, but not quite
138 */
139void ami_gui_menu_set_checked(struct Menu *menu, int item, bool check);
140
141/**
142 * Set disabled state of a menu item
143 * almost generic, but not quite
144 */
145void ami_gui_menu_set_disabled(struct Window *win, struct Menu *menu, int item, bool disable);
146
147/**
148 * Refresh the Hotlist menu
149 */
151
152/**
153 * Gets if NetSurf has been quit from the menu
154 *
155 * \return true if NetSurf has been quit
156 */
158
159/**
160 * Frees a menu. Only used on OS3 and old OS4.
161 */
162void ami_gui_menu_freemenus(struct Menu *menu, struct ami_menu_data **md);
163#endif
164
void ami_gui_menu_update_checked(struct gui_window_2 *gwin)
Definition: gui_menu.c:678
void ami_gui_menu_refresh_hotlist(void)
Refresh the Hotlist menu.
Definition: gui_menu.c:1148
void ami_gui_menu_update_disabled(struct gui_window *g, struct hlcache_handle *c)
Definition: gui_menu.c:722
struct Menu * ami_gui_menu_create(struct gui_window_2 *gwin)
Definition: gui_menu.c:1047
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:795
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:805
void ami_gui_menu_freemenus(struct Menu *menu, struct ami_menu_data **md)
Frees a menu.
Definition: gui_menu.c:1112
bool ami_gui_menu_quit_selected(void)
Gets if NetSurf has been quit from the menu.
Definition: gui_menu.c:1143
ULONG ami_gui_menu_number(int item)
Definition: gui_menu.c:515
void ami_gui_menu_free(struct gui_window_2 *gwin)
Definition: gui_menu.c:1123
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:666
#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:631
@ M_SAVECOMP
Definition: gui_menu.h:39
@ M_BAR_A1
Definition: gui_menu.h:99
@ AMI_MENU_AREXX
Definition: gui_menu.h:100
@ M_PRSAVE
Definition: gui_menu.h:95
@ AMI_MENU_AREXX_MAX
Definition: gui_menu.h:101
@ 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:98
@ 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_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:97
@ 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:298
High-level cache handle.
Definition: hlcache.c:66