NetSurf
url_complete.c
Go to the documentation of this file.
1/*
2 * Copyright 2005 Richard Wilson <info@tinct.net>
3 *
4 * This file is part of NetSurf, http://www.netsurf-browser.org/
5 *
6 * NetSurf is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * NetSurf is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19/**
20 * \file
21 * GUI URL auto-completion implementation.
22 */
23
24#include <assert.h>
25#include <stdbool.h>
26#include <stdio.h>
27#include <stdlib.h>
28#include <string.h>
29#include <oslib/wimp.h>
30
31#include "utils/log.h"
32#include "utils/nsoption.h"
33#include "utils/nsurl.h"
34#include "netsurf/url_db.h"
36
38#include "riscos/gui.h"
39#include "riscos/window.h"
40#include "riscos/mouse.h"
41#include "riscos/toolbar.h"
42#include "riscos/url_complete.h"
43#include "riscos/wimp.h"
44#include "riscos/wimp_event.h"
45#include "riscos/wimputils.h"
46#include "riscos/filetype.h"
47
48#define MAXIMUM_VISIBLE_LINES 7
49
53static char *url_complete_matched_string = NULL;
56static wimp_w url_complete_parent = 0;
57static bool url_complete_matches_reset = false;
58static char *url_complete_original_url = NULL;
60
62static char url_complete_icon_null[] = "";
64static wimp_icon url_complete_icon;
65static wimp_icon url_complete_sprite;
66static int mouse_x;
67static int mouse_y;
68
69static bool url_complete_callback(nsurl *url,
70 const struct url_data *data);
71static void ro_gui_url_complete_mouse_at(wimp_pointer *pointer, void *data);
72
73
74/* This is an exported interface documented in url_complete.h */
75
77{
78 const char *url;
79 wimp_w parent;
80
81 assert(toolbar != NULL);
83
86 return;
87
90 if (url != NULL) {
91 url_complete_matched_string = strdup(url);
94 }
95}
96
97
98/* This is an exported interface documented in url_complete.h */
99
101{
102 wimp_w parent;
103 wimp_window_state state;
104 char *match_url;
105 const char *url;
106 int old_selection;
107 int height;
108 os_error *error;
109 bool currently_open;
110
111 assert(toolbar != NULL);
113
114 /* we must have a toolbar/url bar */
116 (!nsoption_bool(url_suggestion))) {
118 return false;
119 }
120
121 /* if we are currently active elsewhere, remove the previous window */
122 currently_open = ((parent == url_complete_parent) &&
126
127 /* forcibly open on down keys */
128 if ((!currently_open) && (url_complete_matched_string)) {
129 switch (key) {
130 case IS_WIMP_KEY | wimp_KEY_DOWN:
131 case IS_WIMP_KEY | wimp_KEY_PAGE_DOWN:
132 case IS_WIMP_KEY | wimp_KEY_CONTROL | wimp_KEY_DOWN:
135 }
136 }
137
138
139 /* get the text to match */
142 match_url = (url != NULL) ? strdup(url) : NULL;
143 if (match_url == NULL) {
145 return false;
146 }
147
148 /* if the text to match has changed then update it */
150 (strcmp(match_url, url_complete_matched_string))) {
151
152 /* memorize the current matches */
153 int i;
154 int lines = MAXIMUM_VISIBLE_LINES;
158 for (i = 0; i < MAXIMUM_VISIBLE_LINES; i++) {
159 if (i < lines) {
162 } else {
163 url_complete_redraw[i] = NULL;
164 }
165 }
166 }
167
168 /* our selection gets wiped */
169 error = xwimp_force_redraw(dialog_url_complete,
170 0,
172 65536, -url_complete_matches_selection * 44);
173 if (error) {
174 NSLOG(netsurf, INFO, "xwimp_force_redraw: 0x%x: %s",
175 error->errnum, error->errmess);
176 ro_warn_user("WimpError", error->errmess);
177 }
178
179 /* clear our state */
182 url_complete_matched_string = match_url;
187
188 /* get some initial memory */
190 url_complete_matches = malloc(64 * sizeof(char *));
193 return false;
194 }
196 }
197
198 /* find matches */
200 if (strlen(match_url) == 0)
202 else
207 return false;
208 }
209
210 /* update the window */
211 state.w = parent;
212 error = xwimp_get_window_state(&state);
213 if (error) {
214 NSLOG(netsurf, INFO,
215 "xwimp_get_window_state: 0x%x: %s",
216 error->errnum,
217 error->errmess);
218 ro_warn_user("WimpError", error->errmess);
219 return false;
220 }
224
225 /* redraw the relevant bits of the window */
226 lines = MAXIMUM_VISIBLE_LINES;
229 for (i = 0; i < lines; i++) {
230 if (url_complete_redraw[i] !=
232 error = xwimp_force_redraw(dialog_url_complete,
233 0, -(i + 1) * 44, 65536, -i * 44);
234 if (error) {
235 NSLOG(netsurf, INFO,
236 "xwimp_force_redraw: 0x%x: %s",
237 error->errnum,
238 error->errmess);
239 ro_warn_user("WimpError",
240 error->errmess);
241 }
242 }
243 }
244 } else {
245 free(match_url);
246 }
247
248 /* handle keypresses */
249 if (!currently_open)
250 return false;
251
252 old_selection = url_complete_matches_selection;
253
254 switch (key) {
255 case IS_WIMP_KEY | wimp_KEY_UP:
257 break;
258 case IS_WIMP_KEY | wimp_KEY_DOWN:
260 break;
261 case IS_WIMP_KEY | wimp_KEY_PAGE_UP:
264 break;
265 case IS_WIMP_KEY | wimp_KEY_PAGE_DOWN:
268 break;
269 case IS_WIMP_KEY | wimp_KEY_CONTROL | wimp_KEY_UP:
271 break;
272 case IS_WIMP_KEY | wimp_KEY_CONTROL | wimp_KEY_DOWN:
274 break;
275 }
276
281 else if (url_complete_matches_selection < -1)
283
284 if (old_selection == url_complete_matches_selection)
285 return false;
286
287 error = xwimp_force_redraw(dialog_url_complete,
288 0, -(old_selection + 1) * 44,
289 65536, -old_selection * 44);
290 if (error) {
291 NSLOG(netsurf, INFO, "xwimp_force_redraw: 0x%x: %s",
292 error->errnum, error->errmess);
293 ro_warn_user("WimpError", error->errmess);
294 }
295
296 error = xwimp_force_redraw(dialog_url_complete,
297 0, -(url_complete_matches_selection + 1) * 44,
298 65536, -url_complete_matches_selection * 44);
299 if (error) {
300 NSLOG(netsurf, INFO, "xwimp_force_redraw: 0x%x: %s",
301 error->errnum, error->errmess);
302 ro_warn_user("WimpError", error->errmess);
303 }
304
305 if (old_selection == -1) {
307 url_complete_original_url = malloc(strlen(url) + 1);
309 return false;
310 strcpy(url_complete_original_url, url);
311 }
312
315 url_complete_original_url, true, false);
316 } else {
320 true, false);
325 }
327
328 /* auto-scroll */
329 state.w = dialog_url_complete;
330 error = xwimp_get_window_state(&state);
331 if (error) {
332 NSLOG(netsurf, INFO, "xwimp_get_window_state: 0x%x: %s",
333 error->errnum, error->errmess);
334 ro_warn_user("WimpError", error->errmess);
335 return true;
336 }
337
338 if (state.yscroll < -(url_complete_matches_selection * 44))
339 state.yscroll = -(url_complete_matches_selection * 44);
340 height = state.visible.y1 - state.visible.y0;
341 if (state.yscroll - height >
342 -((url_complete_matches_selection + 1) * 44))
343 state.yscroll =
345
346 error = xwimp_open_window(PTR_WIMP_OPEN(&state));
347 if (error) {
348 NSLOG(netsurf, INFO, "xwimp_open_window: 0x%x: %s",
349 error->errnum, error->errmess);
350 ro_warn_user("WimpError", error->errmess);
351 return true;
352 }
353
354 return true;
355}
356
357
358/**
359 * Callback function for urldb_iterate_partial
360 *
361 * \param url URL which matches
362 * \param data Data associated with URL
363 * \return true to continue iteration, false otherwise
364 */
365
366bool url_complete_callback(nsurl *url, const struct url_data *data)
367{
368 nsurl **array_extend;
369
370 /* Ignore unvisited URLs */
371 if (data->visits == 0)
372 return true;
373
375
378
379 array_extend = (nsurl **)realloc(url_complete_matches,
381 sizeof(nsurl *));
382 if (!array_extend) {
384 return false;
385 }
386 url_complete_matches = array_extend;
388 }
389
391
392 return true;
393}
394
395
396/* This is an exported interface documented in url_complete.h */
397
398void ro_gui_url_complete_resize(struct toolbar *toolbar, wimp_open *open)
399{
400 os_box extent = { 0, 0, 0, 0 };
401 os_box url_extent;
402 wimp_window_state toolbar_state;
403 wimp_window_state state;
404 os_error *error;
405 int lines;
406 int scroll_v = 0;
407
408 /* only react to our window */
409 if (open->w != url_complete_parent)
410 return;
411
412 /* if there is no toolbar, or there is no URL bar shown,
413 * or there are no URL matches, close it */
418 return;
419 }
420
421 /* get our current auto-complete window state for the scroll values */
422 state.w = dialog_url_complete;
423 error = xwimp_get_window_state(&state);
424 if (error) {
425 NSLOG(netsurf, INFO, "xwimp_get_window_state: 0x%x: %s",
426 error->errnum, error->errmess);
427 ro_warn_user("WimpError", error->errmess);
428 return;
429 }
430
432 state.yscroll = 0;
433
434 /* move the window to the correct position */
435 toolbar_state.w = ro_toolbar_get_window(toolbar);
436 error = xwimp_get_window_state(&toolbar_state);
437 if (error) {
438 NSLOG(netsurf, INFO, "xwimp_get_window_state: 0x%x: %s",
439 error->errnum, error->errmess);
440 ro_warn_user("WimpError", error->errmess);
441 return;
442 }
443
444 if (!ro_toolbar_get_url_field_extent(toolbar, &url_extent)) {
445 NSLOG(netsurf, INFO, "Failed to read URL field extent.");
446 return;
447 }
448
450 extent.y0 = -(lines * 44);
451 extent.x1 = 65536;
452 error = xwimp_set_extent(dialog_url_complete, &extent);
453 if (error) {
454 NSLOG(netsurf, INFO, "xwimp_set_extent: 0x%x: %s",
455 error->errnum, error->errmess);
456 ro_warn_user("WimpError", error->errmess);
457 return;
458 }
459
460 state.next = open->next;
461 state.flags &= ~wimp_WINDOW_VSCROLL;
462 state.flags &= ~(4095 << 16); /* clear bits 16-27 */
463 if (lines > MAXIMUM_VISIBLE_LINES) {
464 lines = MAXIMUM_VISIBLE_LINES;
465 scroll_v = ro_get_vscroll_width(NULL) - 2;
466 state.flags |= wimp_WINDOW_VSCROLL;
467 }
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) {
475 error = xwimp_close_window(dialog_url_complete);
476 if (error) {
477 NSLOG(netsurf, INFO, "xwimp_close_window: 0x%x: %s",
478 error->errnum, error->errmess);
479 ro_warn_user("WimpError", error->errmess);
480 }
481 } else {
482 error = xwimp_open_window_nested_with_flags(&state,
483 (wimp_w)-1, 0);
484 if (error) {
485 NSLOG(netsurf, INFO, "xwimp_open_window: 0x%x: %s",
486 error->errnum, error->errmess);
487 ro_warn_user("WimpError", error->errmess);
488 return;
489 }
490 open->next = dialog_url_complete;
491 }
492}
493
494
495/* This is an exported interface documented in url_complete.h */
496
498{
499 os_error *error;
500 bool currently_open;
501
502 /* There used to be a check here to see if the icon clicked was the
503 * URL text field in the toolbar. Since this only applied to clicks
504 * originating from the toolbar module following the restructuring,
505 * and this check was better done within the toolbar, it has been
506 * removed from this function and the associated parameters removed.
507 */
508
509 currently_open = ((url_complete_parent != NULL) &&
511
523
524 error = xwimp_close_window(dialog_url_complete);
525 if (error) {
526 NSLOG(netsurf, INFO, "xwimp_close_window: 0x%x: %s",
527 error->errnum, error->errmess);
528 ro_warn_user("WimpError", error->errmess);
529 }
530
531 return currently_open;
532}
533
534
535/* This is an exported interface documented in url_complete.h */
536
537void ro_gui_url_complete_redraw(wimp_draw *redraw)
538{
539 osbool more;
540 os_error *error;
541 int line;
542 const struct url_data *data;
543 int type;
544
545 /* initialise our icon */
546 url_complete_icon.flags = wimp_ICON_INDIRECTED | wimp_ICON_VCENTRED |
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);
550 url_complete_icon.extent.x0 = 50;
551 url_complete_icon.extent.x1 = 16384;
552 url_complete_icon.data.indirected_text.validation =
554 url_complete_sprite.flags = wimp_ICON_TEXT | wimp_ICON_SPRITE |
555 wimp_ICON_INDIRECTED | wimp_ICON_FILLED |
556 wimp_ICON_HCENTRED | wimp_ICON_VCENTRED;
557 url_complete_sprite.extent.x0 = 0;
558 url_complete_sprite.extent.x1 = 50;
559 url_complete_sprite.data.indirected_text.text =
561 url_complete_sprite.data.indirected_text.validation =
563 url_complete_sprite.data.indirected_text.size = 1;
564
565 /* no matches? no redraw */
567 NSLOG(netsurf, INFO, "Attempt to redraw with no matches made");
568 /* Fill is never used, so make it something obvious */
569 ro_gui_user_redraw(redraw, false, os_COLOUR_BLACK);
570 return;
571 }
572
573 /* redraw */
574 more = wimp_redraw_window(redraw);
575 while (more) {
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;
580
581 first_line = (-clip_y1) / 44;
582 last_line = (-clip_y0 + 43) / 44;
583
584 for (line = first_line; line < last_line; line++) {
586 url_complete_icon.flags |=
587 wimp_ICON_SELECTED;
588 else
589 url_complete_icon.flags &=
590 ~wimp_ICON_SELECTED;
591 url_complete_icon.extent.y1 = -line * 44;
592 url_complete_icon.extent.y0 = -(line + 1) * 44;
593 url_complete_icon.data.indirected_text.text =
594 (char *)nsurl_access(
596 url_complete_icon.data.indirected_text.size =
599
600 error = xwimp_plot_icon(&url_complete_icon);
601 if (error) {
602 NSLOG(netsurf, INFO,
603 "xwimp_plot_icon: 0x%x: %s",
604 error->errnum,
605 error->errmess);
606 ro_warn_user("WimpError", error->errmess);
607 }
608
610 if (data)
612 data->type);
613 else
614 type = 0;
615
616 sprintf(url_complete_icon_sprite, "Ssmall_%.3x",
617 type);
618
622 "Ssmall_xxx");
623 url_complete_sprite.extent.y1 = -line * 44;
624 url_complete_sprite.extent.y0 = -(line + 1) * 44;
625 error = xwimp_plot_icon(&url_complete_sprite);
626 if (error) {
627 NSLOG(netsurf, INFO,
628 "xwimp_plot_icon: 0x%x: %s",
629 error->errnum,
630 error->errmess);
631 ro_warn_user("WimpError", error->errmess);
632 }
633 }
634 more = wimp_get_rectangle(redraw);
635 }
636}
637
638
639/* This is an exported interface documented in url_complete.h */
640
641void ro_gui_url_complete_entering(wimp_entering *entering)
642{
644}
645
646
647/**
648 * Handle mouse movement over the URL completion window.
649 *
650 * \param *pointer The pointer state
651 * \param *data NULL data pointer expected by mouse tracker
652 */
653
654void ro_gui_url_complete_mouse_at(wimp_pointer *pointer, void *data)
655{
656 wimp_mouse_state current;
657
658 current = pointer->buttons;
659 pointer->buttons = 0;
661 pointer->buttons = current;
662}
663
664
665/* This is an exported interface documented in url_complete.h */
666
667bool ro_gui_url_complete_click(wimp_pointer *pointer)
668{
669 wimp_window_state state;
670 os_error *error;
671 int selection;
672 struct gui_window *g;
673
674 if ((mouse_x == pointer->pos.x) && (mouse_y == pointer->pos.y) &&
675 (!pointer->buttons))
676 return false;
677
678 mouse_x = pointer->pos.x;
679 mouse_y = pointer->pos.y;
680
682 error = xwimp_get_window_state(&state);
683 if (error) {
684 NSLOG(netsurf, INFO, "xwimp_get_window_state: 0x%x: %s",
685 error->errnum, error->errmess);
686 ro_warn_user("WimpError", error->errmess);
687 return false;
688 }
689
690 selection = (state.visible.y1 - pointer->pos.y - state.yscroll) / 44;
692 int old_selection;
693
695 const char *url;
696
698 if (!g)
699 return false;
704 return false;
705 }
706 old_selection = url_complete_matches_selection;
708 error = xwimp_force_redraw(dialog_url_complete,
709 0, -(old_selection + 1) * 44,
710 65536, -old_selection * 44);
711 if (error) {
712 NSLOG(netsurf, INFO, "xwimp_force_redraw: 0x%x: %s",
713 error->errnum, error->errmess);
714 ro_warn_user("WimpError", error->errmess);
715 }
716 error = xwimp_force_redraw(dialog_url_complete,
717 0, -(url_complete_matches_selection + 1) * 44,
718 65536, -url_complete_matches_selection * 44);
719 if (error) {
720 NSLOG(netsurf, INFO, "xwimp_force_redraw: 0x%x: %s",
721 error->errnum, error->errmess);
722 ro_warn_user("WimpError", error->errmess);
723 }
724 }
725 if (!pointer->buttons)
726 return true;
727
728 /* find owning window */
730 if (!g)
731 return false;
732
733 /* Select sets the text and launches */
734 if (pointer->buttons == wimp_CLICK_SELECT) {
738 true, false);
739
740 /** \todo The interaction of components here is hideous */
741 /* Do NOT make any attempt to use any of the global url
742 * completion variables after this call to browser_window_navigate.
743 * They will be invalidated by (at least):
744 * + ro_gui_window_set_url
745 * + destruction of (i)frames within the current page
746 * Any attempt to use them will probably result in a crash.
747 */
748
751 NULL,
753 NULL,
754 NULL,
755 NULL);
756
758
759 /* Adjust just sets the text */
760 } else if (pointer->buttons == wimp_CLICK_ADJUST) {
764 true, false);
766 }
767 return true;
768}
769
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
Definition: dialog.c:79
wimp_w parent
Definition: dialog.c:88
const char * type
Definition: filetype.cpp:44
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 ...
Definition: mouse.c:177
Mouse dragging and tracking support interface for RISC OS.
Browser window handling (interface).
#define NSLOG(catname, level, logmsg, args...)
Definition: log.h:116
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.
Definition: nsurl.h:31
int ro_content_filetype_from_type(content_type type)
Determine the RISC OS filetype from a content type.
Definition: filetype.c:315
RISC OS filetpe interface.
nserror ro_warn_user(const char *warning, const char *detail)
Display a warning for a serious problem (eg memory exhaustion).
Definition: gui.c:2077
int height
Definition: gui.c:161
wimp_w ro_toolbar_get_window(struct toolbar *toolbar)
Return the RO window handle of a toolbar.
Definition: toolbar.c:1511
bool ro_toolbar_get_url_field_extent(struct toolbar *toolbar, os_box *extent)
Return the current work area coordinates of the URL and favicon field's bounding box.
Definition: toolbar.c:1656
const char * ro_toolbar_get_url(struct toolbar *toolbar)
Return a pointer to the URL contained in a browser toolbar.
Definition: toolbar.c:1619
void ro_toolbar_set_url(struct toolbar *toolbar, const char *url, bool is_utf8, bool set_caret)
Set the content of a toolbar's URL field.
Definition: toolbar.c:1609
bool ro_toolbar_get_display_url(struct toolbar *toolbar)
Return true or false depending on whether the given toolbar is set to display the URL bar.
Definition: toolbar.c:1754
wimp_w ro_toolbar_get_parent_window(struct toolbar *toolbar)
Return the RO window handle of the parent window for a toolbar.
Definition: toolbar.c:1503
Window toolbars (interface).
struct gui_window * ro_gui_window_lookup(wimp_w window)
Convert a RISC OS window handle to a gui_window.
Definition: window.c:4823
Interface to utility string handling.
first entry in window list
Definition: gui.c:298
struct fbtk_widget_s * toolbar
Definition: gui.h:46
int state
Definition: window.cpp:73
char * url
Definition: gui.h:154
struct browser_window * bw
The 'content' window that is rendered in the gui_window.
Definition: gui.c:316
unsigned int visits
Visit count.
Definition: url_db.h:38
content_type type
Type of resource.
Definition: url_db.h:40
static wimp_w url_complete_parent
Definition: url_complete.c:56
static wimp_icon url_complete_icon
Definition: url_complete.c:64
static int url_complete_matches_selection
Definition: url_complete.c:54
void ro_gui_url_complete_start(struct toolbar *toolbar)
Should be called when the caret is placed into a URL completion icon.
Definition: url_complete.c:76
static char * url_complete_original_url
Definition: url_complete.c:58
static int url_complete_matches_available
Definition: url_complete.c:52
bool ro_gui_url_complete_keypress(struct toolbar *toolbar, uint32_t key)
Handles a keypress for URL completion.
Definition: url_complete.c:100
void ro_gui_url_complete_resize(struct toolbar *toolbar, wimp_open *open)
Move and resize the url completion window to match the toolbar.
Definition: url_complete.c:398
#define MAXIMUM_VISIBLE_LINES
Definition: url_complete.c:48
void ro_gui_url_complete_entering(wimp_entering *entering)
Handle the pointer entering the URL completion window.
Definition: url_complete.c:641
static char url_complete_icon_null[]
Definition: url_complete.c:62
static bool url_complete_callback(nsurl *url, const struct url_data *data)
Callback function for urldb_iterate_partial.
Definition: url_complete.c:366
static int mouse_x
Definition: url_complete.c:66
static void ro_gui_url_complete_mouse_at(wimp_pointer *pointer, void *data)
Handle mouse movement over the URL completion window.
Definition: url_complete.c:654
static char url_complete_icon_sprite[12]
Definition: url_complete.c:63
static wimp_icon url_complete_sprite
Definition: url_complete.c:65
bool ro_gui_url_complete_click(wimp_pointer *pointer)
Handle mouse clicks in the URL completion window.
Definition: url_complete.c:667
static bool url_complete_matches_reset
Definition: url_complete.c:57
static int url_complete_matches_allocated
Definition: url_complete.c:51
static int mouse_y
Definition: url_complete.c:67
static int url_complete_keypress_selection
Definition: url_complete.c:55
bool ro_gui_url_complete_close(void)
Try to close the current url completion window.
Definition: url_complete.c:497
static bool url_complete_memory_exhausted
Definition: url_complete.c:59
static nsurl * url_complete_redraw[MAXIMUM_VISIBLE_LINES]
Definition: url_complete.c:61
void ro_gui_url_complete_redraw(wimp_draw *redraw)
Redraws a section of the URL completion window.
Definition: url_complete.c:537
static nsurl ** url_complete_matches
Definition: url_complete.c:50
static char * url_complete_matched_string
Definition: url_complete.c:53
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.
Definition: urldb.c:3309
Option reading and saving interface.
#define nsoption_bool(OPTION)
Get the value of a boolean option.
Definition: nsoption.h:304
bool ro_gui_wimp_sprite_exists(const char *sprite)
Check if a sprite is present in the Wimp sprite pool.
Definition: wimp.c:862
void ro_gui_user_redraw(wimp_draw *redraw, bool user_fill, os_colour user_colour)
Performs simple user redraw for a window.
Definition: wimp.c:971
int ro_get_vscroll_width(wimp_w w)
Gets the vertical scrollbar width.
Definition: wimp.c:70
General RISC OS WIMP/OS library functions (interface).
Automated RISC OS WIMP event handling (interface).
#define IS_WIMP_KEY
Definition: wimp_event.h:37
A collection of grubby utilities for working with OSLib's wimp API.
#define PTR_WIMP_OPEN(pstate)
Definition: wimputils.h:39
static nserror line(const struct redraw_context *ctx, const plot_style_t *style, const struct rect *line)
Plots a line.
Definition: plot.c:579