gimp r24628 - in branches/weskaggs: . app/base app/core app/display app/gegl app/gegl/gegl app/paint app/tools app/widgets libgimpbase modules plug-ins/common plug-ins/jpeg plug-ins/pygimp plug-ins/pygimp/plug-ins plug-ins/script-fu/scripts po po-libgimp po-plug-ins po-python po-script-fu po-tips



Author: weskaggs
Date: Wed Jan 16 19:44:49 2008
New Revision: 24628
URL: http://svn.gnome.org/viewvc/gimp?rev=24628&view=rev

Log:
Bill Skaggs  <weskaggs primate ucdavis edu>

	Merged 24584:24625 from trunk.


Added:
   branches/weskaggs/app/gegl/gimpoperationcolorbalance.c
      - copied unchanged from r24625, /trunk/app/gegl/gimpoperationcolorbalance.c
   branches/weskaggs/app/gegl/gimpoperationcolorbalance.h
      - copied unchanged from r24625, /trunk/app/gegl/gimpoperationcolorbalance.h
   branches/weskaggs/app/gegl/gimpoperationhuesaturation.c
      - copied unchanged from r24625, /trunk/app/gegl/gimpoperationhuesaturation.c
   branches/weskaggs/app/gegl/gimpoperationhuesaturation.h
      - copied unchanged from r24625, /trunk/app/gegl/gimpoperationhuesaturation.h
Modified:
   branches/weskaggs/ChangeLog
   branches/weskaggs/app/base/color-balance.c
   branches/weskaggs/app/core/core-types.h
   branches/weskaggs/app/display/gimpdisplayshell-callbacks.c
   branches/weskaggs/app/display/gimpdisplayshell-coords.c
   branches/weskaggs/app/display/gimpdisplayshell-coords.h
   branches/weskaggs/app/display/gimpdisplayshell.h
   branches/weskaggs/app/gegl/Makefile.am
   branches/weskaggs/app/gegl/gegl-types.h
   branches/weskaggs/app/gegl/gegl/gegl-types.h
   branches/weskaggs/app/gegl/gimp-gegl.c
   branches/weskaggs/app/gegl/gimpoperationcolorize.c
   branches/weskaggs/app/gegl/gimpoperationcolorize.h
   branches/weskaggs/app/gegl/gimpoperationdesaturate.c
   branches/weskaggs/app/gegl/gimpoperationlevels.c
   branches/weskaggs/app/gegl/gimpoperationlevels.h
   branches/weskaggs/app/gegl/gimpoperationposterize.c
   branches/weskaggs/app/gegl/gimpoperationthreshold.c
   branches/weskaggs/app/gegl/gimpoperationthreshold.h
   branches/weskaggs/app/gegl/gimpoperationtilesink.c
   branches/weskaggs/app/gegl/gimpoperationtilesource.c
   branches/weskaggs/app/paint/gimpink.c
   branches/weskaggs/app/paint/gimpink.h
   branches/weskaggs/app/paint/gimpinkundo.c
   branches/weskaggs/app/paint/gimpinkundo.h
   branches/weskaggs/app/tools/gimpblendtool.c
   branches/weskaggs/app/tools/gimpbrightnesscontrasttool.c
   branches/weskaggs/app/tools/gimpcolorbalancetool.c
   branches/weskaggs/app/tools/gimpcolorizetool.c
   branches/weskaggs/app/tools/gimpeditselectiontool.c
   branches/weskaggs/app/tools/gimpeditselectiontool.h
   branches/weskaggs/app/tools/gimphuesaturationtool.c
   branches/weskaggs/app/tools/gimpimagemaptool.c
   branches/weskaggs/app/tools/gimpimagemaptool.h
   branches/weskaggs/app/tools/gimplevelstool.c
   branches/weskaggs/app/tools/gimpmeasuretool.c
   branches/weskaggs/app/tools/gimppainttool.c
   branches/weskaggs/app/tools/gimpposterizetool.c
   branches/weskaggs/app/tools/gimpthresholdtool.c
   branches/weskaggs/app/tools/tools-utils.c
   branches/weskaggs/app/tools/tools-utils.h
   branches/weskaggs/app/widgets/gimpuimanager.c
   branches/weskaggs/libgimpbase/gimpenv.c
   branches/weskaggs/modules/colorsel_cmyk_lcms.c
   branches/weskaggs/modules/controller_dx_dinput.c
   branches/weskaggs/modules/controller_linux_input.c
   branches/weskaggs/modules/gimpinputdevicestore-dx.c
   branches/weskaggs/modules/gimpinputdevicestore-hal.c
   branches/weskaggs/modules/gimpinputdevicestore.h
   branches/weskaggs/plug-ins/common/bumpmap.c
   branches/weskaggs/plug-ins/jpeg/Makefile.am
   branches/weskaggs/plug-ins/pygimp/plug-ins/gimpcons.py
   branches/weskaggs/plug-ins/pygimp/pygimp-pdb.c
   branches/weskaggs/plug-ins/script-fu/scripts/3d-outline.scm
   branches/weskaggs/plug-ins/script-fu/scripts/add-bevel.scm
   branches/weskaggs/plug-ins/script-fu/scripts/burn-in-anim.scm
   branches/weskaggs/plug-ins/script-fu/scripts/camo.scm
   branches/weskaggs/plug-ins/script-fu/scripts/circuit.scm
   branches/weskaggs/plug-ins/script-fu/scripts/clothify.scm
   branches/weskaggs/plug-ins/script-fu/scripts/coffee.scm
   branches/weskaggs/plug-ins/script-fu/scripts/contactsheet.scm
   branches/weskaggs/plug-ins/script-fu/scripts/distress-selection.scm
   branches/weskaggs/plug-ins/script-fu/scripts/flatland.scm
   branches/weskaggs/plug-ins/script-fu/scripts/font-map.scm
   branches/weskaggs/plug-ins/script-fu/scripts/fuzzyborder.scm
   branches/weskaggs/plug-ins/script-fu/scripts/glossy.scm
   branches/weskaggs/plug-ins/script-fu/scripts/land.scm
   branches/weskaggs/plug-ins/script-fu/scripts/lava.scm
   branches/weskaggs/plug-ins/script-fu/scripts/old-photo.scm
   branches/weskaggs/plug-ins/script-fu/scripts/predator.scm
   branches/weskaggs/plug-ins/script-fu/scripts/rendermap.scm
   branches/weskaggs/plug-ins/script-fu/scripts/ripply-anim.scm
   branches/weskaggs/plug-ins/script-fu/scripts/script-fu-compat.init
   branches/weskaggs/plug-ins/script-fu/scripts/script-fu-set-cmap.scm
   branches/weskaggs/plug-ins/script-fu/scripts/select-to-brush.scm
   branches/weskaggs/plug-ins/script-fu/scripts/select-to-image.scm
   branches/weskaggs/plug-ins/script-fu/scripts/select-to-pattern.scm
   branches/weskaggs/plug-ins/script-fu/scripts/speed-text.scm
   branches/weskaggs/plug-ins/script-fu/scripts/spinning-globe.scm
   branches/weskaggs/plug-ins/script-fu/scripts/swirltile.scm
   branches/weskaggs/plug-ins/script-fu/scripts/test-sphere.scm
   branches/weskaggs/plug-ins/script-fu/scripts/text-circle.scm
   branches/weskaggs/plug-ins/script-fu/scripts/unsharp-mask.scm
   branches/weskaggs/plug-ins/script-fu/scripts/xach-effect.scm
   branches/weskaggs/po-libgimp/ChangeLog
   branches/weskaggs/po-libgimp/uk.po
   branches/weskaggs/po-plug-ins/ChangeLog
   branches/weskaggs/po-plug-ins/uk.po
   branches/weskaggs/po-python/ChangeLog
   branches/weskaggs/po-python/uk.po
   branches/weskaggs/po-script-fu/ChangeLog
   branches/weskaggs/po-script-fu/uk.po
   branches/weskaggs/po-tips/ChangeLog
   branches/weskaggs/po-tips/uk.po
   branches/weskaggs/po/ChangeLog
   branches/weskaggs/po/uk.po

Modified: branches/weskaggs/app/base/color-balance.c
==============================================================================
--- branches/weskaggs/app/base/color-balance.c	(original)
+++ branches/weskaggs/app/base/color-balance.c	Wed Jan 16 19:44:49 2008
@@ -106,6 +106,7 @@
     (cb->magenta_green[GIMP_MIDTONES] > 0) ? midtones_add : midtones_sub;
   magenta_green_transfer[GIMP_HIGHLIGHTS] =
     (cb->magenta_green[GIMP_HIGHLIGHTS] > 0) ? highlights_add : highlights_sub;
+
   yellow_blue_transfer[GIMP_SHADOWS] =
     (cb->yellow_blue[GIMP_SHADOWS] > 0) ? shadows_add : shadows_sub;
   yellow_blue_transfer[GIMP_MIDTONES] =
@@ -188,7 +189,7 @@
 
           d[RED_PIX]   = r_n;
           d[GREEN_PIX] = g_n;
-           d[BLUE_PIX]  = b_n;
+          d[BLUE_PIX]  = b_n;
 
           if (alpha)
             d[ALPHA_PIX] = s[ALPHA_PIX];

Modified: branches/weskaggs/app/core/core-types.h
==============================================================================
--- branches/weskaggs/app/core/core-types.h	(original)
+++ branches/weskaggs/app/core/core-types.h	Wed Jan 16 19:44:49 2008
@@ -190,6 +190,11 @@
   gdouble xtilt;
   gdouble ytilt;
   gdouble wheel;
+  gdouble delta_time;
+  gdouble delta_x;
+  gdouble delta_y;
+  gdouble distance;
+  gdouble velocity;
 };
 
 

Modified: branches/weskaggs/app/display/gimpdisplayshell-callbacks.c
==============================================================================
--- branches/weskaggs/app/display/gimpdisplayshell-callbacks.c	(original)
+++ branches/weskaggs/app/display/gimpdisplayshell-callbacks.c	Wed Jan 16 19:44:49 2008
@@ -80,6 +80,9 @@
 #include "gimp-intl.h"
 
 
+#define DEFAULT_EVENT_SMOOTHING  0.7
+
+
 /*  local function prototypes  */
 
 static void       gimp_display_shell_vscrollbar_update (GtkAdjustment    *adjustment,
@@ -600,18 +603,18 @@
                                        GdkEvent         *event,
                                        GimpDisplayShell *shell)
 {
-  GimpDisplay         *display;
-  GimpImage           *image;
-  Gimp                *gimp;
-  GdkDisplay          *gdk_display;
-  GimpTool            *active_tool;
-  GimpCoords           display_coords;
-  GimpCoords           image_coords;
-  GdkModifierType      state;
-  guint32              time;
-  gboolean             device_changed   = FALSE;
-  gboolean             return_val       = FALSE;
-  gboolean             update_sw_cursor = FALSE;
+  GimpDisplay     *display;
+  GimpImage       *image;
+  Gimp            *gimp;
+  GdkDisplay      *gdk_display;
+  GimpTool        *active_tool;
+  GimpCoords       display_coords;
+  GimpCoords       image_coords;
+  GdkModifierType  state;
+  guint32          time;
+  gboolean         device_changed   = FALSE;
+  gboolean         return_val       = FALSE;
+  gboolean         update_sw_cursor = FALSE;
 
   g_return_val_if_fail (GTK_WIDGET_REALIZED (canvas), FALSE);
 
@@ -905,7 +908,7 @@
                                                       &image_coords,
                                                       time, state, display);
 
-                    shell->last_motion_time = bevent->time;
+                    shell->last_read_motion_time = bevent->time;
                   }
               }
             break;
@@ -1185,7 +1188,7 @@
                 GdkTimeCoord **history_events;
                 gint           n_history_events;
 
-               /*  if the first mouse button is down, check for automatic
+                /*  if the first mouse button is down, check for automatic
                  *  scrolling...
                  */
                 if ((mevent->x < 0                 ||
@@ -1197,11 +1200,19 @@
                     gimp_display_shell_autoscroll_start (shell, state, mevent);
                   }
 
-                if (gimp_tool_control_get_motion_mode (active_tool->control) ==
-                    GIMP_MOTION_MODE_EXACT &&
+                /* gdk_device_get_history() has several quirks. First is
+                 * that events with borderline timestamps at both ends
+                 * are included. Because of that we need to add 1 to
+                 * lower border. The second is due to poor X event
+                 * resolution. We need to do -1 to ensure that the
+                 * amount of events between timestamps is final or
+                 * risk loosing some.
+                 */
+                if ((gimp_tool_control_get_motion_mode (active_tool->control) ==
+                    GIMP_MOTION_MODE_EXACT) &&
                     gdk_device_get_history (mevent->device, mevent->window,
-                                            shell->last_motion_time,
-                                            mevent->time,
+                                            shell->last_read_motion_time+1,
+                                            mevent->time - 1,
                                             &history_events,
                                             &n_history_events))
                   {
@@ -1209,6 +1220,7 @@
 
                     for (i = 0; i < n_history_events; i++)
                       {
+
                         gimp_display_shell_get_time_coords (shell,
                                                             mevent->device,
                                                             history_events[i],
@@ -1234,33 +1246,61 @@
                                                             x, y, width, height);
                           }
 
-                        tool_manager_motion_active (gimp,
-                                                    &image_coords,
-                                                    history_events[i]->time,
-                                                    state,
-                                                    display);
+                        /* Early removal of useless events saves CPU time.
+                         */
+                        if (gimp_display_shell_eval_event (shell,
+                                                           &image_coords,
+                                                           DEFAULT_EVENT_SMOOTHING,
+                                                           history_events[i]->time))
+                          {
+                            tool_manager_motion_active (gimp,
+                                                        &image_coords,
+                                                        history_events[i]->time,
+                                                        state,
+                                                        display);
+                          }
+
+                         shell->last_read_motion_time = history_events[i]->time;
                       }
 
                     gdk_device_free_history (history_events, n_history_events);
                   }
                 else
                   {
-                    tool_manager_motion_active (gimp,
-                                                &image_coords, time, state,
-                                                display);
-                  }
+                    /* Early removal of useless events saves CPU time.
+                     */
+                    if (gimp_display_shell_eval_event (shell,
+                                                       &image_coords,
+                                                       DEFAULT_EVENT_SMOOTHING,
+                                                       time))
+                      {
+                        tool_manager_motion_active (gimp,
+                                                    &image_coords,
+                                                    time,
+                                                    state,
+                                                    display);
+                      }
 
-                shell->last_motion_time = mevent->time;
+                    shell->last_read_motion_time = time;
+                  }
               }
           }
 
         if (! (state &
                (GDK_BUTTON1_MASK | GDK_BUTTON2_MASK | GDK_BUTTON3_MASK)))
           {
-            tool_manager_oper_update_active (gimp,
-                                             &image_coords, state,
-                                             shell->proximity,
-                                             display);
+            /* Early removal of useless events saves CPU time.
+             * Smoothing is 0.0 here for coasting.
+             */
+            if (gimp_display_shell_eval_event (shell, &image_coords, 0.0, time))
+              {
+                tool_manager_oper_update_active (gimp,
+                                                 &image_coords, state,
+                                                 shell->proximity,
+                                                 display);
+              }
+
+            shell->last_read_motion_time = time;
           }
       }
       break;

Modified: branches/weskaggs/app/display/gimpdisplayshell-coords.c
==============================================================================
--- branches/weskaggs/app/display/gimpdisplayshell-coords.c	(original)
+++ branches/weskaggs/app/display/gimpdisplayshell-coords.c	Wed Jan 16 19:44:49 2008
@@ -20,6 +20,8 @@
 
 #include <gtk/gtk.h>
 
+#include "libgimpmath/gimpmath.h"
+
 #include "display-types.h"
 
 #include "gimpdisplayshell.h"
@@ -131,7 +133,8 @@
    *  requested axis does not exist.
    */
 
-  if (gdk_device_get_axis (device, event->axes, GDK_AXIS_PRESSURE, &coords->pressure))
+  if (gdk_device_get_axis (device,
+                           event->axes, GDK_AXIS_PRESSURE, &coords->pressure))
     coords->pressure = CLAMP (coords->pressure, GIMP_COORDS_MIN_PRESSURE,
                               GIMP_COORDS_MAX_PRESSURE);
   else
@@ -177,3 +180,153 @@
 {
   gdk_device_get_state (device, shell->canvas->window, NULL, state);
 }
+
+/**
+ * gimp_display_shell_eval_event:
+ * @shell:
+ * @coords:
+ * @inertia_factor:
+ * @time:
+ *
+ * This function evaluates the event to decide if the change is
+ * big enough to need handling and returns FALSE, if change is less
+ * than one image pixel or when smoothed event distance covers less
+ * than one pixel taking a whole lot of load off any draw tools that
+ * have no use for these sub-pixel events anyway. If the event is
+ * seen fit at first look, it is evaluated for speed and smoothed.
+ * Due to lousy time resolution of events pretty strong smoothing is
+ * applied to timestamps for sensible speed result. This function is
+ * also ideal for other event adjustment like pressure curve or
+ * calculating other derived dynamics factors like angular velocity
+ * calculation from tilt values, to allow for even more dynamic
+ * brushes. Calculated distance to last event is stored in GimpCoords
+ * because its a sideproduct of velocity calculation and is currently
+ * calculated in each tool. If they were to use this distance, more
+ * resouces on recalculating the same value would be saved.
+ *
+ * Return value:
+ **/
+gboolean
+gimp_display_shell_eval_event (GimpDisplayShell *shell,
+                               GimpCoords       *coords,
+			       gdouble           inertia_factor,
+			       guint32           time)
+{
+  const gdouble  smooth_factor = 0.3;
+  guint32        thistime      = time;
+  gdouble        dist;
+
+  if (shell->last_disp_motion_time == 0)
+    {
+      /* First pair is invalid to do any velocity calculation,
+       * so we apply constant values.
+       */
+      coords->velocity   = 100;
+      coords->delta_time = 0.001;
+      coords->distance   = 1;
+    }
+  else
+    {
+      gdouble dx = coords->delta_x = shell->last_coords.x - coords->x;
+      gdouble dy = coords->delta_y = shell->last_coords.y - coords->y;
+
+      /* Events with distances less than 1 in either motion direction
+       * are not worth handling.
+       */
+      if (fabs (dx) < 1.0 && fabs (dy) < 1.0)
+        return FALSE;
+
+      coords->delta_time = thistime - 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));
+
+      /* If even smoothed time resolution does not allow to guess for speed,
+       * use last velocity.
+       */
+      if ((coords->delta_time == 0))
+        {
+          coords->velocity = shell->last_coords.velocity;
+        }
+      else
+        {
+          coords->velocity =
+            (coords->distance / (gdouble) coords->delta_time) / 10;
+
+          /* A little smooth on this too, feels better in tools this way. */
+          coords->velocity = (shell->last_coords.velocity * (1 - smooth_factor)
+                              + coords->velocity * smooth_factor);
+          /* Speed needs upper limit */
+          coords->velocity = MIN (coords->velocity, 1.0);
+        }
+
+      if (inertia_factor > 0)
+        {
+          /* Apply smoothing to X and Y. */
+
+          /* This tells how far from the pointer can stray from the line */
+          gdouble max_deviation = SQR (20 * inertia_factor);
+          gdouble cur_deviation = max_deviation;
+          gdouble sin_avg;
+          gdouble sin_old;
+          gdouble sin_new;
+          gdouble cos_avg;
+          gdouble cos_old;
+          gdouble cos_new;
+          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_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_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;
+
+          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;
+
+          cur_deviation = SQR(coords->x-new_x) + SQR(coords->y-new_y);
+
+          while (cur_deviation >= max_deviation)
+            {
+              new_x = new_x * 0.8 + coords->x * 0.2;
+              new_y = new_y * 0.8 + coords->y * 0.2;
+
+              cur_deviation = (SQR (coords->x - new_x) +
+                               SQR (coords->y - new_y));
+            }
+
+          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;
+
+          /* Recalculate distance */
+          coords->distance = sqrt (SQR (coords->delta_x) +
+                                   SQR (coords->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,
+                  shell->last_coords.velocity,
+                  coords->pressure,
+                  coords->distance - dist,
+                  inertia_factor);
+#endif
+    }
+
+  shell->last_coords = *coords;
+  shell->last_disp_motion_time = time;
+
+  return TRUE;
+}

Modified: branches/weskaggs/app/display/gimpdisplayshell-coords.h
==============================================================================
--- branches/weskaggs/app/display/gimpdisplayshell-coords.h	(original)
+++ branches/weskaggs/app/display/gimpdisplayshell-coords.h	Wed Jan 16 19:44:49 2008
@@ -38,6 +38,10 @@
 void     gimp_display_shell_get_device_state  (GimpDisplayShell *shell,
                                                GdkDevice        *device,
                                                GdkModifierType  *state);
+gboolean gimp_display_shell_eval_event        (GimpDisplayShell *shell,
+                                               GimpCoords       *coords,
+                                               gdouble           inertia_factor,
+                                               guint32           time);
 
 
 #endif /* __GIMP_DISPLAY_SHELL_COORDS_H__ */

Modified: branches/weskaggs/app/display/gimpdisplayshell.h
==============================================================================
--- branches/weskaggs/app/display/gimpdisplayshell.h	(original)
+++ branches/weskaggs/app/display/gimpdisplayshell.h	Wed Jan 16 19:44:49 2008
@@ -178,7 +178,8 @@
   gint              scroll_start_x;
   gint              scroll_start_y;
   gboolean          button_press_before_focus;
-  guint32           last_motion_time;
+  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;

Modified: branches/weskaggs/app/gegl/Makefile.am
==============================================================================
--- branches/weskaggs/app/gegl/Makefile.am	(original)
+++ branches/weskaggs/app/gegl/Makefile.am	Wed Jan 16 19:44:49 2008
@@ -7,10 +7,14 @@
 	gimp-gegl.h			\
 	gimp-gegl-utils.c		\
 	gimp-gegl-utils.h		\
+	gimpoperationcolorbalance.c	\
+	gimpoperationcolorbalance.h	\
 	gimpoperationcolorize.c		\
 	gimpoperationcolorize.h		\
 	gimpoperationdesaturate.c	\
 	gimpoperationdesaturate.h	\
+	gimpoperationhuesaturation.c	\
+	gimpoperationhuesaturation.h	\
 	gimpoperationlevels.c		\
 	gimpoperationlevels.h		\
 	gimpoperationposterize.c	\

Modified: branches/weskaggs/app/gegl/gegl-types.h
==============================================================================
--- branches/weskaggs/app/gegl/gegl-types.h	(original)
+++ branches/weskaggs/app/gegl/gegl-types.h	Wed Jan 16 19:44:49 2008
@@ -18,20 +18,23 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  */
 
-#ifndef __OUR_GEGL_TYPES_H__
-#define __OUR_GEGL_TYPES_H__
+#ifndef __GEGL_TYPES_H__
+#define __GEGL_TYPES_H__
 
 
 #include "base/base-types.h"
+#include "gegl/gegl-types.h"
 
 
-typedef struct _GimpOperationColorize   GimpOperationColorize;
-typedef struct _GimpOperationDesaturate GimpOperationDesaturate;
-typedef struct _GimpOperationLevels     GimpOperationLevels;
-typedef struct _GimpOperationPosterize  GimpOperationPosterize;
-typedef struct _GimpOperationThreshold  GimpOperationThreshold;
-typedef struct _GimpOperationTileSink   GimpOperationTileSink;
-typedef struct _GimpOperationTileSource GimpOperationTileSource;
+typedef struct _GimpOperationColorBalance  GimpOperationColorBalance;
+typedef struct _GimpOperationColorize      GimpOperationColorize;
+typedef struct _GimpOperationDesaturate    GimpOperationDesaturate;
+typedef struct _GimpOperationHueSaturation GimpOperationHueSaturation;
+typedef struct _GimpOperationLevels        GimpOperationLevels;
+typedef struct _GimpOperationPosterize     GimpOperationPosterize;
+typedef struct _GimpOperationThreshold     GimpOperationThreshold;
+typedef struct _GimpOperationTileSink      GimpOperationTileSink;
+typedef struct _GimpOperationTileSource    GimpOperationTileSource;
 
 
-#endif /* __OUR_GEGL_TYPES_H__ */
+#endif /* __GEGL_TYPES_H__ */

Modified: branches/weskaggs/app/gegl/gegl/gegl-types.h
==============================================================================
--- branches/weskaggs/app/gegl/gegl/gegl-types.h	(original)
+++ branches/weskaggs/app/gegl/gegl/gegl-types.h	Wed Jan 16 19:44:49 2008
@@ -1,72 +1,30 @@
-/* This file is part of GEGL
+/* GIMP - The GNU Image Manipulation Program
+ * Copyright (C) 1995 Spencer Kimball and Peter Mattis
  *
- * GEGL is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
  *
- * GEGL is distributed in the hope that it will be useful,
+ * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
  *
- * You should have received a copy of the GNU Lesser General Public
- * License along with GEGL; if not, see <http://www.gnu.org/licenses/>.
- *
- * Copyright 2003 Calvin Williamson
- *           2006 Ãyvind KolÃs
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  */
 
-#ifndef __GEGL_TYPES_H__
-#define __GEGL_TYPES_H__
-
-G_BEGIN_DECLS
-
-typedef struct _GeglConnection       GeglConnection;
-typedef struct _GeglColor            GeglColor;
-typedef struct _GeglCurve            GeglCurve;
-typedef struct _GeglCRVisitor        GeglCRVisitor;
-typedef struct _GeglDebugRectVisitor GeglDebugRectVisitor;
-typedef struct _GeglEvalMgr          GeglEvalMgr;
-typedef struct _GeglEvalVisitor      GeglEvalVisitor;
-typedef struct _GeglFinishVisitor    GeglFinishVisitor;
-typedef struct _GeglGraph            GeglGraph;
-typedef struct _GeglHaveVisitor      GeglHaveVisitor;
-typedef struct _GeglNeedVisitor      GeglNeedVisitor;
-typedef struct _GeglNode             GeglNode;
-typedef struct _GeglNodeContext      GeglNodeContext;
-typedef struct _GeglOperation        GeglOperation;
-typedef struct _GeglPad              GeglPad;
-typedef struct _GeglVector           GeglVector;
-typedef struct _GeglProcessor        GeglProcessor;
-typedef struct _GeglPrepareVisitor   GeglPrepareVisitor;
-typedef struct _GeglVisitable        GeglVisitable; /* dummy typedef */
-typedef struct _GeglVisitor          GeglVisitor;
+#ifndef __UGLY_GEGL_TYPES_H__
+#define __UGLY_GEGL_TYPES_H__
 
-typedef struct _GeglRectangle        GeglRectangle;
-typedef struct _GeglPoint            GeglPoint;
-typedef struct _GeglDimension        GeglDimension;
 
-struct _GeglRectangle
-{
-  gint x;
-  gint y;
-  gint width;
-  gint height;
-};
-
-struct _GeglPoint
-{
-  gint x;
-  gint y;
-};
-
-struct _GeglDimension
-{
-  gint width;
-  gint height;
-};
+/*  FIXME: typedefs needed by the headers copied here.
+ *  They are supposed to be removed at some point.
+ */
+typedef struct _GeglOperation   GeglOperation;
+typedef struct _GeglNodeContext GeglNodeContext;
 
-G_END_DECLS
 
-#endif /* __GEGL_TYPES_H__ */
+#endif /* __UGLY_GEGL_TYPES_H__ */

Modified: branches/weskaggs/app/gegl/gimp-gegl.c
==============================================================================
--- branches/weskaggs/app/gegl/gimp-gegl.c	(original)
+++ branches/weskaggs/app/gegl/gimp-gegl.c	Wed Jan 16 19:44:49 2008
@@ -21,14 +21,15 @@
 
 #include "config.h"
 
-#include <glib-object.h>
-#include "gegl/gegl-types.h"
+#include <gegl.h>
 
 #include "gegl-types.h"
 
 #include "gimp-gegl.h"
+#include "gimpoperationcolorbalance.h"
 #include "gimpoperationcolorize.h"
 #include "gimpoperationdesaturate.h"
+#include "gimpoperationhuesaturation.h"
 #include "gimpoperationlevels.h"
 #include "gimpoperationposterize.h"
 #include "gimpoperationthreshold.h"
@@ -39,8 +40,10 @@
 void
 gimp_gegl_init (void)
 {
+  g_type_class_ref (GIMP_TYPE_OPERATION_COLOR_BALANCE);
   g_type_class_ref (GIMP_TYPE_OPERATION_COLORIZE);
   g_type_class_ref (GIMP_TYPE_OPERATION_DESATURATE);
+  g_type_class_ref (GIMP_TYPE_OPERATION_HUE_SATURATION);
   g_type_class_ref (GIMP_TYPE_OPERATION_LEVELS);
   g_type_class_ref (GIMP_TYPE_OPERATION_POSTERIZE);
   g_type_class_ref (GIMP_TYPE_OPERATION_THRESHOLD);

Modified: branches/weskaggs/app/gegl/gimpoperationcolorize.c
==============================================================================
--- branches/weskaggs/app/gegl/gimpoperationcolorize.c	(original)
+++ branches/weskaggs/app/gegl/gimpoperationcolorize.c	Wed Jan 16 19:44:49 2008
@@ -21,13 +21,10 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpcolor/gimpcolor.h"
 
-#include "gegl/gegl-types.h"
-#include <gegl/buffer/gegl-buffer.h>
-
 #include "gegl-types.h"
 
 #include "gimpoperationcolorize.h"
@@ -77,32 +74,29 @@
 
   gegl_operation_class_set_name (operation_class, "gimp-colorize");
 
-  g_object_class_install_property (object_class,
-                                   PROP_HUE,
-                                   g_param_spec_float ("hue",
-                                                       "Hue",
-                                                       "Hue",
-                                                       0.0, 360.0, 180.0,
-                                                       G_PARAM_READWRITE |
-                                                       G_PARAM_CONSTRUCT));
-
-  g_object_class_install_property (object_class,
-                                   PROP_SATURATION,
-                                   g_param_spec_float ("saturation",
-                                                       "Saturation",
-                                                       "Saturation",
-                                                       0.0, 100.0, 50.0,
-                                                       G_PARAM_READWRITE |
-                                                       G_PARAM_CONSTRUCT));
-
-  g_object_class_install_property (object_class,
-                                   PROP_LIGHTNESS,
-                                   g_param_spec_float ("lightness",
-                                                       "Lightness",
-                                                       "Lightness",
-                                                       -100.0, 100.0, 0.0,
-                                                       G_PARAM_READWRITE |
-                                                       G_PARAM_CONSTRUCT));
+  g_object_class_install_property (object_class, PROP_HUE,
+                                   g_param_spec_double ("hue",
+                                                        "Hue",
+                                                        "Hue",
+                                                        0.0, 1.0, 0.5,
+                                                        G_PARAM_READWRITE |
+                                                        G_PARAM_CONSTRUCT));
+
+  g_object_class_install_property (object_class, PROP_SATURATION,
+                                   g_param_spec_double ("saturation",
+                                                        "Saturation",
+                                                        "Saturation",
+                                                        0.0, 1.0, 0.5,
+                                                        G_PARAM_READWRITE |
+                                                        G_PARAM_CONSTRUCT));
+
+  g_object_class_install_property (object_class, PROP_LIGHTNESS,
+                                   g_param_spec_double ("lightness",
+                                                        "Lightness",
+                                                        "Lightness",
+                                                        -1.0, 1.0, 0.0,
+                                                        G_PARAM_READWRITE |
+                                                        G_PARAM_CONSTRUCT));
 }
 
 static void
@@ -121,15 +115,15 @@
   switch (property_id)
     {
     case PROP_HUE:
-      g_value_set_float (value, self->hue);
+      g_value_set_double (value, self->hue);
       break;
 
     case PROP_SATURATION:
-      g_value_set_float (value, self->saturation);
+      g_value_set_double (value, self->saturation);
       break;
 
     case PROP_LIGHTNESS:
-      g_value_set_float (value, self->lightness);
+      g_value_set_double (value, self->lightness);
       break;
 
     default:
@@ -149,15 +143,15 @@
   switch (property_id)
     {
     case PROP_HUE:
-      self->hue = g_value_get_float (value);
+      self->hue = g_value_get_double (value);
       break;
 
     case PROP_SATURATION:
-      self->saturation = g_value_get_float (value);
+      self->saturation = g_value_get_double (value);
       break;
 
     case PROP_LIGHTNESS:
-      self->lightness = g_value_get_float (value);
+      self->lightness = g_value_get_double (value);
       break;
 
    default:
@@ -187,17 +181,17 @@
 
       if (self->lightness > 0)
         {
-          lum = lum * (100.0 - self->lightness) / 100.0;
+          lum = lum * (1.0 - self->lightness);
 
-          lum += 1.0 - (100.0 - self->lightness) / 100.0;
+          lum += 1.0 - (1.0 - self->lightness);
         }
       else if (self->lightness < 0)
         {
-          lum = lum * (self->lightness + 100.0) / 100.0;
+          lum = lum * (self->lightness + 1.0);
         }
 
-      hsl.h = self->hue        / 360.0;
-      hsl.s = self->saturation / 100.0;
+      hsl.h = self->hue;
+      hsl.s = self->saturation;
       hsl.l = lum;
 
       gimp_hsl_to_rgb (&hsl, &rgb);

Modified: branches/weskaggs/app/gegl/gimpoperationcolorize.h
==============================================================================
--- branches/weskaggs/app/gegl/gimpoperationcolorize.h	(original)
+++ branches/weskaggs/app/gegl/gimpoperationcolorize.h	Wed Jan 16 19:44:49 2008
@@ -38,9 +38,9 @@
 {
   GeglOperationPointFilter  parent_instance;
 
-  gfloat                    hue;
-  gfloat                    saturation;
-  gfloat                    lightness;
+  gdouble                   hue;
+  gdouble                   saturation;
+  gdouble                   lightness;
 };
 
 struct _GimpOperationColorizeClass

Modified: branches/weskaggs/app/gegl/gimpoperationdesaturate.c
==============================================================================
--- branches/weskaggs/app/gegl/gimpoperationdesaturate.c	(original)
+++ branches/weskaggs/app/gegl/gimpoperationdesaturate.c	Wed Jan 16 19:44:49 2008
@@ -21,13 +21,10 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpcolor/gimpcolor.h"
 
-#include "gegl/gegl-types.h"
-#include <gegl/buffer/gegl-buffer.h>
-
 #include "gegl-types.h"
 
 #include "gimpoperationdesaturate.h"

Modified: branches/weskaggs/app/gegl/gimpoperationlevels.c
==============================================================================
--- branches/weskaggs/app/gegl/gimpoperationlevels.c	(original)
+++ branches/weskaggs/app/gegl/gimpoperationlevels.c	Wed Jan 16 19:44:49 2008
@@ -21,14 +21,11 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpcolor/gimpcolor.h"
 #include "libgimpmath/gimpmath.h"
 
-#include "gegl/gegl-types.h"
-#include <gegl/buffer/gegl-buffer.h>
-
 #include "gegl-types.h"
 
 #include "gimpoperationlevels.h"
@@ -91,44 +88,44 @@
                                                       G_PARAM_CONSTRUCT));
 
   g_object_class_install_property (object_class, PROP_GAMMA,
-                                   g_param_spec_float ("gamma",
-                                                       "Gamma",
-                                                       "Gamma",
-                                                       0.1, 10.0, 1.0,
-                                                       G_PARAM_READWRITE |
-                                                       G_PARAM_CONSTRUCT));
+                                   g_param_spec_double ("gamma",
+                                                        "Gamma",
+                                                        "Gamma",
+                                                        0.1, 10.0, 1.0,
+                                                        G_PARAM_READWRITE |
+                                                        G_PARAM_CONSTRUCT));
 
   g_object_class_install_property (object_class, PROP_LOW_INPUT,
-                                   g_param_spec_float ("low-input",
-                                                       "Low Input",
-                                                       "Low Input",
-                                                       0.0, 1.0, 0.0,
-                                                       G_PARAM_READWRITE |
-                                                       G_PARAM_CONSTRUCT));
+                                   g_param_spec_double ("low-input",
+                                                        "Low Input",
+                                                        "Low Input",
+                                                        0.0, 1.0, 0.0,
+                                                        G_PARAM_READWRITE |
+                                                        G_PARAM_CONSTRUCT));
 
   g_object_class_install_property (object_class, PROP_HIGH_INPUT,
-                                   g_param_spec_float ("high-input",
-                                                       "High Input",
-                                                       "High Input",
-                                                       0.0, 1.0, 1.0,
-                                                       G_PARAM_READWRITE |
-                                                       G_PARAM_CONSTRUCT));
+                                   g_param_spec_double ("high-input",
+                                                        "High Input",
+                                                        "High Input",
+                                                        0.0, 1.0, 1.0,
+                                                        G_PARAM_READWRITE |
+                                                        G_PARAM_CONSTRUCT));
 
   g_object_class_install_property (object_class, PROP_LOW_OUTPUT,
-                                   g_param_spec_float ("low-output",
-                                                       "Low Output",
-                                                       "Low Output",
-                                                       0.0, 1.0, 0.0,
-                                                       G_PARAM_READWRITE |
-                                                       G_PARAM_CONSTRUCT));
+                                   g_param_spec_double ("low-output",
+                                                        "Low Output",
+                                                        "Low Output",
+                                                        0.0, 1.0, 0.0,
+                                                        G_PARAM_READWRITE |
+                                                        G_PARAM_CONSTRUCT));
 
   g_object_class_install_property (object_class, PROP_HIGH_OUTPUT,
-                                   g_param_spec_float ("high-output",
-                                                       "High Output",
-                                                       "High Output",
-                                                       0.0, 1.0, 1.0,
-                                                       G_PARAM_READWRITE |
-                                                       G_PARAM_CONSTRUCT));
+                                   g_param_spec_double ("high-output",
+                                                        "High Output",
+                                                        "High Output",
+                                                        0.0, 1.0, 1.0,
+                                                        G_PARAM_READWRITE |
+                                                        G_PARAM_CONSTRUCT));
 }
 
 static void
@@ -165,23 +162,23 @@
       break;
 
     case PROP_GAMMA:
-      g_value_set_float (value, self->gamma[self->channel]);
+      g_value_set_double (value, self->gamma[self->channel]);
       break;
 
     case PROP_LOW_INPUT:
-      g_value_set_float (value, self->low_input[self->channel]);
+      g_value_set_double (value, self->low_input[self->channel]);
       break;
 
     case PROP_HIGH_INPUT:
-      g_value_set_float (value, self->high_input[self->channel]);
+      g_value_set_double (value, self->high_input[self->channel]);
       break;
 
     case PROP_LOW_OUTPUT:
-      g_value_set_float (value, self->low_output[self->channel]);
+      g_value_set_double (value, self->low_output[self->channel]);
       break;
 
     case PROP_HIGH_OUTPUT:
-      g_value_set_float (value, self->high_output[self->channel]);
+      g_value_set_double (value, self->high_output[self->channel]);
       break;
 
     default:
@@ -205,23 +202,23 @@
       break;
 
     case PROP_GAMMA:
-      self->gamma[self->channel] = g_value_get_float (value);
+      self->gamma[self->channel] = g_value_get_double (value);
       break;
 
     case PROP_LOW_INPUT:
-      self->low_input[self->channel] = g_value_get_float (value);
+      self->low_input[self->channel] = g_value_get_double (value);
       break;
 
     case PROP_HIGH_INPUT:
-      self->high_input[self->channel] = g_value_get_float (value);
+      self->high_input[self->channel] = g_value_get_double (value);
       break;
 
     case PROP_LOW_OUTPUT:
-      self->low_output[self->channel] = g_value_get_float (value);
+      self->low_output[self->channel] = g_value_get_double (value);
       break;
 
     case PROP_HIGH_OUTPUT:
-      self->high_output[self->channel] = g_value_get_float (value);
+      self->high_output[self->channel] = g_value_get_double (value);
       break;
 
    default:
@@ -230,13 +227,13 @@
     }
 }
 
-static inline gfloat
-gimp_operation_levels_map (gfloat value,
-                           gfloat gamma,
-                           gfloat low_input,
-                           gfloat high_input,
-                           gfloat low_output,
-                           gfloat high_output)
+static inline gdouble
+gimp_operation_levels_map (gdouble value,
+                           gdouble gamma,
+                           gdouble low_input,
+                           gdouble high_input,
+                           gdouble low_output,
+                           gdouble high_output)
 {
   /*  determine input intensity  */
   if (high_input != low_input)
@@ -278,7 +275,7 @@
 
       for (channel = 0; channel < 4; channel++)
         {
-          gfloat value;
+          gdouble value;
 
           value = gimp_operation_levels_map (src[channel],
                                              self->gamma[channel + 1],
@@ -288,7 +285,7 @@
                                              self->high_output[channel + 1]);
 
           /* don't apply the overall curve to the alpha channel */
-          if (channel != 3)
+          if (channel != ALPHA_PIX)
             value = gimp_operation_levels_map (value,
                                                self->gamma[0],
                                                self->low_input[0],

Modified: branches/weskaggs/app/gegl/gimpoperationlevels.h
==============================================================================
--- branches/weskaggs/app/gegl/gimpoperationlevels.h	(original)
+++ branches/weskaggs/app/gegl/gimpoperationlevels.h	Wed Jan 16 19:44:49 2008
@@ -42,13 +42,13 @@
 
   GimpHistogramChannel      channel;
 
-  gfloat                    gamma[5];
+  gdouble                   gamma[5];
 
-  gfloat                    low_input[5];
-  gfloat                    high_input[5];
+  gdouble                   low_input[5];
+  gdouble                   high_input[5];
 
-  gfloat                    low_output[5];
-  gfloat                    high_output[5];
+  gdouble                   low_output[5];
+  gdouble                   high_output[5];
 };
 
 struct _GimpOperationLevelsClass

Modified: branches/weskaggs/app/gegl/gimpoperationposterize.c
==============================================================================
--- branches/weskaggs/app/gegl/gimpoperationposterize.c	(original)
+++ branches/weskaggs/app/gegl/gimpoperationposterize.c	Wed Jan 16 19:44:49 2008
@@ -21,14 +21,11 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpcolor/gimpcolor.h"
 #include "libgimpmath/gimpmath.h"
 
-#include "gegl/gegl-types.h"
-#include <gegl/buffer/gegl-buffer.h>
-
 #include "gegl-types.h"
 
 #include "gimpoperationposterize.h"

Modified: branches/weskaggs/app/gegl/gimpoperationthreshold.c
==============================================================================
--- branches/weskaggs/app/gegl/gimpoperationthreshold.c	(original)
+++ branches/weskaggs/app/gegl/gimpoperationthreshold.c	Wed Jan 16 19:44:49 2008
@@ -21,13 +21,10 @@
 
 #include "config.h"
 
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpcolor/gimpcolor.h"
 
-#include "gegl/gegl-types.h"
-#include <gegl/buffer/gegl-buffer.h>
-
 #include "gegl-types.h"
 
 #include "gimpoperationthreshold.h"
@@ -76,23 +73,21 @@
 
   gegl_operation_class_set_name (operation_class, "gimp-threshold");
 
-  g_object_class_install_property (object_class,
-                                   PROP_LOW,
-                                   g_param_spec_float ("low",
-                                                       "Low",
-                                                       "Low threshold",
-                                                       0.0, 1.0, 0.5,
-                                                       G_PARAM_READWRITE |
-                                                       G_PARAM_CONSTRUCT));
-
-  g_object_class_install_property (object_class,
-                                   PROP_HIGH,
-                                   g_param_spec_float ("high",
-                                                       "High",
-                                                       "High threshold",
-                                                       0.0, 1.0, 1.0,
-                                                       G_PARAM_READWRITE |
-                                                       G_PARAM_CONSTRUCT));
+  g_object_class_install_property (object_class, PROP_LOW,
+                                   g_param_spec_double ("low",
+                                                        "Low",
+                                                        "Low threshold",
+                                                        0.0, 1.0, 0.5,
+                                                        G_PARAM_READWRITE |
+                                                        G_PARAM_CONSTRUCT));
+
+  g_object_class_install_property (object_class, PROP_HIGH,
+                                   g_param_spec_double ("high",
+                                                        "High",
+                                                        "High threshold",
+                                                        0.0, 1.0, 1.0,
+                                                        G_PARAM_READWRITE |
+                                                        G_PARAM_CONSTRUCT));
 }
 
 static void
@@ -111,11 +106,11 @@
   switch (property_id)
     {
     case PROP_LOW:
-      g_value_set_float (value, self->low);
+      g_value_set_double (value, self->low);
       break;
 
     case PROP_HIGH:
-      g_value_set_float (value, self->high);
+      g_value_set_double (value, self->high);
       break;
 
     default:
@@ -135,11 +130,11 @@
   switch (property_id)
     {
     case PROP_LOW:
-      self->low = g_value_get_float (value);
+      self->low = g_value_get_double (value);
       break;
 
     case PROP_HIGH:
-      self->high = g_value_get_float (value);
+      self->high = g_value_get_double (value);
       break;
 
     default:

Modified: branches/weskaggs/app/gegl/gimpoperationthreshold.h
==============================================================================
--- branches/weskaggs/app/gegl/gimpoperationthreshold.h	(original)
+++ branches/weskaggs/app/gegl/gimpoperationthreshold.h	Wed Jan 16 19:44:49 2008
@@ -38,8 +38,8 @@
 {
   GeglOperationPointFilter  parent_instance;
 
-  gfloat                    low;
-  gfloat                    high;
+  gdouble                   low;
+  gdouble                   high;
 };
 
 struct _GimpOperationThresholdClass

Modified: branches/weskaggs/app/gegl/gimpoperationtilesink.c
==============================================================================
--- branches/weskaggs/app/gegl/gimpoperationtilesink.c	(original)
+++ branches/weskaggs/app/gegl/gimpoperationtilesink.c	Wed Jan 16 19:44:49 2008
@@ -23,11 +23,8 @@
 
 #include <string.h>
 
-#include <glib-object.h>
-
-#include "gegl/gegl-types.h"
-#include "gegl/graph/gegl-node-context.h"
-#include <gegl/buffer/gegl-buffer.h>
+#include <gegl.h>
+#include "gegl/buffer/gegl-buffer.h"
 
 #include "gegl-types.h"
 

Modified: branches/weskaggs/app/gegl/gimpoperationtilesource.c
==============================================================================
--- branches/weskaggs/app/gegl/gimpoperationtilesource.c	(original)
+++ branches/weskaggs/app/gegl/gimpoperationtilesource.c	Wed Jan 16 19:44:49 2008
@@ -23,10 +23,8 @@
 
 #include <string.h>
 
-#include <glib-object.h>
-
-#include "gegl/gegl-types.h"
-#include <gegl/buffer/gegl-buffer.h>
+#include <gegl.h>
+#include "gegl/buffer/gegl-buffer.h"
 
 #include "gegl-types.h"
 
@@ -34,7 +32,6 @@
 #include "base/pixel-region.h"
 
 #include "gimp-gegl-utils.h"
-#include "gegl/graph/gegl-node-context.h"
 #include "gimpoperationtilesource.h"
 
 

Modified: branches/weskaggs/app/paint/gimpink.c
==============================================================================
--- branches/weskaggs/app/paint/gimpink.c	(original)
+++ branches/weskaggs/app/paint/gimpink.c	Wed Jan 16 19:44:49 2008
@@ -77,18 +77,6 @@
                                           gdouble           ytilt,
                                           gdouble           velocity);
 
-static void      time_smoother_add       (GimpInk          *ink,
-                                          guint32           value);
-static guint32   time_smoother_result    (GimpInk          *ink);
-static void      time_smoother_init      (GimpInk          *ink,
-                                          guint32           initval);
-
-static void      dist_smoother_add       (GimpInk          *ink,
-                                          gdouble           value);
-static gdouble   dist_smoother_result    (GimpInk          *ink);
-static void      dist_smoother_init      (GimpInk          *ink,
-                                          gdouble           initval);
-
 static void      render_blob             (Blob             *blob,
                                           PixelRegion      *dest);
 
@@ -270,67 +258,25 @@
                                         paint_core->cur_coords.pressure,
                                         paint_core->cur_coords.xtilt,
                                         paint_core->cur_coords.ytilt,
-                                        10.0);
+                                        100);
 
       if (ink->start_blob)
         g_free (ink->start_blob);
 
       ink->start_blob = blob_duplicate (ink->last_blob);
 
-      time_smoother_init (ink, time);
-      ink->last_time = time;
-
-      dist_smoother_init (ink, 0.0);
-      ink->init_velocity = TRUE;
-
       blob_to_render = ink->last_blob;
     }
   else
     {
       Blob    *blob;
-      gdouble  dist;
-      gdouble  velocity;
-      guint32  lasttime = ink->last_time;
-      guint32  thistime;
-
-      time_smoother_add (ink, time);
-      thistime = ink->last_time = time_smoother_result (ink);
-
-      /* The time resolution on X-based GDK motion events is bloody
-       * awful, hence the use of the smoothing function.  Sadly this
-       * also means that there is always the chance of having an
-       * indeterminite velocity since this event and the previous
-       * several may still appear to issue at the same
-       * instant. -ADM
-       */
-      if (thistime == lasttime)
-        thistime = lasttime + 1;
-
-      dist = sqrt ((paint_core->last_coords.x - paint_core->cur_coords.x) *
-                   (paint_core->last_coords.x - paint_core->cur_coords.x) +
-                   (paint_core->last_coords.y - paint_core->cur_coords.y) *
-                   (paint_core->last_coords.y - paint_core->cur_coords.y));
-
-      if (ink->init_velocity)
-        {
-          dist_smoother_init (ink, dist);
-          ink->init_velocity = FALSE;
-        }
-      else
-        {
-          dist_smoother_add (ink, dist);
-          dist = dist_smoother_result (ink);
-        }
-
-      velocity = 10.0 * sqrt ((dist) / (gdouble) (thistime - lasttime));
-
       blob = ink_pen_ellipse (options,
                               paint_core->cur_coords.x,
                               paint_core->cur_coords.y,
                               paint_core->cur_coords.pressure,
                               paint_core->cur_coords.xtilt,
                               paint_core->cur_coords.ytilt,
-                              velocity);
+                              paint_core->cur_coords.velocity * 100);
 
       blob_union = blob_convex_union (ink->last_blob, blob);
       g_free (ink->last_blob);
@@ -510,84 +456,6 @@
 }
 
 
-static void
-time_smoother_init (GimpInk *ink,
-                    guint32  initval)
-{
-  gint i;
-
-  ink->ts_index = 0;
-
-  for (i = 0; i < TIME_SMOOTHER_BUFFER; i++)
-    ink->ts_buffer[i] = initval;
-}
-
-static guint32
-time_smoother_result (GimpInk *ink)
-{
-  guint64 result = 0;
-  gint    i;
-
-  for (i = 0; i < TIME_SMOOTHER_BUFFER; i++)
-    result += ink->ts_buffer[i];
-
-  return (result / (guint64) TIME_SMOOTHER_BUFFER);
-}
-
-static void
-time_smoother_add (GimpInk *ink,
-                   guint32  value)
-{
-  guint64 long_value = (guint64) value;
-
-  /*  handle wrap-around of time values  */
-  if (long_value < ink->ts_buffer[ink->ts_index])
-    long_value += (guint64) + G_MAXUINT32;
-
-  ink->ts_buffer[ink->ts_index++] = long_value;
-
-  ink->ts_buffer[ink->ts_index++] = value;
-
-  if (ink->ts_index == TIME_SMOOTHER_BUFFER)
-    ink->ts_index = 0;
-}
-
-
-static void
-dist_smoother_init (GimpInk *ink,
-                    gdouble  initval)
-{
-  gint i;
-
-  ink->dt_index = 0;
-
-  for (i = 0; i < DIST_SMOOTHER_BUFFER; i++)
-    ink->dt_buffer[i] = initval;
-}
-
-static gdouble
-dist_smoother_result (GimpInk *ink)
-{
-  gint    i;
-  gdouble result = 0.0;
-
-  for (i = 0; i < DIST_SMOOTHER_BUFFER; i++)
-    result += ink->dt_buffer[i];
-
-  return (result / (gdouble) DIST_SMOOTHER_BUFFER);
-}
-
-static void
-dist_smoother_add (GimpInk *ink,
-                   gdouble  value)
-{
-  ink->dt_buffer[ink->dt_index++] = value;
-
-  if (ink->dt_index == DIST_SMOOTHER_BUFFER)
-    ink->dt_index = 0;
-}
-
-
 /*********************************/
 /*  Rendering functions          */
 /*********************************/

Modified: branches/weskaggs/app/paint/gimpink.h
==============================================================================
--- branches/weskaggs/app/paint/gimpink.h	(original)
+++ branches/weskaggs/app/paint/gimpink.h	Wed Jan 16 19:44:49 2008
@@ -24,10 +24,6 @@
 #include "gimpink-blob.h"
 
 
-#define DIST_SMOOTHER_BUFFER 10
-#define TIME_SMOOTHER_BUFFER 10
-
-
 #define GIMP_TYPE_INK            (gimp_ink_get_type ())
 #define GIMP_INK(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_INK, GimpInk))
 #define GIMP_INK_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_INK, GimpInkClass))
@@ -46,18 +42,6 @@
 
   Blob          *cur_blob;     /*  current blob                   */
   Blob          *last_blob;    /*  blob for last cursor position  */
-
-  /* circular distance history buffer */
-  gdouble        dt_buffer[DIST_SMOOTHER_BUFFER];
-  gint           dt_index;
-
-  /* circular timing history buffer */
-  guint32        ts_buffer[TIME_SMOOTHER_BUFFER];
-  gint           ts_index;
-
-  guint32        last_time;     /*  previous time of a motion event  */
-
-  gboolean       init_velocity;
 };
 
 struct _GimpInkClass

Modified: branches/weskaggs/app/paint/gimpinkundo.c
==============================================================================
--- branches/weskaggs/app/paint/gimpinkundo.c	(original)
+++ branches/weskaggs/app/paint/gimpinkundo.c	Wed Jan 16 19:44:49 2008
@@ -82,20 +82,6 @@
   if (ink->start_blob)
     ink_undo->last_blob = blob_duplicate (ink->start_blob);
 
-  memcpy (ink_undo->dt_buffer, ink->dt_buffer,
-          sizeof (ink_undo->dt_buffer));
-
-  ink_undo->dt_index = ink->dt_index;
-
-  memcpy (ink_undo->ts_buffer, ink->ts_buffer,
-          sizeof (ink_undo->ts_buffer));
-
-  ink_undo->ts_index = ink->ts_index;
-
-  ink_undo->last_time = ink->last_time;
-
-  ink_undo->init_velocity = ink->init_velocity;
-
   return object;
 }
 
@@ -112,44 +98,11 @@
     {
       GimpInk *ink = GIMP_INK (GIMP_PAINT_CORE_UNDO (ink_undo)->paint_core);
       Blob    *tmp_blob;
-      gint     tmp_int;
-      gdouble  tmp_double;
-      guint32  tmp_int_buf[DIST_SMOOTHER_BUFFER];
-      gdouble  tmp_double_buf[DIST_SMOOTHER_BUFFER];
 
       tmp_blob = ink->last_blob;
       ink->last_blob = ink_undo->last_blob;
       ink_undo->last_blob = tmp_blob;
 
-      memcpy (tmp_double_buf, ink->dt_buffer,
-              sizeof (tmp_double_buf));
-      memcpy (ink->dt_buffer, ink_undo->dt_buffer,
-              sizeof (tmp_double_buf));
-      memcpy (ink_undo->dt_buffer, tmp_double_buf,
-              sizeof (tmp_double_buf));
-
-      tmp_int = ink->dt_index;
-      ink->dt_index = ink_undo->dt_index;
-      ink_undo->dt_index = tmp_int;
-
-      memcpy (tmp_int_buf, ink->ts_buffer,
-              sizeof (tmp_int_buf));
-      memcpy (ink->ts_buffer, ink_undo->ts_buffer,
-              sizeof (tmp_int_buf));
-      memcpy (ink_undo->ts_buffer, tmp_int_buf,
-              sizeof (tmp_int_buf));
-
-      tmp_int = ink->ts_index;
-      ink->ts_index = ink_undo->ts_index;
-      ink_undo->ts_index = tmp_int;
-
-      tmp_double = ink->last_time;
-      ink->last_time = ink_undo->last_time;
-      ink_undo->last_time = tmp_double;
-
-      tmp_int = ink->init_velocity;
-      ink->init_velocity = ink_undo->init_velocity;
-      ink_undo->init_velocity = tmp_int;
     }
 }
 

Modified: branches/weskaggs/app/paint/gimpinkundo.h
==============================================================================
--- branches/weskaggs/app/paint/gimpinkundo.h	(original)
+++ branches/weskaggs/app/paint/gimpinkundo.h	Wed Jan 16 19:44:49 2008
@@ -38,16 +38,6 @@
   GimpPaintCoreUndo  parent_instance;
 
   Blob              *last_blob;
-
-  gdouble            dt_buffer[DIST_SMOOTHER_BUFFER];
-  gint               dt_index;
-
-  guint32            ts_buffer[TIME_SMOOTHER_BUFFER];
-  gint               ts_index;
-
-  gdouble            last_time;
-
-  gboolean           init_velocity;
 };
 
 struct _GimpInkUndoClass

Modified: branches/weskaggs/app/tools/gimpblendtool.c
==============================================================================
--- branches/weskaggs/app/tools/gimpblendtool.c	(original)
+++ branches/weskaggs/app/tools/gimpblendtool.c	Wed Jan 16 19:44:49 2008
@@ -46,7 +46,7 @@
 #include "gimp-intl.h"
 
 
-#define TARGET_SIZE 15
+#define TARGET_SIZE  15
 
 
 /*  local function prototypes  */
@@ -283,11 +283,11 @@
       blend_tool->end_y = coords->y;
     }
 
-  /* Restrict to multiples of 15 degrees if ctrl is pressed */
   if (state & GDK_CONTROL_MASK)
     {
       gimp_tool_motion_constrain (blend_tool->start_x, blend_tool->start_y,
-                                  &blend_tool->end_x, &blend_tool->end_y);
+                                  &blend_tool->end_x, &blend_tool->end_y,
+                                  GIMP_TOOL_CONSTRAIN_15_DEGREES);
     }
 
   gimp_tool_pop_status (tool, display);
@@ -319,7 +319,8 @@
       if (press)
         {
           gimp_tool_motion_constrain (blend_tool->start_x, blend_tool->start_y,
-                                      &blend_tool->end_x, &blend_tool->end_y);
+                                      &blend_tool->end_x, &blend_tool->end_y,
+                                      GIMP_TOOL_CONSTRAIN_15_DEGREES);
         }
 
       gimp_tool_pop_status (tool, display);

Modified: branches/weskaggs/app/tools/gimpbrightnesscontrasttool.c
==============================================================================
--- branches/weskaggs/app/tools/gimpbrightnesscontrasttool.c	(original)
+++ branches/weskaggs/app/tools/gimpbrightnesscontrasttool.c	Wed Jan 16 19:44:49 2008
@@ -196,22 +196,18 @@
 gimp_brightness_contrast_tool_map (GimpImageMapTool *im_tool)
 {
   GimpBrightnessContrastTool *bc_tool = GIMP_BRIGHTNESS_CONTRAST_TOOL (im_tool);
+  gdouble                     brightness;
+  gdouble                     contrast;
 
-  if (im_tool->operation)
-    {
-      gdouble brightness;
-      gdouble contrast;
-
-      brightness = bc_tool->brightness / 256.0;
-      contrast   = (bc_tool->contrast < 0 ?
-                    (bc_tool->contrast + 127.0) / 127.0 :
-                    bc_tool->contrast * 4.0 / 127.0 + 1);
-
-      gegl_node_set (im_tool->operation,
-                     "brightness", brightness,
-                     "contrast",   contrast,
-                     NULL);
-    }
+  brightness = bc_tool->brightness / 256.0;
+  contrast   = (bc_tool->contrast < 0 ?
+                (bc_tool->contrast + 127.0) / 127.0 :
+                bc_tool->contrast * 4.0 / 127.0 + 1);
+
+  gegl_node_set (im_tool->operation,
+                 "brightness", brightness,
+                 "contrast",   contrast,
+                 NULL);
 
   brightness_contrast_lut_setup (bc_tool->lut,
                                  bc_tool->brightness / 255.0,

Modified: branches/weskaggs/app/tools/gimpcolorbalancetool.c
==============================================================================
--- branches/weskaggs/app/tools/gimpcolorbalancetool.c	(original)
+++ branches/weskaggs/app/tools/gimpcolorbalancetool.c	Wed Jan 16 19:44:49 2008
@@ -43,15 +43,16 @@
 
 /*  local function prototypes  */
 
-static void     gimp_color_balance_tool_finalize   (GObject          *object);
+static void       gimp_color_balance_tool_finalize      (GObject          *object);
 
-static gboolean gimp_color_balance_tool_initialize (GimpTool         *tool,
-                                                    GimpDisplay      *display,
-                                                    GError          **error);
-
-static void     gimp_color_balance_tool_map        (GimpImageMapTool *im_tool);
-static void     gimp_color_balance_tool_dialog     (GimpImageMapTool *im_tool);
-static void     gimp_color_balance_tool_reset      (GimpImageMapTool *im_tool);
+static gboolean   gimp_color_balance_tool_initialize    (GimpTool         *tool,
+                                                         GimpDisplay      *display,
+                                                         GError          **error);
+
+static GeglNode * gimp_color_balance_tool_get_operation (GimpImageMapTool *im_tool);
+static void       gimp_color_balance_tool_map           (GimpImageMapTool *im_tool);
+static void       gimp_color_balance_tool_dialog        (GimpImageMapTool *im_tool);
+static void       gimp_color_balance_tool_reset         (GimpImageMapTool *im_tool);
 
 static void     color_balance_update               (GimpColorBalanceTool *cb_tool);
 static void     color_balance_range_callback       (GtkWidget            *widget,
@@ -97,15 +98,16 @@
   GimpToolClass         *tool_class    = GIMP_TOOL_CLASS (klass);
   GimpImageMapToolClass *im_tool_class = GIMP_IMAGE_MAP_TOOL_CLASS (klass);
 
-  object_class->finalize    = gimp_color_balance_tool_finalize;
+  object_class->finalize       = gimp_color_balance_tool_finalize;
 
-  tool_class->initialize    = gimp_color_balance_tool_initialize;
+  tool_class->initialize       = gimp_color_balance_tool_initialize;
 
-  im_tool_class->shell_desc = _("Adjust Color Balance");
+  im_tool_class->shell_desc    = _("Adjust Color Balance");
 
-  im_tool_class->map        = gimp_color_balance_tool_map;
-  im_tool_class->dialog     = gimp_color_balance_tool_dialog;
-  im_tool_class->reset      = gimp_color_balance_tool_reset;
+  im_tool_class->get_operation = gimp_color_balance_tool_get_operation;
+  im_tool_class->map           = gimp_color_balance_tool_map;
+  im_tool_class->dialog        = gimp_color_balance_tool_dialog;
+  im_tool_class->reset         = gimp_color_balance_tool_reset;
 }
 
 static void
@@ -163,10 +165,37 @@
   return TRUE;
 }
 
+static GeglNode *
+gimp_color_balance_tool_get_operation (GimpImageMapTool *im_tool)
+{
+  return g_object_new (GEGL_TYPE_NODE,
+                       "operation", "gimp-color-balance",
+                       NULL);
+}
+
 static void
-gimp_color_balance_tool_map (GimpImageMapTool *im_tool)
+gimp_color_balance_tool_map (GimpImageMapTool *image_map_tool)
 {
-  GimpColorBalanceTool *cb_tool = GIMP_COLOR_BALANCE_TOOL (im_tool);
+  GimpColorBalanceTool *cb_tool = GIMP_COLOR_BALANCE_TOOL (image_map_tool);
+  ColorBalance         *cb      = cb_tool->color_balance;
+  GimpTransferMode      range;
+
+  for (range = GIMP_SHADOWS; range <= GIMP_HIGHLIGHTS; range++)
+    {
+      gegl_node_set (image_map_tool->operation,
+                     "range", range,
+                     NULL);
+
+      gegl_node_set (image_map_tool->operation,
+                     "cyan-red",      cb->cyan_red[range]      / 256.0,
+                     "magenta-green", cb->magenta_green[range] / 256.0,
+                     "yellow-blue",   cb->yellow_blue[range]   / 256.0,
+                     NULL);
+    }
+
+  gegl_node_set (image_map_tool->operation,
+                 "preserve-luminosity", cb->preserve_luminosity,
+                 NULL);
 
   color_balance_create_lookup_tables (cb_tool->color_balance);
 }

Modified: branches/weskaggs/app/tools/gimpcolorizetool.c
==============================================================================
--- branches/weskaggs/app/tools/gimpcolorizetool.c	(original)
+++ branches/weskaggs/app/tools/gimpcolorizetool.c	Wed Jan 16 19:44:49 2008
@@ -171,14 +171,11 @@
 {
   GimpColorizeTool *col_tool = GIMP_COLORIZE_TOOL (image_map_tool);
 
-  if (image_map_tool->operation)
-    {
-      gegl_node_set (image_map_tool->operation,
-                     "hue",        col_tool->colorize->hue,
-                     "saturation", col_tool->colorize->saturation,
-                     "lightness",  col_tool->colorize->lightness,
-                     NULL);
-    }
+  gegl_node_set (image_map_tool->operation,
+                 "hue",        col_tool->colorize->hue        / 360.0,
+                 "saturation", col_tool->colorize->saturation / 100.0,
+                 "lightness",  col_tool->colorize->lightness  / 100.0,
+                 NULL);
 
   colorize_calculate (col_tool->colorize);
 }

Modified: branches/weskaggs/app/tools/gimpeditselectiontool.c
==============================================================================
--- branches/weskaggs/app/tools/gimpeditselectiontool.c	(original)
+++ branches/weskaggs/app/tools/gimpeditselectiontool.c	Wed Jan 16 19:44:49 2008
@@ -55,6 +55,7 @@
 #include "gimpeditselectiontool.h"
 #include "gimptoolcontrol.h"
 #include "tool_manager.h"
+#include "tools-utils.h"
 
 #include "gimp-intl.h"
 
@@ -63,19 +64,23 @@
 #define ARROW_VELOCITY          25
 
 
-static void   gimp_edit_selection_tool_button_release (GimpTool              *tool,
-                                                       GimpCoords            *coords,
-                                                       guint32                time,
-                                                       GdkModifierType        state,
-                                                       GimpButtonReleaseType  release_type,
-                                                       GimpDisplay           *display);
-static void   gimp_edit_selection_tool_motion         (GimpTool              *tool,
-                                                       GimpCoords            *coords,
-                                                       guint32                time,
-                                                       GdkModifierType        state,
-                                                       GimpDisplay           *display);
-
-static void   gimp_edit_selection_tool_draw           (GimpDrawTool          *tool);
+static void    gimp_edit_selection_tool_button_release      (GimpTool              *tool,
+                                                             GimpCoords            *coords,
+                                                             guint32                time,
+                                                             GdkModifierType        state,
+                                                             GimpButtonReleaseType  release_type,
+                                                             GimpDisplay           *display);
+static void    gimp_edit_selection_tool_motion              (GimpTool              *tool,
+                                                             GimpCoords            *coords,
+                                                             guint32                time,
+                                                             GdkModifierType        state,
+                                                             GimpDisplay           *display);
+static void    gimp_edit_selection_tool_active_modifier_key (GimpTool              *tool,
+                                                             GdkModifierType        key,
+                                                             gboolean               press,
+                                                             GdkModifierType        state,
+                                                             GimpDisplay           *display);
+static void    gimp_edit_selection_tool_draw                (GimpDrawTool          *tool);
 
 
 G_DEFINE_TYPE (GimpEditSelectionTool, gimp_edit_selection_tool,
@@ -87,13 +92,14 @@
 static void
 gimp_edit_selection_tool_class_init (GimpEditSelectionToolClass *klass)
 {
-  GimpToolClass     *tool_class = GIMP_TOOL_CLASS (klass);
-  GimpDrawToolClass *draw_class = GIMP_DRAW_TOOL_CLASS (klass);
+  GimpToolClass     *tool_class   = GIMP_TOOL_CLASS (klass);
+  GimpDrawToolClass *draw_class   = GIMP_DRAW_TOOL_CLASS (klass);
 
-  tool_class->button_release = gimp_edit_selection_tool_button_release;
-  tool_class->motion         = gimp_edit_selection_tool_motion;
+  tool_class->button_release      = gimp_edit_selection_tool_button_release;
+  tool_class->motion              = gimp_edit_selection_tool_motion;
+  tool_class->active_modifier_key = gimp_edit_selection_tool_active_modifier_key;
 
-  draw_class->draw           = gimp_edit_selection_tool_draw;
+  draw_class->draw                = gimp_edit_selection_tool_draw;
 }
 
 static void
@@ -111,6 +117,8 @@
   edit_selection_tool->cumly      = 0;
 
   edit_selection_tool->first_move = TRUE;
+
+  edit_selection_tool->constrain  = FALSE;
 }
 
 static void
@@ -207,6 +215,12 @@
   edit_select->x = edit_select->origx = coords->x - off_x;
   edit_select->y = edit_select->origy = coords->y - off_y;
 
+  /* Remember starting point for use in constrained movement */
+  edit_select->start_x = coords->x;
+  edit_select->start_y = coords->y;
+
+  edit_select->constrain = FALSE;
+
   switch (edit_select->edit_mode)
     {
     case GIMP_TRANSLATE_MODE_CHANNEL:
@@ -542,6 +556,13 @@
 
   gimp_item_offsets (active_item, &off_x, &off_y);
 
+  if (edit_select->constrain)
+    {
+      gimp_tool_motion_constrain (edit_select->start_x, edit_select->start_y,
+                                  &coords->x, &coords->y,
+                                  GIMP_TOOL_CONSTRAIN_45_DEGREES);
+    }
+
   motion_x = coords->x - off_x;
   motion_y = coords->y - off_y;
 
@@ -677,6 +698,18 @@
 }
 
 static void
+gimp_edit_selection_tool_active_modifier_key (GimpTool        *tool,
+                                              GdkModifierType  key,
+                                              gboolean         press,
+                                              GdkModifierType  state,
+                                              GimpDisplay     *display)
+{
+  GimpEditSelectionTool *edit_select = GIMP_EDIT_SELECTION_TOOL (tool);
+
+  edit_select->constrain = state & GDK_CONTROL_MASK ? TRUE : FALSE;
+}
+
+static void
 gimp_edit_selection_tool_draw (GimpDrawTool *draw_tool)
 {
   GimpEditSelectionTool *edit_select = GIMP_EDIT_SELECTION_TOOL (draw_tool);

Modified: branches/weskaggs/app/tools/gimpeditselectiontool.h
==============================================================================
--- branches/weskaggs/app/tools/gimpeditselectiontool.h	(original)
+++ branches/weskaggs/app/tools/gimpeditselectiontool.h	Wed Jan 16 19:44:49 2008
@@ -53,6 +53,9 @@
   gboolean            first_move;      /*  Don't push undos after the first  */
 
   gboolean            propagate_release;
+
+  gboolean            constrain;       /*  Constrain the movement            */
+  gdouble             start_x, start_y;/*  Coords when button was pressed    */
 };
 
 struct _GimpEditSelectionToolClass

Modified: branches/weskaggs/app/tools/gimphuesaturationtool.c
==============================================================================
--- branches/weskaggs/app/tools/gimphuesaturationtool.c	(original)
+++ branches/weskaggs/app/tools/gimphuesaturationtool.c	Wed Jan 16 19:44:49 2008
@@ -49,15 +49,16 @@
 
 /*  local function prototypes  */
 
-static void     gimp_hue_saturation_tool_finalize   (GObject          *object);
+static void       gimp_hue_saturation_tool_finalize      (GObject          *object);
 
-static gboolean gimp_hue_saturation_tool_initialize (GimpTool         *tool,
-                                                     GimpDisplay      *display,
-                                                     GError          **error);
-
-static void     gimp_hue_saturation_tool_map        (GimpImageMapTool *im_tool);
-static void     gimp_hue_saturation_tool_dialog     (GimpImageMapTool *im_tool);
-static void     gimp_hue_saturation_tool_reset      (GimpImageMapTool *im_tool);
+static gboolean   gimp_hue_saturation_tool_initialize    (GimpTool         *tool,
+                                                          GimpDisplay      *display,
+                                                          GError          **error);
+
+static GeglNode * gimp_hue_saturation_tool_get_operation (GimpImageMapTool *im_tool);
+static void       gimp_hue_saturation_tool_map           (GimpImageMapTool *im_tool);
+static void       gimp_hue_saturation_tool_dialog        (GimpImageMapTool *im_tool);
+static void       gimp_hue_saturation_tool_reset         (GimpImageMapTool *im_tool);
 
 static void     hue_saturation_update_sliders       (GimpHueSaturationTool *hs_tool);
 static void     hue_saturation_update_color_areas   (GimpHueSaturationTool *hs_tool);
@@ -115,15 +116,16 @@
   GimpToolClass         *tool_class    = GIMP_TOOL_CLASS (klass);
   GimpImageMapToolClass *im_tool_class = GIMP_IMAGE_MAP_TOOL_CLASS (klass);
 
-  object_class->finalize    = gimp_hue_saturation_tool_finalize;
+  object_class->finalize       = gimp_hue_saturation_tool_finalize;
 
-  tool_class->initialize    = gimp_hue_saturation_tool_initialize;
+  tool_class->initialize       = gimp_hue_saturation_tool_initialize;
 
-  im_tool_class->shell_desc = _("Adjust Hue / Lightness / Saturation");
+  im_tool_class->shell_desc    = _("Adjust Hue / Lightness / Saturation");
 
-  im_tool_class->map        = gimp_hue_saturation_tool_map;
-  im_tool_class->dialog     = gimp_hue_saturation_tool_dialog;
-  im_tool_class->reset      = gimp_hue_saturation_tool_reset;
+  im_tool_class->get_operation = gimp_hue_saturation_tool_get_operation;
+  im_tool_class->map           = gimp_hue_saturation_tool_map;
+  im_tool_class->dialog        = gimp_hue_saturation_tool_dialog;
+  im_tool_class->reset         = gimp_hue_saturation_tool_reset;
 }
 
 static void
@@ -181,9 +183,37 @@
   return TRUE;
 }
 
+static GeglNode *
+gimp_hue_saturation_tool_get_operation (GimpImageMapTool *im_tool)
+{
+  return g_object_new (GEGL_TYPE_NODE,
+                       "operation", "gimp-hue-saturation",
+                       NULL);
+}
+
 static void
 gimp_hue_saturation_tool_map (GimpImageMapTool *image_map_tool)
 {
+  GimpHueSaturationTool *hs_tool = GIMP_HUE_SATURATION_TOOL (image_map_tool);
+  HueSaturation         *hs      = hs_tool->hue_saturation;
+  GimpHueRange           range;
+
+  for (range = GIMP_ALL_HUES; range <= GIMP_MAGENTA_HUES; range++)
+    {
+      gegl_node_set (image_map_tool->operation,
+                     "range", range,
+                     NULL);
+
+      gegl_node_set (image_map_tool->operation,
+                     "hue",        hs->hue[range]        / 180.0,
+                     "saturation", hs->saturation[range] / 100.0,
+                     "lightness",  hs->lightness[range]  / 100.0,
+                     NULL);
+    }
+
+  gegl_node_set (image_map_tool->operation,
+                 "overlap", hs->overlap / 100.0,
+                 NULL);
 }
 
 

Modified: branches/weskaggs/app/tools/gimpimagemaptool.c
==============================================================================
--- branches/weskaggs/app/tools/gimpimagemaptool.c	(original)
+++ branches/weskaggs/app/tools/gimpimagemaptool.c	Wed Jan 16 19:44:49 2008
@@ -468,6 +468,7 @@
 gimp_image_map_tool_create_map (GimpImageMapTool *tool)
 {
   GimpCoreConfig *config = GIMP_TOOL (tool)->tool_info->gimp->config;
+  gboolean        use_gegl;
 
   if (tool->image_map)
     {
@@ -475,14 +476,16 @@
       g_object_unref (tool->image_map);
     }
 
-  if (config->use_gegl && ! tool->operation &&
-      GIMP_IMAGE_MAP_TOOL_GET_CLASS (tool)->get_operation)
+  if (GIMP_IMAGE_MAP_TOOL_GET_CLASS (tool)->get_operation)
     tool->operation = GIMP_IMAGE_MAP_TOOL_GET_CLASS (tool)->get_operation (tool);
 
+  g_assert (tool->operation || tool->apply_func);
+
+  use_gegl = (config->use_gegl || ! tool->apply_func);
+
   tool->image_map = gimp_image_map_new (tool->drawable,
                                         GIMP_TOOL (tool)->tool_info->blurb,
-                                        config->use_gegl ?
-                                        tool->operation : NULL,
+                                        use_gegl ? tool->operation : NULL,
                                         tool->apply_func,
                                         tool->apply_data);
 
@@ -599,17 +602,17 @@
   GimpTool            *tool    = GIMP_TOOL (image_map_tool);
   GimpImageMapOptions *options = GIMP_IMAGE_MAP_OPTIONS (config);
 
-  if (options->preview)
+  if (image_map_tool->image_map)
     {
-      gimp_tool_control_set_preserve (tool->control, TRUE);
+      if (options->preview)
+        {
+          gimp_tool_control_set_preserve (tool->control, TRUE);
 
-      gimp_image_map_tool_map (image_map_tool);
+          gimp_image_map_tool_map (image_map_tool);
 
-      gimp_tool_control_set_preserve (tool->control, FALSE);
-    }
-  else
-    {
-      if (image_map_tool->image_map)
+          gimp_tool_control_set_preserve (tool->control, FALSE);
+        }
+      else
         {
           gimp_tool_control_set_preserve (tool->control, TRUE);
 
@@ -634,7 +637,7 @@
   tool    = GIMP_TOOL (image_map_tool);
   options = GIMP_IMAGE_MAP_TOOL_GET_OPTIONS (tool);
 
-  if (options->preview)
+  if (image_map_tool->image_map && options->preview)
     {
       gimp_tool_control_set_preserve (tool->control, TRUE);
 

Modified: branches/weskaggs/app/tools/gimpimagemaptool.h
==============================================================================
--- branches/weskaggs/app/tools/gimpimagemaptool.h	(original)
+++ branches/weskaggs/app/tools/gimpimagemaptool.h	Wed Jan 16 19:44:49 2008
@@ -19,10 +19,12 @@
 #ifndef  __GIMP_IMAGE_MAP_TOOL_H__
 #define  __GIMP_IMAGE_MAP_TOOL_H__
 
+#ifndef __GEGL_H__
 #ifdef __GNUC__
 #warning FIXME: dont include gegl.h here
 #endif
 #include <gegl.h>
+#endif /* __GEGL_H__ */
 
 #include "gimpcolortool.h"
 

Modified: branches/weskaggs/app/tools/gimplevelstool.c
==============================================================================
--- branches/weskaggs/app/tools/gimplevelstool.c	(original)
+++ branches/weskaggs/app/tools/gimplevelstool.c	Wed Jan 16 19:44:49 2008
@@ -269,39 +269,34 @@
 static void
 gimp_levels_tool_map (GimpImageMapTool *image_map_tool)
 {
-  GimpLevelsTool *tool = GIMP_LEVELS_TOOL (image_map_tool);
+  GimpLevelsTool       *tool = GIMP_LEVELS_TOOL (image_map_tool);
+  GimpHistogramChannel  channel;
 
-  if (image_map_tool->operation)
+  for (channel = GIMP_HISTOGRAM_VALUE;
+       channel <= GIMP_HISTOGRAM_ALPHA;
+       channel++)
     {
-      Levels               *levels = tool->levels;
-      GimpHistogramChannel  channel;
-
-      for (channel = GIMP_HISTOGRAM_VALUE;
-           channel <= GIMP_HISTOGRAM_ALPHA;
-           channel++)
-        {
-          /* FIXME: hack */
-          if (! tool->color && channel == 1)
-            gegl_node_set (image_map_tool->operation,
-                           "channel", GIMP_HISTOGRAM_ALPHA,
-                           NULL);
-          else
-            gegl_node_set (image_map_tool->operation,
-                           "channel", channel,
-                           NULL);
-
-          gegl_node_set (image_map_tool->operation,
-                         "gamma",       levels->gamma[channel],
-                         "low-input",   levels->low_input[channel]   / 255.0,
-                         "high-input",  levels->high_input[channel]  / 255.0,
-                         "low-output",  levels->low_output[channel]  / 255.0,
-                         "high-output", levels->high_output[channel] / 255.0,
-                         NULL);
+      /* FIXME: hack */
+      if (! tool->color && channel == 1)
+        gegl_node_set (image_map_tool->operation,
+                       "channel", GIMP_HISTOGRAM_ALPHA,
+                       NULL);
+      else
+        gegl_node_set (image_map_tool->operation,
+                       "channel", channel,
+                       NULL);
+
+      gegl_node_set (image_map_tool->operation,
+                     "gamma",       tool->levels->gamma[channel],
+                     "low-input",   tool->levels->low_input[channel]   / 255.0,
+                     "high-input",  tool->levels->high_input[channel]  / 255.0,
+                     "low-output",  tool->levels->low_output[channel]  / 255.0,
+                     "high-output", tool->levels->high_output[channel] / 255.0,
+                     NULL);
 
-          /* FIXME: hack */
-          if (! tool->color && channel == 1)
-            break;
-        }
+      /* FIXME: hack */
+      if (! tool->color && channel == 1)
+        break;
     }
 
   gimp_lut_setup (tool->lut,

Modified: branches/weskaggs/app/tools/gimpmeasuretool.c
==============================================================================
--- branches/weskaggs/app/tools/gimpmeasuretool.c	(original)
+++ branches/weskaggs/app/tools/gimpmeasuretool.c	Wed Jan 16 19:44:49 2008
@@ -52,8 +52,8 @@
 #include "gimp-intl.h"
 
 
-#define  TARGET       12
-#define  ARC_RADIUS   30
+#define  TARGET      12
+#define  ARC_RADIUS  30
 
 
 /*  local function prototypes  */
@@ -434,7 +434,9 @@
           gdouble  x = measure->x[i];
           gdouble  y = measure->y[i];
 
-          gimp_tool_motion_constrain (measure->x[0], measure->y[0], &x, &y);
+          gimp_tool_motion_constrain (measure->x[0], measure->y[0],
+                                      &x, &y,
+                                      GIMP_TOOL_CONSTRAIN_15_DEGREES);
 
           measure->x[i] = ROUND (x);
           measure->y[i] = ROUND (y);
@@ -505,7 +507,9 @@
       y = measure->mouse_y;
 
       if (press)
-        gimp_tool_motion_constrain (measure->x[0], measure->y[0], &x, &y);
+        gimp_tool_motion_constrain (measure->x[0], measure->y[0],
+                                    &x, &y,
+                                    GIMP_TOOL_CONSTRAIN_15_DEGREES);
 
       measure->x[measure->point] = ROUND (x);
       measure->y[measure->point] = ROUND (y);

Modified: branches/weskaggs/app/tools/gimppainttool.c
==============================================================================
--- branches/weskaggs/app/tools/gimppainttool.c	(original)
+++ branches/weskaggs/app/tools/gimppainttool.c	Wed Jan 16 19:44:49 2008
@@ -253,10 +253,10 @@
       core->cur_coords.y  = floor (core->cur_coords.y ) + 0.5;
     }
 
-  /* Restrict to multiples of 15 degrees if ctrl is pressed */
   if (state & GDK_CONTROL_MASK)
     gimp_tool_motion_constrain (core->last_coords.x, core->last_coords.y,
-                                &core->cur_coords.x, &core->cur_coords.y);
+                                &core->cur_coords.x, &core->cur_coords.y,
+                                GIMP_TOOL_CONSTRAIN_15_DEGREES);
 }
 
 static void

Modified: branches/weskaggs/app/tools/gimpposterizetool.c
==============================================================================
--- branches/weskaggs/app/tools/gimpposterizetool.c	(original)
+++ branches/weskaggs/app/tools/gimpposterizetool.c	Wed Jan 16 19:44:49 2008
@@ -174,12 +174,9 @@
 {
   GimpPosterizeTool *posterize_tool = GIMP_POSTERIZE_TOOL (image_map_tool);
 
-  if (image_map_tool->operation)
-    {
-      gegl_node_set (image_map_tool->operation,
-                     "levels", posterize_tool->levels,
-                     NULL);
-    }
+  gegl_node_set (image_map_tool->operation,
+                 "levels", posterize_tool->levels,
+                 NULL);
 
   posterize_lut_setup (posterize_tool->lut,
                        posterize_tool->levels,

Modified: branches/weskaggs/app/tools/gimpthresholdtool.c
==============================================================================
--- branches/weskaggs/app/tools/gimpthresholdtool.c	(original)
+++ branches/weskaggs/app/tools/gimpthresholdtool.c	Wed Jan 16 19:44:49 2008
@@ -198,13 +198,10 @@
 {
   GimpThresholdTool *t_tool = GIMP_THRESHOLD_TOOL (image_map_tool);
 
-  if (image_map_tool->operation)
-    {
-      gegl_node_set (image_map_tool->operation,
-                     "low",  t_tool->threshold->low_threshold  / 255.0,
-                     "high", t_tool->threshold->high_threshold / 255.0,
-                     NULL);
-    }
+  gegl_node_set (image_map_tool->operation,
+                 "low",  t_tool->threshold->low_threshold  / 255.0,
+                 "high", t_tool->threshold->high_threshold / 255.0,
+                 NULL);
 }
 
 

Modified: branches/weskaggs/app/tools/tools-utils.c
==============================================================================
--- branches/weskaggs/app/tools/tools-utils.c	(original)
+++ branches/weskaggs/app/tools/tools-utils.c	Wed Jan 16 19:44:49 2008
@@ -25,34 +25,46 @@
 #include "tools-utils.h"
 
 
+static gdouble gimp_tool_utils_point_to_line_distance (const GimpVector2 *point,
+                                                       const GimpVector2 *point_on_line,
+                                                       const GimpVector2 *normalized_line_direction,
+                                                       GimpVector2       *closest_line_point);
+
+
 /**
- * gimp_tool_motion_constrain_helper:
- * @dx: the (fixed) delta-x
- * @dy: a suggested delta-y
+ * gimp_tool_utils_point_to_line_distance:
+ * @point:              The point to calculate the distance for.
+ * @point_on_line:      A point on the line.
+ * @line_direction:     Normalized line direction vector.
+ * @closest_line_point: Gets set to the point on the line that is
+ *                      closest to @point.
  *
- * Returns: An adjusted dy' near dy such that the slope (dx,dy')
- *          is a multiple of 15 degrees.
+ * Returns: The shortest distance from @point to the line defined by
+ *          @point_on_line and @normalized_line_direction.
  **/
 static gdouble
-gimp_tool_motion_constrain_helper (gdouble dx,
-                                   gdouble dy)
+gimp_tool_utils_point_to_line_distance (const GimpVector2 *point,
+                                        const GimpVector2 *point_on_line,
+                                        const GimpVector2 *line_direction,
+                                        GimpVector2       *closest_line_point)
 {
-  static const gdouble slope[4]   = { 0, 0.26795, 0.57735, 1 };
-  static const gdouble divider[3] = { 0.13165, 0.41421, 0.76732 };
-  gint  i;
+  GimpVector2 distance_vector;
+  GimpVector2 tmp_a;
+  GimpVector2 tmp_b;
+  gdouble     d;
+
+  gimp_vector2_sub (&tmp_a, point, point_on_line);
 
-  if (dy < 0)
-    return - gimp_tool_motion_constrain_helper (dx, -dy);
+  d = gimp_vector2_inner_product (&tmp_a, line_direction);
 
-  dx = fabs (dx);
+  tmp_b = gimp_vector2_mul_val (*line_direction, d);
 
-  for (i = 0; i < 3; i ++)
-    if (dy < dx * divider[i])
-      break;
+  *closest_line_point = gimp_vector2_add_val (*point_on_line,
+                                              tmp_b);
 
-  dy = dx * slope[i];
+  gimp_vector2_sub (&distance_vector, closest_line_point, point);
 
-  return dy;
+  return gimp_vector2_length (&distance_vector);
 }
 
 /**
@@ -61,33 +73,47 @@
  * @start_y:
  * @end_x:
  * @end_y:
+ * @n_snap_lines: Number evenly disributed lines to snap to.
  *
- * Restricts the motion vector to 15 degree steps by changing the end
- * point (if necessary).
+ * Projects a line onto the specified subset of evenly radially
+ * distributed lines. @n_lines of 2 makes the line snap horizontally
+ * or vertically. @n_lines of 4 snaps on 45 degree steps. @n_lines of
+ * 12 on 15 degree steps. etc.
  **/
 void
-gimp_tool_motion_constrain (gdouble   start_x,
-                            gdouble   start_y,
-                            gdouble  *end_x,
-                            gdouble  *end_y)
+gimp_tool_motion_constrain (gdouble  start_x,
+                            gdouble  start_y,
+                            gdouble *end_x,
+                            gdouble *end_y,
+                            gint     n_snap_lines)
 {
-  gdouble dx = *end_x - start_x;
-  gdouble dy = *end_y - start_y;
-
-  /*  This algorithm changes only one of dx and dy, and does not try
-   *  to constrain the resulting dx and dy to integers. This gives
-   *  at least two benefits:
-   *    1. gimp_tool_motion_constrain is idempotent, even if followed by
-   *       a rounding operation.
-   *    2. For any two lines with the same starting-point and ideal
-   *       15-degree direction, the points plotted by
-   *       gimp_paint_core_interpolate for the shorter line will always
-   *       be a superset of those plotted for the longer line.
-   */
-
-  if (fabs (dx) > fabs (dy))
-    *end_y = (start_y + gimp_tool_motion_constrain_helper (dx, dy));
-  else
-    *end_x = (start_x + gimp_tool_motion_constrain_helper (dy, dx));
+  GimpVector2 line_point          = {  start_x,  start_y };
+  GimpVector2 point               = { *end_x,   *end_y   };
+  GimpVector2 constrained_point;
+  GimpVector2 line_dir;
+  gdouble     shortest_dist_moved = G_MAXDOUBLE;
+  gdouble     dist_moved;
+  gdouble     angle;
+  gint        i;
+
+  for (i = 0; i < n_snap_lines; i++)
+    {
+      angle = i * G_PI / n_snap_lines;
+
+      gimp_vector2_set (&line_dir,
+                        cos (angle),
+                        sin (angle));
+
+      dist_moved = gimp_tool_utils_point_to_line_distance (&point,
+                                                           &line_point,
+                                                           &line_dir,
+                                                           &constrained_point);
+      if (dist_moved < shortest_dist_moved)
+        {
+          shortest_dist_moved = dist_moved;
+
+          *end_x = constrained_point.x;
+          *end_y = constrained_point.y;
+        }
+    }
 }
-

Modified: branches/weskaggs/app/tools/tools-utils.h
==============================================================================
--- branches/weskaggs/app/tools/tools-utils.h	(original)
+++ branches/weskaggs/app/tools/tools-utils.h	Wed Jan 16 19:44:49 2008
@@ -20,10 +20,20 @@
 #define __TOOLS_UTILS_H__
 
 
+/*
+ * Common values for the n_snap_lines parameter of
+ * gimp_tool_motion_constrain.
+ */
+#define GIMP_TOOL_CONSTRAIN_90_DEGREES 2
+#define GIMP_TOOL_CONSTRAIN_45_DEGREES 4
+#define GIMP_TOOL_CONSTRAIN_15_DEGREES 12
+
+
 void  gimp_tool_motion_constrain (gdouble   start_x,
                                   gdouble   start_y,
                                   gdouble  *end_x,
-                                  gdouble  *end_y);
+                                  gdouble  *end_y,
+                                  gint      n_snap_lines);
 
 
 #endif  /*  __TOOLS_UTILS_H__  */

Modified: branches/weskaggs/app/widgets/gimpuimanager.c
==============================================================================
--- branches/weskaggs/app/widgets/gimpuimanager.c	(original)
+++ branches/weskaggs/app/widgets/gimpuimanager.c	Wed Jan 16 19:44:49 2008
@@ -588,6 +588,9 @@
   if (GTK_IS_MENU_ITEM (widget))
     widget = gtk_menu_item_get_submenu (GTK_MENU_ITEM (widget));
 
+  if (! widget)
+    return;
+
   g_return_if_fail (GTK_IS_MENU (widget));
 
   if (! position_func)

Modified: branches/weskaggs/libgimpbase/gimpenv.c
==============================================================================
--- branches/weskaggs/libgimpbase/gimpenv.c	(original)
+++ branches/weskaggs/libgimpbase/gimpenv.c	Wed Jan 16 19:44:49 2008
@@ -412,7 +412,7 @@
  * gimp_user_directory:
  * @type: the type of user directory to retrieve
  *
- * This procedure is deprecated! Use gimp_image_get_colormap() instead.
+ * This procedure is deprecated! Use g_get_user_special_dir() instead.
  *
  * Returns: The path to the specified user directory, or %NULL if the
  *          logical ID was not found.

Modified: branches/weskaggs/modules/colorsel_cmyk_lcms.c
==============================================================================
--- branches/weskaggs/modules/colorsel_cmyk_lcms.c	(original)
+++ branches/weskaggs/modules/colorsel_cmyk_lcms.c	Wed Jan 16 19:44:49 2008
@@ -397,6 +397,7 @@
     }
 
   gtk_label_set_text (GTK_LABEL (module->name_label), _("Profile: (none)"));
+  gimp_help_set_help_data (module->name_label, NULL, NULL);
 
   if (! config)
     goto out;
@@ -418,6 +419,7 @@
 
   text = g_strdup_printf (_("Profile: %s"), name);
   gtk_label_set_text (GTK_LABEL (module->name_label), text);
+  gimp_help_set_help_data (module->name_label, text, NULL);
   g_free (text);
 
   rgb_profile = color_config_get_rgb_profile (config);

Modified: branches/weskaggs/modules/controller_dx_dinput.c
==============================================================================
--- branches/weskaggs/modules/controller_dx_dinput.c	(original)
+++ branches/weskaggs/modules/controller_dx_dinput.c	Wed Jan 16 19:44:49 2008
@@ -174,7 +174,7 @@
 G_MODULE_EXPORT gboolean
 gimp_module_register (GTypeModule *module)
 {
-  gimp_input_device_store_get_type (module);
+  gimp_input_device_store_register_types (module);
   controller_dx_dinput_register_type (module);
 
   return TRUE;

Modified: branches/weskaggs/modules/controller_linux_input.c
==============================================================================
--- branches/weskaggs/modules/controller_linux_input.c	(original)
+++ branches/weskaggs/modules/controller_linux_input.c	Wed Jan 16 19:44:49 2008
@@ -196,7 +196,7 @@
 G_MODULE_EXPORT gboolean
 gimp_module_register (GTypeModule *module)
 {
-  gimp_input_device_store_get_type (module);
+  gimp_input_device_store_register_types (module);
   controller_linux_input_register_type (module);
 
   return TRUE;

Modified: branches/weskaggs/modules/gimpinputdevicestore-dx.c
==============================================================================
--- branches/weskaggs/modules/gimpinputdevicestore-dx.c	(original)
+++ branches/weskaggs/modules/gimpinputdevicestore-dx.c	Wed Jan 16 19:44:49 2008
@@ -76,62 +76,38 @@
 {
   GtkListStoreClass   parent_class;
 
-  void  (*device_added)   (GimpInputDeviceStore *store,
-                           const gchar          *udi);
-  void  (*device_removed) (GimpInputDeviceStore *store,
-                           const gchar          *udi);
+  void  (* device_added)   (GimpInputDeviceStore *store,
+                            const gchar          *udi);
+  void  (* device_removed) (GimpInputDeviceStore *store,
+                            const gchar          *udi);
 };
 
 
-static void      gimp_input_device_store_class_init (GimpInputDeviceStoreClass *klass);
-static void      gimp_input_device_store_init       (GimpInputDeviceStore *store);
-static void      gimp_input_device_store_finalize   (GObject              *object);
-static gboolean  gimp_input_device_store_add        (GimpInputDeviceStore *store,
-                                                     const GUID           *guid);
-static gboolean  gimp_input_device_store_remove     (GimpInputDeviceStore *store,
-                                                     const gchar          *udi);
-
-
-GType                     gimp_input_device_store_type = 0;
-static GtkListStoreClass *parent_class                 = NULL;
-static guint              store_signals[LAST_SIGNAL]   = { 0 };
-
-
-GType
-gimp_input_device_store_get_type (GTypeModule *module)
-{
-  if (! gimp_input_device_store_type)
-    {
-      const GTypeInfo info =
-      {
-        sizeof (GimpInputDeviceStoreClass),
-        (GBaseInitFunc) NULL,
-        (GBaseFinalizeFunc) NULL,
-        (GClassInitFunc) gimp_input_device_store_class_init,
-        NULL,           /* class_finalize */
-        NULL,           /* class_data     */
-        sizeof (GimpInputDeviceStore),
-        0,              /* n_preallocs    */
-        (GInstanceInitFunc) gimp_input_device_store_init
-      };
-
-      gimp_input_device_store_type =
-        g_type_module_register_type (module, GTK_TYPE_LIST_STORE,
-                                     "GimpInputDeviceStore",
-                                     &info, 0);
-    }
+static void      gimp_input_device_store_finalize (GObject              *object);
 
-  return gimp_input_device_store_type;
-}
+static gboolean  gimp_input_device_store_add      (GimpInputDeviceStore *store,
+                                                   const GUID           *guid);
+static gboolean  gimp_input_device_store_remove   (GimpInputDeviceStore *store,
+                                                   const gchar          *udi);
+
+
+G_DEFINE_DYNAMIC_TYPE (GimpInputDeviceStore, gimp_input_device_store,
+                       GTK_TYPE_LIST_STORE)
 
+static guint store_signals[LAST_SIGNAL] = { 0 };
+
+
+void
+gimp_input_device_store_register_types (GTypeModule *module)
+{
+  gimp_input_device_store_register_type (module);
+}
 
 static void
 gimp_input_device_store_class_init (GimpInputDeviceStoreClass *klass)
 {
   GObjectClass *object_class = G_OBJECT_CLASS (klass);
 
-  parent_class = g_type_class_peek_parent (klass);
-
   store_signals[DEVICE_ADDED] =
     g_signal_new ("device-added",
                   G_TYPE_FROM_CLASS (klass),
@@ -156,6 +132,11 @@
   klass->device_removed  = NULL;
 }
 
+static void
+gimp_input_device_store_class_finalize (GimpInputDeviceStoreClass *klass)
+{
+}
+
 static GdkFilterReturn
 aux_window_filter (GdkXEvent *xevent,
                    GdkEvent  *event,
@@ -283,7 +264,7 @@
       store->error = NULL;
     }
 
-  G_OBJECT_CLASS (parent_class)->finalize (object);
+  G_OBJECT_CLASS (gimp_input_device_store_parent_class)->finalize (object);
 }
 
 static gboolean

Modified: branches/weskaggs/modules/gimpinputdevicestore-hal.c
==============================================================================
--- branches/weskaggs/modules/gimpinputdevicestore-hal.c	(original)
+++ branches/weskaggs/modules/gimpinputdevicestore-hal.c	Wed Jan 16 19:44:49 2008
@@ -71,16 +71,15 @@
 {
   GtkListStoreClass   parent_class;
 
-  void  (*device_added)   (GimpInputDeviceStore *store,
-                           const gchar          *udi);
-  void  (*device_removed) (GimpInputDeviceStore *store,
-                           const gchar          *udi);
+  void  (* device_added)   (GimpInputDeviceStore *store,
+                            const gchar          *udi);
+  void  (* device_removed) (GimpInputDeviceStore *store,
+                            const gchar          *udi);
 };
 
 
-static void      gimp_input_device_store_class_init (GimpInputDeviceStoreClass *klass);
-static void      gimp_input_device_store_init       (GimpInputDeviceStore *store);
 static void      gimp_input_device_store_finalize   (GObject              *object);
+
 static gboolean  gimp_input_device_store_add        (GimpInputDeviceStore *store,
                                                      const gchar          *udi);
 static gboolean  gimp_input_device_store_remove     (GimpInputDeviceStore *store,
@@ -92,46 +91,23 @@
                                                          const char    *udi);
 
 
-GType                     gimp_input_device_store_type = 0;
-static GtkListStoreClass *parent_class                 = NULL;
-static guint              store_signals[LAST_SIGNAL]   = { 0 };
+G_DEFINE_DYNAMIC_TYPE (GimpInputDeviceStore, gimp_input_device_store,
+                       GTK_TYPE_LIST_STORE)
 
+static guint store_signals[LAST_SIGNAL] = { 0 };
 
-GType
-gimp_input_device_store_get_type (GTypeModule *module)
-{
-  if (! gimp_input_device_store_type)
-    {
-      const GTypeInfo info =
-      {
-        sizeof (GimpInputDeviceStoreClass),
-        (GBaseInitFunc) NULL,
-        (GBaseFinalizeFunc) NULL,
-        (GClassInitFunc) gimp_input_device_store_class_init,
-        NULL,           /* class_finalize */
-        NULL,           /* class_data     */
-        sizeof (GimpInputDeviceStore),
-        0,              /* n_preallocs    */
-        (GInstanceInitFunc) gimp_input_device_store_init
-      };
-
-      gimp_input_device_store_type =
-        g_type_module_register_type (module, GTK_TYPE_LIST_STORE,
-                                     "GimpInputDeviceStore",
-                                     &info, 0);
-    }
 
-  return gimp_input_device_store_type;
+void
+gimp_input_device_store_register_types (GTypeModule *module)
+{
+  gimp_input_device_store_register_type (module);
 }
 
-
 static void
 gimp_input_device_store_class_init (GimpInputDeviceStoreClass *klass)
 {
   GObjectClass *object_class = G_OBJECT_CLASS (klass);
 
-  parent_class = g_type_class_peek_parent (klass);
-
   store_signals[DEVICE_ADDED] =
     g_signal_new ("device-added",
                   G_TYPE_FROM_CLASS (klass),
@@ -157,6 +133,11 @@
 }
 
 static void
+gimp_input_device_store_class_finalize (GimpInputDeviceStoreClass *klass)
+{
+}
+
+static void
 gimp_input_device_store_init (GimpInputDeviceStore *store)
 {
   GType            types[] = { G_TYPE_STRING, G_TYPE_STRING };
@@ -234,7 +215,7 @@
       store->error = NULL;
     }
 
-  G_OBJECT_CLASS (parent_class)->finalize (object);
+  G_OBJECT_CLASS (gimp_input_device_store_parent_class)->finalize (object);
 }
 
 static gboolean
@@ -443,10 +424,13 @@
 
 #else /* HAVE_LIBHAL */
 
-GType gimp_input_device_store_type = G_TYPE_NONE;
+void
+gimp_input_device_store_register_types (GTypeModule *module)
+{
+}
 
 GType
-gimp_input_device_store_get_type (GTypeModule *module)
+gimp_input_device_store_get_type (void)
 {
   return G_TYPE_NONE;
 }
@@ -470,5 +454,4 @@
   return NULL;
 }
 
-
 #endif /* HAVE_LIBHAL */

Modified: branches/weskaggs/modules/gimpinputdevicestore.h
==============================================================================
--- branches/weskaggs/modules/gimpinputdevicestore.h	(original)
+++ branches/weskaggs/modules/gimpinputdevicestore.h	Wed Jan 16 19:44:49 2008
@@ -23,17 +23,16 @@
 #define __GIMP_INPUT_DEVICE_STORE_H__
 
 
-#define GIMP_TYPE_INPUT_DEVICE_STORE    (gimp_input_device_store_type)
+#define GIMP_TYPE_INPUT_DEVICE_STORE    (gimp_input_device_store_get_type ())
 #define GIMP_INPUT_DEVICE_STORE(obj)    (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_INPUT_DEVICE_STORE, GimpInputDeviceStore))
 #define GIMP_IS_INPUT_DEVICE_STORE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_INPUT_DEVICE_STORE))
 
 typedef struct _GimpInputDeviceStore GimpInputDeviceStore;
 
 
-extern GType gimp_input_device_store_type;
-
-GType                  gimp_input_device_store_get_type        (GTypeModule           *module);
+void                   gimp_input_device_store_register_types  (GTypeModule           *module);
 
+GType                  gimp_input_device_store_get_type        (void);
 
 GimpInputDeviceStore * gimp_input_device_store_new             (void);
 gchar                * gimp_input_device_store_get_device_file (GimpInputDeviceStore  *store,

Modified: branches/weskaggs/plug-ins/common/bumpmap.c
==============================================================================
--- branches/weskaggs/plug-ins/common/bumpmap.c	(original)
+++ branches/weskaggs/plug-ins/common/bumpmap.c	Wed Jan 16 19:44:49 2008
@@ -351,7 +351,6 @@
           bmvals.azimuth    = param[4].data.d_float;
           bmvals.elevation  = param[5].data.d_float;
           bmvals.depth      = param[6].data.d_int32;
-          bmvals.depth      = param[6].data.d_int32;
           bmvals.xofs       = param[7].data.d_int32;
           bmvals.yofs       = param[8].data.d_int32;
           bmvals.waterlevel = param[9].data.d_int32;
@@ -558,7 +557,8 @@
   lz         = sin (elevation) * 255.0;
 
   /* Calculate constant Z component of surface normal */
-  nz           = (6 * 255) / bmvals.depth;
+  /*              (depth may be 0 if non-interactive) */
+  nz           = (6 * 255) / MAX (bmvals.depth, 1);
   params->nz2  = nz * nz;
   params->nzlz = nz * lz;
 

Modified: branches/weskaggs/plug-ins/jpeg/Makefile.am
==============================================================================
--- branches/weskaggs/plug-ins/jpeg/Makefile.am	(original)
+++ branches/weskaggs/plug-ins/jpeg/Makefile.am	Wed Jan 16 19:44:49 2008
@@ -22,9 +22,7 @@
 	$(EXIF_CFLAGS)	\
 	-I$(includedir)
 
-libexec_PROGRAMS = $(JPEG)
-
-EXTRA_PROGRAMS = jpeg
+libexec_PROGRAMS = jpeg
 
 jpeg_SOURCES = \
 	jpeg.c		\

Modified: branches/weskaggs/plug-ins/pygimp/plug-ins/gimpcons.py
==============================================================================
--- branches/weskaggs/plug-ins/pygimp/plug-ins/gimpcons.py	(original)
+++ branches/weskaggs/plug-ins/pygimp/plug-ins/gimpcons.py	Wed Jan 16 19:44:49 2008
@@ -55,7 +55,7 @@
                                                RESPONSE_CLEAR,
                                                RESPONSE_SAVE))
 
-            banner = ('Gimp %s Python Console\nPython %s\n' %
+            banner = ('GIMP %s Python Console\nPython %s\n' %
                       (gimp.pdb.gimp_version(), sys.version))
 
             self.cons = pyconsole.Console(locals=namespace, banner=banner,
@@ -215,7 +215,7 @@
 
 register(
     PROC_NAME,
-    N_("Interactive Gimp-Python interpreter"),
+    N_("Interactive GIMP Python interpreter"),
     "Type in commands and see results",
     "James Henstridge",
     "James Henstridge",

Modified: branches/weskaggs/plug-ins/pygimp/pygimp-pdb.c
==============================================================================
--- branches/weskaggs/plug-ins/pygimp/pygimp-pdb.c	(original)
+++ branches/weskaggs/plug-ins/pygimp/pygimp-pdb.c	Wed Jan 16 19:44:49 2008
@@ -638,18 +638,59 @@
 /* -------------------------------------------------------- */
 
 static PyObject *
+build_procedure_list(void)
+{
+    int num, i;
+    char **names, *name, *p;
+    PyObject *ret;
+
+    gimp_procedural_db_query(".*", ".*", ".*", ".*", ".*", ".*", ".*",
+                             &num, &names);
+
+    ret = PyList_New(num);
+
+    for (i = 0; i < num; i++) {
+        name = g_strdup(names[i]);
+        for (p = name; *p != '\0'; p++) {
+            if (*p == '-')
+                *p = '_';
+	}
+        PyList_SetItem(ret, i, PyString_FromString(name));
+        g_free(name);
+    }
+
+    g_free(names);
+
+    return ret;
+}
+
+static PyObject *
 pdb_getattro(PyGimpPDB *self, PyObject *attr)
 {
+    char *attr_name;
     PyObject *ret;
 
-    ret = PyObject_GenericGetAttr((PyObject *)self, attr);
+    attr_name = PyString_AsString(attr);
+    if (!attr_name) {
+         PyErr_Clear();
+         return PyObject_GenericGetAttr((PyObject *)self, attr);
+    }
 
+    if (attr_name[0] == '_') {
+        if (strcmp(attr_name, "__members__")) {
+            return build_procedure_list();
+        } else {
+            return PyObject_GenericGetAttr((PyObject *)self, attr);
+        }
+    }
+
+    ret = PyObject_GenericGetAttr((PyObject *)self, attr);
     if (ret)
-	return ret;
+        return ret;
 
     PyErr_Clear();
 
-    return pygimp_pdb_function_new_from_proc_db(PyString_AsString(attr));
+    return pygimp_pdb_function_new_from_proc_db(attr_name);
 }
 
 PyTypeObject PyGimpPDB_Type = {

Modified: branches/weskaggs/plug-ins/script-fu/scripts/3d-outline.scm
==============================================================================
--- branches/weskaggs/plug-ins/script-fu/scripts/3d-outline.scm	(original)
+++ branches/weskaggs/plug-ins/script-fu/scripts/3d-outline.scm	Wed Jan 16 19:44:49 2008
@@ -37,10 +37,10 @@
                                        RGB-IMAGE "Background" 100 NORMAL-MODE)))
         (pattern (car (gimp-layer-new img width height
                                       RGBA-IMAGE "Pattern" 100 NORMAL-MODE)))
-        (layer2)
-        (layer3)
-        (pattern-mask)
-        (floating-sel)
+        (layer2 0)
+        (layer3 0)
+        (pattern-mask 0)
+        (floating-sel 0)
         )
 
     (gimp-context-push)

Modified: branches/weskaggs/plug-ins/script-fu/scripts/add-bevel.scm
==============================================================================
--- branches/weskaggs/plug-ins/script-fu/scripts/add-bevel.scm	(original)
+++ branches/weskaggs/plug-ins/script-fu/scripts/add-bevel.scm	Wed Jan 16 19:44:49 2008
@@ -74,7 +74,7 @@
                                          "Bumpmap"
                                          100
                                          NORMAL-MODE)))
-        (select)
+        (select 0)
         )
 
     (gimp-context-push)

Modified: branches/weskaggs/plug-ins/script-fu/scripts/burn-in-anim.scm
==============================================================================
--- branches/weskaggs/plug-ins/script-fu/scripts/burn-in-anim.scm	(original)
+++ branches/weskaggs/plug-ins/script-fu/scripts/burn-in-anim.scm	Wed Jan 16 19:44:49 2008
@@ -26,23 +26,23 @@
         ;--- main variable: "bl-x" runs from 0 to layer-width
         (bl-x 0)
         (frame-nr 0)
-        (img)
-        (source-layer)
-        (bg-source-layer)
-        (source-layer-width)
-        (bg-layer)
-        (bg-layer-name)
-        (bl-layer)
-        (bl-layer-name)
-        (bl-mask)
-        (bl-layer-width)
-        (bl-height)
-        (bl-x-off)
-        (bl-y-off)
-        (nofadeout-bl-x-off)
-        (nofadeout-bl-width)
-        (blended-layer)
-        (img-display)
+        (img 0)
+        (source-layer 0)
+        (bg-source-layer 0)
+        (source-layer-width 0)
+        (bg-layer 0)
+        (bg-layer-name 0)
+        (bl-layer 0)
+        (bl-layer-name 0)
+        (bl-mask 0)
+        (bl-layer-width 0)
+        (bl-height 0)
+        (bl-x-off 0)
+        (bl-y-off 0)
+        (nofadeout-bl-x-off 0)
+        (nofadeout-bl-width 0)
+        (blended-layer 0)
+        (img-display 0)
         )
 
     (if (< speed 1)

Modified: branches/weskaggs/plug-ins/script-fu/scripts/camo.scm
==============================================================================
--- branches/weskaggs/plug-ins/script-fu/scripts/camo.scm	(original)
+++ branches/weskaggs/plug-ins/script-fu/scripts/camo.scm	Wed Jan 16 19:44:49 2008
@@ -26,9 +26,9 @@
         (theHeight inSize)
         (theImage (car (gimp-image-new theWidth theHeight RGB)))
         (baseLayer (car (gimp-layer-new theImage theWidth theHeight RGBA-IMAGE "Background" 100 NORMAL-MODE)))
-        (thickLayer)
-        (thinLayer)
-        (theBlur)
+        (thickLayer 0)
+        (thinLayer 0)
+        (theBlur 0)
         )
 
     (gimp-context-push)

Modified: branches/weskaggs/plug-ins/script-fu/scripts/circuit.scm
==============================================================================
--- branches/weskaggs/plug-ins/script-fu/scripts/circuit.scm	(original)
+++ branches/weskaggs/plug-ins/script-fu/scripts/circuit.scm	Wed Jan 16 19:44:49 2008
@@ -40,15 +40,15 @@
         (type (car (gimp-drawable-type-with-alpha drawable)))
         (image-width (car (gimp-image-width image)))
         (image-height (car (gimp-image-height image)))
-        (active-selection)
-        (from-selection)
-        (selection-bounds)
-        (select-offset-x)
-        (select-offset-y)
-        (select-width)
-        (select-height)
-        (effect-layer)
-        (active-layer)
+        (active-selection 0)
+        (from-selection 0)
+        (selection-bounds 0)
+        (select-offset-x 0)
+        (select-offset-y 0)
+        (select-width 0)
+        (select-height 0)
+        (effect-layer 0)
+        (active-layer 0)
         )
 
     (gimp-context-push)

Modified: branches/weskaggs/plug-ins/script-fu/scripts/clothify.scm
==============================================================================
--- branches/weskaggs/plug-ins/script-fu/scripts/clothify.scm	(original)
+++ branches/weskaggs/plug-ins/script-fu/scripts/clothify.scm	Wed Jan 16 19:44:49 2008
@@ -11,8 +11,8 @@
         (img (car (gimp-image-new width height RGB)))
 ;       (layer-two (car (gimp-layer-new img width height RGB-IMAGE "Y Dots" 100 MULTIPLY-MODE)))
         (layer-one (car (gimp-layer-new img width height RGB-IMAGE "X Dots" 100 NORMAL-MODE)))
-        (layer-two)
-        (bump-layer)
+        (layer-two 0)
+        (bump-layer 0)
         )
 
     (gimp-context-push)

Modified: branches/weskaggs/plug-ins/script-fu/scripts/coffee.scm
==============================================================================
--- branches/weskaggs/plug-ins/script-fu/scripts/coffee.scm	(original)
+++ branches/weskaggs/plug-ins/script-fu/scripts/coffee.scm	Wed Jan 16 19:44:49 2008
@@ -23,7 +23,7 @@
         (theWidth (car (gimp-image-width theImage)))
         (theNumber inNumber)
         (theSize (min theWidth theHeight))
-        (theStain)
+        (theStain 0)
         )
 
     (gimp-context-push)

Modified: branches/weskaggs/plug-ins/script-fu/scripts/contactsheet.scm
==============================================================================
--- branches/weskaggs/plug-ins/script-fu/scripts/contactsheet.scm	(original)
+++ branches/weskaggs/plug-ins/script-fu/scripts/contactsheet.scm	Wed Jan 16 19:44:49 2008
@@ -34,15 +34,15 @@
 
   (define (init-sheet-data size)
     (let (
-         (sheet-w)
-         (sheet-h)
-         (thumb-w)
-         (thumb-h)
-         (border-x) ;Space between rows and at top and bottom of thumbnails
-         (border-y) ;Space between columns and at left and right of thumbnails
-         (off-x)  ; Additional X shift to properly center a row of thumbnails
-         (off-y)  ; Additional Y shift to properly center rows of thumbnails
-         (count)
+         (sheet-w 0)
+         (sheet-h 0)
+         (thumb-w 0)
+         (thumb-h 0)
+         (border-x 0) ;Space between rows and at top and bottom of thumbnails
+         (border-y 0) ;Space between columns and at left and right of thumbnails
+         (off-x 0)  ; Additional X shift to properly center a row of thumbnails
+         (off-y 0)  ; Additional Y shift to properly center rows of thumbnails
+         (count 0)
          )
 
       (case size
@@ -108,9 +108,9 @@
 
   (define (init-sheet-img img num img-width border-y off-y)
     (let* (
-          (text-layer)
-          (text-width)
-          (text-height)
+          (text-layer 0)
+          (text-width 0)
+          (text-height 0)
           )
       (gimp-selection-all img)
       (gimp-drawable-fill (car (gimp-image-get-active-layer img))
@@ -155,25 +155,25 @@
         (pos-x 0)
         (pos-y 0)
 
-        (sheet-data)
-        (sheet-width)
-        (sheet-height)
-        (thumb-w)
-        (thumb-h)
-        (border-x)
-        (border-y)
-        (off-x)
-        (off-y)
-        (max-x)
-        (max-y)
-
-        (sheet-img)
-        (sheet-layer)
-
-        (new-img)
-        (file)
-        (file-path)
-        (tmp-layer)
+        (sheet-data 0)
+        (sheet-width 0)
+        (sheet-height 0)
+        (thumb-w 0)
+        (thumb-h 0)
+        (border-x 0)
+        (border-y 0)
+        (off-x 0)
+        (off-y 0)
+        (max-x 0)
+        (max-y 0)
+
+        (sheet-img 0)
+        (sheet-layer 0)
+
+        (new-img 0)
+        (file 0)
+        (file-path 0)
+        (tmp-layer 0)
         )
 
     (gimp-context-push)

Modified: branches/weskaggs/plug-ins/script-fu/scripts/distress-selection.scm
==============================================================================
--- branches/weskaggs/plug-ins/script-fu/scripts/distress-selection.scm	(original)
+++ branches/weskaggs/plug-ins/script-fu/scripts/distress-selection.scm	Wed Jan 16 19:44:49 2008
@@ -34,7 +34,7 @@
        (theImage inImage)
        (theWidth (car (gimp-image-width inImage)))
        (theHeight (car (gimp-image-height inImage)))
-       (theLayer)
+       (theLayer 0)
        (theMode (car (gimp-image-base-type inImage)))
        )
 

Modified: branches/weskaggs/plug-ins/script-fu/scripts/flatland.scm
==============================================================================
--- branches/weskaggs/plug-ins/script-fu/scripts/flatland.scm	(original)
+++ branches/weskaggs/plug-ins/script-fu/scripts/flatland.scm	Wed Jan 16 19:44:49 2008
@@ -38,7 +38,7 @@
         (img (car (gimp-image-new width height RGB)))
         (layer-one (car (gimp-layer-new img width height
                                         RGB-IMAGE "bottom" 100 NORMAL-MODE)))
-        (layer-two)
+        (layer-two 0)
         )
 
     (gimp-image-undo-disable img)

Modified: branches/weskaggs/plug-ins/script-fu/scripts/font-map.scm
==============================================================================
--- branches/weskaggs/plug-ins/script-fu/scripts/font-map.scm	(original)
+++ branches/weskaggs/plug-ins/script-fu/scripts/font-map.scm	Wed Jan 16 19:44:49 2008
@@ -81,7 +81,7 @@
                                                               GRAY-IMAGE RGB-IMAGE)
                                          "Background" 100 NORMAL-MODE)))
         (count      0)
-        (font)
+        (font       "")
         )
 
     (gimp-context-push)

Modified: branches/weskaggs/plug-ins/script-fu/scripts/fuzzyborder.scm
==============================================================================
--- branches/weskaggs/plug-ins/script-fu/scripts/fuzzyborder.scm	(original)
+++ branches/weskaggs/plug-ins/script-fu/scripts/fuzzyborder.scm	Wed Jan 16 19:44:49 2008
@@ -38,8 +38,8 @@
   (let (
        (theWidth (car (gimp-image-width inImage)))
        (theHeight (car (gimp-image-height inImage)))
-       (theImage)
-       (theLayer)
+       (theImage 0)
+       (theLayer 0)
        )
 
     (gimp-context-push)

Modified: branches/weskaggs/plug-ins/script-fu/scripts/glossy.scm
==============================================================================
--- branches/weskaggs/plug-ins/script-fu/scripts/glossy.scm	(original)
+++ branches/weskaggs/plug-ins/script-fu/scripts/glossy.scm	Wed Jan 16 19:44:49 2008
@@ -47,7 +47,7 @@
         (posy (- (cadr (gimp-drawable-offsets logo-layer))))
         (bg-layer (car (gimp-layer-new img width height RGB-IMAGE "Background" 100 NORMAL-MODE)))
         (grow-me (car (gimp-layer-copy logo-layer TRUE)))
-        (dont-drop-me)
+        (dont-drop-me 0)
         )
 
     (gimp-context-push)

Modified: branches/weskaggs/plug-ins/script-fu/scripts/land.scm
==============================================================================
--- branches/weskaggs/plug-ins/script-fu/scripts/land.scm	(original)
+++ branches/weskaggs/plug-ins/script-fu/scripts/land.scm	Wed Jan 16 19:44:49 2008
@@ -35,7 +35,7 @@
         (img (car (gimp-image-new width height RGB)))
         (layer-one (car (gimp-layer-new img width height
                                         RGB-IMAGE "Bottom" 100 NORMAL-MODE)))
-        (layer-two)
+        (layer-two 0)
         )
   (gimp-context-set-gradient gradient)
   (gimp-image-undo-disable img)

Modified: branches/weskaggs/plug-ins/script-fu/scripts/lava.scm
==============================================================================
--- branches/weskaggs/plug-ins/script-fu/scripts/lava.scm	(original)
+++ branches/weskaggs/plug-ins/script-fu/scripts/lava.scm	Wed Jan 16 19:44:49 2008
@@ -36,14 +36,14 @@
         (type (car (gimp-drawable-type-with-alpha drawable)))
         (image-width (car (gimp-image-width image)))
         (image-height (car (gimp-image-height image)))
-        (active-selection)
-        (selection-bounds)
-        (select-offset-x)
-        (select-offset-y)
-        (select-width)
-        (select-height)
-        (lava-layer)
-        (active-layer)
+        (active-selection 0)
+        (selection-bounds 0)
+        (select-offset-x 0)
+        (select-offset-y 0)
+        (select-width 0)
+        (select-height 0)
+        (lava-layer 0)
+        (active-layer 0)
         )
 
     (gimp-context-push)

Modified: branches/weskaggs/plug-ins/script-fu/scripts/old-photo.scm
==============================================================================
--- branches/weskaggs/plug-ins/script-fu/scripts/old-photo.scm	(original)
+++ branches/weskaggs/plug-ins/script-fu/scripts/old-photo.scm	Wed Jan 16 19:44:49 2008
@@ -26,10 +26,10 @@
 
 (define (script-fu-old-photo inImage inLayer inDefocus inBorderSize inSepia inMottle inCopy)
   (let (
-       (theImage)
-       (theLayer)
-       (theWidth)
-       (theHeight)
+       (theImage 0)
+       (theLayer 0)
+       (theWidth 0)
+       (theHeight 0)
        )
   (gimp-image-undo-group-start inImage)
   (gimp-selection-all inImage)

Modified: branches/weskaggs/plug-ins/script-fu/scripts/predator.scm
==============================================================================
--- branches/weskaggs/plug-ins/script-fu/scripts/predator.scm	(original)
+++ branches/weskaggs/plug-ins/script-fu/scripts/predator.scm	Wed Jan 16 19:44:49 2008
@@ -35,15 +35,15 @@
         (type (car (gimp-drawable-type-with-alpha drawable)))
         (image-width (car (gimp-image-width image)))
         (image-height (car (gimp-image-height image)))
-        (active-selection)
-        (from-selection)
-        (selection-bounds)
-        (select-offset-x)
-        (select-offset-y)
-        (select-width)
-        (select-height)
-        (effect-layer)
-        (active-layer)
+        (active-selection 0)
+        (from-selection 0)
+        (selection-bounds 0)
+        (select-offset-x 0)
+        (select-offset-y 0)
+        (select-width 0)
+        (select-height 0)
+        (effect-layer 0)
+        (active-layer 0)
         )
 
     (gimp-image-undo-group-start image)

Modified: branches/weskaggs/plug-ins/script-fu/scripts/rendermap.scm
==============================================================================
--- branches/weskaggs/plug-ins/script-fu/scripts/rendermap.scm	(original)
+++ branches/weskaggs/plug-ins/script-fu/scripts/rendermap.scm	Wed Jan 16 19:44:49 2008
@@ -25,8 +25,8 @@
         (theWidth inSize)
         (theHeight inSize)
         (theImage (car(gimp-image-new theWidth theHeight RGB)))
-        (theLayer)
-        (thinLayer)
+        (theLayer 0)
+        (thinLayer 0)
         )
 
   (gimp-context-push)

Modified: branches/weskaggs/plug-ins/script-fu/scripts/ripply-anim.scm
==============================================================================
--- branches/weskaggs/plug-ins/script-fu/scripts/ripply-anim.scm	(original)
+++ branches/weskaggs/plug-ins/script-fu/scripts/ripply-anim.scm	Wed Jan 16 19:44:49 2008
@@ -25,19 +25,19 @@
         (height (car (gimp-drawable-height drawable)))
         (ripple-image (car (gimp-image-new width height GRAY)))
         (ripple-layer (car (gimp-layer-new ripple-image width height GRAY-IMAGE "Ripple Texture" 100 NORMAL-MODE)))
-        (rippletiled-ret)
-        (rippletiled-image)
-        (rippletiled-layer)
-        (remaining-frames)
-        (xpos)
-        (ypos)
-        (xoffset)
-        (yoffset)
-        (dup-image)
-        (layer-name)
-        (this-image)
-        (this-layer)
-        (dup-layer)
+        (rippletiled-ret 0)
+        (rippletiled-image 0)
+        (rippletiled-layer 0)
+        (remaining-frames 0)
+        (xpos 0)
+        (ypos 0)
+        (xoffset 0)
+        (yoffset 0)
+        (dup-image 0)
+        (layer-name 0)
+        (this-image 0)
+        (this-layer 0)
+        (dup-layer 0)
         )
 
     (gimp-context-push)

Modified: branches/weskaggs/plug-ins/script-fu/scripts/script-fu-compat.init
==============================================================================
--- branches/weskaggs/plug-ins/script-fu/scripts/script-fu-compat.init	(original)
+++ branches/weskaggs/plug-ins/script-fu/scripts/script-fu-compat.init	Wed Jan 16 19:44:49 2008
@@ -330,8 +330,7 @@
 )
 
 (define (prog1 form1 . form2)
-  (let ((a))
-    (set! a form1)
+  (let ((a form1))
     (if (not (null? form2))
       form2
     )

Modified: branches/weskaggs/plug-ins/script-fu/scripts/script-fu-set-cmap.scm
==============================================================================
--- branches/weskaggs/plug-ins/script-fu/scripts/script-fu-set-cmap.scm	(original)
+++ branches/weskaggs/plug-ins/script-fu/scripts/script-fu-set-cmap.scm	Wed Jan 16 19:44:49 2008
@@ -27,7 +27,7 @@
   (let* (
         (num-colours (car (gimp-palette-get-info palette)))
         (cmap (cons-array (* num-colours 3) 'byte))
-        (colour)
+        (colour 0)
         (i 0)
         )
 

Modified: branches/weskaggs/plug-ins/script-fu/scripts/select-to-brush.scm
==============================================================================
--- branches/weskaggs/plug-ins/script-fu/scripts/select-to-brush.scm	(original)
+++ branches/weskaggs/plug-ins/script-fu/scripts/select-to-brush.scm	Wed Jan 16 19:44:49 2008
@@ -38,13 +38,13 @@
         (select-offset-y  (caddr selection-bounds))
         (selection-width  (- (cadr (cddr selection-bounds))  select-offset-x))
         (selection-height (- (caddr (cddr selection-bounds)) select-offset-y))
-        (from-selection)
-        (active-selection)
-        (brush-draw-type)
-        (brush-image-type)
-        (brush-image)
-        (brush-draw)
-        (filename2)
+        (from-selection 0)
+        (active-selection 0)
+        (brush-draw-type 0)
+        (brush-image-type 0)
+        (brush-image 0)
+        (brush-draw 0)
+        (filename2 0)
         )
 
     (gimp-context-push)

Modified: branches/weskaggs/plug-ins/script-fu/scripts/select-to-image.scm
==============================================================================
--- branches/weskaggs/plug-ins/script-fu/scripts/select-to-image.scm	(original)
+++ branches/weskaggs/plug-ins/script-fu/scripts/select-to-image.scm	Wed Jan 16 19:44:49 2008
@@ -32,10 +32,10 @@
         (select-offset-y (caddr selection-bounds))
         (selection-width (- (cadr (cddr selection-bounds)) select-offset-x))
         (selection-height (- (caddr (cddr selection-bounds)) select-offset-y))
-        (active-selection)
-        (from-selection)
-        (new-image)
-        (new-draw)
+        (active-selection 0)
+        (from-selection 0)
+        (new-image 0)
+        (new-draw 0)
         )
 
     (gimp-context-push)

Modified: branches/weskaggs/plug-ins/script-fu/scripts/select-to-pattern.scm
==============================================================================
--- branches/weskaggs/plug-ins/script-fu/scripts/select-to-pattern.scm	(original)
+++ branches/weskaggs/plug-ins/script-fu/scripts/select-to-pattern.scm	Wed Jan 16 19:44:49 2008
@@ -26,16 +26,16 @@
 (define (script-fu-selection-to-pattern image drawable desc filename)
 
   (let* (
-        (selection-width)
-        (selection-height)
-        (selection-bounds)
-        (select-offset-x)
-        (select-offset-y)
-        (pattern-draw-type)
-        (pattern-image-type)
-        (pattern-image)
-        (pattern-draw)
-        (filename2)
+        (selection-width 0)
+        (selection-height 0)
+        (selection-bounds 0)
+        (select-offset-x 0)
+        (select-offset-y 0)
+        (pattern-draw-type 0)
+        (pattern-image-type 0)
+        (pattern-image 0)
+        (pattern-draw 0)
+        (filename2 0)
         )
 
   (if (= (car (gimp-selection-is-empty image)) TRUE)

Modified: branches/weskaggs/plug-ins/script-fu/scripts/speed-text.scm
==============================================================================
--- branches/weskaggs/plug-ins/script-fu/scripts/speed-text.scm	(original)
+++ branches/weskaggs/plug-ins/script-fu/scripts/speed-text.scm	Wed Jan 16 19:44:49 2008
@@ -31,8 +31,8 @@
         (saved-select 0)
         (cell-size (/ font-size 8))
         (grey (/ (* density 255) 100))
-        (saved-sel)
-        (text-mask)
+        (saved-sel 0)
+        (text-mask 0)
         )
 
     (gimp-context-push)

Modified: branches/weskaggs/plug-ins/script-fu/scripts/spinning-globe.scm
==============================================================================
--- branches/weskaggs/plug-ins/script-fu/scripts/spinning-globe.scm	(original)
+++ branches/weskaggs/plug-ins/script-fu/scripts/spinning-globe.scm	Wed Jan 16 19:44:49 2008
@@ -36,7 +36,7 @@
         (n 0)
         (ang (* (/ 360 inFrames)
                 (if (= inFromLeft TRUE) 1 -1) ))
-        (theFrame)
+        (theFrame 0)
         )
 
   (gimp-layer-add-alpha theLayer)

Modified: branches/weskaggs/plug-ins/script-fu/scripts/swirltile.scm
==============================================================================
--- branches/weskaggs/plug-ins/script-fu/scripts/swirltile.scm	(original)
+++ branches/weskaggs/plug-ins/script-fu/scripts/swirltile.scm	Wed Jan 16 19:44:49 2008
@@ -54,7 +54,7 @@
   "Adrian Likins"
   "1997"
   ""
-  SF-ADJUSTMENT _"Depth"           '(10 0 64 1 1 0 0)
+  SF-ADJUSTMENT _"Depth"           '(10 1 64 1 1 0 0)
   SF-ADJUSTMENT _"Azimuth"          '(135 0 360 1 10 0 0)
   SF-ADJUSTMENT _"Elevation"        '(45 0 90 1 10 0 0)
   SF-ADJUSTMENT _"Blur radius"      '(3 0 128 1 10 0 0)

Modified: branches/weskaggs/plug-ins/script-fu/scripts/test-sphere.scm
==============================================================================
--- branches/weskaggs/plug-ins/script-fu/scripts/test-sphere.scm	(original)
+++ branches/weskaggs/plug-ins/script-fu/scripts/test-sphere.scm	Wed Jan 16 19:44:49 2008
@@ -194,8 +194,8 @@
                                                       font))
         (x-position (- cx (/ (car text-extents) 2)))
         (y-position (- cy (/ (cadr text-extents) 2)))
-        (shadow-w)
-        (shadow-x)
+        (shadow-w 0)
+        (shadow-x 0)
         )
 
     (gimp-context-push)

Modified: branches/weskaggs/plug-ins/script-fu/scripts/text-circle.scm
==============================================================================
--- branches/weskaggs/plug-ins/script-fu/scripts/text-circle.scm	(original)
+++ branches/weskaggs/plug-ins/script-fu/scripts/text-circle.scm	Wed Jan 16 19:44:49 2008
@@ -49,9 +49,9 @@
         (ndx-start 0)
         (ndx-step 1)
         (ccw 0)
-        (fill-angle-rad)
-        (rot-op)
-        (radian-step)
+        (fill-angle-rad 0)
+        (rot-op 0)
+        (radian-step 0)
         )
 
     (gimp-image-undo-disable img)

Modified: branches/weskaggs/plug-ins/script-fu/scripts/unsharp-mask.scm
==============================================================================
--- branches/weskaggs/plug-ins/script-fu/scripts/unsharp-mask.scm	(original)
+++ branches/weskaggs/plug-ins/script-fu/scripts/unsharp-mask.scm	Wed Jan 16 19:44:49 2008
@@ -12,12 +12,12 @@
                                              drawable-width drawable-height
                                              RGB-IMAGE "Original"
                                              100 NORMAL-MODE)))
-        (original-layer-for-darker)
-        (original-layer-for-lighter)
-        (blured-layer-for-darker)
-        (blured-layer-for-lighter)
-        (darker-layer)
-        (lighter-layer)
+        (original-layer-for-darker 0)
+        (original-layer-for-lighter 0)
+        (blured-layer-for-darker 0)
+        (blured-layer-for-lighter 0)
+        (darker-layer 0)
+        (lighter-layer 0)
         )
 
     (gimp-selection-all img)

Modified: branches/weskaggs/plug-ins/script-fu/scripts/xach-effect.scm
==============================================================================
--- branches/weskaggs/plug-ins/script-fu/scripts/xach-effect.scm	(original)
+++ branches/weskaggs/plug-ins/script-fu/scripts/xach-effect.scm	Wed Jan 16 19:44:49 2008
@@ -43,12 +43,12 @@
         (image-width (car (gimp-image-width image)))
         (hl-opacity (list hl-opacity-comp hl-opacity-comp hl-opacity-comp))
         (image-height (car (gimp-image-height image)))
-        (active-selection)
-        (from-selection)
-        (theLayer)
-        (hl-layer)
-        (shadow-layer)
-        (mask)
+        (active-selection 0)
+        (from-selection 0)
+        (theLayer 0)
+        (hl-layer 0)
+        (shadow-layer 0)
+        (mask 0)
         )
 
     (gimp-context-push)



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