gimp r26247 - in branches/soc-2008-tagging: . app app/core app/display app/gui app/paint app/pdb app/plug-in app/tools app/vectors app/widgets app/xcf devel-docs devel-docs/libgimp devel-docs/libgimp/tmpl devel-docs/libgimpbase/tmpl docs etc libgimp libgimpbase plug-ins/help-browser plug-ins/pygimp plug-ins/script-fu po po-libgimp po-plug-ins po-python po-script-fu po-tips tools/pdbgen tools/pdbgen/pdb



Author: aurisj
Date: Sun Jul 20 16:34:08 2008
New Revision: 26247
URL: http://svn.gnome.org/viewvc/gimp?rev=26247&view=rev

Log:
Merged from trunk revisions 26170:26246.

Added:
   branches/soc-2008-tagging/app/gui/dbus-service.xml
      - copied unchanged from r26246, /trunk/app/gui/dbus-service.xml
   branches/soc-2008-tagging/app/gui/gimpdbusservice.c
      - copied unchanged from r26246, /trunk/app/gui/gimpdbusservice.c
   branches/soc-2008-tagging/app/gui/gimpdbusservice.h
      - copied unchanged from r26246, /trunk/app/gui/gimpdbusservice.h
Removed:
   branches/soc-2008-tagging/app/widgets/dbus-service.xml
   branches/soc-2008-tagging/app/widgets/gimpdbusservice.c
   branches/soc-2008-tagging/app/widgets/gimpdbusservice.h
Modified:
   branches/soc-2008-tagging/ChangeLog
   branches/soc-2008-tagging/NEWS
   branches/soc-2008-tagging/app/Makefile.am
   branches/soc-2008-tagging/app/core/core-types.h
   branches/soc-2008-tagging/app/core/gimpcoords.c
   branches/soc-2008-tagging/app/display/gimpdisplayshell-coords.c
   branches/soc-2008-tagging/app/display/gimpdisplayshell-scale.c
   branches/soc-2008-tagging/app/display/gimpdisplayshell-scale.h
   branches/soc-2008-tagging/app/display/gimpdisplayshell-scroll.c
   branches/soc-2008-tagging/app/display/gimpdisplayshell.c
   branches/soc-2008-tagging/app/display/gimpdisplayshell.h
   branches/soc-2008-tagging/app/display/gimpnavigationeditor.c
   branches/soc-2008-tagging/app/gui/   (props changed)
   branches/soc-2008-tagging/app/gui/Makefile.am
   branches/soc-2008-tagging/app/gui/gui-unique.c
   branches/soc-2008-tagging/app/paint/gimpairbrush.c
   branches/soc-2008-tagging/app/paint/gimpbrushcore.c
   branches/soc-2008-tagging/app/paint/gimpclone.c
   branches/soc-2008-tagging/app/paint/gimpconvolve.c
   branches/soc-2008-tagging/app/paint/gimpdodgeburn.c
   branches/soc-2008-tagging/app/paint/gimperaser.c
   branches/soc-2008-tagging/app/paint/gimpheal.c
   branches/soc-2008-tagging/app/paint/gimppaintbrush.c
   branches/soc-2008-tagging/app/paint/gimppaintcore.c
   branches/soc-2008-tagging/app/paint/gimppaintcore.h
   branches/soc-2008-tagging/app/paint/gimppaintoptions.c
   branches/soc-2008-tagging/app/paint/gimppaintoptions.h
   branches/soc-2008-tagging/app/paint/gimpsmudge.c
   branches/soc-2008-tagging/app/pdb/edit-cmds.c
   branches/soc-2008-tagging/app/pdb/gimp-pdb-compat.c
   branches/soc-2008-tagging/app/pdb/internal-procs.c
   branches/soc-2008-tagging/app/pdb/palette-cmds.c
   branches/soc-2008-tagging/app/plug-in/gimpplugin-message.c
   branches/soc-2008-tagging/app/plug-in/plug-in-params.c
   branches/soc-2008-tagging/app/tools/gimpcolorizetool.c
   branches/soc-2008-tagging/app/tools/gimppainttool.c
   branches/soc-2008-tagging/app/unique.c
   branches/soc-2008-tagging/app/vectors/gimpbezierstroke.c
   branches/soc-2008-tagging/app/widgets/   (props changed)
   branches/soc-2008-tagging/app/widgets/Makefile.am
   branches/soc-2008-tagging/app/widgets/gimpcontrollerkeyboard.c
   branches/soc-2008-tagging/app/widgets/gimpgradientselect.c
   branches/soc-2008-tagging/app/widgets/gimpnavigationview.c
   branches/soc-2008-tagging/app/widgets/gimpnavigationview.h
   branches/soc-2008-tagging/app/xcf/xcf-load.c
   branches/soc-2008-tagging/configure.in
   branches/soc-2008-tagging/devel-docs/ChangeLog
   branches/soc-2008-tagging/devel-docs/libgimp/libgimp-sections.txt
   branches/soc-2008-tagging/devel-docs/libgimp/tmpl/gimppalette.sgml
   branches/soc-2008-tagging/devel-docs/libgimpbase/tmpl/gimpbaseenums.sgml
   branches/soc-2008-tagging/docs/gimprc.5.in
   branches/soc-2008-tagging/etc/controllerrc
   branches/soc-2008-tagging/etc/gimprc
   branches/soc-2008-tagging/libgimp/gimp.c
   branches/soc-2008-tagging/libgimp/gimp.def
   branches/soc-2008-tagging/libgimp/gimp.h
   branches/soc-2008-tagging/libgimp/gimpedit_pdb.c
   branches/soc-2008-tagging/libgimp/gimppalette_pdb.c
   branches/soc-2008-tagging/libgimp/gimppalette_pdb.h
   branches/soc-2008-tagging/libgimp/gimpui.c
   branches/soc-2008-tagging/libgimpbase/gimpbaseenums.c
   branches/soc-2008-tagging/libgimpbase/gimpbaseenums.h
   branches/soc-2008-tagging/libgimpbase/gimpprotocol.c
   branches/soc-2008-tagging/libgimpbase/gimpprotocol.h
   branches/soc-2008-tagging/plug-ins/help-browser/dialog.c
   branches/soc-2008-tagging/plug-ins/pygimp/pygimp-pdb.c
   branches/soc-2008-tagging/plug-ins/script-fu/scheme-wrapper.c
   branches/soc-2008-tagging/po-libgimp/ChangeLog
   branches/soc-2008-tagging/po-libgimp/es.po
   branches/soc-2008-tagging/po-libgimp/lt.po
   branches/soc-2008-tagging/po-plug-ins/ChangeLog
   branches/soc-2008-tagging/po-plug-ins/de.po
   branches/soc-2008-tagging/po-plug-ins/es.po
   branches/soc-2008-tagging/po-plug-ins/lt.po
   branches/soc-2008-tagging/po-python/ChangeLog
   branches/soc-2008-tagging/po-python/es.po
   branches/soc-2008-tagging/po-python/lt.po
   branches/soc-2008-tagging/po-python/nn.po
   branches/soc-2008-tagging/po-script-fu/ChangeLog
   branches/soc-2008-tagging/po-script-fu/es.po
   branches/soc-2008-tagging/po-script-fu/lt.po
   branches/soc-2008-tagging/po-tips/ChangeLog
   branches/soc-2008-tagging/po-tips/nn.po
   branches/soc-2008-tagging/po/ChangeLog
   branches/soc-2008-tagging/po/es.po
   branches/soc-2008-tagging/po/lt.po
   branches/soc-2008-tagging/po/sv.po
   branches/soc-2008-tagging/tools/pdbgen/app.pl
   branches/soc-2008-tagging/tools/pdbgen/enums.pl
   branches/soc-2008-tagging/tools/pdbgen/pdb.pl
   branches/soc-2008-tagging/tools/pdbgen/pdb/edit.pdb
   branches/soc-2008-tagging/tools/pdbgen/pdb/palette.pdb

Modified: branches/soc-2008-tagging/NEWS
==============================================================================
--- branches/soc-2008-tagging/NEWS	(original)
+++ branches/soc-2008-tagging/NEWS	Sun Jul 20 16:34:08 2008
@@ -19,13 +19,18 @@
  - allow to map dynamics to hardness for the Eraser tool
  - provide gimp-remote functionality on Windows
  - disable the build and install of the gimp-remote tool by default
+ - allow to scroll beyond the image borders
+ - added new PDB data type for transferring color arrays
+ - added new PDB function gimp-palette-get-colors
+ - added text search to the Help Browser plug-in
  - bug fixes and code cleanup
 
 
 Contributors:
 
   Sven Neumann, Michael Natterer, Martin Nordholts, Manish Singh,
-  Lars-Peter Clausen, Alexia Death, Tor Lillqvist, Jakub Steiner
+  Lars-Peter Clausen, Alexia Death, Tor Lillqvist, RÃman Joost,
+  Jakub Steiner
 
 
 Changes in GIMP 2.5.1

Modified: branches/soc-2008-tagging/app/Makefile.am
==============================================================================
--- branches/soc-2008-tagging/app/Makefile.am	(original)
+++ branches/soc-2008-tagging/app/Makefile.am	Sun Jul 20 16:34:08 2008
@@ -69,7 +69,7 @@
 	wilber.ico
 
 if OS_WIN32
-mwindows = -mwindows
+win32_ldflags = -mwindows -Wl,--large-address-aware
 endif
 
 if USE_BINRELOC
@@ -102,7 +102,7 @@
 	-u $(SYMPREFIX)gimp_image_map_config_get_type	\
 	-u $(SYMPREFIX)gimp_plug_in_manager_restore
 
-gimp_2_5_LDFLAGS = $(AM_LDFLAGS) $(mwindows) 
+gimp_2_5_LDFLAGS = $(AM_LDFLAGS) $(win32_ldflags) 
 
 gimp_2_5_LDADD = \
 	gui/libappgui.a			\

Modified: branches/soc-2008-tagging/app/core/core-types.h
==============================================================================
--- branches/soc-2008-tagging/app/core/core-types.h	(original)
+++ branches/soc-2008-tagging/app/core/core-types.h	Sun Jul 20 16:34:08 2008
@@ -45,11 +45,14 @@
 #define GIMP_COORDS_MAX_WHEEL         1.0
 #define GIMP_COORDS_DEFAULT_WHEEL     0.5
 
-#define GIMP_COORDS_DEFAULT_VALUES  { 0.0, 0.0, \
-                                      GIMP_COORDS_DEFAULT_PRESSURE, \
-                                      GIMP_COORDS_DEFAULT_TILT,     \
-                                      GIMP_COORDS_DEFAULT_TILT,     \
-                                      GIMP_COORDS_DEFAULT_WHEEL }
+#define GIMP_COORDS_DEFAULT_VELOCITY  0.0
+
+#define GIMP_COORDS_DEFAULT_VALUES    { 0.0, 0.0, \
+                                        GIMP_COORDS_DEFAULT_PRESSURE, \
+                                        GIMP_COORDS_DEFAULT_TILT,     \
+                                        GIMP_COORDS_DEFAULT_TILT,     \
+                                        GIMP_COORDS_DEFAULT_WHEEL,    \
+                                        GIMP_COORDS_DEFAULT_VELOCITY }
 
 
 /*  base classes  */
@@ -201,12 +204,7 @@
   gdouble xtilt;
   gdouble ytilt;
   gdouble wheel;
-  gdouble delta_time;
-  gdouble delta_x;
-  gdouble delta_y;
-  gdouble distance;
   gdouble velocity;
-  gdouble random;
 };
 
 

Modified: branches/soc-2008-tagging/app/core/gimpcoords.c
==============================================================================
--- branches/soc-2008-tagging/app/core/gimpcoords.c	(original)
+++ branches/soc-2008-tagging/app/core/gimpcoords.c	Sun Jul 20 16:34:08 2008
@@ -44,12 +44,13 @@
 {
   if (b)
     {
-      ret_val->x        = amul * a->x        + bmul * b->x ;
-      ret_val->y        = amul * a->y        + bmul * b->y ;
-      ret_val->pressure = amul * a->pressure + bmul * b->pressure ;
-      ret_val->xtilt    = amul * a->xtilt    + bmul * b->xtilt ;
-      ret_val->ytilt    = amul * a->ytilt    + bmul * b->ytilt ;
-      ret_val->wheel    = amul * a->wheel    + bmul * b->wheel ;
+      ret_val->x        = amul * a->x        + bmul * b->x;
+      ret_val->y        = amul * a->y        + bmul * b->y;
+      ret_val->pressure = amul * a->pressure + bmul * b->pressure;
+      ret_val->xtilt    = amul * a->xtilt    + bmul * b->xtilt;
+      ret_val->ytilt    = amul * a->ytilt    + bmul * b->ytilt;
+      ret_val->wheel    = amul * a->wheel    + bmul * b->wheel;
+      ret_val->velocity = amul * a->velocity + bmul * b->velocity;
     }
   else
     {
@@ -59,6 +60,7 @@
       ret_val->xtilt    = amul * a->xtilt;
       ret_val->ytilt    = amul * a->ytilt;
       ret_val->wheel    = amul * a->wheel;
+      ret_val->velocity = amul * a->velocity;
     }
 }
 
@@ -118,7 +120,7 @@
           a->pressure * b->pressure +
           a->xtilt    * b->xtilt    +
           a->ytilt    * b->ytilt    +
-          a->wheel    * b->wheel   );
+          a->wheel    * b->wheel);
 }
 
 

Modified: branches/soc-2008-tagging/app/display/gimpdisplayshell-coords.c
==============================================================================
--- branches/soc-2008-tagging/app/display/gimpdisplayshell-coords.c	(original)
+++ branches/soc-2008-tagging/app/display/gimpdisplayshell-coords.c	Sun Jul 20 16:34:08 2008
@@ -213,6 +213,11 @@
 			       gdouble           inertia_factor,
 			       guint32           time)
 {
+  gdouble delta_time = 0.001;
+  gdouble delta_x    = 0.0;
+  gdouble delta_y    = 0.0;
+  gdouble distance   = 1.0;
+
   /* Smoothing causes problems with cursor tracking
    * when zoomed above screen resolution so we need to supress it.
    */
@@ -221,22 +226,21 @@
       inertia_factor = 0.0;
     }
 
-  if (shell->last_disp_motion_time == 0)
+  if (shell->last_motion_time == 0)
     {
       /* First pair is invalid to do any velocity calculation,
-       * so we apply constant values.
+       * so we apply a constant value.
        */
-      coords->velocity   = 1.0;
-      coords->delta_time = 0.001;
-      coords->distance   = 1;
+      coords->velocity = 1.0;
     }
   else
     {
-      gdouble dx = coords->delta_x = shell->last_coords.x - coords->x;
-      gdouble dy = coords->delta_y = shell->last_coords.y - coords->y;
       gdouble filter;
       gdouble dist;
 
+      delta_x = shell->last_coords.x - coords->x;
+      delta_y = shell->last_coords.y - coords->y;
+
 #define SMOOTH_FACTOR 0.3
 
       /* Events with distances less than the screen resolution are not
@@ -244,20 +248,18 @@
        */
       filter = MIN (1 / shell->scale_x, 1 / shell->scale_y) / 2.0;
 
-      if (fabs (dx) < filter && fabs (dy) < filter)
+      if (fabs (delta_x) < filter && fabs (delta_y) < filter)
         return FALSE;
 
-      coords->delta_time = time - shell->last_disp_motion_time;
-      coords->delta_time = (shell->last_coords.delta_time * (1 - SMOOTH_FACTOR)
-                            + coords->delta_time * SMOOTH_FACTOR);
-      coords->distance = dist = sqrt (SQR (dx) + SQR (dy));
+      delta_time = (shell->last_motion_delta_time * (1 - SMOOTH_FACTOR)
+                    +  (time - shell->last_motion_time) * SMOOTH_FACTOR);
 
-      coords->random = g_random_double_range (0.0, 1.0);
+      distance = dist = sqrt (SQR (delta_x) + SQR (delta_y));
 
       /* If even smoothed time resolution does not allow to guess for speed,
        * use last velocity.
        */
-      if ((coords->delta_time == 0))
+      if (delta_time == 0)
         {
           coords->velocity = shell->last_coords.velocity;
         }
@@ -266,14 +268,13 @@
           /* We need to calculate the velocity in screen coordinates
            * for human interaction
            */
-          gdouble screen_distance = (coords->distance *
+          gdouble screen_distance = (distance *
                                      MIN (shell->scale_x, shell->scale_y));
 
           /* Calculate raw valocity */
-          coords->velocity = ((screen_distance / (gdouble) coords->delta_time) /
-                              VELOCITY_UNIT);
+          coords->velocity = ((screen_distance / delta_time) / VELOCITY_UNIT);
 
-          /* Adding velocity dependent smooth, feels better in tools this way. */
+          /* Adding velocity dependent smoothing, feels better in tools. */
           coords->velocity = (shell->last_coords.velocity *
                               (1 - MIN (SMOOTH_FACTOR, coords->velocity)) +
                               coords->velocity *
@@ -282,10 +283,11 @@
           /* Speed needs upper limit */
           coords->velocity = MIN (coords->velocity, 1.0);
         }
+
       /* High speed -> less smooth*/
       inertia_factor *= (1 - coords->velocity);
 
-      if (inertia_factor > 0 && coords->distance > 0)
+      if (inertia_factor > 0 && distance > 0)
         {
           /* Apply smoothing to X and Y. */
 
@@ -301,23 +303,21 @@
           gdouble new_x;
           gdouble new_y;
 
-          sin_new = coords->delta_x / coords->distance;
-          sin_old = shell->last_coords.delta_x / shell->last_coords.distance;
+          sin_new = delta_x / distance;
+          sin_old = shell->last_motion_delta_x / shell->last_motion_distance;
           sin_avg = sin (asin (sin_old) * inertia_factor +
                          asin (sin_new) * (1 - inertia_factor));
 
-          cos_new = coords->delta_y / coords->distance;
-          cos_old = shell->last_coords.delta_y / shell->last_coords.distance;
+          cos_new = delta_y / distance;
+          cos_old = shell->last_motion_delta_y / shell->last_motion_distance;
           cos_avg = cos (acos (cos_old) * inertia_factor +
                          acos (cos_new) * (1 - inertia_factor));
 
-          coords->delta_x = sin_avg * coords->distance;
-          coords->delta_y = cos_avg * coords->distance;
+          delta_x = sin_avg * distance;
+          delta_y = cos_avg * distance;
 
-          new_x =
-            (shell->last_coords.x - coords->delta_x) * 0.5 + coords->x * 0.5;
-          new_y =
-            (shell->last_coords.y - coords->delta_y) * 0.5 + coords->y * 0.5;
+          new_x = (shell->last_coords.x - delta_x) * 0.5 + coords->x * 0.5;
+          new_y = (shell->last_coords.y - delta_y) * 0.5 + coords->y * 0.5;
 
           cur_deviation = SQR (coords->x - new_x) + SQR (coords->y - new_y);
 
@@ -333,18 +333,17 @@
           coords->x = new_x;
           coords->y = new_y;
 
-          coords->delta_x = shell->last_coords.x - coords->x;
-          coords->delta_y = shell->last_coords.y - coords->y;
+          delta_x = shell->last_coords.x - coords->x;
+          delta_y = shell->last_coords.y - coords->y;
 
           /* Recalculate distance */
-          coords->distance = sqrt (SQR (coords->delta_x) +
-                                   SQR (coords->delta_y));
+          distance = sqrt (SQR (delta_x) + SQR (delta_y));
         }
 
 #ifdef VERBOSE
       g_printerr ("DIST: %f, DT:%f, Vel:%f, Press:%f,smooth_dd:%f, sf %f\n",
-                  coords->distance,
-                  coords->delta_time,
+                  distance,
+                  delta_time,
                   shell->last_coords.velocity,
                   coords->pressure,
                   coords->distance - dist,
@@ -352,8 +351,13 @@
 #endif
     }
 
-  shell->last_coords           = *coords;
-  shell->last_disp_motion_time = time;
+  shell->last_coords            = *coords;
+
+  shell->last_motion_time       = time;
+  shell->last_motion_delta_time = delta_time;
+  shell->last_motion_delta_x    = delta_x;
+  shell->last_motion_delta_y    = delta_y;
+  shell->last_motion_distance   = distance;
 
   return TRUE;
 }

Modified: branches/soc-2008-tagging/app/display/gimpdisplayshell-scale.c
==============================================================================
--- branches/soc-2008-tagging/app/display/gimpdisplayshell-scale.c	(original)
+++ branches/soc-2008-tagging/app/display/gimpdisplayshell-scale.c	Sun Jul 20 16:34:08 2008
@@ -38,6 +38,7 @@
 
 #include "gimpdisplay.h"
 #include "gimpdisplayshell.h"
+#include "gimpdisplayshell-private.h"
 #include "gimpdisplayshell-scale.h"
 #include "gimpdisplayshell-scroll.h"
 #include "gimpdisplayshell-title.h"
@@ -161,11 +162,15 @@
 
     if (image)
       {
-        horizontal_upper    = img2real (shell, TRUE, FUNSCALEX (shell, shell->disp_width));
-        horizontal_max_size = img2real (shell, TRUE, MAX (image_width, image_height));
-
-        vertical_upper      = img2real (shell, FALSE, FUNSCALEY (shell, shell->disp_height));
-        vertical_max_size   = img2real (shell, FALSE, MAX (image_width, image_height));
+        horizontal_upper    = img2real (shell, TRUE,
+					FUNSCALEX (shell, shell->disp_width));
+        horizontal_max_size = img2real (shell, TRUE,
+					MAX (image_width, image_height));
+
+        vertical_upper      = img2real (shell, FALSE,
+					FUNSCALEY (shell, shell->disp_height));
+        vertical_max_size   = img2real (shell, FALSE,
+					MAX (image_width, image_height));
       }
     else
       {
@@ -184,14 +189,18 @@
                                                          &scaled_image_viewport_offset_y);
 
     horizontal_lower -= img2real (shell, TRUE,
-                                  FUNSCALEX (shell, (gdouble) scaled_image_viewport_offset_x));
+                                  FUNSCALEX (shell,
+					     (gdouble) scaled_image_viewport_offset_x));
     horizontal_upper -= img2real (shell, TRUE,
-                                  FUNSCALEX (shell, (gdouble) scaled_image_viewport_offset_x));
+                                  FUNSCALEX (shell,
+					     (gdouble) scaled_image_viewport_offset_x));
 
     vertical_lower   -= img2real (shell, FALSE,
-                                  FUNSCALEY (shell, (gdouble) scaled_image_viewport_offset_y));
+                                  FUNSCALEY (shell,
+					     (gdouble) scaled_image_viewport_offset_y));
     vertical_upper   -= img2real (shell, FALSE,
-                                  FUNSCALEY (shell, (gdouble) scaled_image_viewport_offset_y));
+                                  FUNSCALEY (shell,
+					     (gdouble) scaled_image_viewport_offset_y));
 
 
     /* Finally setup the actual rulers */
@@ -430,6 +439,7 @@
                      (gdouble) shell->disp_height / (gdouble) image_height);
 
   gimp_display_shell_scale (shell, GIMP_ZOOM_TO, zoom_factor);
+  gimp_display_shell_center_image (shell, TRUE, TRUE);
 }
 
 /**
@@ -468,6 +478,67 @@
                      (gdouble) shell->disp_height / (gdouble) image_height);
 
   gimp_display_shell_scale (shell, GIMP_ZOOM_TO, zoom_factor);
+  gimp_display_shell_center_image (shell, TRUE, TRUE);
+}
+
+/**
+ * gimp_display_shell_center_image:
+ * @shell:
+ * @horizontally:
+ * @vertically:
+ *
+ * Centers the image in the display shell on the desired axes.
+ *
+ **/
+void
+gimp_display_shell_center_image (GimpDisplayShell *shell,
+                                 gboolean          horizontally,
+                                 gboolean          vertically)
+{
+  gint sw, sh;
+  gint target_offset_x, target_offset_y;
+
+  g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
+
+  if (! shell->display)
+    return;
+
+  target_offset_x = shell->offset_x;
+  target_offset_y = shell->offset_y;
+
+  gimp_display_shell_get_scaled_image_size (shell, &sw, &sh);
+
+  if (horizontally)
+    {
+      if (sw < shell->disp_width)
+        {
+          target_offset_x = -(shell->disp_width - sw) / 2;
+        }
+      else
+        {
+          target_offset_x = (sw - shell->disp_width) / 2;
+        }
+    }
+
+  if (vertically)
+    {
+      if (sh < shell->disp_height)
+        {
+          target_offset_y = -(shell->disp_height - sh) / 2;
+        }
+      else
+        {
+          target_offset_y = (sh - shell->disp_height) / 2;
+        }
+    }
+
+  /* Note that we can't use gimp_display_shell_scroll_private() here
+   * because that would expose the image twice, causing unwanted
+   * flicker.
+   */
+  gimp_display_shell_scale_by_values (shell, gimp_zoom_model_get_factor (shell->zoom),
+                                      target_offset_x, target_offset_y,
+                                      shell->display->config->resize_windows_on_zoom);
 }
 
 /**

Modified: branches/soc-2008-tagging/app/display/gimpdisplayshell-scale.h
==============================================================================
--- branches/soc-2008-tagging/app/display/gimpdisplayshell-scale.h	(original)
+++ branches/soc-2008-tagging/app/display/gimpdisplayshell-scale.h	Sun Jul 20 16:34:08 2008
@@ -38,6 +38,9 @@
                                                  gdouble           y);
 void   gimp_display_shell_scale_fit_in          (GimpDisplayShell *shell);
 void   gimp_display_shell_scale_fill            (GimpDisplayShell *shell);
+void   gimp_display_shell_center_image          (GimpDisplayShell *shell,
+                                                 gboolean          horizontally,
+                                                 gboolean          vertically);
 void   gimp_display_shell_scale_by_values       (GimpDisplayShell *shell,
                                                  gdouble           scale,
                                                  gint              offset_x,

Modified: branches/soc-2008-tagging/app/display/gimpdisplayshell-scroll.c
==============================================================================
--- branches/soc-2008-tagging/app/display/gimpdisplayshell-scroll.c	(original)
+++ branches/soc-2008-tagging/app/display/gimpdisplayshell-scroll.c	Sun Jul 20 16:34:08 2008
@@ -166,6 +166,32 @@
           max_offset_y = sh + overpan_amount - shell->disp_height;
         }
 
+
+      /* Handle scrollbar stepper sensitiity */
+
+      gtk_range_set_lower_stepper_sensitivity (GTK_RANGE (shell->hsb),
+                                               min_offset_x < shell->offset_x ?
+                                               GTK_SENSITIVITY_ON :
+                                               GTK_SENSITIVITY_OFF);
+
+      gtk_range_set_upper_stepper_sensitivity (GTK_RANGE (shell->hsb),
+                                               max_offset_x > shell->offset_x ?
+                                               GTK_SENSITIVITY_ON :
+                                               GTK_SENSITIVITY_OFF);
+
+      gtk_range_set_lower_stepper_sensitivity (GTK_RANGE (shell->vsb),
+                                               min_offset_y < shell->offset_y ?
+                                               GTK_SENSITIVITY_ON :
+                                               GTK_SENSITIVITY_OFF);
+
+      gtk_range_set_upper_stepper_sensitivity (GTK_RANGE (shell->vsb),
+                                               max_offset_y > shell->offset_y ?
+                                               GTK_SENSITIVITY_ON :
+                                               GTK_SENSITIVITY_OFF);
+
+
+      /* Clamp */
+
       shell->offset_x = CLAMP (shell->offset_x, min_offset_x, max_offset_x);
       shell->offset_y = CLAMP (shell->offset_y, min_offset_y, max_offset_y);
     }
@@ -374,15 +400,15 @@
       ! shell->display->image)
     return;
 
-  sw = SCALEX (shell, gimp_image_get_width (shell->display->image));
+  gimp_display_shell_get_scaled_image_size (shell, &sw, NULL);
 
   if (shell->disp_width < sw)
     {
-      shell->hsbdata->upper = MAX (value + shell->disp_width,
-                                   sw);
-
       shell->hsbdata->lower = MIN (value,
                                    0);
+
+      shell->hsbdata->upper = MAX (value + shell->disp_width,
+                                   sw);
     }
   else
     {
@@ -414,15 +440,15 @@
       ! shell->display->image)
     return;
 
-  sh = SCALEY (shell, gimp_image_get_height (shell->display->image));
+  gimp_display_shell_get_scaled_image_size (shell, NULL, &sh);
 
   if (shell->disp_height < sh)
     {
-      shell->vsbdata->upper = MAX (value + shell->disp_height,
-                                   sh);
-
       shell->vsbdata->lower = MIN (value,
                                    0);
+
+      shell->vsbdata->upper = MAX (value + shell->disp_height,
+                                   sh);
     }
   else
     {

Modified: branches/soc-2008-tagging/app/display/gimpdisplayshell.c
==============================================================================
--- branches/soc-2008-tagging/app/display/gimpdisplayshell.c	(original)
+++ branches/soc-2008-tagging/app/display/gimpdisplayshell.c	Sun Jul 20 16:34:08 2008
@@ -337,10 +337,16 @@
   shell->scroll_start_x         = 0;
   shell->scroll_start_y         = 0;
   shell->button_press_before_focus = FALSE;
-
+  
   shell->highlight              = NULL;
   shell->mask                   = NULL;
 
+  shell->last_motion_time       = 0;
+  shell->last_motion_delta_x    = 0.0;
+  shell->last_motion_delta_y    = 0.0;
+  shell->last_motion_distance   = 0.0;
+  shell->last_motion_delta_time = 0.0;
+
   gtk_window_set_role (GTK_WINDOW (shell), "gimp-image-window");
   gtk_window_set_resizable (GTK_WINDOW (shell), TRUE);
 
@@ -936,9 +942,6 @@
                                                        1, 1, image_width));
   shell->hsb = gtk_hscrollbar_new (shell->hsbdata);
 
-  gtk_range_set_lower_stepper_sensitivity (GTK_RANGE (shell->hsb), GTK_SENSITIVITY_ON);
-  gtk_range_set_upper_stepper_sensitivity (GTK_RANGE (shell->hsb), GTK_SENSITIVITY_ON);
-
   GTK_WIDGET_UNSET_FLAGS (shell->hsb, GTK_CAN_FOCUS);
 
   /*  the vertical scrollbar  */
@@ -946,9 +949,6 @@
                                                        1, 1, image_height));
   shell->vsb = gtk_vscrollbar_new (shell->vsbdata);
 
-  gtk_range_set_lower_stepper_sensitivity (GTK_RANGE (shell->vsb), GTK_SENSITIVITY_ON);
-  gtk_range_set_upper_stepper_sensitivity (GTK_RANGE (shell->vsb), GTK_SENSITIVITY_ON);
-
   GTK_WIDGET_UNSET_FLAGS (shell->vsb, GTK_CAN_FOCUS);
 
   /*  create the contents of the inner_table  ********************************/
@@ -1322,6 +1322,35 @@
     gimp_ui_manager_update (shell->popup_manager, shell->display);
 }
 
+static void
+gimp_display_shell_center_image_callback (GimpDisplayShell *shell,
+                                          GtkAllocation    *allocation,
+                                          GtkWidget        *canvas)
+{
+  gint     sw, sh;
+  gboolean center_horizontally;
+  gboolean center_vertically;
+
+  gimp_display_shell_get_scaled_image_size (shell, &sw, &sh);
+
+  /* We only want to center on the axes on which the image is smaller
+   * than the display canvas. If it is larger, it will be centered on
+   * that axis later, and if we center on all axis unconditionally, we
+   * end up with the wrong centering if the image is larger than the
+   * display canvas.
+   */
+  center_horizontally = sw < shell->disp_width;
+  center_vertically   = sh < shell->disp_height;
+
+  gimp_display_shell_center_image (shell,
+                                   center_horizontally,
+                                   center_vertically);
+
+  g_signal_handlers_disconnect_by_func (canvas,
+                                        gimp_display_shell_center_image_callback,
+                                        shell);
+}
+
 static gboolean
 gimp_display_shell_fill_idle (GimpDisplayShell *shell)
 {
@@ -1357,6 +1386,15 @@
 
   gimp_help_set_help_data (shell->canvas, NULL, NULL);
 
+  /* Not pretty, but we need to center the image as soon as the canvas
+   * has got its new size allocated. The centering will be wrong if we
+   * do it too early, and if we do it too late flickering will occur
+   * due to the image being rendered twice.
+   */
+  g_signal_connect_swapped (shell->canvas, "size-allocate",
+                            G_CALLBACK (gimp_display_shell_center_image_callback),
+                            shell);
+
   shell->fill_idle_id = g_idle_add_full (G_PRIORITY_LOW,
                                          (GSourceFunc) gimp_display_shell_fill_idle,
                                          shell, NULL);

Modified: branches/soc-2008-tagging/app/display/gimpdisplayshell.h
==============================================================================
--- branches/soc-2008-tagging/app/display/gimpdisplayshell.h	(original)
+++ branches/soc-2008-tagging/app/display/gimpdisplayshell.h	Sun Jul 20 16:34:08 2008
@@ -180,8 +180,6 @@
   gint               scroll_start_x;
   gint               scroll_start_y;
   gboolean           button_press_before_focus;
-  guint32            last_disp_motion_time; /*  previous time of a forwarded motion event  */
-  guint32            last_read_motion_time;
 
   GdkRectangle      *highlight;        /* in image coordinates, can be NULL   */
   GimpDrawable      *mask;
@@ -190,6 +188,14 @@
   gpointer           scroll_info;
 
   GimpCoords         last_coords;      /* last motion event                   */
+
+  guint32            last_motion_time; /*  previous time of a forwarded motion event  */
+  guint32            last_read_motion_time;
+  gdouble            last_motion_delta_time;
+  gdouble            last_motion_delta_x;
+  gdouble            last_motion_delta_y;
+  gdouble            last_motion_distance;
+
 };
 
 struct _GimpDisplayShellClass

Modified: branches/soc-2008-tagging/app/display/gimpnavigationeditor.c
==============================================================================
--- branches/soc-2008-tagging/app/display/gimpnavigationeditor.c	(original)
+++ branches/soc-2008-tagging/app/display/gimpnavigationeditor.c	Sun Jul 20 16:34:08 2008
@@ -231,6 +231,10 @@
   GdkScreen            *screen;
   gint                  x, y;
   gint                  x_org, y_org;
+  gint                  view_marker_x;
+  gint                  view_marker_y;
+  gint                  view_marker_width;
+  gint                  view_marker_height;
 
   g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
   g_return_if_fail (GTK_IS_WIDGET (widget));
@@ -272,14 +276,20 @@
   /* decide where to put the popup */
   gdk_window_get_origin (widget->window, &x_org, &y_org);
 
+  gimp_navigation_view_get_local_marker (view,
+                                         &view_marker_x,
+                                         &view_marker_y,
+                                         &view_marker_width,
+                                         &view_marker_height);
+
   x = (x_org + click_x -
-       view->p_x -
-       0.5 * (view->p_width  - BORDER_PEN_WIDTH) -
+       view_marker_x -
+       0.5 * (view_marker_width  - BORDER_PEN_WIDTH) -
        2   * style->xthickness);
 
   y = (y_org + click_y -
-       view->p_y -
-       0.5 * (view->p_height - BORDER_PEN_WIDTH) -
+       view_marker_y -
+       0.5 * (view_marker_height - BORDER_PEN_WIDTH) -
        2   * style->ythickness);
 
   /* If the popup doesn't fit into the screen, we have a problem.
@@ -305,9 +315,9 @@
   gdk_flush ();
 
   /* fill in then grab pointer */
-  view->motion_offset_x = 0.5 * (view->p_width  - BORDER_PEN_WIDTH);
-  view->motion_offset_y = 0.5 * (view->p_height - BORDER_PEN_WIDTH);
-
+  gimp_navigation_view_set_motion_offset (view,
+                                          0.5 * (view_marker_width  - BORDER_PEN_WIDTH),
+                                          0.5 * (view_marker_height - BORDER_PEN_WIDTH));
   gimp_navigation_view_grab_pointer (view);
 }
 

Modified: branches/soc-2008-tagging/app/gui/Makefile.am
==============================================================================
--- branches/soc-2008-tagging/app/gui/Makefile.am	(original)
+++ branches/soc-2008-tagging/app/gui/Makefile.am	Sun Jul 20 16:34:08 2008
@@ -15,9 +15,11 @@
 
 noinst_LIBRARIES = libappgui.a
 
-libappgui_a_SOURCES = \
+libappgui_a_sources = \
 	color-history.c		\
 	color-history.h		\
+	gimpdbusservice.c	\
+	gimpdbusservice.h	\
 	gui.c			\
 	gui.h			\
 	gui-message.c		\
@@ -36,4 +38,23 @@
 	ige-mac-menu.c		\
 	ige-mac-menu.h
 
-EXTRA_DIST = makefile.msc
+libappgui_a_built_sources = gimpdbusservice-glue.h 
+
+libappgui_a_SOURCES = $(libappgui_a_built_sources) $(libappgui_a_sources)
+
+EXTRA_DIST = \
+	dbus-service.xml	\
+	makefile.msc
+
+
+#
+# rules to generate built sources
+#
+# setup autogeneration dependencies
+gen_sources = gimpdbusservice-glue.h
+CLEANFILES = $(gen_sources)
+
+$(srcdir)/gimpdbusservice.c: gimpdbusservice-glue.h
+
+gimpdbusservice-glue.h: $(srcdir)/dbus-service.xml
+	$(DBUS_BINDING_TOOL) --mode=glib-server --prefix=gimp $< > $(@F)

Modified: branches/soc-2008-tagging/app/gui/gui-unique.c
==============================================================================
--- branches/soc-2008-tagging/app/gui/gui-unique.c	(original)
+++ branches/soc-2008-tagging/app/gui/gui-unique.c	Sun Jul 20 16:34:08 2008
@@ -18,7 +18,7 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gtk/gtk.h>
 
 #ifdef G_OS_WIN32
 #include <windows.h>
@@ -30,12 +30,14 @@
 #include <dbus/dbus-glib-lowlevel.h>
 #endif
 
-#include "core/core-types.h"
+#include "gui/gui-types.h"
 
 #include "core/gimp.h"
+#include "core/gimpcontainer.h"
 
-#include "widgets/gimpdbusservice.h"
+#include "display/gimpdisplay.h"
 
+#include "gimpdbusservice.h"
 #include "gui-unique.h"
 
 
@@ -128,12 +130,16 @@
 
 static IdleOpenData *
 idle_open_data_new (const gchar *name,
+                    gint         len,
 		    gboolean     as_new)
 {
-  IdleOpenData *data = g_slice_new (IdleOpenData);
+  IdleOpenData *data = g_slice_new0 (IdleOpenData);
 
-  data->name   = g_strdup (name);
-  data->as_new = as_new;
+  if (len > 0)
+    {
+      data->name   = g_strdup (name);
+      data->as_new = as_new;
+    }
 
   return data;
 }
@@ -148,7 +154,19 @@
 static gboolean
 gui_unique_win32_idle_open (IdleOpenData *data)
 {
-  file_open_from_command_line (unique_gimp, data->name, data->as_new);
+  if (data->name)
+    {
+      file_open_from_command_line (unique_gimp, data->name, data->as_new);
+    }
+  else
+    {
+      /*  raise the first display  */
+      GimpObject *display;
+
+      display = gimp_container_get_first_child (unique_gimp->displays);
+
+      gtk_window_present (GTK_WINDOW (GIMP_DISPLAY (display)->shell));
+    }
 
   return FALSE;
 }
@@ -163,27 +181,28 @@
   switch (uMsg)
     {
     case WM_COPYDATA:
-      {
-	COPYDATASTRUCT *copydata = (COPYDATASTRUCT *) lParam;
-
-	if (unique_gimp && copydata->cbData > 0)
-	  {
-	    GSource      *source;
-	    GClosure     *closure;
-	    IdleOpenData *data = idle_open_data_new (copydata->lpData, copydata->dwData != 0);
-
-	    closure = g_cclosure_new (G_CALLBACK (gui_unique_win32_idle_open),
-				      data,
-				      (GClosureNotify) idle_open_data_free);
-
-	    g_object_watch_closure (unique_gimp, closure);
-
-	    source = g_idle_source_new ();
-	    g_source_set_closure (source, closure);
-	    g_source_attach (source, NULL);
-	    g_source_unref (source);
-	  }
-      }
+      if (unique_gimp)
+        {
+          COPYDATASTRUCT *copydata = (COPYDATASTRUCT *) lParam;
+          GSource        *source;
+          GClosure       *closure;
+          IdleOpenData   *data;
+
+          data = idle_open_data_new (copydata->lpData,
+                                     copydata->cbData,
+                                     copydata->dwData != 0);
+
+          closure = g_cclosure_new (G_CALLBACK (gui_unique_win32_idle_open),
+                                    data,
+                                    (GClosureNotify) idle_open_data_free);
+
+          g_object_watch_closure (unique_gimp, closure);
+
+          source = g_idle_source_new ();
+          g_source_set_closure (source, closure);
+          g_source_attach (source, NULL);
+          g_source_unref (source);
+        }
       return TRUE;
 
     default:

Modified: branches/soc-2008-tagging/app/paint/gimpairbrush.c
==============================================================================
--- branches/soc-2008-tagging/app/paint/gimpairbrush.c	(original)
+++ branches/soc-2008-tagging/app/paint/gimpairbrush.c	Sun Jul 20 16:34:08 2008
@@ -143,8 +143,7 @@
           airbrush->paint_options = paint_options;
 
           dynamic_rate = gimp_paint_options_get_dynamic_rate (paint_options,
-                                                              &paint_core->cur_coords,
-                                                              paint_core->use_pressure);
+                                                              &paint_core->cur_coords);
 
           timeout = 10000 / (options->rate * dynamic_rate);
 

Modified: branches/soc-2008-tagging/app/paint/gimpbrushcore.c
==============================================================================
--- branches/soc-2008-tagging/app/paint/gimpbrushcore.c	(original)
+++ branches/soc-2008-tagging/app/paint/gimpbrushcore.c	Sun Jul 20 16:34:08 2008
@@ -355,7 +355,6 @@
 
   core->scale = gimp_paint_options_get_dynamic_size (paint_options,
                                                      coords,
-                                                     paint_core->use_pressure,
                                                      GIMP_BRUSH_CORE_GET_CLASS (core)->handles_scaling_brush);
 
   core->spacing = (gdouble) gimp_brush_get_spacing (core->main_brush) / 100.0;
@@ -636,7 +635,6 @@
                                          p * delta_wheel);
       paint_core->cur_coords.velocity = (paint_core->last_coords.velocity +
                                          p * delta_velocity);
-      paint_core->cur_coords.random   = g_random_double_range (0.0, 1.0);
 
       if (core->jitter > 0.0)
         {
@@ -689,12 +687,10 @@
   gint           brush_width, brush_height;
 
   if (GIMP_BRUSH_CORE_GET_CLASS (core)->handles_scaling_brush)
-    {
-      core->scale = gimp_paint_options_get_dynamic_size (paint_options,
-                                                         &paint_core->cur_coords,
-                                                         paint_core->use_pressure,
-                                                         TRUE);
-    }
+    core->scale = gimp_paint_options_get_dynamic_size (paint_options,
+                                                       &paint_core->cur_coords,
+                                                       TRUE);
+
   /* else use scale from start(), we don't support on-the-fly scaling */
 
   gimp_brush_scale_size (core->brush, core->scale,

Modified: branches/soc-2008-tagging/app/paint/gimpclone.c
==============================================================================
--- branches/soc-2008-tagging/app/paint/gimpclone.c	(original)
+++ branches/soc-2008-tagging/app/paint/gimpclone.c	Sun Jul 20 16:34:08 2008
@@ -237,12 +237,10 @@
     }
 
   opacity *= gimp_paint_options_get_dynamic_opacity (paint_options,
-                                                     &paint_core->cur_coords,
-                                                     paint_core->use_pressure);
+                                                     &paint_core->cur_coords);
 
   hardness = gimp_paint_options_get_dynamic_hardness (paint_options,
-                                                      &paint_core->cur_coords,
-                                                      paint_core->use_pressure);
+                                                      &paint_core->cur_coords);
 
   gimp_brush_core_paste_canvas (GIMP_BRUSH_CORE (paint_core), drawable,
                                 MIN (opacity, GIMP_OPACITY_OPAQUE),

Modified: branches/soc-2008-tagging/app/paint/gimpconvolve.c
==============================================================================
--- branches/soc-2008-tagging/app/paint/gimpconvolve.c	(original)
+++ branches/soc-2008-tagging/app/paint/gimpconvolve.c	Sun Jul 20 16:34:08 2008
@@ -151,8 +151,7 @@
   rate = options->rate;
 
   rate *= gimp_paint_options_get_dynamic_rate (paint_options,
-                                               &paint_core->cur_coords,
-                                               paint_core->use_pressure);
+                                               &paint_core->cur_coords);
 
   gimp_convolve_calculate_matrix (convolve, options->type,
                                   brush_core->brush->mask->width / 2,

Modified: branches/soc-2008-tagging/app/paint/gimpdodgeburn.c
==============================================================================
--- branches/soc-2008-tagging/app/paint/gimpdodgeburn.c	(original)
+++ branches/soc-2008-tagging/app/paint/gimpdodgeburn.c	Sun Jul 20 16:34:08 2008
@@ -237,12 +237,10 @@
   g_free (temp_data);
 
   opacity *= gimp_paint_options_get_dynamic_opacity (paint_options,
-                                                     &paint_core->cur_coords,
-                                                     paint_core->use_pressure);
+                                                     &paint_core->cur_coords);
 
   hardness = gimp_paint_options_get_dynamic_hardness (paint_options,
-                                                      &paint_core->cur_coords,
-                                                      paint_core->use_pressure);
+                                                      &paint_core->cur_coords);
 
   /* Replace the newly dodgedburned area (canvas_buf) to the image */
   gimp_brush_core_replace_canvas (GIMP_BRUSH_CORE (paint_core), drawable,

Modified: branches/soc-2008-tagging/app/paint/gimperaser.c
==============================================================================
--- branches/soc-2008-tagging/app/paint/gimperaser.c	(original)
+++ branches/soc-2008-tagging/app/paint/gimperaser.c	Sun Jul 20 16:34:08 2008
@@ -132,12 +132,10 @@
                 area->width * area->height, area->bytes);
 
   opacity *= gimp_paint_options_get_dynamic_opacity (paint_options,
-                                                     &paint_core->cur_coords,
-                                                     paint_core->use_pressure);
+                                                     &paint_core->cur_coords);
 
   hardness = gimp_paint_options_get_dynamic_hardness (paint_options,
-                                                      &paint_core->cur_coords,
-                                                      paint_core->use_pressure);
+                                                      &paint_core->cur_coords);
 
   gimp_brush_core_paste_canvas (GIMP_BRUSH_CORE (paint_core), drawable,
                                 MIN (opacity, GIMP_OPACITY_OPAQUE),

Modified: branches/soc-2008-tagging/app/paint/gimpheal.c
==============================================================================
--- branches/soc-2008-tagging/app/paint/gimpheal.c	(original)
+++ branches/soc-2008-tagging/app/paint/gimpheal.c	Sun Jul 20 16:34:08 2008
@@ -438,8 +438,7 @@
   gdouble        hardness;
 
   hardness = gimp_paint_options_get_dynamic_hardness (paint_options,
-                                                      &paint_core->cur_coords,
-                                                      paint_core->use_pressure);
+                                                      &paint_core->cur_coords);
 
   mask_buf = gimp_brush_core_get_brush_mask (GIMP_BRUSH_CORE (source_core),
                                              GIMP_BRUSH_HARD,
@@ -547,8 +546,7 @@
   temp_buf_free (temp);
 
   opacity *= gimp_paint_options_get_dynamic_opacity (paint_options,
-                                                     &paint_core->cur_coords,
-                                                     paint_core->use_pressure);
+                                                     &paint_core->cur_coords);
 
   /* replace the canvas with our healed data */
   gimp_brush_core_replace_canvas (GIMP_BRUSH_CORE (paint_core),

Modified: branches/soc-2008-tagging/app/paint/gimppaintbrush.c
==============================================================================
--- branches/soc-2008-tagging/app/paint/gimppaintbrush.c	(original)
+++ branches/soc-2008-tagging/app/paint/gimppaintbrush.c	Sun Jul 20 16:34:08 2008
@@ -129,8 +129,7 @@
   paint_appl_mode = paint_options->application_mode;
 
   grad_point = gimp_paint_options_get_dynamic_color (paint_options,
-                                                     &paint_core->cur_coords,
-                                                     paint_core->use_pressure);
+                                                     &paint_core->cur_coords);
 
   /* optionally take the color from the current gradient */
   if (gimp_paint_options_get_gradient_color (paint_options, image,
@@ -175,12 +174,10 @@
     }
 
   opacity *= gimp_paint_options_get_dynamic_opacity (paint_options,
-                                                     &paint_core->cur_coords,
-                                                     paint_core->use_pressure);
+                                                     &paint_core->cur_coords);
 
   hardness = gimp_paint_options_get_dynamic_hardness (paint_options,
-                                                      &paint_core->cur_coords,
-                                                      paint_core->use_pressure);
+                                                      &paint_core->cur_coords);
 
   /* finally, let the brush core paste the colored area on the canvas */
   gimp_brush_core_paste_canvas (brush_core, drawable,

Modified: branches/soc-2008-tagging/app/paint/gimppaintcore.c
==============================================================================
--- branches/soc-2008-tagging/app/paint/gimppaintcore.c	(original)
+++ branches/soc-2008-tagging/app/paint/gimppaintcore.c	Sun Jul 20 16:34:08 2008
@@ -150,7 +150,6 @@
   core->x2               = 0;
   core->y2               = 0;
 
-  core->use_pressure     = FALSE;
   core->use_saved_proj   = FALSE;
 
   core->undo_tiles       = NULL;

Modified: branches/soc-2008-tagging/app/paint/gimppaintcore.h
==============================================================================
--- branches/soc-2008-tagging/app/paint/gimppaintcore.h	(original)
+++ branches/soc-2008-tagging/app/paint/gimppaintcore.h	Sun Jul 20 16:34:08 2008
@@ -55,7 +55,6 @@
   gint         x1, y1;           /*  undo extents in image coords        */
   gint         x2, y2;           /*  undo extents in image coords        */
 
-  gboolean     use_pressure;     /*  look at coords->pressure            */
   gboolean     use_saved_proj;   /*  keep the unmodified proj around     */
 
   TileManager *undo_tiles;       /*  tiles which have been modified      */

Modified: branches/soc-2008-tagging/app/paint/gimppaintoptions.c
==============================================================================
--- branches/soc-2008-tagging/app/paint/gimppaintoptions.c	(original)
+++ branches/soc-2008-tagging/app/paint/gimppaintoptions.c	Sun Jul 20 16:34:08 2008
@@ -980,8 +980,7 @@
 
 gdouble
 gimp_paint_options_get_dynamic_opacity (GimpPaintOptions *paint_options,
-                                        const GimpCoords *coords,
-                                        gboolean          use_pressure)
+                                        const GimpCoords *coords)
 {
   gdouble opacity = 1.0;
 
@@ -996,14 +995,14 @@
       gdouble velocity = -1.0;
       gdouble random   = -1.0;
 
-      if (paint_options->pressure_options->opacity && use_pressure)
+      if (paint_options->pressure_options->opacity)
         pressure = GIMP_PAINT_PRESSURE_SCALE * coords->pressure;
 
       if (paint_options->velocity_options->opacity)
         velocity = GIMP_PAINT_VELOCITY_SCALE * (1 - coords->velocity);
 
       if (paint_options->random_options->opacity)
-        random = coords->random;
+        random = g_random_double_range (0.0, 1.0);
 
       opacity = gimp_paint_options_get_dynamics_mix (pressure,
                                                      paint_options->pressure_options->prescale,
@@ -1019,7 +1018,6 @@
 gdouble
 gimp_paint_options_get_dynamic_size (GimpPaintOptions *paint_options,
                                      const GimpCoords *coords,
-                                     gboolean          use_pressure,
                                      gboolean          use_dynamics)
 {
   gdouble scale = 1.0;
@@ -1030,11 +1028,11 @@
       gdouble velocity = -1.0;
       gdouble random   = -1.0;
 
-      if (paint_options->pressure_options->size && use_pressure)
+      if (paint_options->pressure_options->size)
         {
           pressure = coords->pressure;
         }
-      else if (paint_options->pressure_options->inverse_size && use_pressure)
+      else if (paint_options->pressure_options->inverse_size)
         {
           pressure = 1.0 - 0.9 * coords->pressure;
         }
@@ -1050,11 +1048,11 @@
 
       if (paint_options->random_options->size)
         {
-          random = 1.0 - coords->random;
+          random = 1.0 - g_random_double_range (0.0, 1.0);
         }
       else if (paint_options->random_options->inverse_size)
         {
-          random = coords->random;
+          random = g_random_double_range (0.0, 1.0);
         }
 
       scale = gimp_paint_options_get_dynamics_mix (pressure,
@@ -1078,8 +1076,7 @@
 
 gdouble
 gimp_paint_options_get_dynamic_rate (GimpPaintOptions *paint_options,
-                                     const GimpCoords *coords,
-                                     gboolean          use_pressure)
+                                     const GimpCoords *coords)
 {
   gdouble rate = 1.0;
 
@@ -1094,14 +1091,14 @@
       gdouble velocity = -1.0;
       gdouble random   = -1.0;
 
-      if (paint_options->pressure_options->rate && use_pressure)
+      if (paint_options->pressure_options->rate)
         pressure = GIMP_PAINT_PRESSURE_SCALE * coords->pressure;
 
       if (paint_options->velocity_options->rate)
         velocity = GIMP_PAINT_VELOCITY_SCALE * (1 - coords->velocity);
 
       if (paint_options->random_options->rate)
-        random = coords->random;
+        random = g_random_double_range (0.0, 1.0);
 
       rate = gimp_paint_options_get_dynamics_mix (pressure,
                                                   paint_options->pressure_options->prescale,
@@ -1117,8 +1114,7 @@
 
 gdouble
 gimp_paint_options_get_dynamic_color (GimpPaintOptions *paint_options,
-                                      const GimpCoords *coords,
-                                      gboolean          use_pressure)
+                                      const GimpCoords *coords)
 {
   gdouble color = 1.0;
 
@@ -1133,14 +1129,14 @@
       gdouble velocity = -1.0;
       gdouble random   = -1.0;
 
-      if (paint_options->pressure_options->color && use_pressure)
+      if (paint_options->pressure_options->color)
         pressure = GIMP_PAINT_PRESSURE_SCALE * coords->pressure;
 
       if (paint_options->velocity_options->color)
         velocity = GIMP_PAINT_VELOCITY_SCALE * coords->velocity;
 
       if (paint_options->random_options->color)
-        random = coords->random;
+        random = g_random_double_range (0.0, 1.0);
 
       color = gimp_paint_options_get_dynamics_mix (pressure,
                                                    paint_options->pressure_options->prescale,
@@ -1155,8 +1151,7 @@
 
 gdouble
 gimp_paint_options_get_dynamic_hardness (GimpPaintOptions *paint_options,
-                                         const GimpCoords *coords,
-                                         gboolean          use_pressure)
+                                         const GimpCoords *coords)
 {
   gdouble hardness = 1.0;
 
@@ -1171,14 +1166,14 @@
       gdouble velocity = -1.0;
       gdouble random   = -1.0;
 
-      if (paint_options->pressure_options->hardness && use_pressure)
+      if (paint_options->pressure_options->hardness)
         pressure = GIMP_PAINT_PRESSURE_SCALE * coords->pressure;
 
       if (paint_options->velocity_options->hardness)
         velocity = GIMP_PAINT_VELOCITY_SCALE * (1 - coords->velocity);
 
       if (paint_options->random_options->hardness)
-        random = coords->random;
+        random = g_random_double_range (0.0, 1.0);
 
       hardness = gimp_paint_options_get_dynamics_mix (pressure,
                                                       paint_options->pressure_options->prescale,

Modified: branches/soc-2008-tagging/app/paint/gimppaintoptions.h
==============================================================================
--- branches/soc-2008-tagging/app/paint/gimppaintoptions.h	(original)
+++ branches/soc-2008-tagging/app/paint/gimppaintoptions.h	Sun Jul 20 16:34:08 2008
@@ -139,25 +139,20 @@
 
 
 gdouble gimp_paint_options_get_dynamic_opacity (GimpPaintOptions *paint_options,
-                                                const GimpCoords *coords,
-                                                gboolean          use_pressure);
+                                                const GimpCoords *coords);
 
 gdouble gimp_paint_options_get_dynamic_size    (GimpPaintOptions *paint_options,
                                                 const GimpCoords *coords,
-                                                gboolean          use_pressure,
                                                 gboolean          use_dynamics);
 
 gdouble gimp_paint_options_get_dynamic_rate    (GimpPaintOptions *paint_options,
-                                                const GimpCoords *coords,
-                                                gboolean          use_pressure);
+                                                const GimpCoords *coords);
 
 gdouble gimp_paint_options_get_dynamic_color   (GimpPaintOptions *paint_options,
-                                                const GimpCoords *coords,
-                                                gboolean          use_pressure);
+                                                const GimpCoords *coords);
 
 gdouble gimp_paint_options_get_dynamic_hardness(GimpPaintOptions *paint_options,
-                                                const GimpCoords *coords,
-                                                gboolean          use_pressure);
+                                                const GimpCoords *coords);
 
 
 #endif  /*  __GIMP_PAINT_OPTIONS_H__  */

Modified: branches/soc-2008-tagging/app/paint/gimpsmudge.c
==============================================================================
--- branches/soc-2008-tagging/app/paint/gimpsmudge.c	(original)
+++ branches/soc-2008-tagging/app/paint/gimpsmudge.c	Sun Jul 20 16:34:08 2008
@@ -264,8 +264,7 @@
 
   /* Enable dynamic rate */
   dynamic_rate = gimp_paint_options_get_dynamic_rate (paint_options,
-                                                      &paint_core->cur_coords,
-                                                      paint_core->use_pressure);
+                                                      &paint_core->cur_coords);
   rate = (options->rate / 100.0) * dynamic_rate;
 
   /* The tempPR will be the built up buffer (for smudge) */
@@ -306,12 +305,10 @@
     copy_region (&tempPR, &destPR);
 
   opacity *= gimp_paint_options_get_dynamic_opacity (paint_options,
-                                                     &paint_core->cur_coords,
-                                                     paint_core->use_pressure);
+                                                     &paint_core->cur_coords);
 
   hardness = gimp_paint_options_get_dynamic_hardness (paint_options,
-                                                      &paint_core->cur_coords,
-                                                      paint_core->use_pressure);
+                                                      &paint_core->cur_coords);
 
   gimp_brush_core_replace_canvas (GIMP_BRUSH_CORE (paint_core), drawable,
                                   MIN (opacity, GIMP_OPACITY_OPAQUE),

Modified: branches/soc-2008-tagging/app/pdb/edit-cmds.c
==============================================================================
--- branches/soc-2008-tagging/app/pdb/edit-cmds.c	(original)
+++ branches/soc-2008-tagging/app/pdb/edit-cmds.c	Sun Jul 20 16:34:08 2008
@@ -799,7 +799,7 @@
   gimp_procedure_set_static_strings (procedure,
                                      "gimp-edit-cut",
                                      "Cut from the specified drawable.",
-                                     "If there is a selection in the image, then the area specified by the selection is cut from the specified drawable and placed in an internal GIMP edit buffer. It can subsequently be retrieved using the 'gimp-edit-paste' command. If there is no selection, then the specified drawable will be removed and its contents stored in the internal GIMP edit buffer.",
+                                     "If there is a selection in the image, then the area specified by the selection is cut from the specified drawable and placed in an internal GIMP edit buffer. It can subsequently be retrieved using the 'gimp-edit-paste' command. If there is no selection, then the specified drawable will be removed and its contents stored in the internal GIMP edit buffer. This procedure will fail if the selected area lies completely outside the bounds of the current drawable and there is nothing to copy from.",
                                      "Spencer Kimball & Peter Mattis",
                                      "Spencer Kimball & Peter Mattis",
                                      "1995-1996",
@@ -813,7 +813,7 @@
   gimp_procedure_add_return_value (procedure,
                                    g_param_spec_boolean ("non-empty",
                                                          "non empty",
-                                                         "TRUE if the cut was successful, FALSE if the selection contained only transparent pixels",
+                                                         "TRUE if the cut was successful, FALSE if there was nothing to copy from",
                                                          FALSE,
                                                          GIMP_PARAM_READWRITE));
   gimp_pdb_register_procedure (pdb, procedure);
@@ -828,7 +828,7 @@
   gimp_procedure_set_static_strings (procedure,
                                      "gimp-edit-copy",
                                      "Copy from the specified drawable.",
-                                     "If there is a selection in the image, then the area specified by the selection is copied from the specified drawable and placed in an internal GIMP edit buffer. It can subsequently be retrieved using the 'gimp-edit-paste' command. If there is no selection, then the specified drawable's contents will be stored in the internal GIMP edit buffer.",
+                                     "If there is a selection in the image, then the area specified by the selection is copied from the specified drawable and placed in an internal GIMP edit buffer. It can subsequently be retrieved using the 'gimp-edit-paste' command. If there is no selection, then the specified drawable's contents will be stored in the internal GIMP edit buffer. This procedure will fail if the selected area lies completely outside the bounds of the current drawable and there is nothing to copy from.",
                                      "Spencer Kimball & Peter Mattis",
                                      "Spencer Kimball & Peter Mattis",
                                      "1995-1996",
@@ -842,7 +842,7 @@
   gimp_procedure_add_return_value (procedure,
                                    g_param_spec_boolean ("non-empty",
                                                          "non empty",
-                                                         "TRUE if the copy was successful, FALSE if the selection contained only transparent pixels",
+                                                         "TRUE if the cut was successful, FALSE if there was nothing to copy from",
                                                          FALSE,
                                                          GIMP_PARAM_READWRITE));
   gimp_pdb_register_procedure (pdb, procedure);
@@ -871,7 +871,7 @@
   gimp_procedure_add_return_value (procedure,
                                    g_param_spec_boolean ("non-empty",
                                                          "non empty",
-                                                         "TRUE if the copy was successful, FALSE if the selection contained only transparent pixels",
+                                                         "TRUE if the copy was successful",
                                                          FALSE,
                                                          GIMP_PARAM_READWRITE));
   gimp_pdb_register_procedure (pdb, procedure);
@@ -965,7 +965,7 @@
   gimp_procedure_add_return_value (procedure,
                                    gimp_param_spec_string ("real-name",
                                                            "real name",
-                                                           "The real name given to the buffer, or NULL if the selection contained only transparent pixels",
+                                                           "The real name given to the buffer, or NULL if the cut failed",
                                                            FALSE, FALSE, FALSE,
                                                            NULL,
                                                            GIMP_PARAM_READWRITE));
@@ -1002,7 +1002,7 @@
   gimp_procedure_add_return_value (procedure,
                                    gimp_param_spec_string ("real-name",
                                                            "real name",
-                                                           "The real name given to the buffer, or NULL if the selection contained only transparent pixels",
+                                                           "The real name given to the buffer, or NULL if the copy failed",
                                                            FALSE, FALSE, FALSE,
                                                            NULL,
                                                            GIMP_PARAM_READWRITE));
@@ -1039,7 +1039,7 @@
   gimp_procedure_add_return_value (procedure,
                                    gimp_param_spec_string ("real-name",
                                                            "real name",
-                                                           "The real name given to the buffer, or NULL if the selection contained only transparent pixels",
+                                                           "The real name given to the buffer, or NULL if the copy failed",
                                                            FALSE, FALSE, FALSE,
                                                            NULL,
                                                            GIMP_PARAM_READWRITE));

Modified: branches/soc-2008-tagging/app/pdb/gimp-pdb-compat.c
==============================================================================
--- branches/soc-2008-tagging/app/pdb/gimp-pdb-compat.c	(original)
+++ branches/soc-2008-tagging/app/pdb/gimp-pdb-compat.c	Sun Jul 20 16:34:08 2008
@@ -148,7 +148,9 @@
                                             G_PARAM_READWRITE);
       break;
 
-    case GIMP_PDB_BOUNDARY:
+    case GIMP_PDB_COLORARRAY:
+      pspec = gimp_param_spec_color_array (name, name, desc,
+                                           G_PARAM_READWRITE);
       break;
 
     case GIMP_PDB_VECTORS:
@@ -220,7 +222,6 @@
       return GIMP_TYPE_RGB;
 
     case GIMP_PDB_REGION:
-    case GIMP_PDB_BOUNDARY:
       break;
 
     case GIMP_PDB_DISPLAY:
@@ -241,6 +242,9 @@
     case GIMP_PDB_SELECTION:
       return GIMP_TYPE_SELECTION_ID;
 
+    case GIMP_PDB_COLORARRAY:
+      return GIMP_TYPE_COLOR_ARRAY;
+
     case GIMP_PDB_VECTORS:
       return GIMP_TYPE_VECTORS_ID;
 
@@ -268,7 +272,7 @@
 
   if (! pdb_type_quark)
     {
-      struct
+      const struct
       {
         GType          g_type;
         GimpPDBArgType pdb_type;
@@ -287,13 +291,14 @@
 
         { G_TYPE_STRING,             GIMP_PDB_STRING      },
 
+        { GIMP_TYPE_RGB,             GIMP_PDB_COLOR       },
+
         { GIMP_TYPE_INT32_ARRAY,     GIMP_PDB_INT32ARRAY  },
         { GIMP_TYPE_INT16_ARRAY,     GIMP_PDB_INT16ARRAY  },
         { GIMP_TYPE_INT8_ARRAY,      GIMP_PDB_INT8ARRAY   },
         { GIMP_TYPE_FLOAT_ARRAY,     GIMP_PDB_FLOATARRAY  },
         { GIMP_TYPE_STRING_ARRAY,    GIMP_PDB_STRINGARRAY },
-
-        { GIMP_TYPE_RGB,             GIMP_PDB_COLOR       },
+        { GIMP_TYPE_COLOR_ARRAY,     GIMP_PDB_COLORARRAY  },
 
         { GIMP_TYPE_DISPLAY_ID,      GIMP_PDB_DISPLAY     },
         { GIMP_TYPE_IMAGE_ID,        GIMP_PDB_IMAGE       },

Modified: branches/soc-2008-tagging/app/pdb/internal-procs.c
==============================================================================
--- branches/soc-2008-tagging/app/pdb/internal-procs.c	(original)
+++ branches/soc-2008-tagging/app/pdb/internal-procs.c	Sun Jul 20 16:34:08 2008
@@ -29,7 +29,7 @@
 #include "internal-procs.h"
 
 
-/* 586 procedures registered total */
+/* 587 procedures registered total */
 
 void
 internal_procs_init (GimpPDB *pdb)

Modified: branches/soc-2008-tagging/app/pdb/palette-cmds.c
==============================================================================
--- branches/soc-2008-tagging/app/pdb/palette-cmds.c	(original)
+++ branches/soc-2008-tagging/app/pdb/palette-cmds.c	Sun Jul 20 16:34:08 2008
@@ -248,6 +248,54 @@
 }
 
 static GValueArray *
+palette_get_colors_invoker (GimpProcedure      *procedure,
+                            Gimp               *gimp,
+                            GimpContext        *context,
+                            GimpProgress       *progress,
+                            const GValueArray  *args,
+                            GError            **error)
+{
+  gboolean success = TRUE;
+  GValueArray *return_vals;
+  const gchar *name;
+  gint32 num_colors = 0;
+  GimpRGB *colors = NULL;
+
+  name = g_value_get_string (&args->values[0]);
+
+  if (success)
+    {
+      GimpPalette *palette = gimp_pdb_get_palette (gimp, name, FALSE, error);
+
+      if (palette)
+        {
+          GList *list = palette->colors;
+          gint   i;
+
+          num_colors = palette->n_colors;
+          colors     = g_new (GimpRGB, num_colors);
+
+          for (i = 0; i < num_colors; i++, list = g_list_next (list))
+            colors[i] = ((GimpPaletteEntry *)(list->data))->color;
+        }
+      else
+        {
+          success = FALSE;
+        }
+    }
+
+  return_vals = gimp_procedure_get_return_values (procedure, success);
+
+  if (success)
+    {
+      g_value_set_int (&return_vals->values[1], num_colors);
+      gimp_value_take_colorarray (&return_vals->values[2], colors, num_colors);
+    }
+
+  return return_vals;
+}
+
+static GValueArray *
 palette_get_columns_invoker (GimpProcedure      *procedure,
                              Gimp               *gimp,
                              GimpContext        *context,
@@ -748,6 +796,41 @@
   g_object_unref (procedure);
 
   /*
+   * gimp-palette-get-colors
+   */
+  procedure = gimp_procedure_new (palette_get_colors_invoker);
+  gimp_object_set_static_name (GIMP_OBJECT (procedure),
+                               "gimp-palette-get-colors");
+  gimp_procedure_set_static_strings (procedure,
+                                     "gimp-palette-get-colors",
+                                     "Gets all colors from the specified palette.",
+                                     "This procedure retrieves all color entries of the specified palette.",
+                                     "Sven Neumann <sven gimp org>",
+                                     "Sven Neumann",
+                                     "2006",
+                                     NULL);
+  gimp_procedure_add_argument (procedure,
+                               gimp_param_spec_string ("name",
+                                                       "name",
+                                                       "The palette name",
+                                                       FALSE, FALSE, TRUE,
+                                                       NULL,
+                                                       GIMP_PARAM_READWRITE));
+  gimp_procedure_add_return_value (procedure,
+                                   gimp_param_spec_int32 ("num-colors",
+                                                          "num colors",
+                                                          "Length of the colors array",
+                                                          0, G_MAXINT32, 0,
+                                                          GIMP_PARAM_READWRITE));
+  gimp_procedure_add_return_value (procedure,
+                                   gimp_param_spec_color_array ("colors",
+                                                                "colors",
+                                                                "The colors in the palette",
+                                                                GIMP_PARAM_READWRITE));
+  gimp_pdb_register_procedure (pdb, procedure);
+  g_object_unref (procedure);
+
+  /*
    * gimp-palette-get-columns
    */
   procedure = gimp_procedure_new (palette_get_columns_invoker);

Modified: branches/soc-2008-tagging/app/plug-in/gimpplugin-message.c
==============================================================================
--- branches/soc-2008-tagging/app/plug-in/gimpplugin-message.c	(original)
+++ branches/soc-2008-tagging/app/plug-in/gimpplugin-message.c	Sun Jul 20 16:34:08 2008
@@ -618,7 +618,8 @@
       if ((proc_install->params[i].type == GIMP_PDB_INT32ARRAY ||
            proc_install->params[i].type == GIMP_PDB_INT8ARRAY  ||
            proc_install->params[i].type == GIMP_PDB_FLOATARRAY ||
-           proc_install->params[i].type == GIMP_PDB_STRINGARRAY)
+           proc_install->params[i].type == GIMP_PDB_STRINGARRAY ||
+           proc_install->params[i].type == GIMP_PDB_COLORARRAY)
           &&
           proc_install->params[i - 1].type != GIMP_PDB_INT32)
         {

Modified: branches/soc-2008-tagging/app/plug-in/plug-in-params.c
==============================================================================
--- branches/soc-2008-tagging/app/plug-in/plug-in-params.c	(original)
+++ branches/soc-2008-tagging/app/plug-in/plug-in-params.c	Sun Jul 20 16:34:08 2008
@@ -221,8 +221,16 @@
           g_value_set_int (&value, params[i].data.d_selection);
           break;
 
-        case GIMP_PDB_BOUNDARY:
-          g_message ("the \"boundary\" arg type is not currently supported");
+        case GIMP_PDB_COLORARRAY:
+          count = g_value_get_int (&args->values[i - 1]);
+          if (full_copy)
+            gimp_value_set_colorarray (&value,
+                                      params[i].data.d_colorarray,
+                                      count);
+          else
+            gimp_value_set_static_colorarray (&value,
+                                             params[i].data.d_colorarray,
+                                             count);
           break;
 
         case GIMP_PDB_VECTORS:
@@ -374,8 +382,11 @@
           params[i].data.d_selection = g_value_get_int (value);
           break;
 
-        case GIMP_PDB_BOUNDARY:
-          g_message ("the \"boundary\" arg type is not currently supported");
+        case GIMP_PDB_COLORARRAY:
+          if (full_copy)
+            params[i].data.d_colorarray = gimp_value_dup_colorarray (value);
+          else
+            params[i].data.d_colorarray = (GimpRGB *) gimp_value_get_colorarray (value);
           break;
 
         case GIMP_PDB_VECTORS:

Modified: branches/soc-2008-tagging/app/tools/gimpcolorizetool.c
==============================================================================
--- branches/soc-2008-tagging/app/tools/gimpcolorizetool.c	(original)
+++ branches/soc-2008-tagging/app/tools/gimpcolorizetool.c	Sun Jul 20 16:34:08 2008
@@ -109,7 +109,7 @@
   im_tool_class->shell_desc          = _("Colorize the Image");
   im_tool_class->settings_name       = "colorize";
   im_tool_class->import_dialog_title = _("Import Colorize Settings");
-  im_tool_class->export_dialog_title = _("Export Colorsize Settings");
+  im_tool_class->export_dialog_title = _("Export Colorize Settings");
 
   im_tool_class->get_operation       = gimp_colorize_tool_get_operation;
   im_tool_class->map                 = gimp_colorize_tool_map;

Modified: branches/soc-2008-tagging/app/tools/gimppainttool.c
==============================================================================
--- branches/soc-2008-tagging/app/tools/gimppainttool.c	(original)
+++ branches/soc-2008-tagging/app/tools/gimppainttool.c	Sun Jul 20 16:34:08 2008
@@ -274,7 +274,6 @@
   GimpPaintOptions *paint_options = GIMP_PAINT_TOOL_GET_OPTIONS (tool);
   GimpPaintCore    *core          = paint_tool->core;
   GimpDrawable     *drawable;
-  GdkDisplay       *gdk_display;
   GimpCoords        curr_coords;
   gint              off_x, off_y;
   GError           *error = NULL;
@@ -311,11 +310,6 @@
       tool->display = display;
     }
 
-  gdk_display = gtk_widget_get_display (display->shell);
-
-  core->use_pressure = (gimp_devices_get_current (display->image->gimp) !=
-                        gdk_display_get_core_pointer (gdk_display));
-
   if (! gimp_paint_core_start (core, drawable, paint_options, &curr_coords,
                                &error))
     {
@@ -345,7 +339,6 @@
               GIMP_BRUSH_HARD);
 
       core->start_coords = core->last_coords;
-      core->use_pressure = FALSE;
 
       gimp_paint_tool_round_line (core, hard, state);
     }

Modified: branches/soc-2008-tagging/app/unique.c
==============================================================================
--- branches/soc-2008-tagging/app/unique.c	(original)
+++ branches/soc-2008-tagging/app/unique.c	Sun Jul 20 16:34:08 2008
@@ -58,6 +58,7 @@
 #endif
 }
 
+#ifndef GIMP_CONSOLE_COMPILATION
 static gchar *
 gimp_unique_filename_to_uri (const gchar  *filename,
 			     const gchar  *cwd,
@@ -87,6 +88,8 @@
 
   return uri;
 }
+#endif
+
 
 #if HAVE_DBUS_GLIB
 
@@ -97,7 +100,7 @@
 #ifndef GIMP_CONSOLE_COMPILATION
 
 /*  for the DBus service names  */
-#include "widgets/gimpdbusservice.h"
+#include "gui/gimpdbusservice.h"
 
   DBusGConnection *connection = dbus_g_bus_get (DBUS_BUS_SESSION, NULL);
 
@@ -188,32 +191,43 @@
 
   if (window_handle)
     {
-      COPYDATASTRUCT  copydata;
-      gchar          *cwd   = g_get_current_dir ();
-      GError         *error = NULL;
-      gint            i;
-	
-      for (i = 0; filenames[i]; i++)
-	{
-	  gchar *uri = gimp_unique_filename_to_uri (filenames[i], cwd, &error);
+      COPYDATASTRUCT  copydata = { 0, };
 
-	  if (uri)
-	    {
-	      copydata.lpData = uri;
-	      copydata.cbData = strlen (uri) + 1;  /* size in bytes   */
-	      copydata.dwData = (long) as_new;
-
-	      SendMessage (window_handle,
-			   WM_COPYDATA, window_handle, &copydata);
-	    }
-	  else
-	    {
-	      g_printerr ("conversion to uri failed: %s\n", error->message);
-	      g_clear_error (&error);
-	    }
-	}
+      if (filenames)
+        {
+          gchar  *cwd   = g_get_current_dir ();
+          GError *error = NULL;
+          gint    i;
+
+          for (i = 0; filenames[i]; i++)
+            {
+              gchar *uri;
+
+              uri = gimp_unique_filename_to_uri (filenames[i], cwd, &error);
+
+              if (uri)
+                {
+                  copydata.lpData = uri;
+                  copydata.cbData = strlen (uri) + 1;  /* size in bytes   */
+                  copydata.dwData = (long) as_new;
 
-      g_free (cwd);
+                  SendMessage (window_handle,
+                               WM_COPYDATA, window_handle, &copydata);
+                }
+              else
+                {
+                  g_printerr ("conversion to uri failed: %s\n", error->message);
+                  g_clear_error (&error);
+                }
+            }
+
+          g_free (cwd);
+        }
+      else
+        {
+          SendMessage (window_handle,
+                       WM_COPYDATA, window_handle, &copydata);
+        }
 
       return TRUE;
     }

Modified: branches/soc-2008-tagging/app/vectors/gimpbezierstroke.c
==============================================================================
--- branches/soc-2008-tagging/app/vectors/gimpbezierstroke.c	(original)
+++ branches/soc-2008-tagging/app/vectors/gimpbezierstroke.c	Sun Jul 20 16:34:08 2008
@@ -245,11 +245,12 @@
 }
 
 static void
-gimp_bezier_stroke_anchor_delete (GimpStroke        *stroke,
-                                  GimpAnchor        *anchor)
+gimp_bezier_stroke_anchor_delete (GimpStroke *stroke,
+                                  GimpAnchor *anchor)
 {
-  GList *list, *list2;
-  gint i;
+  GList *list;
+  GList *list2;
+  gint   i;
 
   /* Anchors always are surrounded by two handles that have to
    * be deleted too */
@@ -271,7 +272,8 @@
 gimp_bezier_stroke_open (GimpStroke *stroke,
                          GimpAnchor *end_anchor)
 {
-  GList *list, *list2;
+  GList      *list;
+  GList      *list2;
   GimpStroke *new_stroke = NULL;
 
   list = g_list_find (stroke->anchors, end_anchor);
@@ -318,10 +320,12 @@
                                   GimpAnchor *predec,
                                   gdouble     position)
 {
-  GList *segment_start, *list, *list2;
-  GimpCoords subdivided[8];
-  GimpCoords beziercoords[4];
-  gint i;
+  GList      *segment_start;
+  GList      *list;
+  GList      *list2;
+  GimpCoords  subdivided[8];
+  GimpCoords  beziercoords[4];
+  gint        i;
 
   segment_start = g_list_find (stroke->anchors, predec);
 
@@ -424,10 +428,11 @@
                                         const GimpCoords      *deltacoord,
                                         GimpAnchorFeatureType  feature)
 {
-  GimpCoords offsetcoords[2];
-  GList      *segment_start, *list;
+  GimpCoords  offsetcoords[2];
+  GList      *segment_start;
+  GList      *list;
   gint        i;
-  gdouble feel_good;
+  gdouble     feel_good;
 
   segment_start = g_list_find (stroke->anchors, predec);
 
@@ -480,7 +485,8 @@
   GimpCoords  deltacoord;
   GimpCoords  tmp1, tmp2, abs_pos;
   GimpCoords  beziercoords[4];
-  GList      *segment_start, *list;
+  GList      *segment_start;
+  GList      *list;
   gint        i;
 
   segment_start = g_list_find (stroke->anchors, predec);
@@ -514,7 +520,8 @@
 static void
 gimp_bezier_stroke_close (GimpStroke *stroke)
 {
-  GList *start, *end;
+  GList      *start;
+  GList      *end;
   GimpAnchor *anchor;
 
   start = g_list_first (stroke->anchors);
@@ -569,7 +576,8 @@
   GimpCoords  point;
   GimpCoords  segmentcoords[4];
   GList      *anchorlist;
-  GimpAnchor *segment_start, *segment_end = NULL;
+  GimpAnchor *segment_start;
+  GimpAnchor *segment_end = NULL;
   GimpAnchor *anchor;
   gint        count;
 
@@ -671,9 +679,9 @@
    */
 
   GimpCoords subdivided[8];
-  gdouble dist1, dist2;
+  gdouble    dist1, dist2;
   GimpCoords point1, point2;
-  gdouble pos1, pos2;
+  gdouble    pos1, pos2;
 
   gimp_coords_difference (&beziercoords[1], &beziercoords[0], &point1);
   gimp_coords_difference (&beziercoords[3], &beziercoords[2], &point2);
@@ -683,8 +691,8 @@
                  && gimp_coords_length_squared (&point2) < precision))
     {
       GimpCoords line, dcoord;
-      gdouble length2, scalar;
-      gint i;
+      gdouble    length2, scalar;
+      gint       i;
 
       gimp_coords_difference (&(beziercoords[3]),
                               &(beziercoords[0]),
@@ -794,7 +802,8 @@
   GimpCoords  point;
   GimpCoords  segmentcoords[4];
   GList      *anchorlist;
-  GimpAnchor *segment_start, *segment_end = NULL;
+  GimpAnchor *segment_start;
+  GimpAnchor *segment_end = NULL;
   GimpAnchor *anchor;
   gint        count;
 
@@ -889,10 +898,12 @@
                                                 GimpCoords       *ret_point,
                                                 gdouble          *ret_pos)
 {
-  GArray *ret_coords, *ret_params;
-  GimpCoords dir, line, dcoord, min_point;
-  gdouble min_dist = -1, dist, length2, scalar, ori, ori2;
-  gint i;
+  GArray     *ret_coords;
+  GArray     *ret_params;
+  GimpCoords  dir, line, dcoord, min_point;
+  gdouble     min_dist = -1;
+  gdouble     dist, length2, scalar, ori, ori2;
+  gint        i;
 
   gimp_coords_difference (coord2, coord1, &line);
 
@@ -1274,7 +1285,8 @@
                                    GimpStroke *extension,
                                    GimpAnchor *neighbor)
 {
-  GList *list1, *list2;
+  GList *list1;
+  GList *list2;
 
   list1 = g_list_find (stroke->anchors, anchor);
   list1 = gimp_bezier_stroke_get_anchor_listitem (list1);
@@ -1446,10 +1458,11 @@
 static GimpBezierDesc *
 gimp_bezier_stroke_make_bezier (const GimpStroke *stroke)
 {
-  GArray *points, *cmd_array;
-  GimpBezierDesc *bezdesc;
+  GArray            *points;
+  GArray            *cmd_array;
+  GimpBezierDesc    *bezdesc;
   cairo_path_data_t  pathdata;
-  gint num_cmds, i;
+  gint               num_cmds, i;
 
   points = gimp_stroke_control_points_get (stroke, NULL);
 
@@ -1701,7 +1714,8 @@
 }
 
 static gdouble
-arcto_circleparam (gdouble h, gdouble *y)
+arcto_circleparam (gdouble  h,
+                   gdouble *y)
 {
   gdouble t0 = 0.5;
   gdouble dt = 0.25;
@@ -1737,7 +1751,9 @@
 }
 
 static void
-arcto_subdivide (gdouble t, gint part, GimpCoords *p)
+arcto_subdivide (gdouble     t,
+                 gint        part,
+                 GimpCoords *p)
 {
   GimpCoords p01, p12, p23, p012, p123, p0123;
 
@@ -2145,7 +2161,7 @@
    */
 
   GimpCoords subdivided[8];
-  gdouble middle_t = (start_t + end_t) / 2;
+  gdouble    middle_t = (start_t + end_t) / 2;
 
   subdivided[0] = beziercoords[0];
   subdivided[6] = beziercoords[3];
@@ -2184,12 +2200,15 @@
                                                 precision)) /* 1st half */
     {
       *ret_coords = g_array_append_vals (*ret_coords, &(subdivided[0]), 3);
+
       if (ret_params)
         {
           gdouble params[3];
+
           params[0] = start_t;
           params[1] = (2 * start_t + middle_t) / 3;
           params[2] = (start_t + 2 * middle_t) / 3;
+
           *ret_params = g_array_append_vals (*ret_params, &(params[0]), 3);
         }
     }
@@ -2205,12 +2224,15 @@
                                                 precision)) /* 2nd half */
     {
       *ret_coords = g_array_append_vals (*ret_coords, &(subdivided[3]), 3);
+
       if (ret_params)
         {
           gdouble params[3];
+
           params[0] = middle_t;
           params[1] = (2 * middle_t + end_t) / 3;
           params[2] = (middle_t + 2 * end_t) / 3;
+
           *ret_params = g_array_append_vals (*ret_params, &(params[0]), 3);
         }
     }

Modified: branches/soc-2008-tagging/app/widgets/Makefile.am
==============================================================================
--- branches/soc-2008-tagging/app/widgets/Makefile.am	(original)
+++ branches/soc-2008-tagging/app/widgets/Makefile.am	Sun Jul 20 16:34:08 2008
@@ -11,8 +11,6 @@
 	-I$(top_builddir)/app	\
 	-I$(top_srcdir)/app	\
 	$(GTK_CFLAGS)		\
-	$(PANGOFT2_CFLAGS)	\
-	$(DBUS_GLIB_CFLAGS)	\
 	-I$(includedir)
 
 noinst_LIBRARIES = libappwidgets.a
@@ -112,8 +110,6 @@
 	gimpdataeditor.h		\
 	gimpdatafactoryview.c		\
 	gimpdatafactoryview.h		\
-	gimpdbusservice.c		\
-	gimpdbusservice.h		\
 	gimpdeviceinfo.c		\
 	gimpdeviceinfo.h		\
 	gimpdevices.c			\
@@ -354,30 +350,21 @@
 	gtkvwrapbox.c			\
 	gtkvwrapbox.h
 
-libappwidgets_a_built_sources = gimpdbusservice-glue.h widgets-enums.c
+libappwidgets_a_built_sources = widgets-enums.c
 
 libappwidgets_a_SOURCES = \
 	$(libappwidgets_a_built_sources) $(libappwidgets_a_sources)
 
-EXTRA_DIST = \
-	dbus-service.xml	\
-	makefile.msc
+EXTRA_DIST = makefile.msc
 
 
 #
 # rules to generate built sources
 #
 # setup autogeneration dependencies
-gen_sources = xgen-wec gimpdbusservice-glue.h
+gen_sources = xgen-wec
 CLEANFILES = $(gen_sources)
 
-
-$(srcdir)/gimpdbusservice.c: gimpdbusservice-glue.h
-
-gimpdbusservice-glue.h: $(srcdir)/dbus-service.xml
-	$(DBUS_BINDING_TOOL) --mode=glib-server --prefix=gimp $< > $(@F)
-
-
 widgets-enums.c: $(srcdir)/widgets-enums.h $(GIMP_MKENUMS)
 	$(GIMP_MKENUMS) \
 		--fhead "#include \"config.h\"\n#include <gtk/gtk.h>\n#include \"libgimpbase/gimpbase.h\"\n#include \"widgets-enums.h\"\n#include \"gimp-intl.h\"" \

Modified: branches/soc-2008-tagging/app/widgets/gimpcontrollerkeyboard.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpcontrollerkeyboard.c	(original)
+++ branches/soc-2008-tagging/app/widgets/gimpcontrollerkeyboard.c	Sun Jul 20 16:34:08 2008
@@ -66,103 +66,103 @@
 static KeyboardEvent keyboard_events[] =
 {
   { GDK_Up, GDK_MOD1_MASK | GDK_CONTROL_MASK | GDK_SHIFT_MASK,
-    "key-up-shift-control-alt",
+    "cursor-up-shift-control-alt",
     N_("Cursor Up") },
   { GDK_Up, GDK_MOD1_MASK | GDK_CONTROL_MASK,
-    "key-up-control-alt",
+    "cursor-up-control-alt",
     N_("Cursor Up") },
   { GDK_Up, GDK_MOD1_MASK | GDK_SHIFT_MASK,
-    "key-up-shift-alt",
+    "cursor-up-shift-alt",
     N_("Cursor Up") },
   { GDK_Up, GDK_CONTROL_MASK | GDK_SHIFT_MASK,
-    "key-up-shift-control",
+    "cursor-up-shift-control",
     N_("Cursor Up") },
   { GDK_Up, GDK_MOD1_MASK,
-    "key-up-alt",
+    "cursor-up-alt",
     N_("Cursor Up") },
   { GDK_Up, GDK_CONTROL_MASK,
-    "key-up-control",
+    "cursor-up-control",
     N_("Cursor Up") },
   { GDK_Up, GDK_SHIFT_MASK,
-    "key-up-shift",
+    "cursor-up-shift",
     N_("Cursor Up") },
   { GDK_Up, 0,
-    "key-up",
+    "cursor-up",
     N_("Cursor Up") },
 
   { GDK_Down, GDK_MOD1_MASK | GDK_CONTROL_MASK | GDK_SHIFT_MASK,
-    "key-down-shift-control-alt",
+    "cursor-down-shift-control-alt",
     N_("Cursor Down") },
   { GDK_Down, GDK_MOD1_MASK | GDK_CONTROL_MASK,
-    "key-down-control-alt",
+    "cursor-down-control-alt",
     N_("Cursor Down") },
   { GDK_Down, GDK_MOD1_MASK | GDK_SHIFT_MASK,
-    "key-down-shift-alt",
+    "cursor-down-shift-alt",
     N_("Cursor Down") },
   { GDK_Down, GDK_CONTROL_MASK | GDK_SHIFT_MASK,
-    "key-down-shift-control",
+    "cursor-down-shift-control",
     N_("Cursor Down") },
   { GDK_Down, GDK_MOD1_MASK,
-    "key-down-alt",
+    "cursor-down-alt",
     N_("Cursor Down") },
   { GDK_Down, GDK_CONTROL_MASK,
-    "key-down-control",
+    "cursor-down-control",
     N_("Cursor Down") },
   { GDK_Down, GDK_SHIFT_MASK,
-    "key-down-shift",
+    "cursor-down-shift",
     N_("Cursor Down") },
   { GDK_Down, 0,
-    "key-down",
+    "cursor-down",
     N_("Cursor Down") },
 
   { GDK_Left, GDK_MOD1_MASK | GDK_CONTROL_MASK | GDK_SHIFT_MASK,
-    "key-left-shift-control-alt",
+    "cursor-left-shift-control-alt",
     N_("Cursor Left") },
   { GDK_Left, GDK_MOD1_MASK | GDK_CONTROL_MASK,
-    "key-left-control-alt",
+    "cursor-left-control-alt",
     N_("Cursor Left") },
   { GDK_Left, GDK_MOD1_MASK | GDK_SHIFT_MASK,
-    "key-left-shift-alt",
+    "cursor-left-shift-alt",
     N_("Cursor Left") },
   { GDK_Left, GDK_CONTROL_MASK | GDK_SHIFT_MASK,
-    "key-left-shift-control",
+    "cursor-left-shift-control",
     N_("Cursor Left") },
   { GDK_Left, GDK_MOD1_MASK,
-    "key-left-alt",
+    "cursor-left-alt",
     N_("Cursor Left") },
   { GDK_Left, GDK_CONTROL_MASK,
-    "key-left-control",
+    "cursor-left-control",
     N_("Cursor Left") },
   { GDK_Left, GDK_SHIFT_MASK,
-    "key-left-shift",
+    "cursor-left-shift",
     N_("Cursor Left") },
   { GDK_Left, 0,
-    "key-left",
+    "cursor-left",
     N_("Cursor Left") },
 
   { GDK_Right, GDK_MOD1_MASK | GDK_CONTROL_MASK | GDK_SHIFT_MASK,
-    "key-right-shift-control-alt",
+    "cursor-right-shift-control-alt",
     N_("Cursor Right") },
   { GDK_Right, GDK_MOD1_MASK | GDK_CONTROL_MASK,
-    "key-right-control-alt",
+    "cursor-right-control-alt",
     N_("Cursor Right") },
   { GDK_Right, GDK_MOD1_MASK | GDK_SHIFT_MASK,
-    "key-right-shift-alt",
+    "cursor-right-shift-alt",
     N_("Cursor Right") },
   { GDK_Right, GDK_CONTROL_MASK | GDK_SHIFT_MASK,
-    "key-right-shift-control",
+    "cursor-right-shift-control",
     N_("Cursor Right") },
   { GDK_Right, GDK_MOD1_MASK,
-    "key-right-alt",
+    "cursor-right-alt",
     N_("Cursor Right") },
   { GDK_Right, GDK_CONTROL_MASK,
-    "key-right-control",
+    "cursor-right-control",
     N_("Cursor Right") },
   { GDK_Right, GDK_SHIFT_MASK,
-    "key-right-shift",
+    "cursor-right-shift",
     N_("Cursor Right") },
   { GDK_Right, 0,
-    "key-right",
+    "cursor-right",
     N_("Cursor Right") }
 };
 

Modified: branches/soc-2008-tagging/app/widgets/gimpgradientselect.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpgradientselect.c	(original)
+++ branches/soc-2008-tagging/app/widgets/gimpgradientselect.c	Sun Jul 20 16:34:08 2008
@@ -95,6 +95,7 @@
                                   GObjectConstructParam *params)
 {
   GObject       *object;
+  GtkWidget	    *show;
   GimpPdbDialog *dialog;
 
   object = G_OBJECT_CLASS (parent_class)->constructor (type, n_params, params);
@@ -116,6 +117,9 @@
 
   gtk_container_set_border_width (GTK_CONTAINER (dialog->view), 12);
   gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), dialog->view);
+  show = gtk_label_new ("text test");
+  gtk_widget_show (show);
+  gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), show);
   gtk_widget_show (dialog->view);
 
   return object;

Modified: branches/soc-2008-tagging/app/widgets/gimpnavigationview.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpnavigationview.c	(original)
+++ branches/soc-2008-tagging/app/widgets/gimpnavigationview.c	Sun Jul 20 16:34:08 2008
@@ -50,6 +50,30 @@
 };
 
 
+struct _GimpNavigationView
+{
+  GimpView     parent_instance;
+
+  /*  values in image coordinates  */
+  gdouble      x;
+  gdouble      y;
+  gdouble      width;
+  gdouble      height;
+
+  /*  values in view coordinates  */
+  gint         p_x;
+  gint         p_y;
+  gint         p_width;
+  gint         p_height;
+
+  gint         motion_offset_x;
+  gint         motion_offset_y;
+  gboolean     has_grab;
+
+  GdkGC       *gc;
+};
+
+
 static void     gimp_navigation_view_realize        (GtkWidget      *widget);
 static void     gimp_navigation_view_unrealize      (GtkWidget      *widget);
 static void     gimp_navigation_view_size_allocate  (GtkWidget      *widget,
@@ -135,7 +159,6 @@
 
   gtk_widget_add_events (GTK_WIDGET (view), (GDK_POINTER_MOTION_MASK |
                                              GDK_KEY_PRESS_MASK));
-
   view->x               = 0.0;
   view->y               = 0.0;
   view->width           = 0.0;
@@ -575,3 +598,29 @@
   if (GTK_WIDGET_DRAWABLE (view))
     gimp_navigation_view_draw_marker (nav_view, NULL);
 }
+
+void
+gimp_navigation_view_set_motion_offset (GimpNavigationView *view,
+                                        gint                motion_offset_x,
+                                        gint                motion_offset_y)
+{
+  g_return_if_fail (GIMP_IS_NAVIGATION_VIEW (view));
+
+  view->motion_offset_x = motion_offset_x;
+  view->motion_offset_y = motion_offset_y;
+}
+
+void
+gimp_navigation_view_get_local_marker (GimpNavigationView *view,
+                                       gint               *x,
+                                       gint               *y,
+                                       gint               *width,
+                                       gint               *height)
+{
+  g_return_if_fail (GIMP_IS_NAVIGATION_VIEW (view));
+
+  if (x)      *x      = view->p_x;
+  if (y)      *y      = view->p_y;
+  if (width)  *width  = view->p_width;
+  if (height) *height = view->p_height;
+}

Modified: branches/soc-2008-tagging/app/widgets/gimpnavigationview.h
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimpnavigationview.h	(original)
+++ branches/soc-2008-tagging/app/widgets/gimpnavigationview.h	Sun Jul 20 16:34:08 2008
@@ -38,29 +38,6 @@
 
 typedef struct _GimpNavigationViewClass  GimpNavigationViewClass;
 
-struct _GimpNavigationView
-{
-  GimpView     parent_instance;
-
-  /*  values in image coordinates  */
-  gdouble      x;
-  gdouble      y;
-  gdouble      width;
-  gdouble      height;
-
-  /*  values in view coordinates  */
-  gint         p_x;
-  gint         p_y;
-  gint         p_width;
-  gint         p_height;
-
-  gint         motion_offset_x;
-  gint         motion_offset_y;
-  gboolean     has_grab;
-
-  GdkGC       *gc;
-};
-
 struct _GimpNavigationViewClass
 {
   GimpViewClass  parent_class;
@@ -82,6 +59,16 @@
                                            gdouble             y,
                                            gdouble             width,
                                            gdouble             height);
+void    gimp_navigation_view_set_motion_offset
+                                          (GimpNavigationView *view,
+                                           gint                motion_offset_x,
+                                           gint                motion_offset_y);
+void    gimp_navigation_view_get_local_marker
+                                          (GimpNavigationView *view,
+                                           gint               *x,
+                                           gint               *y,
+                                           gint               *width,
+                                           gint               *height);
 void    gimp_navigation_view_grab_pointer (GimpNavigationView *view);
 
 

Modified: branches/soc-2008-tagging/app/xcf/xcf-load.c
==============================================================================
--- branches/soc-2008-tagging/app/xcf/xcf-load.c	(original)
+++ branches/soc-2008-tagging/app/xcf/xcf-load.c	Sun Jul 20 16:34:08 2008
@@ -1735,7 +1735,7 @@
       guint32      num_axes;
       guint32      num_control_points;
       guint32      type;
-      gfloat       coords[6] = GIMP_COORDS_DEFAULT_VALUES;
+      gfloat       coords[7] = GIMP_COORDS_DEFAULT_VALUES;
       GimpStroke  *stroke;
       gint         j;
 

Modified: branches/soc-2008-tagging/configure.in
==============================================================================
--- branches/soc-2008-tagging/configure.in	(original)
+++ branches/soc-2008-tagging/configure.in	Sun Jul 20 16:34:08 2008
@@ -8,7 +8,7 @@
 
 m4_define([gimp_major_version], [2])
 m4_define([gimp_minor_version], [5])
-m4_define([gimp_micro_version], [2])
+m4_define([gimp_micro_version], [3])
 m4_define([gimp_real_version],
           [gimp_major_version.gimp_minor_version.gimp_micro_version])
 m4_define([gimp_version], [gimp_real_version])

Modified: branches/soc-2008-tagging/devel-docs/libgimp/libgimp-sections.txt
==============================================================================
--- branches/soc-2008-tagging/devel-docs/libgimp/libgimp-sections.txt	(original)
+++ branches/soc-2008-tagging/devel-docs/libgimp/libgimp-sections.txt	Sun Jul 20 16:34:08 2008
@@ -636,6 +636,7 @@
 gimp_palette_rename
 gimp_palette_delete
 gimp_palette_get_info
+gimp_palette_get_colors
 gimp_palette_get_columns
 gimp_palette_set_columns
 gimp_palette_add_entry

Modified: branches/soc-2008-tagging/devel-docs/libgimp/tmpl/gimppalette.sgml
==============================================================================
--- branches/soc-2008-tagging/devel-docs/libgimp/tmpl/gimppalette.sgml	(original)
+++ branches/soc-2008-tagging/devel-docs/libgimp/tmpl/gimppalette.sgml	Sun Jul 20 16:34:08 2008
@@ -64,6 +64,16 @@
 @Returns: 
 
 
+<!-- ##### FUNCTION gimp_palette_get_colors ##### -->
+<para>
+
+</para>
+
+ name: 
+ num_colors: 
+ Returns: 
+
+
 <!-- ##### FUNCTION gimp_palette_get_columns ##### -->
 <para>
 

Modified: branches/soc-2008-tagging/devel-docs/libgimpbase/tmpl/gimpbaseenums.sgml
==============================================================================
--- branches/soc-2008-tagging/devel-docs/libgimpbase/tmpl/gimpbaseenums.sgml	(original)
+++ branches/soc-2008-tagging/devel-docs/libgimpbase/tmpl/gimpbaseenums.sgml	Sun Jul 20 16:34:08 2008
@@ -232,12 +232,13 @@
 @GIMP_PDB_CHANNEL: 
 @GIMP_PDB_DRAWABLE: 
 @GIMP_PDB_SELECTION: 
- GIMP_PDB_BOUNDARY: 
+ GIMP_PDB_COLORARRAY: 
 @GIMP_PDB_VECTORS: 
 @GIMP_PDB_PARASITE: 
 @GIMP_PDB_STATUS: 
 @GIMP_PDB_END: 
 @GIMP_PDB_PATH: 
+ GIMP_PDB_BOUNDARY: 
 
 <!-- ##### ENUM GimpPDBProcType ##### -->
 <para>

Modified: branches/soc-2008-tagging/docs/gimprc.5.in
==============================================================================
--- branches/soc-2008-tagging/docs/gimprc.5.in	(original)
+++ branches/soc-2008-tagging/docs/gimprc.5.in	Sun Jul 20 16:34:08 2008
@@ -222,11 +222,11 @@
 
 .TP
 (default-grid
-    (style intersections)
+    (style solid)
     (fgcolor (color-rgba 0.000000 0.000000 0.000000 1.000000))
     (bgcolor (color-rgba 1.000000 1.000000 1.000000 1.000000))
-    (xspacing 32.000000)
-    (yspacing 32.000000)
+    (xspacing 10.000000)
+    (yspacing 10.000000)
     (spacing-unit inches)
     (xoffset 0.000000)
     (yoffset 0.000000)

Modified: branches/soc-2008-tagging/etc/controllerrc
==============================================================================
--- branches/soc-2008-tagging/etc/controllerrc	(original)
+++ branches/soc-2008-tagging/etc/controllerrc	Sun Jul 20 16:34:08 2008
@@ -21,22 +21,18 @@
     (debug-events no)
     (controller "GimpControllerKeyboard")
     (mapping
-        (map "key-up"            "view-scroll-up")
-        (map "key-down"          "view-scroll-down")
-        (map "key-left"          "view-scroll-left")
-        (map "key-right"         "view-scroll-right")
-        (map "key-up-shift"      "view-scroll-page-up")
-        (map "key-down-shift"    "view-scroll-page-down")
-        (map "key-left-shift"    "view-scroll-page-left")
-        (map "key-right-shift"   "view-scroll-page-right")
-        (map "key-up-control"    "view-scroll-top-border")
-        (map "key-down-control"  "view-scroll-bottom-border")
-        (map "key-left-control"  "view-scroll-left-border")
-        (map "key-right-control" "view-scroll-right-border")
-        (map "key-up-alt"        "tools-value-1-increase-skip")
-        (map "key-down-alt"      "tools-value-1-decrease-skip")
-        (map "key-left-alt"      "tools-value-1-decrease")
-        (map "key-right-alt"     "tools-value-1-increase")))
+        (map "cursor-up-shift"      "view-scroll-page-up")
+        (map "cursor-down-shift"    "view-scroll-page-down")
+        (map "cursor-left-shift"    "view-scroll-page-left")
+        (map "cursor-right-shift"   "view-scroll-page-right")
+        (map "cursor-up-control"    "view-scroll-top-border")
+        (map "cursor-down-control"  "view-scroll-bottom-border")
+        (map "cursor-left-control"  "view-scroll-left-border")
+        (map "cursor-right-control" "view-scroll-right-border")
+        (map "cursor-up-alt"        "tools-value-1-increase-skip")
+        (map "cursor-down-alt"      "tools-value-1-decrease-skip")
+        (map "cursor-left-alt"      "tools-value-1-decrease")
+        (map "cursor-right-alt"     "tools-value-1-increase")))
 
 # (GimpControllerInfo "Linux Input Example"
 #    (enabled yes)

Modified: branches/soc-2008-tagging/etc/gimprc
==============================================================================
--- branches/soc-2008-tagging/etc/gimprc	(original)
+++ branches/soc-2008-tagging/etc/gimprc	Sun Jul 20 16:34:08 2008
@@ -172,11 +172,11 @@
 # Specify a default image grid.  This is a parameter list.
 # 
 # (default-grid
-#     (style intersections)
+#     (style solid)
 #     (fgcolor (color-rgba 0.000000 0.000000 0.000000 1.000000))
 #     (bgcolor (color-rgba 1.000000 1.000000 1.000000 1.000000))
-#     (xspacing 32.000000)
-#     (yspacing 32.000000)
+#     (xspacing 10.000000)
+#     (yspacing 10.000000)
 #     (spacing-unit inches)
 #     (xoffset 0.000000)
 #     (yoffset 0.000000)

Modified: branches/soc-2008-tagging/libgimp/gimp.c
==============================================================================
--- branches/soc-2008-tagging/libgimp/gimp.c	(original)
+++ branches/soc-2008-tagging/libgimp/gimp.c	Sun Jul 20 16:34:08 2008
@@ -736,7 +736,6 @@
         case GIMP_PDB_CHANNEL:
         case GIMP_PDB_DRAWABLE:
         case GIMP_PDB_SELECTION:
-        case GIMP_PDB_BOUNDARY:
         case GIMP_PDB_VECTORS:
         case GIMP_PDB_STATUS:
           (void) va_arg (args, gint);
@@ -769,6 +768,7 @@
           (void) va_arg (args, gchar **);
           break;
         case GIMP_PDB_COLOR:
+	case GIMP_PDB_COLORARRAY:
           (void) va_arg (args, GimpRGB *);
           break;
         case GIMP_PDB_PARASITE:
@@ -850,8 +850,8 @@
         case GIMP_PDB_SELECTION:
           params[i].data.d_selection = va_arg (args, gint32);
           break;
-        case GIMP_PDB_BOUNDARY:
-          params[i].data.d_boundary = va_arg (args, gint32);
+        case GIMP_PDB_COLORARRAY:
+          params[i].data.d_colorarray = va_arg (args, GimpRGB *);
           break;
         case GIMP_PDB_VECTORS:
           params[i].data.d_vectors = va_arg (args, gint32);

Modified: branches/soc-2008-tagging/libgimp/gimp.def
==============================================================================
--- branches/soc-2008-tagging/libgimp/gimp.def	(original)
+++ branches/soc-2008-tagging/libgimp/gimp.def	Sun Jul 20 16:34:08 2008
@@ -460,6 +460,7 @@
 	gimp_palette_entry_set_color
 	gimp_palette_entry_set_name
 	gimp_palette_get_background
+	gimp_palette_get_colors
 	gimp_palette_get_columns
 	gimp_palette_get_foreground
 	gimp_palette_get_info

Modified: branches/soc-2008-tagging/libgimp/gimp.h
==============================================================================
--- branches/soc-2008-tagging/libgimp/gimp.h	(original)
+++ branches/soc-2008-tagging/libgimp/gimp.h	Sun Jul 20 16:34:08 2008
@@ -128,6 +128,7 @@
   guint8           *d_int8array;
   gdouble          *d_floatarray;
   gchar           **d_stringarray;
+  GimpRGB          *d_colorarray;
   GimpRGB           d_color;
   GimpParamRegion   d_region;
   gint32            d_display;

Modified: branches/soc-2008-tagging/libgimp/gimpedit_pdb.c
==============================================================================
--- branches/soc-2008-tagging/libgimp/gimpedit_pdb.c	(original)
+++ branches/soc-2008-tagging/libgimp/gimpedit_pdb.c	Sun Jul 20 16:34:08 2008
@@ -36,9 +36,11 @@
  * internal GIMP edit buffer. It can subsequently be retrieved using
  * the gimp_edit_paste() command. If there is no selection, then the
  * specified drawable will be removed and its contents stored in the
- * internal GIMP edit buffer.
+ * internal GIMP edit buffer. This procedure will fail if the selected
+ * area lies completely outside the bounds of the current drawable and
+ * there is nothing to copy from.
  *
- * Returns: TRUE if the cut was successful, FALSE if the selection contained only transparent pixels.
+ * Returns: TRUE if the cut was successful, FALSE if there was nothing to copy from.
  */
 gboolean
 gimp_edit_cut (gint32 drawable_ID)
@@ -71,9 +73,11 @@
  * internal GIMP edit buffer. It can subsequently be retrieved using
  * the gimp_edit_paste() command. If there is no selection, then the
  * specified drawable's contents will be stored in the internal GIMP
- * edit buffer.
+ * edit buffer. This procedure will fail if the selected area lies
+ * completely outside the bounds of the current drawable and there is
+ * nothing to copy from.
  *
- * Returns: TRUE if the copy was successful, FALSE if the selection contained only transparent pixels.
+ * Returns: TRUE if the cut was successful, FALSE if there was nothing to copy from.
  */
 gboolean
 gimp_edit_copy (gint32 drawable_ID)
@@ -108,7 +112,7 @@
  * projection's contents will be stored in the internal GIMP edit
  * buffer.
  *
- * Returns: TRUE if the copy was successful, FALSE if the selection contained only transparent pixels.
+ * Returns: TRUE if the copy was successful.
  *
  * Since: GIMP 2.2
  */
@@ -224,7 +228,7 @@
  * later pasting, regardless of any intermediate copy or cut
  * operations.
  *
- * Returns: The real name given to the buffer, or NULL if the selection contained only transparent pixels.
+ * Returns: The real name given to the buffer, or NULL if the cut failed.
  *
  * Since: GIMP 2.4
  */
@@ -262,7 +266,7 @@
  * later pasting, regardless of any intermediate copy or cut
  * operations.
  *
- * Returns: The real name given to the buffer, or NULL if the selection contained only transparent pixels.
+ * Returns: The real name given to the buffer, or NULL if the copy failed.
  *
  * Since: GIMP 2.4
  */
@@ -300,7 +304,7 @@
  * available for later pasting, regardless of any intermediate copy or
  * cut operations.
  *
- * Returns: The real name given to the buffer, or NULL if the selection contained only transparent pixels.
+ * Returns: The real name given to the buffer, or NULL if the copy failed.
  *
  * Since: GIMP 2.4
  */

Modified: branches/soc-2008-tagging/libgimp/gimppalette_pdb.c
==============================================================================
--- branches/soc-2008-tagging/libgimp/gimppalette_pdb.c	(original)
+++ branches/soc-2008-tagging/libgimp/gimppalette_pdb.c	Sun Jul 20 16:34:08 2008
@@ -23,6 +23,8 @@
 
 #include "config.h"
 
+#include <string.h>
+
 #include "gimp.h"
 
 /**
@@ -227,6 +229,48 @@
 }
 
 /**
+ * gimp_palette_get_colors:
+ * @name: The palette name.
+ * @num_colors: Length of the colors array.
+ *
+ * Gets all colors from the specified palette.
+ *
+ * This procedure retrieves all color entries of the specified palette.
+ *
+ * Returns: The colors in the palette.
+ *
+ * Since: GIMP 2.6
+ */
+GimpRGB *
+gimp_palette_get_colors (const gchar *name,
+                         gint        *num_colors)
+{
+  GimpParam *return_vals;
+  gint nreturn_vals;
+  GimpRGB *colors = NULL;
+
+  return_vals = gimp_run_procedure ("gimp-palette-get-colors",
+                                    &nreturn_vals,
+                                    GIMP_PDB_STRING, name,
+                                    GIMP_PDB_END);
+
+  *num_colors = 0;
+
+  if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
+    {
+      *num_colors = return_vals[1].data.d_int32;
+      colors = g_new (GimpRGB, *num_colors);
+      memcpy (colors,
+              return_vals[2].data.d_colorarray,
+              *num_colors * sizeof (GimpRGB));
+    }
+
+  gimp_destroy_params (return_vals, nreturn_vals);
+
+  return colors;
+}
+
+/**
  * gimp_palette_get_columns:
  * @name: The palette name.
  *

Modified: branches/soc-2008-tagging/libgimp/gimppalette_pdb.h
==============================================================================
--- branches/soc-2008-tagging/libgimp/gimppalette_pdb.h	(original)
+++ branches/soc-2008-tagging/libgimp/gimppalette_pdb.h	Sun Jul 20 16:34:08 2008
@@ -37,6 +37,8 @@
 gboolean gimp_palette_is_editable     (const gchar    *name);
 gboolean gimp_palette_get_info        (const gchar    *name,
                                        gint           *num_colors);
+GimpRGB* gimp_palette_get_colors      (const gchar    *name,
+                                       gint           *num_colors);
 gint     gimp_palette_get_columns     (const gchar    *name);
 gboolean gimp_palette_set_columns     (const gchar    *name,
                                        gint            columns);

Modified: branches/soc-2008-tagging/libgimp/gimpui.c
==============================================================================
--- branches/soc-2008-tagging/libgimp/gimpui.c	(original)
+++ branches/soc-2008-tagging/libgimp/gimpui.c	Sun Jul 20 16:34:08 2008
@@ -50,7 +50,7 @@
  * gimp_ui_init:
  * @prog_name: The name of the plug-in which will be passed as argv[0] to
  *             gtk_init(). It's a convention to use the name of the
- *             executable and _not_ the PDB procedure name or something.
+ *             executable and _not_ the PDB procedure name.
  * @preview:   This parameter is unused and exists for historical
  *             reasons only.
  *
@@ -58,8 +58,11 @@
  * image rendering subsystem (GdkRGB) to follow the GIMP main program's
  * colormap allocation/installation policy.
  *
- * GIMP's colormap policy can be determinded by the user with the
- * gimprc variables @min_colors and @install_cmap.
+ * It also sets up various other things so that the plug-in user looks
+ * and behaves like the GIMP core. This includes selecting the GTK+
+ * theme and setting up the help system as chosen in the GIMP
+ * preferences. Any plug-in that provides a user interface should call
+ * this function.
  **/
 void
 gimp_ui_init (const gchar *prog_name,

Modified: branches/soc-2008-tagging/libgimpbase/gimpbaseenums.c
==============================================================================
--- branches/soc-2008-tagging/libgimpbase/gimpbaseenums.c	(original)
+++ branches/soc-2008-tagging/libgimpbase/gimpbaseenums.c	Sun Jul 20 16:34:08 2008
@@ -815,12 +815,11 @@
     { GIMP_PDB_CHANNEL, "GIMP_PDB_CHANNEL", "channel" },
     { GIMP_PDB_DRAWABLE, "GIMP_PDB_DRAWABLE", "drawable" },
     { GIMP_PDB_SELECTION, "GIMP_PDB_SELECTION", "selection" },
-    { GIMP_PDB_BOUNDARY, "GIMP_PDB_BOUNDARY", "boundary" },
+    { GIMP_PDB_COLORARRAY, "GIMP_PDB_COLORARRAY", "colorarray" },
     { GIMP_PDB_VECTORS, "GIMP_PDB_VECTORS", "vectors" },
     { GIMP_PDB_PARASITE, "GIMP_PDB_PARASITE", "parasite" },
     { GIMP_PDB_STATUS, "GIMP_PDB_STATUS", "status" },
     { GIMP_PDB_END, "GIMP_PDB_END", "end" },
-    { GIMP_PDB_PATH, "GIMP_PDB_PATH", "path" },
     { 0, NULL, NULL }
   };
 
@@ -844,12 +843,11 @@
     { GIMP_PDB_CHANNEL, "GIMP_PDB_CHANNEL", NULL },
     { GIMP_PDB_DRAWABLE, "GIMP_PDB_DRAWABLE", NULL },
     { GIMP_PDB_SELECTION, "GIMP_PDB_SELECTION", NULL },
-    { GIMP_PDB_BOUNDARY, "GIMP_PDB_BOUNDARY", NULL },
+    { GIMP_PDB_COLORARRAY, "GIMP_PDB_COLORARRAY", NULL },
     { GIMP_PDB_VECTORS, "GIMP_PDB_VECTORS", NULL },
     { GIMP_PDB_PARASITE, "GIMP_PDB_PARASITE", NULL },
     { GIMP_PDB_STATUS, "GIMP_PDB_STATUS", NULL },
     { GIMP_PDB_END, "GIMP_PDB_END", NULL },
-    { GIMP_PDB_PATH, "GIMP_PDB_PATH", NULL },
     { 0, NULL, NULL }
   };
 

Modified: branches/soc-2008-tagging/libgimpbase/gimpbaseenums.h
==============================================================================
--- branches/soc-2008-tagging/libgimpbase/gimpbaseenums.h	(original)
+++ branches/soc-2008-tagging/libgimpbase/gimpbaseenums.h	Sun Jul 20 16:34:08 2008
@@ -373,13 +373,15 @@
   GIMP_PDB_CHANNEL,
   GIMP_PDB_DRAWABLE,
   GIMP_PDB_SELECTION,
-  GIMP_PDB_BOUNDARY,
+  GIMP_PDB_COLORARRAY,
   GIMP_PDB_VECTORS,
   GIMP_PDB_PARASITE,
   GIMP_PDB_STATUS,
   GIMP_PDB_END,
 
-  GIMP_PDB_PATH = GIMP_PDB_VECTORS /* deprecated */
+  /*  the following aliases are deprecated  */
+  GIMP_PDB_PATH     = GIMP_PDB_VECTORS,     /*< skip >*/
+  GIMP_PDB_BOUNDARY = GIMP_PDB_COLORARRAY   /*< skip >*/
 } GimpPDBArgType;
 
 

Modified: branches/soc-2008-tagging/libgimpbase/gimpprotocol.c
==============================================================================
--- branches/soc-2008-tagging/libgimpbase/gimpprotocol.c	(original)
+++ branches/soc-2008-tagging/libgimpbase/gimpprotocol.c	Sun Jul 20 16:34:08 2008
@@ -1481,11 +1481,17 @@
             goto cleanup;
           break;
 
-        case GIMP_PDB_BOUNDARY:
-          if (! _gimp_wire_read_int32 (channel,
-                                       (guint32 *) &(*params)[i].data.d_boundary, 1,
-                                       user_data))
-            goto cleanup;
+	case GIMP_PDB_COLORARRAY:
+	  (*params)[i].data.d_colorarray = g_new (GimpRGB,
+                                                  (*params)[i-1].data.d_int32);
+	  if (! _gimp_wire_read_color (channel,
+                                        (*params)[i].data.d_colorarray,
+                                        (*params)[i-1].data.d_int32,
+                                        user_data))
+	    {
+	      g_free ((*params)[i].data.d_colorarray);
+	      goto cleanup;
+	    }
           break;
 
         case GIMP_PDB_VECTORS:
@@ -1698,9 +1704,10 @@
             return;
           break;
 
-        case GIMP_PDB_BOUNDARY:
-          if (! _gimp_wire_write_int32 (channel,
-                                        (const guint32 *) &params[i].data.d_boundary, 1,
+        case GIMP_PDB_COLORARRAY:
+          if (! _gimp_wire_write_color (channel,
+                                        params[i].data.d_colorarray,
+                                        params[i-1].data.d_int32,
                                         user_data))
             return;
           break;
@@ -1773,7 +1780,6 @@
         case GIMP_PDB_CHANNEL:
         case GIMP_PDB_DRAWABLE:
         case GIMP_PDB_SELECTION:
-        case GIMP_PDB_BOUNDARY:
         case GIMP_PDB_VECTORS:
         case GIMP_PDB_STATUS:
           break;
@@ -1811,6 +1817,10 @@
             }
           break;
 
+        case GIMP_PDB_COLORARRAY:
+          g_free (params[i].data.d_colorarray);
+          break;
+
         case GIMP_PDB_PARASITE:
           if (params[i].data.d_parasite.name)
             g_free (params[i].data.d_parasite.name);

Modified: branches/soc-2008-tagging/libgimpbase/gimpprotocol.h
==============================================================================
--- branches/soc-2008-tagging/libgimpbase/gimpprotocol.h	(original)
+++ branches/soc-2008-tagging/libgimpbase/gimpprotocol.h	Sun Jul 20 16:34:08 2008
@@ -27,7 +27,7 @@
 
 /* Increment every time the protocol changes
  */
-#define GIMP_PROTOCOL_VERSION  0x0012
+#define GIMP_PROTOCOL_VERSION  0x0013
 
 
 enum
@@ -120,6 +120,7 @@
     guint8       *d_int8array;
     gdouble      *d_floatarray;
     gchar       **d_stringarray;
+    GimpRGB      *d_colorarray;
     GimpRGB       d_color;
     struct
     {

Modified: branches/soc-2008-tagging/plug-ins/help-browser/dialog.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/help-browser/dialog.c	(original)
+++ branches/soc-2008-tagging/plug-ins/help-browser/dialog.c	Sun Jul 20 16:34:08 2008
@@ -4,6 +4,7 @@
  * GIMP Help Browser
  * Copyright (C) 1999-2008 Sven Neumann <sven gimp org>
  *                         Michael Natterer <mitch gimp org>
+ *                         RÃman Joost <romanofski gimp org>
  *
  * dialog.c
  *
@@ -26,16 +27,11 @@
 
 #include <stdlib.h>
 #include <string.h>
-#include <errno.h>
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-
-#include <glib/gstdio.h>
 
 #include <gtk/gtk.h>
 
+#include <gdk/gdkkeysyms.h>
+
 #include <webkit/webkit.h>
 
 #include "libgimpwidgets/gimpwidgets.h"
@@ -43,10 +39,6 @@
 #include "libgimp/gimp.h"
 #include "libgimp/gimpui.h"
 
-#ifdef G_OS_WIN32
-#include "libgimpbase/gimpwin32-io.h"
-#endif
-
 #include "plug-ins/help/gimphelp.h"
 
 #include "gimpthrobber.h"
@@ -57,10 +49,6 @@
 
 #include "libgimp/stdplugins-intl.h"
 
-#ifndef _O_BINARY
-#define _O_BINARY 0
-#endif
-
 
 #define GIMP_HELP_BROWSER_DIALOG_DATA      "gimp-help-browser-dialog"
 
@@ -84,59 +72,77 @@
 
 /*  local function prototypes  */
 
-static GtkUIManager * ui_manager_new     (GtkWidget         *window);
-
-static void       back_callback          (GtkAction         *action,
-                                          gpointer           data);
-static void       forward_callback       (GtkAction         *action,
-                                          gpointer           data);
-static void       reload_callback        (GtkAction         *action,
-                                          gpointer           data);
-static void       stop_callback          (GtkAction         *action,
-                                          gpointer           data);
-static void       home_callback          (GtkAction         *action,
-                                          gpointer           data);
-static void       copy_location_callback (GtkAction         *action,
-                                          gpointer           data);
-static void       show_index_callback    (GtkAction         *action,
-                                          gpointer           data);
-static void       zoom_in_callback       (GtkAction         *action,
-                                          gpointer           data);
-static void       zoom_out_callback      (GtkAction         *action,
-                                          gpointer           data);
-static void       close_callback         (GtkAction         *action,
-                                          gpointer           data);
-static void       website_callback       (GtkAction         *action,
-                                          gpointer           data);
-
-static void       update_actions         (void);
-
-static void       window_set_icons       (GtkWidget         *window);
-
-static void       row_activated          (GtkTreeView       *tree_view,
-                                          GtkTreePath       *path,
-                                          GtkTreeViewColumn *column);
-static void       dialog_unmap           (GtkWidget         *window,
-                                          GtkWidget         *paned);
-
-static void       view_realize           (GtkWidget         *widget);
-static void       view_unrealize         (GtkWidget         *widget);
-static gboolean   view_popup_menu        (GtkWidget         *widget,
-                                          GdkEventButton    *event);
-static gboolean   view_button_press      (GtkWidget         *widget,
-                                          GdkEventButton    *event);
-
-static void       title_changed          (GtkWidget         *view,
-                                          WebKitWebFrame    *frame,
-                                          const gchar       *title,
-                                          GtkWidget         *window);
-static void       load_started           (GtkWidget         *view,
-                                          WebKitWebFrame    *frame);
-static void       load_finished          (GtkWidget         *view,
-                                          WebKitWebFrame    *frame);
+static GtkUIManager * ui_manager_new      (GtkWidget         *window);
 
-static void       select_index           (const gchar       *uri);
+static GtkWidget * build_searchbar        (void);
 
+static void       back_callback           (GtkAction         *action,
+                                           gpointer           data);
+static void       forward_callback        (GtkAction         *action,
+                                           gpointer           data);
+static void       reload_callback         (GtkAction         *action,
+                                           gpointer           data);
+static void       stop_callback           (GtkAction         *action,
+                                           gpointer           data);
+static void       home_callback           (GtkAction         *action,
+                                           gpointer           data);
+static void       find_callback           (GtkAction         *action,
+                                           gpointer           data);
+static void       find_again_callback     (GtkAction         *action,
+                                           gpointer           data);
+static void       copy_location_callback  (GtkAction         *action,
+                                           gpointer           data);
+static void       show_index_callback     (GtkAction         *action,
+                                           gpointer           data);
+static void       zoom_in_callback        (GtkAction         *action,
+                                           gpointer           data);
+static void       zoom_out_callback       (GtkAction         *action,
+                                           gpointer           data);
+static void       close_callback          (GtkAction         *action,
+                                           gpointer           data);
+static void       website_callback        (GtkAction         *action,
+                                           gpointer           data);
+
+static void       update_actions          (void);
+
+static void       window_set_icons        (GtkWidget         *window);
+
+static void       row_activated           (GtkTreeView       *tree_view,
+                                           GtkTreePath       *path,
+                                           GtkTreeViewColumn *column);
+static void       dialog_unmap            (GtkWidget         *window,
+                                           GtkWidget         *paned);
+
+static void       view_realize            (GtkWidget         *widget);
+static void       view_unrealize          (GtkWidget         *widget);
+static gboolean   view_popup_menu         (GtkWidget         *widget,
+                                           GdkEventButton    *event);
+static gboolean   view_button_press       (GtkWidget         *widget,
+                                           GdkEventButton    *event);
+static gboolean   view_key_press          (GtkWidget         *widget,
+                                           GdkEventKey       *event);
+
+static void       title_changed           (GtkWidget         *view,
+                                           WebKitWebFrame    *frame,
+                                           const gchar       *title,
+                                           GtkWidget         *window);
+static void       load_started            (GtkWidget         *view,
+                                           WebKitWebFrame    *frame);
+static void       load_finished           (GtkWidget         *view,
+                                           WebKitWebFrame    *frame);
+
+static void       select_index            (const gchar       *uri);
+
+static void       search_entry_changed    (GtkWidget         *entry);
+static gboolean   search_entry_key_press  (GtkWidget         *entry,
+                                           GdkEventKey       *event);
+static void       search_prev_clicked     (GtkWidget         *button,
+                                           GtkWidget         *entry);
+static void       search_next_clicked     (GtkWidget         *button,
+                                           GtkWidget         *entry);
+static void       search_close_clicked    (GtkWidget         *button);
+static void       search                  (const gchar       *text,
+                                           gboolean           forward);
 
 
 /*  private variables  */
@@ -145,6 +151,7 @@
 
 static GtkWidget    *view           = NULL;
 static GtkWidget    *sidebar        = NULL;
+static GtkWidget    *searchbar      = NULL;
 static GtkWidget    *tree_view      = NULL;
 static GtkUIManager *ui_manager     = NULL;
 static GtkWidget    *button_prev    = NULL;
@@ -158,6 +165,7 @@
 browser_dialog_open (void)
 {
   GtkWidget   *window;
+  GtkWidget   *main_vbox;
   GtkWidget   *vbox;
   GtkWidget   *toolbar;
   GtkWidget   *paned;
@@ -256,12 +264,16 @@
                     NULL);
 
   /*  HTML view  */
+  main_vbox = gtk_vbox_new (FALSE, 0);
+  gtk_widget_show (main_vbox);
+  gtk_paned_pack2 (GTK_PANED (paned), main_vbox, TRUE, TRUE);
+
   scrolled = gtk_scrolled_window_new (NULL, NULL);
   gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled),
                                   GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
 
   gtk_widget_set_size_request (scrolled, 300, 200);
-  gtk_paned_add2 (GTK_PANED (paned), scrolled);
+  gtk_box_pack_start (GTK_BOX (main_vbox), scrolled, TRUE, TRUE, 0);
   gtk_widget_show (scrolled);
 
   view = webkit_web_view_new ();
@@ -283,6 +295,9 @@
   g_signal_connect (view, "button-press-event",
                     G_CALLBACK (view_button_press),
                     NULL);
+  g_signal_connect (view, "key-press-event",
+                    G_CALLBACK (view_key_press),
+                    NULL);
 
 #if HAVE_WEBKIT_ZOOM_API
   webkit_web_view_set_zoom_level (WEBKIT_WEB_VIEW (view), data.zoom);
@@ -306,6 +321,10 @@
                     paned);
 
   update_actions ();
+
+  /* Searchbar */
+  searchbar = build_searchbar ();
+  gtk_box_pack_start (GTK_BOX (main_vbox), searchbar, FALSE, FALSE, 0);
 }
 
 void
@@ -582,6 +601,16 @@
       G_CALLBACK (zoom_out_callback)
     },
     {
+      "find", GTK_STOCK_FIND,
+      NULL, "<control>F", N_("Find text in current page"),
+      G_CALLBACK (find_callback)
+    },
+    {
+      "find-again", NULL,
+      N_("Find _Again"), "<control>G", NULL,
+      G_CALLBACK (find_again_callback)
+    },
+    {
       "close", GTK_STOCK_CLOSE,
       NULL, "<control>W", NULL,
       G_CALLBACK (close_callback)
@@ -666,6 +695,9 @@
                                      "    <menuitem action=\"home\" />"
                                      "    <menuitem action=\"copy-location\" />"
                                      "    <menuitem action=\"show-index\" />"
+                                     "    <separator />"
+                                     "    <menuitem action=\"find\" />"
+                                     "    <menuitem action=\"find-again\" />"
 #ifdef HAVE_WEBKIT_ZOOM_API
                                      "    <separator />"
                                      "    <menuitem action=\"zoom-in\" />"
@@ -735,6 +767,28 @@
 }
 
 static void
+find_callback (GtkAction *action,
+               gpointer   data)
+{
+  GtkWidget *entry = g_object_get_data (G_OBJECT (searchbar), "entry");
+
+  gtk_widget_show (searchbar);
+  gtk_widget_grab_focus (entry);
+}
+
+static void
+find_again_callback (GtkAction *action,
+                     gpointer   data)
+{
+  GtkWidget *entry = g_object_get_data (G_OBJECT (searchbar), "entry");
+
+  gtk_widget_show (searchbar);
+  gtk_widget_grab_focus (entry);
+
+  search (gtk_entry_get_text (GTK_ENTRY (entry)), TRUE);
+}
+
+static void
 copy_location_callback (GtkAction *action,
                         gpointer   data)
 {
@@ -1008,6 +1062,24 @@
   return FALSE;
 }
 
+static gboolean
+view_key_press (GtkWidget   *widget,
+                GdkEventKey *event)
+{
+  if (event->keyval == GDK_slash)
+    {
+      GtkAction *action;
+
+      action = gtk_ui_manager_get_action (ui_manager,
+                                          "/ui/help-browser-popup/find");
+      gtk_action_activate (action);
+
+      return TRUE;
+    }
+
+  return FALSE;
+}
+
 static void
 title_changed (GtkWidget      *view,
                WebKitWebFrame *frame,
@@ -1047,3 +1119,123 @@
 
   select_index (webkit_web_frame_get_uri (frame));
 }
+
+static GtkWidget *
+build_searchbar (void)
+{
+  GtkWidget *button;
+  GtkWidget *image;
+  GtkWidget *entry;
+  GtkWidget *hbox;
+  GtkWidget *label;
+
+  hbox = gtk_hbox_new (FALSE, 6);
+
+  label = gtk_label_new (_("Find:"));
+  gtk_widget_show (label);
+  gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
+
+  entry = gtk_entry_new ();
+  gtk_widget_show (entry);
+  gtk_box_pack_start (GTK_BOX (hbox), entry, TRUE, TRUE, 0);
+  g_object_set_data (G_OBJECT (hbox), "entry", entry);
+
+  g_signal_connect (entry, "changed",
+                    G_CALLBACK (search_entry_changed),
+                    NULL);
+
+  g_signal_connect (entry, "key-press-event",
+                    G_CALLBACK (search_entry_key_press),
+                    NULL);
+
+  button = gtk_button_new_with_mnemonic (C_("search", "_Previous"));
+  gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE);
+  gtk_button_set_image (GTK_BUTTON (button),
+                        gtk_image_new_from_stock (GTK_STOCK_GO_BACK,
+                                                  GTK_ICON_SIZE_BUTTON));
+  gtk_widget_show (button);
+  gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
+
+  g_signal_connect (button, "clicked",
+                    G_CALLBACK (search_prev_clicked),
+                    entry);
+
+  button = gtk_button_new_with_mnemonic (C_("search", "_Next"));
+  gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE);
+  gtk_button_set_image (GTK_BUTTON (button),
+                        gtk_image_new_from_stock (GTK_STOCK_GO_FORWARD,
+                                                  GTK_ICON_SIZE_BUTTON));
+  gtk_widget_show (button);
+  gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
+
+  g_signal_connect (button, "clicked",
+                    G_CALLBACK (search_next_clicked),
+                    entry);
+
+  button = gtk_button_new_from_stock (GTK_STOCK_CLOSE);
+  gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE);
+
+  g_object_get (button, "image", &image, NULL);
+  g_object_set (image, "icon-size", GTK_ICON_SIZE_MENU, NULL);
+  g_object_unref (image);
+
+  gtk_widget_show (button);
+  gtk_box_pack_end (GTK_BOX (hbox), button, FALSE, FALSE, 0);
+
+  g_signal_connect (button, "clicked",
+                    G_CALLBACK (search_close_clicked),
+                    NULL);
+
+  return hbox;
+}
+
+static void
+search_entry_changed (GtkWidget *entry)
+{
+  search (gtk_entry_get_text (GTK_ENTRY (entry)), TRUE);
+}
+
+static gboolean
+search_entry_key_press (GtkWidget   *entry,
+                        GdkEventKey *event)
+{
+  if (event->keyval == GDK_Escape)
+    {
+      gtk_widget_hide (searchbar);
+      webkit_web_view_unmark_text_matches (WEBKIT_WEB_VIEW (view));
+
+      return TRUE;
+    }
+
+  return FALSE;
+}
+
+static void
+search_prev_clicked (GtkWidget *button,
+                     GtkWidget *entry)
+{
+  search (gtk_entry_get_text (GTK_ENTRY (entry)), FALSE);
+}
+
+static void
+search_next_clicked (GtkWidget *button,
+                     GtkWidget *entry)
+{
+  search (gtk_entry_get_text (GTK_ENTRY (entry)), TRUE);
+}
+
+static void
+search (const gchar *text,
+        gboolean     forward)
+{
+  if (text)
+    webkit_web_view_search_text (WEBKIT_WEB_VIEW (view),
+                                 text, FALSE, forward, TRUE);
+}
+
+static void
+search_close_clicked (GtkWidget *button)
+{
+  gtk_widget_hide (searchbar);
+  webkit_web_view_unmark_text_matches (WEBKIT_WEB_VIEW (view));
+}

Modified: branches/soc-2008-tagging/plug-ins/pygimp/pygimp-pdb.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/pygimp/pygimp-pdb.c	(original)
+++ branches/soc-2008-tagging/plug-ins/pygimp/pygimp-pdb.c	Sun Jul 20 16:34:08 2008
@@ -287,8 +287,26 @@
 	case GIMP_PDB_SELECTION:
 	    value = pygimp_layer_new(params[i].data.d_selection);
 	    break;
-	case GIMP_PDB_BOUNDARY:
-	    value = PyInt_FromLong(params[i].data.d_boundary);
+	case GIMP_PDB_COLORARRAY:
+	    if (params[i].data.d_colorarray == NULL) {
+		value = PyTuple_New(0);
+		break;
+	    }
+	    if ((tmp=PyTuple_GetItem(args, i-1)) == NULL) {
+		Py_DECREF(args);
+		return NULL;
+	    }
+	    if (!PyInt_Check(tmp)) {
+		PyErr_SetString(PyExc_TypeError,
+				"count type must be integer");
+		Py_DECREF(args);
+		return NULL;
+	    }
+	    n = PyInt_AsLong(tmp);
+	    value = PyTuple_New(n);
+	    for (j = 0; j < n; j++)
+		PyTuple_SetItem(value, j,
+                                pygimp_rgb_new(&params[i].data.d_colorarray[j]));
 	    break;
 	case GIMP_PDB_VECTORS:
 	    value = pygimp_vectors_new(params[i].data.d_vectors);
@@ -524,9 +542,23 @@
 	    check(!pygimp_layer_check(item));
 	    ret[i].data.d_selection = ((PyGimpLayer *)item)->ID;
 	    break;
-	case GIMP_PDB_BOUNDARY:
-	    check(!PyInt_Check(item));
-	    ret[i].data.d_boundary = PyInt_AsLong(item);
+	case GIMP_PDB_COLORARRAY:
+	    {
+                GimpRGB *rgb;
+
+		check(!PySequence_Check(item));
+		len = PySequence_Length(item);
+		rgb = g_new(GimpRGB, len);
+		for (j = 0; j < len; j++) {
+		    if (!pygimp_rgb_from_pyobject(item, &rgb[j])) {
+			Py_DECREF(tuple);
+			g_free(rgb);
+			gimp_destroy_params(ret, nparams);
+			return NULL;
+		    }
+		}
+                ret[i].data.d_colorarray = rgb;
+	    }
 	    break;
 	case GIMP_PDB_VECTORS:
 	    check(!pygimp_vectors_check(item));

Modified: branches/soc-2008-tagging/plug-ins/script-fu/scheme-wrapper.c
==============================================================================
--- branches/soc-2008-tagging/plug-ins/script-fu/scheme-wrapper.c	(original)
+++ branches/soc-2008-tagging/plug-ins/script-fu/scheme-wrapper.c	Sun Jul 20 16:34:08 2008
@@ -615,18 +615,18 @@
 #define typeflag(p) ((p)->_flag)
 #define type(p)     (typeflag(p)&T_MASKTYPE)
 
-char *ret_types[] = {
+static const char *ret_types[] = {
   "GIMP_PDB_INT32",       "GIMP_PDB_INT16",     "GIMP_PDB_INT8",
   "GIMP_PDB_FLOAT",       "GIMP_PDB_STRING",    "GIMP_PDB_INT32ARRAY",
   "GIMP_PDB_INT16ARRAY",  "GIMP_PDB_INT8ARRAY", "GIMP_PDB_FLOATARRAY",
   "GIMP_PDB_STRINGARRAY", "GIMP_PDB_COLOR",     "GIMP_PDB_REGION",
   "GIMP_PDB_DISPLAY",     "GIMP_PDB_IMAGE",     "GIMP_PDB_LAYER",
   "GIMP_PDB_CHANNEL",     "GIMP_PDB_DRAWABLE",  "GIMP_PDB_SELECTION",
-  "GIMP_PDB_BOUNDARY",    "GIMP_PDB_VECTORS",   "GIMP_PDB_PARASITE",
+  "GIMP_PDB_COLORARRY",   "GIMP_PDB_VECTORS",   "GIMP_PDB_PARASITE",
   "GIMP_PDB_STATUS",      "GIMP_PDB_END"
 };
 
-char *ts_types[] = {
+static const char *ts_types[] = {
   "T_NONE",
   "T_STRING",    "T_NUMBER",     "T_SYMBOL",       "T_PROC",
   "T_PAIR",      "T_CLOSURE",    "T_CONTINUATION", "T_FOREIGN",
@@ -634,7 +634,7 @@
   "T_PROMISE",   "T_ENVIRONMENT","T_ARRAY"
 };
 
-char *status_types[] = {
+static const char *status_types[] = {
   "GIMP_PDB_EXECUTION_ERROR", "GIMP_PDB_CALLING_ERROR",
   "GIMP_PDB_PASS_THROUGH",    "GIMP_PDB_SUCCESS",
   "GIMP_PDB_CANCEL"
@@ -739,7 +739,6 @@
         case GIMP_PDB_CHANNEL:
         case GIMP_PDB_DRAWABLE:
         case GIMP_PDB_SELECTION:
-        case GIMP_PDB_BOUNDARY:
         case GIMP_PDB_VECTORS:
           if (!sc->vptr->is_number (sc->vptr->pair_car (a)))
             success = FALSE;
@@ -846,7 +845,7 @@
     g_printerr ("     ");
     for (j = 0; j < count; ++j)
       g_printerr (" %ld",
-               sc->vptr->ivalue ( sc->vptr->vector_elem (vector, j) ));
+                  sc->vptr->ivalue ( sc->vptr->vector_elem (vector, j) ));
     g_printerr ("\n");
   }
 }
@@ -897,7 +896,7 @@
     g_printerr ("     ");
     for (j = 0; j < count; ++j)
       g_printerr (" %ld",
-               sc->vptr->ivalue ( sc->vptr->vector_elem (vector, j) ));
+                  sc->vptr->ivalue ( sc->vptr->vector_elem (vector, j) ));
     g_printerr ("\n");
   }
 }
@@ -950,7 +949,7 @@
     g_printerr ("     ");
     for (j = 0; j < count; ++j)
       g_printerr (" %ld",
-               sc->vptr->ivalue ( sc->vptr->vector_elem (vector, j) ));
+                  sc->vptr->ivalue ( sc->vptr->vector_elem (vector, j) ));
     g_printerr ("\n");
   }
 }
@@ -1003,7 +1002,7 @@
     g_printerr ("     ");
     for (j = 0; j < count; ++j)
       g_printerr (" %f",
-               sc->vptr->rvalue ( sc->vptr->vector_elem (vector, j) ));
+                  sc->vptr->rvalue ( sc->vptr->vector_elem (vector, j) ));
     g_printerr ("\n");
   }
 }
@@ -1104,6 +1103,66 @@
             }
           break;
 
+        case GIMP_PDB_COLORARRAY:
+          vector = sc->vptr->pair_car (a);
+          if (!sc->vptr->is_vector (vector))
+            success = FALSE;
+          if (success)
+            {
+              n_elements = args[i-1].data.d_int32;
+              if (n_elements < 0 ||
+                  n_elements > sc->vptr->vector_length (vector))
+                {
+                  g_snprintf (error_str, sizeof (error_str),
+                              "COLOR vector (argument %d) for function %s has "
+                              "size of %ld but expected size of %d",
+                              i+1, proc_name,
+                              sc->vptr->vector_length (vector), n_elements);
+                  return foreign_error (sc, error_str, 0);
+                }
+
+              args[i].data.d_colorarray = g_new (GimpRGB, n_elements);
+
+              for (j = 0; j < n_elements; j++)
+                {
+                  pointer v_element = sc->vptr->vector_elem (vector, j);
+                  pointer color_list;
+                  guchar  r, g, b;
+
+                  if (! (sc->vptr->is_list (sc,
+                                            sc->vptr->pair_car (v_element)) &&
+                         sc->vptr->list_length (sc,
+                                                sc->vptr->pair_car (v_element)) == 3))
+                    {
+                      g_snprintf (error_str, sizeof (error_str),
+                                  "Item %d in vector is not a color "
+                                  "(argument %d for function %s)",
+                                  j+1, i+1, proc_name);
+                      return foreign_error (sc, error_str, vector);
+                    }
+
+                  color_list = sc->vptr->pair_car (v_element);
+                  r = CLAMP (sc->vptr->ivalue (sc->vptr->pair_car (color_list)),
+                             0, 255);
+                  color_list = sc->vptr->pair_cdr (color_list);
+                  g = CLAMP (sc->vptr->ivalue (sc->vptr->pair_car (color_list)),
+                             0, 255);
+                  color_list = sc->vptr->pair_cdr (color_list);
+                  b = CLAMP (sc->vptr->ivalue (sc->vptr->pair_car (color_list)),
+                             0, 255);
+
+                  gimp_rgba_set_uchar (&args[i].data.d_colorarray[j],
+                                       r, g, b, 255);
+                }
+#if DEBUG_MARSHALL
+{
+glong count = sc->vptr->vector_length (vector);
+g_printerr ("      color vector has %ld elements\n", count);
+}
+#endif
+            }
+          break;
+
         case GIMP_PDB_REGION:
           if (! (sc->vptr->is_list (sc, sc->vptr->pair_car (a)) &&
             sc->vptr->list_length (sc, sc->vptr->pair_car (a)) == 4))
@@ -1282,7 +1341,6 @@
             case GIMP_PDB_CHANNEL:
             case GIMP_PDB_DRAWABLE:
             case GIMP_PDB_SELECTION:
-            case GIMP_PDB_BOUNDARY:
             case GIMP_PDB_VECTORS:
               return_val = sc->vptr->cons (sc,
                              sc->vptr->mk_integer (sc,
@@ -1457,6 +1515,38 @@
                 break;
               }
 
+            case GIMP_PDB_COLORARRAY:
+              /*  color arrays are always implemented such that the previous
+               *  return value contains the number of strings in the array
+               */
+              {
+                gint32   num_colors = values[i].data.d_int32;
+                GimpRGB *array  = (GimpRGB *) values[i + 1].data.d_colorarray;
+                pointer  vector = sc->vptr->mk_vector (sc, num_colors);
+
+                return_val = sc->vptr->cons (sc, vector, return_val);
+                set_safe_foreign (sc, return_val);
+
+                for (j = 0; j < num_colors; j++)
+                  {
+                    guchar r, g, b;
+
+                    gimp_rgb_get_uchar (&array[j], &r, &g, &b);
+
+                    intermediate_val = sc->vptr->cons (sc,
+                        sc->vptr->mk_integer (sc, r),
+                        sc->vptr->cons (sc,
+                            sc->vptr->mk_integer (sc, g),
+                            sc->vptr->cons (sc,
+                                sc->vptr->mk_integer (sc, b),
+                                sc->NIL)));
+                    return_val = sc->vptr->cons (sc,
+                                                 intermediate_val,
+                                                 return_val);
+                    set_safe_foreign (sc, return_val);
+                  }
+              }
+              break;
             case GIMP_PDB_REGION:
               {
                 gint32 x, y, w, h;
@@ -1612,6 +1702,10 @@
           g_free (params[i].data.d_stringarray);
           break;
 
+        case GIMP_PDB_COLORARRAY:
+          g_free (params[i].data.d_colorarray);
+          break;
+
         case GIMP_PDB_COLOR:
         case GIMP_PDB_REGION:
         case GIMP_PDB_DISPLAY:
@@ -1620,7 +1714,6 @@
         case GIMP_PDB_CHANNEL:
         case GIMP_PDB_DRAWABLE:
         case GIMP_PDB_SELECTION:
-        case GIMP_PDB_BOUNDARY:
         case GIMP_PDB_VECTORS:
         case GIMP_PDB_PARASITE:
         case GIMP_PDB_STATUS:

Modified: branches/soc-2008-tagging/tools/pdbgen/app.pl
==============================================================================
--- branches/soc-2008-tagging/tools/pdbgen/app.pl	(original)
+++ branches/soc-2008-tagging/tools/pdbgen/app.pl	Sun Jul 20 16:34:08 2008
@@ -487,6 +487,14 @@
                               $flags)
 CODE
     }
+    elsif ($pdbtype eq 'colorarray') {
+	$pspec = <<CODE;
+gimp_param_spec_color_array ("$name",
+                             "$nick",
+                             "$blurb",
+                             $flags)
+CODE
+    }
     else {
 	warn "Unsupported PDB type: $arg->{name} ($arg->{type})";
 	exit -1;

Modified: branches/soc-2008-tagging/tools/pdbgen/enums.pl
==============================================================================
--- branches/soc-2008-tagging/tools/pdbgen/enums.pl	(original)
+++ branches/soc-2008-tagging/tools/pdbgen/enums.pl	Sun Jul 20 16:34:08 2008
@@ -265,9 +265,9 @@
 			  GIMP_PDB_COLOR GIMP_PDB_REGION GIMP_PDB_DISPLAY
 			  GIMP_PDB_IMAGE GIMP_PDB_LAYER GIMP_PDB_CHANNEL
 			  GIMP_PDB_DRAWABLE GIMP_PDB_SELECTION
-			  GIMP_PDB_BOUNDARY GIMP_PDB_VECTORS
+			  GIMP_PDB_COLORARRAY GIMP_PDB_VECTORS
 			  GIMP_PDB_PARASITE GIMP_PDB_STATUS GIMP_PDB_END
-			  GIMP_PDB_PATH) ],
+			  GIMP_PDB_PATH GIMP_PDB_BOUNDARY) ],
 	  mapping => { GIMP_PDB_INT32 => '0',
 		       GIMP_PDB_INT16 => '1',
 		       GIMP_PDB_INT8 => '2',
@@ -286,12 +286,13 @@
 		       GIMP_PDB_CHANNEL => '15',
 		       GIMP_PDB_DRAWABLE => '16',
 		       GIMP_PDB_SELECTION => '17',
-		       GIMP_PDB_BOUNDARY => '18',
+		       GIMP_PDB_COLORARRAY => '18',
 		       GIMP_PDB_VECTORS => '19',
 		       GIMP_PDB_PARASITE => '20',
 		       GIMP_PDB_STATUS => '21',
 		       GIMP_PDB_END => '22',
-		       GIMP_PDB_PATH => 'GIMP_PDB_VECTORS' }
+		       GIMP_PDB_PATH => 'GIMP_PDB_VECTORS',
+		       GIMP_PDB_BOUNDARY => 'GIMP_PDB_COLORARRAY' }
 	},
     GimpPDBProcType =>
 	{ contig => 1,

Modified: branches/soc-2008-tagging/tools/pdbgen/pdb.pl
==============================================================================
--- branches/soc-2008-tagging/tools/pdbgen/pdb.pl	(original)
+++ branches/soc-2008-tagging/tools/pdbgen/pdb.pl	Sun Jul 20 16:34:08 2008
@@ -85,6 +85,13 @@
 		     init_value     => 'NULL',
 		     get_value_func => '$var = gimp_value_get_stringarray ($value)',
 		     set_value_func => 'gimp_value_take_stringarray ($value, $var, $var_len)' },
+    colorarray  => { name           => 'COLORARRAY',
+		     type           => 'GimpRGB *',
+		     const_type     => 'const GimpRGB *',
+		     array          => 1,
+		     init_value     => 'NULL',
+		     get_value_func => '$var = gimp_value_get_colorarray ($value)',
+		     set_value_func => 'gimp_value_take_colorarray ($value, $var, $var_len)' },
 
     color => { name           => 'COLOR' , 
 	       type           => 'GimpRGB ',

Modified: branches/soc-2008-tagging/tools/pdbgen/pdb/edit.pdb
==============================================================================
--- branches/soc-2008-tagging/tools/pdbgen/pdb/edit.pdb	(original)
+++ branches/soc-2008-tagging/tools/pdbgen/pdb/edit.pdb	Sun Jul 20 16:34:08 2008
@@ -23,10 +23,12 @@
     $help = <<'HELP';
 If there is a selection in the image, then the area specified by the
 selection is cut from the specified drawable and placed in an internal
-GIMP edit buffer.  It can subsequently be retrieved using the
+GIMP edit buffer. It can subsequently be retrieved using the
 gimp_edit_paste() command. If there is no selection, then the
 specified drawable will be removed and its contents stored in the
-internal GIMP edit buffer.
+internal GIMP edit buffer. This procedure will fail if the selected area
+lies completely outside the bounds of the current drawable and there is
+nothing to copy from.
 HELP
 
     &std_pdb_misc;
@@ -38,8 +40,8 @@
 
     @outargs = (
 	{ name => 'non_empty', type => 'boolean',
-	  desc => 'TRUE if the cut was successful, FALSE if the
-                   selection contained only transparent pixels' }
+	  desc => 'TRUE if the cut was successful,
+                   FALSE if there was nothing to copy from' }
     );
 
     %invoke = (
@@ -75,7 +77,9 @@
 internal GIMP edit buffer. It can subsequently be retrieved using the
 gimp_edit_paste() command.  If there is no selection, then the
 specified drawable's contents will be stored in the internal GIMP edit
-buffer.
+buffer. This procedure will fail if the selected area lies completely
+outside the bounds of the current drawable and there is nothing to
+copy from.
 HELP
 
     &std_pdb_misc;
@@ -87,8 +91,8 @@
 
     @outargs = (
 	{ name => 'non_empty', type => 'boolean',
-	  desc => 'TRUE if the copy was successful, FALSE if the
-                   selection contained only transparent pixels' }
+	  desc => 'TRUE if the cut was successful,
+                   FALSE if there was nothing to copy from' }
     );
 
     %invoke = (
@@ -135,8 +139,7 @@
 
     @outargs = (
 	{ name => 'non_empty', type => 'boolean',
-	  desc => 'TRUE if the copy was successful, FALSE if the
-                   selection contained only transparent pixels' }
+	  desc => 'TRUE if the copy was successful' }
     );
 
     %invoke = (
@@ -266,7 +269,7 @@
     @outargs = (
 	{ name => 'real_name', type => 'string',
 	  desc => 'The real name given to the buffer, or NULL if the
-                   selection contained only transparent pixels' }
+                   cut failed' }
     );
 
     %invoke = (
@@ -318,7 +321,7 @@
     @outargs = (
 	{ name => 'real_name', type => 'string',
 	  desc => 'The real name given to the buffer, or NULL if the
-                   selection contained only transparent pixels' }
+                   copy failed' }
     );
 
     %invoke = (
@@ -372,7 +375,7 @@
     @outargs = (
 	{ name => 'real_name', type => 'string',
 	  desc => 'The real name given to the buffer, or NULL if the
-                   selection contained only transparent pixels' }
+                   copy failed' }
     );
 
     %invoke = (

Modified: branches/soc-2008-tagging/tools/pdbgen/pdb/palette.pdb
==============================================================================
--- branches/soc-2008-tagging/tools/pdbgen/pdb/palette.pdb	(original)
+++ branches/soc-2008-tagging/tools/pdbgen/pdb/palette.pdb	Sun Jul 20 16:34:08 2008
@@ -212,6 +212,53 @@
     );
 }
 
+sub palette_get_colors {
+    $blurb = 'Gets all colors from the specified palette.';
+
+    $help = <<'HELP';
+This procedure retrieves all color entries of the specified palette. 
+HELP
+
+    &neo_pdb_misc('2006', '2.6');
+
+    @inargs = (
+	{ name => 'name', type => 'string', non_empty => 1,
+	  desc => 'The palette name' }
+    );
+
+    @outargs = (
+    	{ name => 'colors', type => 'colorarray',
+	  desc => 'The colors in the palette',
+	  array => { name => 'num_colors',
+                     desc => 'Length of the colors array' } }
+    );
+
+    %invoke = (
+	vars => [ 'GimpPalette *palette = NULL' ],
+	code => <<'CODE'
+{
+  GimpPalette *palette = gimp_pdb_get_palette (gimp, name, FALSE, error);
+
+  if (palette)
+    {
+      GList *list = palette->colors;
+      gint   i;
+
+      num_colors = palette->n_colors;
+      colors     = g_new (GimpRGB, num_colors);
+
+      for (i = 0; i < num_colors; i++, list = g_list_next (list))
+	colors[i] = ((GimpPaletteEntry *)(list->data))->color;
+    }
+  else
+    {
+      success = FALSE;
+    }
+}
+CODE
+    );
+}
+
 sub palette_get_columns {
     $blurb = "Retrieves the number of columns to use to display this palette";
     $help = <<'HELP';
@@ -551,7 +598,7 @@
             palette_rename
             palette_delete
             palette_is_editable
-            palette_get_info
+            palette_get_info palette_get_colors
             palette_get_columns palette_set_columns
             palette_add_entry palette_delete_entry
             palette_entry_get_color palette_entry_set_color



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