NetSurf
|
Implementation of RISC OS cookie manager. More...
#include <stdint.h>
#include <stdlib.h>
#include <oslib/wimp.h>
#include "utils/log.h"
#include "utils/nsoption.h"
#include "utils/messages.h"
#include "netsurf/plotters.h"
#include "netsurf/keypress.h"
#include "desktop/cookie_manager.h"
#include "riscos/gui.h"
#include "riscos/wimp.h"
#include "riscos/wimp_event.h"
#include "riscos/dialog.h"
#include "riscos/toolbar.h"
#include "riscos/corewindow.h"
#include "riscos/cookies.h"
Go to the source code of this file.
Data Structures | |
struct | ro_cookie_window |
Functions | |
static nserror | cookie_draw (struct ro_corewindow *ro_cw, int originx, int originy, struct rect *r) |
callback to draw on drawable area of ro cookie window More... | |
static nserror | cookie_key (struct ro_corewindow *ro_cw, uint32_t nskey) |
callback for keypress on ro cookie window More... | |
static nserror | cookie_mouse (struct ro_corewindow *ro_cw, browser_mouse_state mouse_state, int x, int y) |
callback for mouse event on ro cookie window More... | |
static nserror | cookie_toolbar_click (struct ro_corewindow *ro_cw, button_bar_action action) |
handle clicks in ro core window toolbar. More... | |
static nserror | cookie_toolbar_update (struct ro_corewindow *ro_cw) |
Handle updating state of buttons in ro core window toolbar. More... | |
static nserror | cookie_toolbar_save (struct ro_corewindow *ro_cw, char *config) |
callback for saving of toolbar state in ro cookie window More... | |
static bool | cookie_menu_prepare (wimp_w w, wimp_i i, wimp_menu *menu, wimp_pointer *pointer) |
Prepare the cookie meu for display. More... | |
static void | cookie_menu_warning (wimp_w w, wimp_i i, wimp_menu *menu, wimp_selection *selection, menu_action action) |
Handle submenu warnings for the cookies menu. More... | |
static bool | cookie_menu_select (wimp_w w, wimp_i i, wimp_menu *menu, wimp_selection *selection, menu_action action) |
Handle selections from the cookies menu. More... | |
static nserror | ro_cookie_init (void) |
Creates the window for the cookie tree. More... | |
nserror | ro_gui_cookies_present (const char *search_term) |
make the cookie window visible. More... | |
void | ro_gui_cookies_initialise (void) |
initialise the cookies window template ready for subsequent use. More... | |
nserror | ro_gui_cookies_finalise (void) |
Free any resources allocated for the cookie window. More... | |
bool | ro_gui_cookies_check_window (wimp_w wh) |
check if window handle is for the cookies window More... | |
bool | ro_gui_cookies_check_menu (wimp_menu *menu) |
check if menu handle is for the cookies menu More... | |
Variables | |
static struct ro_cookie_window * | cookie_window = NULL |
cookie window is a singleton More... | |
static wimp_window * | dialog_cookie_template |
riscos template for cookie window More... | |
Implementation of RISC OS cookie manager.
Definition in file cookies.c.
|
static |
callback to draw on drawable area of ro cookie window
ro_cw | The riscos core window structure. |
r | The rectangle of the window that needs updating. |
originx | The risc os plotter x origin. |
originy | The risc os plotter y origin. |
Definition at line 65 of file cookies.c.
References cookie_manager_redraw(), redraw_context::interactive, no_font_blending, NSERROR_OK, ro_plot_origin_x, ro_plot_origin_y, and ro_plotters.
Referenced by ro_cookie_init().
|
static |
callback for keypress on ro cookie window
ro_cw | The ro core window structure. |
nskey | The netsurf key code. |
Definition at line 95 of file cookies.c.
References cookie_manager_keypress(), NSERROR_NOT_IMPLEMENTED, and NSERROR_OK.
Referenced by ro_cookie_init().
|
static |
Prepare the cookie meu for display.
w | The window owning the menu. |
i | The icon owning the menu. |
menu | The menu from which the selection was made. |
pointer | The pointer shape |
Definition at line 204 of file cookies.c.
References cookie_manager_has_selection(), ro_cookie_window::core, ro_cookie_window::menu, ro_gui_menu_set_entry_shaded(), ro_gui_menu_set_entry_ticked(), ro_gui_wimp_event_get_user_data(), ro_toolbar_menu_buttons_tick, ro_toolbar_menu_edit_shade, ro_toolbar_menu_edit_tick, ro_toolbar_menu_option_shade, ro_corewindow::toolbar, TOOLBAR_BUTTONS, TOOLBAR_EDIT, TREE_CLEAR_SELECTION, and TREE_SELECTION.
Referenced by ro_cookie_init().
|
static |
Handle selections from the cookies menu.
w | The window owning the menu. |
i | The icon owning the menu. |
menu | The menu from which the selection was made. |
selection | The wimp menu selection data. |
action | The selected menu action. |
Definition at line 269 of file cookies.c.
References cookie_manager_contract(), cookie_manager_expand(), cookie_manager_keypress(), ro_cookie_window::core, ro_cookie_window::menu, NS_KEY_CLEAR_SELECTION, NS_KEY_DELETE_LEFT, NS_KEY_SELECT_ALL, ro_gui_wimp_event_get_user_data(), ro_toolbar_get_display_buttons(), ro_toolbar_set_display_buttons(), ro_toolbar_toggle_edit(), ro_corewindow::toolbar, TOOLBAR_BUTTONS, TOOLBAR_EDIT, TREE_CLEAR_SELECTION, TREE_COLLAPSE_ALL, TREE_COLLAPSE_FOLDERS, TREE_COLLAPSE_LINKS, TREE_EXPAND_ALL, TREE_EXPAND_FOLDERS, TREE_EXPAND_LINKS, TREE_SELECT_ALL, and TREE_SELECTION_DELETE.
Referenced by ro_cookie_init().
|
static |
Handle submenu warnings for the cookies menu.
w | The window owning the menu. |
i | The icon owning the menu. |
menu | The menu to which the warning applies. |
selection | The wimp menu selection data. |
action | The selected menu action. |
Definition at line 248 of file cookies.c.
Referenced by ro_cookie_init().
|
static |
callback for mouse event on ro cookie window
ro_cw | The ro core window structure. |
mouse_state | mouse state |
x | location of event |
y | location of event |
Definition at line 114 of file cookies.c.
References cookie_manager_mouse_action(), and NSERROR_OK.
Referenced by ro_cookie_init().
|
static |
handle clicks in ro core window toolbar.
ro_cw | The ro core window structure. |
action | The button bar action. |
Definition at line 132 of file cookies.c.
References cookie_manager_contract(), cookie_manager_expand(), cookie_manager_keypress(), NS_KEY_DELETE_LEFT, NSERROR_OK, TOOLBAR_BUTTON_CLOSE, TOOLBAR_BUTTON_COLLAPSE, TOOLBAR_BUTTON_DELETE, TOOLBAR_BUTTON_EXPAND, and TOOLBAR_BUTTON_OPEN.
Referenced by ro_cookie_init().
|
static |
callback for saving of toolbar state in ro cookie window
ro_cw | The ro core window structure. |
config | The new toolbar configuration. |
Definition at line 185 of file cookies.c.
References NSERROR_OK, nsoption_set_charp, and ro_gui_save_options().
Referenced by ro_cookie_init().
|
static |
Handle updating state of buttons in ro core window toolbar.
ro_cw | The ro core window structure. |
Definition at line 169 of file cookies.c.
References cookie_manager_has_selection(), NSERROR_OK, ro_toolbar_set_button_shaded_state(), ro_corewindow::toolbar, and TOOLBAR_BUTTON_DELETE.
Referenced by ro_cookie_init().
|
static |
Creates the window for the cookie tree.
Definition at line 343 of file cookies.c.
References cookie_draw(), cookie_key(), cookie_manager_init(), cookie_menu_prepare(), cookie_menu_select(), cookie_menu_warning(), cookie_mouse(), cookie_toolbar_click(), cookie_toolbar_save(), cookie_toolbar_update(), cookie_window, ro_cookie_window::core, dialog_cookie_template, ro_corewindow::draw, ro_corewindow::key, ro_cookie_window::menu, messages_get(), ro_corewindow::mouse, NO_ACTION, NSERROR_NOMEM, NSERROR_OK, NSLOG, nsoption_charp, ro_corewindow_init(), ro_gui_menu_define_menu(), ro_gui_set_window_title(), ro_gui_wimp_event_register_menu(), ro_gui_wimp_event_register_menu_prepare(), ro_gui_wimp_event_register_menu_selection(), ro_gui_wimp_event_register_menu_warning(), ro_warn_user(), THEME_STYLE_COOKIES_TOOLBAR, TOOLBAR_BUTTON_CLOSE, TOOLBAR_BUTTON_COLLAPSE, TOOLBAR_BUTTON_DELETE, TOOLBAR_BUTTON_EXPAND, TOOLBAR_BUTTON_NONE, TOOLBAR_BUTTON_OPEN, TOOLBAR_BUTTONS, ro_corewindow::toolbar_click, TOOLBAR_EDIT, ro_corewindow::toolbar_save, ro_corewindow::toolbar_update, TREE_CLEAR_SELECTION, TREE_COLLAPSE_ALL, TREE_COLLAPSE_FOLDERS, TREE_COLLAPSE_LINKS, TREE_EXPAND_ALL, TREE_EXPAND_FOLDERS, TREE_EXPAND_LINKS, TREE_SELECT_ALL, TREE_SELECTION, TREE_SELECTION_DELETE, and ro_corewindow::wh.
Referenced by ro_gui_cookies_present().
bool ro_gui_cookies_check_menu | ( | wimp_menu * | menu | ) |
check if menu handle is for the cookies menu
Definition at line 510 of file cookies.c.
References cookie_window, and ro_cookie_window::menu.
Referenced by ro_gui_interactive_help_request().
bool ro_gui_cookies_check_window | ( | wimp_w | wh | ) |
check if window handle is for the cookies window
Definition at line 499 of file cookies.c.
References cookie_window, ro_cookie_window::core, and ro_corewindow::wh.
Referenced by ro_gui_interactive_help_request().
nserror ro_gui_cookies_finalise | ( | void | ) |
Free any resources allocated for the cookie window.
Definition at line 478 of file cookies.c.
References cookie_manager_fini(), cookie_window, ro_cookie_window::core, NSERROR_OK, and ro_corewindow_fini().
Referenced by gui_quit().
void ro_gui_cookies_initialise | ( | void | ) |
initialise the cookies window template ready for subsequent use.
Definition at line 471 of file cookies.c.
References dialog_cookie_template, and ro_gui_dialog_load_template().
Referenced by ro_gui_dialog_init().
nserror ro_gui_cookies_present | ( | const char * | search_term | ) |
make the cookie window visible.
Definition at line 449 of file cookies.c.
References cookie_manager_set_search_string(), cookie_window, ro_cookie_window::core, NSERROR_OK, NSLOG, ro_cookie_init(), ro_gui_dialog_open_top(), ro_corewindow::toolbar, and ro_corewindow::wh.
Referenced by ro_gui_iconbar_menu_select(), and ro_gui_window_menu_select().
|
static |
cookie window is a singleton
Definition at line 49 of file cookies.c.
Referenced by ro_cookie_init(), ro_gui_cookies_check_menu(), ro_gui_cookies_check_window(), ro_gui_cookies_finalise(), and ro_gui_cookies_present().
|
static |
riscos template for cookie window
Definition at line 52 of file cookies.c.
Referenced by ro_cookie_init(), and ro_gui_cookies_initialise().