Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
gtkentry.c File Reference
#include "gtkentry.h"
#include "common/darktable.h"
+ Include dependency graph for gtkentry.c:

Functions

static gboolean on_match_select (GtkEntryCompletion *widget, GtkTreeModel *model, GtkTreeIter *iter, gpointer user_data)
 
static gboolean on_match_func (GtkEntryCompletion *completion, const gchar *key, GtkTreeIter *iter, gpointer user_data)
 
void dt_gtkentry_setup_completion (GtkEntry *entry, const dt_gtkentry_completion_spec *compl_list, const char *trigger_char)
 
const dt_gtkentry_completion_specdt_gtkentry_get_default_path_compl_list ()
 
gchar * dt_gtkentry_build_completion_tooltip_text (const gchar *header, const dt_gtkentry_completion_spec *compl_list)
 

Function Documentation

◆ dt_gtkentry_build_completion_tooltip_text()

gchar * dt_gtkentry_build_completion_tooltip_text ( const gchar *  header,
const dt_gtkentry_completion_spec compl_list 
)

Builds the tooltip text for a GtkEntry. Uses the same datatype as used for initializing the auto completion table above.

Returns
g_malloc()'ed string. Must be free'd by the caller.

◆ dt_gtkentry_get_default_path_compl_list()

const dt_gtkentry_completion_spec * dt_gtkentry_get_default_path_compl_list ( )

The default set of image metadata of interest for use in image paths.

Referenced by _formula_editing_started(), gui_init(), and gui_init().

◆ dt_gtkentry_setup_completion()

void dt_gtkentry_setup_completion ( GtkEntry *  entry,
const dt_gtkentry_completion_spec compl_list,
const char *  trigger_char 
)

This function initializes entry with an autocomplete table specified by compl_list. To set the default darktable variables, use dt_gtkentry_get_default_path_compl_list().

Parameters
[in]entryGtkEntry
[in]compl_listA {NULL,NULL} terminated array containing {variable,description} for each available completion text.
[in]trigger_charThe input character that will start the best-match lookup

References COMPL_DESCRIPTION, COMPL_VARNAME, model, on_match_func(), on_match_select(), and completion_spec::varname.

Referenced by _formula_editing_started(), dt_accels_window(), gui_init(), and gui_init().

◆ on_match_func()

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

Case insensitive substring search for a completion match.

Based on the default matching function in GtkEntryCompletion.

This function is called once for each iter in the GtkEntryCompletion's list of completion entries (model).

Parameters
completionCompletion object to apply this function on
keyComplete string from the GtkEntry.
iterItem in list of autocomplete database to compare key against.
user_data(const char *) The character that will trigger the lookup for best match.

References COMPL_VARNAME, FALSE, model, and TRUE.

Referenced by dt_gtkentry_setup_completion().

◆ on_match_select()

static gboolean on_match_select ( GtkEntryCompletion *  widget,
GtkTreeModel *  model,
GtkTreeIter *  iter,
gpointer  user_data 
)
static

Called when the user selects an entry from the autocomplete list.

Parameters
[in]widget
[in]modelData structure containing autocomplete strings.
[in]iterPointer into data structure.
[in]user_dataunused here
Returns
Currently always true

References COMPL_VARNAME, model, and TRUE.

Referenced by dt_gtkentry_setup_completion().