26#include <oslib/wimp.h>
84 .background_images =
true,
132 wimp_window_state state;
134 os_box
box = {0, 0, 0, 0};
136 wimp_pointer pointer;
145 if ((lhw->
x ==
x) && (lhw->
y ==
y)) {
157 NSLOG(netsurf, INFO,
"xwimp_close_window: 0x%x: %s",
158 error->errnum, error->errmess);
170 NSLOG(netsurf, INFO,
"xwimptextop_string_width: 0x%x: %s",
171 error->errnum, error->errmess);
183 error = xwimp_get_icon_state(&ic);
185 NSLOG(netsurf, INFO,
"xwimp_get_icon_state: 0x%x: %s",
186 error->errnum, error->errmess);
191 ic.icon.extent.x0, ic.icon.extent.y0,
192 width + 16, ic.icon.extent.y1);
194 NSLOG(netsurf, INFO,
"xwimp_resize_icon: 0x%x: %s",
195 error->errnum, error->errmess);
201 error = xwimp_get_window_state(&state);
203 NSLOG(netsurf, INFO,
"xwimp_get_window_state: 0x%x: %s",
204 error->errnum, error->errmess);
214 NSLOG(netsurf, INFO,
"xwimp_set_extent: 0x%x: %s",
215 error->errnum, error->errmess);
220 error = xwimp_get_pointer_info(&pointer);
222 NSLOG(netsurf, INFO,
"xwimp_get_pointer_info: 0x%x: %s",
223 error->errnum, error->errmess);
229 state.visible.x0 = pointer.pos.x + 24;
230 state.visible.y0 = pointer.pos.y - 22 - 36;
231 state.visible.x1 = pointer.pos.x + 24 +
width + 16;
232 state.visible.y1 = pointer.pos.y - 22;
233 state.next = wimp_TOP;
237 NSLOG(netsurf, INFO,
"xwimp_open_window: 0x%x: %s",
238 error->errnum, error->errmess);
264 switch (mouse_state) {
299 if ((*win_out) != NULL) {
304 ncwin = calloc(1,
sizeof(*ncwin));
313 NSLOG(netsurf, INFO,
"xwimp_create_window: 0x%x: %s",
314 error->errnum, error->errmess);
358 os_box
box = {0, 0, 0, 0};
359 wimp_window_state state;
373 error = xwimp_set_extent(lhw->
core.
wh, &
box);
375 NSLOG(netsurf, INFO,
"xwimp_set_extent: 0x%x: %s",
376 error->errnum, error->errmess);
383 error = xwimp_get_window_state(&state);
385 NSLOG(netsurf, INFO,
"xwimp_get_window_state: 0x%x: %s",
386 error->errnum, error->errmess);
390 state.visible.x0 = 0;
391 state.visible.y0 = 0;
392 state.visible.x1 =
width;
393 state.visible.y1 =
height;
394 state.next = wimp_HIDDEN;
397 NSLOG(netsurf, INFO,
"xwimp_open_window: 0x%x: %s",
398 error->errnum, error->errmess);
406 error = xwimp_set_caret_position(lhw->
core.
wh, -1, 0, 0, -1, 0);
409 "xwimp_set_caret_position: 0x%x : %s",
426 NSLOG(netsurf, INFO,
"Presenting");
429 NSLOG(netsurf, INFO,
"Failed presenting error code %d", res);
nserror local_history_redraw(struct local_history_session *session, int x, int y, struct rect *clip, const struct redraw_context *ctx)
Redraw the local history.
nserror local_history_scroll_to_cursor(struct local_history_session *session)
Scroll the local history window to ensure the current cursor is shown.
nserror local_history_get_size(struct local_history_session *session, int *width, int *height)
get size of local history content area.
nserror local_history_set(struct local_history_session *session, struct browser_window *bw)
Change the browser window to draw local history for.
nserror local_history_fini(struct local_history_session *session)
Finalise the local history.
bool local_history_keypress(struct local_history_session *session, uint32_t key)
Key press handling.
nserror local_history_init(void *core_window_handle, struct browser_window *bw, struct local_history_session **session)
Initialise the local history.
nserror local_history_get_url(struct local_history_session *session, int x, int y, nsurl **url_out)
get url of entry at position in local history content area.
nserror local_history_mouse_action(struct local_history_session *session, enum browser_mouse_state mouse, int x, int y)
Handles all kinds of mouse action.
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_dialog_close(wimp_w close)
Close a dialog box.
nserror
Enumeration of error codes.
@ NSERROR_NOT_IMPLEMENTED
Functionality is not implemented.
@ NSERROR_NOMEM
Memory exhaustion.
static nserror ro_local_history_mouse(struct ro_corewindow *ro_cw, browser_mouse_state mouse_state, int x, int y)
callback for mouse event on ro local_history window
static nserror ro_local_history_draw(struct ro_corewindow *ro_cw, int originx, int originy, struct rect *r)
callback to draw on drawable area of ro local history window
static struct ro_local_history_window * local_history_window
local_history window is a singleton
static nserror ro_local_history_tooltip(struct ro_local_history_window *lhw, int x, int y)
handle hover mouse movement for tooltips
static nserror ro_local_history_key(struct ro_corewindow *ro_cw, uint32_t nskey)
callback for keypress on ro coookie window
static wimp_window * dialog_local_history_template
riscos template for local_history window
nserror ro_gui_local_history_present(wimp_w parent, struct browser_window *bw)
make the local history window visible.
void ro_gui_local_history_initialise(void)
initialise the local history window template ready for subsequent use.
nserror ro_gui_local_history_finalise(void)
Free any resources allocated for the local history window.
static nserror ro_local_history_init(struct browser_window *bw, struct ro_local_history_window **win_out)
Creates the window for the local_history tree.
static nserror ro_local_history_open(struct ro_local_history_window *lhw, wimp_w parent)
open RISC OS local history window at the correct size
RISC OS local history interface.
browser_mouse_state
Mouse state: 1 is primary mouse button.
@ BROWSER_MOUSE_HOVER
No mouse buttons pressed, May be used to indicate hover or end of drag.
@ BROWSER_MOUSE_LEAVE
pointer leaving window
Target independent plotting interface.
Interface to platform-specific graphical user interface window operations.
Interface to key press operations.
#define NSLOG(catname, level, logmsg, args...)
Localised message support (interface).
NetSurf URL handling (interface).
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.
struct nsurl nsurl
NetSurf URL object.
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).
const struct plotter_table ro_plotters
RISC OS plotter operation table.
File/object/selection saving (Interface).
local history viewer context
bool interactive
Redraw to show interactive features.
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(* 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
struct local_history_session * session
local history window context
struct ro_corewindow core
Option reading and saving interface.
#define nsoption_bool(OPTION)
Get the value of a boolean option.
void ro_gui_set_icon_string(wimp_w w, wimp_i i, const char *text, bool is_utf8)
Set the contents of a text or sprite icon to a string.
General RISC OS WIMP/OS library functions (interface).
Automated RISC OS WIMP event handling (interface).
A collection of grubby utilities for working with OSLib's wimp API.
#define PTR_WIMP_OPEN(pstate)