gimp r25473 - in trunk: . app/tools app/widgets cursors cursors/xbm



Author: martinn
Date: Sat Apr 12 12:40:52 2008
New Revision: 25473
URL: http://svn.gnome.org/viewvc/gimp?rev=25473&view=rev

Log:
2008-04-12  Martin Nordholts  <martinn svn gnome org>

	Applied modified patch from Daniel Hornung that changes the mouse
	cursor to a "clicking will create a selection"-icon when hovering
	the center of a pending Scissors Select Tool selection (bug #493370)

	* app/tools/gimpiscissorstool.c
	(gimp_iscissors_tool_cursor_update): Use the new cursor icon.

	* cursors/modifier-select.png
	* cursors/xbm/modifier-select.xbm
	* cursors/xbm/modifier-select-mask.xbm: New cursor icon.

	* cursors/makefile.msc
	* cursors/Makefile.am 
	* app/widgets/gimpcursor.c
	* app/widgets/widgets-enums.h: Changed accordingly.


Added:
   trunk/cursors/modifier-select.png   (contents, props changed)
   trunk/cursors/xbm/modifier-select-mask.xbm   (contents, props changed)
   trunk/cursors/xbm/modifier-select.xbm   (contents, props changed)
Modified:
   trunk/ChangeLog
   trunk/app/tools/gimpiscissorstool.c
   trunk/app/widgets/gimpcursor.c
   trunk/app/widgets/widgets-enums.h
   trunk/cursors/Makefile.am
   trunk/cursors/makefile.msc

Modified: trunk/app/tools/gimpiscissorstool.c
==============================================================================
--- trunk/app/tools/gimpiscissorstool.c	(original)
+++ trunk/app/tools/gimpiscissorstool.c	Sat Apr 12 12:40:52 2008
@@ -1018,9 +1018,18 @@
   switch (iscissors->op)
     {
     case ISCISSORS_OP_SELECT:
-      GIMP_TOOL_CLASS (parent_class)->cursor_update (tool, coords,
-                                                     state, display);
-      return;
+      {
+        GimpSelectionOptions *options;
+
+        options = GIMP_SELECTION_TOOL_GET_OPTIONS (tool);
+
+        /* Do not overwrite the modifiers for add, subtract, intersect */
+        if(options->operation == GIMP_CHANNEL_OP_REPLACE)
+          {
+            modifier = GIMP_CURSOR_MODIFIER_SELECT;
+          }
+      }
+      break;
 
     case ISCISSORS_OP_MOVE_POINT:
       modifier = GIMP_CURSOR_MODIFIER_MOVE;
@@ -1042,10 +1051,19 @@
       break;
     }
 
-  gimp_tool_set_cursor (tool, display,
-                        GIMP_CURSOR_MOUSE,
-                        GIMP_TOOL_CURSOR_ISCISSORS,
-                        modifier);
+
+  if (modifier != GIMP_CURSOR_MODIFIER_NONE)
+    {
+      gimp_tool_set_cursor (tool, display,
+                            GIMP_CURSOR_MOUSE,
+                            GIMP_TOOL_CURSOR_ISCISSORS,
+                            modifier);
+    }
+  else
+    {
+      GIMP_TOOL_CLASS (parent_class)->cursor_update (tool, coords,
+                                                     state, display);
+    }
 }
 
 static gboolean

Modified: trunk/app/widgets/gimpcursor.c
==============================================================================
--- trunk/app/widgets/gimpcursor.c	(original)
+++ trunk/app/widgets/gimpcursor.c	Sat Apr 12 12:40:52 2008
@@ -158,6 +158,8 @@
 #include "cursors/xbm/modifier-pattern-mask.xbm"
 #include "cursors/xbm/modifier-join.xbm"
 #include "cursors/xbm/modifier-join-mask.xbm"
+#include "cursors/xbm/modifier-select.xbm"
+#include "cursors/xbm/modifier-select-mask.xbm"
 
 
 typedef struct _GimpCursor GimpCursor;
@@ -587,6 +589,12 @@
     modifier_join_width, modifier_join_height,
     0, 0,
     modifier_join, NULL, NULL, NULL
+  },
+  {
+    modifier_select_bits, modifier_select_mask_bits,
+    modifier_select_width, modifier_select_height,
+    0, 0,
+    modifier_select, NULL, NULL, NULL
   }
 };
 

Modified: trunk/app/widgets/widgets-enums.h
==============================================================================
--- trunk/app/widgets/widgets-enums.h	(original)
+++ trunk/app/widgets/widgets-enums.h	Sat Apr 12 12:40:52 2008
@@ -280,6 +280,7 @@
   GIMP_CURSOR_MODIFIER_BACKGROUND,
   GIMP_CURSOR_MODIFIER_PATTERN,
   GIMP_CURSOR_MODIFIER_JOIN,
+  GIMP_CURSOR_MODIFIER_SELECT,
   GIMP_CURSOR_MODIFIER_LAST
 } GimpCursorModifier;
 

Modified: trunk/cursors/Makefile.am
==============================================================================
--- trunk/cursors/Makefile.am	(original)
+++ trunk/cursors/Makefile.am	Sat Apr 12 12:40:52 2008
@@ -30,6 +30,7 @@
 	modifier-pattern.png		\
 	modifier-plus.png		\
 	modifier-resize.png		\
+	modifier-select.png		\
 	\
 	tool-airbrush.png		\
 	tool-blend.png			\

Modified: trunk/cursors/makefile.msc
==============================================================================
--- trunk/cursors/makefile.msc	(original)
+++ trunk/cursors/makefile.msc	Sat Apr 12 12:40:52 2008
@@ -30,6 +30,7 @@
 	modifier_pattern		modifier-pattern.png \
 	modifier_plus		modifier-plus.png \
 	modifier_resize		modifier-resize.png \
+	modifier_select		modifier-select.png \
 	\
 	tool_airbrush		tool-airbrush.png \
 	tool_blend		tool-blend.png \

Added: trunk/cursors/modifier-select.png
==============================================================================
Binary file. No diff available.

Added: trunk/cursors/xbm/modifier-select-mask.xbm
==============================================================================
--- (empty file)
+++ trunk/cursors/xbm/modifier-select-mask.xbm	Sat Apr 12 12:40:52 2008
@@ -0,0 +1,14 @@
+#define modifier_select_mask_width 32
+#define modifier_select_mask_height 32
+static unsigned char modifier_select_mask_bits[] = {
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x18, 0x00, 0x00, 0xe0, 0x3d,
+   0x00, 0x00, 0xc0, 0x18, 0x00, 0x00, 0x10, 0x40, 0x00, 0x00, 0x38, 0xe0,
+   0x00, 0x00, 0x38, 0xe0, 0x00, 0x00, 0x38, 0xe0, 0x00, 0x00, 0x10, 0x40,
+   0x00, 0x00, 0xc0, 0x18, 0x00, 0x00, 0xe0, 0x3d, 0x00, 0x00, 0xc0, 0x18,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };

Added: trunk/cursors/xbm/modifier-select.xbm
==============================================================================
--- (empty file)
+++ trunk/cursors/xbm/modifier-select.xbm	Sat Apr 12 12:40:52 2008
@@ -0,0 +1,14 @@
+#define modifier_select_width 32
+#define modifier_select_height 32
+static unsigned char modifier_select_bits[] = {
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x18,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x40,
+   0x00, 0x00, 0x10, 0x40, 0x00, 0x00, 0x10, 0x40, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x18, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };



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