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