[gimp] app: remove widget parameter from gimp_modifiers_to_channel_op()



commit c0610697cb87a96dcea216ba60d51a7cb68b6cdf
Author: Michael Natterer <mitch gimp org>
Date:   Thu Oct 6 10:24:49 2011 +0200

    app: remove widget parameter from gimp_modifiers_to_channel_op()
    
    and simply use the default keymap.

 app/widgets/gimpitemtreeview.c    |    4 +---
 app/widgets/gimpselectioneditor.c |    2 +-
 app/widgets/gimpwidgets-utils.c   |   16 +++-------------
 app/widgets/gimpwidgets-utils.h   |    3 +--
 4 files changed, 6 insertions(+), 19 deletions(-)
---
diff --git a/app/widgets/gimpitemtreeview.c b/app/widgets/gimpitemtreeview.c
index 692b84b..9a63710 100644
--- a/app/widgets/gimpitemtreeview.c
+++ b/app/widgets/gimpitemtreeview.c
@@ -1417,9 +1417,7 @@ gimp_item_tree_view_item_pre_clicked (GimpCellRendererViewable *cell,
       if (renderer)
         {
           GimpItem       *item = GIMP_ITEM (renderer->viewable);
-          GimpChannelOps  op;
-
-          op = gimp_modifiers_to_channel_op (GTK_WIDGET (item_view), state);
+          GimpChannelOps  op   = gimp_modifiers_to_channel_op (state);
 
           gimp_item_to_selection (item, op,
                                   TRUE, FALSE, 0.0, 0.0);
diff --git a/app/widgets/gimpselectioneditor.c b/app/widgets/gimpselectioneditor.c
index 61a90c6..ef4742f 100644
--- a/app/widgets/gimpselectioneditor.c
+++ b/app/widgets/gimpselectioneditor.c
@@ -270,7 +270,7 @@ gimp_selection_view_button_press (GtkWidget           *widget,
   if (! drawable)
     return TRUE;
 
-  operation = gimp_modifiers_to_channel_op (widget, bevent->state);
+  operation = gimp_modifiers_to_channel_op (bevent->state);
 
   x = gimp_image_get_width  (image_editor->image) * bevent->x / renderer->width;
   y = gimp_image_get_height (image_editor->image) * bevent->y / renderer->height;
diff --git a/app/widgets/gimpwidgets-utils.c b/app/widgets/gimpwidgets-utils.c
index bfba43c..4fd6b8d 100644
--- a/app/widgets/gimpwidgets-utils.c
+++ b/app/widgets/gimpwidgets-utils.c
@@ -617,20 +617,10 @@ gimp_suggest_modifiers (const gchar     *message,
 #undef BUF_SIZE
 
 GimpChannelOps
-gimp_modifiers_to_channel_op (GtkWidget       *widget,
-                              GdkModifierType  modifiers)
+gimp_modifiers_to_channel_op (GdkModifierType  modifiers)
 {
-  GdkModifierType  extend_mask;
-  GdkModifierType  modify_mask;
-
-  g_return_val_if_fail (GTK_IS_WIDGET (widget), GIMP_CHANNEL_OP_REPLACE);
-
-  extend_mask =
-    gtk_widget_get_modifier_mask (widget,
-                                  GDK_MODIFIER_INTENT_EXTEND_SELECTION);
-  modify_mask =
-    gtk_widget_get_modifier_mask (widget,
-                                  GDK_MODIFIER_INTENT_MODIFY_SELECTION);
+  GdkModifierType extend_mask = gimp_get_extend_selection_mask ();
+  GdkModifierType modify_mask = gimp_get_modify_selection_mask ();
 
   if (modifiers & extend_mask)
     {
diff --git a/app/widgets/gimpwidgets-utils.h b/app/widgets/gimpwidgets-utils.h
index fb81c27..894860f 100644
--- a/app/widgets/gimpwidgets-utils.h
+++ b/app/widgets/gimpwidgets-utils.h
@@ -58,8 +58,7 @@ gchar           * gimp_suggest_modifiers           (const gchar          *messag
                                                     const gchar          *shift_format,
                                                     const gchar          *control_format,
                                                     const gchar          *alt_format);
-GimpChannelOps    gimp_modifiers_to_channel_op     (GtkWidget            *widget,
-                                                    GdkModifierType       modifiers);
+GimpChannelOps    gimp_modifiers_to_channel_op     (GdkModifierType       modifiers);
 GdkModifierType   gimp_replace_virtual_modifiers   (GdkModifierType       modifiers);
 GdkModifierType   gimp_get_extend_selection_mask   (void);
 GdkModifierType   gimp_get_modify_selection_mask   (void);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]