Index: gimp/app/actions/view-actions.c
===================================================================
RCS file: /cvs/gnome/gimp/app/actions/view-actions.c,v
retrieving revision 1.21
diff -u -p -r1.21 view-actions.c
--- gimp/app/actions/view-actions.c	11 Feb 2005 01:26:14 -0000	1.21
+++ gimp/app/actions/view-actions.c	3 Mar 2005 22:36:24 -0000
@@ -138,6 +138,12 @@ static GimpToggleActionEntry view_toggle
     TRUE,
     GIMP_HELP_VIEW_SHOW_GUIDES },
 
+  { "view-show-sample-points", NULL,
+    N_("Show Sample Points"), NULL, NULL,
+    G_CALLBACK (view_toggle_sample_points_cmd_callback),
+    TRUE,
+    GIMP_HELP_VIEW_SHOW_SAMPLE_POINTS },
+
   { "view-show-grid", NULL,
     N_("S_how Grid"), NULL, NULL,
     G_CALLBACK (view_toggle_grid_cmd_callback),
@@ -522,6 +528,7 @@ view_actions_update (GimpActionGroup *gr
   SET_SENSITIVE ("view-show-layer-boundary", gdisp);
   SET_ACTIVE    ("view-show-layer-boundary", gdisp && options->show_layer_boundary);
   SET_ACTIVE    ("view-show-guides",         gdisp && options->show_guides);
+  SET_ACTIVE    ("view-show-sample-points",  gdisp && options->show_sample_points);
   SET_ACTIVE    ("view-show-grid",           gdisp && options->show_grid);
   SET_ACTIVE    ("view-snap-to-guides",      gdisp && shell->snap_to_guides);
   SET_ACTIVE    ("view-snap-to-grid",        gdisp && shell->snap_to_grid);
Index: gimp/app/actions/view-commands.c
===================================================================
RCS file: /cvs/gnome/gimp/app/actions/view-commands.c,v
retrieving revision 1.63
diff -u -p -r1.63 view-commands.c
--- gimp/app/actions/view-commands.c	28 Jan 2005 19:48:30 -0000	1.63
+++ gimp/app/actions/view-commands.c	3 Mar 2005 22:36:24 -0000
@@ -473,6 +473,22 @@ view_toggle_guides_cmd_callback (GtkActi
 }
 
 void
+view_toggle_sample_points_cmd_callback (GtkAction *action,
+                                        gpointer   data)
+{
+  GimpDisplay      *gdisp;
+  GimpDisplayShell *shell;
+  gboolean          active;
+  return_if_no_display (gdisp, data);
+
+  shell = GIMP_DISPLAY_SHELL (gdisp->shell);
+
+  active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
+
+  gimp_display_shell_set_show_sample_points (shell, active);
+}
+
+void
 view_toggle_grid_cmd_callback (GtkAction *action,
                                gpointer   data)
 {
Index: gimp/app/actions/view-commands.h
===================================================================
RCS file: /cvs/gnome/gimp/app/actions/view-commands.h,v
retrieving revision 1.23
diff -u -p -r1.23 view-commands.h
--- gimp/app/actions/view-commands.h	28 Jan 2005 19:48:30 -0000	1.23
+++ gimp/app/actions/view-commands.h	3 Mar 2005 22:36:24 -0000
@@ -67,6 +67,8 @@ void   view_toggle_statusbar_cmd_callbac
                                                 gpointer   data);
 void   view_toggle_guides_cmd_callback         (GtkAction *action,
                                                 gpointer   data);
+void   view_toggle_sample_points_cmd_callback  (GtkAction *action,
+                                                gpointer   data);
 void   view_toggle_grid_cmd_callback           (GtkAction *action,
                                                 gpointer   data);
 
Index: gimp/app/config/gimprc-blurbs.h
===================================================================
RCS file: /cvs/gnome/gimp/app/config/gimprc-blurbs.h,v
retrieving revision 1.59
diff -u -p -r1.59 gimprc-blurbs.h
--- gimp/app/config/gimprc-blurbs.h	21 Feb 2005 02:56:02 -0000	1.59
+++ gimp/app/config/gimprc-blurbs.h	3 Mar 2005 22:36:25 -0000
@@ -318,6 +318,10 @@ N_("When enabled, the layer boundary is 
 N_("When enabled, the guides are visible by default. This can also be " \
    "toggled with the \"View->Show Guides\" command.")
 
+#define SHOW_SAMPLE_POINTS_BLURB \
+N_("When enabled, the sample points are visible by default. This can also be " \
+   "toggled with the \"View->Show Sample Points\" command.")
+
 #define SHOW_GRID_BLURB \
 N_("When enabled, the grid is visible by default. This can also be toggled " \
    "with the \"View->Show Grid\" command.")
Index: gimp/app/core/Makefile.am
===================================================================
RCS file: /cvs/gnome/gimp/app/core/Makefile.am,v
retrieving revision 1.104
diff -u -p -r1.104 Makefile.am
--- gimp/app/core/Makefile.am	27 Feb 2005 13:21:58 -0000	1.104
+++ gimp/app/core/Makefile.am	3 Mar 2005 22:36:25 -0000
@@ -148,6 +148,8 @@ libappcore_a_sources = \
 	gimpimage-resize.h		\
 	gimpimage-rotate.c		\
 	gimpimage-rotate.h		\
+	gimpimage-samplepoints.c	\
+	gimpimage-samplepoints.h	\
 	gimpimage-scale.c		\
 	gimpimage-scale.h		\
 	gimpimage-snap.c		\
Index: gimp/app/core/core-enums.c
===================================================================
RCS file: /cvs/gnome/gimp/app/core/core-enums.c,v
retrieving revision 1.77
diff -u -p -r1.77 core-enums.c
--- gimp/app/core/core-enums.c	1 Mar 2005 20:19:53 -0000	1.77
+++ gimp/app/core/core-enums.c	3 Mar 2005 22:36:25 -0000
@@ -691,6 +727,7 @@ gimp_undo_type_get_type (void)
     { GIMP_UNDO_GROUP_IMAGE_QMASK, "GIMP_UNDO_GROUP_IMAGE_QMASK", "group-image-qmask" },
     { GIMP_UNDO_GROUP_IMAGE_GRID, "GIMP_UNDO_GROUP_IMAGE_GRID", "group-image-grid" },
     { GIMP_UNDO_GROUP_IMAGE_GUIDE, "GIMP_UNDO_GROUP_IMAGE_GUIDE", "group-image-guide" },
+    { GIMP_UNDO_GROUP_IMAGE_SAMPLE_POINT, "GIMP_UNDO_GROUP_IMAGE_SAMPLE_POINT", "group-image-sample-point" },
     { GIMP_UNDO_GROUP_DRAWABLE, "GIMP_UNDO_GROUP_DRAWABLE", "group-drawable" },
     { GIMP_UNDO_GROUP_DRAWABLE_MOD, "GIMP_UNDO_GROUP_DRAWABLE_MOD", "group-drawable-mod" },
     { GIMP_UNDO_GROUP_MASK, "GIMP_UNDO_GROUP_MASK", "group-mask" },
@@ -720,6 +757,7 @@ gimp_undo_type_get_type (void)
     { GIMP_UNDO_IMAGE_RESOLUTION, "GIMP_UNDO_IMAGE_RESOLUTION", "image-resolution" },
     { GIMP_UNDO_IMAGE_GRID, "GIMP_UNDO_IMAGE_GRID", "image-grid" },
     { GIMP_UNDO_IMAGE_GUIDE, "GIMP_UNDO_IMAGE_GUIDE", "image-guide" },
+    { GIMP_UNDO_IMAGE_SAMPLE_POINT, "GIMP_UNDO_IMAGE_SAMPLE_POINT", "image-sample-point" },
     { GIMP_UNDO_IMAGE_COLORMAP, "GIMP_UNDO_IMAGE_COLORMAP", "image-colormap" },
     { GIMP_UNDO_DRAWABLE, "GIMP_UNDO_DRAWABLE", "drawable" },
     { GIMP_UNDO_DRAWABLE_MOD, "GIMP_UNDO_DRAWABLE_MOD", "drawable-mod" },
@@ -772,6 +810,7 @@ gimp_undo_type_get_type (void)
     { GIMP_UNDO_GROUP_IMAGE_QMASK, N_("Quick Mask"), NULL },
     { GIMP_UNDO_GROUP_IMAGE_GRID, N_("Grid"), NULL },
     { GIMP_UNDO_GROUP_IMAGE_GUIDE, N_("Guide"), NULL },
+    { GIMP_UNDO_GROUP_IMAGE_SAMPLE_POINT, N_("Sample Point"), NULL },
     { GIMP_UNDO_GROUP_DRAWABLE, N_("Drawable"), NULL },
     { GIMP_UNDO_GROUP_DRAWABLE_MOD, N_("Drawable mod"), NULL },
     { GIMP_UNDO_GROUP_MASK, N_("Selection mask"), NULL },
@@ -801,6 +840,7 @@ gimp_undo_type_get_type (void)
     { GIMP_UNDO_IMAGE_RESOLUTION, N_("Resolution change"), NULL },
     { GIMP_UNDO_IMAGE_GRID, N_("Grid"), NULL },
     { GIMP_UNDO_IMAGE_GUIDE, N_("Guide"), NULL },
+    { GIMP_UNDO_IMAGE_SAMPLE_POINT, N_("Sample Point"), NULL },
     { GIMP_UNDO_IMAGE_COLORMAP, N_("Change indexed palette"), NULL },
     { GIMP_UNDO_DRAWABLE, N_("Drawable"), NULL },
     { GIMP_UNDO_DRAWABLE_MOD, N_("Drawable mod"), NULL },
Index: gimp/app/core/core-enums.h
===================================================================
RCS file: /cvs/gnome/gimp/app/core/core-enums.h,v
retrieving revision 1.93
diff -u -p -r1.93 core-enums.h
--- gimp/app/core/core-enums.h	1 Mar 2005 20:19:53 -0000	1.93
+++ gimp/app/core/core-enums.h	3 Mar 2005 22:36:25 -0000
@@ -336,6 +351,7 @@ typedef enum /*< pdb-skip >*/
   GIMP_UNDO_GROUP_IMAGE_QMASK,        /*< desc="Quick Mask"                  >*/
   GIMP_UNDO_GROUP_IMAGE_GRID,         /*< desc="Grid"                        >*/
   GIMP_UNDO_GROUP_IMAGE_GUIDE,        /*< desc="Guide"                       >*/
+  GIMP_UNDO_GROUP_IMAGE_SAMPLE_POINT, /*< desc="Sample Point"                >*/
   GIMP_UNDO_GROUP_DRAWABLE,           /*< desc="Drawable"                    >*/
   GIMP_UNDO_GROUP_DRAWABLE_MOD,       /*< desc="Drawable mod"                >*/
   GIMP_UNDO_GROUP_MASK,               /*< desc="Selection mask"              >*/
@@ -370,6 +386,7 @@ typedef enum /*< pdb-skip >*/
   GIMP_UNDO_IMAGE_RESOLUTION,         /*< desc="Resolution change"         >*/
   GIMP_UNDO_IMAGE_GRID,               /*< desc="Grid"                      >*/
   GIMP_UNDO_IMAGE_GUIDE,              /*< desc="Guide"                     >*/
+  GIMP_UNDO_IMAGE_SAMPLE_POINT,       /*< desc="Sample Point"              >*/
   GIMP_UNDO_IMAGE_COLORMAP,           /*< desc="Change indexed palette"    >*/
   GIMP_UNDO_DRAWABLE,                 /*< desc="Drawable"                  >*/
   GIMP_UNDO_DRAWABLE_MOD,             /*< desc="Drawable mod"              >*/
Index: gimp/app/core/core-types.h
===================================================================
RCS file: /cvs/gnome/gimp/app/core/core-types.h,v
retrieving revision 1.97
diff -u -p -r1.97 core-types.h
--- gimp/app/core/core-types.h	21 Feb 2005 02:56:26 -0000	1.97
+++ gimp/app/core/core-types.h	3 Mar 2005 22:36:25 -0000
@@ -133,6 +133,7 @@ typedef struct _GimpArea            Gimp
 typedef struct _GimpCoords          GimpCoords;
 typedef struct _GimpGradientSegment GimpGradientSegment;
 typedef struct _GimpGuide           GimpGuide;
+typedef struct _GimpSamplePoint     GimpSamplePoint;
 typedef         guint32             GimpTattoo;
 typedef struct _GimpPaletteEntry    GimpPaletteEntry;
 typedef struct _GimpPlugInDebug     GimpPlugInDebug;
Index: gimp/app/core/gimp.c
===================================================================
RCS file: /cvs/gnome/gimp/app/core/gimp.c,v
retrieving revision 1.126
diff -u -p -r1.126 gimp.c
--- gimp/app/core/gimp.c	21 Feb 2005 02:56:26 -0000	1.126
+++ gimp/app/core/gimp.c	3 Mar 2005 22:36:25 -0000
@@ -241,6 +241,7 @@ gimp_init (Gimp *gimp)
 
   gimp->next_image_ID       = 1;
   gimp->next_guide_ID       = 1;
+  gimp->next_sample_point_ID = 1;
   gimp->image_table         = g_hash_table_new (g_direct_hash, NULL);
 
   gimp->next_item_ID        = 1;
Index: gimp/app/core/gimp.h
===================================================================
RCS file: /cvs/gnome/gimp/app/core/gimp.h,v
retrieving revision 1.69
diff -u -p -r1.69 gimp.h
--- gimp/app/core/gimp.h	21 Feb 2005 02:56:27 -0000	1.69
+++ gimp/app/core/gimp.h	3 Mar 2005 22:36:25 -0000
@@ -88,6 +88,7 @@ struct _Gimp
   GimpContainer          *images;
   gint                    next_image_ID;
   guint32                 next_guide_ID;
+  guint32                 next_sample_point_ID;
   GHashTable             *image_table;
 
   gint                    next_item_ID;
Index: gimp/app/core/gimpimage-crop.c
===================================================================
RCS file: /cvs/gnome/gimp/app/core/gimpimage-crop.c,v
retrieving revision 1.35
diff -u -p -r1.35 gimpimage-crop.c
--- gimp/app/core/gimpimage-crop.c	14 Jul 2004 12:12:50 -0000	1.35
+++ gimp/app/core/gimpimage-crop.c	3 Mar 2005 22:36:25 -0000
@@ -31,6 +31,7 @@
 #include "gimpimage.h"
 #include "gimpimage-crop.h"
 #include "gimpimage-guides.h"
+#include "gimpimage-samplepoints.h"
 #include "gimpimage-undo.h"
 #include "gimpimage-undo-push.h"
 #include "gimplayer.h"
@@ -227,6 +228,31 @@ gimp_image_crop (GimpImage   *gimage,
             gimp_image_remove_guide (gimage, guide, TRUE);
           else if (new_position != guide->position)
             gimp_image_move_guide (gimage, guide, new_position, TRUE);
+        }
+
+      /*  Reposition or remove sample points  */
+      list = gimage->sample_points;
+      while (list)
+        {
+          GimpSamplePoint *sample_point        = list->data;
+          gboolean         remove_sample_point = FALSE;
+          gint             new_x               = sample_point->x;
+          gint             new_y               = sample_point->y;
+
+          list = g_list_next (list);
+
+          new_y -= y1;
+          if ((sample_point->y < y1) || (sample_point->y > y2))
+            remove_sample_point = TRUE;
+
+          new_x -= x1;
+          if ((sample_point->x < x1) || (sample_point->x > x2))
+            remove_sample_point = TRUE;
+
+          if (remove_sample_point)
+            gimp_image_remove_sample_point (gimage, sample_point, TRUE);
+          else if (new_x != sample_point->x || new_y != sample_point->y)
+            gimp_image_move_sample_point (gimage, sample_point, new_x, new_y, TRUE);
         }
 
       gimp_image_undo_group_end (gimage);
Index: gimp/app/core/gimpimage-duplicate.c
===================================================================
RCS file: /cvs/gnome/gimp/app/core/gimpimage-duplicate.c,v
retrieving revision 1.95
diff -u -p -r1.95 gimpimage-duplicate.c
--- gimp/app/core/gimpimage-duplicate.c	25 Jan 2005 19:11:21 -0000	1.95
+++ gimp/app/core/gimpimage-duplicate.c	3 Mar 2005 22:36:25 -0000
@@ -33,6 +33,7 @@
 #include "gimpimage-duplicate.h"
 #include "gimpimage-grid.h"
 #include "gimpimage-guides.h"
+#include "gimpimage-samplepoints.h"
 #include "gimplayer.h"
 #include "gimplayer-floating-sel.h"
 #include "gimplist.h"
@@ -233,6 +234,17 @@ gimp_image_duplicate (GimpImage *gimage)
 	default:
 	  g_error ("Unknown guide orientation.\n");
 	}
+    }
+
+  /*  Copy any sample points  */
+  for (list = gimage->sample_points; list; list = g_list_next (list))
+    {
+      GimpSamplePoint *sample_point = list->data;
+
+      gimp_image_add_sample_point_at_pos (new_gimage,
+                                          sample_point->x,
+                                          sample_point->y,
+                                          FALSE);
     }
 
   /*  Copy the grid  */
Index: gimp/app/core/gimpimage-flip.c
===================================================================
RCS file: /cvs/gnome/gimp/app/core/gimpimage-flip.c,v
retrieving revision 1.9
diff -u -p -r1.9 gimpimage-flip.c
--- gimp/app/core/gimpimage-flip.c	10 Aug 2004 18:46:35 -0000	1.9
+++ gimp/app/core/gimpimage-flip.c	3 Mar 2005 22:36:25 -0000
@@ -27,6 +27,7 @@
 #include "gimpimage.h"
 #include "gimpimage-flip.h"
 #include "gimpimage-guides.h"
+#include "gimpimage-samplepoints.h"
 #include "gimpimage-undo.h"
 #include "gimpimage-undo-push.h"
 #include "gimpitem.h"
@@ -142,6 +143,24 @@ gimp_image_flip (GimpImage           *gi
 	default:
           break;
 	}
+    }
+
+  /*  Flip all sample points  */
+  for (list = gimage->sample_points; list; list = g_list_next (list))
+    {
+      GimpSamplePoint *sample_point = list->data;
+
+      if (flip_type == GIMP_ORIENTATION_VERTICAL)
+        gimp_image_move_sample_point (gimage, sample_point,
+                                      sample_point->x,
+                                      gimage->height - sample_point->y,
+                                      TRUE);
+
+      if (flip_type == GIMP_ORIENTATION_HORIZONTAL)
+        gimp_image_move_sample_point (gimage, sample_point,
+                                      gimage->width - sample_point->x,
+                                      sample_point->y,
+                                      TRUE);
     }
 
   gimp_image_undo_group_end (gimage);
Index: gimp/app/core/gimpimage-rotate.c
===================================================================
RCS file: /cvs/gnome/gimp/app/core/gimpimage-rotate.c,v
retrieving revision 1.12
diff -u -p -r1.12 gimpimage-rotate.c
--- gimp/app/core/gimpimage-rotate.c	10 Aug 2004 18:46:36 -0000	1.12
+++ gimp/app/core/gimpimage-rotate.c	3 Mar 2005 22:36:25 -0000
@@ -27,6 +27,7 @@
 #include "gimpimage.h"
 #include "gimpimage-rotate.h"
 #include "gimpimage-guides.h"
+#include "gimpimage-samplepoints.h"
 #include "gimpimage-undo.h"
 #include "gimpimage-undo-push.h"
 #include "gimpitem.h"
@@ -34,13 +35,15 @@
 #include "gimpprogress.h"
 
 
-static void  gimp_image_rotate_item_offset (GimpImage        *gimage,
-					    GimpRotationType  rotate_type,
-					    GimpItem         *item,
-					    gint              off_x,
-					    gint              off_y);
-static void  gimp_image_rotate_guides      (GimpImage        *gimage,
-					    GimpRotationType  rotate_type);
+static void  gimp_image_rotate_item_offset   (GimpImage        *gimage,
+                                              GimpRotationType  rotate_type,
+                                              GimpItem         *item,
+                                              gint              off_x,
+                                              gint              off_y);
+static void  gimp_image_rotate_guides        (GimpImage        *gimage,
+                                              GimpRotationType  rotate_type);
+static void  gimp_image_rotate_sample_points (GimpImage        *gimage,
+                                              GimpRotationType  rotate_type);
 
 
 void
@@ -169,6 +172,9 @@ gimp_image_rotate (GimpImage        *gim
   /*  Rotate all Guides  */
   gimp_image_rotate_guides (gimage, rotate_type);
 
+  /*  Rotate all sample points  */
+  gimp_image_rotate_sample_points (gimage, rotate_type);
+
   /*  Resize the image (if needed)  */
   if (size_changed)
     {
@@ -304,6 +310,43 @@ gimp_image_rotate_guides (GimpImage     
             default:
               break;
             }
+          break;
+	}
+    }
+}
+
+
+static void
+gimp_image_rotate_sample_points (GimpImage        *gimage,
+                                 GimpRotationType  rotate_type)
+{
+  GList *list;
+
+  /*  Rotate all sample points  */
+  for (list = gimage->sample_points; list; list = g_list_next (list))
+    {
+      GimpSamplePoint *sample_point = list->data;
+      gint             old_x;
+      gint             old_y;
+
+      old_x = sample_point->x;
+      old_y = sample_point->y;
+
+      switch (rotate_type)
+        {
+        case GIMP_ROTATE_90:
+          sample_point->x = old_y;
+          sample_point->y = gimage->height - old_x;
+          break;
+
+        case GIMP_ROTATE_180:
+          sample_point->x = gimage->height - old_x;
+          sample_point->y = gimage->width - old_y;
+          break;
+
+        case GIMP_ROTATE_270:
+          sample_point->x = gimage->width - old_y;
+          sample_point->y = old_x;
           break;
 	}
     }
Index: gimp/app/core/gimpimage-samplepoints.c
===================================================================
RCS file: gimp/app/core/gimpimage-samplepoints.c
diff -N gimp/app/core/gimpimage-samplepoints.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ gimp/app/core/gimpimage-samplepoints.c	3 Mar 2005 22:36:25 -0000
@@ -0,0 +1,188 @@
+/* The GIMP -- an image manipulation program
+ * Copyright (C) 1995 Spencer Kimball and Peter Mattis
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#include "config.h"
+
+#include <glib-object.h>
+
+#include "core-types.h"
+
+#include "gimp.h"
+#include "gimpimage.h"
+#include "gimpimage-samplepoints.h"
+#include "gimpimage-undo-push.h"
+
+#include "gimp-intl.h"
+
+
+/*  public functions  */
+
+GimpSamplePoint *
+gimp_image_add_sample_point_at_pos (GimpImage *gimage,
+                                    gint       x,
+                                    gint       y,
+                                    gboolean   push_undo)
+{
+  GimpSamplePoint *sample_point;
+
+  g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL);
+  g_return_val_if_fail (x >= 0 && x <= gimage->width, NULL);
+  g_return_val_if_fail (y >= 0 && y <= gimage->height, NULL);
+
+  sample_point = g_new0 (GimpSamplePoint, 1);
+
+  sample_point->ref_count   = 1;
+  sample_point->x           = -1;
+  sample_point->y           = -1;
+  sample_point->sample_point_ID    = gimage->gimp->next_sample_point_ID++;
+
+  if (push_undo)
+    gimp_image_undo_push_image_sample_point (gimage, _("Add Sample_Point"),
+                                             sample_point);
+
+  gimp_image_add_sample_point (gimage, sample_point, x, y);
+  gimp_image_sample_point_unref (sample_point);
+
+  return sample_point;
+}
+
+GimpSamplePoint *
+gimp_image_sample_point_ref (GimpSamplePoint *sample_point)
+{
+  g_return_val_if_fail (sample_point != NULL, NULL);
+
+  sample_point->ref_count++;
+
+  return sample_point;
+}
+
+void
+gimp_image_sample_point_unref (GimpSamplePoint *sample_point)
+{
+  g_return_if_fail (sample_point != NULL);
+
+  sample_point->ref_count--;
+
+  if (sample_point->ref_count < 1)
+    g_free (sample_point);
+}
+
+void
+gimp_image_add_sample_point (GimpImage       *gimage,
+                             GimpSamplePoint *sample_point,
+                             gint             x,
+                             gint             y)
+{
+  g_return_if_fail (GIMP_IS_IMAGE (gimage));
+  g_return_if_fail (sample_point != NULL);
+  g_return_if_fail (x >= 0);
+  g_return_if_fail (y >= 0);
+  g_return_if_fail (x <= gimage->width);
+  g_return_if_fail (y <= gimage->height);
+
+  gimage->sample_points = g_list_prepend (gimage->sample_points, sample_point);
+
+  sample_point->x = x;
+  sample_point->y = y;
+  gimp_image_sample_point_ref (sample_point);
+
+  gimp_image_update_sample_point (gimage, sample_point);
+}
+
+void
+gimp_image_remove_sample_point (GimpImage *gimage,
+			 GimpSamplePoint *sample_point,
+                         gboolean   push_undo)
+{
+  g_return_if_fail (GIMP_IS_IMAGE (gimage));
+  g_return_if_fail (sample_point != NULL);
+
+  gimp_image_update_sample_point (gimage, sample_point);
+
+  if (push_undo)
+    gimp_image_undo_push_image_sample_point (gimage, _("Remove Sample Point"), sample_point);
+
+  gimage->sample_points = g_list_remove (gimage->sample_points, sample_point);
+
+  sample_point->x = -1;
+  sample_point->y = -1;
+  gimp_image_sample_point_unref (sample_point);
+}
+
+void
+gimp_image_move_sample_point (GimpImage       *gimage,
+                              GimpSamplePoint *sample_point,
+                              gint             x,
+                              gint             y,
+                              gboolean         push_undo)
+{
+  g_return_if_fail (GIMP_IS_IMAGE (gimage));
+  g_return_if_fail (sample_point != NULL);
+  g_return_if_fail (x >= 0);
+  g_return_if_fail (y >= 0);
+  g_return_if_fail (x <= gimage->width);
+  g_return_if_fail (y <= gimage->height);
+
+  if (push_undo)
+    gimp_image_undo_push_image_sample_point (gimage, _("Move Sample Point"), sample_point);
+
+  gimp_image_update_sample_point (gimage, sample_point);
+  sample_point->x = x;
+  sample_point->y = y;
+  gimp_image_update_sample_point (gimage, sample_point);
+}
+
+GimpSamplePoint *
+gimp_image_find_sample_point (GimpImage *gimage,
+                              gdouble    x,
+                              gdouble    y,
+                              gdouble    epsilon_x,
+                              gdouble    epsilon_y)
+{
+  GList           *list;
+  GimpSamplePoint *sample_point;
+  GimpSamplePoint *ret            = NULL;
+  gdouble          dist;
+  gdouble          mindist        = G_MAXDOUBLE;
+
+  g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL);
+  g_return_val_if_fail (epsilon_x > 0 && epsilon_y > 0, NULL);
+
+  if (x < 0 || x >= gimage->width ||
+      y < 0 || y >= gimage->height)
+    {
+      return NULL;
+    }
+
+  for (list = gimage->sample_points; list; list = g_list_next (list))
+    {
+      sample_point = (GimpSamplePoint *) list->data;
+
+      if (sample_point->x < 0 || sample_point->y < 0)
+        continue;
+
+      dist = hypot ( sample_point->x - x, sample_point->y - y);
+      if (dist < MIN (epsilon_y, mindist))
+        {
+          mindist = dist;
+          ret = sample_point;
+        }
+    }
+
+  return ret;
+}
Index: gimp/app/core/gimpimage-samplepoints.h
===================================================================
RCS file: gimp/app/core/gimpimage-samplepoints.h
diff -N gimp/app/core/gimpimage-samplepoints.h
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ gimp/app/core/gimpimage-samplepoints.h	3 Mar 2005 22:36:25 -0000
@@ -0,0 +1,60 @@
+/* The GIMP -- an image manipulation program
+ * Copyright (C) 1995 Spencer Kimball and Peter Mattis
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __GIMP_IMAGE_SAMPLE_POINTS_H__
+#define __GIMP_IMAGE_SAMPLE_POINTS_H__
+
+#define GIMP_SAMPLE_POINT_DRAW_SIZE 10
+
+struct _GimpSamplePoint
+{
+  gint                 ref_count;
+  gint                 x;
+  gint                 y;
+  guint32              sample_point_ID;
+};
+
+
+GimpSamplePoint * gimp_image_add_sample_point_at_pos (GimpImage        *gimage,
+                                                      gint              x,
+                                                      gint              y,
+                                                      gboolean          push_undo);
+GimpSamplePoint * gimp_image_sample_point_ref        (GimpSamplePoint *sample_point);
+void              gimp_image_sample_point_unref      (GimpSamplePoint *sample_point);
+
+void              gimp_image_add_sample_point        (GimpImage       *gimage,
+                                                      GimpSamplePoint *sample_point,
+                                                      gint             x,
+                                                      gint             y);
+void              gimp_image_remove_sample_point     (GimpImage       *gimage,
+                                                      GimpSamplePoint *sample_point,
+                                                      gboolean         push_undo);
+void              gimp_image_move_sample_point       (GimpImage       *gimage,
+                                                      GimpSamplePoint *sample_point,
+                                                      gint             x,
+                                                      gint             y,
+                                                      gboolean         push_undo);
+
+GimpSamplePoint * gimp_image_find_sample_point       (GimpImage       *gimage,
+                                                      gdouble         x,
+                                                      gdouble         y,
+                                                      gdouble         epsilon_x,
+                                                      gdouble         epsilon_y);
+
+
+#endif /* __GIMP_IMAGE_SAMPLE_POINTS_H__ */
Index: gimp/app/core/gimpimage-scale.c
===================================================================
RCS file: /cvs/gnome/gimp/app/core/gimpimage-scale.c,v
retrieving revision 1.237
diff -u -p -r1.237 gimpimage-scale.c
--- gimp/app/core/gimpimage-scale.c	10 Aug 2004 18:46:36 -0000	1.237
+++ gimp/app/core/gimpimage-scale.c	3 Mar 2005 22:36:25 -0000
@@ -27,6 +27,7 @@
 #include "gimp.h"
 #include "gimpimage.h"
 #include "gimpimage-guides.h"
+#include "gimpimage-samplepoints.h"
 #include "gimpimage-scale.h"
 #include "gimpimage-undo.h"
 #include "gimpimage-undo-push.h"
@@ -179,6 +180,16 @@ gimp_image_scale (GimpImage             
 	default:
           break;
 	}
+    }
+
+  /*  Scale all sample points  */
+  for (list = gimage->sample_points; list; list = g_list_next (list))
+    {
+      GimpSamplePoint *sample_point = list->data;
+
+      gimp_image_undo_push_image_sample_point (gimage, NULL, sample_point);
+      sample_point->x = sample_point->x * new_width / old_width;
+      sample_point->y = sample_point->y * new_height / old_height;
     }
 
   gimp_image_undo_group_end (gimage);
Index: gimp/app/core/gimpimage-undo-push.c
===================================================================
RCS file: /cvs/gnome/gimp/app/core/gimpimage-undo-push.c,v
retrieving revision 1.234
diff -u -p -r1.234 gimpimage-undo-push.c
--- gimp/app/core/gimpimage-undo-push.c	25 Jan 2005 19:11:21 -0000	1.234
+++ gimp/app/core/gimpimage-undo-push.c	3 Mar 2005 22:36:25 -0000
@@ -38,6 +38,7 @@
 #include "gimpimage-colormap.h"
 #include "gimpimage-grid.h"
 #include "gimpimage-guides.h"
+#include "gimpimage-samplepoints.h"
 #include "gimpimage-undo.h"
 #include "gimpimage.h"
 #include "gimpitemundo.h"
@@ -478,6 +479,105 @@ undo_free_image_guide (GimpUndo     *und
   GuideUndo *gu = undo->data;
 
   gimp_image_guide_unref (gu->guide);
+  g_free (gu);
+}
+
+
+/**********************/
+/*  Sampe Point Undo  */
+/**********************/
+
+typedef struct _SamplePointUndo SamplePointUndo;
+
+struct _SamplePointUndo
+{
+  GimpSamplePoint     *sample_point;
+  gint                 x;
+  gint                 y;
+};
+
+static gboolean undo_pop_image_sample_point  (GimpUndo            *undo,
+                                              GimpUndoMode         undo_mode,
+                                              GimpUndoAccumulator *accum);
+static void     undo_free_image_sample_point (GimpUndo            *undo,
+                                              GimpUndoMode         undo_mode);
+
+gboolean
+gimp_image_undo_push_image_sample_point (GimpImage       *gimage,
+                                         const gchar     *undo_desc,
+                                         GimpSamplePoint *sample_point)
+{
+  GimpUndo *new;
+
+  g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE);
+  g_return_val_if_fail (sample_point != NULL, FALSE);
+
+  if ((new = gimp_image_undo_push (gimage, GIMP_TYPE_UNDO,
+                                   sizeof (SamplePointUndo),
+                                   sizeof (SamplePointUndo),
+                                   GIMP_UNDO_IMAGE_SAMPLE_POINT, undo_desc,
+                                   GIMP_DIRTY_IMAGE_META,
+                                   undo_pop_image_sample_point,
+                                   undo_free_image_sample_point,
+                                   NULL)))
+    {
+      SamplePointUndo *gu = new->data;
+
+      gu->sample_point    = gimp_image_sample_point_ref (sample_point);
+      gu->x               = sample_point->x;
+      gu->y               = sample_point->y;
+
+      return TRUE;
+    }
+
+  return FALSE;
+}
+
+static gboolean
+undo_pop_image_sample_point (GimpUndo            *undo,
+                             GimpUndoMode         undo_mode,
+                             GimpUndoAccumulator *accum)
+{
+  SamplePointUndo *gu = undo->data;
+  gint             old_x;
+  gint             old_y;
+
+  old_x = gu->sample_point->x;
+  old_y = gu->sample_point->y;
+
+  if (gu->sample_point->x == -1)
+    {
+      undo->gimage->sample_points = g_list_prepend (undo->gimage->sample_points, gu->sample_point);
+      gu->sample_point->x = gu->x;
+      gu->sample_point->y = gu->y;
+      gimp_image_sample_point_ref (gu->sample_point);
+      gimp_image_update_sample_point (undo->gimage, gu->sample_point);
+    }
+  else if (gu->x == -1)
+    {
+      gimp_image_remove_sample_point (undo->gimage, gu->sample_point, FALSE);
+    }
+  else
+    {
+      gimp_image_update_sample_point (undo->gimage, gu->sample_point);
+      gu->sample_point->x = gu->x;
+      gu->sample_point->y = gu->y;
+      gimp_image_update_sample_point (undo->gimage, gu->sample_point);
+    }
+
+  gu->x = old_x;
+  gu->y = old_y;
+
+  return TRUE;
+}
+
+static void
+undo_free_image_sample_point (GimpUndo     *undo,
+                              GimpUndoMode  undo_mode)
+{
+  SamplePointUndo *gu = undo->data;
+
+  gimp_image_sample_point_unref (gu->sample_point);
   g_free (gu);
 }
 
Index: gimp/app/core/gimpimage-undo-push.h
===================================================================
RCS file: /cvs/gnome/gimp/app/core/gimpimage-undo-push.h,v
retrieving revision 1.40
diff -u -p -r1.40 gimpimage-undo-push.h
--- gimp/app/core/gimpimage-undo-push.h	1 Apr 2004 14:51:58 -0000	1.40
+++ gimp/app/core/gimpimage-undo-push.h	3 Mar 2005 22:36:25 -0000
@@ -34,6 +34,9 @@ gboolean gimp_image_undo_push_image_grid
 gboolean gimp_image_undo_push_image_guide           (GimpImage     *gimage,
                                                      const gchar   *undo_desc,
                                                      GimpGuide     *guide);
+gboolean gimp_image_undo_push_image_sample_point    (GimpImage     *gimage,
+                                                     const gchar   *undo_desc,
+                                                     GimpSamplePoint *sample_point);
 gboolean gimp_image_undo_push_image_colormap        (GimpImage     *gimage,
                                                      const gchar   *undo_desc);
 
Index: gimp/app/core/gimpimage.c
===================================================================
RCS file: /cvs/gnome/gimp/app/core/gimpimage.c,v
retrieving revision 1.344
diff -u -p -r1.344 gimpimage.c
--- gimp/app/core/gimpimage.c	25 Jan 2005 19:11:21 -0000	1.344
+++ gimp/app/core/gimpimage.c	3 Mar 2005 22:36:25 -0000
@@ -44,6 +44,7 @@
 #include "gimpimage-colorhash.h"
 #include "gimpimage-colormap.h"
 #include "gimpimage-guides.h"
+#include "gimpimage-samplepoints.h"
 #include "gimpimage-preview.h"
 #include "gimpimage-qmask.h"
 #include "gimpimage-undo.h"
@@ -92,6 +93,7 @@ enum
   DIRTY,
   UPDATE,
   UPDATE_GUIDE,
+  UPDATE_SAMPLE_POINT,
   COLORMAP_CHANGED,
   UNDO_EVENT,
   FLUSH,
@@ -398,6 +400,16 @@ gimp_image_class_init (GimpImageClass *k
                   G_TYPE_NONE, 1,
                   G_TYPE_POINTER);
 
+  gimp_image_signals[UPDATE_SAMPLE_POINT] =
+    g_signal_new ("update_sample_point",
+                  G_TYPE_FROM_CLASS (klass),
+                  G_SIGNAL_RUN_FIRST,
+                  G_STRUCT_OFFSET (GimpImageClass, update_sample_point),
+                  NULL, NULL,
+                  gimp_marshal_VOID__POINTER,
+                  G_TYPE_NONE, 1,
+                  G_TYPE_POINTER);
+
   gimp_image_signals[COLORMAP_CHANGED] =
     g_signal_new ("colormap_changed",
                   G_TYPE_FROM_CLASS (klass),
@@ -460,6 +472,7 @@ gimp_image_class_init (GimpImageClass *k
   klass->dirty                        = NULL;
   klass->update                       = NULL;
   klass->update_guide                 = NULL;
+  klass->update_sample_point          = NULL;
   klass->colormap_changed             = gimp_image_real_colormap_changed;
   klass->undo_event                   = NULL;
   klass->flush                        = gimp_image_real_flush;
@@ -533,6 +546,8 @@ gimp_image_init (GimpImage *gimage)
 
   gimage->grid                  = NULL;
 
+  gimage->sample_points         = NULL;
+
   gimage->layers                = gimp_list_new (GIMP_TYPE_LAYER,   TRUE);
   gimage->channels              = gimp_list_new (GIMP_TYPE_CHANNEL, TRUE);
   gimage->vectors               = gimp_list_new (GIMP_TYPE_VECTORS, TRUE);
@@ -858,6 +873,13 @@ gimp_image_finalize (GObject *object)
       gimage->grid = NULL;
     }
 
+  if (gimage->sample_points)
+    {
+      g_list_foreach (gimage->sample_points, (GFunc) gimp_image_sample_point_unref, NULL);
+      g_list_free (gimage->sample_points);
+      gimage->sample_points = NULL;
+    }
+
   if (gimage->undo_stack)
     {
       g_object_unref (gimage->undo_stack);
@@ -915,6 +937,8 @@ gimp_image_get_memsize (GimpObject *obje
 
   memsize += gimp_g_list_get_memsize (gimage->guides, sizeof (GimpGuide));
 
+  memsize += gimp_g_list_get_memsize (gimage->sample_points, sizeof (GimpSamplePoint));
+
   if (gimage->grid)
     memsize += gimp_object_get_memsize (GIMP_OBJECT (gimage->grid), gui_size);
 
@@ -1629,6 +1653,16 @@ gimp_image_update_guide (GimpImage *gima
   g_return_if_fail (guide != NULL);
 
   g_signal_emit (gimage, gimp_image_signals[UPDATE_GUIDE], 0, guide);
+}
+
+void
+gimp_image_update_sample_point (GimpImage       *gimage,
+                                GimpSamplePoint *sample_point)
+{
+  g_return_if_fail (GIMP_IS_IMAGE (gimage));
+  g_return_if_fail (sample_point != NULL);
+
+  g_signal_emit (gimage, gimp_image_signals[UPDATE_SAMPLE_POINT], 0, sample_point);
 }
 
 void
Index: gimp/app/core/gimpimage.h
===================================================================
RCS file: /cvs/gnome/gimp/app/core/gimpimage.h,v
retrieving revision 1.157
diff -u -p -r1.157 gimpimage.h
--- gimp/app/core/gimpimage.h	12 Oct 2004 21:28:52 -0000	1.157
+++ gimp/app/core/gimpimage.h	3 Mar 2005 22:36:25 -0000
@@ -129,6 +129,7 @@ struct _GimpImage
 
   GList             *guides;                /*  guides                       */
   GimpGrid          *grid;                  /*  grid                         */
+  GList             *sample_points;         /*  color sample points          */
 
   /*  Layer/Channel attributes  */
   GimpContainer     *layers;                /*  the list of layers           */
@@ -207,6 +208,8 @@ struct _GimpImageClass
 					 gint                  height);
   void (* update_guide)                 (GimpImage            *gimage,
                                          GimpGuide            *guide);
+  void (* update_sample_point)          (GimpImage            *gimage,
+                                         GimpSamplePoint      *sample_point);
   void (* colormap_changed)             (GimpImage            *gimage,
 					 gint                  color_index);
   void (* undo_event)                   (GimpImage            *gimage,
@@ -294,6 +297,8 @@ void            gimp_image_update       
                                                   gint                height);
 void            gimp_image_update_guide          (GimpImage          *gimage,
                                                   GimpGuide          *guide);
+void            gimp_image_update_sample_point   (GimpImage          *gimage,
+                                                  GimpSamplePoint    *sample_point);
 void		gimp_image_colormap_changed      (GimpImage          *gimage,
                                                   gint                col);
 void            gimp_image_selection_control     (GimpImage          *gimage,
Index: gimp/app/display/gimpdisplayoptions.c
===================================================================
RCS file: /cvs/gnome/gimp/app/display/gimpdisplayoptions.c,v
retrieving revision 1.6
diff -u -p -r1.6 gimpdisplayoptions.c
--- gimp/app/display/gimpdisplayoptions.c	25 Jan 2005 19:11:22 -0000	1.6
+++ gimp/app/display/gimpdisplayoptions.c	3 Mar 2005 22:36:25 -0000
@@ -48,6 +48,7 @@ enum
   PROP_SHOW_SELECTION,
   PROP_SHOW_LAYER_BOUNDARY,
   PROP_SHOW_GUIDES,
+  PROP_SHOW_SAMPLE_POINTS,
   PROP_SHOW_GRID,
   PROP_PADDING_MODE,
   PROP_PADDING_COLOR
@@ -177,6 +178,10 @@ gimp_display_options_class_init (GimpDis
                                     "show-layer-boundary", SHOW_LAYER_BOUNDARY_BLURB,
                                     TRUE,
                                     0);
+  GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_SHOW_SAMPLE_POINTS,
+                                    "show-sample-points", SHOW_SAMPLE_POINTS_BLURB,
+                                    TRUE,
+                                    0);
   GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_SHOW_GUIDES,
                                     "show-guides", SHOW_GUIDES_BLURB,
                                     TRUE,
@@ -235,6 +240,10 @@ gimp_display_options_fs_class_init (Gimp
                                     "show-guides", SHOW_GUIDES_BLURB,
                                     FALSE,
                                     0);
+  GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_SHOW_SAMPLE_POINTS,
+                                    "show-sample-points", SHOW_SAMPLE_POINTS_BLURB,
+                                    FALSE,
+                                    0);
   GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_SHOW_GRID,
                                     "show-grid", SHOW_GRID_BLURB,
                                     FALSE,
@@ -287,6 +296,9 @@ gimp_display_options_set_property (GObje
     case PROP_SHOW_GUIDES:
       options->show_guides = g_value_get_boolean (value);
       break;
+    case PROP_SHOW_SAMPLE_POINTS:
+      options->show_sample_points = g_value_get_boolean (value);
+      break;
     case PROP_SHOW_GRID:
       options->show_grid = g_value_get_boolean (value);
       break;
@@ -333,6 +345,9 @@ gimp_display_options_get_property (GObje
       break;
     case PROP_SHOW_GUIDES:
       g_value_set_boolean (value, options->show_guides);
+      break;
+    case PROP_SHOW_SAMPLE_POINTS:
+      g_value_set_boolean (value, options->show_sample_points);
       break;
     case PROP_SHOW_GRID:
       g_value_set_boolean (value, options->show_grid);
Index: gimp/app/display/gimpdisplayoptions.h
===================================================================
RCS file: /cvs/gnome/gimp/app/display/gimpdisplayoptions.h,v
retrieving revision 1.2
diff -u -p -r1.2 gimpdisplayoptions.h
--- gimp/app/display/gimpdisplayoptions.h	23 Oct 2003 07:33:15 -0000	1.2
+++ gimp/app/display/gimpdisplayoptions.h	3 Mar 2005 22:36:25 -0000
@@ -49,6 +49,7 @@ struct _GimpDisplayOptions
   gboolean               show_selection;
   gboolean               show_layer_boundary;
   gboolean               show_guides;
+  gboolean               show_sample_points;
   gboolean               show_grid;
   GimpCanvasPaddingMode  padding_mode;
   GimpRGB                padding_color;
Index: gimp/app/display/gimpdisplayshell-appearance.c
===================================================================
RCS file: /cvs/gnome/gimp/app/display/gimpdisplayshell-appearance.c,v
retrieving revision 1.18
diff -u -p -r1.18 gimpdisplayshell-appearance.c
--- gimp/app/display/gimpdisplayshell-appearance.c	3 Jan 2005 16:55:24 -0000	1.18
+++ gimp/app/display/gimpdisplayshell-appearance.c	3 Mar 2005 22:36:25 -0000
@@ -403,6 +403,35 @@ gimp_display_shell_get_show_guides (Gimp
 }
 
 void
+gimp_display_shell_set_show_sample_points (GimpDisplayShell *shell,
+                                           gboolean          show)
+{
+  GimpDisplayOptions *options;
+
+  g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
+
+  options = GET_OPTIONS (shell);
+
+  g_object_set (options, "show-sample-points", show, NULL);
+
+  if (shell->gdisp->gimage->sample_points)
+    gimp_display_shell_expose_full (shell);
+
+  SET_ACTIVE (shell->menubar_manager, "view-show-sample-points", show);
+
+  if (IS_ACTIVE_DISPLAY (shell))
+    SET_ACTIVE (shell->popup_manager, "view-show-sample-points", show);
+}
+
+gboolean
+gimp_display_shell_get_show_sample_points (GimpDisplayShell *shell)
+{
+  g_return_val_if_fail (GIMP_IS_DISPLAY_SHELL (shell), FALSE);
+
+  return GET_OPTIONS (shell)->show_sample_points;
+}
+
+void
 gimp_display_shell_set_snap_to_grid (GimpDisplayShell *shell,
                                      gboolean          snap)
 {
Index: gimp/app/display/gimpdisplayshell-appearance.h
===================================================================
RCS file: /cvs/gnome/gimp/app/display/gimpdisplayshell-appearance.h,v
retrieving revision 1.9
diff -u -p -r1.9 gimpdisplayshell-appearance.h
--- gimp/app/display/gimpdisplayshell-appearance.h	3 Jan 2005 16:55:24 -0000	1.9
+++ gimp/app/display/gimpdisplayshell-appearance.h	3 Mar 2005 22:36:25 -0000
@@ -60,6 +60,10 @@ void       gimp_display_shell_set_show_g
                                                    gboolean          show);
 gboolean   gimp_display_shell_get_show_guides     (GimpDisplayShell *shell);
 
+void       gimp_display_shell_set_show_sample_points (GimpDisplayShell *shell,
+                                                      gboolean          show);
+gboolean   gimp_display_shell_get_show_sample_points (GimpDisplayShell *shell);
+
 void       gimp_display_shell_set_snap_to_grid    (GimpDisplayShell *shell,
                                                    gboolean          snap);
 gboolean   gimp_display_shell_get_snap_to_grid    (GimpDisplayShell *shell);
Index: gimp/app/display/gimpdisplayshell-callbacks.c
===================================================================
RCS file: /cvs/gnome/gimp/app/display/gimpdisplayshell-callbacks.c,v
retrieving revision 1.278
diff -u -p -r1.278 gimpdisplayshell-callbacks.c
--- gimp/app/display/gimpdisplayshell-callbacks.c	22 Feb 2005 21:38:04 -0000	1.278
+++ gimp/app/display/gimpdisplayshell-callbacks.c	3 Mar 2005 22:36:25 -0000
@@ -36,6 +36,7 @@
 #include "core/gimpcontext.h"
 #include "core/gimpimage.h"
 #include "core/gimpimage-guides.h"
+#include "core/gimpimage-samplepoints.h"
 #include "core/gimpimage-qmask.h"
 #include "core/gimplayer.h"
 #include "core/gimptoolinfo.h"
@@ -217,6 +218,8 @@ gimp_display_shell_events (GtkWidget    
                                                 options->show_layer_boundary);
         gimp_display_shell_set_show_guides     (shell,
                                                 options->show_guides);
+        gimp_display_shell_set_show_sample_points (shell,
+                                                   options->show_sample_points);
         gimp_display_shell_set_show_grid       (shell,
                                                 options->show_grid);
         gimp_display_shell_set_padding         (shell,
@@ -407,6 +410,9 @@ gimp_display_shell_canvas_expose (GtkWid
 
   /* draw the guides */
   gimp_display_shell_draw_guides (shell);
+
+  /* draw the sample points */
+  gimp_display_shell_draw_sample_points (shell);
 
   /* draw the grid */
   gimp_display_shell_draw_grid (shell, &eevent->area);
Index: gimp/app/display/gimpdisplayshell-draw.c
===================================================================
RCS file: /cvs/gnome/gimp/app/display/gimpdisplayshell-draw.c,v
retrieving revision 1.309
diff -u -p -r1.309 gimpdisplayshell-draw.c
--- gimp/app/display/gimpdisplayshell-draw.c	1 Oct 2004 09:50:04 -0000	1.309
+++ gimp/app/display/gimpdisplayshell-draw.c	3 Mar 2005 22:36:25 -0000
@@ -26,6 +26,7 @@
 #include "core/gimpgrid.h"
 #include "core/gimpimage.h"
 #include "core/gimpimage-guides.h"
+#include "core/gimpimage-samplepoints.h"
 #include "core/gimplist.h"
 
 #include "vectors/gimpstroke.h"
@@ -119,6 +120,73 @@ gimp_display_shell_draw_guides (GimpDisp
 	  gimp_display_shell_draw_guide (shell,
                                          (GimpGuide *) list->data,
                                          FALSE);
+	}
+    }
+}
+
+void
+gimp_display_shell_draw_sample_point (GimpDisplayShell *shell,
+                                      GimpSamplePoint  *sample_point,
+                                      gboolean          active)
+{
+  gint  x1, x2;
+  gint  y1, y2;
+  gint  x, y;
+  gint  w, h;
+
+  g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
+  g_return_if_fail (sample_point != NULL);
+
+  if (sample_point->x < 0)
+    return;
+
+  gimp_display_shell_transform_xy (shell,
+                                   sample_point->x,
+                                   sample_point->y,
+                                   &x, &y, FALSE);
+
+  x1 = x - GIMP_SAMPLE_POINT_DRAW_SIZE;
+  x2 = x + GIMP_SAMPLE_POINT_DRAW_SIZE;
+  y1 = y - GIMP_SAMPLE_POINT_DRAW_SIZE;
+  y2 = y + GIMP_SAMPLE_POINT_DRAW_SIZE;
+
+
+  gdk_drawable_get_size (shell->canvas->window, &w, &h);
+
+  if (x < 0 || y < 0 || x >= w || y >= h)
+    return;
+
+  if (x1 < 0) x1 = 0;
+  if (y1 < 0) y1 = 0;
+  if (x2 > w) x2 = w;
+  if (y2 > h) y2 = h;
+
+  gimp_canvas_draw_line (GIMP_CANVAS (shell->canvas),
+                         (active ?
+                          GIMP_CANVAS_STYLE_GUIDE_ACTIVE :
+                          GIMP_CANVAS_STYLE_GUIDE_NORMAL), x, y1, x, y2);
+  gimp_canvas_draw_line (GIMP_CANVAS (shell->canvas),
+                         (active ?
+                          GIMP_CANVAS_STYLE_GUIDE_ACTIVE :
+                          GIMP_CANVAS_STYLE_GUIDE_NORMAL), x1, y, x2, y);
+}
+
+void
+gimp_display_shell_draw_sample_points (GimpDisplayShell *shell)
+{
+  g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
+
+  if (gimp_display_shell_get_show_sample_points (shell))
+    {
+      GList *list;
+
+      for (list = shell->gdisp->gimage->sample_points;
+           list;
+           list = g_list_next (list))
+	{
+	  gimp_display_shell_draw_sample_point(shell,
+                                               (GimpSamplePoint *) list->data,
+                                               FALSE);
 	}
     }
 }
Index: gimp/app/display/gimpdisplayshell-draw.h
===================================================================
RCS file: /cvs/gnome/gimp/app/display/gimpdisplayshell-draw.h,v
retrieving revision 1.72
diff -u -p -r1.72 gimpdisplayshell-draw.h
--- gimp/app/display/gimpdisplayshell-draw.h	4 Apr 2004 17:17:40 -0000	1.72
+++ gimp/app/display/gimpdisplayshell-draw.h	3 Mar 2005 22:36:25 -0000
@@ -20,21 +20,25 @@
 #define __GIMP_DISPLAY_SHELL_DRAW_H__
 
 
-void   gimp_display_shell_draw_guide   (GimpDisplayShell   *shell,
-                                        GimpGuide          *guide,
-                                        gboolean            active);
-void   gimp_display_shell_draw_guides  (GimpDisplayShell   *shell);
-void   gimp_display_shell_draw_grid    (GimpDisplayShell   *shell,
-                                        const GdkRectangle *area);
-void   gimp_display_shell_draw_vector  (GimpDisplayShell   *shell,
-                                        GimpVectors        *vectors);
-void   gimp_display_shell_draw_vectors (GimpDisplayShell   *shell);
-void   gimp_display_shell_draw_cursor  (GimpDisplayShell   *shell);
-void   gimp_display_shell_draw_area    (GimpDisplayShell   *shell,
-                                        gint                x,
-                                        gint                y,
-                                        gint                w,
-                                        gint                h);
+void   gimp_display_shell_draw_guide         (GimpDisplayShell   *shell,
+                                              GimpGuide          *guide,
+                                              gboolean            active);
+void   gimp_display_shell_draw_guides        (GimpDisplayShell   *shell);
+void   gimp_display_shell_draw_sample_point  (GimpDisplayShell   *shell,
+                                             GimpSamplePoint     *sample_point,
+                                             gboolean             active);
+void   gimp_display_shell_draw_sample_points (GimpDisplayShell   *shell);
+void   gimp_display_shell_draw_grid          (GimpDisplayShell   *shell,
+                                              const GdkRectangle *area);
+void   gimp_display_shell_draw_vector        (GimpDisplayShell   *shell,
+                                              GimpVectors        *vectors);
+void   gimp_display_shell_draw_vectors       (GimpDisplayShell   *shell);
+void   gimp_display_shell_draw_cursor        (GimpDisplayShell   *shell);
+void   gimp_display_shell_draw_area          (GimpDisplayShell   *shell,
+                                              gint                x,
+                                              gint                y,
+                                              gint                w,
+                                              gint                h);
 
 
 #endif /* __GIMP_DISPLAY_SHELL_DRAW_H__ */
Index: gimp/app/display/gimpdisplayshell-handlers.c
===================================================================
RCS file: /cvs/gnome/gimp/app/display/gimpdisplayshell-handlers.c,v
retrieving revision 1.49
diff -u -p -r1.49 gimpdisplayshell-handlers.c
--- gimp/app/display/gimpdisplayshell-handlers.c	10 Nov 2004 15:44:16 -0000	1.49
+++ gimp/app/display/gimpdisplayshell-handlers.c	3 Mar 2005 22:36:25 -0000
@@ -73,6 +73,9 @@ static void   gimp_display_shell_qmask_c
 static void   gimp_display_shell_update_guide_handler       (GimpImage        *gimage,
                                                              GimpGuide        *guide,
                                                              GimpDisplayShell *shell);
+static void   gimp_display_shell_update_sample_point_handler(GimpImage        *gimage,
+                                                             GimpSamplePoint  *sample_point,
+                                                             GimpDisplayShell *shell);
 static void   gimp_display_shell_invalidate_preview_handler (GimpImage        *gimage,
                                                              GimpDisplayShell *shell);
 
@@ -157,6 +160,9 @@ gimp_display_shell_connect (GimpDisplayS
   g_signal_connect (gimage, "update_guide",
                     G_CALLBACK (gimp_display_shell_update_guide_handler),
                     shell);
+  g_signal_connect (gimage, "update_sample_point",
+                    G_CALLBACK (gimp_display_shell_update_sample_point_handler),
+                    shell);
   g_signal_connect (gimage, "invalidate_preview",
                     G_CALLBACK (gimp_display_shell_invalidate_preview_handler),
                     shell);
@@ -310,6 +316,9 @@ gimp_display_shell_disconnect (GimpDispl
                                         gimp_display_shell_update_guide_handler,
                                         shell);
   g_signal_handlers_disconnect_by_func (gimage,
+                                        gimp_display_shell_update_sample_point_handler,
+                                        shell);
+  g_signal_handlers_disconnect_by_func (gimage,
                                         gimp_display_shell_qmask_changed_handler,
                                         shell);
   g_signal_handlers_disconnect_by_func (gimage,
@@ -442,6 +451,14 @@ gimp_display_shell_update_guide_handler 
                                          GimpDisplayShell *shell)
 {
   gimp_display_shell_expose_guide (shell, guide);
+}
+
+static void
+gimp_display_shell_update_sample_point_handler (GimpImage        *gimage,
+                                                GimpSamplePoint  *sample_point,
+                                                GimpDisplayShell *shell)
+{
+  gimp_display_shell_expose_sample_point (shell, sample_point);
 }
 
 static void
Index: gimp/app/display/gimpdisplayshell.c
===================================================================
RCS file: /cvs/gnome/gimp/app/display/gimpdisplayshell.c,v
retrieving revision 1.353
diff -u -p -r1.353 gimpdisplayshell.c
--- gimp/app/display/gimpdisplayshell.c	21 Feb 2005 00:45:16 -0000	1.353
+++ gimp/app/display/gimpdisplayshell.c	3 Mar 2005 22:36:25 -0000
@@ -37,6 +37,7 @@
 #include "core/gimpcontext.h"
 #include "core/gimpimage.h"
 #include "core/gimpimage-guides.h"
+#include "core/gimpimage-samplepoints.h"
 #include "core/gimpimage-snap.h"
 #include "core/gimpmarshal.h"
 
@@ -1261,6 +1262,33 @@ gimp_display_shell_expose_guide (GimpDis
     default:
       break;
     }
+}
+
+void
+gimp_display_shell_expose_sample_point (GimpDisplayShell *shell,
+                                        GimpSamplePoint  *sample_point)
+{
+  gint x, y;
+  gint xmin, xmax, ymin, ymax;
+
+  g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
+  g_return_if_fail (sample_point != NULL);
+
+  if (sample_point->x < 0)
+    return;
+
+  gimp_display_shell_transform_xy (shell,
+                                   sample_point->x,
+                                   sample_point->y,
+                                   &x, &y,
+                                   FALSE);
+
+  xmin = MAX (0, x - GIMP_SAMPLE_POINT_DRAW_SIZE);
+  xmax = MIN (shell->disp_width, x + GIMP_SAMPLE_POINT_DRAW_SIZE);
+  ymin = MAX (0, y - GIMP_SAMPLE_POINT_DRAW_SIZE);
+  ymax = MIN (shell->disp_height, y + GIMP_SAMPLE_POINT_DRAW_SIZE);
+
+  gimp_display_shell_expose_area (shell, xmin, ymin, xmax, ymax);
 }
 
 void
Index: gimp/app/display/gimpdisplayshell.h
===================================================================
RCS file: /cvs/gnome/gimp/app/display/gimpdisplayshell.h,v
retrieving revision 1.88
diff -u -p -r1.88 gimpdisplayshell.h
--- gimp/app/display/gimpdisplayshell.h	3 Jan 2005 16:19:09 -0000	1.88
+++ gimp/app/display/gimpdisplayshell.h	3 Mar 2005 22:36:25 -0000
@@ -221,6 +221,8 @@ void        gimp_display_shell_expose_ar
                                                       gint              h);
 void        gimp_display_shell_expose_guide          (GimpDisplayShell *shell,
                                                       GimpGuide        *guide);
+void        gimp_display_shell_expose_sample_point   (GimpDisplayShell *shell,
+                                                      GimpSamplePoint  *sample_point);
 void        gimp_display_shell_expose_full           (GimpDisplayShell *shell);
 
 void        gimp_display_shell_flush                 (GimpDisplayShell *shell,
Index: gimp/app/tools/gimpimagemaptool.c
===================================================================
RCS file: /cvs/gnome/gimp/app/tools/gimpimagemaptool.c,v
retrieving revision 1.59
diff -u -p -r1.59 gimpimagemaptool.c
--- gimp/app/tools/gimpimagemaptool.c	10 Feb 2005 11:00:45 -0000	1.59
+++ gimp/app/tools/gimpimagemaptool.c	3 Mar 2005 22:36:25 -0000
@@ -34,6 +34,7 @@
 #include "core/gimpdrawable.h"
 #include "core/gimpimage.h"
 #include "core/gimpimage-pick-color.h"
+#include "core/gimpimage-samplepoints.h"
 #include "core/gimpimagemap.h"
 #include "core/gimppickable.h"
 #include "core/gimpprojection.h"
@@ -51,6 +52,17 @@
 
 #include "gimp-intl.h"
 
+typedef struct
+{
+  GimpSamplePoint  *sample_point;
+  GimpRGB          *color;
+  GtkWidget        *vbox;
+  GtkWidget        *color_area;
+  GtkWidget        *r_label;
+  GtkWidget        *g_label;
+  GtkWidget        *b_label;
+  gint              index;
+} ColorSample;
 
 /*  local function prototypes  */
 
@@ -64,6 +76,11 @@ static gboolean gimp_image_map_tool_init
 static void     gimp_image_map_tool_control    (GimpTool         *tool,
                                                 GimpToolAction    action,
                                                 GimpDisplay      *gdisp);
+static void gimp_image_map_tool_button_press   (GimpTool         *tool,
+                                                GimpCoords       *coords,
+                                                guint32           time,
+                                                GdkModifierType   state,
+                                                GimpDisplay      *gdisp);
 static gboolean gimp_image_map_tool_key_press  (GimpTool         *tool,
                                                 GdkEventKey      *kevent,
                                                 GimpDisplay      *gdisp);
@@ -100,10 +117,18 @@ static void    gimp_image_map_tool_setti
                                                       const gchar      *title,
                                                       gboolean          save);
 
-static void     gimp_image_map_tool_notify_preview (GObject          *config,
-                                                    GParamSpec       *pspec,
-                                                    GimpImageMapTool *image_map_tool);
-
+static void     gimp_image_map_tool_notify_preview   (GObject          *config,
+                                                      GParamSpec       *pspec,
+                                                      GimpImageMapTool *image_map_tool);
+static void gimp_image_map_tool_update_color_samples (GimpImageMapTool *tool);
+static gboolean gimp_image_map_tool_idle_update_color_samples (GimpImageMapTool *tool);
+static void gimp_image_map_tool_update_color_sample  (GimpImageMapTool *image_map_tool,
+                                                      ColorSample      *color_sample);
+static void gimp_image_map_tool_add_color_sample     (GimpImageMapTool *image_map_tool,
+                                                      GimpSamplePoint  *sample_point);
+static void gimp_image_map_tool_delete_color_sample  (GimpImageMapTool *image_map_tool,
+                                                      ColorSample      *color_sample);
+static void gimp_image_map_tool_delete_color_samples (GimpImageMapTool *image_map_tool);
 
 static GimpToolClass *parent_class = NULL;
 
@@ -149,6 +174,7 @@ gimp_image_map_tool_class_init (GimpImag
 
   tool_class->initialize = gimp_image_map_tool_initialize;
   tool_class->control    = gimp_image_map_tool_control;
+  tool_class->button_press = gimp_image_map_tool_button_press;
   tool_class->key_press  = gimp_image_map_tool_key_press;
 
   color_tool_class->pick = gimp_image_map_tool_pick_color;
@@ -187,6 +213,7 @@ gimp_image_map_tool_init (GimpImageMapTo
   image_map_tool->main_vbox   = NULL;
   image_map_tool->load_button = NULL;
   image_map_tool->save_button = NULL;
+  image_map_tool->idle_id     = 0;
 }
 
 static void
@@ -196,6 +223,7 @@ gimp_image_map_tool_finalize (GObject *o
 
   if (image_map_tool->shell)
     {
+      gimp_image_map_tool_delete_color_samples (image_map_tool);
       gtk_widget_destroy (image_map_tool->shell);
       image_map_tool->shell       = NULL;
       image_map_tool->main_vbox   = NULL;
@@ -221,12 +249,16 @@ gimp_image_map_tool_initialize (GimpTool
   /*  set gdisp so the dialog can be hidden on display destruction  */
   tool->gdisp = gdisp;
 
+  drawable = gimp_image_active_drawable (gdisp->gimage);
+
   if (! image_map_tool->shell)
     {
       GimpImageMapToolClass *klass;
       GtkWidget             *shell;
       GtkWidget             *vbox;
       GtkWidget             *toggle;
+      GtkWidget             *frame;
+      GtkWidget             *hbox;
       const gchar           *stock_id;
 
       klass = GIMP_IMAGE_MAP_TOOL_GET_CLASS (image_map_tool);
@@ -250,7 +282,6 @@ gimp_image_map_tool_initialize (GimpTool
                                                 GTK_RESPONSE_CANCEL,
                                                 -1);
 
-
       g_signal_connect_object (shell, "response",
                                G_CALLBACK (gimp_image_map_tool_response),
                                G_OBJECT (image_map_tool), 0);
@@ -272,6 +303,41 @@ gimp_image_map_tool_initialize (GimpTool
                                G_CALLBACK (gimp_image_map_tool_notify_preview),
                                image_map_tool, 0);
 
+      /*  Frame for color samples */
+      frame = gimp_frame_new ("Color Samples");
+      gtk_box_pack_end (GTK_BOX (image_map_tool->main_vbox), frame,
+                        FALSE, FALSE, 0);
+      gtk_widget_show (frame);
+
+      image_map_tool->color_sample_hbox = hbox = gtk_hbox_new (FALSE, 0);
+      gtk_container_add (GTK_CONTAINER (frame), hbox);
+      gtk_widget_show (hbox);
+
+      image_map_tool->sample_hint = NULL;
+      image_map_tool->color_samples = NULL;
+
+      if (!gdisp->gimage->sample_points)
+        {
+          GtkWidget  *label;
+
+          label = gtk_label_new (_("Ctrl-click on the image to add sample points"));
+          gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
+          gtk_widget_show (label);
+          image_map_tool->sample_hint = label;
+        }
+      else
+        {
+          GList           *list;
+          GimpSamplePoint *sample_point;
+
+          for (list = gdisp->gimage->sample_points; list; list = g_list_next (list))
+            {
+              sample_point = (GimpSamplePoint *) list->data;
+
+              gimp_image_map_tool_add_color_sample (image_map_tool, sample_point);
+            }
+        }
+
       if (klass->load_dialog_title)
         {
           image_map_tool->load_button =
@@ -338,8 +404,6 @@ gimp_image_map_tool_initialize (GimpTool
       gtk_widget_show (vbox);
     }
 
-  drawable = gimp_image_active_drawable (gdisp->gimage);
-
   gimp_viewable_dialog_set_viewable (GIMP_VIEWABLE_DIALOG (image_map_tool->shell),
                                      GIMP_VIEWABLE (drawable));
 
@@ -377,6 +441,30 @@ gimp_image_map_tool_control (GimpTool   
   GIMP_TOOL_CLASS (parent_class)->control (tool, action, gdisp);
 }
 
+static void
+gimp_image_map_tool_button_press (GimpTool        *tool,
+                                  GimpCoords      *coords,
+                                  guint32          time,
+                                  GdkModifierType  state,
+                                  GimpDisplay     *gdisp)
+{
+  GimpImageMapTool *image_map_tool = GIMP_IMAGE_MAP_TOOL (tool);
+
+  if (state & GDK_CONTROL_MASK)
+    {
+      GimpSamplePoint *sample_point;
+
+      sample_point = gimp_image_add_sample_point_at_pos (gdisp->gimage,
+                                                         coords->x, coords->y,
+                                                         TRUE);
+
+      gimp_image_map_tool_add_color_sample (image_map_tool, sample_point);
+    }
+
+  GIMP_TOOL_CLASS (parent_class)->button_press (tool, coords, time, state, gdisp);
+}
+
+
 static gboolean
 gimp_image_map_tool_key_press (GimpTool    *tool,
                                GdkEventKey *kevent,
@@ -561,6 +649,8 @@ gimp_image_map_tool_notify_preview (GObj
 
       gimp_image_map_tool_map (image_map_tool);
 
+      gimp_image_map_tool_update_color_samples (image_map_tool);
+
       gimp_tool_control_set_preserve (tool->control, FALSE);
     }
   else
@@ -596,6 +686,8 @@ gimp_image_map_tool_preview (GimpImageMa
 
       gimp_image_map_tool_map (image_map_tool);
 
+      gimp_image_map_tool_update_color_samples (image_map_tool);
+
       gimp_tool_control_set_preserve (tool->control, FALSE);
     }
 }
@@ -803,4 +895,133 @@ gimp_image_map_tool_settings_dialog (Gim
                      GIMP_TOOL (tool)->tool_info->help_id, NULL);
 
   gtk_widget_show (tool->settings_dialog);
+}
+
+static void
+gimp_image_map_tool_update_color_samples (GimpImageMapTool *image_map_tool)
+{
+  if (image_map_tool->idle_id)
+    g_source_remove (image_map_tool->idle_id);
+
+  image_map_tool->idle_id
+    = g_idle_add_full (G_PRIORITY_LOW,
+                       (GSourceFunc) gimp_image_map_tool_idle_update_color_samples,
+                       image_map_tool,
+                       (GDestroyNotify) NULL);
+}
+
+static gboolean
+gimp_image_map_tool_idle_update_color_samples (GimpImageMapTool *image_map_tool)
+{
+  ColorSample     *color_sample;
+  GList           *list;
+
+  image_map_tool->idle_id = 0;
+
+  for (list = image_map_tool->color_samples; list; list = g_list_next (list))
+    {
+      color_sample = (ColorSample *)list->data;
+
+      gimp_image_map_tool_update_color_sample (image_map_tool, color_sample);
+    }
+
+  return FALSE;
+}
+
+static void
+gimp_image_map_tool_update_color_sample (GimpImageMapTool *image_map_tool,
+                                         ColorSample      *color_sample)
+{
+  GimpDisplay  *gdisp = GIMP_TOOL (image_map_tool)->gdisp;
+  gchar         color_str[10];
+
+  gimp_pickable_pick_color (GIMP_PICKABLE (gdisp->gimage->projection),
+                            color_sample->sample_point->x,
+                            color_sample->sample_point->y,
+                            FALSE, 0,
+                            color_sample->color,
+                            &color_sample->index);
+
+  gimp_color_area_set_color (GIMP_COLOR_AREA (color_sample->color_area),
+                             color_sample->color);
+
+  sprintf (color_str, "%d", (gint) (256 * color_sample->color->r));
+  gtk_label_set_text (GTK_LABEL (color_sample->r_label), color_str);
+
+  sprintf (color_str, "%d", (gint) (256 * color_sample->color->g));
+  gtk_label_set_text (GTK_LABEL (color_sample->g_label), color_str);
+
+  sprintf (color_str, "%d", (gint) (256 * color_sample->color->b));
+  gtk_label_set_text (GTK_LABEL (color_sample->b_label), color_str);
+}
+
+static void
+gimp_image_map_tool_add_color_sample (GimpImageMapTool *image_map_tool,
+                                      GimpSamplePoint  *sample_point)
+{
+  ColorSample  *color_sample = g_new0 (ColorSample, 1);
+  GtkWidget    *hbox         = image_map_tool->color_sample_hbox;
+  GtkWidget    *vbox;
+  GimpRGB      *color;
+
+  if (image_map_tool->sample_hint)
+    {
+      gtk_widget_destroy (image_map_tool->sample_hint);
+      image_map_tool->sample_hint = NULL;
+    }
+
+  vbox = color_sample->vbox = gtk_vbox_new (FALSE, 0);
+  gtk_box_pack_start (GTK_BOX (hbox), vbox, FALSE, FALSE, 10);
+
+  color_sample->sample_point = sample_point;
+
+  color_sample->color = color = g_new0 (GimpRGB, 1);
+
+  color_sample->color_area = gimp_color_area_new (color, GIMP_COLOR_AREA_FLAT, 0);
+  gtk_widget_set_size_request (color_sample->color_area, 30, 20);
+
+  image_map_tool->color_samples = g_list_append (image_map_tool->color_samples,
+                                                 color_sample);
+  gtk_box_pack_start (GTK_BOX (vbox), color_sample->color_area, FALSE, FALSE, 0);
+  gtk_widget_show (color_sample->color_area);
+
+  color_sample->r_label = gtk_label_new ("000");
+  gtk_box_pack_start (GTK_BOX (vbox), color_sample->r_label, FALSE, FALSE, 0);
+  gtk_widget_show (color_sample->r_label);
+
+  color_sample->g_label = gtk_label_new ("000");
+  gtk_box_pack_start (GTK_BOX (vbox), color_sample->g_label, FALSE, FALSE, 0);
+  gtk_widget_show (color_sample->g_label);
+
+  color_sample->b_label = gtk_label_new ("000");
+  gtk_box_pack_start (GTK_BOX (vbox), color_sample->b_label, FALSE, FALSE, 0);
+  gtk_widget_show (color_sample->b_label);
+
+  gimp_image_map_tool_update_color_sample (image_map_tool, color_sample);
+
+  gtk_widget_show (vbox);
+}
+
+static void
+gimp_image_map_tool_delete_color_sample (GimpImageMapTool *image_map_tool,
+                                         ColorSample      *color_sample)
+{
+  gtk_widget_destroy (color_sample->color_area);
+
+  g_free (color_sample->color);
+
+  g_free (color_sample);
+}
+
+static void
+gimp_image_map_tool_delete_color_samples (GimpImageMapTool *image_map_tool)
+{
+  GList *list = image_map_tool->color_samples;
+
+  while (list)
+    {
+      gimp_image_map_tool_delete_color_sample (image_map_tool,
+                                               (ColorSample *)list->data);
+      list = g_list_remove (list, list->data);
+    }
 }
Index: gimp/app/tools/gimpimagemaptool.h
===================================================================
RCS file: /cvs/gnome/gimp/app/tools/gimpimagemaptool.h,v
retrieving revision 1.18
diff -u -p -r1.18 gimpimagemaptool.h
--- gimp/app/tools/gimpimagemaptool.h	22 Oct 2004 19:44:03 -0000	1.18
+++ gimp/app/tools/gimpimagemaptool.h	3 Mar 2005 22:36:25 -0000
@@ -48,6 +48,12 @@ struct _GimpImageMapTool
 
   /* settings file dialog */
   GtkWidget     *settings_dialog;
+  GtkWidget     *sample_hint;
+  GtkWidget     *color_sample_hbox;
+
+  GList         *color_samples;
+
+  guint32        idle_id;
 };
 
 struct _GimpImageMapToolClass
Index: gimp/app/widgets/gimphelp-ids.h
===================================================================
RCS file: /cvs/gnome/gimp/app/widgets/gimphelp-ids.h,v
retrieving revision 1.56
diff -u -p -r1.56 gimphelp-ids.h
--- gimp/app/widgets/gimphelp-ids.h	21 Feb 2005 02:56:27 -0000	1.56
+++ gimp/app/widgets/gimphelp-ids.h	3 Mar 2005 22:36:25 -0000
@@ -80,6 +80,7 @@
 #define GIMP_HELP_VIEW_SHOW_LAYER_BOUNDARY        "gimp-view-show-layer-boundary"
 #define GIMP_HELP_VIEW_SHOW_GUIDES                "gimp-view-show-guides"
 #define GIMP_HELP_VIEW_SNAP_TO_GUIDES             "gimp-view-snap-to-guides"
+#define GIMP_HELP_VIEW_SHOW_SAMPLE_POINTS         "gimp-view-show-sample-points"
 #define GIMP_HELP_VIEW_SHOW_GRID                  "gimp-view-show-grid"
 #define GIMP_HELP_VIEW_SNAP_TO_GRID               "gimp-view-snap-to-grid"
 #define GIMP_HELP_VIEW_SNAP_TO_CANVAS             "gimp-view-snap-to-canvas"
Index: gimp/menus/image-menu.xml.in
===================================================================
RCS file: /cvs/gnome/gimp/menus/image-menu.xml.in,v
retrieving revision 1.37
diff -u -p -r1.37 image-menu.xml.in
--- gimp/menus/image-menu.xml.in	28 Jan 2005 19:48:31 -0000	1.37
+++ gimp/menus/image-menu.xml.in	3 Mar 2005 22:36:25 -0000
@@ -238,6 +238,7 @@
       <menuitem action="view-show-selection" />
       <menuitem action="view-show-layer-boundary" />
       <menuitem action="view-show-guides" />
+      <menuitem action="view-show-sample-points" />
       <menuitem action="view-show-grid" />
       <separator />
       <menuitem action="view-snap-to-guides" />
