27#include <oslib/osmodule.h>
28#include <oslib/wimp.h>
76 wimp_MESSAGE_HEADER_MEMBERS
88 wimp_MESSAGE_HEADER_MEMBERS
114 .background_images =
true,
271 if ((hotlistw == NULL) ||
282 NULL, NULL, NULL, NULL);
339 if ((hotlistw == NULL) ||
429 static const struct ns_menu hotlist_menu_def = {
470 ncwin = calloc(1,
sizeof(*ncwin));
478 NSLOG(netsurf, INFO,
"xwimp_create_window: 0x%x: %s",
479 error->errnum, error->errmess);
498 hotlist_toolbar_buttons,
521 ncwin->
menu,
false,
false);
550 snprintf(command,
sizeof(command),
"Filer_Run %s",
552 error = xos_cli(command);
558 NSLOG(netsurf, INFO,
"xos_cli: 0x%x: %s", error->errnum,
566 NSLOG(netsurf, INFO,
"Presenting");
571 NSLOG(netsurf, INFO,
"Failed presenting code %d", res);
670 wimp_message message;
709 add_url->your_ref = 0;
713 strcpy(add_url->
appname,
"NetSurf");
bool hotlist_keypress(uint32_t key)
Key press handling.
bool hotlist_has_selection(void)
Determine whether there is a selection.
nserror hotlist_add_entry(nsurl *url, const char *title, bool at_y, int y)
Add an entry to the hotlist for given Title/URL.
void hotlist_mouse_action(browser_mouse_state mouse, int x, int y)
Handles all kinds of mouse action.
nserror hotlist_fini(void)
Finalise the hotlist.
nserror hotlist_add_url(nsurl *url)
Add an entry to the hotlist for given URL.
nserror hotlist_manager_init(void *core_window_handle)
Initialise the hotlist manager.
void hotlist_redraw(int x, int y, struct rect *clip, const struct redraw_context *ctx)
Redraw the hotlist.
nserror hotlist_add_folder(const char *title, bool at_y, int y)
Add a folder to the hotlist.
nserror hotlist_expand(bool only_folders)
Expand the treeview's nodes.
void hotlist_edit_selection(void)
Edit the first selected node.
bool hotlist_has_url(nsurl *url)
Check whether given URL is present in hotlist.
void hotlist_remove_url(nsurl *url)
Remove any entries matching the given URL from the hotlist.
nserror hotlist_contract(bool all)
Contract the treeview's nodes.
void ro_gui_dialog_open_persistent(wimp_w parent, wimp_w w, bool pointer)
Open a persistent dialog box relative to the pointer.
wimp_window * ro_gui_dialog_load_template(const char *template_name)
Load a template without creating a window.
void ro_gui_save_options(void)
Save the current options.
bool ro_gui_dialog_open_top(wimp_w w, struct toolbar *toolbar, int width, int height)
Moves a window to the top of the stack.
nserror
Enumeration of error codes.
@ NSERROR_NOT_IMPLEMENTED
Functionality is not implemented.
@ NSERROR_NOMEM
Memory exhaustion.
static nserror hotlist_draw(struct ro_corewindow *ro_cw, int originx, int originy, struct rect *r)
callback to draw on drawable area of ro hotlist window
static nserror hotlist_key(struct ro_corewindow *ro_cw, uint32_t nskey)
callback for keypress on ro hotlist window
static char * hotlist_url
URL area claimed from RMA.
bool ro_gui_hotlist_has_page(nsurl *url)
Report whether the hotlist contains a given URL.
static void hotlist_menu_warning(wimp_w w, wimp_i i, wimp_menu *menu, wimp_selection *selection, menu_action action)
Handle submenu warnings for the hotlist menu.
void ro_gui_hotlist_remove_page(nsurl *url)
Remove a URL from the hotlist.
nserror ro_gui_hotlist_present(void)
make the cookie window visible.
static nserror hotlist_toolbar_save(struct ro_corewindow *ro_cw, char *config)
callback for saving of toolbar state in ro hotlist window
static void ro_gui_hotlist_scheduled_callback(void *p)
Callback to schedule for the next available Null poll, by which point a hotlist client will have clai...
static void ro_gui_hotlist_addurl_bounce(wimp_message *message)
Handle bounced Message_HotlistAddURL, so that RMA storage can be freed.
void ro_gui_hotlist_add_page(nsurl *url)
Add a URL to the hotlist.
static query_id hotlist_query
Hotlist Query Handler.
static struct ro_hotlist_window * hotlist_window
hotlist window singleton
static nsurl * hotlist_delete_url
static bool hotlist_menu_prepare(wimp_w w, wimp_i i, wimp_menu *menu, wimp_pointer *pointer)
Prepare the hotlist menu for display.
bool ro_gui_hotlist_check_window(wimp_w wh)
static nserror hotlist_toolbar_update(struct ro_corewindow *ro_cw)
Handle updating state of buttons in ro core window toolbar.
static char * hotlist_title
Title area claimed from RMA.
bool ro_gui_hotlist_check_menu(wimp_menu *menu)
void ro_gui_hotlist_add_cleanup(void)
Clean up RMA storage used by the Message_HotlistAddURL protocol.
static nserror ro_hotlist_init(void)
Creates the window for the hotlist tree.
static const query_callback remove_funcs
removal query dialog callbacks.
static nserror hotlist_toolbar_click(struct ro_corewindow *ro_cw, button_bar_action action)
handle clicks in ro hotlist window toolbar.
void ro_gui_hotlist_initialise(void)
initialise the hotlist window template ready for subsequent use.
static wimp_window * dialog_hotlist_template
riscos template for hotlist window
static void ro_gui_hotlist_remove_cancelled(query_id id, enum query_response res, void *p)
Callback cancelling a URL delete query.
static bool hotlist_menu_select(wimp_w w, wimp_i i, wimp_menu *menu, wimp_selection *selection, menu_action action)
Handle selections from the hotlist menu.
nserror ro_gui_hotlist_finalise(void)
Free any resources allocated for the cookie window.
static void ro_gui_hotlist_remove_confirmed(query_id id, enum query_response res, void *p)
Callback confirming a URL delete query.
static nserror hotlist_mouse(struct ro_corewindow *ro_cw, browser_mouse_state mouse_state, int x, int y)
callback for mouse event on ro hotlist window
#define message_HOTLIST_ADD_URL
@ THEME_STYLE_HOTLIST_TOOLBAR
browser_mouse_state
Mouse state: 1 is primary mouse button.
Target independent plotting interface.
Interface to platform-specific graphical user interface window operations.
@ GUI_SAVE_HOTLIST_EXPORT_HTML
Interface to key press operations.
#define NSLOG(catname, level, logmsg, args...)
bool ro_message_send_message(wimp_event_no event, wimp_message *message, wimp_t task, void(*callback)(wimp_message *message))
Sends a message and registers a return route for a bounce.
Automated RISC OS message routing (interface).
const char * messages_get(const char *key)
Fast lookup of a message by key from the standard Messages hash.
Localised message support (interface).
NetSurf URL handling (interface).
nserror nsurl_create(const char *const url_s, nsurl **url)
Create a NetSurf URL object from a URL string.
void nsurl_unref(nsurl *url)
Drop a reference to a NetSurf URL object.
const char * nsurl_access(const nsurl *url)
Access a NetSurf URL object as a string.
size_t nsurl_length(const nsurl *url)
Find the length of a NetSurf URL object's URL, as returned by nsurl_access.
nsurl * nsurl_ref(nsurl *url)
Increment the reference count to a NetSurf URL object.
struct nsurl nsurl
NetSurf URL object.
void query_close(query_id id)
Close a query window without waiting for a response from the user.
query_id query_user(const char *query, const char *detail, const query_callback *cb, void *pw, const char *yes, const char *no)
Display a query to the user, requesting a response, near the current pointer position to keep the req...
nserror ro_corewindow_fini(struct ro_corewindow *ro_cw)
finalise elements of ro core window.
nserror ro_corewindow_init(struct ro_corewindow *ro_cw, const struct button_bar_buttons *tb_buttons, char *tb_order, theme_style tb_style, const char *tb_help)
initialise elements of riscos core window.
RISC OS core window interface.
nserror ro_warn_user(const char *warning, const char *detail)
Display a warning for a serious problem (eg memory exhaustion).
nserror riscos_schedule(int t, void(*callback)(void *p), void *p)
Schedule a callback.
const struct plotter_table ro_plotters
RISC OS plotter operation table.
File/object/selection saving (Interface).
void ro_gui_save_prepare(gui_save_type save_type, struct hlcache_handle *h, char *s, const nsurl *url, const char *title)
Prepares the save box to reflect gui_save_type and a content, and opens it.
bool interactive
Redraw to show interactive features.
nserror(* toolbar_click)(struct ro_corewindow *ro_cw, button_bar_action action)
callback for clicks in ro core window toolbar.
nserror(* mouse)(struct ro_corewindow *ro_cw, browser_mouse_state mouse_state, int x, int y)
callback for mouse event on ro core window
nserror(* toolbar_save)(struct ro_corewindow *ro_cw, char *config)
callback for saving ro core window toolbar state.
nserror(* key)(struct ro_corewindow *ro_cw, uint32_t nskey)
callback for keypress on ro core window
nserror(* draw)(struct ro_corewindow *ro_cw, int originx, int originy, struct rect *r)
callback to draw on drawable area of ro core window
nserror(* toolbar_update)(struct ro_corewindow *ro_cw)
callback for updating state of buttons in ro core window toolbar.
struct toolbar * toolbar
toolbar
URL adding hotlist protocol message block.
char * title
Pointer to the title in RMA.
wimp_MESSAGE_HEADER_MEMBERS char * url
< The standard message header.
char appname[32]
The application name.
change hotlist protocol message block.
Hotlist window container for RISC OS.
struct ro_corewindow core
const char * title
Resource title.
Unified URL information database public interface.
const struct url_data * urldb_get_url_data(struct nsurl *url)
Find data for an URL.
Option reading and saving interface.
#define nsoption_charp(OPTION)
Get the value of a string option.
#define nsoption_set_charp(OPTION, VALUE)
set string option in default table
#define nsoption_bool(OPTION)
Get the value of a boolean option.
void ro_gui_set_window_title(wimp_w w, const char *text)
Set a window title.
General RISC OS WIMP/OS library functions (interface).
void * ro_gui_wimp_event_get_user_data(wimp_w w)
Gets the user data associated with a window.
bool ro_gui_wimp_event_register_menu_selection(wimp_w w, bool(*callback)(wimp_w w, wimp_i i, wimp_menu *m, wimp_selection *s, menu_action a))
Register a function to be called following a menu selection.
bool ro_gui_wimp_event_register_menu_prepare(wimp_w w, bool(*callback)(wimp_w w, wimp_i i, wimp_menu *m, wimp_pointer *p))
Register a function to be called before a menu is (re-)opened.
bool ro_gui_wimp_event_register_menu_warning(wimp_w w, void(*callback)(wimp_w w, wimp_i i, wimp_menu *m, wimp_selection *s, menu_action a))
Register a function to be called when a sub-menu warning is received.
bool ro_gui_wimp_event_register_menu(wimp_w w, wimp_menu *m, bool menu_auto, bool position_ibar)
Register a window menu to be (semi-)automatically handled.
Automated RISC OS WIMP event handling (interface).