NetSurf
frontends
amiga
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. */
29
enum
{
30
/* Project menu */
31
M_PROJECT
= 0,
32
M_NEWWIN
,
33
M_NEWTAB
,
34
M_BAR_P1
,
35
M_OPEN
,
36
M_SAVEAS
,
37
M_SAVESRC
,
38
M_SAVETXT
,
39
M_SAVECOMP
,
40
M_SAVEIFF
,
41
#ifdef WITH_PDF_EXPORT
42
M_SAVEPDF,
43
#endif
44
M_BAR_P2
,
45
M_PRINT
,
46
M_BAR_P3
,
47
M_CLOSETAB
,
48
M_CLOSEWIN
,
49
M_BAR_P4
,
50
M_ABOUT
,
51
M_BAR_P5
,
52
M_QUIT
,
53
/* Edit menu */
54
M_EDIT
,
55
M_CUT
,
56
M_COPY
,
57
M_PASTE
,
58
M_BAR_E1
,
59
M_SELALL
,
60
M_CLEAR
,
61
M_BAR_E2
,
62
M_UNDO
,
63
M_REDO
,
64
/* Browser menu */
65
M_BROWSER
,
66
M_FIND
,
67
M_BAR_B1
,
68
M_HISTLOCL
,
69
M_HISTGLBL
,
70
M_BAR_B2
,
71
M_COOKIES
,
72
M_BAR_B3
,
73
M_SCALE
,
74
M_SCALEDEC
,
75
M_SCALENRM
,
76
M_SCALEINC
,
77
M_IMAGES
,
78
M_IMGFORE
,
79
M_IMGBACK
,
80
M_JS
,
81
M_CSS
,
82
M_BAR_B4
,
83
M_REDRAW
,
84
/* Hotlist menu */
85
M_HOTLIST
,
86
M_HLADD
,
87
M_HLSHOW
,
88
M_BAR_H1
,
// 48
89
AMI_MENU_HOTLIST
,
/* Where the hotlist entries start */
90
AMI_MENU_HOTLIST_MAX
=
AMI_MENU_HOTLIST
+
AMI_HOTLIST_ITEMS
,
91
/* Settings menu */
92
M_PREFS
,
93
M_PREDIT
,
94
M_BAR_S1
,
95
M_SNAPSHOT
,
96
M_PRSAVE
,
97
/* ARexx menu */
98
M_AREXX
,
99
M_AREXXEX
,
100
M_BAR_A1
,
101
AMI_MENU_AREXX
,
102
AMI_MENU_AREXX_MAX
=
AMI_MENU_AREXX
+
AMI_MENU_AREXX_ITEMS
103
};
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
109
struct
gui_window
;
110
struct
gui_window_2
;
111
struct
hlcache_handle
;
112
struct
Window;
113
struct
ami_menu_data
;
114
115
ULONG
ami_gui_menu_number
(
int
item);
116
struct
Menu *
ami_gui_menu_create
(
struct
gui_window_2
*gwin);
117
void
ami_gui_menu_free
(
struct
gui_window_2
*gwin);
118
119
void
ami_gui_menu_update_checked
(
struct
gui_window_2
*gwin);
120
void
ami_gui_menu_update_disabled
(
struct
gui_window
*g,
struct
hlcache_handle
*c);
121
122
/**
123
* Sets that an item linked to a toggle menu item has been changed.
124
*/
125
void
ami_gui_menu_set_check_toggled
(
void
);
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
*/
134
bool
ami_gui_menu_get_check_toggled
(
void
);
135
136
/**
137
* Set checked state of a menu item
138
* almost generic, but not quite
139
*/
140
void
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
*/
146
void
ami_gui_menu_set_disabled
(
struct
Window *win,
struct
Menu *menu,
int
item,
bool
disable);
147
148
/**
149
* Refresh the Hotlist menu
150
*/
151
void
ami_gui_menu_refresh_hotlist
(
void
);
152
153
/**
154
* Gets if NetSurf has been quit from the menu
155
*
156
* \return true if NetSurf has been quit
157
*/
158
bool
ami_gui_menu_quit_selected
(
void
);
159
160
/**
161
* Frees a menu. Only used on OS3 and old OS4.
162
*/
163
void
ami_gui_menu_freemenus
(
struct
Menu *menu,
struct
ami_menu_data
**md);
164
#endif
165
ami_gui_menu_update_checked
void ami_gui_menu_update_checked(struct gui_window_2 *gwin)
Definition:
gui_menu.c:691
ami_gui_menu_refresh_hotlist
void ami_gui_menu_refresh_hotlist(void)
Refresh the Hotlist menu.
Definition:
gui_menu.c:1163
ami_gui_menu_update_disabled
void ami_gui_menu_update_disabled(struct gui_window *g, struct hlcache_handle *c)
Definition:
gui_menu.c:735
ami_gui_menu_create
struct Menu * ami_gui_menu_create(struct gui_window_2 *gwin)
Definition:
gui_menu.c:1062
ami_gui_menu_set_check_toggled
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
ami_gui_menu_get_check_toggled
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
ami_gui_menu_freemenus
void ami_gui_menu_freemenus(struct Menu *menu, struct ami_menu_data **md)
Frees a menu.
Definition:
gui_menu.c:1127
ami_gui_menu_quit_selected
bool ami_gui_menu_quit_selected(void)
Gets if NetSurf has been quit from the menu.
Definition:
gui_menu.c:1158
ami_gui_menu_number
ULONG ami_gui_menu_number(int item)
Definition:
gui_menu.c:528
ami_gui_menu_free
void ami_gui_menu_free(struct gui_window_2 *gwin)
Definition:
gui_menu.c:1138
ami_gui_menu_set_disabled
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
AMI_MENU_AREXX_ITEMS
#define AMI_MENU_AREXX_ITEMS
Maximum number of ARexx menu items (somewhat arbitrary value)
Definition:
gui_menu.h:26
ami_gui_menu_set_checked
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
@ M_SAVECOMP
Definition:
gui_menu.h:39
M_BAR_A1
@ M_BAR_A1
Definition:
gui_menu.h:100
AMI_MENU_AREXX
@ AMI_MENU_AREXX
Definition:
gui_menu.h:101
M_PRSAVE
@ M_PRSAVE
Definition:
gui_menu.h:96
AMI_MENU_AREXX_MAX
@ AMI_MENU_AREXX_MAX
Definition:
gui_menu.h:102
M_QUIT
@ M_QUIT
Definition:
gui_menu.h:52
M_CLOSETAB
@ M_CLOSETAB
Definition:
gui_menu.h:47
M_HISTGLBL
@ M_HISTGLBL
Definition:
gui_menu.h:69
M_IMGFORE
@ M_IMGFORE
Definition:
gui_menu.h:78
M_SCALEDEC
@ M_SCALEDEC
Definition:
gui_menu.h:74
M_PASTE
@ M_PASTE
Definition:
gui_menu.h:57
M_REDO
@ M_REDO
Definition:
gui_menu.h:63
M_HISTLOCL
@ M_HISTLOCL
Definition:
gui_menu.h:68
M_AREXXEX
@ M_AREXXEX
Definition:
gui_menu.h:99
M_NEWTAB
@ M_NEWTAB
Definition:
gui_menu.h:33
M_BAR_B2
@ M_BAR_B2
Definition:
gui_menu.h:70
M_REDRAW
@ M_REDRAW
Definition:
gui_menu.h:83
M_SCALENRM
@ M_SCALENRM
Definition:
gui_menu.h:75
M_CLOSEWIN
@ M_CLOSEWIN
Definition:
gui_menu.h:48
M_BAR_E1
@ M_BAR_E1
Definition:
gui_menu.h:58
M_HOTLIST
@ M_HOTLIST
Definition:
gui_menu.h:85
M_PRINT
@ M_PRINT
Definition:
gui_menu.h:45
M_BAR_S1
@ M_BAR_S1
Definition:
gui_menu.h:94
M_EDIT
@ M_EDIT
Definition:
gui_menu.h:54
M_SNAPSHOT
@ M_SNAPSHOT
Definition:
gui_menu.h:95
M_IMAGES
@ M_IMAGES
Definition:
gui_menu.h:77
M_HLSHOW
@ M_HLSHOW
Definition:
gui_menu.h:87
M_BAR_B1
@ M_BAR_B1
Definition:
gui_menu.h:67
M_SAVEIFF
@ M_SAVEIFF
Definition:
gui_menu.h:40
M_SAVESRC
@ M_SAVESRC
Definition:
gui_menu.h:37
M_JS
@ M_JS
Definition:
gui_menu.h:80
M_IMGBACK
@ M_IMGBACK
Definition:
gui_menu.h:79
M_BAR_E2
@ M_BAR_E2
Definition:
gui_menu.h:61
M_BAR_B3
@ M_BAR_B3
Definition:
gui_menu.h:72
M_BAR_P1
@ M_BAR_P1
Definition:
gui_menu.h:34
M_PROJECT
@ M_PROJECT
Definition:
gui_menu.h:31
M_BAR_H1
@ M_BAR_H1
Definition:
gui_menu.h:88
M_BAR_P2
@ M_BAR_P2
Definition:
gui_menu.h:44
M_OPEN
@ M_OPEN
Definition:
gui_menu.h:35
M_CSS
@ M_CSS
Definition:
gui_menu.h:81
M_SELALL
@ M_SELALL
Definition:
gui_menu.h:59
M_UNDO
@ M_UNDO
Definition:
gui_menu.h:62
M_CUT
@ M_CUT
Definition:
gui_menu.h:55
M_AREXX
@ M_AREXX
Definition:
gui_menu.h:98
M_PREDIT
@ M_PREDIT
Definition:
gui_menu.h:93
M_NEWWIN
@ M_NEWWIN
Definition:
gui_menu.h:32
M_BROWSER
@ M_BROWSER
Definition:
gui_menu.h:65
M_COOKIES
@ M_COOKIES
Definition:
gui_menu.h:71
M_SCALE
@ M_SCALE
Definition:
gui_menu.h:73
M_CLEAR
@ M_CLEAR
Definition:
gui_menu.h:60
M_ABOUT
@ M_ABOUT
Definition:
gui_menu.h:50
M_BAR_P5
@ M_BAR_P5
Definition:
gui_menu.h:51
M_BAR_P4
@ M_BAR_P4
Definition:
gui_menu.h:49
M_FIND
@ M_FIND
Definition:
gui_menu.h:66
M_SAVETXT
@ M_SAVETXT
Definition:
gui_menu.h:38
M_COPY
@ M_COPY
Definition:
gui_menu.h:56
M_SCALEINC
@ M_SCALEINC
Definition:
gui_menu.h:76
AMI_MENU_HOTLIST_MAX
@ AMI_MENU_HOTLIST_MAX
Definition:
gui_menu.h:90
M_SAVEAS
@ M_SAVEAS
Definition:
gui_menu.h:36
M_BAR_B4
@ M_BAR_B4
Definition:
gui_menu.h:82
AMI_MENU_HOTLIST
@ AMI_MENU_HOTLIST
Definition:
gui_menu.h:89
M_HLADD
@ M_HLADD
Definition:
gui_menu.h:86
M_BAR_P3
@ M_BAR_P3
Definition:
gui_menu.h:46
M_PREFS
@ M_PREFS
Definition:
gui_menu.h:92
AMI_HOTLIST_ITEMS
#define AMI_HOTLIST_ITEMS
Maximum number of hotlist items (somewhat arbitrary value)
Definition:
gui_menu.h:23
ami_menu_data
Definition:
menu.h:26
gui_window_2
Definition:
gui.c:246
gui_window
first entry in window list
Definition:
gui.c:298
hlcache_handle
High-level cache handle.
Definition:
hlcache.c:66
Generated on Fri Dec 27 2024 08:42:07 for NetSurf by
1.9.4