NetSurf
|
Implementation of RISC OS global history. More...
#include <stdint.h>
#include <stdlib.h>
#include <oslib/wimp.h>
#include "utils/nsoption.h"
#include "utils/messages.h"
#include "utils/log.h"
#include "netsurf/window.h"
#include "netsurf/plotters.h"
#include "netsurf/keypress.h"
#include "desktop/global_history.h"
#include "riscos/dialog.h"
#include "riscos/gui.h"
#include "riscos/menus.h"
#include "riscos/save.h"
#include "riscos/toolbar.h"
#include "riscos/wimp.h"
#include "riscos/wimp_event.h"
#include "riscos/corewindow.h"
#include "riscos/global_history.h"
Go to the source code of this file.
Data Structures | |
struct | ro_global_history_window |
Functions | |
static nserror | global_history_draw (struct ro_corewindow *ro_cw, int originx, int originy, struct rect *r) |
callback to draw on drawable area of ro global_history window More... | |
static nserror | global_history_key (struct ro_corewindow *ro_cw, uint32_t nskey) |
callback for keypress on ro coookie window More... | |
static nserror | global_history_mouse (struct ro_corewindow *ro_cw, browser_mouse_state mouse_state, int x, int y) |
callback for mouse event on ro global_history window More... | |
static nserror | global_history_toolbar_click (struct ro_corewindow *ro_cw, button_bar_action action) |
handle clicks in ro core window toolbar. More... | |
static nserror | global_history_toolbar_update (struct ro_corewindow *ro_cw) |
Handle updating state of buttons in ro core window toolbar. More... | |
static nserror | global_history_toolbar_save (struct ro_corewindow *ro_cw, char *config) |
callback for saving of toolbar state in ro global history window More... | |
static bool | global_history_menu_prepare (wimp_w w, wimp_i i, wimp_menu *menu, wimp_pointer *pointer) |
Prepare the global_history menu for display. More... | |
static void | global_history_menu_warning (wimp_w w, wimp_i i, wimp_menu *menu, wimp_selection *selection, menu_action action) |
Handle submenu warnings for the global_history menu. More... | |
static bool | global_history_menu_select (wimp_w w, wimp_i i, wimp_menu *menu, wimp_selection *selection, menu_action action) |
Handle selections from the global_history menu. More... | |
static nserror | ro_global_history_init (void) |
Creates the window for the global_history tree. More... | |
nserror | ro_gui_global_history_present (void) |
make the global history window visible. More... | |
void | ro_gui_global_history_initialise (void) |
initialise the global history window template ready for subsequent use. More... | |
nserror | ro_gui_global_history_finalise (void) |
Free any resources allocated for the global history window. More... | |
bool | ro_gui_global_history_check_window (wimp_w wh) |
check if window handle is for the global history window More... | |
bool | ro_gui_global_history_check_menu (wimp_menu *menu) |
check if menu handle is for the global history menu More... | |
Variables | |
static struct ro_global_history_window * | global_history_window = NULL |
global_history window is a singleton More... | |
static wimp_window * | dialog_global_history_template |
riscos template for global_history window More... | |
Implementation of RISC OS global history.
Definition in file global_history.c.
|
static |
callback to draw on drawable area of ro global_history 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 69 of file global_history.c.
References global_history_redraw(), redraw_context::interactive, no_font_blending, NSERROR_OK, ro_plot_origin_x, ro_plot_origin_y, and ro_plotters.
Referenced by ro_global_history_init().
|
static |
callback for keypress on ro coookie window
ro_cw | The ro core window structure. |
nskey | The netsurf key code. |
Definition at line 99 of file global_history.c.
References global_history_keypress(), NSERROR_NOT_IMPLEMENTED, and NSERROR_OK.
Referenced by ro_global_history_init().
|
static |
Prepare the global_history menu 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 218 of file global_history.c.
References ro_global_history_window::core, global_history_has_selection(), GUI_SAVE_HISTORY_EXPORT_HTML, ro_global_history_window::menu, ro_gui_menu_set_entry_shaded(), ro_gui_menu_set_entry_ticked(), ro_gui_save_prepare(), 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_global_history_init().
|
static |
Handle selections from the global_history 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 286 of file global_history.c.
References ro_global_history_window::core, dialog_saveas, global_history_contract(), global_history_expand(), global_history_keypress(), HISTORY_EXPORT, ro_global_history_window::menu, NS_KEY_CLEAR_SELECTION, NS_KEY_CR, NS_KEY_DELETE_LEFT, NS_KEY_SELECT_ALL, ro_gui_dialog_open_persistent(), 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, TREE_SELECTION_DELETE, and TREE_SELECTION_LAUNCH.
Referenced by ro_global_history_init().
|
static |
Handle submenu warnings for the global_history 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 265 of file global_history.c.
Referenced by ro_global_history_init().
|
static |
callback for mouse event on ro global_history window
ro_cw | The ro core window structure. |
mouse_state | mouse state |
x | location of event |
y | location of event |
Definition at line 118 of file global_history.c.
References global_history_mouse_action(), and NSERROR_OK.
Referenced by ro_global_history_init().
|
static |
handle clicks in ro core window toolbar.
ro_cw | The ro core window structure. |
action | The button bar action. |
Definition at line 136 of file global_history.c.
References global_history_contract(), global_history_expand(), global_history_keypress(), NS_KEY_CR, NS_KEY_DELETE_LEFT, NSERROR_OK, TOOLBAR_BUTTON_CLOSE, TOOLBAR_BUTTON_COLLAPSE, TOOLBAR_BUTTON_DELETE, TOOLBAR_BUTTON_EXPAND, TOOLBAR_BUTTON_LAUNCH, and TOOLBAR_BUTTON_OPEN.
Referenced by ro_global_history_init().
|
static |
callback for saving of toolbar state in ro global history window
ro_cw | The ro core window structure. |
config | The new toolbar configuration. |
Definition at line 199 of file global_history.c.
References NSERROR_OK, nsoption_set_charp, and ro_gui_save_options().
Referenced by ro_global_history_init().
|
static |
Handle updating state of buttons in ro core window toolbar.
ro_cw | The ro core window structure. |
Definition at line 178 of file global_history.c.
References global_history_has_selection(), NSERROR_OK, ro_toolbar_set_button_shaded_state(), ro_corewindow::toolbar, TOOLBAR_BUTTON_DELETE, and TOOLBAR_BUTTON_LAUNCH.
Referenced by ro_global_history_init().
|
static |
Creates the window for the global_history tree.
Definition at line 368 of file global_history.c.
References ro_global_history_window::core, dialog_global_history_template, dialog_saveas, ro_corewindow::draw, global_history_draw(), global_history_init(), global_history_key(), global_history_menu_prepare(), global_history_menu_select(), global_history_menu_warning(), global_history_mouse(), global_history_toolbar_click(), global_history_toolbar_save(), global_history_toolbar_update(), global_history_window, HISTORY_EXPORT, ro_corewindow::key, ro_global_history_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_GLOBAL_HISTORY_TOOLBAR, TOOLBAR_BUTTON_CLOSE, TOOLBAR_BUTTON_COLLAPSE, TOOLBAR_BUTTON_DELETE, TOOLBAR_BUTTON_EXPAND, TOOLBAR_BUTTON_LAUNCH, 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, TREE_SELECTION_LAUNCH, and ro_corewindow::wh.
Referenced by ro_gui_global_history_present().
bool ro_gui_global_history_check_menu | ( | wimp_menu * | menu | ) |
check if menu handle is for the global history menu
Definition at line 540 of file global_history.c.
References global_history_window, and ro_global_history_window::menu.
Referenced by ro_gui_interactive_help_request().
bool ro_gui_global_history_check_window | ( | wimp_w | wh | ) |
check if window handle is for the global history window
Definition at line 529 of file global_history.c.
References ro_global_history_window::core, global_history_window, and ro_corewindow::wh.
Referenced by ro_gui_interactive_help_request().
nserror ro_gui_global_history_finalise | ( | void | ) |
Free any resources allocated for the global history window.
Definition at line 508 of file global_history.c.
References ro_global_history_window::core, global_history_fini(), global_history_window, NSERROR_OK, and ro_corewindow_fini().
Referenced by gui_quit().
void ro_gui_global_history_initialise | ( | void | ) |
initialise the global history window template ready for subsequent use.
Definition at line 501 of file global_history.c.
References dialog_global_history_template, and ro_gui_dialog_load_template().
Referenced by ro_gui_dialog_init().
nserror ro_gui_global_history_present | ( | void | ) |
make the global history window visible.
Definition at line 482 of file global_history.c.
References ro_global_history_window::core, global_history_window, NSERROR_OK, NSLOG, ro_global_history_init(), ro_gui_dialog_open_top(), ro_corewindow::toolbar, and ro_corewindow::wh.
Referenced by ro_gui_iconbar_menu_select(), ro_gui_window_handle_local_keypress(), ro_gui_window_menu_select(), and ro_gui_window_toolbar_click().
|
static |
riscos template for global_history window
Definition at line 56 of file global_history.c.
Referenced by ro_global_history_init(), and ro_gui_global_history_initialise().
|
static |
global_history window is a singleton
Definition at line 53 of file global_history.c.
Referenced by ro_global_history_init(), ro_gui_global_history_check_menu(), ro_gui_global_history_check_window(), ro_gui_global_history_finalise(), and ro_gui_global_history_present().