![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include "widgets/accelerators.h"#include <glib/gi18n.h>#include "widgets/widget_settings.h"#include "widgets/widget_style.h"#include "system/macros.h"#include "system/mem_alloc.h"#include "widgets/gtkentry.h"#include "widgets/gdkkeys.h"#include "widgets/icon_cell_renderer.h"#include <assert.h>#include <glib.h>
Include dependency graph for accelerators.c:Go to the source code of this file.
Data Structures | |
| struct | PayloadClosure |
| struct | _accel_removal_t |
| struct | _accel_lookup_t |
| struct | _accel_treeview_t |
| struct | _accel_window_params_t |
| struct | dt_accels_search_state_t |
| struct | dt_accels_dispatch_state_t |
Macros | |
| #define | DT_ACCEL_SEARCH_INLINE_SEPARATOR " > " |
| #define | DT_ACCEL_SEARCH_DISPATCH_RETRY_DELAY_MS 50 |
| #define | DT_ACCEL_SEARCH_RECENT_KEY "plugins/accel_search/recent_entries" |
| #define | DT_ACCEL_SEARCH_RECENT_MAX 20 |
Typedefs | |
| typedef struct _accel_removal_t | _accel_removal_t |
| typedef struct _accel_lookup_t | _accel_lookup_t |
| typedef struct _accel_treeview_t | _accel_treeview_t |
| typedef struct _accel_window_params_t | _accel_window_params_t |
| typedef struct dt_accels_search_state_t | dt_accels_search_state_t |
| typedef struct dt_accels_dispatch_state_t | dt_accels_dispatch_state_t |
Enumerations | |
| enum | { COL_NAME , COL_KEYS , COL_CLEAR , COL_DESCRIPTION , COL_PATH , COL_SHORTCUT , COL_KEYVAL , COL_MODS , COL_DISPLAY_MODS , NUM_COLUMNS } |
Functions | |
| void | dt_accels_set_global (dt_accels_t *accels) |
| dt_accels_t * | dt_accels_get_global (void) |
| void | dt_accels_set_top_offset_handler (dt_accels_top_offset_handler_t handler) |
| void | dt_accels_set_refocus_handler (dt_accels_refocus_handler_t handler) |
| void | dt_accels_set_recent_handlers (dt_accels_recent_get_handler_t get, dt_accels_recent_set_handler_t set) |
| static void | _g_list_closure_unref (gpointer data) |
| static void | _shortcut_set_widget_data (GtkWidget *widget, dt_shortcut_t *shortcut) |
| static gboolean | _accels_tooltip_query_hook (GSignalInvocationHint *hint, guint n_param_values, const GValue *param_values, gpointer data) |
| static void | _accels_install_tooltip_hook (void) |
| static void | _clean_shortcut (gpointer data) |
| PayloadClosure * | dt_shortcut_get_payload_closure (dt_shortcut_t *shortcut) |
| GClosure * | dt_shortcut_get_closure (dt_shortcut_t *shortcut) |
| void | dt_shortcut_remove_closure (dt_shortcut_t *shortcut, gpointer data) |
| static void | _find_parent_hashtable (gpointer _key, gpointer value, gpointer user_data) |
| static void | _insert_parent_data_into_children (dt_shortcut_t *shortcut) |
| void | dt_shortcut_set_closure (dt_shortcut_t *shortcut, gboolean(*action_callback)(GtkAccelGroup *group, GObject *acceleratable, guint keyval, GdkModifierType mods, gpointer user_data), gpointer data, GtkWidget *widget) |
| dt_accels_t * | dt_accels_init (char *config_file, GtkAccelFlags flags) |
| void | dt_accels_cleanup (dt_accels_t *accels) |
| void | dt_accels_connect_active_group (dt_accels_t *accels, const gchar *group) |
| Connect the contextual active accels group to the window. Views can declare their own set of contextual accels, which can override the global accels, in case they use the same keys. | |
| void | dt_accels_disconnect_active_group (dt_accels_t *accels) |
| Disconnect the contextual active accels group from the window. | |
| static gboolean | _update_shortcut_state (dt_shortcut_t *shortcut, GtkAccelKey *key, gboolean init) |
| static void | _add_widget_accel (dt_shortcut_t *shortcut, GtkAccelFlags flags) |
| static void | _remove_widget_accel (dt_shortcut_t *shortcut, const GtkAccelKey *old_key) |
| static void | _remove_generic_accel (dt_shortcut_t *shortcut) |
| static void | _add_generic_accel (dt_shortcut_t *shortcut, GtkAccelFlags flags) |
| static void | _connect_accel (dt_shortcut_t *shortcut) |
| static void | _insert_accel (dt_accels_t *accels, dt_shortcut_t *shortcut) |
| static gboolean | _widget_shortcut_callback (GtkAccelGroup *group, GObject *acceleratable, guint keyval, GdkModifierType mods, gpointer user_data) |
| static gboolean | _virtual_shortcut_callback (GtkAccelGroup *group, GObject *acceleratable, guint keyval, GdkModifierType mods, gpointer user_data) |
| void | dt_accels_new_virtual_shortcut (dt_accels_t *accels, GtkAccelGroup *accel_group, const gchar *accel_path, GtkWidget *widget, guint key_val, GdkModifierType accel_mods) |
| Add a new virtual shortcut. Virtual shortcuts are immutable, read-only and don't trigger any action. They are meant to serve as placeholders, in a purely declarative way, for key combinations hardcoded in the key-pressed events handlers of widgets able to capture focus. Once declared here, they will prevent users from declaring their own shortcuts using hardcoded combinations for the corresponding accel_group. | |
| void | dt_accels_new_virtual_instance_shortcut (dt_accels_t *accels, gboolean(*action_callback)(GtkAccelGroup *group, GObject *acceleratable, guint keyval, GdkModifierType mods, gpointer user_data), gpointer data, GtkAccelGroup *accel_group, const gchar *action_scope, const gchar *action_name) |
| void | dt_accels_new_widget_shortcut (dt_accels_t *accels, GtkWidget *widget, const gchar *signal, GtkAccelGroup *accel_group, const gchar *accel_path, guint key_val, GdkModifierType accel_mods, const gboolean lock) |
| Register a new shortcut for a widget, setting up its path, default keys and accel group. This does everything but connecting it, so exists only as a defined slot to be connected later. | |
| void | dt_accels_new_action_shortcut (dt_accels_t *accels, gboolean(*action_callback)(GtkAccelGroup *group, GObject *acceleratable, guint keyval, GdkModifierType mods, gpointer user_data), gpointer data, GtkWidget *target_widget, GtkAccelGroup *accel_group, const gchar *action_scope, const gchar *action_name, guint key_val, GdkModifierType accel_mods, const gboolean lock, const char *description) |
| Register a new shortcut for a generic action, setting up its path, default keys and accel group. This does everything but connecting it, so exists only as a defined slot to be connected later. | |
| void | dt_accels_load_user_config (dt_accels_t *accels) |
| Loads keyboardrc.lang from config dir. This needs to run after we inited the accel map from widgets creation. | |
| static void | _connect_accel_hashtable (gpointer _key, gpointer value, gpointer user_data) |
| void | dt_accels_connect_accels (dt_accels_t *accels) |
| Actually enable accelerators after having loaded user config. | |
| static void | _remove_accel_hashtable (gpointer _key, gpointer value, gpointer user_data) |
| void | dt_accels_remove_accel (dt_accels_t *accels, const char *path, gpointer data) |
Recursively remove all accels for all shortcuts containing path. This is unneeded for accels attached to Gtk widgets through dt_accels_new_widget_shortcut because Gtk will handle that internally when deleting a widget. But for our own widget-less dt_accels_new_action_shortcut, we need to handle that ourselves. | |
| void | dt_accels_remove_shortcut (dt_accels_t *accels, const char *path) |
| Remove the shortcut object identified by path and all its accels. | |
| gchar * | dt_accels_build_path (const gchar *scope, const gchar *feature) |
| static void | _accels_keys_decode (dt_accels_t *accels, GdkEvent *event, guint *keyval, GdkModifierType *mods) |
| static guint | _normalize_keyval (const guint keyval) |
| static void | _for_each_accel (gpointer key, gpointer value, gpointer user_data) |
| static const char * | _find_path_for_keys (dt_accels_t *accels, guint key, GdkModifierType modifier, GtkAccelGroup *group) |
| static void | _for_each_non_virtual_accel (gpointer key, gpointer value, gpointer user_data) |
| static dt_shortcut_t * | _find_non_virtual_shortcut (dt_accels_t *accels, GtkAccelGroup *group, guint keyval, GdkModifierType mods) |
| static gboolean | _call_shortcut_cclosure (dt_shortcut_t *shortcut, GtkWindow *main_window, GClosure *closure) |
| static gboolean | _key_pressed (GtkWidget *w, GdkEvent *event, dt_accels_t *accels, guint keyval, GdkModifierType mods) |
| gboolean | dt_accels_dispatch (GtkWidget *w, GdkEvent *event, gpointer user_data) |
| Force our listener for all key strokes to bypass reserved Gtk keys. | |
| void | dt_accels_attach_scroll_handler (dt_accels_t *accels, gboolean(*callback)(GdkEventScroll event, void *data), void *data) |
| Attach a new global scroll event callback. So far this is used in darkroom to redirect scroll events to a Bauhaus widget when the focusing shortcut of that widget is held down on keyboard. | |
| void | dt_accels_detach_scroll_handler (dt_accels_t *accels) |
| static void | _make_column_editable (GtkTreeViewColumn *col, GtkCellRenderer *renderer, GtkTreeModel *model, GtkTreeIter *iter, gpointer data) |
| static void | _make_column_clearable (GtkTreeViewColumn *col, GtkCellRenderer *renderer, GtkTreeModel *model, GtkTreeIter *iter, gpointer data) |
| static int | guess_key_group (dt_accels_t *accels, guint keyval, guint hardware_keycode) |
| static void | _shortcut_edited (GtkCellRenderer *cell, const gchar *path_string, guint key, GdkModifierType mods, guint hardware_key, gpointer user_data) |
| static void | _shortcut_cleared (GtkCellRendererAccel *renderer, const gchar *path_string, gpointer user_data) |
| static gboolean | _icon_activate (GtkCellRenderer *cell, GdkEvent *event, GtkWidget *treeview, const gchar *path_str, GdkRectangle *background, GdkRectangle *cell_area, GtkCellRendererState flags, gpointer user_data) |
| static void | _create_main_row (GtkTreeStore *store, GtkTreeIter *iter, const char *label, const char *path, dt_shortcut_t *shortcut) |
| void | _for_each_accel_create_treeview_row (gpointer key, gpointer value, gpointer user_data) |
| static gchar * | _shortcut_search_trim_display_path (const gchar *path) |
| void | _for_each_path_create_treeview_row (gpointer key, gpointer value, gpointer user_data) |
| static gint | _sort_model_by_relevance_func (GtkTreeModel *model, GtkTreeIter *a, GtkTreeIter *b, gpointer data) |
| static gint | _sort_model_func (GtkTreeModel *model, GtkTreeIter *a, GtkTreeIter *b, gpointer data) |
| static gboolean | filter_callback (GtkTreeModel *model, GtkTreeIter *iter, gpointer user_data) |
| static void | search_changed (GtkEntry *entry, gpointer user_data) |
| void | dt_accels_window (dt_accels_t *accels, GtkWindow *main_window) |
| Show the modal dialog listing all available keyboard shortcuts and letting user to set them. | |
| static int | _match_text (GtkTreeModel *model, GtkTreeIter *iter, const char *needle) |
| static void | _find_and_rank_matches (GtkTreeModel *model, GtkWidget *search_entry) |
| static void | _shortcut_search_load_recent_entries (GtkListStore *store) |
| static gint | _shortcut_search_recent_sort_func (GtkTreeModel *model, GtkTreeIter *a, GtkTreeIter *b, gpointer user_data) |
| static void | _shortcut_search_save_recent_entry (const char *query, const dt_shortcut_t *shortcut) |
| static gboolean | _dispatch_selected_shortcut_idle (gpointer data) |
| static void | _search_entry_changed (GtkWidget *widget, gpointer user_data) |
| static gboolean | _shortcut_search_recent_match_selected (GtkEntryCompletion *completion, GtkTreeModel *model, GtkTreeIter *iter, gpointer user_data) |
| static gboolean | _shortcut_search_recent_insert_prefix (GtkEntryCompletion *completion, gchar *prefix, gpointer user_data) |
| static void | _dispatch_selected_shortcut (dt_accels_dispatch_state_t *state) |
| static gboolean | _shortcut_search_visible (GtkTreeModel *model, GtkTreeIter *iter, gpointer user_data) |
| static gboolean | _shortcut_search_recent_completion_match (GtkEntryCompletion *completion, const gchar *key, GtkTreeIter *iter, gpointer user_data) |
| static gboolean | _queue_action_from_shortcut (dt_shortcut_t *shortcut, GtkWidget *window, dt_accels_search_state_t *state) |
| static void | _shortcut_search_selection_changed (GtkTreeSelection *selection, gpointer user_data) |
| static gboolean | _shortcut_search_row_activated (GtkTreeView *tree_view, GtkTreePath *path, GtkTreeViewColumn *column, gpointer user_data) |
| static gboolean | _shortcut_search_move_selection (dt_accels_search_state_t *state, const gboolean forward) |
| static gboolean | _search_entry_restore_space_idle (gpointer user_data) |
| static gboolean | _search_entry_key_pressed (GtkWidget *widget __attribute__((unused)), GdkEventKey *event, gpointer user_data) |
| static gboolean | _search_entry_button_pressed (GtkWidget *widget, GdkEventButton *event, gpointer user_data) |
| static gboolean | _shortcut_search_window_key_pressed (GtkWidget *widget, GdkEventKey *event, gpointer user_data) |
| static gboolean | _shortcut_search_button_press (GtkWidget *widget, GdkEventButton *event, gpointer user_data) |
| static void | _shortcut_search_destroy (GtkWidget *widget, gpointer user_data) |
| void | dt_accels_search (dt_accels_t *accels, GtkWindow *main_window, GtkWidget *anchor) |
| static gboolean | _text_entry_focus_in_event (GtkWidget *self, GdkEventFocus event, gpointer user_data) |
| static gboolean | _text_entry_focus_out_event (GtkWidget *self, GdkEventFocus event, gpointer user_data) |
| static gboolean | _text_entry_key_pressed (GtkWidget *widget, GdkEventKey *event, gpointer user_data) |
| void | dt_accels_disconnect_on_text_input (GtkWidget *widget) |
| Disconnect accels while a text or search entry has the focus, and reconnect them when it loses it. This is what makes one-key shortcuts safe to have at all. Escape hands focus back to the host's main area via dt_widget_refocus(). | |
Variables | |
| static dt_accels_t * | _accels_global = NULL |
| static dt_accels_top_offset_handler_t | _top_offset_handler = NULL |
| static dt_accels_refocus_handler_t | _refocus_handler = NULL |
| static dt_accels_recent_get_handler_t | _recent_get = NULL |
| static dt_accels_recent_set_handler_t | _recent_set = NULL |
| static dt_accels_t * | accels_global_ref = NULL |
| #define DT_ACCEL_SEARCH_DISPATCH_RETRY_DELAY_MS 50 |
Definition at line 100 of file accelerators.c.
| #define DT_ACCEL_SEARCH_INLINE_SEPARATOR " > " |
Definition at line 99 of file accelerators.c.
| #define DT_ACCEL_SEARCH_RECENT_KEY "plugins/accel_search/recent_entries" |
Definition at line 2079 of file accelerators.c.
| #define DT_ACCEL_SEARCH_RECENT_MAX 20 |
Definition at line 2080 of file accelerators.c.
| typedef struct _accel_lookup_t _accel_lookup_t |
| typedef struct _accel_removal_t _accel_removal_t |
| typedef struct _accel_treeview_t _accel_treeview_t |
| typedef struct _accel_window_params_t _accel_window_params_t |
| typedef struct dt_accels_dispatch_state_t dt_accels_dispatch_state_t |
| typedef struct dt_accels_search_state_t dt_accels_search_state_t |
| anonymous enum |
| Enumerator | |
|---|---|
| COL_NAME | |
| COL_KEYS | |
| COL_CLEAR | |
| COL_DESCRIPTION | |
| COL_PATH | |
| COL_SHORTCUT | |
| COL_KEYVAL | |
| COL_MODS | |
| COL_DISPLAY_MODS | |
| NUM_COLUMNS | |
Definition at line 1318 of file accelerators.c.
Definition at line 244 of file accelerators.c.
References _accels_tooltip_query_hook().
Referenced by dt_accels_init().
|
static |
Definition at line 1031 of file accelerators.c.
References dt_accels_t::default_mod_mask, dt_free, dt_keys_mainpad_alternatives(), dt_widget_log, dt_widget_log_enabled, IS_NULL_PTR, and dt_accels_t::keymap.
Referenced by _shortcut_edited(), and dt_accels_dispatch().
|
static |
Definition at line 144 of file accelerators.c.
References dt_accels_t::acceleratables, dt_shortcut_t::description, dt_accels_display_mods(), dt_accels_get_global(), DT_ACCELS_WIDGET_SHORTCUT_KEY, DT_ACCELS_WIDGET_TOOLTIP_DISABLED_KEY, dt_free, dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), IS_NULL_PTR, dt_shortcut_t::key, dt_accels_t::lock, dt_shortcut_t::mods, TRUE, and void().
Referenced by _accels_install_tooltip_hook().
|
static |
Definition at line 612 of file accelerators.c.
References dt_shortcut_t::accel_group, dt_shortcut_get_closure(), flags, dt_shortcut_t::key, and dt_shortcut_t::mods.
Referenced by _connect_accel(), _remove_accel_hashtable(), and dt_accels_new_action_shortcut().
|
static |
For native Gtk widget accels, we create alternatives for numpad keys, in case we fail to decode them ourselves and defer to native Gtk. Otherwise, numpad keys are also converted at input event handling.
Definition at line 576 of file accelerators.c.
References dt_shortcut_t::accel_group, dt_keys_numpad_alternatives(), flags, dt_shortcut_t::key, dt_shortcut_t::mods, dt_shortcut_t::signal, and dt_shortcut_t::widget.
Referenced by _connect_accel(), and dt_accels_new_widget_shortcut().
|
static |
Definition at line 2586 of file accelerators.c.
References dt_shortcut_t::accel_group, dt_shortcut_get_closure(), FALSE, IS_NULL_PTR, k, dt_shortcut_t::key, and dt_shortcut_t::mods.
Referenced by _dispatch_selected_shortcut(), and _key_pressed().
|
static |
Definition at line 256 of file accelerators.c.
References _g_list_closure_unref(), dt_shortcut_t::closure, dt_free, and dt_shortcut_t::path.
Referenced by dt_accels_init().
|
static |
Definition at line 916 of file accelerators.c.
References _add_generic_accel(), _add_widget_accel(), _remove_generic_accel(), _remove_widget_accel(), _update_shortcut_state(), dt_shortcut_t::accels, dt_shortcut_get_closure(), DT_SHORTCUT_UNSET, dt_accels_t::flags, dt_accels_t::init, key, dt_shortcut_t::key, dt_shortcut_t::mods, dt_shortcut_t::path, dt_shortcut_t::type, and dt_shortcut_t::widget.
Referenced by _connect_accel_hashtable(), _insert_accel(), and _shortcut_edited().
|
static |
Definition at line 955 of file accelerators.c.
References _connect_accel(), and value.
Referenced by dt_accels_connect_accels().
|
static |
Definition at line 1505 of file accelerators.c.
References COL_DESCRIPTION, COL_DISPLAY_MODS, COL_KEYVAL, COL_MODS, COL_NAME, COL_PATH, COL_SHORTCUT, dt_shortcut_t::description, dt_accels_display_mods(), dt_shortcut_t::key, dt_shortcut_t::mods, and store.
Referenced by _for_each_accel_create_treeview_row().
|
static |
Definition at line 2627 of file accelerators.c.
References _call_shortcut_cclosure(), _dispatch_selected_shortcut_idle(), _refocus_handler, dt_accels_dispatch_state_t::accels, PayloadClosure::base, dt_shortcut_t::closure, dt_shortcut_t::description, DT_ACCEL_SEARCH_DISPATCH_RETRY_DELAY_MS, dt_shortcut_get_closure(), dt_shortcut_get_payload_closure(), dt_widget_log, dt_widget_scroll_focus(), FALSE, IS_NULL_PTR, dt_accels_dispatch_state_t::main_window, dt_accels_dispatch_state_t::path, dt_accels_dispatch_state_t::retries, state, PayloadClosure::widget, and dt_shortcut_t::widget.
Referenced by _dispatch_selected_shortcut_idle().
|
static |
Definition at line 2784 of file accelerators.c.
References _dispatch_selected_shortcut(), dt_free, and state.
Referenced by _dispatch_selected_shortcut(), and dt_accels_search().
Definition at line 2028 of file accelerators.c.
References _match_text(), DT_ACCEL_SEARCH_INLINE_SEPARATOR, dt_free, IS_NULL_PTR, model, and search_entry.
Referenced by _search_entry_changed().
|
static |
Definition at line 1181 of file accelerators.c.
References _for_each_non_virtual_accel(), dt_accels_t::acceleratables, dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), IS_NULL_PTR, dt_accels_t::lock, and _accel_lookup_t::results.
Referenced by _key_pressed().
|
static |
Definition at line 334 of file accelerators.c.
References dt_free, dt_shortcut_get_closure(), dt_shortcut_get_payload_closure(), n, PayloadClosure::parent_data, dt_shortcut_t::path, and value.
Referenced by _insert_parent_data_into_children().
|
static |
Definition at line 1136 of file accelerators.c.
References _for_each_accel(), dt_accels_t::acceleratables, dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), key, dt_accels_t::lock, and _accel_lookup_t::results.
Referenced by _shortcut_edited().
|
inlinestatic |
Definition at line 1106 of file accelerators.c.
References _normalize_keyval(), dt_shortcut_t::accel_group, dt_widget_log, _accel_lookup_t::group, key, _accel_lookup_t::key, dt_shortcut_t::key, _accel_lookup_t::modifier, dt_shortcut_t::mods, dt_shortcut_t::path, _accel_lookup_t::results, and value.
Referenced by _find_path_for_keys().
| void _for_each_accel_create_treeview_row | ( | gpointer | key, |
| gpointer | value, | ||
| gpointer | user_data | ||
| ) |
Definition at line 1518 of file accelerators.c.
References _create_main_row(), COL_KEYS, COL_NAME, COL_PATH, dt_capitalize_label(), dt_free, i, IS_NULL_PTR, key, _accel_treeview_t::node_cache, store, _accel_treeview_t::store, and value.
Referenced by dt_accels_window().
|
inlinestatic |
Definition at line 1153 of file accelerators.c.
References _normalize_keyval(), dt_shortcut_t::accel_group, dt_widget_log, _accel_lookup_t::group, key, _accel_lookup_t::key, dt_shortcut_t::key, _accel_lookup_t::modifier, dt_shortcut_t::mods, dt_shortcut_t::path, _accel_lookup_t::results, value, and dt_shortcut_t::virtual_shortcut.
Referenced by _find_non_virtual_shortcut().
| void _for_each_path_create_treeview_row | ( | gpointer | key, |
| gpointer | value, | ||
| gpointer | user_data | ||
| ) |
Definition at line 1605 of file accelerators.c.
References _shortcut_search_trim_display_path(), dt_shortcut_t::accel_group, dt_shortcut_t::accels, dt_accels_t::active_group, dt_shortcut_t::description, dt_accels_display_mods(), dt_free, dt_accels_t::global_accels, IS_NULL_PTR, key, dt_shortcut_t::key, dt_shortcut_t::mods, store, and value.
Referenced by dt_accels_search().
|
static |
Definition at line 126 of file accelerators.c.
References PayloadClosure::base, dt_free, and PayloadClosure::widget.
Referenced by _clean_shortcut(), and dt_shortcut_remove_closure().
|
static |
Definition at line 1495 of file accelerators.c.
References _shortcut_edited(), and TRUE.
Referenced by dt_accels_window().
|
static |
Definition at line 622 of file accelerators.c.
References _connect_accel(), dt_accels_t::acceleratables, dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), dt_shortcut_t::key, dt_accels_t::lock, dt_shortcut_t::mods, and dt_shortcut_t::path.
Referenced by dt_accels_new_action_shortcut(), dt_accels_new_virtual_shortcut(), and dt_accels_new_widget_shortcut().
|
static |
Definition at line 368 of file accelerators.c.
References _find_parent_hashtable(), dt_accels_t::acceleratables, and dt_shortcut_t::accels.
Referenced by dt_shortcut_set_closure().
|
static |
Definition at line 1201 of file accelerators.c.
References _call_shortcut_cclosure(), _find_non_virtual_shortcut(), dt_accels_t::active_group, dt_free, dt_widget_log, FALSE, dt_accels_t::global_accels, IS_NULL_PTR, and TRUE.
Referenced by dt_accels_dispatch().
|
static |
Definition at line 1355 of file accelerators.c.
References COL_SHORTCUT, IS_NULL_PTR, dt_shortcut_t::key, dt_shortcut_t::locked, and model.
Referenced by dt_accels_window().
|
static |
Definition at line 1343 of file accelerators.c.
References COL_SHORTCUT, IS_NULL_PTR, dt_shortcut_t::locked, and model.
Referenced by dt_accels_window().
|
static |
Definition at line 1967 of file accelerators.c.
References dt_free, FALSE, i, IS_NULL_PTR, model, t, and TRUE.
Referenced by _find_and_rank_matches().
|
inlinestatic |
Definition at line 1100 of file accelerators.c.
Referenced by _for_each_accel(), _for_each_non_virtual_accel(), and filter_callback().
|
static |
Definition at line 2841 of file accelerators.c.
References _shortcut_search_save_recent_entry(), dt_shortcut_t::description, DT_ACCEL_SEARCH_INLINE_SEPARATOR, dt_free, dt_widget_log, IS_NULL_PTR, dt_shortcut_t::path, state, TRUE, and window.
Referenced by _search_entry_key_pressed(), and _shortcut_search_row_activated().
|
static |
Definition at line 970 of file accelerators.c.
References _add_generic_accel(), _remove_generic_accel(), dt_shortcut_t::accels, dt_shortcut_get_closure(), dt_shortcut_remove_closure(), dt_accels_t::flags, dt_shortcut_t::key, dt_shortcut_t::path, and value.
Referenced by dt_accels_remove_accel().
|
static |
Definition at line 600 of file accelerators.c.
References dt_shortcut_t::accel_group, dt_shortcut_get_closure(), and IS_NULL_PTR.
Referenced by _connect_accel(), _remove_accel_hashtable(), and dt_accels_new_action_shortcut().
|
static |
Definition at line 589 of file accelerators.c.
References dt_shortcut_t::accel_group, dt_keys_numpad_alternatives(), and dt_shortcut_t::widget.
Referenced by _connect_accel(), and dt_accels_new_widget_shortcut().
|
static |
Definition at line 3079 of file accelerators.c.
References DT_ACCEL_SEARCH_INLINE_SEPARATOR, dt_free, FALSE, IS_NULL_PTR, state, and TRUE.
Referenced by dt_accels_search().
Definition at line 2317 of file accelerators.c.
References _find_and_rank_matches(), FALSE, IS_NULL_PTR, dt_shortcut_t::path, dt_accels_search_state_t::selected, state, and TRUE.
Referenced by dt_accels_search().
|
static |
Definition at line 2944 of file accelerators.c.
References _queue_action_from_shortcut(), _search_entry_restore_space_idle(), _shortcut_search_move_selection(), _shortcut_search_trim_display_path(), DT_ACCEL_SEARCH_INLINE_SEPARATOR, dt_free, dt_keys_mainpad_alternatives(), FALSE, has_selection(), IS_NULL_PTR, key, MIN, dt_shortcut_t::path, position(), state, and TRUE.
Referenced by _shortcut_search_window_key_pressed(), and dt_accels_search().
|
static |
Definition at line 2927 of file accelerators.c.
References dt_free, IS_NULL_PTR, dt_accels_search_state_t::pending_space_idle_id, and state.
Referenced by _search_entry_key_pressed().
|
static |
Definition at line 1489 of file accelerators.c.
References _shortcut_edited().
Referenced by dt_accels_window().
|
static |
Definition at line 1393 of file accelerators.c.
References _accels_keys_decode(), _connect_accel(), _find_path_for_keys(), dt_shortcut_t::accel_group, dt_shortcut_t::accels, accels_global_ref, COL_DISPLAY_MODS, COL_KEYVAL, COL_MODS, COL_SHORTCUT, dt_accels_display_mods(), dt_free, dt_keys_mainpad_alternatives(), FALSE, guess_key_group(), IS_NULL_PTR, key, dt_shortcut_t::path, state, and store.
Referenced by _icon_activate(), _shortcut_cleared(), and dt_accels_window().
|
static |
Definition at line 3105 of file accelerators.c.
References FALSE, IS_NULL_PTR, state, and TRUE.
Referenced by dt_accels_search().
Definition at line 3137 of file accelerators.c.
References dt_free, IS_NULL_PTR, and state.
Referenced by dt_accels_search().
|
static |
Definition at line 2082 of file accelerators.c.
References _recent_get, _shortcut_search_trim_display_path(), DT_ACCEL_SEARCH_INLINE_SEPARATOR, DT_ACCEL_SEARCH_RECENT_MAX, dt_free, i, IS_NULL_PTR, and store.
Referenced by dt_accels_search().
|
static |
Definition at line 2887 of file accelerators.c.
References FALSE, IS_NULL_PTR, state, and TRUE.
Referenced by _search_entry_key_pressed().
|
static |
Definition at line 2800 of file accelerators.c.
References DT_ACCEL_SEARCH_INLINE_SEPARATOR, dt_free, FALSE, IS_NULL_PTR, key, and model.
Referenced by dt_accels_search().
|
static |
Definition at line 2391 of file accelerators.c.
References _shortcut_search_trim_display_path(), DT_ACCEL_SEARCH_INLINE_SEPARATOR, dt_free, FALSE, IS_NULL_PTR, MAX, model, dt_shortcut_t::path, state, and TRUE.
Referenced by dt_accels_search().
|
static |
Definition at line 2364 of file accelerators.c.
References dt_free, IS_NULL_PTR, model, state, and TRUE.
Referenced by dt_accels_search().
|
static |
Definition at line 2134 of file accelerators.c.
References DT_ACCEL_SEARCH_INLINE_SEPARATOR, dt_free, IS_NULL_PTR, model, and state.
Referenced by dt_accels_search().
|
static |
Definition at line 2875 of file accelerators.c.
References _queue_action_from_shortcut(), FALSE, and state.
Referenced by dt_accels_search().
|
static |
Definition at line 2218 of file accelerators.c.
References _recent_get, _recent_set, DT_ACCEL_SEARCH_RECENT_MAX, dt_free, entries, FALSE, i, IS_NULL_PTR, k, dt_shortcut_t::path, and TRUE.
Referenced by _queue_action_from_shortcut().
|
static |
|
static |
Definition at line 1588 of file accelerators.c.
References IS_NULL_PTR.
Referenced by _for_each_path_create_treeview_row(), _search_entry_key_pressed(), _shortcut_search_load_recent_entries(), and _shortcut_search_recent_insert_prefix().
|
static |
|
static |
Definition at line 3100 of file accelerators.c.
References _search_entry_key_pressed().
Referenced by dt_accels_search().
|
inlinestatic |
Definition at line 136 of file accelerators.c.
References DT_ACCELS_WIDGET_SHORTCUT_KEY, DT_ACCELS_WIDGET_TOOLTIP_DISABLED_KEY, IS_NULL_PTR, and TRUE.
Referenced by dt_accels_new_virtual_shortcut(), and dt_accels_new_widget_shortcut().
|
static |
Definition at line 1647 of file accelerators.c.
References dt_free, i, IS_NULL_PTR, and model.
Referenced by dt_accels_search().
|
static |
Definition at line 1704 of file accelerators.c.
References dt_free, model, and res.
Referenced by dt_accels_window().
|
static |
Definition at line 3339 of file accelerators.c.
References dt_accels_disable(), dt_accels_get_global(), FALSE, and TRUE.
Referenced by dt_accels_disconnect_on_text_input().
|
static |
Definition at line 3345 of file accelerators.c.
References dt_accels_disable(), dt_accels_get_global(), and FALSE.
Referenced by dt_accels_disconnect_on_text_input().
|
static |
Definition at line 3351 of file accelerators.c.
References dt_widget_refocus(), FALSE, and TRUE.
Referenced by dt_accels_disconnect_on_text_input().
|
static |
Definition at line 513 of file accelerators.c.
References DT_SHORTCUT_DEFAULT, DT_SHORTCUT_UNSET, DT_SHORTCUT_USER, FALSE, init(), key, dt_shortcut_t::key, dt_shortcut_t::locked, dt_shortcut_t::mods, dt_shortcut_t::path, TRUE, and dt_shortcut_t::type.
Referenced by _connect_accel().
|
static |
Definition at line 682 of file accelerators.c.
References dt_free, FALSE, IS_NULL_PTR, dt_shortcut_t::key, dt_shortcut_t::mods, n, TRUE, and dt_shortcut_t::widget.
Referenced by dt_accels_new_virtual_shortcut().
|
static |
Definition at line 672 of file accelerators.c.
References FALSE, IS_NULL_PTR, dt_shortcut_t::signal, TRUE, and dt_shortcut_t::widget.
Referenced by dt_accels_new_widget_shortcut().
| void dt_accels_attach_scroll_handler | ( | dt_accels_t * | accels, |
| gboolean(*)(GdkEventScroll event, void *data) | callback, | ||
| void * | data | ||
| ) |
Attach a new global scroll event callback. So far this is used in darkroom to redirect scroll events to a Bauhaus widget when the focusing shortcut of that widget is held down on keyboard.
| callback | |
| data |
Definition at line 1299 of file accelerators.c.
References dt_accels_t::scroll::callback, dt_accels_t::scroll::data, and dt_accels_t::scroll.
Referenced by enter().
| gchar * dt_accels_build_path | ( | const gchar * | scope, |
| const gchar * | feature | ||
| ) |
Definition at line 1023 of file accelerators.c.
Referenced by _iop_panel_label(), _styles_get_submenu(), add_generic_top_menu_entry(), add_generic_top_submenu_entry(), dt_accels_new_action_shortcut(), dt_accels_new_virtual_instance_shortcut(), dt_bauhaus_init(), dt_bauhaus_widget_set_label(), dt_iop_gui_cleanup_module(), dt_iop_gui_init(), dt_lib_unload_module(), dt_thumbtable_new(), gui_cleanup(), gui_init(), gui_init(), and set_menu_entry().
| void dt_accels_cleanup | ( | dt_accels_t * | accels | ) |
Definition at line 427 of file accelerators.c.
References dt_accels_t::acceleratables, dt_accels_t::active_group, dt_accels_t::config_file, dt_accels_t::darkroom_accels, dt_free, dt_pthread_mutex_destroy(), dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), dt_accels_t::global_accels, dt_accels_t::lighttable_accels, dt_accels_t::lock, dt_accels_t::map_accels, dt_accels_t::print_accels, and dt_accels_t::slideshow_accels.
Referenced by dt_cleanup().
| void dt_accels_connect_accels | ( | dt_accels_t * | accels | ) |
Actually enable accelerators after having loaded user config.
| accels |
Definition at line 962 of file accelerators.c.
References _connect_accel_hashtable(), dt_accels_t::acceleratables, dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), and dt_accels_t::lock.
| void dt_accels_connect_active_group | ( | dt_accels_t * | accels, |
| const gchar * | group | ||
| ) |
Connect the contextual active accels group to the window. Views can declare their own set of contextual accels, which can override the global accels, in case they use the same keys.
| accels | |
| group | any of the following: "darkroom", "lighttable", "map", "print", "slideshow". |
Definition at line 457 of file accelerators.c.
References dt_accels_t::active_group, dt_accels_t::darkroom_accels, IS_NULL_PTR, dt_accels_t::lighttable_accels, dt_accels_t::map_accels, dt_accels_t::print_accels, dt_accels_t::reset, and dt_accels_t::slideshow_accels.
Referenced by enter().
| void dt_accels_detach_scroll_handler | ( | dt_accels_t * | accels | ) |
Definition at line 1305 of file accelerators.c.
References dt_accels_t::scroll::callback, dt_accels_t::scroll::data, and dt_accels_t::scroll.
Referenced by leave().
| void dt_accels_disconnect_active_group | ( | dt_accels_t * | accels | ) |
Disconnect the contextual active accels group from the window.
| accels |
Definition at line 493 of file accelerators.c.
References dt_accels_t::active_group, IS_NULL_PTR, and dt_accels_t::reset.
Referenced by leave().
Disconnect accels while a text or search entry has the focus, and reconnect them when it loses it. This is what makes one-key shortcuts safe to have at all. Escape hands focus back to the host's main area via dt_widget_refocus().
| widget | the entry to guard. |
Definition at line 3361 of file accelerators.c.
References _text_entry_focus_in_event(), _text_entry_focus_out_event(), and _text_entry_key_pressed().
Referenced by _add_tag_button_clicked(), _gui_init_datetime(), _gui_styles_dialog_run(), _lib_duplicate_init_callback(), _lib_tagging_tag_show_accel(), _pop_menu_dictionary_change_path(), _pop_menu_dictionary_create_tag(), _pop_menu_dictionary_edit_tag(), _presets_show_edit_dialog(), dt_gui_preferences_string(), dt_gui_show_standalone_string_dialog(), dt_iop_gui_rename_module(), gui_init(), gui_init(), gui_init(), gui_init(), gui_init(), init_tab_general(), and init_tab_presets().
| gboolean dt_accels_dispatch | ( | GtkWidget * | w, |
| GdkEvent * | event, | ||
| gpointer | user_data | ||
| ) |
Force our listener for all key strokes to bypass reserved Gtk keys.
| w | |
| event | |
| user_data |
Definition at line 1228 of file accelerators.c.
References _accels_keys_decode(), _key_pressed(), dt_accels_t::active_group, dt_accels_t::active_key, dt_accels_t::scroll::callback, dt_accels_t::scroll::data, dt_accels_t::disable_accels, FALSE, IS_NULL_PTR, dt_accels_t::reset, and dt_accels_t::scroll.
Referenced by dt_gui_gtk_init().
| dt_accels_t * dt_accels_get_global | ( | void | ) |
Definition at line 69 of file accelerators.c.
References _accels_global.
Referenced by _accels_tooltip_query_hook(), _text_entry_focus_in_event(), _text_entry_focus_out_event(), _widget_finalize(), dt_accels_search(), and dt_bauhaus_init().
| dt_accels_t * dt_accels_init | ( | char * | config_file, |
| GtkAccelFlags | flags | ||
| ) |
Definition at line 398 of file accelerators.c.
References _accels_install_tooltip_hook(), _clean_shortcut(), dt_accels_t::acceleratables, dt_accels_t::active_group, dt_accels_t::active_key, dt_accels_t::scroll::callback, dt_accels_t::config_file, dt_accels_t::darkroom_accels, dt_accels_t::scroll::data, dt_accels_t::default_mod_mask, dt_accels_t::disable_accels, dt_pthread_mutex_init(), FALSE, flags, dt_accels_t::flags, dt_accels_t::global_accels, dt_accels_t::init, dt_accels_t::keymap, dt_accels_t::lighttable_accels, dt_accels_t::lock, dt_accels_t::map_accels, dt_accels_t::print_accels, dt_accels_t::reset, dt_accels_t::scroll, and dt_accels_t::slideshow_accels.
Referenced by dt_gui_gtk_init().
| void dt_accels_load_user_config | ( | dt_accels_t * | accels | ) |
Loads keyboardrc.lang from config dir. This needs to run after we inited the accel map from widgets creation.
| accels |
Definition at line 910 of file accelerators.c.
References dt_accels_t::config_file.
Referenced by dt_gui_gtk_init().
| void dt_accels_new_action_shortcut | ( | dt_accels_t * | accels, |
| gboolean(*)(GtkAccelGroup *group, GObject *acceleratable, guint keyval, GdkModifierType mods, gpointer user_data) | action_callback, | ||
| gpointer | data, | ||
| GtkWidget * | target_widget, | ||
| GtkAccelGroup * | accel_group, | ||
| const gchar * | action_scope, | ||
| const gchar * | action_name, | ||
| guint | key_val, | ||
| GdkModifierType | accel_mods, | ||
| const gboolean | lock, | ||
| const char * | description | ||
| ) |
Register a new shortcut for a generic action, setting up its path, default keys and accel group. This does everything but connecting it, so exists only as a defined slot to be connected later.
The callback should have the following signature:
| accels | |
| data | Opaque payload handed back to action_callback. Its type is the caller's business and is never inspected here. |
| target_widget | The widget this action acts on, or NULL when it acts on something that is not a widget. Pass data itself when data IS a widget. The dispatcher uses it to pick between several instances registered on the same path, and to decide whether invoking the action should first move focus back to the center view. It must be declared rather than derived: asking GTK whether an opaque pointer is a widget reads through it as if it were a GObject, which is undefined for every payload that is not one. |
| accel_group | |
| action_scope | Human-readable, translated, category or scope of the action. Will be turned into path internally |
| action_name | Human-readable, translated, name or description of the action. Will be turned into path internally |
| key_val | |
| accel_mods | |
| lock | prevent user edition |
Definition at line 852 of file accelerators.c.
References _add_generic_accel(), _insert_accel(), _remove_generic_accel(), dt_shortcut_t::accel_group, dt_accels_t::acceleratables, dt_shortcut_t::accels, dt_shortcut_t::closure, description(), dt_shortcut_t::description, dt_accels_build_path(), dt_free, dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), dt_shortcut_get_closure(), dt_shortcut_set_closure(), DT_SHORTCUT_UNSET, FALSE, dt_accels_t::flags, dt_shortcut_t::key, lock, dt_accels_t::lock, dt_shortcut_t::locked, dt_shortcut_t::mods, dt_shortcut_t::path, dt_shortcut_t::signal, dt_shortcut_t::type, dt_shortcut_t::virtual_shortcut, and dt_shortcut_t::widget.
Referenced by dt_dev_toolbox_add_accels(), dt_lib_init_module(), gui_init(), and set_menu_entry().
| void dt_accels_new_virtual_instance_shortcut | ( | dt_accels_t * | accels, |
| gboolean(*)(GtkAccelGroup *group, GObject *acceleratable, guint keyval, GdkModifierType mods, gpointer user_data) | action_callback, | ||
| gpointer | data, | ||
| GtkAccelGroup * | accel_group, | ||
| const gchar * | action_scope, | ||
| const gchar * | action_name | ||
| ) |
Definition at line 756 of file accelerators.c.
References dt_shortcut_t::accel_group, dt_accels_t::acceleratables, dt_shortcut_t::accels, dt_shortcut_t::closure, dt_shortcut_t::description, dt_accels_build_path(), dt_free, dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), DT_SHORTCUT_DEFAULT, dt_shortcut_set_closure(), IS_NULL_PTR, dt_shortcut_t::key, dt_accels_t::lock, dt_shortcut_t::locked, dt_shortcut_t::mods, dt_shortcut_t::path, dt_shortcut_t::signal, TRUE, dt_shortcut_t::type, dt_shortcut_t::virtual_shortcut, and dt_shortcut_t::widget.
Referenced by _iop_panel_label().
| void dt_accels_new_virtual_shortcut | ( | dt_accels_t * | accels, |
| GtkAccelGroup * | accel_group, | ||
| const gchar * | accel_path, | ||
| GtkWidget * | widget, | ||
| guint | key_val, | ||
| GdkModifierType | accel_mods | ||
| ) |
Add a new virtual shortcut. Virtual shortcuts are immutable, read-only and don't trigger any action. They are meant to serve as placeholders, in a purely declarative way, for key combinations hardcoded in the key-pressed events handlers of widgets able to capture focus. Once declared here, they will prevent users from declaring their own shortcuts using hardcoded combinations for the corresponding accel_group.
| accel_group | |
| accel_path | |
| key_val | |
| accel_mods |
Definition at line 721 of file accelerators.c.
References _insert_accel(), _shortcut_set_widget_data(), _virtual_shortcut_callback(), dt_shortcut_t::accel_group, dt_accels_t::acceleratables, dt_shortcut_t::accels, dt_shortcut_t::closure, dt_shortcut_t::description, dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), dt_shortcut_set_closure(), DT_SHORTCUT_UNSET, IS_NULL_PTR, dt_shortcut_t::key, dt_accels_t::lock, dt_shortcut_t::locked, dt_shortcut_t::mods, dt_shortcut_t::path, dt_shortcut_t::signal, TRUE, dt_shortcut_t::type, dt_shortcut_t::virtual_shortcut, and dt_shortcut_t::widget.
Referenced by dt_bauhaus_init(), dt_thumbtable_new(), and gui_init().
| void dt_accels_new_widget_shortcut | ( | dt_accels_t * | accels, |
| GtkWidget * | widget, | ||
| const gchar * | signal, | ||
| GtkAccelGroup * | accel_group, | ||
| const gchar * | accel_path, | ||
| guint | key_val, | ||
| GdkModifierType | accel_mods, | ||
| const gboolean | lock | ||
| ) |
Register a new shortcut for a widget, setting up its path, default keys and accel group. This does everything but connecting it, so exists only as a defined slot to be connected later.
| accels | |
| widget | |
| signal | |
| accel_group | |
| accel_path | |
| key_val | |
| accel_mods | |
| lock | prevent user edition |
Definition at line 796 of file accelerators.c.
References _add_widget_accel(), _insert_accel(), _remove_widget_accel(), _shortcut_set_widget_data(), _widget_shortcut_callback(), dt_shortcut_t::accel_group, dt_accels_t::acceleratables, dt_shortcut_t::accels, dt_shortcut_t::closure, dt_shortcut_t::description, dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), dt_shortcut_set_closure(), DT_SHORTCUT_UNSET, FALSE, dt_accels_t::flags, key, dt_shortcut_t::key, lock, dt_accels_t::lock, dt_shortcut_t::locked, dt_shortcut_t::mods, dt_shortcut_t::path, dt_shortcut_t::signal, dt_shortcut_t::type, dt_shortcut_t::virtual_shortcut, and dt_shortcut_t::widget.
Referenced by gui_init().
| void dt_accels_remove_accel | ( | dt_accels_t * | accels, |
| const char * | path, | ||
| gpointer | data | ||
| ) |
Recursively remove all accels for all shortcuts containing path. This is unneeded for accels attached to Gtk widgets through dt_accels_new_widget_shortcut because Gtk will handle that internally when deleting a widget. But for our own widget-less dt_accels_new_action_shortcut, we need to handle that ourselves.
Accels are typically added at gui_init() time of their attached GUI object, and the typical use case of this API assumes those objects live until the app is closed. But IOP modules can be added/removed at runtime (instances), so we need to destroy accels when their target object (user_data pointer/callback) is destroyed. If some accels are left dangling with a reference to a non-existing callback/data/closure, the app will crash with segfault upon shortcut activation.
This will remove in one shot all accels attached to a parent and to all of its children, assuming that children will share their path root with their parent, and that rule is entirely up to the developer to enforce.
This does not remove the shortcut object.
| accels | |
| path | accel path |
| data | the user-data used by the initial callback, if any |
Definition at line 1000 of file accelerators.c.
References _remove_accel_hashtable(), dt_accels_t::acceleratables, dt_free, dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), IS_NULL_PTR, and dt_accels_t::lock.
Referenced by _widget_finalize(), dt_iop_gui_cleanup_module(), and gui_cleanup().
| void dt_accels_remove_shortcut | ( | dt_accels_t * | accels, |
| const char * | path | ||
| ) |
Remove the shortcut object identified by path and all its accels.
| accels | |
| path |
Definition at line 1015 of file accelerators.c.
References dt_accels_t::acceleratables, dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), and dt_accels_t::lock.
Referenced by _iop_panel_label(), dt_iop_gui_cleanup_module(), dt_lib_unload_module(), and gui_cleanup().
| void dt_accels_search | ( | dt_accels_t * | accels, |
| GtkWindow * | main_window, | ||
| GtkWidget * | anchor | ||
| ) |
Definition at line 3155 of file accelerators.c.
References _dispatch_selected_shortcut_idle(), _for_each_path_create_treeview_row(), _search_entry_button_pressed(), _search_entry_changed(), _search_entry_key_pressed(), _shortcut_search_button_press(), _shortcut_search_destroy(), _shortcut_search_load_recent_entries(), _shortcut_search_recent_completion_match(), _shortcut_search_recent_insert_prefix(), _shortcut_search_recent_match_selected(), _shortcut_search_recent_sort_func(), _shortcut_search_row_activated(), _shortcut_search_selection_changed(), _shortcut_search_visible(), _shortcut_search_window_key_pressed(), _sort_model_by_relevance_func(), _top_offset_handler, dt_accels_t::acceleratables, dt_accels_dispatch_state_t::accels, description(), dt_accels_get_global(), dt_free, dt_gui_add_class(), dt_osx_disallow_fullscreen(), FALSE, IS_NULL_PTR, dt_accels_dispatch_state_t::main_window, MAX, dt_accels_dispatch_state_t::path, scrolled(), search_entry, state, store, dt_accels_search_state_t::store, TRUE, and window.
Referenced by _open_accel_search_callback(), and search_accels_callback().
| void dt_accels_set_global | ( | dt_accels_t * | accels | ) |
The accels instance this process uses. Set once by the host at GUI init.
Definition at line 64 of file accelerators.c.
References _accels_global.
Referenced by dt_gui_gtk_init().
| void dt_accels_set_recent_handlers | ( | dt_accels_recent_get_handler_t | get, |
| dt_accels_recent_set_handler_t | set | ||
| ) |
Definition at line 84 of file accelerators.c.
References _recent_get, and _recent_set.
Referenced by dt_gui_gtk_init().
| void dt_accels_set_refocus_handler | ( | dt_accels_refocus_handler_t | handler | ) |
Definition at line 79 of file accelerators.c.
References _refocus_handler.
Referenced by dt_gui_gtk_init().
| void dt_accels_set_top_offset_handler | ( | dt_accels_top_offset_handler_t | handler | ) |
Definition at line 74 of file accelerators.c.
References _top_offset_handler.
Referenced by dt_gui_gtk_init().
| void dt_accels_window | ( | dt_accels_t * | accels, |
| GtkWindow * | main_window | ||
| ) |
Show the modal dialog listing all available keyboard shortcuts and letting user to set them.
| accels | |
| main_window | The main Ansel application window (for modal/transient) |
Definition at line 1836 of file accelerators.c.
References _for_each_accel_create_treeview_row(), _icon_activate(), _make_column_clearable(), _make_column_editable(), _shortcut_cleared(), _shortcut_edited(), _sort_model_func(), dt_accels_t::acceleratables, accels_global_ref, COL_CLEAR, COL_DESCRIPTION, COL_DISPLAY_MODS, COL_KEYS, COL_KEYVAL, COL_NAME, COL_PATH, dt_free, dt_free_gpointer(), dt_gtkentry_setup_completion(), dt_gui_add_class(), DT_GUI_BOX_SPACING, dt_osx_disallow_fullscreen(), dtgtk_cell_renderer_button_new(), FALSE, filter_callback(), i, NUM_COLUMNS, search_changed(), store, _accel_treeview_t::store, and TRUE.
Referenced by shortcuts_callback().
| GClosure * dt_shortcut_get_closure | ( | dt_shortcut_t * | shortcut | ) |
Definition at line 276 of file accelerators.c.
References PayloadClosure::base, and dt_shortcut_get_payload_closure().
Referenced by _add_generic_accel(), _call_shortcut_cclosure(), _connect_accel(), _dispatch_selected_shortcut(), _find_parent_hashtable(), _remove_accel_hashtable(), _remove_generic_accel(), and dt_accels_new_action_shortcut().
| PayloadClosure * dt_shortcut_get_payload_closure | ( | dt_shortcut_t * | shortcut | ) |
Definition at line 267 of file accelerators.c.
References dt_shortcut_t::closure.
Referenced by _dispatch_selected_shortcut(), _find_parent_hashtable(), and dt_shortcut_get_closure().
| void dt_shortcut_remove_closure | ( | dt_shortcut_t * | shortcut, |
| gpointer | data | ||
| ) |
Definition at line 290 of file accelerators.c.
References _g_list_closure_unref(), dt_shortcut_t::closure, and IS_NULL_PTR.
Referenced by _remove_accel_hashtable().
| void dt_shortcut_set_closure | ( | dt_shortcut_t * | shortcut, |
| gboolean(*)(GtkAccelGroup *group, GObject *acceleratable, guint keyval, GdkModifierType mods, gpointer user_data) | action_callback, | ||
| gpointer | data, | ||
| GtkWidget * | widget | ||
| ) |
Definition at line 375 of file accelerators.c.
References _insert_parent_data_into_children(), PayloadClosure::base, dt_shortcut_t::closure, PayloadClosure::parent_data, and PayloadClosure::widget.
Referenced by dt_accels_new_action_shortcut(), dt_accels_new_virtual_instance_shortcut(), dt_accels_new_virtual_shortcut(), and dt_accels_new_widget_shortcut().
|
static |
Definition at line 1737 of file accelerators.c.
References _normalize_keyval(), COL_KEYVAL, COL_MODS, COL_PATH, dt_free, FALSE, filter_callback(), IS_NULL_PTR, model, and TRUE.
Referenced by dt_accels_window(), and filter_callback().
|
static |
Definition at line 1368 of file accelerators.c.
References dt_free, i, and dt_accels_t::keymap.
Referenced by _shortcut_edited().
|
static |
Definition at line 1818 of file accelerators.c.
References IS_NULL_PTR.
Referenced by dt_accels_window().
|
static |
Definition at line 58 of file accelerators.c.
Referenced by dt_accels_get_global(), and dt_accels_set_global().
|
static |
Definition at line 61 of file accelerators.c.
Referenced by _shortcut_search_load_recent_entries(), _shortcut_search_save_recent_entry(), and dt_accels_set_recent_handlers().
|
static |
Definition at line 62 of file accelerators.c.
Referenced by _shortcut_search_save_recent_entry(), and dt_accels_set_recent_handlers().
|
static |
Definition at line 60 of file accelerators.c.
Referenced by _dispatch_selected_shortcut(), and dt_accels_set_refocus_handler().
|
static |
Definition at line 59 of file accelerators.c.
Referenced by dt_accels_search(), and dt_accels_set_top_offset_handler().
|
static |
Definition at line 1316 of file accelerators.c.
Referenced by _shortcut_edited(), and dt_accels_window().