Kaydet (Commit) 2c19fe8e authored tarafından Nick Treleaven's avatar Nick Treleaven

Break down Edit, Editing, Tags, Other keybinding groups into Editor,

Clipboard, Select, Format, Insert groups and rename GEANY_KEYS_*
accordingly.
Group most keybinding callbacks together according to keybinding
group.
Add underscore for GEANY_KEYGROUP_*.
Set main menu widget with keybindings_set_item() - this is still
ignored for now. Popup menu accels are set separately.


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/branches/plugin-keybindings@2323 ea778897-0a13-0410-b9d1-a72fbfd435f5
üst 83f7b577
2008-03-12 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
* src/build.c, src/keybindings.c, src/keybindings.h, src/tools.c,
src/callbacks.c, plugins/filebrowser.c:
Break down Edit, Editing, Tags, Other keybinding groups into Editor,
Clipboard, Select, Format, Insert groups and rename GEANY_KEYS_*
accordingly.
Group most keybinding callbacks together according to keybinding
group.
Add underscore for GEANY_KEYGROUP_*.
Set main menu widget with keybindings_set_item() - this is still
ignored for now. Popup menu accels are set separately.
2008-03-10 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
* src/keybindings.c, src/keybindings.h, src/plugindata.h,
......
......@@ -497,7 +497,7 @@ static void on_hidden_files_clicked(GtkCheckMenuItem *item)
static void on_hide_sidebar(void)
{
p_keybindings->send_command(GEANY_KEYGROUP_VIEW, GEANY_KEYS_MENU_SIDEBAR);
p_keybindings->send_command(GEANY_KEY_GROUP_VIEW, GEANY_KEYS_VIEW_SIDEBAR);
}
......
......@@ -1109,7 +1109,7 @@ static void create_build_menu_gen(BuildMenuItems *menu_items)
GtkWidget *menu, *item = NULL, *image, *separator;
GtkAccelGroup *accel_group = gtk_accel_group_new();
GtkTooltips *tooltips = GTK_TOOLTIPS(lookup_widget(app->window, "tooltips"));
KeyBindingGroup *group = g_ptr_array_index(keybinding_groups, GEANY_KEYGROUP_BUILD);
KeyBindingGroup *group = g_ptr_array_index(keybinding_groups, GEANY_KEY_GROUP_BUILD);
menu = gtk_menu_new();
......@@ -1226,7 +1226,7 @@ static void create_build_menu_tex(BuildMenuItems *menu_items)
GtkWidget *menu, *item, *image, *separator;
GtkAccelGroup *accel_group = gtk_accel_group_new();
GtkTooltips *tooltips = GTK_TOOLTIPS(lookup_widget(app->window, "tooltips"));
KeyBindingGroup *group = g_ptr_array_index(keybinding_groups, GEANY_KEYGROUP_BUILD);
KeyBindingGroup *group = g_ptr_array_index(keybinding_groups, GEANY_KEY_GROUP_BUILD);
menu = gtk_menu_new();
......
......@@ -654,7 +654,7 @@ on_entry1_key_press_event (GtkWidget *widget,
{
if (event->keyval == GDK_Escape)
{
keybindings_send_command(GEANY_KEYGROUP_FOCUS, GEANY_KEYS_SWITCH_EDITOR);
keybindings_send_command(GEANY_KEY_GROUP_FOCUS, GEANY_KEYS_FOCUS_EDITOR);
return TRUE;
}
return FALSE;
......@@ -925,7 +925,7 @@ void on_toggle_case1_activate(GtkMenuItem *menuitem, gpointer user_data)
if (! sci_can_copy(sci))
{
keybindings_send_command(GEANY_KEYGROUP_EDITING, GEANY_KEYS_EDIT_SELECTWORD);
keybindings_send_command(GEANY_KEY_GROUP_SELECT, GEANY_KEYS_SELECT_WORD);
keep_sel = FALSE;
}
......@@ -1114,7 +1114,7 @@ void
on_compile_button_clicked (GtkToolButton *toolbutton,
gpointer user_data)
{
keybindings_send_command(GEANY_KEYGROUP_BUILD, GEANY_KEYS_BUILD_COMPILE);
keybindings_send_command(GEANY_KEY_GROUP_BUILD, GEANY_KEYS_BUILD_COMPILE);
}
......@@ -1562,7 +1562,7 @@ void
on_run_button_clicked (GtkToolButton *toolbutton,
gpointer user_data)
{
keybindings_send_command(GEANY_KEYGROUP_BUILD, GEANY_KEYS_BUILD_RUN);
keybindings_send_command(GEANY_KEY_GROUP_BUILD, GEANY_KEYS_BUILD_RUN);
}
......@@ -1718,7 +1718,7 @@ void
on_menu_duplicate_line1_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
keybindings_send_command(GEANY_KEYGROUP_EDITING, GEANY_KEYS_EDIT_DUPLICATELINE);
keybindings_send_command(GEANY_KEY_GROUP_EDITOR, GEANY_KEYS_EDITOR_DUPLICATELINE);
}
......
This diff is collapsed.
......@@ -69,197 +69,226 @@ extern GPtrArray *keybinding_groups; /* array of KeyBindingGroup pointers */
/** Keybinding group IDs */
enum
{
GEANY_KEYGROUP_FILE,
GEANY_KEYGROUP_EDIT,
GEANY_KEYGROUP_SEARCH,
GEANY_KEYGROUP_VIEW,
GEANY_KEYGROUP_DOCUMENT,
GEANY_KEYGROUP_BUILD,
GEANY_KEYGROUP_TOOLS,
GEANY_KEYGROUP_HELP,
GEANY_KEYGROUP_FOCUS,
GEANY_KEYGROUP_NOTEBOOK,
GEANY_KEYGROUP_EDITING,
GEANY_KEYGROUP_TAGS,
GEANY_KEYGROUP_OTHER,
GEANY_KEYGROUP_COUNT
GEANY_KEY_GROUP_FILE,
GEANY_KEY_GROUP_PROJECT,
GEANY_KEY_GROUP_EDITOR,
GEANY_KEY_GROUP_CLIPBOARD,
GEANY_KEY_GROUP_SELECT,
GEANY_KEY_GROUP_FORMAT,
GEANY_KEY_GROUP_INSERT,
GEANY_KEY_GROUP_SETTINGS,
GEANY_KEY_GROUP_SEARCH,
GEANY_KEY_GROUP_GOTO,
GEANY_KEY_GROUP_VIEW,
GEANY_KEY_GROUP_FOCUS,
GEANY_KEY_GROUP_NOTEBOOK,
GEANY_KEY_GROUP_DOCUMENT,
GEANY_KEY_GROUP_BUILD,
GEANY_KEY_GROUP_TOOLS,
GEANY_KEY_GROUP_HELP,
GEANY_KEY_GROUP_COUNT
};
/** File group keybinding command IDs */
enum
{
GEANY_KEYS_MENU_NEW,
GEANY_KEYS_MENU_OPEN,
GEANY_KEYS_MENU_OPENSELECTED,
GEANY_KEYS_MENU_SAVE,
GEANY_KEYS_MENU_SAVEAS,
GEANY_KEYS_MENU_SAVEALL,
GEANY_KEYS_MENU_PRINT,
GEANY_KEYS_MENU_CLOSE,
GEANY_KEYS_MENU_CLOSEALL,
GEANY_KEYS_MENU_RELOADFILE,
GEANY_KEYS_MENU_PROJECTPROPERTIES,
GEANY_KEYS_FILE_NEW,
GEANY_KEYS_FILE_OPEN,
GEANY_KEYS_FILE_OPENSELECTED,
GEANY_KEYS_FILE_SAVE,
GEANY_KEYS_FILE_SAVEAS,
GEANY_KEYS_FILE_SAVEALL,
GEANY_KEYS_FILE_PRINT,
GEANY_KEYS_FILE_CLOSE,
GEANY_KEYS_FILE_CLOSEALL,
GEANY_KEYS_FILE_RELOAD,
GEANY_KEYS_FILE_COUNT
};
/** Edit group keybinding command IDs */
/** Project group keybinding command IDs */
enum
{
GEANY_KEYS_MENU_UNDO,
GEANY_KEYS_MENU_REDO,
GEANY_KEYS_MENU_CUT,
GEANY_KEYS_MENU_COPY,
GEANY_KEYS_MENU_PASTE,
GEANY_KEYS_MENU_SELECTALL,
GEANY_KEYS_MENU_INSERTDATE,
GEANY_KEYS_MENU_PREFERENCES,
GEANY_KEYS_EDIT_COUNT
GEANY_KEYS_PROJECT_PROPERTIES,
GEANY_KEYS_PROJECT_COUNT
};
/** Search group keybinding command IDs */
/** Editor group keybinding command IDs */
enum
{
GEANY_KEYS_MENU_FIND,
GEANY_KEYS_MENU_FINDNEXT,
GEANY_KEYS_MENU_FINDPREVIOUS,
GEANY_KEYS_MENU_FINDINFILES,
GEANY_KEYS_MENU_REPLACE,
GEANY_KEYS_MENU_FINDNEXTSEL,
GEANY_KEYS_MENU_FINDPREVSEL,
GEANY_KEYS_MENU_NEXTMESSAGE,
GEANY_KEYS_MENU_GOTOLINE,
GEANY_KEYS_SEARCH_COUNT
GEANY_KEYS_EDITOR_UNDO,
GEANY_KEYS_EDITOR_REDO,
GEANY_KEYS_EDITOR_DELETELINE,
GEANY_KEYS_EDITOR_DUPLICATELINE,
GEANY_KEYS_EDITOR_TRANSPOSELINE,
GEANY_KEYS_EDITOR_SCROLLTOLINE,
GEANY_KEYS_EDITOR_SCROLLLINEUP,
GEANY_KEYS_EDITOR_SCROLLLINEDOWN,
GEANY_KEYS_EDITOR_COMPLETESNIPPET,
GEANY_KEYS_EDITOR_SUPPRESSSNIPPETCOMPLETION,
GEANY_KEYS_EDITOR_CONTEXTACTION,
GEANY_KEYS_EDITOR_AUTOCOMPLETE,
GEANY_KEYS_EDITOR_CALLTIP,
GEANY_KEYS_EDITOR_MACROLIST,
GEANY_KEYS_EDITOR_COUNT
};
/** View group keybinding command IDs */
/** Clipboard group keybinding command IDs */
enum
{
GEANY_KEYS_MENU_TOGGLEALL,
GEANY_KEYS_MENU_FULLSCREEN,
GEANY_KEYS_MENU_MESSAGEWINDOW,
GEANY_KEYS_MENU_SIDEBAR,
GEANY_KEYS_MENU_ZOOMIN,
GEANY_KEYS_MENU_ZOOMOUT,
GEANY_KEYS_VIEW_COUNT
GEANY_KEYS_CLIPBOARD_CUT,
GEANY_KEYS_CLIPBOARD_COPY,
GEANY_KEYS_CLIPBOARD_PASTE,
GEANY_KEYS_CLIPBOARD_CUTLINE,
GEANY_KEYS_CLIPBOARD_COPYLINE,
GEANY_KEYS_CLIPBOARD_COUNT
};
/** Document group keybinding command IDs */
/** Select group keybinding command IDs */
enum
{
GEANY_KEYS_MENU_REPLACETABS,
GEANY_KEYS_MENU_FOLDALL,
GEANY_KEYS_MENU_UNFOLDALL,
GEANY_KEYS_RELOADTAGLIST,
GEANY_KEYS_DOCUMENT_COUNT
GEANY_KEYS_SELECT_ALL,
GEANY_KEYS_SELECT_WORD,
GEANY_KEYS_SELECT_LINE,
GEANY_KEYS_SELECT_PARAGRAPH,
GEANY_KEYS_SELECT_COUNT
};
/** Build group keybinding command IDs */
/** Format group keybinding command IDs */
enum
{
GEANY_KEYS_BUILD_COMPILE,
GEANY_KEYS_BUILD_LINK,
GEANY_KEYS_BUILD_MAKE,
GEANY_KEYS_BUILD_MAKEOWNTARGET,
GEANY_KEYS_BUILD_MAKEOBJECT,
GEANY_KEYS_BUILD_NEXTERROR,
GEANY_KEYS_BUILD_RUN,
GEANY_KEYS_BUILD_RUN2,
GEANY_KEYS_BUILD_OPTIONS,
GEANY_KEYS_BUILD_COUNT
GEANY_KEYS_FORMAT_TOGGLECASE,
GEANY_KEYS_FORMAT_COMMENTLINETOGGLE,
GEANY_KEYS_FORMAT_COMMENTLINE,
GEANY_KEYS_FORMAT_UNCOMMENTLINE,
GEANY_KEYS_FORMAT_INCREASEINDENT,
GEANY_KEYS_FORMAT_DECREASEINDENT,
GEANY_KEYS_FORMAT_INCREASEINDENTBYSPACE,
GEANY_KEYS_FORMAT_DECREASEINDENTBYSPACE,
GEANY_KEYS_FORMAT_AUTOINDENT,
GEANY_KEYS_FORMAT_SENDTOCMD1,
GEANY_KEYS_FORMAT_SENDTOCMD2,
GEANY_KEYS_FORMAT_SENDTOCMD3,
GEANY_KEYS_FORMAT_COUNT
};
/** Tools group keybinding command IDs */
/** Insert group keybinding command IDs */
enum
{
GEANY_KEYS_MENU_OPENCOLORCHOOSER,
GEANY_KEYS_TOOLS_COUNT
GEANY_KEYS_INSERT_DATE,
GEANY_KEYS_INSERT_ALTWHITESPACE,
GEANY_KEYS_INSERT_COUNT
};
/** Help group keybinding command IDs */
/** Settings group keybinding command IDs */
enum
{
GEANY_KEYS_MENU_HELP,
GEANY_KEYS_HELP_COUNT
GEANY_KEYS_SETTINGS_PREFERENCES,
GEANY_KEYS_SETTINGS_COUNT
};
/** Search group keybinding command IDs */
enum
{
GEANY_KEYS_SEARCH_FIND,
GEANY_KEYS_SEARCH_FINDNEXT,
GEANY_KEYS_SEARCH_FINDPREVIOUS,
GEANY_KEYS_SEARCH_FINDINFILES,
GEANY_KEYS_SEARCH_REPLACE,
GEANY_KEYS_SEARCH_FINDNEXTSEL,
GEANY_KEYS_SEARCH_FINDPREVSEL,
GEANY_KEYS_SEARCH_NEXTMESSAGE,
GEANY_KEYS_SEARCH_FINDUSAGE,
GEANY_KEYS_SEARCH_COUNT
};
/** Go To group keybinding command IDs */
enum
{
GEANY_KEYS_GOTO_FORWARD,
GEANY_KEYS_GOTO_BACK,
GEANY_KEYS_GOTO_LINE,
GEANY_KEYS_GOTO_MATCHINGBRACE,
GEANY_KEYS_GOTO_TOGGLEMARKER,
GEANY_KEYS_GOTO_NEXTMARKER,
GEANY_KEYS_GOTO_PREVIOUSMARKER,
GEANY_KEYS_GOTO_TAGDEFINITION,
GEANY_KEYS_GOTO_TAGDECLARATION,
GEANY_KEYS_GOTO_COUNT
};
/** View group keybinding command IDs */
enum
{
GEANY_KEYS_VIEW_TOGGLEALL,
GEANY_KEYS_VIEW_FULLSCREEN,
GEANY_KEYS_VIEW_MESSAGEWINDOW,
GEANY_KEYS_VIEW_SIDEBAR,
GEANY_KEYS_VIEW_ZOOMIN,
GEANY_KEYS_VIEW_ZOOMOUT,
GEANY_KEYS_VIEW_COUNT
};
/** Focus group keybinding command IDs */
enum
{
GEANY_KEYS_SWITCH_EDITOR,
GEANY_KEYS_SWITCH_SCRIBBLE,
GEANY_KEYS_SWITCH_VTE,
GEANY_KEYS_SWITCH_SEARCH_BAR,
GEANY_KEYS_FOCUS_EDITOR,
GEANY_KEYS_FOCUS_SCRIBBLE,
GEANY_KEYS_FOCUS_VTE,
GEANY_KEYS_FOCUS_SEARCHBAR,
GEANY_KEYS_FOCUS_COUNT
};
/** Notebook tab group keybinding command IDs */
/** Notebook Tab group keybinding command IDs */
enum
{
GEANY_KEYS_SWITCH_TABLEFT,
GEANY_KEYS_SWITCH_TABRIGHT,
GEANY_KEYS_SWITCH_TABLASTUSED,
GEANY_KEYS_MOVE_TABLEFT,
GEANY_KEYS_MOVE_TABRIGHT,
GEANY_KEYS_MOVE_TABFIRST,
GEANY_KEYS_MOVE_TABLAST,
GEANY_KEYS_NOTEBOOK_SWITCHTABLEFT,
GEANY_KEYS_NOTEBOOK_SWITCHTABRIGHT,
GEANY_KEYS_NOTEBOOK_SWITCHTABLASTUSED,
GEANY_KEYS_NOTEBOOK_MOVETABLEFT,
GEANY_KEYS_NOTEBOOK_MOVETABRIGHT,
GEANY_KEYS_NOTEBOOK_MOVETABFIRST,
GEANY_KEYS_NOTEBOOK_MOVETABLAST,
GEANY_KEYS_NOTEBOOK_COUNT
};
/** Editing group keybinding command IDs */
/** Document group keybinding command IDs */
enum
{
GEANY_KEYS_EDIT_TOGGLECASE,
GEANY_KEYS_EDIT_DUPLICATELINE,
GEANY_KEYS_EDIT_DELETELINE,
GEANY_KEYS_EDIT_COPYLINE,
GEANY_KEYS_EDIT_CUTLINE,
GEANY_KEYS_EDIT_TRANSPOSELINE,
GEANY_KEYS_EDIT_COMMENTLINETOGGLE,
GEANY_KEYS_EDIT_COMMENTLINE,
GEANY_KEYS_EDIT_UNCOMMENTLINE,
GEANY_KEYS_EDIT_INCREASEINDENT,
GEANY_KEYS_EDIT_DECREASEINDENT,
GEANY_KEYS_EDIT_INCREASEINDENTBYSPACE,
GEANY_KEYS_EDIT_DECREASEINDENTBYSPACE,
GEANY_KEYS_EDIT_AUTOINDENT,
GEANY_KEYS_EDIT_SENDTOCMD1,
GEANY_KEYS_EDIT_SENDTOCMD2,
GEANY_KEYS_EDIT_SENDTOCMD3,
GEANY_KEYS_EDIT_GOTOMATCHINGBRACE,
GEANY_KEYS_EDIT_TOGGLEMARKER,
GEANY_KEYS_EDIT_GOTONEXTMARKER,
GEANY_KEYS_EDIT_GOTOPREVIOUSMARKER,
GEANY_KEYS_EDIT_SELECTWORD,
GEANY_KEYS_EDIT_SELECTLINE,
GEANY_KEYS_EDIT_SELECTPARAGRAPH,
GEANY_KEYS_EDIT_SCROLLTOLINE,
GEANY_KEYS_EDIT_SCROLLLINEUP,
GEANY_KEYS_EDIT_SCROLLLINEDOWN,
GEANY_KEYS_EDIT_INSERTALTWHITESPACE,
GEANY_KEYS_EDIT_COMPLETESNIPPET,
GEANY_KEYS_EDIT_SUPPRESSSNIPPETCOMPLETION,
GEANY_KEYS_POPUP_FINDUSAGE,
GEANY_KEYS_POPUP_CONTEXTACTION,
GEANY_KEYS_EDITING_COUNT
GEANY_KEYS_DOCUMENT_REPLACETABS,
GEANY_KEYS_DOCUMENT_FOLDALL,
GEANY_KEYS_DOCUMENT_UNFOLDALL,
GEANY_KEYS_DOCUMENT_RELOADTAGLIST,
GEANY_KEYS_DOCUMENT_COUNT
};
/** Tags group keybinding command IDs */
/** Build group keybinding command IDs */
enum
{
GEANY_KEYS_EDIT_AUTOCOMPLETE,
GEANY_KEYS_EDIT_CALLTIP,
GEANY_KEYS_EDIT_MACROLIST,
GEANY_KEYS_POPUP_GOTOTAGDEFINITION,
GEANY_KEYS_POPUP_GOTOTAGDECLARATION,
GEANY_KEYS_TAGS_COUNT
GEANY_KEYS_BUILD_COMPILE,
GEANY_KEYS_BUILD_LINK,
GEANY_KEYS_BUILD_MAKE,
GEANY_KEYS_BUILD_MAKEOWNTARGET,
GEANY_KEYS_BUILD_MAKEOBJECT,
GEANY_KEYS_BUILD_NEXTERROR,
GEANY_KEYS_BUILD_RUN,
GEANY_KEYS_BUILD_RUN2,
GEANY_KEYS_BUILD_OPTIONS,
GEANY_KEYS_BUILD_COUNT
};
/** Tools group keybinding command IDs */
enum
{
GEANY_KEYS_TOOLS_OPENCOLORCHOOSER,
GEANY_KEYS_TOOLS_COUNT
};
/** Other group keybinding command IDs */
/** Help group keybinding command IDs */
enum
{
GEANY_KEYS_NAV_FORWARD,
GEANY_KEYS_NAV_BACK,
GEANY_KEYS_OTHER_COUNT
GEANY_KEYS_HELP_HELP,
GEANY_KEYS_HELP_COUNT
};
......
......@@ -365,13 +365,13 @@ static void cc_insert_custom_command_items(GtkMenu *me, GtkMenu *mp, gchar *labe
switch (idx)
{
case 0: key_idx = GEANY_KEYS_EDIT_SENDTOCMD1; break;
case 1: key_idx = GEANY_KEYS_EDIT_SENDTOCMD2; break;
case 2: key_idx = GEANY_KEYS_EDIT_SENDTOCMD3; break;
case 0: key_idx = GEANY_KEYS_FORMAT_SENDTOCMD1; break;
case 1: key_idx = GEANY_KEYS_FORMAT_SENDTOCMD2; break;
case 2: key_idx = GEANY_KEYS_FORMAT_SENDTOCMD3; break;
}
if (key_idx != -1)
kb = keybindings_lookup_item(GEANY_KEYGROUP_EDITING, key_idx);
kb = keybindings_lookup_item(GEANY_KEY_GROUP_FORMAT, key_idx);
item = gtk_menu_item_new_with_label(label);
if (key_idx != -1)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment