NetSurf
|
URL Suggestion Menu (implementation). More...
#include <assert.h>
#include <string.h>
#include <stdlib.h>
#include <oslib/wimp.h>
#include "utils/messages.h"
#include "utils/nsurl.h"
#include "netsurf/url_db.h"
#include "riscos/menus.h"
#include "riscos/url_suggest.h"
Go to the source code of this file.
Data Structures | |
struct | url_suggest_item |
Functions | |
static bool | ro_gui_url_suggest_callback (nsurl *url, const struct url_data *data) |
Callback function for urldb_iterate_entries. More... | |
static | wimp_MENU (URL_SUGGEST_MAX_URLS) |
Initialise the URL suggestion menu. More... | |
bool | ro_gui_url_suggest_get_menu_available (void) |
Check if there is a URL suggestion menu available for use. More... | |
bool | ro_gui_url_suggest_prepare_menu (void) |
Builds the URL suggestion menu. More... | |
const char * | ro_gui_url_suggest_get_selection (wimp_selection *selection) |
Process a selection from the URL Suggest menu. More... | |
Variables | |
static int | suggest_entries |
static time_t | suggest_time |
static struct url_suggest_item * | suggest_list |
URL Suggestion Menu (implementation).
Definition in file url_suggest.c.
Callback function for urldb_iterate_entries.
url | URL which matches |
data | Data associated with URL |
Definition at line 158 of file url_suggest.c.
References CONTENT_HTML, CONTENT_TEXTPLAIN, count(), url_data::last_visit, url_suggest_item::next, nsurl_access(), suggest_entries, suggest_list, suggest_time, url_data::type, url_suggest_item::url, URL_SUGGEST_MAX_URLS, url_data::visits, and url_suggest_item::weight.
Referenced by ro_gui_url_suggest_prepare_menu().
bool ro_gui_url_suggest_get_menu_available | ( | void | ) |
Check if there is a URL suggestion menu available for use.
Definition at line 81 of file url_suggest.c.
References ro_gui_url_suggest_prepare_menu().
Referenced by ro_gui_url_bar_update_urlsuggest().
const char * ro_gui_url_suggest_get_selection | ( | wimp_selection * | selection | ) |
Process a selection from the URL Suggest menu.
*selection | The menu selection. |
Definition at line 230 of file url_suggest.c.
References ro_gui_url_suggest_menu, and url_suggest_item::url.
Referenced by ro_gui_url_bar_menu_select().
bool ro_gui_url_suggest_prepare_menu | ( | void | ) |
Builds the URL suggestion menu.
This is called by ro_gui_menu_create() when it is asked to display the url_suggest_menu.
/return true if the menu has entries; else false.
Definition at line 94 of file url_suggest.c.
References url_suggest_item::next, ro_gui_url_suggest_callback(), ro_gui_url_suggest_menu, suggest_entries, suggest_list, suggest_time, url_suggest_item::url, URL_SUGGEST_MAX_URLS, and urldb_iterate_entries().
Referenced by ro_gui_dialog_open_url_menu_prepare(), ro_gui_dialog_prepare_open_url(), ro_gui_options_home_initialise(), ro_gui_options_home_menu_prepare(), ro_gui_url_bar_menu_prepare(), and ro_gui_url_suggest_get_menu_available().
|
static |
Initialise the URL suggestion menu.
This MUST be called before anything tries to use the URL menu.
Definition at line 48 of file url_suggest.c.
References messages_get(), ro_gui_menu_init_structure(), ro_gui_url_suggest_menu, suggest_entries, and URL_SUGGEST_MAX_URLS.
|
static |
Definition at line 44 of file url_suggest.c.
Referenced by ro_gui_url_suggest_callback(), ro_gui_url_suggest_prepare_menu(), and wimp_MENU().
|
static |
Definition at line 46 of file url_suggest.c.
Referenced by ro_gui_url_suggest_callback(), and ro_gui_url_suggest_prepare_menu().
|
static |
Definition at line 45 of file url_suggest.c.
Referenced by ro_gui_url_suggest_callback(), and ro_gui_url_suggest_prepare_menu().