Lines Matching defs:shortcut
2 * Keyboard shortcut processing.
62 unsigned int sp_shortcut_get_key(unsigned int const shortcut);
63 GdkModifierType sp_shortcut_get_modifiers(unsigned int const shortcut);
68 sp_shortcut_invoke(unsigned int shortcut, Inkscape::UI::View::View *view)
70 Inkscape::Verb *verb = sp_shortcut_get_verb(shortcut);
119 unsigned int shortcut = 0;
126 shortcut = accel_key |
134 return shortcut;
137 Glib::ustring sp_shortcut_to_label(unsigned int const shortcut) {
141 if (shortcut & SP_SHORTCUT_CONTROL_MASK)
143 if (shortcut & SP_SHORTCUT_SHIFT_MASK)
145 if (shortcut & SP_SHORTCUT_ALT_MASK)
208 * Get a list of keyboard shortcut files names and paths from the system and users paths
217 // loop through possible keyboard shortcut file locations.
249 g_warning("Unable to read keyboard shortcut file %s", full);
254 g_warning("Not a shortcut keys file %s", full);
393 g_warning("Unable to read keyboard shortcut file %s", importname);
411 g_warning("Unable to read keyboard shortcut file %s", filename);
420 * Add or delete a shortcut to the users default.xml keys file
421 * @param addremove - when true add/override a shortcut, when false remove shortcut
425 * Element (a) is used for shortcut display in menus (display="True") and contains the gdk_keyval_name of the shortcut key
426 * Element (b) is used in shortcut lookup and contains an uppercase version of the gdk_keyval_name,
429 void sp_shortcut_delete_from_file(char const * /*action*/, unsigned int const shortcut) {
435 g_warning("Unable to read keyboard shortcut file %s", filename);
439 gchar *key = gdk_keyval_name (sp_shortcut_get_key(shortcut));
440 std::string modifiers = sp_shortcut_to_label(shortcut & (SP_SHORTCUT_MODIFIER_MASK));
443 g_warning("Unknown key for shortcut %u", shortcut);
497 void sp_shortcut_add_to_file(char const *action, unsigned int const shortcut) {
503 g_warning("Unable to read keyboard shortcut file %s, creating ....", filename);
506 g_warning("Unable to create keyboard shortcut file %s", filename);
511 gchar *key = gdk_keyval_name (sp_shortcut_get_key(shortcut));
512 std::string modifiers = sp_shortcut_to_label(shortcut & (SP_SHORTCUT_MODIFIER_MASK));
515 g_warning("Unknown key for shortcut %u", shortcut);
573 g_warning("Missing verb name (action= attribute) for shortcut");
632 * Removes a keyboard shortcut for the given verb.
633 * (Removes any existing binding for the given shortcut, including appropriately
637 sp_shortcut_unset(unsigned int const shortcut)
641 Inkscape::Verb *verb = (*verbs)[shortcut];
643 /* Maintain the invariant that sp_shortcut_get_primary(v) returns either 0 or a valid shortcut for v. */
646 (*verbs)[shortcut] = 0;
649 if (old_primary == shortcut) {
673 sp_shortcut_add_accelerator(GtkWidget *item, unsigned int const shortcut)
675 if (shortcut == GDK_KEY_VoidSymbol) {
679 unsigned int accel_key = sp_shortcut_get_key(shortcut);
685 sp_shortcut_get_modifiers(shortcut),
692 sp_shortcut_get_key(unsigned int const shortcut)
694 return (shortcut & (~SP_SHORTCUT_MODIFIER_MASK));
698 sp_shortcut_get_modifiers(unsigned int const shortcut)
701 ((shortcut & SP_SHORTCUT_SHIFT_MASK) ? GDK_SHIFT_MASK : 0) |
702 ((shortcut & SP_SHORTCUT_CONTROL_MASK) ? GDK_CONTROL_MASK : 0) |
703 ((shortcut & SP_SHORTCUT_ALT_MASK) ? GDK_MOD1_MASK : 0)
708 * Adds a keyboard shortcut for the given verb.
709 * (Removes any existing binding for the given shortcut, including appropriately
712 * \param is_primary True iff this is the shortcut to be written in menu items or buttons.
714 * \post sp_shortcut_get_verb(shortcut) == verb.
715 * \post !is_primary or sp_shortcut_get_primary(verb) == shortcut.
718 sp_shortcut_set(unsigned int const shortcut, Inkscape::Verb *const verb, bool const is_primary, bool const is_user_set)
722 Inkscape::Verb *old_verb = (*verbs)[shortcut];
723 (*verbs)[shortcut] = verb;
725 /* Maintain the invariant that sp_shortcut_get_primary(v) returns either 0 or a valid shortcut for v. */
729 if (old_primary == shortcut) {
736 (*primary_shortcuts)[verb] = shortcut;
742 sp_shortcut_get_verb(unsigned int shortcut)
745 return (*verbs)[shortcut];
774 gchar *sp_shortcut_get_label(unsigned int shortcut)
786 if (shortcut != GDK_KEY_VoidSymbol) {
788 sp_shortcut_get_key(shortcut),
789 sp_shortcut_get_modifiers(shortcut));