Branch: refs/heads/master Author: Jiří Techet techet@gmail.com Committer: Jiří Techet techet@gmail.com Date: Tue, 20 Jan 2015 18:33:06 UTC Commit: daecf69c9cd29891c661d3c52dd0fa7ba451d972 https://github.com/geany/geany/commit/daecf69c9cd29891c661d3c52dd0fa7ba451d9...
Log Message: ----------- Make keybindings_get_modifiers() part of plugin API
Modified Paths: -------------- plugins/geanyfunctions.h src/keybindings.c src/keybindings.h src/plugindata.h src/plugins.c
Modified: plugins/geanyfunctions.h 2 lines changed, 2 insertions(+), 0 deletions(-) =================================================================== @@ -342,6 +342,8 @@ geany_functions->p_keybindings->keybindings_set_item #define keybindings_get_item \ geany_functions->p_keybindings->keybindings_get_item +#define keybindings_get_modifiers \ + geany_functions->p_keybindings->keybindings_get_modifiers #define tm_get_real_path \ geany_functions->p_tm->tm_get_real_path #define tm_source_file_new \
Modified: src/keybindings.c 9 lines changed, 9 insertions(+), 0 deletions(-) =================================================================== @@ -110,6 +110,15 @@ static void cb_func_move_tab(guint key_id); static void add_popup_menu_accels(void);
+/** Gets significant modifiers from a GdkModifierType mask. The set of + * significant modifiers corresponds to the default modifier mask as returned + * by @c gtk_accelerator_get_default_mod_mask(). In addition, it improves + * the Command key handling on OS X by adding @c GEANY_PRIMARY_MOD_MASK + * when needed. For this reason it is preferred to use this function + * instead of @c gtk_accelerator_set_default_mod_mask(). + * @param mods GdkModifierType mask. + * @return Significant modifiers from the mask. + * @since 1.25. */ GdkModifierType keybindings_get_modifiers(GdkModifierType mods) { #ifdef __APPLE__
Modified: src/keybindings.h 5 lines changed, 5 insertions(+), 0 deletions(-) =================================================================== @@ -26,6 +26,11 @@
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
Modified: src/plugindata.h 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -565,7 +565,7 @@ typedef struct KeybindingFuncs _GeanyKeyCallback callback, guint key, GdkModifierType mod, const gchar *name, const gchar *label, GtkWidget *menu_item); struct GeanyKeyBinding* (*keybindings_get_item)(struct GeanyKeyGroup *group, gsize key_id); - + GdkModifierType (*keybindings_get_modifiers)(GdkModifierType mods); } KeybindingFuncs;
Modified: src/plugins.c 3 lines changed, 2 insertions(+), 1 deletions(-) =================================================================== @@ -284,7 +284,8 @@ static EncodingFuncs encoding_funcs = { static KeybindingFuncs keybindings_funcs = { &keybindings_send_command, &keybindings_set_item, - &keybindings_get_item + &keybindings_get_item, + &keybindings_get_modifiers };
static TagManagerFuncs tagmanager_funcs = {
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).