[gimp/metadata-browser] app: add utility functions which return modifier masks
- From: Roman Joost <romanofski src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/metadata-browser] app: add utility functions which return modifier masks
- Date: Fri, 2 Dec 2011 02:11:01 +0000 (UTC)
commit acb336f6c5586635fe8c8bbe8ea08738f0c12ad6
Author: Michael Natterer <mitch gimp org>
Date: Thu Oct 6 10:20:23 2011 +0200
app: add utility functions which return modifier masks
Simply get the masks from the default display's keymap, since
the widget makes absolutely no difference here.
app/widgets/gimpwidgets-utils.c | 28 ++++++++++++++++++++++++++++
app/widgets/gimpwidgets-utils.h | 3 +++
2 files changed, 31 insertions(+), 0 deletions(-)
---
diff --git a/app/widgets/gimpwidgets-utils.c b/app/widgets/gimpwidgets-utils.c
index 4cf9b34..bfba43c 100644
--- a/app/widgets/gimpwidgets-utils.c
+++ b/app/widgets/gimpwidgets-utils.c
@@ -679,6 +679,34 @@ gimp_replace_virtual_modifiers (GdkModifierType modifiers)
return result;
}
+GdkModifierType
+gimp_get_extend_selection_mask (void)
+{
+ GdkDisplay *display = gdk_display_get_default ();
+
+ return gdk_keymap_get_modifier_mask (gdk_keymap_get_for_display (display),
+ GDK_MODIFIER_INTENT_EXTEND_SELECTION);
+}
+
+GdkModifierType
+gimp_get_modify_selection_mask (void)
+{
+ GdkDisplay *display = gdk_display_get_default ();
+
+ return gdk_keymap_get_modifier_mask (gdk_keymap_get_for_display (display),
+ GDK_MODIFIER_INTENT_MODIFY_SELECTION);
+}
+
+GdkModifierType
+gimp_get_toggle_behavior_mask (void)
+{
+ GdkDisplay *display = gdk_display_get_default ();
+
+ /* use the modify selection modifier */
+ return gdk_keymap_get_modifier_mask (gdk_keymap_get_for_display (display),
+ GDK_MODIFIER_INTENT_MODIFY_SELECTION);
+}
+
/**
* gimp_get_screen_resolution:
* @screen: a #GdkScreen or %NULL
diff --git a/app/widgets/gimpwidgets-utils.h b/app/widgets/gimpwidgets-utils.h
index 7a64523..fb81c27 100644
--- a/app/widgets/gimpwidgets-utils.h
+++ b/app/widgets/gimpwidgets-utils.h
@@ -61,6 +61,9 @@ gchar * gimp_suggest_modifiers (const gchar *messag
GimpChannelOps gimp_modifiers_to_channel_op (GtkWidget *widget,
GdkModifierType modifiers);
GdkModifierType gimp_replace_virtual_modifiers (GdkModifierType modifiers);
+GdkModifierType gimp_get_extend_selection_mask (void);
+GdkModifierType gimp_get_modify_selection_mask (void);
+GdkModifierType gimp_get_toggle_behavior_mask (void);
void gimp_get_screen_resolution (GdkScreen *screen,
gdouble *xres,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]