2006-05-19 17:18:06 +00:00
|
|
|
/*
|
|
|
|
* keybindings.h - this file is part of Geany, a fast and lightweight IDE
|
|
|
|
*
|
2010-01-01 22:55:18 +00:00
|
|
|
* Copyright 2006-2010 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
|
|
|
|
* Copyright 2006-2010 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
|
2006-05-19 17:18:06 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*
|
|
|
|
* $Id$
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef GEANY_KEYBINDINGS_H
|
|
|
|
#define GEANY_KEYBINDINGS_H 1
|
|
|
|
|
2009-08-24 11:35:13 +00:00
|
|
|
/** Function pointer type used for keybinding callbacks. */
|
2008-08-08 18:05:53 +00:00
|
|
|
typedef void (*GeanyKeyCallback) (guint key_id);
|
2006-10-26 15:22:27 +00:00
|
|
|
|
2009-08-25 16:55:56 +00:00
|
|
|
/** Represents a single keybinding action.
|
|
|
|
* Use keybindings_set_item() to set. */
|
2008-08-08 18:05:53 +00:00
|
|
|
typedef struct GeanyKeyBinding
|
2006-05-19 17:18:06 +00:00
|
|
|
{
|
2009-08-24 11:35:13 +00:00
|
|
|
guint key; /**< Key value in lower-case, such as @c GDK_a or 0 */
|
|
|
|
GdkModifierType mods; /**< Modifier keys, such as @c GDK_CONTROL_MASK or 0 */
|
2008-03-14 17:23:24 +00:00
|
|
|
gchar *name; /**< Key name for the configuration file, such as @c "menu_new" */
|
2009-10-29 11:59:55 +00:00
|
|
|
/** Label used in the preferences dialog keybindings tab.
|
|
|
|
* May contain underscores - these won't be displayed. */
|
|
|
|
gchar *label;
|
2009-10-12 11:50:45 +00:00
|
|
|
/** Function called when the key combination is pressed, or @c NULL to use the group callback
|
|
|
|
* (preferred). @see plugin_set_key_group(). */
|
|
|
|
GeanyKeyCallback callback;
|
2009-08-24 11:35:13 +00:00
|
|
|
GtkWidget *menu_item; /**< Optional widget to set an accelerator for, or @c NULL */
|
2009-08-25 16:55:56 +00:00
|
|
|
}
|
|
|
|
GeanyKeyBinding;
|
2006-05-19 17:18:06 +00:00
|
|
|
|
2009-10-12 11:50:45 +00:00
|
|
|
|
|
|
|
/** Function pointer type used for keybinding group callbacks.
|
|
|
|
* You should return @c TRUE to indicate handling the callback. (Occasionally, if the keybinding
|
|
|
|
* cannot apply in the current situation, it is useful to return @c FALSE to allow a later keybinding
|
|
|
|
* with the same key combination to handle it). */
|
|
|
|
typedef gboolean (*GeanyKeyGroupCallback) (guint key_id);
|
|
|
|
|
2009-08-25 16:55:56 +00:00
|
|
|
/** A collection of keybindings grouped together. */
|
|
|
|
typedef struct GeanyKeyGroup GeanyKeyGroup;
|
2006-05-19 17:18:06 +00:00
|
|
|
|
2009-08-25 16:55:56 +00:00
|
|
|
/* Plugins should not set these fields. */
|
2009-08-26 14:56:05 +00:00
|
|
|
#ifdef GEANY_PRIVATE
|
2009-08-25 16:55:56 +00:00
|
|
|
struct GeanyKeyGroup
|
2008-02-29 19:30:28 +00:00
|
|
|
{
|
2009-08-25 16:55:56 +00:00
|
|
|
const gchar *name; /* Group name used in the configuration file, such as @c "html_chars" */
|
2009-08-24 11:35:13 +00:00
|
|
|
const gchar *label; /* Group label used in the preferences dialog keybindings tab */
|
2009-08-25 16:55:56 +00:00
|
|
|
gsize count; /* number of keybindings the group holds */
|
2009-08-24 11:35:13 +00:00
|
|
|
GeanyKeyBinding *keys; /* array of GeanyKeyBinding structs */
|
2009-08-25 16:55:56 +00:00
|
|
|
gboolean plugin; /* used by plugin */
|
2009-10-12 11:50:45 +00:00
|
|
|
GeanyKeyGroupCallback callback; /* use this or individual keybinding callbacks */
|
2009-08-25 16:55:56 +00:00
|
|
|
};
|
2009-08-26 14:56:05 +00:00
|
|
|
#endif
|
2009-08-25 16:55:56 +00:00
|
|
|
|
2008-02-29 19:30:28 +00:00
|
|
|
|
2008-08-08 18:05:53 +00:00
|
|
|
extern GPtrArray *keybinding_groups; /* array of GeanyKeyGroup pointers */
|
2008-02-12 15:49:54 +00:00
|
|
|
|
2008-03-13 17:12:18 +00:00
|
|
|
extern const gchar keybindings_keyfile_group_name[];
|
|
|
|
|
2008-02-29 19:30:28 +00:00
|
|
|
|
2008-06-26 16:39:41 +00:00
|
|
|
/* Note: we don't need to increment the plugin ABI when appending keybindings or keygroups,
|
|
|
|
* just make sure to only insert keybindings/groups immediately before the _COUNT item, so
|
|
|
|
* the existing enum values stay the same.
|
|
|
|
* The _COUNT item should not be used by plugins, as it may well change. */
|
2008-03-24 13:40:01 +00:00
|
|
|
|
2008-03-10 17:30:27 +00:00
|
|
|
/** Keybinding group IDs */
|
2010-04-05 11:42:31 +00:00
|
|
|
enum GeanyKeyGroupID
|
2008-02-29 19:30:28 +00:00
|
|
|
{
|
2010-04-05 11:42:31 +00:00
|
|
|
GEANY_KEY_GROUP_FILE, /**< Group for @ref GeanyKeysFileID. */
|
|
|
|
GEANY_KEY_GROUP_PROJECT, /**< Group for @ref GeanyKeysProjectID. */
|
|
|
|
GEANY_KEY_GROUP_EDITOR, /**< Group for @ref GeanyKeysEditorID. */
|
|
|
|
GEANY_KEY_GROUP_CLIPBOARD, /**< Group for @ref GeanyKeysClipboardID. */
|
|
|
|
GEANY_KEY_GROUP_SELECT, /**< Group for @ref GeanyKeysSelectID. */
|
|
|
|
GEANY_KEY_GROUP_FORMAT, /**< Group for @ref GeanyKeysFormatID. */
|
|
|
|
GEANY_KEY_GROUP_INSERT, /**< Group for @ref GeanyKeysInsertID. */
|
|
|
|
GEANY_KEY_GROUP_SETTINGS, /**< Group for @ref GeanyKeysSettingsID. */
|
|
|
|
GEANY_KEY_GROUP_SEARCH, /**< Group for @ref GeanyKeysSearchID. */
|
|
|
|
GEANY_KEY_GROUP_GOTO, /**< Group for @ref GeanyKeysGoToID. */
|
|
|
|
GEANY_KEY_GROUP_VIEW, /**< Group for @ref GeanyKeysViewID. */
|
|
|
|
GEANY_KEY_GROUP_FOCUS, /**< Group for @ref GeanyKeysFocusID. */
|
|
|
|
GEANY_KEY_GROUP_NOTEBOOK, /**< Group for @ref GeanyKeysNotebookTabID. */
|
|
|
|
GEANY_KEY_GROUP_DOCUMENT, /**< Group for @ref GeanyKeysDocumentID. */
|
|
|
|
GEANY_KEY_GROUP_BUILD, /**< Group for @ref GeanyKeysBuildID. */
|
|
|
|
GEANY_KEY_GROUP_TOOLS, /**< Group for @ref GeanyKeysToolsID. */
|
|
|
|
GEANY_KEY_GROUP_HELP, /**< Group for @ref GeanyKeysHelpID. */
|
2008-03-12 13:37:39 +00:00
|
|
|
GEANY_KEY_GROUP_COUNT
|
2008-02-29 19:30:28 +00:00
|
|
|
};
|
|
|
|
|
2008-03-10 17:30:27 +00:00
|
|
|
/** File group keybinding command IDs */
|
2010-04-05 11:42:31 +00:00
|
|
|
enum GeanyKeysFileID
|
2006-05-19 17:18:06 +00:00
|
|
|
{
|
2010-04-05 11:42:31 +00:00
|
|
|
GEANY_KEYS_FILE_NEW, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_FILE_OPEN, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_FILE_OPENSELECTED, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_FILE_SAVE, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_FILE_SAVEAS, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_FILE_SAVEALL, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_FILE_PRINT, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_FILE_CLOSE, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_FILE_CLOSEALL, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_FILE_RELOAD, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_FILE_OPENLASTTAB, /**< Keybinding. */
|
2008-02-29 19:30:28 +00:00
|
|
|
GEANY_KEYS_FILE_COUNT
|
|
|
|
};
|
2007-03-29 14:39:04 +00:00
|
|
|
|
2008-03-12 13:37:39 +00:00
|
|
|
/** Project group keybinding command IDs */
|
2010-04-05 11:42:31 +00:00
|
|
|
enum GeanyKeysProjectID
|
2008-02-29 19:30:28 +00:00
|
|
|
{
|
2010-04-05 11:42:31 +00:00
|
|
|
GEANY_KEYS_PROJECT_PROPERTIES, /**< Keybinding. */
|
2008-03-12 13:37:39 +00:00
|
|
|
GEANY_KEYS_PROJECT_COUNT
|
2008-02-29 19:30:28 +00:00
|
|
|
};
|
2007-03-29 14:39:04 +00:00
|
|
|
|
2008-03-12 13:37:39 +00:00
|
|
|
/** Editor group keybinding command IDs */
|
2010-04-05 11:42:31 +00:00
|
|
|
enum GeanyKeysEditorID
|
2008-02-29 19:30:28 +00:00
|
|
|
{
|
2010-04-05 11:42:31 +00:00
|
|
|
GEANY_KEYS_EDITOR_UNDO, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_EDITOR_REDO, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_EDITOR_DELETELINE, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_EDITOR_DUPLICATELINE, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_EDITOR_TRANSPOSELINE, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_EDITOR_SCROLLTOLINE, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_EDITOR_SCROLLLINEUP, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_EDITOR_SCROLLLINEDOWN, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_EDITOR_COMPLETESNIPPET, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_EDITOR_SUPPRESSSNIPPETCOMPLETION, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_EDITOR_SNIPPETNEXTCURSOR, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_EDITOR_CONTEXTACTION, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_EDITOR_AUTOCOMPLETE, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_EDITOR_CALLTIP, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_EDITOR_MACROLIST, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_EDITOR_DELETELINETOEND, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_EDITOR_WORDPARTCOMPLETION, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_EDITOR_MOVELINEUP, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_EDITOR_MOVELINEDOWN, /**< Keybinding. */
|
2008-03-12 13:37:39 +00:00
|
|
|
GEANY_KEYS_EDITOR_COUNT
|
2008-02-29 19:30:28 +00:00
|
|
|
};
|
2007-03-29 14:39:04 +00:00
|
|
|
|
2008-03-12 13:37:39 +00:00
|
|
|
/** Clipboard group keybinding command IDs */
|
2010-04-05 11:42:31 +00:00
|
|
|
enum GeanyKeysClipboardID
|
2008-02-29 19:30:28 +00:00
|
|
|
{
|
2010-04-05 11:42:31 +00:00
|
|
|
GEANY_KEYS_CLIPBOARD_CUT, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_CLIPBOARD_COPY, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_CLIPBOARD_PASTE, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_CLIPBOARD_CUTLINE, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_CLIPBOARD_COPYLINE, /**< Keybinding. */
|
2008-03-12 13:37:39 +00:00
|
|
|
GEANY_KEYS_CLIPBOARD_COUNT
|
2008-02-29 19:30:28 +00:00
|
|
|
};
|
2007-03-29 14:39:04 +00:00
|
|
|
|
2008-03-12 13:37:39 +00:00
|
|
|
/** Select group keybinding command IDs */
|
2010-04-05 11:42:31 +00:00
|
|
|
enum GeanyKeysSelectID
|
2008-02-29 19:30:28 +00:00
|
|
|
{
|
2008-03-12 13:37:39 +00:00
|
|
|
|
2010-04-05 11:42:31 +00:00
|
|
|
GEANY_KEYS_SELECT_ALL, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_SELECT_WORD, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_SELECT_LINE, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_SELECT_PARAGRAPH, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_SELECT_WORDPARTLEFT, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_SELECT_WORDPARTRIGHT, /**< Keybinding. */
|
2008-03-12 13:37:39 +00:00
|
|
|
GEANY_KEYS_SELECT_COUNT
|
2008-02-29 19:30:28 +00:00
|
|
|
};
|
2007-03-29 14:39:04 +00:00
|
|
|
|
2008-03-12 13:37:39 +00:00
|
|
|
/** Format group keybinding command IDs */
|
2010-04-05 11:42:31 +00:00
|
|
|
enum GeanyKeysFormatID
|
2008-02-29 19:30:28 +00:00
|
|
|
{
|
2010-04-05 11:42:31 +00:00
|
|
|
GEANY_KEYS_FORMAT_TOGGLECASE, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_FORMAT_COMMENTLINETOGGLE, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_FORMAT_COMMENTLINE, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_FORMAT_UNCOMMENTLINE, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_FORMAT_INCREASEINDENT, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_FORMAT_DECREASEINDENT, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_FORMAT_INCREASEINDENTBYSPACE, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_FORMAT_DECREASEINDENTBYSPACE, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_FORMAT_AUTOINDENT, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_FORMAT_SENDTOCMD1, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_FORMAT_SENDTOCMD2, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_FORMAT_SENDTOCMD3, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_FORMAT_SENDTOVTE, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_FORMAT_REFLOWPARAGRAPH, /**< Keybinding. */
|
2008-03-12 13:37:39 +00:00
|
|
|
GEANY_KEYS_FORMAT_COUNT
|
2008-02-29 19:30:28 +00:00
|
|
|
};
|
2007-03-29 14:39:04 +00:00
|
|
|
|
2008-03-12 13:37:39 +00:00
|
|
|
/** Insert group keybinding command IDs */
|
2010-04-05 11:42:31 +00:00
|
|
|
enum GeanyKeysInsertID
|
2008-02-29 19:30:28 +00:00
|
|
|
{
|
2010-04-05 11:42:31 +00:00
|
|
|
GEANY_KEYS_INSERT_DATE, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_INSERT_ALTWHITESPACE, /**< Keybinding. */
|
2008-03-12 13:37:39 +00:00
|
|
|
GEANY_KEYS_INSERT_COUNT
|
2008-02-29 19:30:28 +00:00
|
|
|
};
|
2007-03-29 14:39:04 +00:00
|
|
|
|
2008-03-12 13:37:39 +00:00
|
|
|
/** Settings group keybinding command IDs */
|
2010-04-05 11:42:31 +00:00
|
|
|
enum GeanyKeysSettingsID
|
2008-02-29 19:30:28 +00:00
|
|
|
{
|
2010-04-05 11:42:31 +00:00
|
|
|
GEANY_KEYS_SETTINGS_PREFERENCES, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_SETTINGS_PLUGINPREFERENCES, /**< Keybinding. */
|
2008-03-12 13:37:39 +00:00
|
|
|
GEANY_KEYS_SETTINGS_COUNT
|
|
|
|
};
|
|
|
|
|
|
|
|
/** Search group keybinding command IDs */
|
2010-04-05 11:42:31 +00:00
|
|
|
enum GeanyKeysSearchID
|
2008-03-12 13:37:39 +00:00
|
|
|
{
|
2010-04-05 11:42:31 +00:00
|
|
|
GEANY_KEYS_SEARCH_FIND, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_SEARCH_FINDNEXT, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_SEARCH_FINDPREVIOUS, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_SEARCH_FINDINFILES, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_SEARCH_REPLACE, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_SEARCH_FINDNEXTSEL, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_SEARCH_FINDPREVSEL, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_SEARCH_NEXTMESSAGE, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_SEARCH_PREVIOUSMESSAGE, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_SEARCH_FINDUSAGE, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_SEARCH_FINDDOCUMENTUSAGE, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_SEARCH_MARKALL, /**< Keybinding. */
|
2008-03-12 13:37:39 +00:00
|
|
|
GEANY_KEYS_SEARCH_COUNT
|
|
|
|
};
|
|
|
|
|
|
|
|
/** Go To group keybinding command IDs */
|
2010-04-05 11:42:31 +00:00
|
|
|
enum GeanyKeysGoToID
|
2008-03-12 13:37:39 +00:00
|
|
|
{
|
2010-04-05 11:42:31 +00:00
|
|
|
GEANY_KEYS_GOTO_FORWARD, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_GOTO_BACK, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_GOTO_LINE, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_GOTO_LINESTART, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_GOTO_LINEEND, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_GOTO_MATCHINGBRACE, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_GOTO_TOGGLEMARKER, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_GOTO_NEXTMARKER, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_GOTO_PREVIOUSMARKER, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_GOTO_PREVWORDPART, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_GOTO_NEXTWORDPART, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_GOTO_TAGDEFINITION, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_GOTO_TAGDECLARATION, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_GOTO_LINEENDVISUAL, /**< Keybinding. */
|
2008-03-12 13:37:39 +00:00
|
|
|
GEANY_KEYS_GOTO_COUNT
|
|
|
|
};
|
|
|
|
|
|
|
|
/** View group keybinding command IDs */
|
2010-04-05 11:42:31 +00:00
|
|
|
enum GeanyKeysViewID
|
2008-03-12 13:37:39 +00:00
|
|
|
{
|
2010-04-05 11:42:31 +00:00
|
|
|
GEANY_KEYS_VIEW_TOGGLEALL, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_VIEW_FULLSCREEN, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_VIEW_MESSAGEWINDOW, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_VIEW_SIDEBAR, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_VIEW_ZOOMIN, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_VIEW_ZOOMOUT, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_VIEW_ZOOMRESET, /**< Keybinding. */
|
2008-03-12 13:37:39 +00:00
|
|
|
GEANY_KEYS_VIEW_COUNT
|
2008-02-29 19:30:28 +00:00
|
|
|
};
|
2007-07-04 14:41:58 +00:00
|
|
|
|
2008-03-10 17:30:27 +00:00
|
|
|
/** Focus group keybinding command IDs */
|
2010-04-05 11:42:31 +00:00
|
|
|
/* TODO when the plugin ABI get increased the next time, rearrange these keybindings */
|
|
|
|
enum GeanyKeysFocusID
|
2008-02-29 19:30:28 +00:00
|
|
|
{
|
2010-04-05 11:42:31 +00:00
|
|
|
GEANY_KEYS_FOCUS_EDITOR, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_FOCUS_SCRIBBLE, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_FOCUS_VTE, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_FOCUS_SEARCHBAR, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_FOCUS_SIDEBAR, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_FOCUS_COMPILER, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_FOCUS_MESSAGES, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_FOCUS_MESSAGE_WINDOW, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_FOCUS_SIDEBAR_DOCUMENT_LIST, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_FOCUS_SIDEBAR_SYMBOL_LIST, /**< Keybinding. */
|
2008-02-29 19:30:28 +00:00
|
|
|
GEANY_KEYS_FOCUS_COUNT
|
|
|
|
};
|
2007-11-06 16:59:01 +00:00
|
|
|
|
2008-03-12 13:37:39 +00:00
|
|
|
/** Notebook Tab group keybinding command IDs */
|
2010-04-05 11:42:31 +00:00
|
|
|
enum GeanyKeysNotebookTabID
|
2008-02-29 19:30:28 +00:00
|
|
|
{
|
2010-04-05 11:42:31 +00:00
|
|
|
GEANY_KEYS_NOTEBOOK_SWITCHTABLEFT, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_NOTEBOOK_SWITCHTABRIGHT, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_NOTEBOOK_SWITCHTABLASTUSED, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_NOTEBOOK_MOVETABLEFT, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_NOTEBOOK_MOVETABRIGHT, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_NOTEBOOK_MOVETABFIRST, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_NOTEBOOK_MOVETABLAST, /**< Keybinding. */
|
2008-02-29 19:30:28 +00:00
|
|
|
GEANY_KEYS_NOTEBOOK_COUNT
|
|
|
|
};
|
2007-03-29 14:39:04 +00:00
|
|
|
|
2008-03-12 13:37:39 +00:00
|
|
|
/** Document group keybinding command IDs */
|
2010-04-05 11:42:31 +00:00
|
|
|
enum GeanyKeysDocumentID
|
2008-02-29 19:30:28 +00:00
|
|
|
{
|
2010-04-05 11:42:31 +00:00
|
|
|
GEANY_KEYS_DOCUMENT_REPLACETABS, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_DOCUMENT_REPLACESPACES, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_DOCUMENT_TOGGLEFOLD, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_DOCUMENT_FOLDALL, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_DOCUMENT_UNFOLDALL, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_DOCUMENT_RELOADTAGLIST, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_DOCUMENT_LINEWRAP, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_DOCUMENT_LINEBREAK, /**< Keybinding. */
|
2010-04-17 14:55:14 +00:00
|
|
|
GEANY_KEYS_DOCUMENT_REMOVE_MARKERS, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_DOCUMENT_REMOVE_ERROR_INDICATORS, /**< Keybinding. */
|
2008-03-12 13:37:39 +00:00
|
|
|
GEANY_KEYS_DOCUMENT_COUNT
|
2008-02-29 19:30:28 +00:00
|
|
|
};
|
2007-09-13 16:40:19 +00:00
|
|
|
|
2008-03-12 13:37:39 +00:00
|
|
|
/** Build group keybinding command IDs */
|
2010-04-05 11:42:31 +00:00
|
|
|
enum GeanyKeysBuildID
|
2008-02-29 19:30:28 +00:00
|
|
|
{
|
2010-04-05 11:42:31 +00:00
|
|
|
GEANY_KEYS_BUILD_COMPILE, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_BUILD_LINK, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_BUILD_MAKE, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_BUILD_MAKEOWNTARGET, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_BUILD_MAKEOBJECT, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_BUILD_NEXTERROR, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_BUILD_PREVIOUSERROR, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_BUILD_RUN, /**< Keybinding. */
|
|
|
|
GEANY_KEYS_BUILD_OPTIONS, /**< Keybinding. */
|
2008-03-12 13:37:39 +00:00
|
|
|
GEANY_KEYS_BUILD_COUNT
|
|
|
|
};
|
|
|
|
|
|
|
|
/** Tools group keybinding command IDs */
|
2010-04-05 11:42:31 +00:00
|
|
|
enum GeanyKeysToolsID
|
2008-03-12 13:37:39 +00:00
|
|
|
{
|
2010-04-05 11:42:31 +00:00
|
|
|
GEANY_KEYS_TOOLS_OPENCOLORCHOOSER, /**< Keybinding. */
|
2008-03-12 13:37:39 +00:00
|
|
|
GEANY_KEYS_TOOLS_COUNT
|
2008-02-29 19:30:28 +00:00
|
|
|
};
|
2007-11-06 16:59:01 +00:00
|
|
|
|
2008-03-12 13:37:39 +00:00
|
|
|
/** Help group keybinding command IDs */
|
2010-04-05 11:42:31 +00:00
|
|
|
enum GeanyKeysHelpID
|
2008-02-29 19:30:28 +00:00
|
|
|
{
|
2010-04-05 11:42:31 +00:00
|
|
|
GEANY_KEYS_HELP_HELP, /**< Keybinding. */
|
2008-03-12 13:37:39 +00:00
|
|
|
GEANY_KEYS_HELP_COUNT
|
2008-02-29 19:30:28 +00:00
|
|
|
};
|
2006-05-19 17:18:06 +00:00
|
|
|
|
|
|
|
|
|
|
|
void keybindings_init(void);
|
|
|
|
|
2008-03-10 13:54:47 +00:00
|
|
|
void keybindings_load_keyfile(void);
|
|
|
|
|
2006-05-19 17:18:06 +00:00
|
|
|
void keybindings_free(void);
|
|
|
|
|
2009-08-25 16:55:56 +00:00
|
|
|
GeanyKeyGroup *keybindings_set_group(GeanyKeyGroup *group, const gchar *section_name,
|
|
|
|
const gchar *label, gsize count, GeanyKeyGroupCallback callback) G_GNUC_WARN_UNUSED_RESULT;
|
|
|
|
|
|
|
|
void keybindings_free_group(GeanyKeyGroup *group);
|
|
|
|
|
|
|
|
GeanyKeyBinding *keybindings_set_item(GeanyKeyGroup *group, gsize key_id,
|
2008-08-08 18:05:53 +00:00
|
|
|
GeanyKeyCallback callback, guint key, GdkModifierType mod,
|
2008-03-14 17:23:24 +00:00
|
|
|
gchar *name, gchar *label, GtkWidget *menu_item);
|
2008-02-29 19:30:28 +00:00
|
|
|
|
2009-08-25 16:55:56 +00:00
|
|
|
GeanyKeyBinding *keybindings_get_item(GeanyKeyGroup *group, gsize key_id);
|
|
|
|
|
2009-10-29 11:59:55 +00:00
|
|
|
gchar *keybindings_get_label(GeanyKeyBinding *kb);
|
|
|
|
|
2009-08-18 13:57:07 +00:00
|
|
|
void keybindings_update_combo(GeanyKeyBinding *kb, guint key, GdkModifierType mods);
|
|
|
|
|
2008-03-10 13:29:35 +00:00
|
|
|
void keybindings_send_command(guint group_id, guint key_id);
|
2008-03-10 13:23:57 +00:00
|
|
|
|
2008-08-08 18:05:53 +00:00
|
|
|
GeanyKeyBinding *keybindings_lookup_item(guint group_id, guint key_id);
|
2007-07-18 15:35:52 +00:00
|
|
|
|
2006-05-19 17:18:06 +00:00
|
|
|
/* just write the content of the keys array to the config file */
|
|
|
|
void keybindings_write_to_file(void);
|
|
|
|
|
2008-02-20 11:24:23 +00:00
|
|
|
void keybindings_show_shortcuts(void);
|
2007-03-23 16:34:54 +00:00
|
|
|
|
2009-11-23 22:25:11 +00:00
|
|
|
const GeanyKeyBinding *keybindings_check_event(GdkEventKey *ev, gint *group_id, gint *binding_id);
|
|
|
|
|
2006-05-19 17:18:06 +00:00
|
|
|
#endif
|
|
|
|
|