diff --git a/include/history.h b/include/history.h index ebc9f10d..2ec59f9c 100644 --- a/include/history.h +++ b/include/history.h @@ -1,29 +1,3 @@ -/** - * rofi - * - * MIT/X11 License - * Copyright 2013-2015 Qball Cow - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - */ #ifndef ROFI_HISTORY_H #define ROFI_HISTORY_H @@ -34,8 +8,7 @@ * Sets the entry in the history, if it exists its use-count is incremented. * */ -void history_set ( const char *filename, const char *entry ) -__attribute__( ( nonnull ) ); +void history_set ( const char *filename, const char *entry ) __attribute__( ( nonnull ) ); /** @@ -44,8 +17,7 @@ __attribute__( ( nonnull ) ); * * Removes the entry from the history. */ -void history_remove ( const char *filename, const char *entry ) -__attribute__( ( nonnull ) ); +void history_remove ( const char *filename, const char *entry ) __attribute__( ( nonnull ) ); /** @@ -55,9 +27,6 @@ __attribute__( ( nonnull ) ); * Gets the entries in the list (in order of usage) * @returns a list of entries length long. (and NULL terminated). */ -char ** history_get_list ( const char *filename, unsigned int * length ) -__attribute__( ( nonnull ) ); - - +char ** history_get_list ( const char *filename, unsigned int * length ) __attribute__( ( nonnull ) ); #endif diff --git a/include/keyb.h b/include/keyb.h index a6851bfa..71f10156 100644 --- a/include/keyb.h +++ b/include/keyb.h @@ -23,6 +23,17 @@ typedef enum _KeyBindingAction MODE_PREVIOUS, TOGGLE_CASE_SENSITIVITY, DELETE_ENTRY, + ROW_LEFT, + ROW_RIGHT, + ROW_UP, + ROW_DOWN, + ROW_TAB, + PAGE_PREV, + PAGE_NEXT, + ROW_FIRST, + ROW_LAST, + ROW_SELECT, + CANCEL, CUSTOM_1, CUSTOM_2, CUSTOM_3, @@ -42,17 +53,6 @@ typedef enum _KeyBindingAction CUSTOM_17, CUSTOM_18, CUSTOM_19, - ROW_LEFT, - ROW_RIGHT, - ROW_UP, - ROW_DOWN, - ROW_TAB, - PAGE_PREV, - PAGE_NEXT, - ROW_FIRST, - ROW_LAST, - ROW_SELECT, - CANCEL, NUM_ABE } KeyBindingAction; diff --git a/source/keyb.c b/source/keyb.c index 85672c28..17028b2d 100644 --- a/source/keyb.c +++ b/source/keyb.c @@ -3,9 +3,6 @@ #include "x11-helper.h" #include "xrmoptions.h" - - - typedef struct _KeyBinding { unsigned int modmask; @@ -37,256 +34,56 @@ extern unsigned int NumlockMask; */ DefaultBinding bindings[NUM_ABE] = { - { - .id = PASTE_PRIMARY, - .name = "kb-primary-paste", - .keybinding = "Control+Shift+v,Shift+Insert", - }, - { - .id = PASTE_SECONDARY, - .name = "kb-secondary-paste", - .keybinding = "Control+v,Insert", - }, - { - .id = CLEAR_LINE, - .name = "kb-clear-line", - .keybinding = "Control+u", - }, - { - .id = MOVE_FRONT, - .name = "kb-move-front", - .keybinding = "Control+a", - }, - { - .id = MOVE_END, - .name = "kb-move-end", - .keybinding = "Control+e", - }, - { - .id = MOVE_WORD_BACK, - .name = "kb-move-word-back", - .keybinding = "Alt+b", - }, - { - .id = MOVE_WORD_FORWARD, - .name = "kb-move-word-forward", - .keybinding = "Alt+f", - }, - { - .id = MOVE_CHAR_BACK, - .name = "kb-move-char-back", - .keybinding = "Left,Control+b" - }, - { - .id = MOVE_CHAR_FORWARD, - .name = "kb-move-char-forward", - .keybinding = "Right,Control+f" - }, - { - .id = REMOVE_WORD_BACK, - .name = "kb-remove-word-back", - .keybinding = "Control+Alt+h", - }, - { - .id = REMOVE_WORD_FORWARD, - .name = "kb-remove-word-forward", - .keybinding = "Control+Alt+d", - }, - { - .id = REMOVE_CHAR_FORWARD, - .name = "kb-remove-char-forward", - .keybinding = "Delete,Control+d", - }, - { - .id = REMOVE_CHAR_BACK, - .name = "kb-remove-char-back", - .keybinding = "BackSpace,Control+h", - }, - { - .id = ACCEPT_ENTRY, - .name = "kb-accept-entry", - .keybinding = "Control+j,Control+m,Return,KP_Enter", - }, - { - .id = ACCEPT_CUSTOM, - .name = "kb-accept-custom", - .keybinding = "Control+Return", - }, - { - .id = ACCEPT_ENTRY_CONTINUE, - .name = "kb-accept-entry-continue", - .keybinding = "Shift+Return", - }, - { - .id = MODE_NEXT, - .name = "kb-mode-next", - .keybinding = "Shift+Right,Control+Tab" - }, - { - .id = MODE_PREVIOUS, - .name = "kb-mode-previous", - .keybinding = "Shift+Left,Control+Shift+Tab" - }, - { - .id = TOGGLE_CASE_SENSITIVITY, - .name = "kb-toggle-case-sensitivity", - .keybinding = "grave,dead_grave" - }, - { - .id = DELETE_ENTRY, - .name = "kb-delete-entry", - .keybinding = "Shift+Delete" - }, - { - .id = CUSTOM_1, - .name = "kb-custom-1", - .keybinding = "Alt+1" - }, - { - .id = CUSTOM_2, - .name = "kb-custom-2", - .keybinding = "Alt+2" - }, - { - .id = CUSTOM_3, - .name = "kb-custom-3", - .keybinding = "Alt+3" - }, - { - .id = CUSTOM_4, - .name = "kb-custom-4", - .keybinding = "Alt+4" - }, - { - .id = CUSTOM_5, - .name = "kb-custom-5", - .keybinding = "Alt+5" - }, - { - .id = CUSTOM_6, - .name = "kb-custom-6", - .keybinding = "Alt+6" - }, - { - .id = CUSTOM_7, - .name = "kb-custom-7", - .keybinding = "Alt+7" - }, - { - .id = CUSTOM_8, - .name = "kb-custom-8", - .keybinding = "Alt+8" - }, - { - .id = CUSTOM_9, - .name = "kb-custom-9", - .keybinding = "Alt+9" - }, - { - .id = CUSTOM_10, - .name = "kb-custom-10", - .keybinding = "Alt+0" - }, - { - .id = CUSTOM_11, - .name = "kb-custom-11", - .keybinding = "Alt+Shift+1" - }, - { - .id = CUSTOM_12, - .name = "kb-custom-12", - .keybinding = "Alt+Shift+2" - }, - { - .id = CUSTOM_13, - .name = "kb-custom-13", - .keybinding = "Alt+Shift+3" - }, - { - .id = CUSTOM_14, - .name = "kb-custom-14", - .keybinding = "Alt+Shift+4" - }, - { - .id = CUSTOM_15, - .name = "kb-custom-15", - .keybinding = "Alt+Shift+5" - }, - { - .id = CUSTOM_16, - .name = "kb-custom-16", - .keybinding = "Alt+Shift+6" - }, - { - .id = CUSTOM_17, - .name = "kb-custom-17", - .keybinding = "Alt+Shift+7" - }, - { - .id = CUSTOM_18, - .name = "kb-custom-18", - .keybinding = "Alt+Shift+8" - }, - { - .id = CUSTOM_19, - .name = "kb-custom-19", - .keybinding = "Alt+Shift+9" - }, - { - .id = ROW_LEFT, - .name = "kb-row-left", - .keybinding = "Control+Page_Up" - }, - { - .id = ROW_RIGHT, - .name = "kb-row-right", - .keybinding = "Control+Page_Down" - }, - { - .id = ROW_UP, - .name = "kb-row-up", - .keybinding = "Up,Control+p,Shift+Tab" - }, - { - .id = ROW_DOWN, - .name = "kb-row-down", - .keybinding = "Down,Control+n" - }, - { - .id = ROW_TAB, - .name = "kb-row-tab", - .keybinding = "Tab" - }, - { - .id = PAGE_PREV, - .name = "kb-page-prev", - .keybinding = "Page_Up" - }, - { - .id = PAGE_NEXT, - .name = "kb-page-next", - .keybinding = "Page_Down" - }, - { - .id = ROW_FIRST, - .name = "kb-row-first", - .keybinding = "Home,KP_Home" - }, - { - .id = ROW_LAST, - .name = "kb-row-last", - .keybinding = "End,KP_End" - }, - { - .id = ROW_SELECT, - .name = "kb-row-select", - .keybinding = "Control+space" - }, - { - .id = CANCEL, - .name = "kb-cancel", - .keybinding = "Escape" - }, + { .id = PASTE_PRIMARY, .name = "kb-primary-paste", .keybinding = "Control+Shift+v,Shift+Insert", }, + { .id = PASTE_SECONDARY, .name = "kb-secondary-paste", .keybinding = "Control+v,Insert", }, + { .id = CLEAR_LINE, .name = "kb-clear-line", .keybinding = "Control+u", }, + { .id = MOVE_FRONT, .name = "kb-move-front", .keybinding = "Control+a", }, + { .id = MOVE_END, .name = "kb-move-end", .keybinding = "Control+e", }, + { .id = MOVE_WORD_BACK, .name = "kb-move-word-back", .keybinding = "Alt+b", }, + { .id = MOVE_WORD_FORWARD, .name = "kb-move-word-forward", .keybinding = "Alt+f", }, + { .id = MOVE_CHAR_BACK, .name = "kb-move-char-back", .keybinding = "Left,Control+b" }, + { .id = MOVE_CHAR_FORWARD, .name = "kb-move-char-forward", .keybinding = "Right,Control+f" }, + { .id = REMOVE_WORD_BACK, .name = "kb-remove-word-back", .keybinding = "Control+Alt+h", }, + { .id = REMOVE_WORD_FORWARD, .name = "kb-remove-word-forward", .keybinding = "Control+Alt+d", }, + { .id = REMOVE_CHAR_FORWARD, .name = "kb-remove-char-forward", .keybinding = "Delete,Control+d", }, + { .id = REMOVE_CHAR_BACK, .name = "kb-remove-char-back", .keybinding = "BackSpace,Control+h", }, + { .id = ACCEPT_ENTRY, .name = "kb-accept-entry", .keybinding = "Control+j,Control+m,Return,KP_Enter", }, + { .id = ACCEPT_CUSTOM, .name = "kb-accept-custom", .keybinding = "Control+Return", }, + { .id = ACCEPT_ENTRY_CONTINUE, .name = "kb-accept-entry-continue", .keybinding = "Shift+Return", }, + { .id = MODE_NEXT, .name = "kb-mode-next", .keybinding = "Shift+Right,Control+Tab" }, + { .id = MODE_PREVIOUS, .name = "kb-mode-previous", .keybinding = "Shift+Left,Control+Shift+Tab" }, + { .id = TOGGLE_CASE_SENSITIVITY, .name = "kb-toggle-case-sensitivity", .keybinding = "grave,dead_grave" }, + { .id = DELETE_ENTRY, .name = "kb-delete-entry", .keybinding = "Shift+Delete" }, + { .id = ROW_LEFT, .name = "kb-row-left", .keybinding = "Control+Page_Up" }, + { .id = ROW_RIGHT, .name = "kb-row-right", .keybinding = "Control+Page_Down" }, + { .id = ROW_UP, .name = "kb-row-up", .keybinding = "Up,Control+p,Shift+Tab" }, + { .id = ROW_DOWN, .name = "kb-row-down", .keybinding = "Down,Control+n" }, + { .id = ROW_TAB, .name = "kb-row-tab", .keybinding = "Tab" }, + { .id = PAGE_PREV, .name = "kb-page-prev", .keybinding = "Page_Up" }, + { .id = PAGE_NEXT, .name = "kb-page-next", .keybinding = "Page_Down" }, + { .id = ROW_FIRST, .name = "kb-row-first", .keybinding = "Home,KP_Home" }, + { .id = ROW_LAST, .name = "kb-row-last", .keybinding = "End,KP_End" }, + { .id = ROW_SELECT, .name = "kb-row-select", .keybinding = "Control+space" }, + { .id = CANCEL, .name = "kb-cancel", .keybinding = "Escape" }, + { .id = CUSTOM_1, .name = "kb-custom-1", .keybinding = "Alt+1" }, + { .id = CUSTOM_2, .name = "kb-custom-2", .keybinding = "Alt+2" }, + { .id = CUSTOM_3, .name = "kb-custom-3", .keybinding = "Alt+3" }, + { .id = CUSTOM_4, .name = "kb-custom-4", .keybinding = "Alt+4" }, + { .id = CUSTOM_5, .name = "kb-custom-5", .keybinding = "Alt+5" }, + { .id = CUSTOM_6, .name = "kb-custom-6", .keybinding = "Alt+6" }, + { .id = CUSTOM_7, .name = "kb-custom-7", .keybinding = "Alt+7" }, + { .id = CUSTOM_8, .name = "kb-custom-8", .keybinding = "Alt+8" }, + { .id = CUSTOM_9, .name = "kb-custom-9", .keybinding = "Alt+9" }, + { .id = CUSTOM_10, .name = "kb-custom-10", .keybinding = "Alt+0" }, + { .id = CUSTOM_11, .name = "kb-custom-11", .keybinding = "Alt+Shift+1" }, + { .id = CUSTOM_12, .name = "kb-custom-12", .keybinding = "Alt+Shift+2" }, + { .id = CUSTOM_13, .name = "kb-custom-13", .keybinding = "Alt+Shift+3" }, + { .id = CUSTOM_14, .name = "kb-custom-14", .keybinding = "Alt+Shift+4" }, + { .id = CUSTOM_15, .name = "kb-custom-15", .keybinding = "Alt+Shift+5" }, + { .id = CUSTOM_16, .name = "kb-custom-16", .keybinding = "Alt+Shift+6" }, + { .id = CUSTOM_17, .name = "kb-custom-17", .keybinding = "Alt+Shift+7" }, + { .id = CUSTOM_18, .name = "kb-custom-18", .keybinding = "Alt+Shift+8" }, + { .id = CUSTOM_19, .name = "kb-custom-19", .keybinding = "Alt+Shift+9" }, };