29#include <oslib/wimp.h>
48#define MAXIMUM_VISIBLE_LINES 7
103 wimp_window_state state;
132 case IS_WIMP_KEY | wimp_KEY_CONTROL | wimp_KEY_DOWN:
142 match_url = (url != NULL) ? strdup(url) : NULL;
143 if (match_url == NULL) {
174 NSLOG(netsurf, INFO,
"xwimp_force_redraw: 0x%x: %s",
175 error->errnum, error->errmess);
200 if (strlen(match_url) == 0)
212 error = xwimp_get_window_state(&state);
215 "xwimp_get_window_state: 0x%x: %s",
229 for (i = 0; i < lines; i++) {
233 0, -(i + 1) * 44, 65536, -i * 44);
236 "xwimp_force_redraw: 0x%x: %s",
272 case IS_WIMP_KEY | wimp_KEY_CONTROL | wimp_KEY_DOWN:
288 0, -(old_selection + 1) * 44,
289 65536, -old_selection * 44);
291 NSLOG(netsurf, INFO,
"xwimp_force_redraw: 0x%x: %s",
292 error->errnum, error->errmess);
300 NSLOG(netsurf, INFO,
"xwimp_force_redraw: 0x%x: %s",
301 error->errnum, error->errmess);
305 if (old_selection == -1) {
330 error = xwimp_get_window_state(&state);
332 NSLOG(netsurf, INFO,
"xwimp_get_window_state: 0x%x: %s",
333 error->errnum, error->errmess);
340 height = state.visible.y1 - state.visible.y0;
341 if (state.yscroll -
height >
348 NSLOG(netsurf, INFO,
"xwimp_open_window: 0x%x: %s",
349 error->errnum, error->errmess);
368 nsurl **array_extend;
400 os_box extent = { 0, 0, 0, 0 };
402 wimp_window_state toolbar_state;
403 wimp_window_state state;
423 error = xwimp_get_window_state(&state);
425 NSLOG(netsurf, INFO,
"xwimp_get_window_state: 0x%x: %s",
426 error->errnum, error->errmess);
436 error = xwimp_get_window_state(&toolbar_state);
438 NSLOG(netsurf, INFO,
"xwimp_get_window_state: 0x%x: %s",
439 error->errnum, error->errmess);
445 NSLOG(netsurf, INFO,
"Failed to read URL field extent.");
450 extent.y0 = -(lines * 44);
454 NSLOG(netsurf, INFO,
"xwimp_set_extent: 0x%x: %s",
455 error->errnum, error->errmess);
460 state.next = open->next;
461 state.flags &= ~wimp_WINDOW_VSCROLL;
462 state.flags &= ~(4095 << 16);
466 state.flags |= wimp_WINDOW_VSCROLL;
468 state.visible.x0 = open->visible.x0 + 2 + url_extent.x0;
469 state.visible.x1 = open->visible.x0 - 2 + url_extent.x1 - scroll_v;
470 state.visible.y1 = open->visible.y1 - url_extent.y1 + 2;
471 state.visible.y0 = state.visible.y1 - (lines * 44);
472 if (state.visible.x1 + scroll_v > toolbar_state.visible.x1)
473 state.visible.x1 = toolbar_state.visible.x1 - scroll_v;
474 if (state.visible.x1 - state.visible.x0 < 0) {
477 NSLOG(netsurf, INFO,
"xwimp_close_window: 0x%x: %s",
478 error->errnum, error->errmess);
482 error = xwimp_open_window_nested_with_flags(&state,
485 NSLOG(netsurf, INFO,
"xwimp_open_window: 0x%x: %s",
486 error->errnum, error->errmess);
526 NSLOG(netsurf, INFO,
"xwimp_close_window: 0x%x: %s",
527 error->errnum, error->errmess);
531 return currently_open;
547 wimp_ICON_TEXT | wimp_ICON_FILLED |
548 (wimp_COLOUR_BLACK << wimp_ICON_FG_COLOUR_SHIFT) |
549 (wimp_COLOUR_WHITE << wimp_ICON_BG_COLOUR_SHIFT);
555 wimp_ICON_INDIRECTED | wimp_ICON_FILLED |
556 wimp_ICON_HCENTRED | wimp_ICON_VCENTRED;
567 NSLOG(netsurf, INFO,
"Attempt to redraw with no matches made");
574 more = wimp_redraw_window(redraw);
576 int first_line, last_line;
577 int origin_y = redraw->box.y1 - redraw->yscroll;
578 int clip_y0 = redraw->clip.y0 - origin_y;
579 int clip_y1 = redraw->clip.y1 - origin_y;
581 first_line = (-clip_y1) / 44;
582 last_line = (-clip_y0 + 43) / 44;
603 "xwimp_plot_icon: 0x%x: %s",
628 "xwimp_plot_icon: 0x%x: %s",
634 more = wimp_get_rectangle(redraw);
656 wimp_mouse_state current;
658 current = pointer->buttons;
659 pointer->buttons = 0;
661 pointer->buttons = current;
669 wimp_window_state state;
682 error = xwimp_get_window_state(&
state);
684 NSLOG(netsurf, INFO,
"xwimp_get_window_state: 0x%x: %s",
685 error->errnum, error->errmess);
709 0, -(old_selection + 1) * 44,
710 65536, -old_selection * 44);
712 NSLOG(netsurf, INFO,
"xwimp_force_redraw: 0x%x: %s",
713 error->errnum, error->errmess);
720 NSLOG(netsurf, INFO,
"xwimp_force_redraw: 0x%x: %s",
721 error->errnum, error->errmess);
725 if (!pointer->buttons)
734 if (pointer->buttons == wimp_CLICK_SELECT) {
760 }
else if (pointer->buttons == wimp_CLICK_ADJUST) {
Browser window creation and manipulation interface.
nserror browser_window_navigate(struct browser_window *bw, struct nsurl *url, struct nsurl *referrer, enum browser_window_nav_flags flags, char *post_urlenc, struct fetch_multipart_data *post_multipart, struct hlcache_handle *parent)
Start fetching a page in a browser window.
@ BW_NAVIGATE_HISTORY
this will form a new history node (don't set for back/reload/etc)
wimp_w dialog_url_complete
RISc OS global history interface.
void ro_mouse_track_start(void(*poll_end)(wimp_leaving *leaving, void *data), void(*poll_track)(wimp_pointer *pointer, void *data), void *data)
Start tracking the mouse in a window, providing a function to be called on null polls and optionally ...
Mouse dragging and tracking support interface for RISC OS.
Browser window handling (interface).
#define NSLOG(catname, level, logmsg, args...)
NetSurf URL handling (interface).
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.
int ro_content_filetype_from_type(content_type type)
Determine the RISC OS filetype from a content type.
RISC OS filetpe interface.
nserror ro_warn_user(const char *warning, const char *detail)
Display a warning for a serious problem (eg memory exhaustion).
struct gui_window * ro_gui_window_lookup(wimp_w window)
Convert a RISC OS window handle to a gui_window.
Interface to utility string handling.
first entry in window list
struct fbtk_widget_s * toolbar
struct browser_window * bw
The 'content' window that is rendered in the gui_window.
unsigned int visits
Visit count.
content_type type
Type of resource.
static wimp_w url_complete_parent
static wimp_icon url_complete_icon
static int url_complete_matches_selection
void ro_gui_url_complete_start(struct toolbar *toolbar)
Should be called when the caret is placed into a URL completion icon.
static char * url_complete_original_url
static int url_complete_matches_available
bool ro_gui_url_complete_keypress(struct toolbar *toolbar, uint32_t key)
Handles a keypress for URL completion.
void ro_gui_url_complete_resize(struct toolbar *toolbar, wimp_open *open)
Move and resize the url completion window to match the toolbar.
#define MAXIMUM_VISIBLE_LINES
void ro_gui_url_complete_entering(wimp_entering *entering)
Handle the pointer entering the URL completion window.
static char url_complete_icon_null[]
static bool url_complete_callback(nsurl *url, const struct url_data *data)
Callback function for urldb_iterate_partial.
static void ro_gui_url_complete_mouse_at(wimp_pointer *pointer, void *data)
Handle mouse movement over the URL completion window.
static char url_complete_icon_sprite[12]
static wimp_icon url_complete_sprite
bool ro_gui_url_complete_click(wimp_pointer *pointer)
Handle mouse clicks in the URL completion window.
static bool url_complete_matches_reset
static int url_complete_matches_allocated
static int url_complete_keypress_selection
bool ro_gui_url_complete_close(void)
Try to close the current url completion window.
static bool url_complete_memory_exhausted
static nsurl * url_complete_redraw[MAXIMUM_VISIBLE_LINES]
void ro_gui_url_complete_redraw(wimp_draw *redraw)
Redraws a section of the URL completion window.
static nsurl ** url_complete_matches
static char * url_complete_matched_string
Central repository for URL data (interface).
Unified URL information database public interface.
void urldb_iterate_partial(const char *prefix, bool(*callback)(struct nsurl *url, const struct url_data *data))
Iterate over entries in the database which match the given prefix.
void urldb_iterate_entries(bool(*callback)(struct nsurl *url, const struct url_data *data))
Iterate over all entries in database.
const struct url_data * urldb_get_url_data(struct nsurl *url)
Find data for an URL.
Option reading and saving interface.
#define nsoption_bool(OPTION)
Get the value of a boolean option.
bool ro_gui_wimp_sprite_exists(const char *sprite)
Check if a sprite is present in the Wimp sprite pool.
void ro_gui_user_redraw(wimp_draw *redraw, bool user_fill, os_colour user_colour)
Performs simple user redraw for a window.
int ro_get_vscroll_width(wimp_w w)
Gets the vertical scrollbar width.
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)
static nserror line(const struct redraw_context *ctx, const plot_style_t *style, const struct rect *line)
Plots a line.