This file is indexed.

/usr/include/geany/keybindings.h is in geany-common 1.29-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
/*
 *      keybindings.h - this file is part of Geany, a fast and lightweight IDE
 *
 *      Copyright 2006-2012 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
 *      Copyright 2006-2012 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
 *
 *      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.
 */

#ifndef GEANY_KEYBINDINGS_H
#define GEANY_KEYBINDINGS_H 1

#include "gtkcompat.h"

G_BEGIN_DECLS

/** Defines the primary modifier mask which is the Ctrl key mask on
 * UNIX/Windows and Command key mask on OS X. When testing for the mask
 * presence, use together with keybindings_get_modifiers() which adds 
 * @c GEANY_PRIMARY_MOD_MASK when needed.
 * @since 1.25. */
#ifdef __APPLE__
#define GEANY_PRIMARY_MOD_MASK GDK_META_MASK
#else
#define GEANY_PRIMARY_MOD_MASK GDK_CONTROL_MASK
#endif

/** A collection of keybindings grouped together. */
typedef struct GeanyKeyGroup GeanyKeyGroup;
typedef struct GeanyKeyBinding GeanyKeyBinding;

/** 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);

/** Function pointer type used for keybinding group callbacks, with userdata for passing context.
 *
 * 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).
 *
 * @since 1.26 (API 226) */
typedef gboolean (*GeanyKeyGroupFunc)(GeanyKeyGroup *group, guint key_id, gpointer user_data);

/** Function pointer type used for keybinding callbacks. */
typedef void (*GeanyKeyCallback) (guint key_id);

/** Function pointer type used for keybinding callbacks, with userdata for passing context
 *
 * 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).
 *
 * @since 1.26 (API 226) */
typedef gboolean (*GeanyKeyBindingFunc)(GeanyKeyBinding *key, guint key_id, gpointer user_data);

/** Represents a single keybinding action.
 *
 * Use keybindings_set_item() to set. */
struct GeanyKeyBinding
{
	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 */
	gchar *name;			/**< Key name for the configuration file, such as @c "menu_new" */
	/** Label used in the preferences dialog keybindings tab.
	 * May contain underscores - these won't be displayed. */
	gchar *label;
	/** Function called when the key combination is pressed, or @c NULL to use the group callback
	 * (preferred). @see plugin_set_key_group(). */
	GeanyKeyCallback callback;
	GtkWidget *menu_item;	/**< Optional widget to set an accelerator for, or @c NULL */
	guint id;
	guint default_key;
	GdkModifierType default_mods;
	GeanyKeyBindingFunc cb_func;
	gpointer cb_data;
	GDestroyNotify cb_data_destroy;
};

/* Note: we don't need to break the plugin ABI when appending keybinding or keygroup IDs,
 * just make sure to insert immediately before the _COUNT item, so
 * the existing enum values stay the same. */

/** Keybinding group IDs for use with keybindings_send_command(). */
/* These IDs are used to lookup a group. */
enum GeanyKeyGroupID
{
	GEANY_KEY_GROUP_FILE,			/**< Group. */
	GEANY_KEY_GROUP_PROJECT,		/**< Group. */
	GEANY_KEY_GROUP_EDITOR,			/**< Group. */
	GEANY_KEY_GROUP_CLIPBOARD,		/**< Group. */
	GEANY_KEY_GROUP_SELECT,			/**< Group. */
	GEANY_KEY_GROUP_FORMAT,			/**< Group. */
	GEANY_KEY_GROUP_INSERT,			/**< Group. */
	GEANY_KEY_GROUP_SETTINGS,		/**< Group. */
	GEANY_KEY_GROUP_SEARCH,			/**< Group. */
	GEANY_KEY_GROUP_GOTO,			/**< Group. */
	GEANY_KEY_GROUP_VIEW,			/**< Group. */
	GEANY_KEY_GROUP_FOCUS,			/**< Group. */
	GEANY_KEY_GROUP_NOTEBOOK,		/**< Group. */
	GEANY_KEY_GROUP_DOCUMENT,		/**< Group. */
	GEANY_KEY_GROUP_BUILD,			/**< Group. */
	GEANY_KEY_GROUP_TOOLS,			/**< Group. */
	GEANY_KEY_GROUP_HELP,			/**< Group. */
	GEANY_KEY_GROUP_COUNT	/* must not be used by plugins */
};

/** Keybinding command IDs for use with keybindings_send_command(). */
/* These IDs are used to lookup a keybinding. */
enum GeanyKeyBindingID
{
	GEANY_KEYS_EDITOR_TRANSPOSELINE,			/**< Keybinding. */
	GEANY_KEYS_DOCUMENT_REMOVE_ERROR_INDICATORS, /**< Keybinding. */
	GEANY_KEYS_FOCUS_SEARCHBAR,					/**< Keybinding. */
	GEANY_KEYS_SEARCH_FIND,						/**< Keybinding. */
	GEANY_KEYS_FILE_SAVEALL,					/**< Keybinding. */
	GEANY_KEYS_GOTO_NEXTMARKER,					/**< Keybinding. */
	GEANY_KEYS_NOTEBOOK_SWITCHTABLEFT,			/**< Keybinding. */
	GEANY_KEYS_VIEW_ZOOMOUT,					/**< Keybinding. */
	GEANY_KEYS_GOTO_LINE,						/**< Keybinding. */
	GEANY_KEYS_DOCUMENT_TOGGLEFOLD,				/**< Keybinding. */
	GEANY_KEYS_BUILD_COMPILE,					/**< Keybinding. */
	GEANY_KEYS_EDITOR_SCROLLTOLINE,				/**< Keybinding. */
	GEANY_KEYS_DOCUMENT_UNFOLDALL,				/**< Keybinding. */
	GEANY_KEYS_GOTO_MATCHINGBRACE,				/**< Keybinding. */
	GEANY_KEYS_SEARCH_FINDDOCUMENTUSAGE,		/**< Keybinding. */
	GEANY_KEYS_CLIPBOARD_PASTE,					/**< Keybinding. */
	GEANY_KEYS_BUILD_MAKE,						/**< Keybinding. */
	GEANY_KEYS_INSERT_ALTWHITESPACE,			/**< Keybinding. */
	GEANY_KEYS_EDITOR_SCROLLLINEDOWN,			/**< Keybinding. */
	GEANY_KEYS_VIEW_TOGGLEALL,					/**< Keybinding. */
	GEANY_KEYS_VIEW_FULLSCREEN,					/**< Keybinding. */
	GEANY_KEYS_GOTO_LINEEND,					/**< Keybinding. */
	GEANY_KEYS_EDITOR_CALLTIP,					/**< Keybinding. */
	GEANY_KEYS_FILE_PRINT,						/**< Keybinding. */
	GEANY_KEYS_EDITOR_DUPLICATELINE,			/**< Keybinding. */
	GEANY_KEYS_FOCUS_SCRIBBLE,					/**< Keybinding. */
	GEANY_KEYS_TOOLS_OPENCOLORCHOOSER,			/**< Keybinding. */
	GEANY_KEYS_SEARCH_PREVIOUSMESSAGE,			/**< Keybinding. */
	GEANY_KEYS_FILE_CLOSE,						/**< Keybinding. */
	GEANY_KEYS_DOCUMENT_REPLACETABS,			/**< Keybinding. */
	GEANY_KEYS_FILE_RELOAD,						/**< Keybinding. */
	GEANY_KEYS_SEARCH_FINDNEXTSEL,				/**< Keybinding. */
	GEANY_KEYS_FOCUS_MESSAGES,					/**< Keybinding. */
	GEANY_KEYS_BUILD_RUN,						/**< Keybinding. */
	GEANY_KEYS_HELP_HELP,						/**< Keybinding. */
	GEANY_KEYS_SETTINGS_PLUGINPREFERENCES,		/**< Keybinding. */
	GEANY_KEYS_VIEW_ZOOMRESET,					/**< Keybinding. */
	GEANY_KEYS_SELECT_WORD,						/**< Keybinding. */
	GEANY_KEYS_FORMAT_INCREASEINDENT,			/**< Keybinding. */
	GEANY_KEYS_SETTINGS_PREFERENCES,			/**< Keybinding. */
	GEANY_KEYS_FORMAT_SENDTOCMD3,				/**< Keybinding. */
	GEANY_KEYS_DOCUMENT_FOLDALL,				/**< Keybinding. */
	GEANY_KEYS_FORMAT_SENDTOVTE,				/**< Keybinding. */
	GEANY_KEYS_PROJECT_PROPERTIES,				/**< Keybinding. */
	GEANY_KEYS_DOCUMENT_LINEWRAP,				/**< Keybinding. */
	GEANY_KEYS_EDITOR_MACROLIST,				/**< Keybinding.
												 * @deprecated 1.25, it doesn't do anything anymore */
	GEANY_KEYS_EDITOR_SUPPRESSSNIPPETCOMPLETION, /**< Keybinding. */
	GEANY_KEYS_FOCUS_SIDEBAR_SYMBOL_LIST,		/**< Keybinding. */
	GEANY_KEYS_GOTO_LINESTART,					/**< Keybinding. */
	GEANY_KEYS_SEARCH_FINDUSAGE,				/**< Keybinding. */
	GEANY_KEYS_FILE_NEW,						/**< Keybinding. */
	GEANY_KEYS_EDITOR_SNIPPETNEXTCURSOR,		/**< Keybinding. */
	GEANY_KEYS_NOTEBOOK_SWITCHTABRIGHT,			/**< Keybinding. */
	GEANY_KEYS_FILE_SAVE,						/**< Keybinding. */
	GEANY_KEYS_FORMAT_INCREASEINDENTBYSPACE,	/**< Keybinding. */
	GEANY_KEYS_SEARCH_FINDNEXT,					/**< Keybinding. */
	GEANY_KEYS_GOTO_TOGGLEMARKER,				/**< Keybinding. */
	GEANY_KEYS_GOTO_TAGDEFINITION,				/**< Keybinding. */
	GEANY_KEYS_SEARCH_NEXTMESSAGE,				/**< Keybinding. */
	GEANY_KEYS_EDITOR_DELETELINETOEND,			/**< Keybinding. */
	GEANY_KEYS_FORMAT_AUTOINDENT,				/**< Keybinding. */
	GEANY_KEYS_FILE_OPENSELECTED,				/**< Keybinding. */
	GEANY_KEYS_GOTO_BACK,						/**< Keybinding. */
	GEANY_KEYS_INSERT_DATE,						/**< Keybinding. */
	GEANY_KEYS_BUILD_PREVIOUSERROR,				/**< Keybinding. */
	GEANY_KEYS_GOTO_LINEENDVISUAL,				/**< Keybinding. */
	GEANY_KEYS_DOCUMENT_REPLACESPACES,			/**< Keybinding. */
	GEANY_KEYS_FOCUS_EDITOR,					/**< Keybinding. */
	GEANY_KEYS_SELECT_WORDPARTRIGHT,			/**< Keybinding. */
	GEANY_KEYS_VIEW_MESSAGEWINDOW,				/**< Keybinding. */
	GEANY_KEYS_FOCUS_SIDEBAR_DOCUMENT_LIST,		/**< Keybinding. */
	GEANY_KEYS_FORMAT_REFLOWPARAGRAPH,			/**< Keybinding. */
	GEANY_KEYS_EDITOR_MOVELINEUP,				/**< Keybinding. */
	GEANY_KEYS_NOTEBOOK_MOVETABLEFT,			/**< Keybinding. */
	GEANY_KEYS_SELECT_LINE,						/**< Keybinding. */
	GEANY_KEYS_EDITOR_UNDO,						/**< Keybinding. */
	GEANY_KEYS_EDITOR_MOVELINEDOWN,				/**< Keybinding. */
	GEANY_KEYS_CLIPBOARD_COPYLINE,				/**< Keybinding. */
	GEANY_KEYS_BUILD_MAKEOWNTARGET,				/**< Keybinding. */
	GEANY_KEYS_FORMAT_SENDTOCMD2,				/**< Keybinding. */
	GEANY_KEYS_SEARCH_MARKALL,					/**< Keybinding. */
	GEANY_KEYS_BUILD_LINK,						/**< Keybinding. */
	GEANY_KEYS_FILE_CLOSEALL,					/**< Keybinding. */
	GEANY_KEYS_GOTO_FORWARD,					/**< Keybinding. */
	GEANY_KEYS_CLIPBOARD_CUT,					/**< Keybinding. */
	GEANY_KEYS_NOTEBOOK_SWITCHTABLASTUSED,		/**< Keybinding. */
	GEANY_KEYS_NOTEBOOK_MOVETABRIGHT,			/**< Keybinding. */
	GEANY_KEYS_BUILD_OPTIONS,					/**< Keybinding. */
	GEANY_KEYS_GOTO_TAGDECLARATION,				/**< Keybinding. */
	GEANY_KEYS_FILE_OPEN,						/**< Keybinding. */
	GEANY_KEYS_EDITOR_COMPLETESNIPPET,			/**< Keybinding. */
	GEANY_KEYS_FORMAT_UNCOMMENTLINE,			/**< Keybinding. */
	GEANY_KEYS_FOCUS_VTE,						/**< Keybinding. */
	GEANY_KEYS_FORMAT_SENDTOCMD1,				/**< Keybinding. */
	GEANY_KEYS_SELECT_WORDPARTLEFT,				/**< Keybinding. */
	GEANY_KEYS_VIEW_ZOOMIN,						/**< Keybinding. */
	GEANY_KEYS_DOCUMENT_LINEBREAK,				/**< Keybinding. */
	GEANY_KEYS_EDITOR_REDO,						/**< Keybinding. */
	GEANY_KEYS_EDITOR_CONTEXTACTION,			/**< Keybinding. */
	GEANY_KEYS_SEARCH_FINDPREVSEL,				/**< Keybinding. */
	GEANY_KEYS_FORMAT_DECREASEINDENTBYSPACE,	/**< Keybinding. */
	GEANY_KEYS_FORMAT_COMMENTLINETOGGLE,		/**< Keybinding. */
	GEANY_KEYS_SELECT_ALL,						/**< Keybinding. */
	GEANY_KEYS_DOCUMENT_RELOADTAGLIST,			/**< Keybinding. */
	GEANY_KEYS_BUILD_NEXTERROR,					/**< Keybinding. */
	GEANY_KEYS_NOTEBOOK_MOVETABLAST,			/**< Keybinding. */
	GEANY_KEYS_SELECT_PARAGRAPH,				/**< Keybinding. */
	GEANY_KEYS_EDITOR_DELETELINE,				/**< Keybinding. */
	GEANY_KEYS_CLIPBOARD_COPY,					/**< Keybinding. */
	GEANY_KEYS_VIEW_SIDEBAR,					/**< Keybinding. */
	GEANY_KEYS_FILE_SAVEAS,						/**< Keybinding. */
	GEANY_KEYS_FORMAT_COMMENTLINE,				/**< Keybinding. */
	GEANY_KEYS_GOTO_PREVWORDPART,				/**< Keybinding. */
	GEANY_KEYS_SEARCH_FINDPREVIOUS,				/**< Keybinding. */
	GEANY_KEYS_SEARCH_REPLACE,					/**< Keybinding. */
	GEANY_KEYS_EDITOR_WORDPARTCOMPLETION,		/**< Keybinding. */
	GEANY_KEYS_EDITOR_AUTOCOMPLETE,				/**< Keybinding. */
	GEANY_KEYS_FOCUS_SIDEBAR,					/**< Keybinding. */
	GEANY_KEYS_FOCUS_MESSAGE_WINDOW,			/**< Keybinding. */
	GEANY_KEYS_NOTEBOOK_MOVETABFIRST,			/**< Keybinding. */
	GEANY_KEYS_GOTO_PREVIOUSMARKER,				/**< Keybinding. */
	GEANY_KEYS_EDITOR_SCROLLLINEUP,				/**< Keybinding. */
	GEANY_KEYS_FOCUS_COMPILER,					/**< Keybinding. */
	GEANY_KEYS_FORMAT_TOGGLECASE,				/**< Keybinding. */
	GEANY_KEYS_CLIPBOARD_CUTLINE,				/**< Keybinding. */
	GEANY_KEYS_DOCUMENT_REMOVE_MARKERS,			/**< Keybinding. */
	GEANY_KEYS_BUILD_MAKEOBJECT,				/**< Keybinding. */
	GEANY_KEYS_FORMAT_DECREASEINDENT,			/**< Keybinding. */
	GEANY_KEYS_FILE_OPENLASTTAB,				/**< Keybinding. */
	GEANY_KEYS_SEARCH_FINDINFILES,				/**< Keybinding. */
	GEANY_KEYS_GOTO_NEXTWORDPART,				/**< Keybinding. */
	GEANY_KEYS_INSERT_LINEAFTER,				/**< Keybinding. */
	GEANY_KEYS_INSERT_LINEBEFORE,				/**< Keybinding. */
	GEANY_KEYS_DOCUMENT_REMOVE_MARKERS_INDICATORS,	/**< Keybinding. */
	GEANY_KEYS_PROJECT_OPEN,					/**< Keybinding. */
	GEANY_KEYS_PROJECT_NEW,						/**< Keybinding. */
	GEANY_KEYS_PROJECT_CLOSE,					/**< Keybinding. */
	GEANY_KEYS_FORMAT_JOINLINES,				/**< Keybinding. */
	GEANY_KEYS_GOTO_LINESTARTVISUAL,			/**< Keybinding. */
	GEANY_KEYS_DOCUMENT_CLONE,					/**< Keybinding. */
	GEANY_KEYS_FILE_QUIT,						/**< Keybinding. */
	GEANY_KEYS_FILE_PROPERTIES,					/**< Keybinding. */
	GEANY_KEYS_FORMAT_SENDTOCMD4,				/**< Keybinding. */
	GEANY_KEYS_FORMAT_SENDTOCMD5,				/**< Keybinding. */
	GEANY_KEYS_FORMAT_SENDTOCMD6,				/**< Keybinding. */
	GEANY_KEYS_FORMAT_SENDTOCMD7,				/**< Keybinding. */
	GEANY_KEYS_FORMAT_SENDTOCMD8,				/**< Keybinding. */
	GEANY_KEYS_FORMAT_SENDTOCMD9,				/**< Keybinding. */
	GEANY_KEYS_EDITOR_DELETELINETOBEGINNING,	/**< Keybinding. */
	GEANY_KEYS_COUNT	/* must not be used by plugins */
};


void keybindings_send_command(guint group_id, guint key_id);

GeanyKeyBinding *keybindings_set_item(GeanyKeyGroup *group, gsize key_id,
		GeanyKeyCallback callback, guint key, GdkModifierType mod,
		const gchar *name, const gchar *label, GtkWidget *menu_item);

GeanyKeyBinding *keybindings_set_item_full(GeanyKeyGroup *group, gsize key_id,
		guint key, GdkModifierType mod, const gchar *kf_name, const gchar *label,
		GtkWidget *menu_item, GeanyKeyBindingFunc func, gpointer pdata,
		GDestroyNotify destroy_notify);

GeanyKeyBinding *keybindings_get_item(GeanyKeyGroup *group, gsize key_id);

GdkModifierType keybindings_get_modifiers(GdkModifierType mods);

#ifdef GEANY_PRIVATE

extern GPtrArray *keybinding_groups;	/* array of GeanyKeyGroup pointers */


void keybindings_init(void);

void keybindings_load_keyfile(void);

void keybindings_free(void);

GeanyKeyGroup *keybindings_get_core_group(guint id);

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);

gchar *keybindings_get_label(GeanyKeyBinding *kb);

void keybindings_update_combo(GeanyKeyBinding *kb, guint key, GdkModifierType mods);

GeanyKeyBinding *keybindings_lookup_item(guint group_id, guint key_id);

/* just write the content of the keys array to the config file */
void keybindings_write_to_file(void);

void keybindings_show_shortcuts(void);

gboolean keybindings_check_event(GdkEventKey *ev, GeanyKeyBinding *kb);

void keybindings_dialog_show_prefs_scroll(const gchar *name);

#endif /* GEANY_PRIVATE */

G_END_DECLS

#endif /* GEANY_KEYBINDINGS_H */