NetSurf
frontends
riscos
menus.h
Go to the documentation of this file.
1
/*
2
* Copyright 2005 Richard Wilson <info@tinct.net>
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 _NETSURF_RISCOS_MENUS_H_
20
#define _NETSURF_RISCOS_MENUS_H_
21
22
extern
wimp_menu *
image_quality_menu
, *
proxy_type_menu
, *
languages_menu
;
23
24
extern
wimp_menu *
current_menu
;
25
26
typedef
enum
{
27
28
/* no/unknown actions */
29
NO_ACTION
,
30
31
/* help actions */
32
HELP_OPEN_CONTENTS
,
33
HELP_OPEN_GUIDE
,
34
HELP_OPEN_INFORMATION
,
35
HELP_OPEN_CREDITS
,
36
HELP_OPEN_LICENCE
,
37
HELP_LAUNCH_INTERACTIVE
,
38
39
/* history actions */
40
HISTORY_SHOW_LOCAL
,
41
HISTORY_SHOW_GLOBAL
,
42
43
/* hotlist actions */
44
HOTLIST_ADD_URL
,
45
HOTLIST_SHOW
,
46
47
/* cookie actions */
48
COOKIES_SHOW
,
49
COOKIES_DELETE
,
50
51
/* page actions */
52
BROWSER_PAGE
,
53
BROWSER_PAGE_INFO
,
54
BROWSER_PRINT
,
55
BROWSER_NEW_WINDOW
,
56
BROWSER_VIEW_SOURCE
,
57
58
/* object actions */
59
BROWSER_OBJECT
,
60
BROWSER_OBJECT_OBJECT
,
61
BROWSER_OBJECT_LINK
,
62
BROWSER_OBJECT_INFO
,
63
BROWSER_OBJECT_PRINT
,
64
BROWSER_OBJECT_RELOAD
,
65
BROWSER_LINK_SAVE
,
66
BROWSER_LINK_DOWNLOAD
,
67
BROWSER_LINK_NEW_WINDOW
,
68
69
/* save actions */
70
BROWSER_OBJECT_SAVE
,
71
BROWSER_OBJECT_EXPORT
,
72
BROWSER_OBJECT_EXPORT_SPRITE
,
73
BROWSER_OBJECT_EXPORT_DRAW
,
74
BROWSER_OBJECT_SAVE_URL_URI
,
75
BROWSER_OBJECT_SAVE_URL_URL
,
76
BROWSER_OBJECT_SAVE_URL_TEXT
,
77
BROWSER_SAVE
,
78
BROWSER_SAVE_COMPLETE
,
79
BROWSER_EXPORT_DRAW
,
80
BROWSER_EXPORT_PDF
,
81
BROWSER_EXPORT_TEXT
,
82
BROWSER_SAVE_URL_URI
,
83
BROWSER_SAVE_URL_URL
,
84
BROWSER_SAVE_URL_TEXT
,
85
BROWSER_LINK_SAVE_URI
,
86
BROWSER_LINK_SAVE_URL
,
87
BROWSER_LINK_SAVE_TEXT
,
88
HOTLIST_EXPORT
,
89
HISTORY_EXPORT
,
90
91
/* selection actions */
92
BROWSER_SELECTION
,
93
BROWSER_SELECTION_SAVE
,
94
BROWSER_SELECTION_COPY
,
95
BROWSER_SELECTION_CUT
,
96
BROWSER_SELECTION_PASTE
,
97
BROWSER_SELECTION_CLEAR
,
98
BROWSER_SELECTION_ALL
,
99
100
/* navigation actions */
101
BROWSER_NAVIGATE_HOME
,
102
BROWSER_NAVIGATE_BACK
,
103
BROWSER_NAVIGATE_FORWARD
,
104
BROWSER_NAVIGATE_UP
,
105
BROWSER_NAVIGATE_RELOAD
,
106
BROWSER_NAVIGATE_RELOAD_ALL
,
107
BROWSER_NAVIGATE_STOP
,
108
BROWSER_NAVIGATE_URL
,
109
110
/* browser window/display actions */
111
BROWSER_SCALE_VIEW
,
112
BROWSER_FIND_TEXT
,
113
BROWSER_IMAGES_FOREGROUND
,
114
BROWSER_IMAGES_BACKGROUND
,
115
BROWSER_BUFFER_ANIMS
,
116
BROWSER_BUFFER_ALL
,
117
BROWSER_SAVE_VIEW
,
118
BROWSER_WINDOW_DEFAULT
,
119
BROWSER_WINDOW_STAGGER
,
120
BROWSER_WINDOW_COPY
,
121
BROWSER_WINDOW_RESET
,
122
123
/* tree actions */
124
TREE_NEW_FOLDER
,
125
TREE_NEW_LINK
,
126
TREE_EXPAND_ALL
,
127
TREE_EXPAND_FOLDERS
,
128
TREE_EXPAND_LINKS
,
129
TREE_COLLAPSE_ALL
,
130
TREE_COLLAPSE_FOLDERS
,
131
TREE_COLLAPSE_LINKS
,
132
TREE_SELECTION
,
133
TREE_SELECTION_EDIT
,
134
TREE_SELECTION_LAUNCH
,
135
TREE_SELECTION_DELETE
,
136
TREE_SELECT_ALL
,
137
TREE_CLEAR_SELECTION
,
138
139
/* toolbar actions */
140
TOOLBAR_BUTTONS
,
141
TOOLBAR_ADDRESS_BAR
,
142
TOOLBAR_THROBBER
,
143
TOOLBAR_EDIT
,
144
145
/* misc actions */
146
CHOICES_SHOW
,
147
APPLICATION_QUIT
,
148
}
menu_action
;
149
150
151
/* Menu entry structures for use when defining menus. */
152
153
struct
ns_menu_entry
{
154
const
char
*
text
;
/**< menu text (from messages) */
155
menu_action
action
;
/**< associated action */
156
wimp_w *
sub_window
;
/**< sub-window if any */
157
};
158
159
struct
ns_menu
{
160
const
char
*
title
;
161
struct
ns_menu_entry
entries
[];
162
};
163
164
165
void
ro_gui_menu_init
(
void
);
166
void
ro_gui_menu_create
(wimp_menu* menu,
int
x,
int
y, wimp_w w);
167
void
ro_gui_menu_destroy
(
void
);
168
void
ro_gui_popup_menu
(wimp_menu *menu, wimp_w w, wimp_i i);
169
void
ro_gui_menu_window_changed
(wimp_w
from
, wimp_w
to
);
170
void
ro_gui_menu_selection
(wimp_selection*
selection
);
171
void
ro_gui_menu_warning
(wimp_message_menu_warning *warning);
172
void
ro_gui_menu_message_deleted
(wimp_message_menus_deleted *deleted);
173
void
ro_gui_menu_refresh
(wimp_menu *menu);
174
void
ro_gui_menu_init_structure
(wimp_menu *menu,
int
entries);
175
const
char
*
ro_gui_menu_find_menu_entry_key
(wimp_menu *menu,
176
const
char
*translated);
177
wimp_menu *
ro_gui_menu_define_menu
(
const
struct
ns_menu
*menu);
178
void
ro_gui_menu_set_entry_shaded
(wimp_menu *menu,
menu_action
action
,
179
bool
shaded);
180
void
ro_gui_menu_set_entry_ticked
(wimp_menu *menu,
menu_action
action
,
181
bool
ticked);
182
183
#endif
menu_action
menu_action
Definition:
scaffolding.h:77
ro_gui_menu_destroy
void ro_gui_menu_destroy(void)
Forcibly close any menu or transient dialogue box that is currently open.
Definition:
menus.c:288
ro_gui_menu_create
void ro_gui_menu_create(wimp_menu *menu, int x, int y, wimp_w w)
Display a menu.
Definition:
menus.c:211
ro_gui_menu_init_structure
void ro_gui_menu_init_structure(wimp_menu *menu, int entries)
Initialise the basic state of a menu structure so all entries are indirected text with no flags,...
Definition:
menus.c:682
ro_gui_menu_set_entry_ticked
void ro_gui_menu_set_entry_ticked(wimp_menu *menu, menu_action action, bool ticked)
Sets an action within a menu as having a specific ticked status.
Definition:
menus.c:831
ro_gui_popup_menu
void ro_gui_popup_menu(wimp_menu *menu, wimp_w w, wimp_i i)
Display a pop-up menu next to the specified icon.
Definition:
menus.c:251
image_quality_menu
wimp_menu * image_quality_menu
The available menus.
Definition:
menus.c:104
ro_gui_menu_init
void ro_gui_menu_init(void)
Create menu structures.
Definition:
menus.c:116
ro_gui_menu_find_menu_entry_key
const char * ro_gui_menu_find_menu_entry_key(wimp_menu *menu, const char *translated)
Finds the key associated with a menu entry translation.
Definition:
menus.c:735
ro_gui_menu_message_deleted
void ro_gui_menu_message_deleted(wimp_message_menus_deleted *deleted)
Handle Message_MenusDeleted, removing our current record of an open menu if it matches the deleted me...
Definition:
menus.c:442
languages_menu
wimp_menu * languages_menu
Definition:
menus.h:22
ro_gui_menu_refresh
void ro_gui_menu_refresh(wimp_menu *menu)
Update the current menu by sending it a Menu Prepare event through wimp_event and then reopening it i...
Definition:
menus.c:475
ro_gui_menu_warning
void ro_gui_menu_warning(wimp_message_menu_warning *warning)
Handle Message_MenuWarning.
Definition:
menus.c:381
ro_gui_menu_set_entry_shaded
void ro_gui_menu_set_entry_shaded(wimp_menu *menu, menu_action action, bool shaded)
Sets an action within a menu as having a specific ticked status.
Definition:
menus.c:804
ro_gui_menu_define_menu
wimp_menu * ro_gui_menu_define_menu(const struct ns_menu *menu)
Creates a wimp_menu and adds it to the list to handle actions for.
Definition:
menus.c:510
current_menu
wimp_menu * current_menu
The current menu being worked with (may not be open)
Definition:
menus.c:96
menu_action
menu_action
Definition:
menus.h:26
BROWSER_SELECTION_SAVE
@ BROWSER_SELECTION_SAVE
Definition:
menus.h:93
BROWSER_WINDOW_STAGGER
@ BROWSER_WINDOW_STAGGER
Definition:
menus.h:119
TREE_EXPAND_FOLDERS
@ TREE_EXPAND_FOLDERS
Definition:
menus.h:127
BROWSER_NAVIGATE_HOME
@ BROWSER_NAVIGATE_HOME
Definition:
menus.h:101
TREE_EXPAND_ALL
@ TREE_EXPAND_ALL
Definition:
menus.h:126
BROWSER_SCALE_VIEW
@ BROWSER_SCALE_VIEW
Definition:
menus.h:111
BROWSER_PAGE_INFO
@ BROWSER_PAGE_INFO
Definition:
menus.h:53
NO_ACTION
@ NO_ACTION
Definition:
menus.h:29
BROWSER_OBJECT_SAVE
@ BROWSER_OBJECT_SAVE
Definition:
menus.h:70
BROWSER_NAVIGATE_FORWARD
@ BROWSER_NAVIGATE_FORWARD
Definition:
menus.h:103
BROWSER_BUFFER_ALL
@ BROWSER_BUFFER_ALL
Definition:
menus.h:116
BROWSER_BUFFER_ANIMS
@ BROWSER_BUFFER_ANIMS
Definition:
menus.h:115
HELP_OPEN_LICENCE
@ HELP_OPEN_LICENCE
Definition:
menus.h:36
TREE_COLLAPSE_FOLDERS
@ TREE_COLLAPSE_FOLDERS
Definition:
menus.h:130
BROWSER_SELECTION
@ BROWSER_SELECTION
Definition:
menus.h:92
TOOLBAR_ADDRESS_BAR
@ TOOLBAR_ADDRESS_BAR
Definition:
menus.h:141
BROWSER_OBJECT_RELOAD
@ BROWSER_OBJECT_RELOAD
Definition:
menus.h:64
TREE_SELECTION
@ TREE_SELECTION
Definition:
menus.h:132
BROWSER_OBJECT_EXPORT_SPRITE
@ BROWSER_OBJECT_EXPORT_SPRITE
Definition:
menus.h:72
BROWSER_WINDOW_RESET
@ BROWSER_WINDOW_RESET
Definition:
menus.h:121
BROWSER_WINDOW_COPY
@ BROWSER_WINDOW_COPY
Definition:
menus.h:120
CHOICES_SHOW
@ CHOICES_SHOW
Definition:
menus.h:146
BROWSER_OBJECT_SAVE_URL_URI
@ BROWSER_OBJECT_SAVE_URL_URI
Definition:
menus.h:74
COOKIES_SHOW
@ COOKIES_SHOW
Definition:
menus.h:48
BROWSER_SAVE_VIEW
@ BROWSER_SAVE_VIEW
Definition:
menus.h:117
BROWSER_IMAGES_BACKGROUND
@ BROWSER_IMAGES_BACKGROUND
Definition:
menus.h:114
BROWSER_NAVIGATE_RELOAD
@ BROWSER_NAVIGATE_RELOAD
Definition:
menus.h:105
BROWSER_OBJECT
@ BROWSER_OBJECT
Definition:
menus.h:59
BROWSER_SELECTION_CUT
@ BROWSER_SELECTION_CUT
Definition:
menus.h:95
BROWSER_OBJECT_LINK
@ BROWSER_OBJECT_LINK
Definition:
menus.h:61
BROWSER_NEW_WINDOW
@ BROWSER_NEW_WINDOW
Definition:
menus.h:55
BROWSER_EXPORT_PDF
@ BROWSER_EXPORT_PDF
Definition:
menus.h:80
BROWSER_NAVIGATE_BACK
@ BROWSER_NAVIGATE_BACK
Definition:
menus.h:102
BROWSER_LINK_SAVE_TEXT
@ BROWSER_LINK_SAVE_TEXT
Definition:
menus.h:87
BROWSER_OBJECT_PRINT
@ BROWSER_OBJECT_PRINT
Definition:
menus.h:63
BROWSER_PRINT
@ BROWSER_PRINT
Definition:
menus.h:54
BROWSER_NAVIGATE_STOP
@ BROWSER_NAVIGATE_STOP
Definition:
menus.h:107
HISTORY_SHOW_LOCAL
@ HISTORY_SHOW_LOCAL
Definition:
menus.h:40
TREE_SELECTION_LAUNCH
@ TREE_SELECTION_LAUNCH
Definition:
menus.h:134
TREE_NEW_FOLDER
@ TREE_NEW_FOLDER
Definition:
menus.h:124
BROWSER_SAVE_URL_TEXT
@ BROWSER_SAVE_URL_TEXT
Definition:
menus.h:84
BROWSER_SELECTION_CLEAR
@ BROWSER_SELECTION_CLEAR
Definition:
menus.h:97
BROWSER_LINK_NEW_WINDOW
@ BROWSER_LINK_NEW_WINDOW
Definition:
menus.h:67
TREE_SELECT_ALL
@ TREE_SELECT_ALL
Definition:
menus.h:136
BROWSER_NAVIGATE_UP
@ BROWSER_NAVIGATE_UP
Definition:
menus.h:104
BROWSER_LINK_SAVE
@ BROWSER_LINK_SAVE
Definition:
menus.h:65
BROWSER_OBJECT_EXPORT_DRAW
@ BROWSER_OBJECT_EXPORT_DRAW
Definition:
menus.h:73
HOTLIST_ADD_URL
@ HOTLIST_ADD_URL
Definition:
menus.h:44
TREE_CLEAR_SELECTION
@ TREE_CLEAR_SELECTION
Definition:
menus.h:137
BROWSER_OBJECT_SAVE_URL_URL
@ BROWSER_OBJECT_SAVE_URL_URL
Definition:
menus.h:75
HELP_OPEN_GUIDE
@ HELP_OPEN_GUIDE
Definition:
menus.h:33
BROWSER_NAVIGATE_URL
@ BROWSER_NAVIGATE_URL
Definition:
menus.h:108
HOTLIST_SHOW
@ HOTLIST_SHOW
Definition:
menus.h:45
BROWSER_PAGE
@ BROWSER_PAGE
Definition:
menus.h:52
BROWSER_LINK_DOWNLOAD
@ BROWSER_LINK_DOWNLOAD
Definition:
menus.h:66
BROWSER_SAVE
@ BROWSER_SAVE
Definition:
menus.h:77
TREE_SELECTION_EDIT
@ TREE_SELECTION_EDIT
Definition:
menus.h:133
BROWSER_FIND_TEXT
@ BROWSER_FIND_TEXT
Definition:
menus.h:112
TREE_EXPAND_LINKS
@ TREE_EXPAND_LINKS
Definition:
menus.h:128
BROWSER_OBJECT_INFO
@ BROWSER_OBJECT_INFO
Definition:
menus.h:62
BROWSER_NAVIGATE_RELOAD_ALL
@ BROWSER_NAVIGATE_RELOAD_ALL
Definition:
menus.h:106
BROWSER_OBJECT_EXPORT
@ BROWSER_OBJECT_EXPORT
Definition:
menus.h:71
BROWSER_IMAGES_FOREGROUND
@ BROWSER_IMAGES_FOREGROUND
Definition:
menus.h:113
TOOLBAR_BUTTONS
@ TOOLBAR_BUTTONS
Definition:
menus.h:140
HELP_OPEN_CREDITS
@ HELP_OPEN_CREDITS
Definition:
menus.h:35
BROWSER_LINK_SAVE_URI
@ BROWSER_LINK_SAVE_URI
Definition:
menus.h:85
HOTLIST_EXPORT
@ HOTLIST_EXPORT
Definition:
menus.h:88
BROWSER_OBJECT_SAVE_URL_TEXT
@ BROWSER_OBJECT_SAVE_URL_TEXT
Definition:
menus.h:76
BROWSER_LINK_SAVE_URL
@ BROWSER_LINK_SAVE_URL
Definition:
menus.h:86
APPLICATION_QUIT
@ APPLICATION_QUIT
Definition:
menus.h:147
TREE_SELECTION_DELETE
@ TREE_SELECTION_DELETE
Definition:
menus.h:135
BROWSER_SAVE_COMPLETE
@ BROWSER_SAVE_COMPLETE
Definition:
menus.h:78
HELP_OPEN_INFORMATION
@ HELP_OPEN_INFORMATION
Definition:
menus.h:34
HISTORY_SHOW_GLOBAL
@ HISTORY_SHOW_GLOBAL
Definition:
menus.h:41
TOOLBAR_EDIT
@ TOOLBAR_EDIT
Definition:
menus.h:143
HISTORY_EXPORT
@ HISTORY_EXPORT
Definition:
menus.h:89
BROWSER_WINDOW_DEFAULT
@ BROWSER_WINDOW_DEFAULT
Definition:
menus.h:118
BROWSER_SAVE_URL_URI
@ BROWSER_SAVE_URL_URI
Definition:
menus.h:82
BROWSER_EXPORT_DRAW
@ BROWSER_EXPORT_DRAW
Definition:
menus.h:79
BROWSER_VIEW_SOURCE
@ BROWSER_VIEW_SOURCE
Definition:
menus.h:56
TREE_COLLAPSE_ALL
@ TREE_COLLAPSE_ALL
Definition:
menus.h:129
COOKIES_DELETE
@ COOKIES_DELETE
Definition:
menus.h:49
BROWSER_SELECTION_COPY
@ BROWSER_SELECTION_COPY
Definition:
menus.h:94
BROWSER_SAVE_URL_URL
@ BROWSER_SAVE_URL_URL
Definition:
menus.h:83
BROWSER_EXPORT_TEXT
@ BROWSER_EXPORT_TEXT
Definition:
menus.h:81
TREE_COLLAPSE_LINKS
@ TREE_COLLAPSE_LINKS
Definition:
menus.h:131
BROWSER_SELECTION_ALL
@ BROWSER_SELECTION_ALL
Definition:
menus.h:98
HELP_OPEN_CONTENTS
@ HELP_OPEN_CONTENTS
Definition:
menus.h:32
TREE_NEW_LINK
@ TREE_NEW_LINK
Definition:
menus.h:125
BROWSER_OBJECT_OBJECT
@ BROWSER_OBJECT_OBJECT
Definition:
menus.h:60
TOOLBAR_THROBBER
@ TOOLBAR_THROBBER
Definition:
menus.h:142
HELP_LAUNCH_INTERACTIVE
@ HELP_LAUNCH_INTERACTIVE
Definition:
menus.h:37
BROWSER_SELECTION_PASTE
@ BROWSER_SELECTION_PASTE
Definition:
menus.h:96
ro_gui_menu_selection
void ro_gui_menu_selection(wimp_selection *selection)
Handle menu selection.
Definition:
menus.c:326
proxy_type_menu
wimp_menu * proxy_type_menu
Definition:
menus.h:22
ro_gui_menu_window_changed
void ro_gui_menu_window_changed(wimp_w from, wimp_w to)
Allow the current menu window to change, if the window is deleted and recreated while a menu is activ...
Definition:
menus.c:314
ns_menu_entry
Definition:
menus.h:153
ns_menu_entry::action
menu_action action
associated action
Definition:
menus.h:155
ns_menu_entry::sub_window
wimp_w * sub_window
sub-window if any
Definition:
menus.h:156
ns_menu_entry::text
const char * text
menu text (from messages)
Definition:
menus.h:154
ns_menu
Definition:
menus.h:159
ns_menu::title
const char * title
Definition:
menus.h:160
ns_menu::entries
struct ns_menu_entry entries[]
Definition:
menus.h:161
selection
Definition:
selection.c:55
from
char from[32]
Encoding name to convert from.
Definition:
utf8.c:143
to
char to[32]
Encoding name to convert to.
Definition:
utf8.c:144
Generated on Wed Dec 18 2024 10:31:35 for NetSurf by
1.9.4