NetSurf
Data Structures | Functions | Variables
completion.c File Reference

Implementation of url entry completion. More...

#include <stdlib.h>
#include "utils/log.h"
#include "utils/messages.h"
#include "utils/nsoption.h"
#include "utils/nsurl.h"
#include "netsurf/url_db.h"
#include "netsurf/browser_window.h"
#include "desktop/searchweb.h"
#include "gtk/compat.h"
#include "gtk/warn.h"
#include "gtk/scaffolding.h"
#include "gtk/toolbar_items.h"
#include "gtk/window.h"
#include "gtk/completion.h"
Include dependency graph for completion.c:

Go to the source code of this file.

Data Structures

struct  nsgtk_completion_ctx
 

Functions

static gboolean nsgtk_completion_match (GtkEntryCompletion *completion, const gchar *key, GtkTreeIter *iter, gpointer user_data)
 completion row matcher More...
 
static bool nsgtk_completion_udb_callback (nsurl *url, const struct url_data *data)
 callback for each entry to add to completion list More...
 
static gboolean nsgtk_completion_match_select (GtkEntryCompletion *widget, GtkTreeModel *model, GtkTreeIter *iter, gpointer data)
 event handler for when a completion suggestion is selected. More...
 
void nsgtk_completion_init (void)
 initialise completion list store More...
 
gboolean nsgtk_completion_update (GtkEntry *entry)
 update completion list store. More...
 
nserror nsgtk_completion_connect_signals (GtkEntry *entry, struct browser_window *(*get_bw)(void *ctx), void *get_bw_ctx)
 connect signals on entry completion More...
 

Variables

GtkListStore * nsgtk_completion_list
 

Detailed Description

Implementation of url entry completion.

Definition in file completion.c.

Function Documentation

◆ nsgtk_completion_connect_signals()

nserror nsgtk_completion_connect_signals ( GtkEntry *  entry,
struct browser_window *(*)(void *ctx)  get_bw,
void *  get_bw_ctx 
)

connect signals on entry completion

Definition at line 148 of file completion.c.

Referenced by toolbar_connect_signal().

Here is the caller graph for this function:

◆ nsgtk_completion_init()

void nsgtk_completion_init ( void  )

initialise completion list store

Definition at line 127 of file completion.c.

References nsgtk_completion_list.

Referenced by nsgtk_setup().

Here is the caller graph for this function:

◆ nsgtk_completion_match()

static gboolean nsgtk_completion_match ( GtkEntryCompletion *  completion,
const gchar *  key,
GtkTreeIter *  iter,
gpointer  user_data 
)
static

completion row matcher

Definition at line 58 of file completion.c.

◆ nsgtk_completion_match_select()

static gboolean nsgtk_completion_match_select ( GtkEntryCompletion *  widget,
GtkTreeModel *  model,
GtkTreeIter *  iter,
gpointer  data 
)
static

event handler for when a completion suggestion is selected.

Definition at line 91 of file completion.c.

References browser_window_navigate(), browser_window::bw, BW_NAVIGATE_HISTORY, G_VALUE_INIT, nsgtk_completion_ctx::get_bw, nsgtk_completion_ctx::get_bw_ctx, messages_get_errorcode(), NSERROR_OK, nsgtk_warning(), nsurl_unref(), search_web_omni(), and SEARCH_WEB_OMNI_NONE.

Here is the call graph for this function:

◆ nsgtk_completion_udb_callback()

static bool nsgtk_completion_udb_callback ( nsurl url,
const struct url_data data 
)
static

callback for each entry to add to completion list

Definition at line 75 of file completion.c.

References nsgtk_completion_list, nsurl_access(), and url_data::visits.

Referenced by nsgtk_completion_update().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nsgtk_completion_update()

gboolean nsgtk_completion_update ( GtkEntry *  entry)

update completion list store.

Definition at line 134 of file completion.c.

References nsgtk_completion_list, nsgtk_completion_udb_callback(), nsoption_bool, and urldb_iterate_partial().

Referenced by url_entry_changed_cb().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ nsgtk_completion_list

GtkListStore* nsgtk_completion_list