gimp r24761 - in branches/weskaggs: . app/base app/dialogs app/display app/gegl app/tools app/widgets libgimpconfig libgimpwidgets menus modules plug-ins/common plug-ins/gimpressionist plug-ins/pygimp po themes/Default/images themes/Default/images/tools
- From: weskaggs svn gnome org
- To: svn-commits-list gnome org
- Subject: gimp r24761 - in branches/weskaggs: . app/base app/dialogs app/display app/gegl app/tools app/widgets libgimpconfig libgimpwidgets menus modules plug-ins/common plug-ins/gimpressionist plug-ins/pygimp po themes/Default/images themes/Default/images/tools
- Date: Thu, 31 Jan 2008 16:37:52 +0000 (GMT)
Author: weskaggs
Date: Thu Jan 31 16:37:51 2008
New Revision: 24761
URL: http://svn.gnome.org/viewvc/gimp?rev=24761&view=rev
Log:
Bill Skaggs <weskaggs primate ucdavis edu>
Merged 24710:24758 from trunk.
Added:
branches/weskaggs/app/gegl/gimpbrightnesscontrastconfig.c
- copied unchanged from r24758, /trunk/app/gegl/gimpbrightnesscontrastconfig.c
branches/weskaggs/app/gegl/gimpbrightnesscontrastconfig.h
- copied unchanged from r24758, /trunk/app/gegl/gimpbrightnesscontrastconfig.h
branches/weskaggs/app/gegl/gimpoperationpointfilter.c
- copied unchanged from r24758, /trunk/app/gegl/gimpoperationpointfilter.c
branches/weskaggs/app/gegl/gimpoperationpointfilter.h
- copied unchanged from r24758, /trunk/app/gegl/gimpoperationpointfilter.h
branches/weskaggs/app/gegl/gimpposterizeconfig.c
- copied unchanged from r24758, /trunk/app/gegl/gimpposterizeconfig.c
branches/weskaggs/app/gegl/gimpposterizeconfig.h
- copied unchanged from r24758, /trunk/app/gegl/gimpposterizeconfig.h
branches/weskaggs/app/tools/gimppolygonselecttool.c
- copied unchanged from r24758, /trunk/app/tools/gimppolygonselecttool.c
branches/weskaggs/app/tools/gimppolygonselecttool.h
- copied unchanged from r24758, /trunk/app/tools/gimppolygonselecttool.h
branches/weskaggs/themes/Default/images/tools/stock-tool-polygon-select-16.png
- copied unchanged from r24758, /trunk/themes/Default/images/tools/stock-tool-polygon-select-16.png
branches/weskaggs/themes/Default/images/tools/stock-tool-polygon-select-22.png
- copied unchanged from r24758, /trunk/themes/Default/images/tools/stock-tool-polygon-select-22.png
Modified:
branches/weskaggs/ChangeLog
branches/weskaggs/app/base/tile-manager.c
branches/weskaggs/app/dialogs/keyboard-shortcuts-dialog.c
branches/weskaggs/app/display/gimpdisplayshell-autoscroll.c
branches/weskaggs/app/display/gimpdisplayshell-callbacks.c
branches/weskaggs/app/display/gimpdisplayshell.c
branches/weskaggs/app/display/gimpdisplayshell.h
branches/weskaggs/app/gegl/Makefile.am
branches/weskaggs/app/gegl/gegl-types.h
branches/weskaggs/app/gegl/gimpcolorbalanceconfig.c
branches/weskaggs/app/gegl/gimpcolorbalanceconfig.h
branches/weskaggs/app/gegl/gimpcolorizeconfig.c
branches/weskaggs/app/gegl/gimpcolorizeconfig.h
branches/weskaggs/app/gegl/gimpcurvesconfig.c
branches/weskaggs/app/gegl/gimpcurvesconfig.h
branches/weskaggs/app/gegl/gimphuesaturationconfig.c
branches/weskaggs/app/gegl/gimphuesaturationconfig.h
branches/weskaggs/app/gegl/gimplevelsconfig.c
branches/weskaggs/app/gegl/gimplevelsconfig.h
branches/weskaggs/app/gegl/gimpoperationcolorbalance.c
branches/weskaggs/app/gegl/gimpoperationcolorbalance.h
branches/weskaggs/app/gegl/gimpoperationcolorize.c
branches/weskaggs/app/gegl/gimpoperationcolorize.h
branches/weskaggs/app/gegl/gimpoperationcurves.c
branches/weskaggs/app/gegl/gimpoperationcurves.h
branches/weskaggs/app/gegl/gimpoperationdesaturate.c
branches/weskaggs/app/gegl/gimpoperationhuesaturation.c
branches/weskaggs/app/gegl/gimpoperationhuesaturation.h
branches/weskaggs/app/gegl/gimpoperationlevels.c
branches/weskaggs/app/gegl/gimpoperationlevels.h
branches/weskaggs/app/gegl/gimpoperationposterize.c
branches/weskaggs/app/gegl/gimpoperationposterize.h
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/gegl/gimpthresholdconfig.c
branches/weskaggs/app/gegl/gimpthresholdconfig.h
branches/weskaggs/app/tools/Makefile.am
branches/weskaggs/app/tools/gimp-tools.c
branches/weskaggs/app/tools/gimpbrightnesscontrasttool.c
branches/weskaggs/app/tools/gimpbrightnesscontrasttool.h
branches/weskaggs/app/tools/gimpcolorbalancetool.c
branches/weskaggs/app/tools/gimpcolorizetool.c
branches/weskaggs/app/tools/gimpcurvestool.c
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/gimpposterizetool.c
branches/weskaggs/app/tools/gimpposterizetool.h
branches/weskaggs/app/tools/gimpthresholdtool.c
branches/weskaggs/app/widgets/gimphelp-ids.h
branches/weskaggs/app/widgets/gimphistogramview.c
branches/weskaggs/libgimpconfig/gimpconfig-serialize.c
branches/weskaggs/libgimpwidgets/gimpstock.c
branches/weskaggs/libgimpwidgets/gimpstock.h
branches/weskaggs/menus/image-menu.xml.in
branches/weskaggs/modules/controller_dx_dinput.c
branches/weskaggs/plug-ins/common/cubism.c
branches/weskaggs/plug-ins/common/lcms.c
branches/weskaggs/plug-ins/common/wmf.c
branches/weskaggs/plug-ins/gimpressionist/brush.c
branches/weskaggs/plug-ins/gimpressionist/brush.h
branches/weskaggs/plug-ins/gimpressionist/color.c
branches/weskaggs/plug-ins/gimpressionist/color.h
branches/weskaggs/plug-ins/gimpressionist/general.c
branches/weskaggs/plug-ins/gimpressionist/general.h
branches/weskaggs/plug-ins/gimpressionist/gimp.c
branches/weskaggs/plug-ins/gimpressionist/gimpressionist.c
branches/weskaggs/plug-ins/gimpressionist/gimpressionist.h
branches/weskaggs/plug-ins/gimpressionist/globals.c
branches/weskaggs/plug-ins/gimpressionist/infile.h
branches/weskaggs/plug-ins/gimpressionist/orientation.c
branches/weskaggs/plug-ins/gimpressionist/orientation.h
branches/weskaggs/plug-ins/gimpressionist/orientmap.c
branches/weskaggs/plug-ins/gimpressionist/orientmap.h
branches/weskaggs/plug-ins/gimpressionist/paper.c
branches/weskaggs/plug-ins/gimpressionist/paper.h
branches/weskaggs/plug-ins/gimpressionist/placement.c
branches/weskaggs/plug-ins/gimpressionist/placement.h
branches/weskaggs/plug-ins/gimpressionist/plasma.c
branches/weskaggs/plug-ins/gimpressionist/ppmtool.c
branches/weskaggs/plug-ins/gimpressionist/ppmtool.h
branches/weskaggs/plug-ins/gimpressionist/presets.c
branches/weskaggs/plug-ins/gimpressionist/presets.h
branches/weskaggs/plug-ins/gimpressionist/preview.c
branches/weskaggs/plug-ins/gimpressionist/preview.h
branches/weskaggs/plug-ins/gimpressionist/random.h
branches/weskaggs/plug-ins/gimpressionist/repaint.c
branches/weskaggs/plug-ins/gimpressionist/size.c
branches/weskaggs/plug-ins/gimpressionist/size.h
branches/weskaggs/plug-ins/gimpressionist/sizemap.c
branches/weskaggs/plug-ins/gimpressionist/utils.c
branches/weskaggs/plug-ins/pygimp/gimpmodule.c
branches/weskaggs/plug-ins/pygimp/pygimp-colors.c
branches/weskaggs/po/ChangeLog
branches/weskaggs/po/POTFILES.in
branches/weskaggs/themes/Default/images/Makefile.am
Modified: branches/weskaggs/app/base/tile-manager.c
==============================================================================
--- branches/weskaggs/app/base/tile-manager.c (original)
+++ branches/weskaggs/app/base/tile-manager.c Thu Jan 31 16:37:51 2008
@@ -400,7 +400,7 @@
if (G_UNLIKELY (num < 0))
{
- g_warning ("%s: tile coordinates out of range.", G_GNUC_FUNCTION);
+ g_warning ("%s: tile coordinates out of range.", G_STRLOC);
return;
}
@@ -427,13 +427,13 @@
if (G_UNLIKELY ((tile_num < 0) || (tile_num >= ntiles)))
{
- g_warning ("%s: tile out of range", G_GNUC_FUNCTION);
+ g_warning ("%s: tile out of range", G_STRLOC);
return;
}
if (G_UNLIKELY (! tm->tiles))
{
- g_warning ("%s: empty tile level - initializing", G_GNUC_FUNCTION);
+ g_warning ("%s: empty tile level - initializing", G_STRLOC);
tm->tiles = g_new (Tile *, ntiles);
tiles = tm->tiles;
@@ -475,14 +475,14 @@
#endif
if (G_UNLIKELY (! srctile->valid))
- g_warning("%s: srctile not validated yet! please report", G_GNUC_FUNCTION);
+ g_warning("%s: srctile not validated yet! please report", G_STRLOC);
if (G_UNLIKELY ((*tile_ptr)->ewidth != srctile->ewidth ||
(*tile_ptr)->eheight != srctile->eheight ||
(*tile_ptr)->bpp != srctile->bpp))
{
g_warning ("%s: nonconformant map (%p -> %p)",
- G_GNUC_FUNCTION, srctile, *tile_ptr);
+ G_STRLOC, srctile, *tile_ptr);
}
tile_detach (*tile_ptr, tm, tile_num);
@@ -645,7 +645,7 @@
if (G_UNLIKELY (tl == NULL))
{
- g_warning ("%s: tile not attached to manager", G_GNUC_FUNCTION);
+ g_warning ("%s: tile not attached to manager", G_STRLOC);
return;
}
@@ -689,7 +689,7 @@
if (G_UNLIKELY (tl == NULL))
{
- g_warning ("%s: tile not attached to manager", G_GNUC_FUNCTION);
+ g_warning ("%s: tile not attached to manager", G_STRLOC);
return;
}
Modified: branches/weskaggs/app/dialogs/keyboard-shortcuts-dialog.c
==============================================================================
--- branches/weskaggs/app/dialogs/keyboard-shortcuts-dialog.c (original)
+++ branches/weskaggs/app/dialogs/keyboard-shortcuts-dialog.c Thu Jan 31 16:37:51 2008
@@ -67,6 +67,8 @@
gtk_widget_show (vbox);
scrolled_window = gtk_scrolled_window_new (NULL, NULL);
+ gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window),
+ GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS);
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_window),
GTK_SHADOW_IN);
gtk_box_pack_start (GTK_BOX (vbox), scrolled_window, TRUE, TRUE, 0);
Modified: branches/weskaggs/app/display/gimpdisplayshell-autoscroll.c
==============================================================================
--- branches/weskaggs/app/display/gimpdisplayshell-autoscroll.c (original)
+++ branches/weskaggs/app/display/gimpdisplayshell-autoscroll.c Thu Jan 31 16:37:51 2008
@@ -154,7 +154,6 @@
gimp_display_shell_snap_coords (shell,
&image_coords,
- &image_coords,
x, y, width, height);
}
Modified: branches/weskaggs/app/display/gimpdisplayshell-callbacks.c
==============================================================================
--- branches/weskaggs/app/display/gimpdisplayshell-callbacks.c (original)
+++ branches/weskaggs/app/display/gimpdisplayshell-callbacks.c Thu Jan 31 16:37:51 2008
@@ -664,7 +664,6 @@
if (gimp_display_shell_snap_coords (shell,
&image_coords,
- &image_coords,
x, y, width, height))
{
update_sw_cursor = TRUE;
@@ -1088,7 +1087,6 @@
if (gimp_display_shell_snap_coords (shell,
&image_coords,
- &image_coords,
x, y, width, height))
{
update_sw_cursor = TRUE;
@@ -1148,7 +1146,6 @@
gimp_display_shell_snap_coords (shell,
&image_coords,
- &image_coords,
x, y, width, height);
}
}
@@ -1243,7 +1240,6 @@
gimp_display_shell_snap_coords (shell,
&image_coords,
- &image_coords,
x, y, width, height);
}
Modified: branches/weskaggs/app/display/gimpdisplayshell.c
==============================================================================
--- branches/weskaggs/app/display/gimpdisplayshell.c (original)
+++ branches/weskaggs/app/display/gimpdisplayshell.c Thu Jan 31 16:37:51 2008
@@ -1227,32 +1227,31 @@
gboolean
gimp_display_shell_snap_coords (GimpDisplayShell *shell,
GimpCoords *coords,
- GimpCoords *snapped_coords,
gint snap_offset_x,
gint snap_offset_y,
gint snap_width,
gint snap_height)
{
- gboolean snap_to_guides = FALSE;
- gboolean snap_to_grid = FALSE;
- gboolean snap_to_canvas = FALSE;
- gboolean snap_to_vectors = FALSE;
- gboolean snapped = FALSE;
+ GimpImage *image;
+ gboolean snap_to_guides = FALSE;
+ gboolean snap_to_grid = FALSE;
+ gboolean snap_to_canvas = FALSE;
+ gboolean snap_to_vectors = FALSE;
+ gboolean snapped = FALSE;
g_return_val_if_fail (GIMP_IS_DISPLAY_SHELL (shell), FALSE);
g_return_val_if_fail (coords != NULL, FALSE);
- g_return_val_if_fail (snapped_coords != NULL, FALSE);
- *snapped_coords = *coords;
+ image = shell->display->image;
if (gimp_display_shell_get_snap_to_guides (shell) &&
- gimp_image_get_guides (shell->display->image))
+ gimp_image_get_guides (image))
{
snap_to_guides = TRUE;
}
if (gimp_display_shell_get_snap_to_grid (shell) &&
- gimp_image_get_grid (shell->display->image))
+ gimp_image_get_grid (image))
{
snap_to_grid = TRUE;
}
@@ -1260,18 +1259,17 @@
snap_to_canvas = gimp_display_shell_get_snap_to_canvas (shell);
if (gimp_display_shell_get_snap_to_vectors (shell) &&
- gimp_image_get_active_vectors (shell->display->image))
+ gimp_image_get_active_vectors (image))
{
snap_to_vectors = TRUE;
}
if (snap_to_guides || snap_to_grid || snap_to_canvas || snap_to_vectors)
{
- gdouble tx, ty;
gint snap_distance;
+ gdouble tx, ty;
- snap_distance =
- GIMP_DISPLAY_CONFIG (shell->display->image->gimp->config)->snap_distance;
+ snap_distance = GIMP_DISPLAY_CONFIG (image->gimp->config)->snap_distance;
if (snap_width > 0 && snap_height > 0)
{
@@ -1308,8 +1306,8 @@
if (snapped)
{
- snapped_coords->x = tx - snap_offset_x;
- snapped_coords->y = ty - snap_offset_y;
+ coords->x = tx - snap_offset_x;
+ coords->y = ty - snap_offset_y;
}
}
Modified: branches/weskaggs/app/display/gimpdisplayshell.h
==============================================================================
--- branches/weskaggs/app/display/gimpdisplayshell.h (original)
+++ branches/weskaggs/app/display/gimpdisplayshell.h Thu Jan 31 16:37:51 2008
@@ -221,7 +221,6 @@
gboolean gimp_display_shell_snap_coords (GimpDisplayShell *shell,
GimpCoords *coords,
- GimpCoords *snapped_coords,
gint snap_offset_x,
gint snap_offset_y,
gint snap_width,
Modified: branches/weskaggs/app/gegl/Makefile.am
==============================================================================
--- branches/weskaggs/app/gegl/Makefile.am (original)
+++ branches/weskaggs/app/gegl/Makefile.am Thu Jan 31 16:37:51 2008
@@ -8,6 +8,8 @@
gimp-gegl-utils.c \
gimp-gegl-utils.h \
\
+ gimpbrightnesscontrastconfig.c \
+ gimpbrightnesscontrastconfig.h \
gimpcolorbalanceconfig.c \
gimpcolorbalanceconfig.h \
gimpcolorizeconfig.c \
@@ -18,6 +20,8 @@
gimphuesaturationconfig.h \
gimplevelsconfig.c \
gimplevelsconfig.h \
+ gimpposterizeconfig.c \
+ gimpposterizeconfig.h \
gimpthresholdconfig.c \
gimpthresholdconfig.h \
\
@@ -33,6 +37,8 @@
gimpoperationhuesaturation.h \
gimpoperationlevels.c \
gimpoperationlevels.h \
+ gimpoperationpointfilter.c \
+ gimpoperationpointfilter.h \
gimpoperationposterize.c \
gimpoperationposterize.h \
gimpoperationthreshold.c \
Modified: branches/weskaggs/app/gegl/gegl-types.h
==============================================================================
--- branches/weskaggs/app/gegl/gegl-types.h (original)
+++ branches/weskaggs/app/gegl/gegl-types.h Thu Jan 31 16:37:51 2008
@@ -28,26 +28,29 @@
/* operations */
-typedef struct _GimpOperationColorBalance GimpOperationColorBalance;
-typedef struct _GimpOperationColorize GimpOperationColorize;
-typedef struct _GimpOperationCurves GimpOperationCurves;
-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;
+typedef struct _GimpOperationColorBalance GimpOperationColorBalance;
+typedef struct _GimpOperationColorize GimpOperationColorize;
+typedef struct _GimpOperationCurves GimpOperationCurves;
+typedef struct _GimpOperationDesaturate GimpOperationDesaturate;
+typedef struct _GimpOperationHueSaturation GimpOperationHueSaturation;
+typedef struct _GimpOperationLevels GimpOperationLevels;
+typedef struct _GimpOperationPointFilter GimpOperationPointFilter;
+typedef struct _GimpOperationPosterize GimpOperationPosterize;
+typedef struct _GimpOperationThreshold GimpOperationThreshold;
+typedef struct _GimpOperationTileSink GimpOperationTileSink;
+typedef struct _GimpOperationTileSource GimpOperationTileSource;
/* operation config objects */
-typedef struct _GimpColorBalanceConfig GimpColorBalanceConfig;
-typedef struct _GimpColorizeConfig GimpColorizeConfig;
-typedef struct _GimpCurvesConfig GimpCurvesConfig;
-typedef struct _GimpHueSaturationConfig GimpHueSaturationConfig;
-typedef struct _GimpLevelsConfig GimpLevelsConfig;
-typedef struct _GimpThresholdConfig GimpThresholdConfig;
+typedef struct _GimpBrightnessContrastConfig GimpBrightnessContrastConfig;
+typedef struct _GimpColorBalanceConfig GimpColorBalanceConfig;
+typedef struct _GimpColorizeConfig GimpColorizeConfig;
+typedef struct _GimpCurvesConfig GimpCurvesConfig;
+typedef struct _GimpHueSaturationConfig GimpHueSaturationConfig;
+typedef struct _GimpLevelsConfig GimpLevelsConfig;
+typedef struct _GimpPosterizeConfig GimpPosterizeConfig;
+typedef struct _GimpThresholdConfig GimpThresholdConfig;
#endif /* __GEGL_TYPES_H__ */
Modified: branches/weskaggs/app/gegl/gimpcolorbalanceconfig.c
==============================================================================
--- branches/weskaggs/app/gegl/gimpcolorbalanceconfig.c (original)
+++ branches/weskaggs/app/gegl/gimpcolorbalanceconfig.c Thu Jan 31 16:37:51 2008
@@ -25,6 +25,7 @@
#include "libgimpcolor/gimpcolor.h"
#include "libgimpmath/gimpmath.h"
+#include "libgimpconfig/gimpconfig.h"
#include "gegl-types.h"
@@ -45,6 +46,8 @@
};
+static void gimp_color_balance_config_iface_init (GimpConfigInterface *iface);
+
static void gimp_color_balance_config_get_property (GObject *object,
guint property_id,
GValue *value,
@@ -54,15 +57,19 @@
const GValue *value,
GParamSpec *pspec);
+static void gimp_color_balance_config_reset (GimpConfig *config);
+
-G_DEFINE_TYPE (GimpColorBalanceConfig, gimp_color_balance_config,
- G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_CODE (GimpColorBalanceConfig, gimp_color_balance_config,
+ G_TYPE_OBJECT,
+ G_IMPLEMENT_INTERFACE (GIMP_TYPE_CONFIG,
+ gimp_color_balance_config_iface_init))
#define parent_class gimp_color_balance_config_parent_class
static void
-gimp_color_balance_config_class_init (GimpColorBalanceConfigClass * klass)
+gimp_color_balance_config_class_init (GimpColorBalanceConfigClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
@@ -98,7 +105,7 @@
g_param_spec_double ("yellow-blue",
"Yellow-Blue",
"Yellow-Blue",
- -1.0, 1.0, 1.0,
+ -1.0, 1.0, 0.0,
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT));
@@ -112,9 +119,15 @@
}
static void
+gimp_color_balance_config_iface_init (GimpConfigInterface *iface)
+{
+ iface->reset = gimp_color_balance_config_reset;
+}
+
+static void
gimp_color_balance_config_init (GimpColorBalanceConfig *self)
{
- gimp_color_balance_config_reset (self);
+ gimp_config_reset (GIMP_CONFIG (self));
}
static void
@@ -165,6 +178,9 @@
{
case PROP_RANGE:
self->range = g_value_get_enum (value);
+ g_object_notify (object, "cyan-red");
+ g_object_notify (object, "magenta-green");
+ g_object_notify (object, "yellow-blue");
break;
case PROP_CYAN_RED:
@@ -189,35 +205,41 @@
}
}
-
-/* public functions */
-
-void
-gimp_color_balance_config_reset (GimpColorBalanceConfig *config)
+static void
+gimp_color_balance_config_reset (GimpConfig *config)
{
- GimpTransferMode range;
+ GimpColorBalanceConfig *cb_config = GIMP_COLOR_BALANCE_CONFIG (config);
+ GimpTransferMode range;
- g_return_if_fail (GIMP_IS_COLOR_BALANCE_CONFIG (config));
-
- config->range = GIMP_MIDTONES;
+ g_object_freeze_notify (G_OBJECT (config));
for (range = GIMP_SHADOWS; range <= GIMP_HIGHLIGHTS; range++)
{
- gimp_color_balance_config_reset_range (config, range);
+ cb_config->range = range;
+ gimp_color_balance_config_reset_range (cb_config);
}
- config->preserve_luminosity = TRUE;
+ gimp_config_reset_property (G_OBJECT (config), "range");
+ gimp_config_reset_property (G_OBJECT (config), "preserve-luminosity");
+
+ g_object_thaw_notify (G_OBJECT (config));
}
+
+/* public functions */
+
void
-gimp_color_balance_config_reset_range (GimpColorBalanceConfig *config,
- GimpTransferMode range)
+gimp_color_balance_config_reset_range (GimpColorBalanceConfig *config)
{
g_return_if_fail (GIMP_IS_COLOR_BALANCE_CONFIG (config));
- config->cyan_red[range] = 0.0;
- config->magenta_green[range] = 0.0;
- config->yellow_blue[range] = 0.0;
+ g_object_freeze_notify (G_OBJECT (config));
+
+ gimp_config_reset_property (G_OBJECT (config), "cyan-red");
+ gimp_config_reset_property (G_OBJECT (config), "magenta-green");
+ gimp_config_reset_property (G_OBJECT (config), "yellow-blue");
+
+ g_object_thaw_notify (G_OBJECT (config));
}
Modified: branches/weskaggs/app/gegl/gimpcolorbalanceconfig.h
==============================================================================
--- branches/weskaggs/app/gegl/gimpcolorbalanceconfig.h (original)
+++ branches/weskaggs/app/gegl/gimpcolorbalanceconfig.h Thu Jan 31 16:37:51 2008
@@ -54,9 +54,7 @@
GType gimp_color_balance_config_get_type (void) G_GNUC_CONST;
-void gimp_color_balance_config_reset (GimpColorBalanceConfig *config);
-void gimp_color_balance_config_reset_range (GimpColorBalanceConfig *config,
- GimpTransferMode range);
+void gimp_color_balance_config_reset_range (GimpColorBalanceConfig *config);
/* temp cruft */
void gimp_color_balance_config_to_cruft (GimpColorBalanceConfig *config,
Modified: branches/weskaggs/app/gegl/gimpcolorizeconfig.c
==============================================================================
--- branches/weskaggs/app/gegl/gimpcolorizeconfig.c (original)
+++ branches/weskaggs/app/gegl/gimpcolorizeconfig.c Thu Jan 31 16:37:51 2008
@@ -23,6 +23,8 @@
#include <gegl.h>
+#include "libgimpconfig/gimpconfig.h"
+
#include "gegl-types.h"
/* temp cruft */
@@ -50,13 +52,15 @@
GParamSpec *pspec);
-G_DEFINE_TYPE (GimpColorizeConfig, gimp_colorize_config, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_CODE (GimpColorizeConfig, gimp_colorize_config,
+ G_TYPE_OBJECT,
+ G_IMPLEMENT_INTERFACE (GIMP_TYPE_CONFIG, NULL))
#define parent_class gimp_colorize_config_parent_class
static void
-gimp_colorize_config_class_init (GimpColorizeConfigClass * klass)
+gimp_colorize_config_class_init (GimpColorizeConfigClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
@@ -150,19 +154,6 @@
}
-/* public functions */
-
-void
-gimp_colorize_config_reset (GimpColorizeConfig *config)
-{
- g_return_if_fail (GIMP_IS_COLORIZE_CONFIG (config));
-
- config->hue = 0.5;
- config->saturation = 0.5;
- config->lightness = 0.0;
-}
-
-
/* temp cruft */
void
Modified: branches/weskaggs/app/gegl/gimpcolorizeconfig.h
==============================================================================
--- branches/weskaggs/app/gegl/gimpcolorizeconfig.h (original)
+++ branches/weskaggs/app/gegl/gimpcolorizeconfig.h Thu Jan 31 16:37:51 2008
@@ -50,8 +50,6 @@
GType gimp_colorize_config_get_type (void) G_GNUC_CONST;
-void gimp_colorize_config_reset (GimpColorizeConfig *config);
-
/* temp cruft */
void gimp_colorize_config_to_cruft (GimpColorizeConfig *config,
Colorize *cruft);
Modified: branches/weskaggs/app/gegl/gimpcurvesconfig.c
==============================================================================
--- branches/weskaggs/app/gegl/gimpcurvesconfig.c (original)
+++ branches/weskaggs/app/gegl/gimpcurvesconfig.c Thu Jan 31 16:37:51 2008
@@ -24,6 +24,7 @@
#include <string.h>
#include <gegl.h>
+#include <glib/gstdio.h>
#include "libgimpcolor/gimpcolor.h"
#include "libgimpmath/gimpmath.h"
@@ -49,24 +50,34 @@
};
-static void gimp_curves_config_finalize (GObject *object);
-static void gimp_curves_config_get_property (GObject *object,
- guint property_id,
- GValue *value,
- GParamSpec *pspec);
-static void gimp_curves_config_set_property (GObject *object,
- guint property_id,
- const GValue *value,
- GParamSpec *pspec);
+static void gimp_curves_config_iface_init (GimpConfigInterface *iface);
-
-G_DEFINE_TYPE (GimpCurvesConfig, gimp_curves_config, G_TYPE_OBJECT)
+static void gimp_curves_config_finalize (GObject *object);
+static void gimp_curves_config_get_property (GObject *object,
+ guint property_id,
+ GValue *value,
+ GParamSpec *pspec);
+static void gimp_curves_config_set_property (GObject *object,
+ guint property_id,
+ const GValue *value,
+ GParamSpec *pspec);
+
+static void gimp_curves_config_reset (GimpConfig *config);
+
+static void gimp_curves_config_curve_dirty (GimpCurve *curve,
+ GimpCurvesConfig *config);
+
+
+G_DEFINE_TYPE_WITH_CODE (GimpCurvesConfig, gimp_curves_config,
+ G_TYPE_OBJECT,
+ G_IMPLEMENT_INTERFACE (GIMP_TYPE_CONFIG,
+ gimp_curves_config_iface_init))
#define parent_class gimp_curves_config_parent_class
static void
-gimp_curves_config_class_init (GimpCurvesConfigClass * klass)
+gimp_curves_config_class_init (GimpCurvesConfigClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
@@ -92,6 +103,12 @@
}
static void
+gimp_curves_config_iface_init (GimpConfigInterface *iface)
+{
+ iface->reset = gimp_curves_config_reset;
+}
+
+static void
gimp_curves_config_init (GimpCurvesConfig *self)
{
GimpHistogramChannel channel;
@@ -101,9 +118,13 @@
channel++)
{
self->curve[channel] = GIMP_CURVE (gimp_curve_new ("curves config"));
+
+ g_signal_connect_object (self->curve[channel], "dirty",
+ G_CALLBACK (gimp_curves_config_curve_dirty),
+ self, 0);
}
- gimp_curves_config_reset (self);
+ gimp_config_reset (GIMP_CONFIG (self));
}
static void
@@ -162,6 +183,7 @@
{
case PROP_CHANNEL:
self->channel = g_value_get_enum (value);
+ g_object_notify (object, "curve");
break;
case PROP_CURVE:
@@ -176,33 +198,43 @@
}
}
-
-/* public functions */
-
-void
-gimp_curves_config_reset (GimpCurvesConfig *config)
+static void
+gimp_curves_config_reset (GimpConfig *config)
{
- GimpHistogramChannel channel;
-
- g_return_if_fail (GIMP_IS_CURVES_CONFIG (config));
+ GimpCurvesConfig *c_config = GIMP_CURVES_CONFIG (config);
+ GimpHistogramChannel channel;
- config->channel = GIMP_HISTOGRAM_VALUE;
+ g_object_freeze_notify (G_OBJECT (config));
for (channel = GIMP_HISTOGRAM_VALUE;
channel <= GIMP_HISTOGRAM_ALPHA;
channel++)
{
- gimp_curve_reset (config->curve[channel], FALSE);
+ c_config->channel = channel;
+ gimp_curves_config_reset_channel (c_config);
}
+
+ gimp_config_reset_property (G_OBJECT (config), "channel");
+
+ g_object_thaw_notify (G_OBJECT (config));
}
+static void
+gimp_curves_config_curve_dirty (GimpCurve *curve,
+ GimpCurvesConfig *config)
+{
+ g_object_notify (G_OBJECT (config), "curve");
+}
+
+
+/* public functions */
+
void
-gimp_curves_config_reset_channel (GimpCurvesConfig *config,
- GimpHistogramChannel channel)
+gimp_curves_config_reset_channel (GimpCurvesConfig *config)
{
g_return_if_fail (GIMP_IS_CURVES_CONFIG (config));
- gimp_curve_reset (config->curve[channel], FALSE);
+ gimp_curve_reset (config->curve[config->channel], TRUE);
}
gboolean
@@ -245,6 +277,8 @@
}
}
+ g_object_freeze_notify (G_OBJECT (config));
+
for (i = 0; i < 5; i++)
{
GimpCurve *curve = config->curve[i];
@@ -259,6 +293,8 @@
gimp_data_thaw (GIMP_DATA (curve));
}
+ g_object_thaw_notify (G_OBJECT (config));
+
return TRUE;
}
Modified: branches/weskaggs/app/gegl/gimpcurvesconfig.h
==============================================================================
--- branches/weskaggs/app/gegl/gimpcurvesconfig.h (original)
+++ branches/weskaggs/app/gegl/gimpcurvesconfig.h Thu Jan 31 16:37:51 2008
@@ -55,21 +55,19 @@
GType gimp_curves_config_get_type (void) G_GNUC_CONST;
-void gimp_curves_config_reset (GimpCurvesConfig *config);
-void gimp_curves_config_reset_channel (GimpCurvesConfig *config,
- GimpHistogramChannel channel);
-
-gboolean gimp_curves_config_load_cruft (GimpCurvesConfig *config,
- gpointer fp,
- GError **error);
-gboolean gimp_curves_config_save_cruft (GimpCurvesConfig *config,
- gpointer fp);
+void gimp_curves_config_reset_channel (GimpCurvesConfig *config);
+
+gboolean gimp_curves_config_load_cruft (GimpCurvesConfig *config,
+ gpointer fp,
+ GError **error);
+gboolean gimp_curves_config_save_cruft (GimpCurvesConfig *config,
+ gpointer fp);
/* temp cruft */
-void gimp_curves_config_to_cruft (GimpCurvesConfig *config,
- Curves *cruft,
- gboolean is_color);
+void gimp_curves_config_to_cruft (GimpCurvesConfig *config,
+ Curves *cruft,
+ gboolean is_color);
#endif /* __GIMP_CURVES_CONFIG_H__ */
Modified: branches/weskaggs/app/gegl/gimphuesaturationconfig.c
==============================================================================
--- branches/weskaggs/app/gegl/gimphuesaturationconfig.c (original)
+++ branches/weskaggs/app/gegl/gimphuesaturationconfig.c Thu Jan 31 16:37:51 2008
@@ -23,6 +23,8 @@
#include <gegl.h>
+#include "libgimpconfig/gimpconfig.h"
+
#include "gegl-types.h"
/* temp cruft */
@@ -42,6 +44,8 @@
};
+static void gimp_hue_saturation_config_iface_init (GimpConfigInterface *iface);
+
static void gimp_hue_saturation_config_get_property (GObject *object,
guint property_id,
GValue *value,
@@ -51,15 +55,19 @@
const GValue *value,
GParamSpec *pspec);
+static void gimp_hue_saturation_config_reset (GimpConfig *config);
+
-G_DEFINE_TYPE (GimpHueSaturationConfig, gimp_hue_saturation_config,
- G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_CODE (GimpHueSaturationConfig, gimp_hue_saturation_config,
+ G_TYPE_OBJECT,
+ G_IMPLEMENT_INTERFACE (GIMP_TYPE_CONFIG,
+ gimp_hue_saturation_config_iface_init))
#define parent_class gimp_hue_saturation_config_parent_class
static void
-gimp_hue_saturation_config_class_init (GimpHueSaturationConfigClass * klass)
+gimp_hue_saturation_config_class_init (GimpHueSaturationConfigClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
@@ -109,9 +117,15 @@
}
static void
+gimp_hue_saturation_config_iface_init (GimpConfigInterface *iface)
+{
+ iface->reset = gimp_hue_saturation_config_reset;
+}
+
+static void
gimp_hue_saturation_config_init (GimpHueSaturationConfig *self)
{
- gimp_hue_saturation_config_reset (self);
+ gimp_config_reset (GIMP_CONFIG (self));
}
static void
@@ -162,6 +176,9 @@
{
case PROP_RANGE:
self->range = g_value_get_enum (value);
+ g_object_notify (object, "hue");
+ g_object_notify (object, "saturation");
+ g_object_notify (object, "lightness");
break;
case PROP_HUE:
@@ -186,35 +203,41 @@
}
}
-
-/* public functions */
-
-void
-gimp_hue_saturation_config_reset (GimpHueSaturationConfig *config)
+static void
+gimp_hue_saturation_config_reset (GimpConfig *config)
{
- GimpHueRange range;
+ GimpHueSaturationConfig *hs_config = GIMP_HUE_SATURATION_CONFIG (config);
+ GimpHueRange range;
- g_return_if_fail (GIMP_IS_HUE_SATURATION_CONFIG (config));
-
- config->range = GIMP_ALL_HUES;
+ g_object_freeze_notify (G_OBJECT (config));
for (range = GIMP_ALL_HUES; range <= GIMP_MAGENTA_HUES; range++)
{
- gimp_hue_saturation_config_reset_range (config, range);
+ hs_config->range = range;
+ gimp_hue_saturation_config_reset_range (hs_config);
}
- config->overlap = 0.0;
+ gimp_config_reset_property (G_OBJECT (config), "range");
+ gimp_config_reset_property (G_OBJECT (config), "overlap");
+
+ g_object_thaw_notify (G_OBJECT (config));
}
+
+/* public functions */
+
void
-gimp_hue_saturation_config_reset_range (GimpHueSaturationConfig *config,
- GimpHueRange range)
+gimp_hue_saturation_config_reset_range (GimpHueSaturationConfig *config)
{
g_return_if_fail (GIMP_IS_HUE_SATURATION_CONFIG (config));
- config->hue[range] = 0.0;
- config->saturation[range] = 0.0;
- config->lightness[range] = 0.0;
+ g_object_freeze_notify (G_OBJECT (config));
+
+ gimp_config_reset_property (G_OBJECT (config), "hue");
+ gimp_config_reset_property (G_OBJECT (config), "saturation");
+ gimp_config_reset_property (G_OBJECT (config), "lightness");
+
+ g_object_thaw_notify (G_OBJECT (config));
}
Modified: branches/weskaggs/app/gegl/gimphuesaturationconfig.h
==============================================================================
--- branches/weskaggs/app/gegl/gimphuesaturationconfig.h (original)
+++ branches/weskaggs/app/gegl/gimphuesaturationconfig.h Thu Jan 31 16:37:51 2008
@@ -54,9 +54,7 @@
GType gimp_hue_saturation_config_get_type (void) G_GNUC_CONST;
-void gimp_hue_saturation_config_reset (GimpHueSaturationConfig *config);
-void gimp_hue_saturation_config_reset_range (GimpHueSaturationConfig *config,
- GimpHueRange range);
+void gimp_hue_saturation_config_reset_range (GimpHueSaturationConfig *config);
/* temp cruft */
void gimp_hue_saturation_config_to_cruft (GimpHueSaturationConfig *config,
Modified: branches/weskaggs/app/gegl/gimplevelsconfig.c
==============================================================================
--- branches/weskaggs/app/gegl/gimplevelsconfig.c (original)
+++ branches/weskaggs/app/gegl/gimplevelsconfig.c Thu Jan 31 16:37:51 2008
@@ -55,6 +55,8 @@
};
+static void gimp_levels_config_iface_init (GimpConfigInterface *iface);
+
static void gimp_levels_config_get_property (GObject *object,
guint property_id,
GValue *value,
@@ -64,14 +66,19 @@
const GValue *value,
GParamSpec *pspec);
+static void gimp_levels_config_reset (GimpConfig *config);
+
-G_DEFINE_TYPE (GimpLevelsConfig, gimp_levels_config, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_CODE (GimpLevelsConfig, gimp_levels_config,
+ G_TYPE_OBJECT,
+ G_IMPLEMENT_INTERFACE (GIMP_TYPE_CONFIG,
+ gimp_levels_config_iface_init))
#define parent_class gimp_levels_config_parent_class
static void
-gimp_levels_config_class_init (GimpLevelsConfigClass * klass)
+gimp_levels_config_class_init (GimpLevelsConfigClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
@@ -129,9 +136,15 @@
}
static void
+gimp_levels_config_iface_init (GimpConfigInterface *iface)
+{
+ iface->reset = gimp_levels_config_reset;
+}
+
+static void
gimp_levels_config_init (GimpLevelsConfig *self)
{
- gimp_levels_config_reset (self);
+ gimp_config_reset (GIMP_CONFIG (self));
}
static void
@@ -186,6 +199,11 @@
{
case PROP_CHANNEL:
self->channel = g_value_get_enum (value);
+ g_object_notify (object, "gamma");
+ g_object_notify (object, "low-input");
+ g_object_notify (object, "high-input");
+ g_object_notify (object, "low-output");
+ g_object_notify (object, "high-output");
break;
case PROP_GAMMA:
@@ -214,64 +232,80 @@
}
}
-
-/* public functions */
-
-void
-gimp_levels_config_reset (GimpLevelsConfig *config)
+static void
+gimp_levels_config_reset (GimpConfig *config)
{
- GimpHistogramChannel channel;
-
- g_return_if_fail (GIMP_IS_LEVELS_CONFIG (config));
+ GimpLevelsConfig *l_config = GIMP_LEVELS_CONFIG (config);
+ GimpHistogramChannel channel;
- config->channel = GIMP_HISTOGRAM_VALUE;
+ g_object_freeze_notify (G_OBJECT (config));
for (channel = GIMP_HISTOGRAM_VALUE;
channel <= GIMP_HISTOGRAM_ALPHA;
channel++)
{
- gimp_levels_config_reset_channel (config, channel);
+ l_config->channel = channel;
+ gimp_levels_config_reset_channel (l_config);
}
+
+ gimp_config_reset_property (G_OBJECT (config), "channel");
+
+ g_object_thaw_notify (G_OBJECT (config));
}
+
+/* public functions */
+
void
-gimp_levels_config_reset_channel (GimpLevelsConfig *config,
- GimpHistogramChannel channel)
+gimp_levels_config_reset_channel (GimpLevelsConfig *config)
{
g_return_if_fail (GIMP_IS_LEVELS_CONFIG (config));
- config->gamma[channel] = 1.0;
- config->low_input[channel] = 0.0;
- config->high_input[channel] = 1.0;
- config->low_output[channel] = 0.0;
- config->high_output[channel] = 1.0;
+ g_object_freeze_notify (G_OBJECT (config));
+
+ gimp_config_reset_property (G_OBJECT (config), "gamma");
+ gimp_config_reset_property (G_OBJECT (config), "low-input");
+ gimp_config_reset_property (G_OBJECT (config), "high-input");
+ gimp_config_reset_property (G_OBJECT (config), "low-output");
+ gimp_config_reset_property (G_OBJECT (config), "high-output");
+
+ g_object_thaw_notify (G_OBJECT (config));
}
void
-gimp_levels_config_stretch (GimpLevelsConfig *config,
- GimpHistogram *histogram,
- gboolean is_color)
+gimp_levels_config_stretch (GimpLevelsConfig *config,
+ GimpHistogram *histogram,
+ gboolean is_color)
{
g_return_if_fail (GIMP_IS_LEVELS_CONFIG (config));
g_return_if_fail (histogram != NULL);
+ g_object_freeze_notify (G_OBJECT (config));
+
if (is_color)
{
GimpHistogramChannel channel;
- /* Set the overall value to defaults */
- gimp_levels_config_reset_channel (config, GIMP_HISTOGRAM_VALUE);
+ /* Set the overall value to defaults */
+ channel = config->channel;
+ config->channel = GIMP_HISTOGRAM_VALUE;
+ gimp_levels_config_reset_channel (config);
+ config->channel = channel;
for (channel = GIMP_HISTOGRAM_RED;
channel <= GIMP_HISTOGRAM_BLUE;
channel++)
- gimp_levels_config_stretch_channel (config, histogram, channel);
+ {
+ gimp_levels_config_stretch_channel (config, histogram, channel);
+ }
}
else
{
gimp_levels_config_stretch_channel (config, histogram,
GIMP_HISTOGRAM_VALUE);
}
+
+ g_object_thaw_notify (G_OBJECT (config));
}
void
@@ -285,6 +319,8 @@
g_return_if_fail (GIMP_IS_LEVELS_CONFIG (config));
g_return_if_fail (histogram != NULL);
+ g_object_freeze_notify (G_OBJECT (config));
+
config->gamma[channel] = 1.0;
config->low_output[channel] = 0.0;
config->high_output[channel] = 1.0;
@@ -340,6 +376,14 @@
}
}
}
+
+ g_object_notify (G_OBJECT (config), "gamma");
+ g_object_notify (G_OBJECT (config), "low-input");
+ g_object_notify (G_OBJECT (config), "high-input");
+ g_object_notify (G_OBJECT (config), "low-output");
+ g_object_notify (G_OBJECT (config), "high-output");
+
+ g_object_thaw_notify (G_OBJECT (config));
}
static gdouble
@@ -379,13 +423,22 @@
{
g_return_if_fail (GIMP_IS_LEVELS_CONFIG (config));
+ g_object_freeze_notify (G_OBJECT (config));
+
if (black)
- config->low_input[channel] = gimp_levels_config_input_from_color (channel,
- black);
+ {
+ config->low_input[channel] = gimp_levels_config_input_from_color (channel,
+ black);
+ g_object_notify (G_OBJECT (config), "low-input");
+ }
+
if (white)
- config->high_input[channel] = gimp_levels_config_input_from_color (channel,
- white);
+ {
+ config->high_input[channel] = gimp_levels_config_input_from_color (channel,
+ white);
+ g_object_notify (G_OBJECT (config), "high-input");
+ }
if (gray)
{
@@ -417,7 +470,10 @@
/* Map selected color to corresponding lightness */
config->gamma[channel] = log (inten) / log (out_light);
+ g_object_notify (G_OBJECT (config), "gamma");
}
+
+ g_object_thaw_notify (G_OBJECT (config));
}
gboolean
@@ -468,6 +524,8 @@
goto error;
}
+ g_object_freeze_notify (G_OBJECT (config));
+
for (i = 0; i < 5; i++)
{
config->low_input[i] = low_input[i] / 255.0;
@@ -477,6 +535,14 @@
config->gamma[i] = gamma[i];
}
+ g_object_notify (G_OBJECT (config), "gamma");
+ g_object_notify (G_OBJECT (config), "low-input");
+ g_object_notify (G_OBJECT (config), "high-input");
+ g_object_notify (G_OBJECT (config), "low-output");
+ g_object_notify (G_OBJECT (config), "high-output");
+
+ g_object_thaw_notify (G_OBJECT (config));
+
return TRUE;
error:
Modified: branches/weskaggs/app/gegl/gimplevelsconfig.h
==============================================================================
--- branches/weskaggs/app/gegl/gimplevelsconfig.h (original)
+++ branches/weskaggs/app/gegl/gimplevelsconfig.h Thu Jan 31 16:37:51 2008
@@ -56,9 +56,7 @@
GType gimp_levels_config_get_type (void) G_GNUC_CONST;
-void gimp_levels_config_reset (GimpLevelsConfig *config);
-void gimp_levels_config_reset_channel (GimpLevelsConfig *config,
- GimpHistogramChannel channel);
+void gimp_levels_config_reset_channel (GimpLevelsConfig *config);
void gimp_levels_config_stretch (GimpLevelsConfig *config,
GimpHistogram *histogram,
Modified: branches/weskaggs/app/gegl/gimpoperationcolorbalance.c
==============================================================================
--- branches/weskaggs/app/gegl/gimpoperationcolorbalance.c (original)
+++ branches/weskaggs/app/gegl/gimpoperationcolorbalance.c Thu Jan 31 16:37:51 2008
@@ -32,51 +32,34 @@
#include "gimpoperationcolorbalance.h"
-enum
-{
- PROP_0,
- PROP_CONFIG
-};
-
-
-static void gimp_operation_color_balance_finalize (GObject *object);
-static void gimp_operation_color_balance_get_property (GObject *object,
- guint property_id,
- GValue *value,
- GParamSpec *pspec);
-static void gimp_operation_color_balance_set_property (GObject *object,
- guint property_id,
- const GValue *value,
- GParamSpec *pspec);
-
-static gboolean gimp_operation_color_balance_process (GeglOperation *operation,
- void *in_buf,
- void *out_buf,
- glong samples);
+static gboolean gimp_operation_color_balance_process (GeglOperation *operation,
+ void *in_buf,
+ void *out_buf,
+ glong samples);
G_DEFINE_TYPE (GimpOperationColorBalance, gimp_operation_color_balance,
- GEGL_TYPE_OPERATION_POINT_FILTER)
+ GIMP_TYPE_OPERATION_POINT_FILTER)
#define parent_class gimp_operation_color_balance_parent_class
static void
-gimp_operation_color_balance_class_init (GimpOperationColorBalanceClass * klass)
+gimp_operation_color_balance_class_init (GimpOperationColorBalanceClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GeglOperationClass *operation_class = GEGL_OPERATION_CLASS (klass);
GeglOperationPointFilterClass *point_class = GEGL_OPERATION_POINT_FILTER_CLASS (klass);
- object_class->finalize = gimp_operation_color_balance_finalize;
- object_class->set_property = gimp_operation_color_balance_set_property;
- object_class->get_property = gimp_operation_color_balance_get_property;
+ object_class->set_property = gimp_operation_point_filter_set_property;
+ object_class->get_property = gimp_operation_point_filter_get_property;
- point_class->process = gimp_operation_color_balance_process;
+ operation_class->name = "gimp-color-balance";
- gegl_operation_class_set_name (operation_class, "gimp-color-balance");
+ point_class->process = gimp_operation_color_balance_process;
- g_object_class_install_property (object_class, PROP_CONFIG,
+ g_object_class_install_property (object_class,
+ GIMP_OPERATION_POINT_FILTER_PROP_CONFIG,
g_param_spec_object ("config",
"Config",
"The config object",
@@ -90,62 +73,6 @@
{
}
-static void
-gimp_operation_color_balance_finalize (GObject *object)
-{
- GimpOperationColorBalance *self = GIMP_OPERATION_COLOR_BALANCE (object);
-
- if (self->config)
- {
- g_object_unref (self->config);
- self->config = NULL;
- }
-
- G_OBJECT_CLASS (parent_class)->finalize (object);
-}
-
-static void
-gimp_operation_color_balance_get_property (GObject *object,
- guint property_id,
- GValue *value,
- GParamSpec *pspec)
-{
- GimpOperationColorBalance *self = GIMP_OPERATION_COLOR_BALANCE (object);
-
- switch (property_id)
- {
- case PROP_CONFIG:
- g_value_set_object (value, self->config);
- break;
-
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
- break;
- }
-}
-
-static void
-gimp_operation_color_balance_set_property (GObject *object,
- guint property_id,
- const GValue *value,
- GParamSpec *pspec)
-{
- GimpOperationColorBalance *self = GIMP_OPERATION_COLOR_BALANCE (object);
-
- switch (property_id)
- {
- case PROP_CONFIG:
- if (self->config)
- g_object_unref (self->config);
- self->config = g_value_dup_object (value);
- break;
-
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
- break;
- }
-}
-
static inline gfloat
gimp_operation_color_balance_map (gfloat value,
gdouble shadows,
@@ -188,16 +115,15 @@
void *out_buf,
glong samples)
{
- GimpOperationColorBalance *self = GIMP_OPERATION_COLOR_BALANCE (operation);
- GimpColorBalanceConfig *config = self->config;
- gfloat *src = in_buf;
- gfloat *dest = out_buf;
- glong sample;
+ GimpOperationPointFilter *point = GIMP_OPERATION_POINT_FILTER (operation);
+ GimpColorBalanceConfig *config = GIMP_COLOR_BALANCE_CONFIG (point->config);
+ gfloat *src = in_buf;
+ gfloat *dest = out_buf;
if (! config)
return FALSE;
- for (sample = 0; sample < samples; sample++)
+ while (samples--)
{
gfloat r = src[RED_PIX];
gfloat g = src[GREEN_PIX];
Modified: branches/weskaggs/app/gegl/gimpoperationcolorbalance.h
==============================================================================
--- branches/weskaggs/app/gegl/gimpoperationcolorbalance.h (original)
+++ branches/weskaggs/app/gegl/gimpoperationcolorbalance.h Thu Jan 31 16:37:51 2008
@@ -23,8 +23,7 @@
#define __GIMP_OPERATION_COLOR_BALANCE_H__
-#include <gegl-plugin.h>
-#include <operation/gegl-operation-point-filter.h>
+#include "gimpoperationpointfilter.h"
#define GIMP_TYPE_OPERATION_COLOR_BALANCE (gimp_operation_color_balance_get_type ())
@@ -39,14 +38,12 @@
struct _GimpOperationColorBalance
{
- GeglOperationPointFilter parent_instance;
-
- GimpColorBalanceConfig *config;
+ GimpOperationPointFilter parent_instance;
};
struct _GimpOperationColorBalanceClass
{
- GeglOperationPointFilterClass parent_class;
+ GimpOperationPointFilterClass parent_class;
};
Modified: branches/weskaggs/app/gegl/gimpoperationcolorize.c
==============================================================================
--- branches/weskaggs/app/gegl/gimpoperationcolorize.c (original)
+++ branches/weskaggs/app/gegl/gimpoperationcolorize.c Thu Jan 31 16:37:51 2008
@@ -31,51 +31,34 @@
#include "gimpoperationcolorize.h"
-enum
-{
- PROP_0,
- PROP_CONFIG
-};
-
-
-static void gimp_operation_colorize_finalize (GObject *object);
-static void gimp_operation_colorize_get_property (GObject *object,
- guint property_id,
- GValue *value,
- GParamSpec *pspec);
-static void gimp_operation_colorize_set_property (GObject *object,
- guint property_id,
- const GValue *value,
- GParamSpec *pspec);
-
-static gboolean gimp_operation_colorize_process (GeglOperation *operation,
- void *in_buf,
- void *out_buf,
- glong samples);
+static gboolean gimp_operation_colorize_process (GeglOperation *operation,
+ void *in_buf,
+ void *out_buf,
+ glong samples);
G_DEFINE_TYPE (GimpOperationColorize, gimp_operation_colorize,
- GEGL_TYPE_OPERATION_POINT_FILTER)
+ GIMP_TYPE_OPERATION_POINT_FILTER)
#define parent_class gimp_operation_colorize_parent_class
static void
-gimp_operation_colorize_class_init (GimpOperationColorizeClass * klass)
+gimp_operation_colorize_class_init (GimpOperationColorizeClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GeglOperationClass *operation_class = GEGL_OPERATION_CLASS (klass);
GeglOperationPointFilterClass *point_class = GEGL_OPERATION_POINT_FILTER_CLASS (klass);
- object_class->finalize = gimp_operation_colorize_finalize;
- object_class->set_property = gimp_operation_colorize_set_property;
- object_class->get_property = gimp_operation_colorize_get_property;
+ object_class->set_property = gimp_operation_point_filter_set_property;
+ object_class->get_property = gimp_operation_point_filter_get_property;
- point_class->process = gimp_operation_colorize_process;
+ operation_class->name = "gimp-colorize";
- gegl_operation_class_set_name (operation_class, "gimp-colorize");
+ point_class->process = gimp_operation_colorize_process;
- g_object_class_install_property (object_class, PROP_CONFIG,
+ g_object_class_install_property (object_class,
+ GIMP_OPERATION_POINT_FILTER_PROP_CONFIG,
g_param_spec_object ("config",
"Config",
"The config object",
@@ -89,79 +72,25 @@
{
}
-static void
-gimp_operation_colorize_finalize (GObject *object)
-{
- GimpOperationColorize *self = GIMP_OPERATION_COLORIZE (object);
-
- if (self->config)
- {
- g_object_unref (self->config);
- self->config = NULL;
- }
-
- G_OBJECT_CLASS (parent_class)->finalize (object);
-}
-
-static void
-gimp_operation_colorize_get_property (GObject *object,
- guint property_id,
- GValue *value,
- GParamSpec *pspec)
-{
- GimpOperationColorize *self = GIMP_OPERATION_COLORIZE (object);
-
- switch (property_id)
- {
- case PROP_CONFIG:
- g_value_set_object (value, self->config);
- break;
-
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
- break;
- }
-}
-
-static void
-gimp_operation_colorize_set_property (GObject *object,
- guint property_id,
- const GValue *value,
- GParamSpec *pspec)
-{
- GimpOperationColorize *self = GIMP_OPERATION_COLORIZE (object);
-
- switch (property_id)
- {
- case PROP_CONFIG:
- if (self->config)
- g_object_unref (self->config);
- self->config = g_value_dup_object (value);
- break;
-
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
- break;
- }
-}
-
static gboolean
gimp_operation_colorize_process (GeglOperation *operation,
void *in_buf,
void *out_buf,
glong samples)
{
- GimpOperationColorize *self = GIMP_OPERATION_COLORIZE (operation);
- GimpColorizeConfig *config = self->config;
- gfloat *src = in_buf;
- gfloat *dest = out_buf;
- GimpHSL hsl;
- glong sample;
+ GimpOperationPointFilter *point = GIMP_OPERATION_POINT_FILTER (operation);
+ GimpColorizeConfig *config = GIMP_COLORIZE_CONFIG (point->config);
+ gfloat *src = in_buf;
+ gfloat *dest = out_buf;
+ GimpHSL hsl;
+
+ if (! config)
+ return FALSE;
hsl.h = config->hue;
hsl.s = config->saturation;
- for (sample = 0; sample < samples; sample++)
+ while (samples--)
{
GimpRGB rgb;
gfloat lum = GIMP_RGB_LUMINANCE (src[RED_PIX],
Modified: branches/weskaggs/app/gegl/gimpoperationcolorize.h
==============================================================================
--- branches/weskaggs/app/gegl/gimpoperationcolorize.h (original)
+++ branches/weskaggs/app/gegl/gimpoperationcolorize.h Thu Jan 31 16:37:51 2008
@@ -22,8 +22,8 @@
#ifndef __GIMP_OPERATION_COLORIZE_H__
#define __GIMP_OPERATION_COLORIZE_H__
-#include <gegl-plugin.h>
-#include <operation/gegl-operation-point-filter.h>
+
+#include "gimpoperationpointfilter.h"
#define GIMP_TYPE_OPERATION_COLORIZE (gimp_operation_colorize_get_type ())
@@ -38,14 +38,12 @@
struct _GimpOperationColorize
{
- GeglOperationPointFilter parent_instance;
-
- GimpColorizeConfig *config;
+ GimpOperationPointFilter parent_instance;
};
struct _GimpOperationColorizeClass
{
- GeglOperationPointFilterClass parent_class;
+ GimpOperationPointFilterClass parent_class;
};
Modified: branches/weskaggs/app/gegl/gimpoperationcurves.c
==============================================================================
--- branches/weskaggs/app/gegl/gimpoperationcurves.c (original)
+++ branches/weskaggs/app/gegl/gimpoperationcurves.c Thu Jan 31 16:37:51 2008
@@ -32,51 +32,34 @@
#include "gimpoperationcurves.h"
-enum
-{
- PROP_0,
- PROP_CONFIG
-};
-
-
-static void gimp_operation_curves_finalize (GObject *object);
-static void gimp_operation_curves_get_property (GObject *object,
- guint property_id,
- GValue *value,
- GParamSpec *pspec);
-static void gimp_operation_curves_set_property (GObject *object,
- guint property_id,
- const GValue *value,
- GParamSpec *pspec);
-
-static gboolean gimp_operation_curves_process (GeglOperation *operation,
- void *in_buf,
- void *out_buf,
- glong samples);
+static gboolean gimp_operation_curves_process (GeglOperation *operation,
+ void *in_buf,
+ void *out_buf,
+ glong samples);
G_DEFINE_TYPE (GimpOperationCurves, gimp_operation_curves,
- GEGL_TYPE_OPERATION_POINT_FILTER)
+ GIMP_TYPE_OPERATION_POINT_FILTER)
#define parent_class gimp_operation_curves_parent_class
static void
-gimp_operation_curves_class_init (GimpOperationCurvesClass * klass)
+gimp_operation_curves_class_init (GimpOperationCurvesClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GeglOperationClass *operation_class = GEGL_OPERATION_CLASS (klass);
GeglOperationPointFilterClass *point_class = GEGL_OPERATION_POINT_FILTER_CLASS (klass);
- object_class->finalize = gimp_operation_curves_finalize;
- object_class->set_property = gimp_operation_curves_set_property;
- object_class->get_property = gimp_operation_curves_get_property;
+ object_class->set_property = gimp_operation_point_filter_set_property;
+ object_class->get_property = gimp_operation_point_filter_get_property;
- point_class->process = gimp_operation_curves_process;
+ operation_class->name = "gimp-curves";
- gegl_operation_class_set_name (operation_class, "gimp-curves");
+ point_class->process = gimp_operation_curves_process;
- g_object_class_install_property (object_class, PROP_CONFIG,
+ g_object_class_install_property (object_class,
+ GIMP_OPERATION_POINT_FILTER_PROP_CONFIG,
g_param_spec_object ("config",
"Config",
"The config object",
@@ -90,62 +73,6 @@
{
}
-static void
-gimp_operation_curves_finalize (GObject *object)
-{
- GimpOperationCurves *self = GIMP_OPERATION_CURVES (object);
-
- if (self->config)
- {
- g_object_unref (self->config);
- self->config = NULL;
- }
-
- G_OBJECT_CLASS (parent_class)->finalize (object);
-}
-
-static void
-gimp_operation_curves_get_property (GObject *object,
- guint property_id,
- GValue *value,
- GParamSpec *pspec)
-{
- GimpOperationCurves *self = GIMP_OPERATION_CURVES (object);
-
- switch (property_id)
- {
- case PROP_CONFIG:
- g_value_set_object (value, self->config);
- break;
-
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
- break;
- }
-}
-
-static void
-gimp_operation_curves_set_property (GObject *object,
- guint property_id,
- const GValue *value,
- GParamSpec *pspec)
-{
- GimpOperationCurves *self = GIMP_OPERATION_CURVES (object);
-
- switch (property_id)
- {
- case PROP_CONFIG:
- if (self->config)
- g_object_unref (self->config);
- self->config = g_value_dup_object (value);
- break;
-
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
- break;
- }
-}
-
static inline gdouble
gimp_operation_curves_map (gdouble value,
GimpCurve *curve)
@@ -176,16 +103,15 @@
void *out_buf,
glong samples)
{
- GimpOperationCurves *self = GIMP_OPERATION_CURVES (operation);
- GimpCurvesConfig *config = self->config;
- gfloat *src = in_buf;
- gfloat *dest = out_buf;
- glong sample;
+ GimpOperationPointFilter *point = GIMP_OPERATION_POINT_FILTER (operation);
+ GimpCurvesConfig *config = GIMP_CURVES_CONFIG (point->config);
+ gfloat *src = in_buf;
+ gfloat *dest = out_buf;
if (! config)
return FALSE;
- for (sample = 0; sample < samples; sample++)
+ while (samples--)
{
gint channel;
Modified: branches/weskaggs/app/gegl/gimpoperationcurves.h
==============================================================================
--- branches/weskaggs/app/gegl/gimpoperationcurves.h (original)
+++ branches/weskaggs/app/gegl/gimpoperationcurves.h Thu Jan 31 16:37:51 2008
@@ -23,8 +23,7 @@
#define __GIMP_OPERATION_CURVES_H__
-#include <gegl-plugin.h>
-#include <operation/gegl-operation-point-filter.h>
+#include "gimpoperationpointfilter.h"
#define GIMP_TYPE_OPERATION_CURVES (gimp_operation_curves_get_type ())
@@ -39,14 +38,12 @@
struct _GimpOperationCurves
{
- GeglOperationPointFilter parent_instance;
-
- GimpCurvesConfig *config;
+ GimpOperationPointFilter parent_instance;
};
struct _GimpOperationCurvesClass
{
- GeglOperationPointFilterClass parent_class;
+ GimpOperationPointFilterClass parent_class;
};
Modified: branches/weskaggs/app/gegl/gimpoperationdesaturate.c
==============================================================================
--- branches/weskaggs/app/gegl/gimpoperationdesaturate.c (original)
+++ branches/weskaggs/app/gegl/gimpoperationdesaturate.c Thu Jan 31 16:37:51 2008
@@ -59,7 +59,7 @@
static void
-gimp_operation_desaturate_class_init (GimpOperationDesaturateClass * klass)
+gimp_operation_desaturate_class_init (GimpOperationDesaturateClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GeglOperationClass *operation_class = GEGL_OPERATION_CLASS (klass);
@@ -68,9 +68,9 @@
object_class->set_property = gimp_operation_desaturate_set_property;
object_class->get_property = gimp_operation_desaturate_get_property;
- point_class->process = gimp_operation_desaturate_process;
+ operation_class->name = "gimp-desaturate";
- gegl_operation_class_set_name (operation_class, "gimp-desaturate");
+ point_class->process = gimp_operation_desaturate_process;
g_object_class_install_property (object_class,
PROP_MODE,
@@ -137,9 +137,8 @@
GimpOperationDesaturate *self = GIMP_OPERATION_DESATURATE (operation);
gfloat *src = in_buf;
gfloat *dest = out_buf;
- glong sample;
- for (sample = 0; sample < samples; sample++)
+ while (samples--)
{
gfloat value = 0.0;
Modified: branches/weskaggs/app/gegl/gimpoperationhuesaturation.c
==============================================================================
--- branches/weskaggs/app/gegl/gimpoperationhuesaturation.c (original)
+++ branches/weskaggs/app/gegl/gimpoperationhuesaturation.c Thu Jan 31 16:37:51 2008
@@ -32,51 +32,34 @@
#include "gimpoperationhuesaturation.h"
-enum
-{
- PROP_0,
- PROP_CONFIG
-};
-
-
-static void gimp_operation_hue_saturation_finalize (GObject *object);
-static void gimp_operation_hue_saturation_get_property (GObject *object,
- guint property_id,
- GValue *value,
- GParamSpec *pspec);
-static void gimp_operation_hue_saturation_set_property (GObject *object,
- guint property_id,
- const GValue *value,
- GParamSpec *pspec);
-
-static gboolean gimp_operation_hue_saturation_process (GeglOperation *operation,
- void *in_buf,
- void *out_buf,
- glong samples);
+static gboolean gimp_operation_hue_saturation_process (GeglOperation *operation,
+ void *in_buf,
+ void *out_buf,
+ glong samples);
G_DEFINE_TYPE (GimpOperationHueSaturation, gimp_operation_hue_saturation,
- GEGL_TYPE_OPERATION_POINT_FILTER)
+ GIMP_TYPE_OPERATION_POINT_FILTER)
#define parent_class gimp_operation_hue_saturation_parent_class
static void
-gimp_operation_hue_saturation_class_init (GimpOperationHueSaturationClass * klass)
+gimp_operation_hue_saturation_class_init (GimpOperationHueSaturationClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GeglOperationClass *operation_class = GEGL_OPERATION_CLASS (klass);
GeglOperationPointFilterClass *point_class = GEGL_OPERATION_POINT_FILTER_CLASS (klass);
- object_class->finalize = gimp_operation_hue_saturation_finalize;
- object_class->set_property = gimp_operation_hue_saturation_set_property;
- object_class->get_property = gimp_operation_hue_saturation_get_property;
+ object_class->set_property = gimp_operation_point_filter_set_property;
+ object_class->get_property = gimp_operation_point_filter_get_property;
- point_class->process = gimp_operation_hue_saturation_process;
+ operation_class->name = "gimp-hue-saturation";
- gegl_operation_class_set_name (operation_class, "gimp-hue-saturation");
+ point_class->process = gimp_operation_hue_saturation_process;
- g_object_class_install_property (object_class, PROP_CONFIG,
+ g_object_class_install_property (object_class,
+ GIMP_OPERATION_POINT_FILTER_PROP_CONFIG,
g_param_spec_object ("config",
"Config",
"The config object",
@@ -90,62 +73,6 @@
{
}
-static void
-gimp_operation_hue_saturation_finalize (GObject *object)
-{
- GimpOperationHueSaturation *self = GIMP_OPERATION_HUE_SATURATION (object);
-
- if (self->config)
- {
- g_object_unref (self->config);
- self->config = NULL;
- }
-
- G_OBJECT_CLASS (parent_class)->finalize (object);
-}
-
-static void
-gimp_operation_hue_saturation_get_property (GObject *object,
- guint property_id,
- GValue *value,
- GParamSpec *pspec)
-{
- GimpOperationHueSaturation *self = GIMP_OPERATION_HUE_SATURATION (object);
-
- switch (property_id)
- {
- case PROP_CONFIG:
- g_value_set_object (value, self->config);
- break;
-
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
- break;
- }
-}
-
-static void
-gimp_operation_hue_saturation_set_property (GObject *object,
- guint property_id,
- const GValue *value,
- GParamSpec *pspec)
-{
- GimpOperationHueSaturation *self = GIMP_OPERATION_HUE_SATURATION (object);
-
- switch (property_id)
- {
- case PROP_CONFIG:
- if (self->config)
- g_object_unref (self->config);
- self->config = g_value_dup_object (value);
- break;
-
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
- break;
- }
-}
-
static inline gdouble
map_hue (GimpHueSaturationConfig *config,
GimpHueRange range,
@@ -200,14 +127,16 @@
void *out_buf,
glong samples)
{
- GimpOperationHueSaturation *self = GIMP_OPERATION_HUE_SATURATION (operation);
- GimpHueSaturationConfig *config = self->config;
- gfloat *src = in_buf;
- gfloat *dest = out_buf;
- gfloat overlap = config->overlap / 2.0;
- glong sample;
+ GimpOperationPointFilter *point = GIMP_OPERATION_POINT_FILTER (operation);
+ GimpHueSaturationConfig *config = GIMP_HUE_SATURATION_CONFIG (point->config);
+ gfloat *src = in_buf;
+ gfloat *dest = out_buf;
+ gfloat overlap = config->overlap / 2.0;
+
+ if (! config)
+ return FALSE;
- for (sample = 0; sample < samples; sample++)
+ while (samples--)
{
GimpRGB rgb;
GimpHSL hsl;
Modified: branches/weskaggs/app/gegl/gimpoperationhuesaturation.h
==============================================================================
--- branches/weskaggs/app/gegl/gimpoperationhuesaturation.h (original)
+++ branches/weskaggs/app/gegl/gimpoperationhuesaturation.h Thu Jan 31 16:37:51 2008
@@ -22,8 +22,8 @@
#ifndef __GIMP_OPERATION_HUE_SATURATION_H__
#define __GIMP_OPERATION_HUE_SATURATION_H__
-#include <gegl-plugin.h>
-#include <operation/gegl-operation-point-filter.h>
+
+#include "gimpoperationpointfilter.h"
#define GIMP_TYPE_OPERATION_HUE_SATURATION (gimp_operation_hue_saturation_get_type ())
@@ -38,14 +38,12 @@
struct _GimpOperationHueSaturation
{
- GeglOperationPointFilter parent_instance;
-
- GimpHueSaturationConfig *config;
+ GimpOperationPointFilter parent_instance;
};
struct _GimpOperationHueSaturationClass
{
- GeglOperationPointFilterClass parent_class;
+ GimpOperationPointFilterClass parent_class;
};
Modified: branches/weskaggs/app/gegl/gimpoperationlevels.c
==============================================================================
--- branches/weskaggs/app/gegl/gimpoperationlevels.c (original)
+++ branches/weskaggs/app/gegl/gimpoperationlevels.c Thu Jan 31 16:37:51 2008
@@ -32,51 +32,34 @@
#include "gimpoperationlevels.h"
-enum
-{
- PROP_0,
- PROP_CONFIG
-};
-
-
-static void gimp_operation_levels_finalize (GObject *object);
-static void gimp_operation_levels_get_property (GObject *object,
- guint property_id,
- GValue *value,
- GParamSpec *pspec);
-static void gimp_operation_levels_set_property (GObject *object,
- guint property_id,
- const GValue *value,
- GParamSpec *pspec);
-
-static gboolean gimp_operation_levels_process (GeglOperation *operation,
- void *in_buf,
- void *out_buf,
- glong samples);
+static gboolean gimp_operation_levels_process (GeglOperation *operation,
+ void *in_buf,
+ void *out_buf,
+ glong samples);
G_DEFINE_TYPE (GimpOperationLevels, gimp_operation_levels,
- GEGL_TYPE_OPERATION_POINT_FILTER)
+ GIMP_TYPE_OPERATION_POINT_FILTER)
#define parent_class gimp_operation_levels_parent_class
static void
-gimp_operation_levels_class_init (GimpOperationLevelsClass * klass)
+gimp_operation_levels_class_init (GimpOperationLevelsClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GeglOperationClass *operation_class = GEGL_OPERATION_CLASS (klass);
GeglOperationPointFilterClass *point_class = GEGL_OPERATION_POINT_FILTER_CLASS (klass);
- object_class->finalize = gimp_operation_levels_finalize;
- object_class->set_property = gimp_operation_levels_set_property;
- object_class->get_property = gimp_operation_levels_get_property;
+ object_class->set_property = gimp_operation_point_filter_set_property;
+ object_class->get_property = gimp_operation_point_filter_get_property;
- point_class->process = gimp_operation_levels_process;
+ operation_class->name = "gimp-levels";
- gegl_operation_class_set_name (operation_class, "gimp-levels");
+ point_class->process = gimp_operation_levels_process;
- g_object_class_install_property (object_class, PROP_CONFIG,
+ g_object_class_install_property (object_class,
+ GIMP_OPERATION_POINT_FILTER_PROP_CONFIG,
g_param_spec_object ("config",
"Config",
"The config object",
@@ -90,62 +73,6 @@
{
}
-static void
-gimp_operation_levels_finalize (GObject *object)
-{
- GimpOperationLevels *self = GIMP_OPERATION_LEVELS (object);
-
- if (self->config)
- {
- g_object_unref (self->config);
- self->config = NULL;
- }
-
- G_OBJECT_CLASS (parent_class)->finalize (object);
-}
-
-static void
-gimp_operation_levels_get_property (GObject *object,
- guint property_id,
- GValue *value,
- GParamSpec *pspec)
-{
- GimpOperationLevels *self = GIMP_OPERATION_LEVELS (object);
-
- switch (property_id)
- {
- case PROP_CONFIG:
- g_value_set_object (value, self->config);
- break;
-
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
- break;
- }
-}
-
-static void
-gimp_operation_levels_set_property (GObject *object,
- guint property_id,
- const GValue *value,
- GParamSpec *pspec)
-{
- GimpOperationLevels *self = GIMP_OPERATION_LEVELS (object);
-
- switch (property_id)
- {
- case PROP_CONFIG:
- if (self->config)
- g_object_unref (self->config);
- self->config = g_value_dup_object (value);
- break;
-
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
- break;
- }
-}
-
static inline gdouble
gimp_operation_levels_map (gdouble value,
gdouble gamma,
@@ -183,16 +110,15 @@
void *out_buf,
glong samples)
{
- GimpOperationLevels *self = GIMP_OPERATION_LEVELS (operation);
- GimpLevelsConfig *config = self->config;
- gfloat *src = in_buf;
- gfloat *dest = out_buf;
- glong sample;
+ GimpOperationPointFilter *point = GIMP_OPERATION_POINT_FILTER (operation);
+ GimpLevelsConfig *config = GIMP_LEVELS_CONFIG (point->config);
+ gfloat *src = in_buf;
+ gfloat *dest = out_buf;
if (! config)
return FALSE;
- for (sample = 0; sample < samples; sample++)
+ while (samples--)
{
gint channel;
@@ -252,4 +178,3 @@
return value;
}
-
Modified: branches/weskaggs/app/gegl/gimpoperationlevels.h
==============================================================================
--- branches/weskaggs/app/gegl/gimpoperationlevels.h (original)
+++ branches/weskaggs/app/gegl/gimpoperationlevels.h Thu Jan 31 16:37:51 2008
@@ -23,8 +23,7 @@
#define __GIMP_OPERATION_LEVELS_H__
-#include <gegl-plugin.h>
-#include <operation/gegl-operation-point-filter.h>
+#include "gimpoperationpointfilter.h"
#define GIMP_TYPE_OPERATION_LEVELS (gimp_operation_levels_get_type ())
@@ -39,14 +38,12 @@
struct _GimpOperationLevels
{
- GeglOperationPointFilter parent_instance;
-
- GimpLevelsConfig *config;
+ GimpOperationPointFilter parent_instance;
};
struct _GimpOperationLevelsClass
{
- GeglOperationPointFilterClass parent_class;
+ GimpOperationPointFilterClass parent_class;
};
Modified: branches/weskaggs/app/gegl/gimpoperationposterize.c
==============================================================================
--- branches/weskaggs/app/gegl/gimpoperationposterize.c (original)
+++ branches/weskaggs/app/gegl/gimpoperationposterize.c Thu Jan 31 16:37:51 2008
@@ -29,58 +29,43 @@
#include "gegl-types.h"
#include "gimpoperationposterize.h"
+#include "gimpposterizeconfig.h"
-enum
-{
- PROP_0,
- PROP_LEVELS
-};
-
-
-static void gimp_operation_posterize_get_property (GObject *object,
- guint property_id,
- GValue *value,
- GParamSpec *pspec);
-static void gimp_operation_posterize_set_property (GObject *object,
- guint property_id,
- const GValue *value,
- GParamSpec *pspec);
-
-static gboolean gimp_operation_posterize_process (GeglOperation *operation,
- void *in_buf,
- void *out_buf,
- glong samples);
+static gboolean gimp_operation_posterize_process (GeglOperation *operation,
+ void *in_buf,
+ void *out_buf,
+ glong samples);
G_DEFINE_TYPE (GimpOperationPosterize, gimp_operation_posterize,
- GEGL_TYPE_OPERATION_POINT_FILTER)
+ GIMP_TYPE_OPERATION_POINT_FILTER)
#define parent_class gimp_operation_posterize_parent_class
static void
-gimp_operation_posterize_class_init (GimpOperationPosterizeClass * klass)
+gimp_operation_posterize_class_init (GimpOperationPosterizeClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GeglOperationClass *operation_class = GEGL_OPERATION_CLASS (klass);
GeglOperationPointFilterClass *point_class = GEGL_OPERATION_POINT_FILTER_CLASS (klass);
- object_class->set_property = gimp_operation_posterize_set_property;
- object_class->get_property = gimp_operation_posterize_get_property;
+ object_class->set_property = gimp_operation_point_filter_set_property;
+ object_class->get_property = gimp_operation_point_filter_get_property;
- point_class->process = gimp_operation_posterize_process;
+ operation_class->name = "gimp-posterize";
- gegl_operation_class_set_name (operation_class, "gimp-posterize");
+ point_class->process = gimp_operation_posterize_process;
g_object_class_install_property (object_class,
- PROP_LEVELS,
- g_param_spec_int ("levels",
- "Levels",
- "Posterize levels",
- 2, 256, 10,
- G_PARAM_READWRITE |
- G_PARAM_CONSTRUCT));
+ GIMP_OPERATION_POINT_FILTER_PROP_CONFIG,
+ g_param_spec_object ("config",
+ "Config",
+ "The config object",
+ GIMP_TYPE_POSTERIZE_CONFIG,
+ G_PARAM_READWRITE |
+ G_PARAM_CONSTRUCT));
}
static void
@@ -88,59 +73,22 @@
{
}
-static void
-gimp_operation_posterize_get_property (GObject *object,
- guint property_id,
- GValue *value,
- GParamSpec *pspec)
-{
- GimpOperationPosterize *self = GIMP_OPERATION_POSTERIZE (object);
-
- switch (property_id)
- {
- case PROP_LEVELS:
- g_value_set_int (value, self->levels);
- break;
-
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
- break;
- }
-}
-
-static void
-gimp_operation_posterize_set_property (GObject *object,
- guint property_id,
- const GValue *value,
- GParamSpec *pspec)
-{
- GimpOperationPosterize *self = GIMP_OPERATION_POSTERIZE (object);
-
- switch (property_id)
- {
- case PROP_LEVELS:
- self->levels = g_value_get_int (value);
- break;
-
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
- break;
- }
-}
-
static gboolean
gimp_operation_posterize_process (GeglOperation *operation,
void *in_buf,
void *out_buf,
glong samples)
{
- GimpOperationPosterize *self = GIMP_OPERATION_POSTERIZE (operation);
- gfloat *src = in_buf;
- gfloat *dest = out_buf;
- gfloat levels = self->levels - 1.0;
- glong sample;
+ GimpOperationPointFilter *point = GIMP_OPERATION_POINT_FILTER (operation);
+ GimpPosterizeConfig *config = GIMP_POSTERIZE_CONFIG (point->config);
+ gfloat *src = in_buf;
+ gfloat *dest = out_buf;
+ gfloat levels = config->levels - 1.0;
+
+ if (! config)
+ return FALSE;
- for (sample = 0; sample < samples; sample++)
+ while (samples--)
{
dest[RED_PIX] = RINT (src[RED_PIX] * levels) / levels;
dest[GREEN_PIX] = RINT (src[GREEN_PIX] * levels) / levels;
Modified: branches/weskaggs/app/gegl/gimpoperationposterize.h
==============================================================================
--- branches/weskaggs/app/gegl/gimpoperationposterize.h (original)
+++ branches/weskaggs/app/gegl/gimpoperationposterize.h Thu Jan 31 16:37:51 2008
@@ -23,28 +23,27 @@
#define __GIMP_OPERATION_POSTERIZE_H__
-#include <gegl-plugin.h>
-#include <operation/gegl-operation-point-filter.h>
+#include "gimpoperationpointfilter.h"
-#define GIMP_TYPE_OPERATION_POSTERIZE (gimp_operation_posterize_get_type ())
-#define GIMP_OPERATION_POSTERIZE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_OPERATION_POSTERIZE, GimpOperationPosterize))
-#define GIMP_OPERATION_POSTERIZE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_OPERATION_POSTERIZE, GimpOperationPosterizeClass))
-#define GIMP_OPERATION_POSTERIZE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_OPERATION_POSTERIZE, GimpOperationPosterizeClass))
+#define GIMP_TYPE_OPERATION_POSTERIZE (gimp_operation_posterize_get_type ())
+#define GIMP_OPERATION_POSTERIZE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_OPERATION_POSTERIZE, GimpOperationPosterize))
+#define GIMP_OPERATION_POSTERIZE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_OPERATION_POSTERIZE, GimpOperationPosterizeClass))
+#define GIMP_IS_OPERATION_POSTERIZE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_OPERATION_POSTERIZE))
+#define GIMP_IS_OPERATION_POSTERIZE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_OPERATION_POSTERIZE))
+#define GIMP_OPERATION_POSTERIZE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_OPERATION_POSTERIZE, GimpOperationPosterizeClass))
typedef struct _GimpOperationPosterizeClass GimpOperationPosterizeClass;
struct _GimpOperationPosterize
{
- GeglOperationPointFilter parent_instance;
-
- gint levels;
+ GimpOperationPointFilter parent_instance;
};
struct _GimpOperationPosterizeClass
{
- GeglOperationPointFilterClass parent_class;
+ GimpOperationPointFilterClass parent_class;
};
Modified: branches/weskaggs/app/gegl/gimpoperationthreshold.c
==============================================================================
--- branches/weskaggs/app/gegl/gimpoperationthreshold.c (original)
+++ branches/weskaggs/app/gegl/gimpoperationthreshold.c Thu Jan 31 16:37:51 2008
@@ -31,51 +31,34 @@
#include "gimpthresholdconfig.h"
-enum
-{
- PROP_0,
- PROP_CONFIG
-};
-
-
-static void gimp_operation_threshold_finalize (GObject *object);
-static void gimp_operation_threshold_get_property (GObject *object,
- guint property_id,
- GValue *value,
- GParamSpec *pspec);
-static void gimp_operation_threshold_set_property (GObject *object,
- guint property_id,
- const GValue *value,
- GParamSpec *pspec);
-
-static gboolean gimp_operation_threshold_process (GeglOperation *operation,
- void *in_buf,
- void *out_buf,
- glong samples);
+static gboolean gimp_operation_threshold_process (GeglOperation *operation,
+ void *in_buf,
+ void *out_buf,
+ glong samples);
G_DEFINE_TYPE (GimpOperationThreshold, gimp_operation_threshold,
- GEGL_TYPE_OPERATION_POINT_FILTER)
+ GIMP_TYPE_OPERATION_POINT_FILTER)
#define parent_class gimp_operation_threshold_parent_class
static void
-gimp_operation_threshold_class_init (GimpOperationThresholdClass * klass)
+gimp_operation_threshold_class_init (GimpOperationThresholdClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GeglOperationClass *operation_class = GEGL_OPERATION_CLASS (klass);
GeglOperationPointFilterClass *point_class = GEGL_OPERATION_POINT_FILTER_CLASS (klass);
- object_class->finalize = gimp_operation_threshold_finalize;
- object_class->set_property = gimp_operation_threshold_set_property;
- object_class->get_property = gimp_operation_threshold_get_property;
+ object_class->set_property = gimp_operation_point_filter_set_property;
+ object_class->get_property = gimp_operation_point_filter_get_property;
- point_class->process = gimp_operation_threshold_process;
+ operation_class->name = "gimp-threshold";
- gegl_operation_class_set_name (operation_class, "gimp-threshold");
+ point_class->process = gimp_operation_threshold_process;
- g_object_class_install_property (object_class, PROP_CONFIG,
+ g_object_class_install_property (object_class,
+ GIMP_OPERATION_POINT_FILTER_PROP_CONFIG,
g_param_spec_object ("config",
"Config",
"The config object",
@@ -89,78 +72,21 @@
{
}
-static void
-gimp_operation_threshold_finalize (GObject *object)
-{
- GimpOperationThreshold *self = GIMP_OPERATION_THRESHOLD (object);
-
- if (self->config)
- {
- g_object_unref (self->config);
- self->config = NULL;
- }
-
- G_OBJECT_CLASS (parent_class)->finalize (object);
-}
-
-static void
-gimp_operation_threshold_get_property (GObject *object,
- guint property_id,
- GValue *value,
- GParamSpec *pspec)
-{
- GimpOperationThreshold *self = GIMP_OPERATION_THRESHOLD (object);
-
- switch (property_id)
- {
- case PROP_CONFIG:
- g_value_set_object (value, self->config);
- break;
-
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
- break;
- }
-}
-
-static void
-gimp_operation_threshold_set_property (GObject *object,
- guint property_id,
- const GValue *value,
- GParamSpec *pspec)
-{
- GimpOperationThreshold *self = GIMP_OPERATION_THRESHOLD (object);
-
- switch (property_id)
- {
- case PROP_CONFIG:
- if (self->config)
- g_object_unref (self->config);
- self->config = g_value_dup_object (value);
- break;
-
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
- break;
- }
-}
-
static gboolean
gimp_operation_threshold_process (GeglOperation *operation,
void *in_buf,
void *out_buf,
glong samples)
{
- GimpOperationThreshold *self = GIMP_OPERATION_THRESHOLD (operation);
- GimpThresholdConfig *config = self->config;
- gfloat *src = in_buf;
- gfloat *dest = out_buf;
- glong sample;
+ GimpOperationPointFilter *point = GIMP_OPERATION_POINT_FILTER (operation);
+ GimpThresholdConfig *config = GIMP_THRESHOLD_CONFIG (point->config);
+ gfloat *src = in_buf;
+ gfloat *dest = out_buf;
if (! config)
return FALSE;
- for (sample = 0; sample < samples; sample++)
+ while (samples--)
{
gfloat value;
Modified: branches/weskaggs/app/gegl/gimpoperationthreshold.h
==============================================================================
--- branches/weskaggs/app/gegl/gimpoperationthreshold.h (original)
+++ branches/weskaggs/app/gegl/gimpoperationthreshold.h Thu Jan 31 16:37:51 2008
@@ -23,8 +23,7 @@
#define __GIMP_OPERATION_THRESHOLD_H__
-#include <gegl-plugin.h>
-#include <operation/gegl-operation-point-filter.h>
+#include "gimpoperationpointfilter.h"
#define GIMP_TYPE_OPERATION_THRESHOLD (gimp_operation_threshold_get_type ())
@@ -39,14 +38,12 @@
struct _GimpOperationThreshold
{
- GeglOperationPointFilter parent_instance;
-
- GimpThresholdConfig *config;
+ GimpOperationPointFilter parent_instance;
};
struct _GimpOperationThresholdClass
{
- GeglOperationPointFilterClass parent_class;
+ GimpOperationPointFilterClass parent_class;
};
Modified: branches/weskaggs/app/gegl/gimpoperationtilesink.c
==============================================================================
--- branches/weskaggs/app/gegl/gimpoperationtilesink.c (original)
+++ branches/weskaggs/app/gegl/gimpoperationtilesink.c Thu Jan 31 16:37:51 2008
@@ -74,7 +74,7 @@
static void
-gimp_operation_tile_sink_class_init (GimpOperationTileSinkClass * klass)
+gimp_operation_tile_sink_class_init (GimpOperationTileSinkClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GeglOperationClass *operation_class = GEGL_OPERATION_CLASS (klass);
@@ -94,10 +94,11 @@
object_class->set_property = gimp_operation_tile_sink_set_property;
object_class->get_property = gimp_operation_tile_sink_get_property;
+ operation_class->name = "gimp-tilemanager-sink";
+
sink_class->process = gimp_operation_tile_sink_process;
sink_class->needs_full = FALSE;
- gegl_operation_class_set_name (operation_class, "gimp-tilemanager-sink");;
g_object_class_install_property (object_class, PROP_TILE_MANAGER,
g_param_spec_boxed ("tile-manager",
@@ -191,41 +192,38 @@
const GeglRectangle *result)
{
GimpOperationTileSink *self = GIMP_OPERATION_TILE_SINK (operation);
+ const Babl *format;
+ PixelRegion destPR;
+ guint bpp;
+ gpointer pr;
- if (self->tile_manager)
- {
- const Babl *format;
- PixelRegion destPR;
- guint bpp = tile_manager_bpp (self->tile_manager);
- gpointer pr;
-
- if (self->linear)
- format = gimp_bpp_to_babl_format_linear (bpp);
- else
- format = gimp_bpp_to_babl_format (bpp);
-
- pixel_region_init (&destPR, self->tile_manager,
- result->x, result->y,
- result->width, result->height,
- TRUE);
-
- for (pr = pixel_regions_register (1, &destPR);
- pr;
- pr = pixel_regions_process (pr))
- {
- GeglRectangle rect = { destPR.x, destPR.y, destPR.w, destPR.h };
-
- gegl_buffer_get (input,
- 1.0, &rect, format, destPR.data, destPR.rowstride);
- }
+ if (! self->tile_manager)
+ return FALSE;
- g_signal_emit (operation, tile_sink_signals[DATA_WRITTEN], 0,
- result);
- }
+ bpp = tile_manager_bpp (self->tile_manager);
+
+ if (self->linear)
+ format = gimp_bpp_to_babl_format_linear (bpp);
else
+ format = gimp_bpp_to_babl_format (bpp);
+
+ pixel_region_init (&destPR, self->tile_manager,
+ result->x, result->y,
+ result->width, result->height,
+ TRUE);
+
+ for (pr = pixel_regions_register (1, &destPR);
+ pr;
+ pr = pixel_regions_process (pr))
{
- g_warning ("no tilemanager?");
+ GeglRectangle rect = { destPR.x, destPR.y, destPR.w, destPR.h };
+
+ gegl_buffer_get (input,
+ 1.0, &rect, format, destPR.data, destPR.rowstride);
}
+ g_signal_emit (operation, tile_sink_signals[DATA_WRITTEN], 0,
+ result);
+
return TRUE;
}
Modified: branches/weskaggs/app/gegl/gimpoperationtilesource.c
==============================================================================
--- branches/weskaggs/app/gegl/gimpoperationtilesource.c (original)
+++ branches/weskaggs/app/gegl/gimpoperationtilesource.c Thu Jan 31 16:37:51 2008
@@ -69,7 +69,7 @@
static void
-gimp_operation_tile_source_class_init (GimpOperationTileSourceClass * klass)
+gimp_operation_tile_source_class_init (GimpOperationTileSourceClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GeglOperationClass *operation_class = GEGL_OPERATION_CLASS (klass);
@@ -79,6 +79,7 @@
object_class->set_property = gimp_operation_tile_source_set_property;
object_class->get_property = gimp_operation_tile_source_get_property;
+ operation_class->name = "gimp-tilemanager-source";
operation_class->prepare = gimp_operation_tile_source_prepare;
operation_class->get_defined_region = gimp_operation_tile_source_get_defined_region;
operation_class->adjust_result_region = NULL; /* the default source is
@@ -89,7 +90,6 @@
source_class->process = gimp_operation_tile_source_process;
- gegl_operation_class_set_name (operation_class, "gimp-tilemanager-source");;
g_object_class_install_property (object_class, PROP_TILE_MANAGER,
g_param_spec_boxed ("tile-manager",
@@ -220,28 +220,27 @@
const GeglRectangle *result)
{
GimpOperationTileSource *self = GIMP_OPERATION_TILE_SOURCE (operation);
+ const Babl *format;
+ PixelRegion srcPR;
+ gpointer pr;
- if (self->tile_manager)
+ if (! self->tile_manager)
+ return FALSE;
+
+ format = gegl_operation_get_format (operation, "output");
+
+ pixel_region_init (&srcPR, self->tile_manager,
+ result->x, result->y,
+ result->width, result->height,
+ FALSE);
+
+ for (pr = pixel_regions_register (1, &srcPR);
+ pr;
+ pr = pixel_regions_process (pr))
{
- const Babl *format;
- PixelRegion srcPR;
- gpointer pr;
-
- format = gegl_operation_get_format (operation, "output");
-
- pixel_region_init (&srcPR, self->tile_manager,
- result->x, result->y,
- result->width, result->height,
- FALSE);
-
- for (pr = pixel_regions_register (1, &srcPR);
- pr;
- pr = pixel_regions_process (pr))
- {
- GeglRectangle rect = { srcPR.x, srcPR.y, srcPR.w, srcPR.h };
+ GeglRectangle rect = { srcPR.x, srcPR.y, srcPR.w, srcPR.h };
- gegl_buffer_set (output, &rect, format, srcPR.data, srcPR.rowstride);
- }
+ gegl_buffer_set (output, &rect, format, srcPR.data, srcPR.rowstride);
}
return TRUE;
Modified: branches/weskaggs/app/gegl/gimpthresholdconfig.c
==============================================================================
--- branches/weskaggs/app/gegl/gimpthresholdconfig.c (original)
+++ branches/weskaggs/app/gegl/gimpthresholdconfig.c Thu Jan 31 16:37:51 2008
@@ -23,6 +23,8 @@
#include <gegl.h>
+#include "libgimpconfig/gimpconfig.h"
+
#include "gegl-types.h"
/* temp cruft */
@@ -49,14 +51,15 @@
GParamSpec *pspec);
-G_DEFINE_TYPE (GimpThresholdConfig, gimp_threshold_config,
- G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_CODE (GimpThresholdConfig, gimp_threshold_config,
+ G_TYPE_OBJECT,
+ G_IMPLEMENT_INTERFACE (GIMP_TYPE_CONFIG, NULL))
#define parent_class gimp_threshold_config_parent_class
static void
-gimp_threshold_config_class_init (GimpThresholdConfigClass * klass)
+gimp_threshold_config_class_init (GimpThresholdConfigClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
@@ -134,18 +137,6 @@
}
-/* public functions */
-
-void
-gimp_threshold_config_reset (GimpThresholdConfig *config)
-{
- g_return_if_fail (GIMP_IS_THRESHOLD_CONFIG (config));
-
- config->low = 0.5;
- config->high = 1.0;
-}
-
-
/* temp cruft */
void
Modified: branches/weskaggs/app/gegl/gimpthresholdconfig.h
==============================================================================
--- branches/weskaggs/app/gegl/gimpthresholdconfig.h (original)
+++ branches/weskaggs/app/gegl/gimpthresholdconfig.h Thu Jan 31 16:37:51 2008
@@ -49,8 +49,6 @@
GType gimp_threshold_config_get_type (void) G_GNUC_CONST;
-void gimp_threshold_config_reset (GimpThresholdConfig *config);
-
/* temp cruft */
void gimp_threshold_config_to_cruft (GimpThresholdConfig *config,
Threshold *cruft);
Modified: branches/weskaggs/app/tools/Makefile.am
==============================================================================
--- branches/weskaggs/app/tools/Makefile.am (original)
+++ branches/weskaggs/app/tools/Makefile.am Thu Jan 31 16:37:51 2008
@@ -118,6 +118,8 @@
gimpperspectiveclonetool.h \
gimpperspectivetool.c \
gimpperspectivetool.h \
+ gimppolygonselecttool.c \
+ gimppolygonselecttool.h \
gimpposterizetool.c \
gimpposterizetool.h \
gimprectangleselecttool.c \
Modified: branches/weskaggs/app/tools/gimp-tools.c
==============================================================================
--- branches/weskaggs/app/tools/gimp-tools.c (original)
+++ branches/weskaggs/app/tools/gimp-tools.c Thu Jan 31 16:37:51 2008
@@ -69,6 +69,7 @@
#include "gimppenciltool.h"
#include "gimpperspectiveclonetool.h"
#include "gimpperspectivetool.h"
+#include "gimppolygonselecttool.h"
#include "gimpposterizetool.h"
#include "gimpthresholdtool.h"
#include "gimprectangleselecttool.h"
@@ -167,6 +168,7 @@
gimp_iscissors_tool_register,
gimp_by_color_select_tool_register,
gimp_fuzzy_select_tool_register,
+ gimp_polygon_select_tool_register,
gimp_free_select_tool_register,
gimp_ellipse_select_tool_register,
gimp_rect_select_tool_register
Modified: branches/weskaggs/app/tools/gimpbrightnesscontrasttool.c
==============================================================================
--- branches/weskaggs/app/tools/gimpbrightnesscontrasttool.c (original)
+++ branches/weskaggs/app/tools/gimpbrightnesscontrasttool.c Thu Jan 31 16:37:51 2008
@@ -18,9 +18,12 @@
#include "config.h"
+#include <string.h>
+
#include <gegl.h>
#include <gtk/gtk.h>
+#include "libgimpconfig/gimpconfig.h"
#include "libgimpwidgets/gimpwidgets.h"
#include "tools-types.h"
@@ -28,6 +31,8 @@
#include "base/gimplut.h"
#include "base/lut-funcs.h"
+#include "gegl/gimpbrightnesscontrastconfig.h"
+
#include "core/gimpdrawable.h"
#include "core/gimpimage.h"
@@ -69,12 +74,15 @@
GimpDisplay *display);
static GeglNode *
- gimp_brightness_contrast_tool_get_operation (GimpImageMapTool *image_map_tool);
+ gimp_brightness_contrast_tool_get_operation (GimpImageMapTool *image_map_tool,
+ GObject **config);
static void gimp_brightness_contrast_tool_map (GimpImageMapTool *image_map_tool);
static void gimp_brightness_contrast_tool_dialog (GimpImageMapTool *image_map_tool);
-static void gimp_brightness_contrast_tool_reset (GimpImageMapTool *image_map_tool);
-static void brightness_contrast_update_sliders (GimpBrightnessContrastTool *bc_tool);
+static void brightness_contrast_config_notify (GObject *object,
+ GParamSpec *pspec,
+ GimpBrightnessContrastTool *bc_tool);
+
static void brightness_contrast_brightness_changed (GtkAdjustment *adj,
GimpBrightnessContrastTool *bc_tool);
static void brightness_contrast_contrast_changed (GtkAdjustment *adj,
@@ -122,7 +130,6 @@
im_tool_class->get_operation = gimp_brightness_contrast_tool_get_operation;
im_tool_class->map = gimp_brightness_contrast_tool_map;
im_tool_class->dialog = gimp_brightness_contrast_tool_dialog;
- im_tool_class->reset = gimp_brightness_contrast_tool_reset;
}
static void
@@ -130,9 +137,7 @@
{
GimpImageMapTool *im_tool = GIMP_IMAGE_MAP_TOOL (bc_tool);
- bc_tool->brightness = 0.0;
- bc_tool->contrast = 0.0;
- bc_tool->lut = gimp_lut_new ();
+ bc_tool->lut = gimp_lut_new ();
im_tool->apply_func = (GimpImageMapApplyFunc) gimp_lut_process;
im_tool->apply_data = bc_tool->lut;
@@ -172,19 +177,27 @@
return FALSE;
}
- bc_tool->brightness = 0.0;
- bc_tool->contrast = 0.0;
+ gimp_config_reset (GIMP_CONFIG (bc_tool->config));
GIMP_TOOL_CLASS (parent_class)->initialize (tool, display, error);
- brightness_contrast_update_sliders (bc_tool);
-
return TRUE;
}
static GeglNode *
-gimp_brightness_contrast_tool_get_operation (GimpImageMapTool *im_tool)
+gimp_brightness_contrast_tool_get_operation (GimpImageMapTool *im_tool,
+ GObject **config)
{
+ GimpBrightnessContrastTool *bc_tool = GIMP_BRIGHTNESS_CONTRAST_TOOL (im_tool);
+
+ bc_tool->config = g_object_new (GIMP_TYPE_BRIGHTNESS_CONTRAST_CONFIG, NULL);
+
+ *config = G_OBJECT (bc_tool->config);
+
+ g_signal_connect_object (bc_tool->config, "notify",
+ G_CALLBACK (brightness_contrast_config_notify),
+ G_OBJECT (bc_tool), 0);
+
return g_object_new (GEGL_TYPE_NODE,
"operation", "brightness-contrast",
NULL);
@@ -194,22 +207,13 @@
gimp_brightness_contrast_tool_map (GimpImageMapTool *im_tool)
{
GimpBrightnessContrastTool *bc_tool = GIMP_BRIGHTNESS_CONTRAST_TOOL (im_tool);
- 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);
+ gimp_brightness_contrast_config_set_node (bc_tool->config,
+ im_tool->operation);
brightness_contrast_lut_setup (bc_tool->lut,
- bc_tool->brightness / 255.0,
- bc_tool->contrast / 127.0,
+ bc_tool->config->brightness / 2.0,
+ bc_tool->config->contrast,
gimp_drawable_bytes (im_tool->drawable));
}
@@ -223,10 +227,10 @@
{
GimpBrightnessContrastTool *bc_tool = GIMP_BRIGHTNESS_CONTRAST_TOOL (tool);
- bc_tool->x = coords->x - bc_tool->contrast;
- bc_tool->y = coords->y + bc_tool->brightness;
- bc_tool->dx = bc_tool->contrast;
- bc_tool->dy = - bc_tool->brightness;
+ bc_tool->x = coords->x - bc_tool->config->contrast * 127.0;
+ bc_tool->y = coords->y + bc_tool->config->brightness * 127.0;
+ bc_tool->dx = bc_tool->config->contrast * 127.0;
+ bc_tool->dy = - bc_tool->config->brightness * 127.0;
gimp_tool_control_activate (tool->control);
tool->display = display;
@@ -249,7 +253,7 @@
return;
if (release_type == GIMP_BUTTON_RELEASE_CANCEL)
- gimp_brightness_contrast_tool_reset (im_tool);
+ gimp_config_reset (GIMP_CONFIG (bc_tool->config));
gimp_image_map_tool_preview (im_tool);
}
@@ -262,18 +266,16 @@
GimpDisplay *display)
{
GimpBrightnessContrastTool *bc_tool = GIMP_BRIGHTNESS_CONTRAST_TOOL (tool);
- GimpImageMapTool *im_tool = GIMP_IMAGE_MAP_TOOL (tool);
gimp_tool_control_pause (tool->control);
bc_tool->dx = (coords->x - bc_tool->x);
bc_tool->dy = - (coords->y - bc_tool->y);
- bc_tool->brightness = CLAMP (bc_tool->dy, -127.0, 127.0);
- bc_tool->contrast = CLAMP (bc_tool->dx, -127.0, 127.0);
-
- brightness_contrast_update_sliders (bc_tool);
- gimp_image_map_tool_preview (im_tool);
+ g_object_set (bc_tool->config,
+ "brightness", CLAMP (bc_tool->dy, -127.0, 127.0) / 127.0,
+ "contrast", CLAMP (bc_tool->dx, -127.0, 127.0) / 127.0,
+ NULL);
gimp_tool_control_resume (tool->control);
}
@@ -286,10 +288,11 @@
static void
gimp_brightness_contrast_tool_dialog (GimpImageMapTool *im_tool)
{
- GimpBrightnessContrastTool *bc_tool = GIMP_BRIGHTNESS_CONTRAST_TOOL (im_tool);
- GtkWidget *table;
- GtkWidget *slider;
- GtkObject *data;
+ GimpBrightnessContrastTool *bc_tool = GIMP_BRIGHTNESS_CONTRAST_TOOL (im_tool);
+ GimpBrightnessContrastConfig *config = bc_tool->config;
+ GtkWidget *table;
+ GtkWidget *slider;
+ GtkObject *data;
/* The table containing sliders */
table = gtk_table_new (2, 3, FALSE);
@@ -302,7 +305,7 @@
/* Create the brightness scale widget */
data = gimp_scale_entry_new (GTK_TABLE (table), 0, 0,
_("_Brightness:"), SLIDER_WIDTH, -1,
- bc_tool->brightness,
+ config->brightness * 127.0,
-127.0, 127.0, 1.0, 10.0, 0,
TRUE, 0.0, 0.0,
NULL, NULL);
@@ -317,7 +320,7 @@
/* Create the contrast scale widget */
data = gimp_scale_entry_new (GTK_TABLE (table), 0, 1,
_("Con_trast:"), SLIDER_WIDTH, -1,
- bc_tool->contrast,
+ config->contrast * 127.0,
-127.0, 127.0, 1.0, 10.0, 0,
TRUE, 0.0, 0.0,
NULL, NULL);
@@ -331,32 +334,41 @@
}
static void
-gimp_brightness_contrast_tool_reset (GimpImageMapTool *im_tool)
+brightness_contrast_config_notify (GObject *object,
+ GParamSpec *pspec,
+ GimpBrightnessContrastTool *bc_tool)
{
- GimpBrightnessContrastTool *bc_tool = GIMP_BRIGHTNESS_CONTRAST_TOOL (im_tool);
+ GimpBrightnessContrastConfig *config = GIMP_BRIGHTNESS_CONTRAST_CONFIG (object);
- bc_tool->brightness = 0.0;
- bc_tool->contrast = 0.0;
+ if (! bc_tool->brightness_data)
+ return;
- brightness_contrast_update_sliders (bc_tool);
-}
+ if (! strcmp (pspec->name, "brightness"))
+ {
+ gtk_adjustment_set_value (bc_tool->brightness_data,
+ config->brightness * 127.0);
+ }
+ else if (! strcmp (pspec->name, "contrast"))
+ {
+ gtk_adjustment_set_value (bc_tool->contrast_data,
+ config->contrast * 127.0);
+ }
-static void
-brightness_contrast_update_sliders (GimpBrightnessContrastTool *bc_tool)
-{
- gtk_adjustment_set_value (bc_tool->brightness_data, bc_tool->brightness);
- gtk_adjustment_set_value (bc_tool->contrast_data, bc_tool->contrast);
+ gimp_image_map_tool_preview (GIMP_IMAGE_MAP_TOOL (bc_tool));
}
static void
brightness_contrast_brightness_changed (GtkAdjustment *adjustment,
GimpBrightnessContrastTool *bc_tool)
{
- if (bc_tool->brightness != adjustment->value)
- {
- bc_tool->brightness = adjustment->value;
+ GimpBrightnessContrastConfig *config = bc_tool->config;
+ gdouble value = adjustment->value / 127.0;
- gimp_image_map_tool_preview (GIMP_IMAGE_MAP_TOOL (bc_tool));
+ if (config->brightness != value)
+ {
+ g_object_set (config,
+ "brightness", value,
+ NULL);
}
}
@@ -364,10 +376,13 @@
brightness_contrast_contrast_changed (GtkAdjustment *adjustment,
GimpBrightnessContrastTool *bc_tool)
{
- if (bc_tool->contrast != adjustment->value)
- {
- bc_tool->contrast = adjustment->value;
+ GimpBrightnessContrastConfig *config = bc_tool->config;
+ gdouble value = adjustment->value / 127.0;
- gimp_image_map_tool_preview (GIMP_IMAGE_MAP_TOOL (bc_tool));
+ if (config->contrast != value)
+ {
+ g_object_set (config,
+ "contrast", value,
+ NULL);
}
}
Modified: branches/weskaggs/app/tools/gimpbrightnesscontrasttool.h
==============================================================================
--- branches/weskaggs/app/tools/gimpbrightnesscontrasttool.h (original)
+++ branches/weskaggs/app/tools/gimpbrightnesscontrasttool.h Thu Jan 31 16:37:51 2008
@@ -36,18 +36,17 @@
struct _GimpBrightnessContrastTool
{
- GimpImageMapTool parent_instance;
+ GimpImageMapTool parent_instance;
- gdouble x, y;
- gdouble dx, dy;
+ GimpBrightnessContrastConfig *config;
+ GimpLut *lut;
- gdouble brightness;
- gdouble contrast;
- GimpLut *lut;
+ gdouble x, y;
+ gdouble dx, dy;
/* dialog */
- GtkAdjustment *brightness_data;
- GtkAdjustment *contrast_data;
+ GtkAdjustment *brightness_data;
+ GtkAdjustment *contrast_data;
};
struct _GimpBrightnessContrastToolClass
Modified: branches/weskaggs/app/tools/gimpcolorbalancetool.c
==============================================================================
--- branches/weskaggs/app/tools/gimpcolorbalancetool.c (original)
+++ branches/weskaggs/app/tools/gimpcolorbalancetool.c Thu Jan 31 16:37:51 2008
@@ -18,9 +18,12 @@
#include "config.h"
+#include <string.h>
+
#include <gegl.h>
#include <gtk/gtk.h>
+#include "libgimpconfig/gimpconfig.h"
#include "libgimpwidgets/gimpwidgets.h"
#include "tools-types.h"
@@ -50,12 +53,16 @@
GimpDisplay *display,
GError **error);
-static GeglNode * gimp_color_balance_tool_get_operation (GimpImageMapTool *im_tool);
+static GeglNode * gimp_color_balance_tool_get_operation (GimpImageMapTool *im_tool,
+ GObject **config);
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_config_notify (GObject *object,
+ GParamSpec *pspec,
+ GimpColorBalanceTool *cb_tool);
+
static void color_balance_range_callback (GtkWidget *widget,
GimpColorBalanceTool *cb_tool);
static void color_balance_range_reset_callback (GtkWidget *widget,
@@ -129,12 +136,6 @@
{
GimpColorBalanceTool *cb_tool = GIMP_COLOR_BALANCE_TOOL (object);
- if (cb_tool->config)
- {
- g_object_unref (cb_tool->config);
- cb_tool->config = NULL;
- }
-
g_slice_free (ColorBalance, cb_tool->color_balance);
G_OBJECT_CLASS (parent_class)->finalize (object);
@@ -160,20 +161,16 @@
return FALSE;
}
- gimp_color_balance_config_reset (cb_tool->config);
+ gimp_config_reset (GIMP_CONFIG (cb_tool->config));
GIMP_TOOL_CLASS (parent_class)->initialize (tool, display, error);
- gimp_int_radio_group_set_active (GTK_RADIO_BUTTON (cb_tool->range_radio),
- cb_tool->config->range);
-
- color_balance_update (cb_tool);
-
return TRUE;
}
static GeglNode *
-gimp_color_balance_tool_get_operation (GimpImageMapTool *im_tool)
+gimp_color_balance_tool_get_operation (GimpImageMapTool *im_tool,
+ GObject **config)
{
GimpColorBalanceTool *cb_tool = GIMP_COLOR_BALANCE_TOOL (im_tool);
GeglNode *node;
@@ -184,6 +181,12 @@
cb_tool->config = g_object_new (GIMP_TYPE_COLOR_BALANCE_CONFIG, NULL);
+ *config = G_OBJECT (cb_tool->config);
+
+ g_signal_connect_object (cb_tool->config, "notify",
+ G_CALLBACK (color_balance_config_notify),
+ G_OBJECT (cb_tool), 0);
+
gegl_node_set (node,
"config", cb_tool->config,
NULL);
@@ -205,7 +208,8 @@
/**************************/
static GtkAdjustment *
-create_levels_scale (const gchar *left,
+create_levels_scale (gdouble value,
+ const gchar *left,
const gchar *right,
GtkWidget *table,
gint col)
@@ -222,7 +226,8 @@
gtk_widget_show (label);
spinbutton = gimp_spin_button_new (&adj,
- 0, -100.0, 100.0, 1.0, 10.0, 0.0, 1.0, 0);
+ value, -100.0, 100.0,
+ 1.0, 10.0, 0.0, 1.0, 0);
slider = gtk_hscale_new (GTK_ADJUSTMENT (adj));
gtk_scale_set_draw_value (GTK_SCALE (slider), FALSE);
@@ -247,18 +252,21 @@
static void
gimp_color_balance_tool_dialog (GimpImageMapTool *im_tool)
{
- GimpColorBalanceTool *cb_tool = GIMP_COLOR_BALANCE_TOOL (im_tool);
- GtkWidget *vbox;
- GtkWidget *hbox;
- GtkWidget *table;
- GtkWidget *button;
- GtkWidget *frame;
+ GimpColorBalanceTool *cb_tool = GIMP_COLOR_BALANCE_TOOL (im_tool);
+ GimpColorBalanceConfig *config = cb_tool->config;
+ GtkWidget *vbox;
+ GtkWidget *hbox;
+ GtkWidget *table;
+ GtkWidget *button;
+ GtkWidget *frame;
frame = gimp_enum_radio_frame_new (GIMP_TYPE_TRANSFER_MODE,
gtk_label_new (_("Select Range to Adjust")),
G_CALLBACK (color_balance_range_callback),
cb_tool,
&cb_tool->range_radio);
+ gimp_int_radio_group_set_active (GTK_RADIO_BUTTON (cb_tool->range_radio),
+ config->range);
gtk_box_pack_start (GTK_BOX (im_tool->main_vbox), frame, FALSE, FALSE, 0);
gtk_widget_show (frame);
@@ -277,22 +285,28 @@
gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0);
gtk_widget_show (table);
- cb_tool->cyan_red_adj = create_levels_scale (_("Cyan"), _("Red"),
- table, 0);
+ cb_tool->cyan_red_adj =
+ create_levels_scale (config->cyan_red[config->range] * 100.0,
+ _("Cyan"), _("Red"),
+ table, 0);
g_signal_connect (cb_tool->cyan_red_adj, "value-changed",
G_CALLBACK (color_balance_cr_changed),
cb_tool);
- cb_tool->magenta_green_adj = create_levels_scale (_("Magenta"), _("Green"),
- table, 1);
+ cb_tool->magenta_green_adj =
+ create_levels_scale (config->magenta_green[config->range] * 100.0,
+ _("Magenta"), _("Green"),
+ table, 1);
g_signal_connect (cb_tool->magenta_green_adj, "value-changed",
G_CALLBACK (color_balance_mg_changed),
cb_tool);
- cb_tool->yellow_blue_adj = create_levels_scale (_("Yellow"), _("Blue"),
- table, 2);
+ cb_tool->yellow_blue_adj =
+ create_levels_scale (config->yellow_blue[config->range] * 100.0,
+ _("Yellow"), _("Blue"),
+ table, 2);
g_signal_connect (cb_tool->yellow_blue_adj, "value-changed",
G_CALLBACK (color_balance_yb_changed),
@@ -313,7 +327,7 @@
cb_tool->preserve_toggle =
gtk_check_button_new_with_mnemonic (_("Preserve _luminosity"));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (cb_tool->preserve_toggle),
- cb_tool->config->preserve_luminosity);
+ config->preserve_luminosity);
gtk_box_pack_end (GTK_BOX (im_tool->main_vbox), cb_tool->preserve_toggle,
FALSE, FALSE, 0);
gtk_widget_show (cb_tool->preserve_toggle);
@@ -329,28 +343,53 @@
GimpColorBalanceTool *cb_tool = GIMP_COLOR_BALANCE_TOOL (im_tool);
GimpTransferMode range = cb_tool->config->range;
- gimp_color_balance_config_reset (cb_tool->config);
+ g_object_freeze_notify (G_OBJECT (cb_tool->config));
+
+ gimp_config_reset (GIMP_CONFIG (cb_tool->config));
g_object_set (cb_tool->config,
"range", range,
NULL);
- color_balance_update (cb_tool);
+ g_object_thaw_notify (G_OBJECT (cb_tool->config));
}
static void
-color_balance_update (GimpColorBalanceTool *cb_tool)
+color_balance_config_notify (GObject *object,
+ GParamSpec *pspec,
+ GimpColorBalanceTool *cb_tool)
{
- GimpColorBalanceConfig *config = cb_tool->config;
+ GimpColorBalanceConfig *config = GIMP_COLOR_BALANCE_CONFIG (object);
- gtk_adjustment_set_value (cb_tool->cyan_red_adj,
- config->cyan_red[config->range] * 100.0);
- gtk_adjustment_set_value (cb_tool->magenta_green_adj,
- config->magenta_green[config->range] * 100.0);
- gtk_adjustment_set_value (cb_tool->yellow_blue_adj,
- config->yellow_blue[config->range] * 100.0);
+ if (! cb_tool->cyan_red_adj)
+ return;
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (cb_tool->preserve_toggle),
- config->preserve_luminosity);
+ if (! strcmp (pspec->name, "range"))
+ {
+ gimp_int_radio_group_set_active (GTK_RADIO_BUTTON (cb_tool->range_radio),
+ config->range);
+ }
+ else if (! strcmp (pspec->name, "cyan-red"))
+ {
+ gtk_adjustment_set_value (cb_tool->cyan_red_adj,
+ config->cyan_red[config->range] * 100.0);
+ }
+ else if (! strcmp (pspec->name, "magenta-green"))
+ {
+ gtk_adjustment_set_value (cb_tool->magenta_green_adj,
+ config->magenta_green[config->range] * 100.0);
+ }
+ else if (! strcmp (pspec->name, "yellow-blue"))
+ {
+ gtk_adjustment_set_value (cb_tool->yellow_blue_adj,
+ config->yellow_blue[config->range] * 100.0);
+ }
+ else if (! strcmp (pspec->name, "preserve-luminosity"))
+ {
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (cb_tool->preserve_toggle),
+ config->preserve_luminosity);
+ }
+
+ gimp_image_map_tool_preview (GIMP_IMAGE_MAP_TOOL (cb_tool));
}
static void
@@ -365,8 +404,6 @@
g_object_set (cb_tool->config,
"range", range,
NULL);
-
- color_balance_update (cb_tool);
}
}
@@ -374,12 +411,7 @@
color_balance_range_reset_callback (GtkWidget *widget,
GimpColorBalanceTool *cb_tool)
{
- gimp_color_balance_config_reset_range (cb_tool->config,
- cb_tool->config->range);
-
- color_balance_update (cb_tool);
-
- gimp_image_map_tool_preview (GIMP_IMAGE_MAP_TOOL (cb_tool));
+ gimp_color_balance_config_reset_range (cb_tool->config);
}
static void
@@ -394,8 +426,6 @@
g_object_set (config,
"preserve-luminosity", active,
NULL);
-
- gimp_image_map_tool_preview (GIMP_IMAGE_MAP_TOOL (cb_tool));
}
}
@@ -411,8 +441,6 @@
g_object_set (config,
"cyan-red", value,
NULL);
-
- gimp_image_map_tool_preview (GIMP_IMAGE_MAP_TOOL (cb_tool));
}
}
@@ -428,8 +456,6 @@
g_object_set (config,
"magenta-green", value,
NULL);
-
- gimp_image_map_tool_preview (GIMP_IMAGE_MAP_TOOL (cb_tool));
}
}
@@ -445,7 +471,5 @@
g_object_set (config,
"yellow-blue", value,
NULL);
-
- gimp_image_map_tool_preview (GIMP_IMAGE_MAP_TOOL (cb_tool));
}
}
Modified: branches/weskaggs/app/tools/gimpcolorizetool.c
==============================================================================
--- branches/weskaggs/app/tools/gimpcolorizetool.c (original)
+++ branches/weskaggs/app/tools/gimpcolorizetool.c Thu Jan 31 16:37:51 2008
@@ -18,9 +18,12 @@
#include "config.h"
+#include <string.h>
+
#include <gegl.h>
#include <gtk/gtk.h>
+#include "libgimpconfig/gimpconfig.h"
#include "libgimpwidgets/gimpwidgets.h"
#include "tools-types.h"
@@ -53,12 +56,15 @@
GimpDisplay *display,
GError **error);
-static GeglNode * gimp_colorize_tool_get_operation (GimpImageMapTool *im_tool);
+static GeglNode * gimp_colorize_tool_get_operation (GimpImageMapTool *im_tool,
+ GObject **config);
static void gimp_colorize_tool_map (GimpImageMapTool *im_tool);
static void gimp_colorize_tool_dialog (GimpImageMapTool *im_tool);
-static void gimp_colorize_tool_reset (GimpImageMapTool *im_tool);
-static void colorize_update_sliders (GimpColorizeTool *col_tool);
+static void gimp_colorize_tool_config_notify (GObject *object,
+ GParamSpec *pspec,
+ GimpColorizeTool *col_tool);
+
static void colorize_hue_changed (GtkAdjustment *adj,
GimpColorizeTool *col_tool);
static void colorize_saturation_changed (GtkAdjustment *adj,
@@ -104,7 +110,6 @@
im_tool_class->get_operation = gimp_colorize_tool_get_operation;
im_tool_class->map = gimp_colorize_tool_map;
im_tool_class->dialog = gimp_colorize_tool_dialog;
- im_tool_class->reset = gimp_colorize_tool_reset;
}
static void
@@ -125,12 +130,6 @@
{
GimpColorizeTool *col_tool = GIMP_COLORIZE_TOOL (object);
- if (col_tool->config)
- {
- g_object_unref (col_tool->config);
- col_tool->config = NULL;
- }
-
g_slice_free (Colorize, col_tool->colorize);
G_OBJECT_CLASS (parent_class)->finalize (object);
@@ -154,31 +153,36 @@
return FALSE;
}
- gimp_colorize_config_reset (col_tool->config);
+ gimp_config_reset (GIMP_CONFIG (col_tool->config));
GIMP_TOOL_CLASS (parent_class)->initialize (tool, display, error);
- colorize_update_sliders (col_tool);
-
gimp_image_map_tool_preview (GIMP_IMAGE_MAP_TOOL (tool));
return TRUE;
}
static GeglNode *
-gimp_colorize_tool_get_operation (GimpImageMapTool *im_tool)
+gimp_colorize_tool_get_operation (GimpImageMapTool *im_tool,
+ GObject **config)
{
- GimpColorizeTool *tool = GIMP_COLORIZE_TOOL (im_tool);
+ GimpColorizeTool *col_tool = GIMP_COLORIZE_TOOL (im_tool);
GeglNode *node;
node = g_object_new (GEGL_TYPE_NODE,
"operation", "gimp-colorize",
NULL);
- tool->config = g_object_new (GIMP_TYPE_COLORIZE_CONFIG, NULL);
+ col_tool->config = g_object_new (GIMP_TYPE_COLORIZE_CONFIG, NULL);
+
+ *config = G_OBJECT (col_tool->config);
+
+ g_signal_connect_object (col_tool->config, "notify",
+ G_CALLBACK (gimp_colorize_tool_config_notify),
+ G_OBJECT (col_tool), 0);
gegl_node_set (node,
- "config", tool->config,
+ "config", col_tool->config,
NULL);
return node;
@@ -187,7 +191,7 @@
static void
gimp_colorize_tool_map (GimpImageMapTool *image_map_tool)
{
- GimpColorizeTool *col_tool = GIMP_COLORIZE_TOOL (image_map_tool);
+ GimpColorizeTool *col_tool = GIMP_COLORIZE_TOOL (image_map_tool);
gimp_colorize_config_to_cruft (col_tool->config, col_tool->colorize);
}
@@ -226,7 +230,8 @@
/* Create the hue scale widget */
data = gimp_scale_entry_new (GTK_TABLE (table), 0, 0,
_("_Hue:"), SLIDER_WIDTH, -1,
- 0.0, 0.0, 360.0, 1.0, 15.0, 0,
+ col_tool->config->hue * 360.0,
+ 0.0, 360.0, 1.0, 15.0, 0,
TRUE, 0.0, 0.0,
NULL, NULL);
col_tool->hue_data = GTK_ADJUSTMENT (data);
@@ -240,7 +245,8 @@
/* Create the saturation scale widget */
data = gimp_scale_entry_new (GTK_TABLE (table), 0, 1,
_("_Saturation:"), SLIDER_WIDTH, -1,
- 0.0, 0.0, 100.0, 1.0, 10.0, 0,
+ col_tool->config->saturation * 100.0,
+ 0.0, 100.0, 1.0, 10.0, 0,
TRUE, 0.0, 0.0,
NULL, NULL);
col_tool->saturation_data = GTK_ADJUSTMENT (data);
@@ -254,7 +260,8 @@
/* Create the lightness scale widget */
data = gimp_scale_entry_new (GTK_TABLE (table), 0, 2,
_("_Lightness:"), SLIDER_WIDTH, -1,
- 0.0, -100.0, 100.0, 1.0, 10.0, 0,
+ col_tool->config->lightness * 100.0,
+ -100.0, 100.0, 1.0, 10.0, 0,
TRUE, 0.0, 0.0,
NULL, NULL);
col_tool->lightness_data = GTK_ADJUSTMENT (data);
@@ -267,24 +274,32 @@
}
static void
-gimp_colorize_tool_reset (GimpImageMapTool *image_map_tool)
+gimp_colorize_tool_config_notify (GObject *object,
+ GParamSpec *pspec,
+ GimpColorizeTool *col_tool)
{
- GimpColorizeTool *col_tool = GIMP_COLORIZE_TOOL (image_map_tool);
+ GimpColorizeConfig *config = GIMP_COLORIZE_CONFIG (object);
- gimp_colorize_config_reset (col_tool->config);
+ if (! col_tool->hue_data)
+ return;
- colorize_update_sliders (col_tool);
-}
+ if (! strcmp (pspec->name, "hue"))
+ {
+ gtk_adjustment_set_value (col_tool->hue_data,
+ config->hue * 360.0);
+ }
+ else if (! strcmp (pspec->name, "saturation"))
+ {
+ gtk_adjustment_set_value (col_tool->saturation_data,
+ config->saturation * 100.0);
+ }
+ else if (! strcmp (pspec->name, "lightness"))
+ {
+ gtk_adjustment_set_value (col_tool->lightness_data,
+ config->lightness * 100.0);
+ }
-static void
-colorize_update_sliders (GimpColorizeTool *col_tool)
-{
- gtk_adjustment_set_value (col_tool->hue_data,
- col_tool->config->hue * 360.0);
- gtk_adjustment_set_value (col_tool->saturation_data,
- col_tool->config->saturation * 100.0);
- gtk_adjustment_set_value (col_tool->lightness_data,
- col_tool->config->lightness * 100.0);
+ gimp_image_map_tool_preview (GIMP_IMAGE_MAP_TOOL (col_tool));
}
static void
@@ -298,8 +313,6 @@
g_object_set (col_tool->config,
"hue", value,
NULL);
-
- gimp_image_map_tool_preview (GIMP_IMAGE_MAP_TOOL (col_tool));
}
}
@@ -314,8 +327,6 @@
g_object_set (col_tool->config,
"saturation", value,
NULL);
-
- gimp_image_map_tool_preview (GIMP_IMAGE_MAP_TOOL (col_tool));
}
}
@@ -330,7 +341,5 @@
g_object_set (col_tool->config,
"lightness", value,
NULL);
-
- gimp_image_map_tool_preview (GIMP_IMAGE_MAP_TOOL (col_tool));
}
}
Modified: branches/weskaggs/app/tools/gimpcurvestool.c
==============================================================================
--- branches/weskaggs/app/tools/gimpcurvestool.c (original)
+++ branches/weskaggs/app/tools/gimpcurvestool.c Thu Jan 31 16:37:51 2008
@@ -22,6 +22,7 @@
#include <gtk/gtk.h>
#include "libgimpcolor/gimpcolor.h"
+#include "libgimpconfig/gimpconfig.h"
#include "libgimpwidgets/gimpwidgets.h"
#include "tools-types.h"
@@ -83,7 +84,8 @@
GimpImageType sample_type,
GimpRGB *color,
gint color_index);
-static GeglNode * gimp_curves_tool_get_operation (GimpImageMapTool *image_map_tool);
+static GeglNode * gimp_curves_tool_get_operation (GimpImageMapTool *image_map_tool,
+ GObject **config);
static void gimp_curves_tool_map (GimpImageMapTool *image_map_tool);
static void gimp_curves_tool_dialog (GimpImageMapTool *image_map_tool);
static void gimp_curves_tool_reset (GimpImageMapTool *image_map_tool);
@@ -93,8 +95,10 @@
static gboolean gimp_curves_tool_settings_save (GimpImageMapTool *image_map_tool,
gpointer fp);
-static void curves_curve_callback (GimpCurve *curve,
+static void gimp_curves_tool_config_notify (GObject *object,
+ GParamSpec *pspec,
GimpCurvesTool *tool);
+
static void curves_channel_callback (GtkWidget *widget,
GimpCurvesTool *tool);
static void curves_channel_reset_callback (GtkWidget *widget,
@@ -186,12 +190,6 @@
{
GimpCurvesTool *tool = GIMP_CURVES_TOOL (object);
- if (tool->config)
- {
- g_object_unref (tool->config);
- tool->config = NULL;
- }
-
gimp_lut_free (tool->lut);
if (tool->hist)
@@ -210,7 +208,6 @@
{
GimpCurvesTool *c_tool = GIMP_CURVES_TOOL (tool);
GimpDrawable *drawable = gimp_image_get_active_drawable (display->image);
- gint i;
if (! drawable)
return FALSE;
@@ -222,8 +219,7 @@
return FALSE;
}
- for (i = 0; i < G_N_ELEMENTS (c_tool->config->curve); i++)
- gimp_curve_reset (c_tool->config->curve[i], TRUE);
+ gimp_config_reset (GIMP_CONFIG (c_tool->config));
if (! c_tool->hist)
c_tool->hist = gimp_histogram_new ();
@@ -382,11 +378,11 @@
}
static GeglNode *
-gimp_curves_tool_get_operation (GimpImageMapTool *image_map_tool)
+gimp_curves_tool_get_operation (GimpImageMapTool *image_map_tool,
+ GObject **config)
{
GimpCurvesTool *tool = GIMP_CURVES_TOOL (image_map_tool);
GeglNode *node;
- gint i;
node = g_object_new (GEGL_TYPE_NODE,
"operation", "gimp-curves",
@@ -394,12 +390,11 @@
tool->config = g_object_new (GIMP_TYPE_CURVES_CONFIG, NULL);
- for (i = 0; i < G_N_ELEMENTS (tool->config->curve); i++)
- {
- g_signal_connect_object (tool->config->curve[i], "dirty",
- G_CALLBACK (curves_curve_callback),
- tool, 0);
- }
+ *config = G_OBJECT (tool->config);
+
+ g_signal_connect_object (tool->config, "notify",
+ G_CALLBACK (gimp_curves_tool_config_notify),
+ tool, 0);
gegl_node_set (node,
"config", tool->config,
@@ -605,13 +600,15 @@
static void
gimp_curves_tool_reset (GimpImageMapTool *image_map_tool)
{
- GimpCurvesTool *tool = GIMP_CURVES_TOOL (image_map_tool);
- GimpHistogramChannel channel = tool->config->channel;
+ GimpCurvesTool *tool = GIMP_CURVES_TOOL (image_map_tool);
+ GimpHistogramChannel channel;
- gimp_curves_config_reset (tool->config);
- g_object_set (tool->config,
- "channel", channel,
- NULL);
+ for (channel = GIMP_HISTOGRAM_VALUE;
+ channel <= GIMP_HISTOGRAM_ALPHA;
+ channel++)
+ {
+ gimp_curve_reset (tool->config->curve[channel], FALSE);
+ }
}
static gboolean
@@ -621,15 +618,7 @@
{
GimpCurvesTool *tool = GIMP_CURVES_TOOL (image_map_tool);
- if (gimp_curves_config_load_cruft (tool->config, fp, error))
- {
- gimp_int_radio_group_set_active (GTK_RADIO_BUTTON (tool->curve_type),
- GIMP_CURVE_SMOOTH);
-
- return TRUE;
- }
-
- return FALSE;
+ return gimp_curves_config_load_cruft (tool->config, fp, error);
}
static gboolean
@@ -642,15 +631,16 @@
}
static void
-curves_curve_callback (GimpCurve *curve,
- GimpCurvesTool *tool)
+gimp_curves_tool_config_notify (GObject *object,
+ GParamSpec *pspec,
+ GimpCurvesTool *tool)
{
- GimpCurvesConfig *config = tool->config;
+ GimpCurvesConfig *config = GIMP_CURVES_CONFIG (object);
- if (curve != config->curve[config->channel])
+ if (! tool->xrange)
return;
- if (tool->xrange)
+ if (! strcmp (pspec->name, "channel"))
{
switch (config->channel)
{
@@ -672,25 +662,6 @@
config->curve[GIMP_HISTOGRAM_BLUE]->curve);
break;
}
- }
-
- if (GIMP_IMAGE_MAP_TOOL (tool)->drawable)
- gimp_image_map_tool_preview (GIMP_IMAGE_MAP_TOOL (tool));
-}
-
-static void
-curves_channel_callback (GtkWidget *widget,
- GimpCurvesTool *tool)
-{
- gint value;
-
- if (gimp_int_combo_box_get_active (GIMP_INT_COMBO_BOX (widget), &value))
- {
- GimpCurvesConfig *config = tool->config;
-
- g_object_set (config,
- "channel", value,
- NULL);
gimp_histogram_view_set_channel (GIMP_HISTOGRAM_VIEW (tool->graph),
config->channel);
@@ -702,11 +673,29 @@
gimp_curve_view_set_curve (GIMP_CURVE_VIEW (tool->graph),
config->curve[config->channel]);
-
+ }
+ else if (! strcmp (pspec->name, "curve"))
+ {
gimp_int_radio_group_set_active (GTK_RADIO_BUTTON (tool->curve_type),
config->curve[config->channel]->curve_type);
+ }
- curves_curve_callback (config->curve[config->channel], tool);
+ gimp_image_map_tool_preview (GIMP_IMAGE_MAP_TOOL (tool));
+}
+
+static void
+curves_channel_callback (GtkWidget *widget,
+ GimpCurvesTool *tool)
+{
+ GimpCurvesConfig *config = tool->config;
+ gint value;
+
+ if (gimp_int_combo_box_get_active (GIMP_INT_COMBO_BOX (widget), &value) &&
+ config->channel != value)
+ {
+ g_object_set (config,
+ "channel", value,
+ NULL);
}
}
@@ -714,7 +703,7 @@
curves_channel_reset_callback (GtkWidget *widget,
GimpCurvesTool *tool)
{
- gimp_curves_config_reset_channel (tool->config, tool->config->channel);
+ gimp_curve_reset (tool->config->curve[tool->config->channel], FALSE);
}
static gboolean
Modified: branches/weskaggs/app/tools/gimphuesaturationtool.c
==============================================================================
--- branches/weskaggs/app/tools/gimphuesaturationtool.c (original)
+++ branches/weskaggs/app/tools/gimphuesaturationtool.c Thu Jan 31 16:37:51 2008
@@ -18,9 +18,12 @@
#include "config.h"
+#include <string.h>
+
#include <gegl.h>
#include <gtk/gtk.h>
+#include "libgimpconfig/gimpconfig.h"
#include "libgimpwidgets/gimpwidgets.h"
#include "tools-types.h"
@@ -56,12 +59,16 @@
GimpDisplay *display,
GError **error);
-static GeglNode * gimp_hue_saturation_tool_get_operation (GimpImageMapTool *im_tool);
+static GeglNode * gimp_hue_saturation_tool_get_operation (GimpImageMapTool *im_tool,
+ GObject **config);
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_config_notify (GObject *object,
+ GParamSpec *pspec,
+ GimpHueSaturationTool *hs_tool);
+
static void hue_saturation_update_color_areas (GimpHueSaturationTool *hs_tool);
static void hue_saturation_range_callback (GtkWidget *widget,
@@ -137,12 +144,6 @@
{
GimpHueSaturationTool *hs_tool = GIMP_HUE_SATURATION_TOOL (object);
- if (hs_tool->config)
- {
- g_object_unref (hs_tool->config);
- hs_tool->config = NULL;
- }
-
g_slice_free (HueSaturation, hs_tool->hue_saturation);
G_OBJECT_CLASS (parent_class)->finalize (object);
@@ -168,21 +169,16 @@
return FALSE;
}
- gimp_hue_saturation_config_reset (hs_tool->config);
+ gimp_config_reset (GIMP_CONFIG (hs_tool->config));
GIMP_TOOL_CLASS (parent_class)->initialize (tool, display, error);
- gimp_int_radio_group_set_active (GTK_RADIO_BUTTON (hs_tool->range_radio),
- hs_tool->config->range);
-
- hue_saturation_update_sliders (hs_tool);
- hue_saturation_update_color_areas (hs_tool);
-
return TRUE;
}
static GeglNode *
-gimp_hue_saturation_tool_get_operation (GimpImageMapTool *im_tool)
+gimp_hue_saturation_tool_get_operation (GimpImageMapTool *im_tool,
+ GObject **config)
{
GimpHueSaturationTool *hs_tool = GIMP_HUE_SATURATION_TOOL (im_tool);
GeglNode *node;
@@ -193,6 +189,12 @@
hs_tool->config = g_object_new (GIMP_TYPE_HUE_SATURATION_CONFIG, NULL);
+ *config = G_OBJECT (hs_tool->config);
+
+ g_signal_connect_object (hs_tool->config, "notify",
+ G_CALLBACK (hue_saturation_config_notify),
+ G_OBJECT (hs_tool), 0);
+
gegl_node_set (node,
"config", hs_tool->config,
NULL);
@@ -216,19 +218,20 @@
static void
gimp_hue_saturation_tool_dialog (GimpImageMapTool *image_map_tool)
{
- GimpHueSaturationTool *hs_tool = GIMP_HUE_SATURATION_TOOL (image_map_tool);
- GtkWidget *vbox;
- GtkWidget *abox;
- GtkWidget *table;
- GtkWidget *slider;
- GtkWidget *button;
- GtkWidget *frame;
- GtkWidget *hbox;
- GtkObject *data;
- GtkSizeGroup *label_group;
- GtkSizeGroup *spinner_group;
- GSList *group = NULL;
- gint i;
+ GimpHueSaturationTool *hs_tool = GIMP_HUE_SATURATION_TOOL (image_map_tool);
+ GimpHueSaturationConfig *config = hs_tool->config;
+ GtkWidget *vbox;
+ GtkWidget *abox;
+ GtkWidget *table;
+ GtkWidget *slider;
+ GtkWidget *button;
+ GtkWidget *frame;
+ GtkWidget *hbox;
+ GtkObject *data;
+ GtkSizeGroup *label_group;
+ GtkSizeGroup *spinner_group;
+ GSList *group = NULL;
+ gint i;
const struct
{
@@ -342,7 +345,8 @@
data = gimp_scale_entry_new (GTK_TABLE (table), 0, 0,
_("_Overlap:"), SLIDER_WIDTH, -1,
- 0.0, 0, 100.0, 1.0, 15.0, 0,
+ config->overlap * 100.0,
+ 0.0, 100.0, 1.0, 15.0, 0,
TRUE, 0.0, 0.0,
NULL, NULL);
hs_tool->overlap_data = GTK_ADJUSTMENT (data);
@@ -378,7 +382,8 @@
/* Create the hue scale widget */
data = gimp_scale_entry_new (GTK_TABLE (table), 0, 0,
_("_Hue:"), SLIDER_WIDTH, -1,
- 0.0, -180.0, 180.0, 1.0, 15.0, 0,
+ config->hue[config->range] * 180.0,
+ -180.0, 180.0, 1.0, 15.0, 0,
TRUE, 0.0, 0.0,
NULL, NULL);
hs_tool->hue_data = GTK_ADJUSTMENT (data);
@@ -396,7 +401,8 @@
/* Create the lightness scale widget */
data = gimp_scale_entry_new (GTK_TABLE (table), 0, 1,
_("_Lightness:"), SLIDER_WIDTH, -1,
- 0.0, -100.0, 100.0, 1.0, 10.0, 0,
+ config->lightness[config->range] * 100.0,
+ -100.0, 100.0, 1.0, 10.0, 0,
TRUE, 0.0, 0.0,
NULL, NULL);
hs_tool->lightness_data = GTK_ADJUSTMENT (data);
@@ -414,7 +420,8 @@
/* Create the saturation scale widget */
data = gimp_scale_entry_new (GTK_TABLE (table), 0, 2,
_("_Saturation:"), SLIDER_WIDTH, -1,
- 0.0, -100.0, 100.0, 1.0, 10.0, 0,
+ config->saturation[config->range] * 100.0,
+ -100.0, 100.0, 1.0, 10.0, 0,
TRUE, 0.0, 0.0,
NULL, NULL);
hs_tool->saturation_data = GTK_ADJUSTMENT (data);
@@ -440,6 +447,11 @@
g_signal_connect (button, "clicked",
G_CALLBACK (hue_saturation_range_reset_callback),
hs_tool);
+
+ gimp_int_radio_group_set_active (GTK_RADIO_BUTTON (hs_tool->range_radio),
+ config->range);
+
+ hue_saturation_update_color_areas (hs_tool);
}
static void
@@ -448,28 +460,55 @@
GimpHueSaturationTool *hs_tool = GIMP_HUE_SATURATION_TOOL (image_map_tool);
GimpHueRange range = hs_tool->config->range;
- gimp_hue_saturation_config_reset (hs_tool->config);
+ g_object_freeze_notify (G_OBJECT (hs_tool->config));
+
+ gimp_config_reset (GIMP_CONFIG (hs_tool->config));
g_object_set (hs_tool->config,
"range", range,
NULL);
- hue_saturation_update_sliders (hs_tool);
- hue_saturation_update_color_areas (hs_tool);
+ g_object_thaw_notify (G_OBJECT (hs_tool->config));
}
static void
-hue_saturation_update_sliders (GimpHueSaturationTool *hs_tool)
+hue_saturation_config_notify (GObject *object,
+ GParamSpec *pspec,
+ GimpHueSaturationTool *hs_tool)
{
- GimpHueSaturationConfig *config = hs_tool->config;
+ GimpHueSaturationConfig *config = GIMP_HUE_SATURATION_CONFIG (object);
+
+ if (! hs_tool->hue_data)
+ return;
+
+ if (! strcmp (pspec->name, "range"))
+ {
+ gimp_int_radio_group_set_active (GTK_RADIO_BUTTON (hs_tool->range_radio),
+ config->range);
+ }
+ else if (! strcmp (pspec->name, "hue"))
+ {
+ gtk_adjustment_set_value (hs_tool->hue_data,
+ config->hue[config->range] * 180.0);
+ }
+ else if (! strcmp (pspec->name, "lightness"))
+ {
+ gtk_adjustment_set_value (hs_tool->lightness_data,
+ config->lightness[config->range] * 100.0);
+ }
+ else if (! strcmp (pspec->name, "saturation"))
+ {
+ gtk_adjustment_set_value (hs_tool->saturation_data,
+ config->saturation[config->range] * 100.0);
+ }
+ else if (! strcmp (pspec->name, "overlap"))
+ {
+ gtk_adjustment_set_value (hs_tool->overlap_data,
+ config->overlap * 100.0);
+ }
+
+ hue_saturation_update_color_areas (hs_tool);
- gtk_adjustment_set_value (hs_tool->hue_data,
- config->hue[config->range] * 180.0);
- gtk_adjustment_set_value (hs_tool->lightness_data,
- config->lightness[config->range] * 100.0);
- gtk_adjustment_set_value (hs_tool->saturation_data,
- config->saturation[config->range] * 100.0);
- gtk_adjustment_set_value (hs_tool->overlap_data,
- config->overlap * 100.0);
+ gimp_image_map_tool_preview (GIMP_IMAGE_MAP_TOOL (hs_tool));
}
static void
@@ -511,8 +550,6 @@
g_object_set (hs_tool->config,
"range", range,
NULL);
-
- hue_saturation_update_sliders (hs_tool);
}
}
@@ -520,13 +557,7 @@
hue_saturation_range_reset_callback (GtkWidget *widget,
GimpHueSaturationTool *hs_tool)
{
- gimp_hue_saturation_config_reset_range (hs_tool->config,
- hs_tool->config->range);
-
- hue_saturation_update_sliders (hs_tool);
- hue_saturation_update_color_areas (hs_tool);
-
- gimp_image_map_tool_preview (GIMP_IMAGE_MAP_TOOL (hs_tool));
+ gimp_hue_saturation_config_reset_range (hs_tool->config);
}
static void
@@ -541,10 +572,6 @@
g_object_set (config,
"hue", value,
NULL);
-
- hue_saturation_update_color_areas (hs_tool);
-
- gimp_image_map_tool_preview (GIMP_IMAGE_MAP_TOOL (hs_tool));
}
}
@@ -560,10 +587,6 @@
g_object_set (config,
"lightness", value,
NULL);
-
- hue_saturation_update_color_areas (hs_tool);
-
- gimp_image_map_tool_preview (GIMP_IMAGE_MAP_TOOL (hs_tool));
}
}
@@ -579,10 +602,6 @@
g_object_set (config,
"saturation", value,
NULL);
-
- hue_saturation_update_color_areas (hs_tool);
-
- gimp_image_map_tool_preview (GIMP_IMAGE_MAP_TOOL (hs_tool));
}
}
@@ -598,9 +617,5 @@
g_object_set (config,
"overlap", value,
NULL);
-
- hue_saturation_update_color_areas (hs_tool);
-
- gimp_image_map_tool_preview (GIMP_IMAGE_MAP_TOOL (hs_tool));
}
}
Modified: branches/weskaggs/app/tools/gimpimagemaptool.c
==============================================================================
--- branches/weskaggs/app/tools/gimpimagemaptool.c (original)
+++ branches/weskaggs/app/tools/gimpimagemaptool.c Thu Jan 31 16:37:51 2008
@@ -26,6 +26,7 @@
#include <gdk/gdkkeysyms.h>
#include "libgimpbase/gimpbase.h"
+#include "libgimpconfig/gimpconfig.h"
#include "libgimpwidgets/gimpwidgets.h"
#include "tools-types.h"
@@ -163,6 +164,7 @@
image_map_tool->drawable = NULL;
image_map_tool->operation = NULL;
+ image_map_tool->config = NULL;
image_map_tool->image_map = NULL;
image_map_tool->shell = NULL;
@@ -187,7 +189,8 @@
klass = GIMP_IMAGE_MAP_TOOL_GET_CLASS (image_map_tool);
if (klass->get_operation)
- image_map_tool->operation = klass->get_operation (image_map_tool);
+ image_map_tool->operation = klass->get_operation (image_map_tool,
+ &image_map_tool->config);
return object;
}
@@ -203,6 +206,12 @@
image_map_tool->operation = NULL;
}
+ if (image_map_tool->config)
+ {
+ g_object_unref (image_map_tool->config);
+ image_map_tool->config = NULL;
+ }
+
if (image_map_tool->shell)
{
gtk_widget_destroy (image_map_tool->shell);
@@ -480,7 +489,14 @@
static void
gimp_image_map_tool_reset (GimpImageMapTool *tool)
{
- GIMP_IMAGE_MAP_TOOL_GET_CLASS (tool)->reset (tool);
+ if (GIMP_IMAGE_MAP_TOOL_GET_CLASS (tool)->reset)
+ {
+ GIMP_IMAGE_MAP_TOOL_GET_CLASS (tool)->reset (tool);
+ }
+ else if (tool->config)
+ {
+ gimp_config_reset (GIMP_CONFIG (tool->config));
+ }
}
static void
Modified: branches/weskaggs/app/tools/gimpimagemaptool.h
==============================================================================
--- branches/weskaggs/app/tools/gimpimagemaptool.h (original)
+++ branches/weskaggs/app/tools/gimpimagemaptool.h Thu Jan 31 16:37:51 2008
@@ -42,6 +42,7 @@
GimpDrawable *drawable;
GeglNode *operation;
+ GObject *config;
GimpImageMapApplyFunc apply_func;
gpointer apply_data;
@@ -69,7 +70,8 @@
const gchar *save_dialog_title;
/* virtual functions */
- GeglNode * (* get_operation) (GimpImageMapTool *image_map_tool);
+ GeglNode * (* get_operation) (GimpImageMapTool *image_map_tool,
+ GObject **config);
void (* map) (GimpImageMapTool *image_map_tool);
void (* dialog) (GimpImageMapTool *image_map_tool);
void (* reset) (GimpImageMapTool *image_map_tool);
Modified: branches/weskaggs/app/tools/gimplevelstool.c
==============================================================================
--- branches/weskaggs/app/tools/gimplevelstool.c (original)
+++ branches/weskaggs/app/tools/gimplevelstool.c Thu Jan 31 16:37:51 2008
@@ -22,6 +22,7 @@
#include <gtk/gtk.h>
#include "libgimpmath/gimpmath.h"
+#include "libgimpconfig/gimpconfig.h"
#include "libgimpwidgets/gimpwidgets.h"
#include "tools-types.h"
@@ -74,7 +75,8 @@
GimpRGB *color,
gint color_index);
-static GeglNode * gimp_levels_tool_get_operation (GimpImageMapTool *im_tool);
+static GeglNode * gimp_levels_tool_get_operation (GimpImageMapTool *im_tool,
+ GObject **config);
static void gimp_levels_tool_map (GimpImageMapTool *im_tool);
static void gimp_levels_tool_dialog (GimpImageMapTool *im_tool);
static void gimp_levels_tool_dialog_unmap (GtkWidget *dialog,
@@ -86,7 +88,10 @@
static gboolean gimp_levels_tool_settings_save (GimpImageMapTool *im_tool,
gpointer fp);
-static void levels_update_adjustments (GimpLevelsTool *tool);
+static void gimp_levels_tool_config_notify (GObject *object,
+ GParamSpec *pspec,
+ GimpLevelsTool *tool);
+
static void levels_update_input_bar (GimpLevelsTool *tool);
static void levels_channel_callback (GtkWidget *widget,
@@ -184,12 +189,6 @@
{
GimpLevelsTool *tool = GIMP_LEVELS_TOOL (object);
- if (tool->config)
- {
- g_object_unref (tool->config);
- tool->config = NULL;
- }
-
gimp_lut_free (tool->lut);
if (tool->hist)
@@ -219,11 +218,11 @@
return FALSE;
}
+ gimp_config_reset (GIMP_CONFIG (l_tool->config));
+
if (! l_tool->hist)
l_tool->hist = gimp_histogram_new ();
- gimp_levels_config_reset (l_tool->config);
-
l_tool->color = gimp_drawable_is_rgb (drawable);
l_tool->alpha = gimp_drawable_has_alpha (drawable);
@@ -236,11 +235,6 @@
gimp_int_combo_box_set_sensitivity (GIMP_INT_COMBO_BOX (l_tool->channel_menu),
levels_menu_sensitivity, l_tool, NULL);
- gimp_int_combo_box_set_active (GIMP_INT_COMBO_BOX (l_tool->channel_menu),
- l_tool->config->channel);
-
- levels_update_adjustments (l_tool);
-
gimp_drawable_calculate_histogram (drawable, l_tool->hist);
gimp_histogram_view_set_histogram (GIMP_HISTOGRAM_VIEW (l_tool->hist_view),
l_tool->hist);
@@ -249,7 +243,8 @@
}
static GeglNode *
-gimp_levels_tool_get_operation (GimpImageMapTool *im_tool)
+gimp_levels_tool_get_operation (GimpImageMapTool *im_tool,
+ GObject **config)
{
GimpLevelsTool *tool = GIMP_LEVELS_TOOL (im_tool);
GeglNode *node;
@@ -260,6 +255,12 @@
tool->config = g_object_new (GIMP_TYPE_LEVELS_CONFIG, NULL);
+ *config = G_OBJECT (tool->config);
+
+ g_signal_connect_object (tool->config, "notify",
+ G_CALLBACK (gimp_levels_tool_config_notify),
+ G_OBJECT (tool), 0);
+
gegl_node_set (node,
"config", tool->config,
NULL);
@@ -336,23 +337,24 @@
static void
gimp_levels_tool_dialog (GimpImageMapTool *image_map_tool)
{
- GimpLevelsTool *tool = GIMP_LEVELS_TOOL (image_map_tool);
- GimpToolOptions *tool_options = GIMP_TOOL_GET_OPTIONS (image_map_tool);
- GtkListStore *store;
- GtkWidget *vbox;
- GtkWidget *vbox2;
- GtkWidget *vbox3;
- GtkWidget *hbox;
- GtkWidget *hbox2;
- GtkWidget *label;
- GtkWidget *menu;
- GtkWidget *frame;
- GtkWidget *hbbox;
- GtkWidget *button;
- GtkWidget *spinbutton;
- GtkWidget *bar;
- GtkObject *data;
- gint border;
+ GimpLevelsTool *tool = GIMP_LEVELS_TOOL (image_map_tool);
+ GimpToolOptions *tool_options = GIMP_TOOL_GET_OPTIONS (image_map_tool);
+ GimpLevelsConfig *config = tool->config;
+ GtkListStore *store;
+ GtkWidget *vbox;
+ GtkWidget *vbox2;
+ GtkWidget *vbox3;
+ GtkWidget *hbox;
+ GtkWidget *hbox2;
+ GtkWidget *label;
+ GtkWidget *menu;
+ GtkWidget *frame;
+ GtkWidget *hbbox;
+ GtkWidget *button;
+ GtkWidget *spinbutton;
+ GtkWidget *bar;
+ GtkObject *data;
+ gint border;
/* The option menu for selecting channels */
hbox = gtk_hbox_new (FALSE, 6);
@@ -482,7 +484,9 @@
gtk_box_pack_start (GTK_BOX (hbox2), button, FALSE, FALSE, 0);
gtk_widget_show (button);
- spinbutton = gimp_spin_button_new (&data, 0, 0, 255, 1, 10, 10, 0.5, 0);
+ spinbutton = gimp_spin_button_new (&data,
+ config->low_input[config->channel] * 255.0,
+ 0, 255, 1, 10, 10, 0.5, 0);
gtk_box_pack_start (GTK_BOX (hbox2), spinbutton, FALSE, FALSE, 0);
gtk_widget_show (spinbutton);
@@ -495,7 +499,9 @@
tool->low_input);
/* input gamma spin */
- spinbutton = gimp_spin_button_new (&data, 1, 0.1, 10, 0.01, 0.1, 1, 0.5, 2);
+ spinbutton = gimp_spin_button_new (&data,
+ config->gamma[config->channel],
+ 0.1, 10, 0.01, 0.1, 1, 0.5, 2);
gtk_box_pack_start (GTK_BOX (hbox), spinbutton, TRUE, FALSE, 0);
gimp_help_set_help_data (spinbutton, _("Gamma"), NULL);
gtk_widget_show (spinbutton);
@@ -524,7 +530,9 @@
gtk_box_pack_start (GTK_BOX (hbox2), button, FALSE, FALSE, 0);
gtk_widget_show (button);
- spinbutton = gimp_spin_button_new (&data, 255, 0, 255, 1, 10, 10, 0.5, 0);
+ spinbutton = gimp_spin_button_new (&data,
+ config->high_input[config->channel] * 255.0,
+ 0, 255, 1, 10, 10, 0.5, 0);
gtk_box_pack_start (GTK_BOX (hbox2), spinbutton, FALSE, FALSE, 0);
gtk_widget_show (spinbutton);
@@ -584,7 +592,9 @@
gtk_widget_show (hbox);
/* low output spin */
- spinbutton = gimp_spin_button_new (&data, 0, 0, 255, 1, 10, 10, 0.5, 0);
+ spinbutton = gimp_spin_button_new (&data,
+ config->low_output[config->channel] * 255.0,
+ 0, 255, 1, 10, 10, 0.5, 0);
gtk_box_pack_start (GTK_BOX (hbox), spinbutton, FALSE, FALSE, 0);
gtk_widget_show (spinbutton);
@@ -597,7 +607,9 @@
tool->low_output);
/* high output spin */
- spinbutton = gimp_spin_button_new (&data, 255, 0, 255, 1, 10, 10, 0.5, 0);
+ spinbutton = gimp_spin_button_new (&data,
+ config->high_output[config->channel] * 255.0,
+ 0, 255, 1, 10, 10, 0.5, 0);
gtk_box_pack_end (GTK_BOX (hbox), spinbutton, FALSE, FALSE, 0);
gtk_widget_show (spinbutton);
@@ -664,6 +676,9 @@
g_signal_connect (image_map_tool->shell, "unmap",
G_CALLBACK (gimp_levels_tool_dialog_unmap),
tool);
+
+ gimp_int_combo_box_set_active (GIMP_INT_COMBO_BOX (tool->channel_menu),
+ config->channel);
}
static void
@@ -681,12 +696,14 @@
GimpLevelsTool *tool = GIMP_LEVELS_TOOL (image_map_tool);
GimpHistogramChannel channel = tool->config->channel;
- gimp_levels_config_reset (tool->config);
+ g_object_freeze_notify (G_OBJECT (tool->config));
+
+ gimp_config_reset (GIMP_CONFIG (tool->config));
g_object_set (tool->config,
"channel", channel,
NULL);
- levels_update_adjustments (tool);
+ g_object_thaw_notify (G_OBJECT (tool->config));
}
static gboolean
@@ -696,14 +713,7 @@
{
GimpLevelsTool *tool = GIMP_LEVELS_TOOL (image_map_tool);
- if (gimp_levels_config_load_cruft (tool->config, fp, error))
- {
- levels_update_adjustments (tool);
-
- return TRUE;
- }
-
- return FALSE;
+ return gimp_levels_config_load_cruft (tool->config, fp, error);
}
static gboolean
@@ -716,36 +726,62 @@
}
static void
-levels_update_adjustments (GimpLevelsTool *tool)
+gimp_levels_tool_config_notify (GObject *object,
+ GParamSpec *pspec,
+ GimpLevelsTool *tool)
{
- GimpLevelsConfig *config = tool->config;
+ GimpLevelsConfig *config = GIMP_LEVELS_CONFIG (object);
- tool->low_input->upper = 255;
- tool->high_input->lower = 0;
- tool->gamma_linear->lower = 0;
- tool->gamma_linear->upper = 255;
-
- gtk_adjustment_set_value (tool->low_input,
- config->low_input[config->channel] * 255.0);
- gtk_adjustment_set_value (tool->gamma,
- config->gamma[config->channel]);
- gtk_adjustment_set_value (tool->high_input,
- config->high_input[config->channel] * 255.0);
-
- tool->low_input->upper = tool->high_input->value;
- tool->high_input->lower = tool->low_input->value;
- tool->gamma_linear->lower = tool->low_input->value;
- tool->gamma_linear->upper = tool->high_input->value;
- gtk_adjustment_changed (tool->low_input);
- gtk_adjustment_changed (tool->high_input);
- gtk_adjustment_changed (tool->gamma_linear);
+ if (! tool->low_input)
+ return;
- gtk_adjustment_set_value (tool->low_output,
- config->low_output[config->channel] * 255.0);
- gtk_adjustment_set_value (tool->high_output,
- config->high_output[config->channel] * 255.0);
+ if (! strcmp (pspec->name, "channel"))
+ {
+ gimp_histogram_view_set_channel (GIMP_HISTOGRAM_VIEW (tool->hist_view),
+ config->channel);
+ gimp_color_bar_set_channel (GIMP_COLOR_BAR (tool->output_bar),
+ config->channel);
+ gimp_int_combo_box_set_active (GIMP_INT_COMBO_BOX (tool->channel_menu),
+ config->channel);
+ }
+ else if (! strcmp (pspec->name, "gamma") ||
+ ! strcmp (pspec->name, "low-input") ||
+ ! strcmp (pspec->name, "high-input"))
+ {
+ tool->low_input->upper = 255;
+ tool->high_input->lower = 0;
+ tool->gamma_linear->lower = 0;
+ tool->gamma_linear->upper = 255;
+
+ gtk_adjustment_set_value (tool->low_input,
+ config->low_input[config->channel] * 255.0);
+ gtk_adjustment_set_value (tool->gamma,
+ config->gamma[config->channel]);
+ gtk_adjustment_set_value (tool->high_input,
+ config->high_input[config->channel] * 255.0);
+
+ tool->low_input->upper = tool->high_input->value;
+ tool->high_input->lower = tool->low_input->value;
+ tool->gamma_linear->lower = tool->low_input->value;
+ tool->gamma_linear->upper = tool->high_input->value;
+ gtk_adjustment_changed (tool->low_input);
+ gtk_adjustment_changed (tool->high_input);
+ gtk_adjustment_changed (tool->gamma_linear);
- levels_update_input_bar (tool);
+ levels_update_input_bar (tool);
+ }
+ else if (! strcmp (pspec->name, "low-output"))
+ {
+ gtk_adjustment_set_value (tool->low_output,
+ config->low_output[config->channel] * 255.0);
+ }
+ else if (! strcmp (pspec->name, "high-output"))
+ {
+ gtk_adjustment_set_value (tool->high_output,
+ config->high_output[config->channel] * 255.0);
+ }
+
+ gimp_image_map_tool_preview (GIMP_IMAGE_MAP_TOOL (tool));
}
static void
@@ -809,18 +845,12 @@
{
gint value;
- if (gimp_int_combo_box_get_active (GIMP_INT_COMBO_BOX (widget), &value))
+ if (gimp_int_combo_box_get_active (GIMP_INT_COMBO_BOX (widget), &value) &&
+ tool->config->channel != value)
{
g_object_set (tool->config,
"channel", value,
NULL);
-
- gimp_histogram_view_set_channel (GIMP_HISTOGRAM_VIEW (tool->hist_view),
- tool->config->channel);
- gimp_color_bar_set_channel (GIMP_COLOR_BAR (tool->output_bar),
- tool->config->channel);
-
- levels_update_adjustments (tool);
}
}
@@ -828,10 +858,7 @@
levels_channel_reset_callback (GtkWidget *widget,
GimpLevelsTool *tool)
{
- gimp_levels_config_reset_channel (tool->config, tool->config->channel);
- levels_update_adjustments (tool);
-
- gimp_image_map_tool_preview (GIMP_IMAGE_MAP_TOOL (tool));
+ gimp_levels_config_reset_channel (tool->config);
}
static gboolean
@@ -866,9 +893,6 @@
GimpLevelsTool *tool)
{
gimp_levels_config_stretch (tool->config, tool->hist, tool->color);
- levels_update_adjustments (tool);
-
- gimp_image_map_tool_preview (GIMP_IMAGE_MAP_TOOL (tool));
}
static void
@@ -922,9 +946,6 @@
g_object_set (config,
"low-input", value / 255.0,
NULL);
- levels_update_input_bar (tool);
-
- gimp_image_map_tool_preview (GIMP_IMAGE_MAP_TOOL (tool));
}
levels_linear_gamma_update (tool);
@@ -941,9 +962,6 @@
g_object_set (config,
"gamma", adjustment->value,
NULL);
- levels_update_input_bar (tool);
-
- gimp_image_map_tool_preview (GIMP_IMAGE_MAP_TOOL (tool));
}
levels_linear_gamma_update (tool);
@@ -966,9 +984,6 @@
g_object_set (config,
"high-input", value / 255.0,
NULL);
- levels_update_input_bar (tool);
-
- gimp_image_map_tool_preview (GIMP_IMAGE_MAP_TOOL (tool));
}
levels_linear_gamma_update (tool);
@@ -986,8 +1001,6 @@
g_object_set (config,
"low-output", value / 255.0,
NULL);
-
- gimp_image_map_tool_preview (GIMP_IMAGE_MAP_TOOL (tool));
}
}
@@ -1003,8 +1016,6 @@
g_object_set (config,
"high-output", value / 255.0,
NULL);
-
- gimp_image_map_tool_preview (GIMP_IMAGE_MAP_TOOL (tool));
}
}
@@ -1102,8 +1113,4 @@
levels_input_adjust_by_color (tool->config,
value, tool->config->channel, color);
}
-
- levels_update_adjustments (tool);
-
- gimp_image_map_tool_preview (GIMP_IMAGE_MAP_TOOL (tool));
}
Modified: branches/weskaggs/app/tools/gimpposterizetool.c
==============================================================================
--- branches/weskaggs/app/tools/gimpposterizetool.c (original)
+++ branches/weskaggs/app/tools/gimpposterizetool.c Thu Jan 31 16:37:51 2008
@@ -21,6 +21,8 @@
#include <gegl.h>
#include <gtk/gtk.h>
+#include "libgimpmath/gimpmath.h"
+#include "libgimpconfig/gimpconfig.h"
#include "libgimpwidgets/gimpwidgets.h"
#include "tools-types.h"
@@ -28,6 +30,8 @@
#include "base/gimplut.h"
#include "base/lut-funcs.h"
+#include "gegl/gimpposterizeconfig.h"
+
#include "core/gimpdrawable.h"
#include "core/gimpimage.h"
@@ -41,8 +45,6 @@
#include "gimp-intl.h"
-#define POSTERIZE_DEFAULT_LEVELS 3
-
#define SLIDER_WIDTH 200
@@ -52,10 +54,14 @@
GimpDisplay *display,
GError **error);
-static GeglNode * gimp_posterize_tool_get_operation (GimpImageMapTool *im_tool);
+static GeglNode * gimp_posterize_tool_get_operation (GimpImageMapTool *im_tool,
+ GObject **config);
static void gimp_posterize_tool_map (GimpImageMapTool *im_tool);
static void gimp_posterize_tool_dialog (GimpImageMapTool *im_tool);
-static void gimp_posterize_tool_reset (GimpImageMapTool *im_tool);
+
+static void gimp_posterize_tool_config_notify (GObject *object,
+ GParamSpec *pspec,
+ GimpPosterizeTool *posterize_tool);
static void gimp_posterize_tool_levels_changed (GtkAdjustment *adjustment,
GimpPosterizeTool *posterize_tool);
@@ -99,7 +105,6 @@
im_tool_class->get_operation = gimp_posterize_tool_get_operation;
im_tool_class->map = gimp_posterize_tool_map;
im_tool_class->dialog = gimp_posterize_tool_dialog;
- im_tool_class->reset = gimp_posterize_tool_reset;
}
static void
@@ -107,8 +112,7 @@
{
GimpImageMapTool *im_tool = GIMP_IMAGE_MAP_TOOL (posterize_tool);
- posterize_tool->levels = POSTERIZE_DEFAULT_LEVELS;
- posterize_tool->lut = gimp_lut_new ();
+ posterize_tool->lut = gimp_lut_new ();
im_tool->apply_func = (GimpImageMapApplyFunc) gimp_lut_process;
im_tool->apply_data = posterize_tool->lut;
@@ -148,12 +152,12 @@
return FALSE;
}
- posterize_tool->levels = POSTERIZE_DEFAULT_LEVELS;
+ gimp_config_reset (GIMP_CONFIG (posterize_tool->config));
GIMP_TOOL_CLASS (parent_class)->initialize (tool, display, error);
gtk_adjustment_set_value (posterize_tool->levels_data,
- posterize_tool->levels);
+ posterize_tool->config->levels);
gimp_image_map_tool_preview (GIMP_IMAGE_MAP_TOOL (posterize_tool));
@@ -161,11 +165,29 @@
}
static GeglNode *
-gimp_posterize_tool_get_operation (GimpImageMapTool *im_tool)
+gimp_posterize_tool_get_operation (GimpImageMapTool *image_map_tool,
+ GObject **config)
{
- return g_object_new (GEGL_TYPE_NODE,
+ GimpPosterizeTool *posterize_tool = GIMP_POSTERIZE_TOOL (image_map_tool);
+ GeglNode *node;
+
+ node = g_object_new (GEGL_TYPE_NODE,
"operation", "gimp-posterize",
NULL);
+
+ posterize_tool->config = g_object_new (GIMP_TYPE_POSTERIZE_CONFIG, NULL);
+
+ *config = G_OBJECT (posterize_tool->config);
+
+ g_signal_connect_object (posterize_tool->config, "notify",
+ G_CALLBACK (gimp_posterize_tool_config_notify),
+ G_OBJECT (posterize_tool), 0);
+
+ gegl_node_set (node,
+ "config", posterize_tool->config,
+ NULL);
+
+ return node;
}
static void
@@ -173,12 +195,8 @@
{
GimpPosterizeTool *posterize_tool = GIMP_POSTERIZE_TOOL (image_map_tool);
- gegl_node_set (image_map_tool->operation,
- "levels", posterize_tool->levels,
- NULL);
-
posterize_lut_setup (posterize_tool->lut,
- posterize_tool->levels,
+ posterize_tool->config->levels,
gimp_drawable_bytes (image_map_tool->drawable));
}
@@ -204,7 +222,7 @@
data = gimp_scale_entry_new (GTK_TABLE (table), 0, 0,
_("Posterize _levels:"), SLIDER_WIDTH, -1,
- posterize_tool->levels,
+ posterize_tool->config->levels,
2.0, 256.0, 1.0, 10.0, 0,
TRUE, 0.0, 0.0,
NULL, NULL);
@@ -218,24 +236,31 @@
}
static void
-gimp_posterize_tool_reset (GimpImageMapTool *image_map_tool)
+gimp_posterize_tool_config_notify (GObject *object,
+ GParamSpec *pspec,
+ GimpPosterizeTool *posterize_tool)
{
- GimpPosterizeTool *posterize_tool = GIMP_POSTERIZE_TOOL (image_map_tool);
+ GimpPosterizeConfig *config = GIMP_POSTERIZE_CONFIG (object);
- posterize_tool->levels = POSTERIZE_DEFAULT_LEVELS;
+ if (! posterize_tool->levels_data)
+ return;
- gtk_adjustment_set_value (posterize_tool->levels_data,
- posterize_tool->levels);
+ gtk_adjustment_set_value (posterize_tool->levels_data, config->levels);
+
+ gimp_image_map_tool_preview (GIMP_IMAGE_MAP_TOOL (posterize_tool));
}
static void
gimp_posterize_tool_levels_changed (GtkAdjustment *adjustment,
GimpPosterizeTool *posterize_tool)
{
- if (posterize_tool->levels != adjustment->value)
- {
- posterize_tool->levels = adjustment->value;
+ GimpPosterizeConfig *config = posterize_tool->config;
+ gint value = ROUND (adjustment->value);
- gimp_image_map_tool_preview (GIMP_IMAGE_MAP_TOOL (posterize_tool));
+ if (config->levels != value)
+ {
+ g_object_set (config,
+ "levels", value,
+ NULL);
}
}
Modified: branches/weskaggs/app/tools/gimpposterizetool.h
==============================================================================
--- branches/weskaggs/app/tools/gimpposterizetool.h (original)
+++ branches/weskaggs/app/tools/gimpposterizetool.h Thu Jan 31 16:37:51 2008
@@ -36,13 +36,13 @@
struct _GimpPosterizeTool
{
- GimpImageMapTool parent_instance;
+ GimpImageMapTool parent_instance;
- gint levels;
- GimpLut *lut;
+ GimpPosterizeConfig *config;
+ GimpLut *lut;
/* dialog */
- GtkAdjustment *levels_data;
+ GtkAdjustment *levels_data;
};
struct _GimpPosterizeToolClass
Modified: branches/weskaggs/app/tools/gimpthresholdtool.c
==============================================================================
--- branches/weskaggs/app/tools/gimpthresholdtool.c (original)
+++ branches/weskaggs/app/tools/gimpthresholdtool.c Thu Jan 31 16:37:51 2008
@@ -21,6 +21,7 @@
#include <gegl.h>
#include <gtk/gtk.h>
+#include "libgimpconfig/gimpconfig.h"
#include "libgimpwidgets/gimpwidgets.h"
#include "tools-types.h"
@@ -54,10 +55,14 @@
GimpDisplay *display,
GError **error);
-static GeglNode * gimp_threshold_tool_get_operation (GimpImageMapTool *im_tool);
+static GeglNode * gimp_threshold_tool_get_operation (GimpImageMapTool *im_tool,
+ GObject **config);
static void gimp_threshold_tool_map (GimpImageMapTool *im_tool);
static void gimp_threshold_tool_dialog (GimpImageMapTool *im_tool);
-static void gimp_threshold_tool_reset (GimpImageMapTool *im_tool);
+
+static void gimp_threshold_tool_config_notify (GObject *object,
+ GParamSpec *pspec,
+ GimpThresholdTool *t_tool);
static void gimp_threshold_tool_histogram_range (GimpHistogramView *view,
gint start,
@@ -106,7 +111,6 @@
im_tool_class->get_operation = gimp_threshold_tool_get_operation;
im_tool_class->map = gimp_threshold_tool_map;
im_tool_class->dialog = gimp_threshold_tool_dialog;
- im_tool_class->reset = gimp_threshold_tool_reset;
}
static void
@@ -126,12 +130,6 @@
{
GimpThresholdTool *t_tool = GIMP_THRESHOLD_TOOL (object);
- if (t_tool->config)
- {
- g_object_unref (t_tool->config);
- t_tool->config = NULL;
- }
-
g_slice_free (Threshold, t_tool->threshold);
if (t_tool->hist)
@@ -161,11 +159,11 @@
return FALSE;
}
+ gimp_config_reset (GIMP_CONFIG (t_tool->config));
+
if (! t_tool->hist)
t_tool->hist = gimp_histogram_new ();
- gimp_threshold_config_reset (t_tool->config);
-
t_tool->threshold->color = gimp_drawable_is_rgb (drawable);
GIMP_TOOL_CLASS (parent_class)->initialize (tool, display, error);
@@ -190,7 +188,8 @@
}
static GeglNode *
-gimp_threshold_tool_get_operation (GimpImageMapTool *image_map_tool)
+gimp_threshold_tool_get_operation (GimpImageMapTool *image_map_tool,
+ GObject **config)
{
GimpThresholdTool *t_tool = GIMP_THRESHOLD_TOOL (image_map_tool);
GeglNode *node;
@@ -201,6 +200,12 @@
t_tool->config = g_object_new (GIMP_TYPE_THRESHOLD_CONFIG, NULL);
+ *config = G_OBJECT (t_tool->config);
+
+ g_signal_connect_object (t_tool->config, "notify",
+ G_CALLBACK (gimp_threshold_tool_config_notify),
+ G_OBJECT (t_tool), 0);
+
gegl_node_set (node,
"config", t_tool->config,
NULL);
@@ -273,15 +278,18 @@
}
static void
-gimp_threshold_tool_reset (GimpImageMapTool *image_map_tool)
-{
- GimpThresholdTool *t_tool = GIMP_THRESHOLD_TOOL (image_map_tool);
+gimp_threshold_tool_config_notify (GObject *object,
+ GParamSpec *pspec,
+ GimpThresholdTool *t_tool)
+{
+ GimpThresholdConfig *config = GIMP_THRESHOLD_CONFIG (object);
+
+ if (t_tool->histogram_box)
+ gimp_histogram_view_set_range (t_tool->histogram_box->view,
+ config->low * 255.999,
+ config->high * 255.999);
- gimp_threshold_config_reset (t_tool->config);
-
- gimp_histogram_view_set_range (t_tool->histogram_box->view,
- t_tool->config->low * 255.999,
- t_tool->config->high * 255.999);
+ gimp_image_map_tool_preview (GIMP_IMAGE_MAP_TOOL (t_tool));
}
static void
@@ -300,8 +308,6 @@
"low", low,
"high", high,
NULL);
-
- gimp_image_map_tool_preview (GIMP_IMAGE_MAP_TOOL (t_tool));
}
}
Modified: branches/weskaggs/app/widgets/gimphelp-ids.h
==============================================================================
--- branches/weskaggs/app/widgets/gimphelp-ids.h (original)
+++ branches/weskaggs/app/widgets/gimphelp-ids.h Thu Jan 31 16:37:51 2008
@@ -270,6 +270,7 @@
#define GIMP_HELP_TOOL_PENCIL "gimp-tool-pencil"
#define GIMP_HELP_TOOL_PERSPECTIVE "gimp-tool-perspective"
#define GIMP_HELP_TOOL_PERSPECTIVE_CLONE "gimp-tool-perspective-clone"
+#define GIMP_HELP_TOOL_POLYGON_SELECT "gimp-tool-polygon-select"
#define GIMP_HELP_TOOL_POSTERIZE "gimp-tool-posterize"
#define GIMP_HELP_TOOL_RECT_SELECT "gimp-tool-rect-select"
#define GIMP_HELP_TOOL_ROTATE "gimp-tool-rotate"
Modified: branches/weskaggs/app/widgets/gimphistogramview.c
==============================================================================
--- branches/weskaggs/app/widgets/gimphistogramview.c (original)
+++ branches/weskaggs/app/widgets/gimphistogramview.c Thu Jan 31 16:37:51 2008
@@ -623,7 +623,8 @@
{
g_return_if_fail (GIMP_IS_HISTOGRAM_VIEW (view));
- g_object_set (view, "histogram-channel", channel, NULL);
+ if (channel != view->channel)
+ g_object_set (view, "histogram-channel", channel, NULL);
}
GimpHistogramChannel
@@ -640,7 +641,8 @@
{
g_return_if_fail (GIMP_IS_HISTOGRAM_VIEW (view));
- g_object_set (view, "histogram-scale", scale, NULL);
+ if (scale != view->scale)
+ g_object_set (view, "histogram-scale", scale, NULL);
}
GimpHistogramScale
@@ -658,13 +660,17 @@
{
g_return_if_fail (GIMP_IS_HISTOGRAM_VIEW (view));
- view->start = MIN (start, end);
- view->end = MAX (start, end);
-
- gtk_widget_queue_draw (GTK_WIDGET (view));
-
- g_signal_emit (view, histogram_view_signals[RANGE_CHANGED], 0,
- view->start, view->end);
+ if (view->start != MIN (start, end) ||
+ view->end != MAX (start, end))
+ {
+ view->start = MIN (start, end);
+ view->end = MAX (start, end);
+
+ gtk_widget_queue_draw (GTK_WIDGET (view));
+
+ g_signal_emit (view, histogram_view_signals[RANGE_CHANGED], 0,
+ view->start, view->end);
+ }
}
void
Modified: branches/weskaggs/libgimpconfig/gimpconfig-serialize.c
==============================================================================
--- branches/weskaggs/libgimpconfig/gimpconfig-serialize.c (original)
+++ branches/weskaggs/libgimpconfig/gimpconfig-serialize.c Thu Jan 31 16:37:51 2008
@@ -143,9 +143,10 @@
}
/**
- * gimp_config_serialize_properties:
- * @config: a #GimpConfig.
- * @writer: a #GimpConfigWriter.
+ * gimp_config_serialize_property:
+ * @config: a #GimpConfig.
+ * @param_spec: a #GParamSpec.
+ * @writer: a #GimpConfigWriter.
*
* This function serializes a single object property to the @writer.
*
Modified: branches/weskaggs/libgimpwidgets/gimpstock.c
==============================================================================
--- branches/weskaggs/libgimpwidgets/gimpstock.c (original)
+++ branches/weskaggs/libgimpwidgets/gimpstock.c Thu Jan 31 16:37:51 2008
@@ -313,6 +313,7 @@
{ GIMP_STOCK_TOOL_PENCIL, NULL, 0, 0, LIBGIMP_DOMAIN },
{ GIMP_STOCK_TOOL_PERSPECTIVE, N_("_Transform"), 0, 0, LIBGIMP_DOMAIN },
{ GIMP_STOCK_TOOL_PERSPECTIVE_CLONE, NULL, 0, 0, LIBGIMP_DOMAIN },
+ { GIMP_STOCK_TOOL_POLYGON_SELECT, NULL, 0, 0, LIBGIMP_DOMAIN },
{ GIMP_STOCK_TOOL_POSTERIZE, NULL, 0, 0, LIBGIMP_DOMAIN },
{ GIMP_STOCK_TOOL_RECT_SELECT, NULL, 0, 0, LIBGIMP_DOMAIN },
{ GIMP_STOCK_TOOL_ROTATE, N_("_Rotate"), 0, 0, LIBGIMP_DOMAIN },
@@ -463,6 +464,7 @@
{ GIMP_STOCK_TOOL_PENCIL, stock_tool_pencil_22 },
{ GIMP_STOCK_TOOL_PERSPECTIVE, stock_tool_perspective_22 },
{ GIMP_STOCK_TOOL_PERSPECTIVE_CLONE, stock_tool_perspective_clone_22 },
+ { GIMP_STOCK_TOOL_POLYGON_SELECT, stock_tool_polygon_select_22 },
{ GIMP_STOCK_TOOL_POSTERIZE, stock_tool_posterize_22 },
{ GIMP_STOCK_TOOL_RECT_SELECT, stock_tool_rect_select_22 },
{ GIMP_STOCK_TOOL_ROTATE, stock_tool_rotate_22 },
@@ -624,6 +626,7 @@
{ GIMP_STOCK_TOOL_PENCIL, stock_tool_pencil_16 },
{ GIMP_STOCK_TOOL_PERSPECTIVE, stock_tool_perspective_16 },
{ GIMP_STOCK_TOOL_PERSPECTIVE_CLONE, stock_tool_perspective_clone_16 },
+ { GIMP_STOCK_TOOL_POLYGON_SELECT, stock_tool_polygon_select_16 },
{ GIMP_STOCK_TOOL_POSTERIZE, stock_tool_posterize_16 },
{ GIMP_STOCK_TOOL_RECT_SELECT, stock_tool_rect_select_16 },
{ GIMP_STOCK_TOOL_ROTATE, stock_tool_rotate_16 },
Modified: branches/weskaggs/libgimpwidgets/gimpstock.h
==============================================================================
--- branches/weskaggs/libgimpwidgets/gimpstock.h (original)
+++ branches/weskaggs/libgimpwidgets/gimpstock.h Thu Jan 31 16:37:51 2008
@@ -130,6 +130,7 @@
#define GIMP_STOCK_TOOL_PENCIL "gimp-tool-pencil"
#define GIMP_STOCK_TOOL_PERSPECTIVE "gimp-tool-perspective"
#define GIMP_STOCK_TOOL_PERSPECTIVE_CLONE "gimp-tool-perspective-clone"
+#define GIMP_STOCK_TOOL_POLYGON_SELECT "gimp-tool-polygon-select"
#define GIMP_STOCK_TOOL_POSTERIZE "gimp-tool-posterize"
#define GIMP_STOCK_TOOL_RECT_SELECT "gimp-tool-rect-select"
#define GIMP_STOCK_TOOL_ROTATE "gimp-tool-rotate"
Modified: branches/weskaggs/menus/image-menu.xml.in
==============================================================================
--- branches/weskaggs/menus/image-menu.xml.in (original)
+++ branches/weskaggs/menus/image-menu.xml.in Thu Jan 31 16:37:51 2008
@@ -494,6 +494,7 @@
<menuitem action="tools-rect-select" />
<menuitem action="tools-ellipse-select" />
<menuitem action="tools-free-select" />
+ <menuitem action="tools-polygon-select" />
<menuitem action="tools-foreground-select" />
<menuitem action="tools-fuzzy-select" />
<menuitem action="tools-by-color-select" />
Modified: branches/weskaggs/modules/controller_dx_dinput.c
==============================================================================
--- branches/weskaggs/modules/controller_dx_dinput.c (original)
+++ branches/weskaggs/modules/controller_dx_dinput.c Thu Jan 31 16:37:51 2008
@@ -64,7 +64,7 @@
#define NUM_EVENTS_PER_SLIDER 2 /* Slider decrease and increase */
#define NUM_EVENTS_PER_POV 3 /* POV view vector X and Y view and return */
-#define CONTROLLER_TYPE_DX_DINPUT (controller_dx_input_get_type ())
+#define CONTROLLER_TYPE_DX_DINPUT (controller_dx_dinput_get_type ())
#define CONTROLLER_DX_DINPUT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONTROLLER_TYPE_DX_DINPUT, ControllerDXDInput))
#define CONTROLLER_DX_DINPUT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONTROLLER_TYPE_DX_DINPUT, ControllerDXDInputClass))
#define CONTROLLER_IS_DX_DINPUT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONTROLLER_TYPE_DX_DINPUT))
@@ -161,7 +161,7 @@
};
-G_DEFINE_DYNAMIC_TYPE (ControllerDXInput, controller_dx_input,
+G_DEFINE_DYNAMIC_TYPE (ControllerDXDInput, controller_dx_dinput,
GIMP_TYPE_CONTROLLER)
@@ -240,7 +240,7 @@
dx_dinput_set_device (controller, NULL);
- G_OBJECT_CLASS (controller_dx_input_parent_class)->dispose (object);
+ G_OBJECT_CLASS (controller_dx_dinput_parent_class)->dispose (object);
}
static void
@@ -280,7 +280,7 @@
controller->store = NULL;
}
- G_OBJECT_CLASS (controller_dx_input_parent_class)->finalize (object);
+ G_OBJECT_CLASS (controller_dx_dinput_parent_class)->finalize (object);
}
static void
@@ -892,7 +892,6 @@
#undef BIT
g_print ("\n");
g_print (" dwFlags:");
-#define BIT(x) if (oformat->dwFlags & DIDOI_ASPECT##x) g_print (" DIDOI_ASPECT"#x)
switch (oformat->dwFlags & DIDOI_ASPECTACCEL)
{
case DIDOI_ASPECTPOSITION: g_print (" DIDOI_ASPECTPOSITION"); break;
Modified: branches/weskaggs/plug-ins/common/cubism.c
==============================================================================
--- branches/weskaggs/plug-ins/common/cubism.c (original)
+++ branches/weskaggs/plug-ins/common/cubism.c Thu Jan 31 16:37:51 2008
@@ -424,12 +424,13 @@
pr = gimp_pixel_rgns_process (pr))
{
count = src_rgn.w * src_rgn.h;
- dest = src_rgn.data;
+ dest = src_rgn.data;
while (count--)
for (i = 0; i < bytes; i++)
*dest++ = bg_col[i];
}
+
dest = NULL;
}
@@ -440,11 +441,10 @@
randomize_indices (num_tiles, random_indices);
- count = 0;
gimp_pixel_rgn_init (&src_rgn, drawable,
x1, y1, x2 - x1, y2 - y1, FALSE, FALSE);
- while (count < num_tiles)
+ for (count = 0; count < num_tiles; count++)
{
i = random_indices[count] / (cols + 1);
j = random_indices[count] % (cols + 1);
@@ -473,14 +473,13 @@
gimp_pixel_rgn_get_pixel (&src_rgn, col, ix, iy);
- if (!has_alpha || col[bytes - 1])
+ if (! has_alpha || col[bytes - 1])
fill_poly_color (&poly, drawable, preview, col, dest);
- count++;
- if (!preview)
+ if (! preview)
{
- if ((count % 5) == 0)
- gimp_progress_update ((double) count / (double) num_tiles);
+ if (count % 8 == 0)
+ gimp_progress_update ((gdouble) count / (gdouble) num_tiles);
}
}
@@ -510,17 +509,12 @@
{
gdouble r;
- if (!one_over_dist)
+ if (! one_over_dist)
return 1.0;
- else
- {
- r = (vec[0] * x + vec[1] * y) * one_over_dist;
- if (r < 0.2)
- r = 0.2;
- else if (r > 1.0)
- r = 1.0;
- }
- return r;
+
+ r = (vec[0] * x + vec[1] * y) * one_over_dist;
+
+ return CLAMP (r, 0.2, 1.0);
}
static void
@@ -611,8 +605,8 @@
if (poly->npts)
{
- gint poly_npts = poly->npts;
GimpVector2 *curptr;
+ gint poly_npts = poly->npts;
xs = (gint) (poly->pts[poly_npts-1].x);
ys = (gint) (poly->pts[poly_npts-1].y);
@@ -685,7 +679,10 @@
if (val > 0)
{
xx = (gdouble) j / (gdouble) SUPERSAMPLE + min_x;
- alpha = (gint) (val * calc_alpha_blend (vec, one_over_dist, xx - sx, yy - sy));
+ alpha = (gint) (val * calc_alpha_blend (vec,
+ one_over_dist,
+ xx - sx,
+ yy - sy));
if (preview)
{
for (b = 0; b < bytes; b++)
@@ -698,13 +695,13 @@
#ifndef USE_READABLE_BUT_SLOW_CODE
{
- guchar *buf_iter = buf,
- *col_iter = col,
- *buf_end = buf+bytes;
+ guchar *buf_iter = buf;
+ guchar *col_iter = col;
+ guchar *buf_end = buf + bytes;
for(; buf_iter < buf_end; buf_iter++, col_iter++)
- *buf_iter = ((guint)(*col_iter * alpha)
- + (((guint)*buf_iter)
+ *buf_iter = ((guint) (*col_iter * alpha)
+ + (((guint) *buf_iter)
* (256 - alpha))) >> 8;
}
#else /* original, pre-ECL code */
Modified: branches/weskaggs/plug-ins/common/lcms.c
==============================================================================
--- branches/weskaggs/plug-ins/common/lcms.c (original)
+++ branches/weskaggs/plug-ins/common/lcms.c Thu Jan 31 16:37:51 2008
@@ -795,8 +795,7 @@
if (! file)
{
- g_message (_("Could not open '%s' for reading: %s"),
- gimp_filename_to_utf8 (filename), error->message);
+ g_message (error->message);
g_error_free (error);
return FALSE;
@@ -948,7 +947,7 @@
break;
default:
- g_warning ("%s: unexpected bpp", G_GNUC_FUNCTION);
+ g_warning ("%s: unexpected bpp", G_STRLOC);
continue;
}
@@ -1100,9 +1099,7 @@
if (! file)
{
- g_message (_("Could not open '%s' for reading: %s"),
- gimp_filename_to_utf8 (filename),
- error->message);
+ g_message (error->message);
g_error_free (error);
return NULL;
@@ -1533,15 +1530,13 @@
&values->bpc);
}
- run = (gimp_dialog_run (GIMP_DIALOG (dialog)) == GTK_RESPONSE_OK);
-
- gtk_widget_hide (dialog);
-
- if (run)
+ while ((run = gimp_dialog_run (GIMP_DIALOG (dialog))) == GTK_RESPONSE_OK)
{
gchar *filename = gimp_color_profile_combo_box_get_active (box);
cmsHPROFILE dest_profile;
+ gtk_widget_set_sensitive (dialog, FALSE);
+
if (filename)
{
dest_profile = lcms_load_profile (filename, NULL);
@@ -1551,23 +1546,32 @@
dest_profile = cmsCreate_sRGBProfile ();
}
- if (lcms_icc_profile_is_rgb (dest_profile))
+ if (dest_profile)
{
- if (apply)
- success = lcms_image_apply_profile (image,
- src_profile, dest_profile,
- filename,
- values->intent, values->bpc);
+ if (lcms_icc_profile_is_rgb (dest_profile))
+ {
+ if (apply)
+ success = lcms_image_apply_profile (image,
+ src_profile, dest_profile,
+ filename,
+ values->intent,
+ values->bpc);
+ else
+ success = lcms_image_set_profile (image,
+ dest_profile, filename, TRUE);
+ }
else
- success = lcms_image_set_profile (image,
- dest_profile, filename, TRUE);
- }
- else
- {
- gimp_message (_("Destination profile is not for RGB color space."));
+ {
+ gimp_message (_("Destination profile is not for RGB color space."));
+ }
+
+ cmsCloseProfile (dest_profile);
}
- cmsCloseProfile (dest_profile);
+ if (success)
+ break;
+ else
+ gtk_widget_set_sensitive (dialog, TRUE);
}
gtk_widget_destroy (dialog);
Modified: branches/weskaggs/plug-ins/common/wmf.c
==============================================================================
--- branches/weskaggs/plug-ins/common/wmf.c (original)
+++ branches/weskaggs/plug-ins/common/wmf.c Thu Jan 31 16:37:51 2008
@@ -977,8 +977,7 @@
{
if (error)
{
- g_message (_("Could not open '%s' for reading: %s"),
- gimp_filename_to_utf8 (filename), error->message);
+ g_message (error->message);
g_error_free (error);
}
else
Modified: branches/weskaggs/plug-ins/gimpressionist/brush.c
==============================================================================
--- branches/weskaggs/plug-ins/gimpressionist/brush.c (original)
+++ branches/weskaggs/plug-ins/gimpressionist/brush.c Thu Jan 31 16:37:51 2008
@@ -1,3 +1,20 @@
+/* GIMP - The GNU Image Manipulation Program
+ * Copyright (C) 1995 Spencer Kimball and Peter Mattis
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
#include "config.h"
Modified: branches/weskaggs/plug-ins/gimpressionist/brush.h
==============================================================================
--- branches/weskaggs/plug-ins/gimpressionist/brush.h (original)
+++ branches/weskaggs/plug-ins/gimpressionist/brush.h Thu Jan 31 16:37:51 2008
@@ -1,3 +1,21 @@
+/* GIMP - The GNU Image Manipulation Program
+ * Copyright (C) 1995 Spencer Kimball and Peter Mattis
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
#ifndef __BRUSH_H
#define __BRUSH_H
Modified: branches/weskaggs/plug-ins/gimpressionist/color.c
==============================================================================
--- branches/weskaggs/plug-ins/gimpressionist/color.c (original)
+++ branches/weskaggs/plug-ins/gimpressionist/color.c Thu Jan 31 16:37:51 2008
@@ -1,3 +1,21 @@
+/* GIMP - The GNU Image Manipulation Program
+ * Copyright (C) 1995 Spencer Kimball and Peter Mattis
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
#include "config.h"
#include <gtk/gtk.h>
Modified: branches/weskaggs/plug-ins/gimpressionist/color.h
==============================================================================
--- branches/weskaggs/plug-ins/gimpressionist/color.h (original)
+++ branches/weskaggs/plug-ins/gimpressionist/color.h Thu Jan 31 16:37:51 2008
@@ -1,3 +1,21 @@
+/* GIMP - The GNU Image Manipulation Program
+ * Copyright (C) 1995 Spencer Kimball and Peter Mattis
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
#ifndef __COLOR_H
#define __COLOR_H
Modified: branches/weskaggs/plug-ins/gimpressionist/general.c
==============================================================================
--- branches/weskaggs/plug-ins/gimpressionist/general.c (original)
+++ branches/weskaggs/plug-ins/gimpressionist/general.c Thu Jan 31 16:37:51 2008
@@ -1,3 +1,21 @@
+/* GIMP - The GNU Image Manipulation Program
+ * Copyright (C) 1995 Spencer Kimball and Peter Mattis
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
#include "config.h"
#include <gtk/gtk.h>
Modified: branches/weskaggs/plug-ins/gimpressionist/general.h
==============================================================================
--- branches/weskaggs/plug-ins/gimpressionist/general.h (original)
+++ branches/weskaggs/plug-ins/gimpressionist/general.h Thu Jan 31 16:37:51 2008
@@ -1,3 +1,21 @@
+/* GIMP - The GNU Image Manipulation Program
+ * Copyright (C) 1995 Spencer Kimball and Peter Mattis
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
#ifndef __GENERAL_H
#define __GENERAL_H
Modified: branches/weskaggs/plug-ins/gimpressionist/gimp.c
==============================================================================
--- branches/weskaggs/plug-ins/gimpressionist/gimp.c (original)
+++ branches/weskaggs/plug-ins/gimpressionist/gimp.c Thu Jan 31 16:37:51 2008
@@ -1,3 +1,21 @@
+/* GIMP - The GNU Image Manipulation Program
+ * Copyright (C) 1995 Spencer Kimball and Peter Mattis
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
#include "config.h"
#include <string.h>
@@ -45,9 +63,7 @@
{
if (!PPM_IS_INITED (&infile))
grabarea ();
-#if 0
- updatepreview (NULL, (void *)2); /* Force grabarea () */
-#endif
+
ppm_copy (&infile, p);
}
@@ -217,233 +233,248 @@
grabarea (void)
{
GimpPixelRgn src_rgn;
- guchar *src_row;
- guchar *src;
- gint alpha, bpp;
- gboolean has_alpha;
- gint x, y;
ppm_t *p;
gint x1, y1, x2, y2;
+ gint x, y;
+ gint width, height;
gint row, col;
- int rowstride;
+ gint rowstride;
+ gpointer pr;
gimp_drawable_mask_bounds (drawable->drawable_id, &x1, &y1, &x2, &y2);
- bpp = gimp_drawable_bpp (drawable->drawable_id);
- has_alpha = gimp_drawable_has_alpha (drawable->drawable_id);
- alpha = (has_alpha) ? bpp - 1 : bpp;
+ width = x2 - x1;
+ height = y2 - y1;
- ppm_new (&infile, x2-x1, y2-y1);
+ ppm_new (&infile, width, height);
p = &infile;
- if (has_alpha)
- {
- ppm_new (&inalpha, x2-x1, y2-y1);
- }
- rowstride = p->width * 3;
+ if (gimp_drawable_has_alpha (drawable->drawable_id))
+ ppm_new (&inalpha, width, height);
- src_row = g_new (guchar, (x2 - x1) * bpp);
+ rowstride = p->width * 3;
- gimp_pixel_rgn_init (&src_rgn, drawable,
- 0, 0, x2 - x1, y2 - y1,
- FALSE, FALSE);
+ gimp_pixel_rgn_init (&src_rgn,
+ drawable, x1, y1, width, height, FALSE, FALSE);
- if (bpp == 3)
- { /* RGB */
- int bpr = (x2 - x1) * 3;
+ for (pr = gimp_pixel_rgns_register (1, &src_rgn);
+ pr != NULL;
+ pr = gimp_pixel_rgns_process (pr))
+ {
+ const guchar *src = src_rgn.data;
- for (row = 0, y = y1; y < y2; row++, y++)
+ switch (src_rgn.bpp)
{
- gimp_pixel_rgn_get_row (&src_rgn, src_row, x1, y, (x2 - x1));
- memcpy (p->col + row * rowstride, src_row, bpr);
- }
- }
- else if (bpp > 3)
- { /* RGBA */
- for (row = 0, y = y1; y < y2; row++, y++)
- {
- guchar *tmprow = p->col + row * rowstride;
- guchar *tmparow = inalpha.col + row * rowstride;
+ case 1:
+ for (y = 0, row = src_rgn.y - y1; y < src_rgn.h; y++, row++)
+ {
+ const guchar *s = src;
+ guchar *tmprow = p->col + row * rowstride;
+
+ for (x = 0, col = src_rgn.x - x1; x < src_rgn.w; x++, col++)
+ {
+ gint k = col * 3;
- gimp_pixel_rgn_get_row (&src_rgn, src_row, x1, y, (x2 - x1));
- src = src_row;
+ tmprow[k + 0] = s[0];
+ tmprow[k + 1] = s[0];
+ tmprow[k + 2] = s[0];
- for (col = 0, x = x1; x < x2; col++, x++)
+ s++;
+ }
+
+ src += src_rgn.rowstride;
+ }
+ break;
+
+ case 2:
+ for (y = 0, row = src_rgn.y - y1; y < src_rgn.h; y++, row++)
{
- int k = col * 3;
+ const guchar *s = src;
+ guchar *tmprow = p->col + row * rowstride;
+ guchar *tmparow = inalpha.col + row * rowstride;
+
+ for (x = 0, col = src_rgn.x - x1; x < src_rgn.w; x++, col++)
+ {
+ gint k = col * 3;
+
+ tmprow[k + 0] = s[0];
+ tmprow[k + 1] = s[0];
+ tmprow[k + 2] = s[0];
+ tmparow[k] = 255 - s[1];
+
+ s += 2;
+ }
- tmprow[k+0] = src[0];
- tmprow[k+1] = src[1];
- tmprow[k+2] = src[2];
- tmparow[k] = 255 - src[3];
- src += src_rgn.bpp;
+ src += src_rgn.rowstride;
}
- }
- }
- else if (bpp == 2)
- {
- /* GrayA */
- for (row = 0, y = y1; y < y2; row++, y++)
- {
- guchar *tmprow = p->col + row * rowstride;
- guchar *tmparow = inalpha.col + row * rowstride;
+ break;
- gimp_pixel_rgn_get_row (&src_rgn, src_row, x1, y, (x2 - x1));
- src = src_row;
+ case 3:
+ col = src_rgn.x - x1;
- for (col = 0, x = x1; x < x2; col++, x++)
+ for (y = 0, row = src_rgn.y - y1; y < src_rgn.h; y++, row++)
{
- int k = col * 3;
+ memcpy (p->col + row * rowstride + col * 3, src, src_rgn.w * 3);
- tmprow[k+0] = src[0];
- tmprow[k+1] = src[0];
- tmprow[k+2] = src[0];
- tmparow[k] = 255 - src[1];
- src += src_rgn.bpp;
+ src += src_rgn.rowstride;
}
- }
- }
- else
- { /* Gray */
- for (row = 0, y = y1; y < y2; row++, y++)
- {
- guchar *tmprow = p->col + row * rowstride;
+ break;
- gimp_pixel_rgn_get_row (&src_rgn, src_row, x1, y, (x2 - x1));
- src = src_row;
- for (col = 0, x = x1; x < x2; col++, x++)
+ case 4:
+ for (y = 0, row = src_rgn.y - y1; y < src_rgn.h; y++, row++)
{
- int k = col * 3;
+ const guchar *s = src;
+ guchar *tmprow = p->col + row * rowstride;
+ guchar *tmparow = inalpha.col + row * rowstride;
+
+ for (x = 0, col = src_rgn.x - x1; x < src_rgn.w; x++, col++)
+ {
+ gint k = col * 3;
+
+ tmprow[k + 0] = s[0];
+ tmprow[k + 1] = s[1];
+ tmprow[k + 2] = s[2];
+ tmparow[k] = 255 - s[3];
- tmprow[k+0] = src[0];
- tmprow[k+1] = src[0];
- tmprow[k+2] = src[0];
- src += src_rgn.bpp;
+ s += 4;
+ }
+
+ src += src_rgn.rowstride;
}
+ break;
}
}
- g_free (src_row);
}
static void
gimpressionist_main (void)
{
GimpPixelRgn dest_rgn;
- guchar *dest_row;
- guchar *dest;
- gint alpha, bpp;
- gboolean has_alpha;
- gint x, y;
ppm_t *p;
gint x1, y1, x2, y2;
+ gint x, y;
+ gint width, height;
gint row, col;
- int rowstride;
+ gint rowstride;
+ gint count;
+ glong done;
+ glong total;
+ gpointer pr;
gimp_drawable_mask_bounds (drawable->drawable_id, &x1, &y1, &x2, &y2);
- bpp = gimp_drawable_bpp (drawable->drawable_id);
- has_alpha = gimp_drawable_has_alpha (drawable->drawable_id);
- alpha = (has_alpha) ? bpp - 1 : bpp;
+ width = x2 - x1;
+ height = y2 - y1;
- dest_row = g_new (guchar, (x2 - x1) * bpp);
+ total = width * height;
gimp_progress_init (_("Painting"));
- if (!PPM_IS_INITED (&infile))
- {
- grabarea ();
- }
+ if (! PPM_IS_INITED (&infile))
+ grabarea ();
repaint (&infile, (img_has_alpha) ? &inalpha : NULL);
- gimp_pixel_rgn_init (&dest_rgn, drawable,
- 0, 0, x2 - x1, y2 - y1,
- TRUE, TRUE);
-
p = &infile;
rowstride = p->width * 3;
- if (bpp == 3)
- {
- int bpr = (x2 - x1) * 3;
+ gimp_pixel_rgn_init (&dest_rgn,
+ drawable, x1, y1, width, height, TRUE, TRUE);
- for (row = 0, y = y1; y < y2; row++, y++)
- {
- if (row % 10 == 0)
- gimp_progress_update (0.8 + 0.2 * ((double)row / (y2 - y1)));
- memcpy (dest_row, p->col + row * rowstride, bpr);
- gimp_pixel_rgn_set_row (&dest_rgn, dest_row, x1, y, (x2 - x1));
- }
- }
- else if (bpp == 4)
+ for (pr = gimp_pixel_rgns_register (1, &dest_rgn), count = 0, done = 0;
+ pr != NULL;
+ pr = gimp_pixel_rgns_process (pr), count++)
{
+ guchar *dest = dest_rgn.data;
- for (row = 0, y = y1; y < y2; row++, y++)
+ switch (dest_rgn.bpp)
{
- guchar *tmprow = p->col + row * rowstride;
+ case 1:
+ for (y = 0, row = dest_rgn.y - y1; y < dest_rgn.h; y++, row++)
+ {
+ guchar *d = dest;
+ const guchar *tmprow = p->col + row * rowstride;
- if (row % 10 == 0)
- gimp_progress_update (0.8 + 0.2 * ((double)row / (y2-y1)));
- dest = dest_row;
+ for (x = 0, col = dest_rgn.x - x1; x < dest_rgn.w; x++, col++)
+ {
+ gint k = col * 3;
+
+ *d++ = GIMP_RGB_LUMINANCE (tmprow[k + 0],
+ tmprow[k + 1],
+ tmprow[k + 2]);
+ }
- for (col = 0, x = x1; x < x2; col++, x++)
+ dest += dest_rgn.rowstride;
+ }
+ break;
+
+ case 2:
+ for (y = 0, row = dest_rgn.y - y1; y < dest_rgn.h; y++, row++)
{
- int k = col * 3;
+ guchar *d = dest;
+ const guchar *tmprow = p->col + row * rowstride;
+ const guchar *tmparow = inalpha.col + row * rowstride;
+
+ for (x = 0, col = dest_rgn.x - x1; x < dest_rgn.w; x++, col++)
+ {
+ gint k = col * 3;
+ gint value = GIMP_RGB_LUMINANCE (tmprow[k + 0],
+ tmprow[k + 1],
+ tmprow[k + 2]);
+
+ d[0] = value;
+ d[1] = 255 - tmparow[k];
+
+ d += 2;
+ }
- dest[0] = tmprow[k+0];
- dest[1] = tmprow[k+1];
- dest[2] = tmprow[k+2];
- dest[3] = 255 - inalpha.col[row * rowstride + k];
- dest += dest_rgn.bpp;
+ dest += dest_rgn.rowstride;
}
- gimp_pixel_rgn_set_row (&dest_rgn, dest_row, x1, y, (x2 - x1));
- }
- }
- else if (bpp == 2)
- {
- for (row = 0, y = y1; y < y2; row++, y++)
- {
- guchar *tmprow = p->col + row * rowstride;
+ break;
- if (row % 10 == 0)
- gimp_progress_update (0.8 + 0.2 * ((double)row / (y2-y1)));
- dest = dest_row;
+ case 3:
+ col = dest_rgn.x - x1;
- for (col = 0, x = x1; x < x2; col++, x++)
+ for (y = 0, row = dest_rgn.y - y1; y < dest_rgn.h; y++, row++)
{
- int k = col * 3;
+ memcpy (dest, p->col + row * rowstride + col * 3, dest_rgn.w * 3);
- dest[0] = (tmprow[k+0] + tmprow[k+1] + tmprow[k+2]) / 3;
- dest[1] = 255 - inalpha.col[row * rowstride + k];
- dest += dest_rgn.bpp;
+ dest += dest_rgn.rowstride;
}
- gimp_pixel_rgn_set_row (&dest_rgn, dest_row, x1, y, (x2 - x1));
- }
- }
- else
- {
- for (row = 0, y = y1; y < y2; row++, y++)
- {
- guchar *tmprow = p->col + row * rowstride;
-
- if (row % 10 == 0)
- gimp_progress_update (0.8 + 0.2 * ((double)row / (y2-y1)));
- dest = dest_row;
+ break;
- for (col = 0, x = x1; x < x2; col++, x++)
+ case 4:
+ for (y = 0, row = dest_rgn.y - y1; y < dest_rgn.h; y++, row++)
{
- int k = col * 3;
- dest[0] = (tmprow[k+0] + tmprow[k+1] + tmprow[k+2]) / 3;
- dest += dest_rgn.bpp;
+ guchar *d = dest;
+ const guchar *tmprow = p->col + row * rowstride;
+ const guchar *tmparow = inalpha.col + row * rowstride;
+
+ for (x = 0, col = dest_rgn.x - x1; x < dest_rgn.w; x++, col++)
+ {
+ gint k = col * 3;
+
+ d[0] = tmprow[k + 0];
+ d[1] = tmprow[k + 1];
+ d[2] = tmprow[k + 2];
+ d[3] = 255 - tmparow[k];
+
+ d += 4;
+ }
+
+ dest += dest_rgn.rowstride;
}
- gimp_pixel_rgn_set_row (&dest_rgn, dest_row, x1, y, (x2 - x1));
+ break;
}
- }
- g_free (dest_row);
+ done += dest_rgn.w * dest_rgn.h;
+
+ if (count % 16 == 0)
+ gimp_progress_update (0.8 + 0.2 * done / total);
+ }
gimp_drawable_flush (drawable);
gimp_drawable_merge_shadow (drawable->drawable_id, TRUE);
- gimp_drawable_update (drawable->drawable_id, x1, y1, (x2 - x1), (y2 - y1));
+ gimp_drawable_update (drawable->drawable_id, x1, y1, width, height);
}
Modified: branches/weskaggs/plug-ins/gimpressionist/gimpressionist.c
==============================================================================
--- branches/weskaggs/plug-ins/gimpressionist/gimpressionist.c (original)
+++ branches/weskaggs/plug-ins/gimpressionist/gimpressionist.c Thu Jan 31 16:37:51 2008
@@ -1,3 +1,21 @@
+/* GIMP - The GNU Image Manipulation Program
+ * Copyright (C) 1995 Spencer Kimball and Peter Mattis
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
#include "config.h"
#include <libgimp/gimp.h>
Modified: branches/weskaggs/plug-ins/gimpressionist/gimpressionist.h
==============================================================================
--- branches/weskaggs/plug-ins/gimpressionist/gimpressionist.h (original)
+++ branches/weskaggs/plug-ins/gimpressionist/gimpressionist.h Thu Jan 31 16:37:51 2008
@@ -1,3 +1,20 @@
+/* GIMP - The GNU Image Manipulation Program
+ * Copyright (C) 1995 Spencer Kimball and Peter Mattis
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
#ifndef __GIMPRESSIONIST_H
#define __GIMPRESSIONIST_H
Modified: branches/weskaggs/plug-ins/gimpressionist/globals.c
==============================================================================
--- branches/weskaggs/plug-ins/gimpressionist/globals.c (original)
+++ branches/weskaggs/plug-ins/gimpressionist/globals.c Thu Jan 31 16:37:51 2008
@@ -1,3 +1,21 @@
+/* GIMP - The GNU Image Manipulation Program
+ * Copyright (C) 1995 Spencer Kimball and Peter Mattis
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
#include "config.h"
#include <libgimp/gimp.h>
Modified: branches/weskaggs/plug-ins/gimpressionist/infile.h
==============================================================================
--- branches/weskaggs/plug-ins/gimpressionist/infile.h (original)
+++ branches/weskaggs/plug-ins/gimpressionist/infile.h Thu Jan 31 16:37:51 2008
@@ -1,3 +1,21 @@
+/* GIMP - The GNU Image Manipulation Program
+ * Copyright (C) 1995 Spencer Kimball and Peter Mattis
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
#ifndef __INFILE_H
#define __INFILE_H
Modified: branches/weskaggs/plug-ins/gimpressionist/orientation.c
==============================================================================
--- branches/weskaggs/plug-ins/gimpressionist/orientation.c (original)
+++ branches/weskaggs/plug-ins/gimpressionist/orientation.c Thu Jan 31 16:37:51 2008
@@ -1,3 +1,21 @@
+/* GIMP - The GNU Image Manipulation Program
+ * Copyright (C) 1995 Spencer Kimball and Peter Mattis
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
#include "config.h"
#include <gtk/gtk.h>
Modified: branches/weskaggs/plug-ins/gimpressionist/orientation.h
==============================================================================
--- branches/weskaggs/plug-ins/gimpressionist/orientation.h (original)
+++ branches/weskaggs/plug-ins/gimpressionist/orientation.h Thu Jan 31 16:37:51 2008
@@ -1,3 +1,21 @@
+/* GIMP - The GNU Image Manipulation Program
+ * Copyright (C) 1995 Spencer Kimball and Peter Mattis
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
#ifndef __ORIENTATION_H
#define __ORIENTATION_H
Modified: branches/weskaggs/plug-ins/gimpressionist/orientmap.c
==============================================================================
--- branches/weskaggs/plug-ins/gimpressionist/orientmap.c (original)
+++ branches/weskaggs/plug-ins/gimpressionist/orientmap.c Thu Jan 31 16:37:51 2008
@@ -1,3 +1,21 @@
+/* GIMP - The GNU Image Manipulation Program
+ * Copyright (C) 1995 Spencer Kimball and Peter Mattis
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
#include "config.h"
#include <gtk/gtk.h>
Modified: branches/weskaggs/plug-ins/gimpressionist/orientmap.h
==============================================================================
--- branches/weskaggs/plug-ins/gimpressionist/orientmap.h (original)
+++ branches/weskaggs/plug-ins/gimpressionist/orientmap.h Thu Jan 31 16:37:51 2008
@@ -1,5 +1,24 @@
+/* GIMP - The GNU Image Manipulation Program
+ * Copyright (C) 1995 Spencer Kimball and Peter Mattis
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
#ifndef __ORIENTMAP_H
#define __ORIENTMAP_H
+
void create_orientmap_dialog (GtkWidget *parent);
void update_orientmap_dialog (void);
void orientation_map_free_resources(void);
Modified: branches/weskaggs/plug-ins/gimpressionist/paper.c
==============================================================================
--- branches/weskaggs/plug-ins/gimpressionist/paper.c (original)
+++ branches/weskaggs/plug-ins/gimpressionist/paper.c Thu Jan 31 16:37:51 2008
@@ -1,3 +1,21 @@
+/* GIMP - The GNU Image Manipulation Program
+ * Copyright (C) 1995 Spencer Kimball and Peter Mattis
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
#include "config.h"
#include <string.h>
Modified: branches/weskaggs/plug-ins/gimpressionist/paper.h
==============================================================================
--- branches/weskaggs/plug-ins/gimpressionist/paper.h (original)
+++ branches/weskaggs/plug-ins/gimpressionist/paper.h Thu Jan 31 16:37:51 2008
@@ -1,3 +1,21 @@
+/* GIMP - The GNU Image Manipulation Program
+ * Copyright (C) 1995 Spencer Kimball and Peter Mattis
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
#ifndef __PAPER_H
#define __PAPER_H
Modified: branches/weskaggs/plug-ins/gimpressionist/placement.c
==============================================================================
--- branches/weskaggs/plug-ins/gimpressionist/placement.c (original)
+++ branches/weskaggs/plug-ins/gimpressionist/placement.c Thu Jan 31 16:37:51 2008
@@ -1,3 +1,21 @@
+/* GIMP - The GNU Image Manipulation Program
+ * Copyright (C) 1995 Spencer Kimball and Peter Mattis
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
#include "config.h"
#include <gtk/gtk.h>
Modified: branches/weskaggs/plug-ins/gimpressionist/placement.h
==============================================================================
--- branches/weskaggs/plug-ins/gimpressionist/placement.h (original)
+++ branches/weskaggs/plug-ins/gimpressionist/placement.h Thu Jan 31 16:37:51 2008
@@ -1,3 +1,21 @@
+/* GIMP - The GNU Image Manipulation Program
+ * Copyright (C) 1995 Spencer Kimball and Peter Mattis
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
#ifndef __PLACEMENT_H
#define __PLACEMENT_H
Modified: branches/weskaggs/plug-ins/gimpressionist/plasma.c
==============================================================================
--- branches/weskaggs/plug-ins/gimpressionist/plasma.c (original)
+++ branches/weskaggs/plug-ins/gimpressionist/plasma.c Thu Jan 31 16:37:51 2008
@@ -1,3 +1,21 @@
+/* GIMP - The GNU Image Manipulation Program
+ * Copyright (C) 1995 Spencer Kimball and Peter Mattis
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
#include "config.h"
#include <stdlib.h>
Modified: branches/weskaggs/plug-ins/gimpressionist/ppmtool.c
==============================================================================
--- branches/weskaggs/plug-ins/gimpressionist/ppmtool.c (original)
+++ branches/weskaggs/plug-ins/gimpressionist/ppmtool.c Thu Jan 31 16:37:51 2008
@@ -1,3 +1,21 @@
+/* GIMP - The GNU Image Manipulation Program
+ * Copyright (C) 1995 Spencer Kimball and Peter Mattis
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
#include "config.h"
#include <string.h>
Modified: branches/weskaggs/plug-ins/gimpressionist/ppmtool.h
==============================================================================
--- branches/weskaggs/plug-ins/gimpressionist/ppmtool.h (original)
+++ branches/weskaggs/plug-ins/gimpressionist/ppmtool.h Thu Jan 31 16:37:51 2008
@@ -1,3 +1,21 @@
+/* GIMP - The GNU Image Manipulation Program
+ * Copyright (C) 1995 Spencer Kimball and Peter Mattis
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
#ifndef __PPM_TOOL_H
#define __PPM_TOOL_H
Modified: branches/weskaggs/plug-ins/gimpressionist/presets.c
==============================================================================
--- branches/weskaggs/plug-ins/gimpressionist/presets.c (original)
+++ branches/weskaggs/plug-ins/gimpressionist/presets.c Thu Jan 31 16:37:51 2008
@@ -1,3 +1,21 @@
+/* GIMP - The GNU Image Manipulation Program
+ * Copyright (C) 1995 Spencer Kimball and Peter Mattis
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
#include "config.h"
#include <string.h>
Modified: branches/weskaggs/plug-ins/gimpressionist/presets.h
==============================================================================
--- branches/weskaggs/plug-ins/gimpressionist/presets.h (original)
+++ branches/weskaggs/plug-ins/gimpressionist/presets.h Thu Jan 31 16:37:51 2008
@@ -1,3 +1,21 @@
+/* GIMP - The GNU Image Manipulation Program
+ * Copyright (C) 1995 Spencer Kimball and Peter Mattis
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
#ifndef __PRESETS_H
#define __PRESETS_H
Modified: branches/weskaggs/plug-ins/gimpressionist/preview.c
==============================================================================
--- branches/weskaggs/plug-ins/gimpressionist/preview.c (original)
+++ branches/weskaggs/plug-ins/gimpressionist/preview.c Thu Jan 31 16:37:51 2008
@@ -1,3 +1,21 @@
+/* GIMP - The GNU Image Manipulation Program
+ * Copyright (C) 1995 Spencer Kimball and Peter Mattis
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
#include "config.h"
#include <string.h>
@@ -74,79 +92,49 @@
void
updatepreview (GtkWidget *wg, gpointer d)
{
- /* This portion is remmed out because of the remming out of the
- * code below.
- * -- Shlomi Fish
- * */
-#if 0
- guchar buf[PREVIEWSIZE*3];
-
- if (!PPM_IS_INITED (&infile) && d)
- grabarea();
-#endif
-
- /* It seems that infile.col must be true here. (after grabarea() that is.)
- * Thus, I'm removing this entire portion of the code in hope that
- * it works OK afterwards.
- * -- Shlomi Fish
- * */
-#if 0
- if (!PPM_IS_INITED (&infile) && !d) {
- guchar *buffer;
-
- buffer = g_new0 (guchar, 3*PREVIEWSIZE*PREVIEWSIZE);
- gimp_preview_area_draw (GIMP_PREVIEW_AREA (preview),
- 0, 0, PREVIEWSIZE, PREVIEWSIZE,
- GIMP_RGB_IMAGE,
- buffer,
- PREVIEWSIZE * 3);
-
- g_free (buffer);
- }
- else
-#endif
- {
- if (!PPM_IS_INITED (&backup_ppm))
- {
- infile_copy_to_ppm (&backup_ppm);
- if ((backup_ppm.width != PREVIEWSIZE) ||
- (backup_ppm.height != PREVIEWSIZE))
- resize_fast (&backup_ppm, PREVIEWSIZE, PREVIEWSIZE);
- if (img_has_alpha)
- {
- infile_copy_alpha_to_ppm (&alpha_backup_ppm);
- if ((alpha_backup_ppm.width != PREVIEWSIZE) ||
- (alpha_backup_ppm.height != PREVIEWSIZE))
- resize_fast (&alpha_backup_ppm, PREVIEWSIZE, PREVIEWSIZE);
- }
- }
- if (!PPM_IS_INITED (&preview_ppm))
- {
- ppm_copy (&backup_ppm, &preview_ppm);
-
- if (img_has_alpha)
- ppm_copy (&alpha_backup_ppm, &alpha_ppm);
- }
- if (d)
- {
- store_values ();
-
- if (GPOINTER_TO_INT (d) != 2)
- repaint (&preview_ppm, &alpha_ppm);
- }
+ if (!PPM_IS_INITED (&backup_ppm))
+ {
+ infile_copy_to_ppm (&backup_ppm);
+ if ((backup_ppm.width != PREVIEWSIZE) ||
+ (backup_ppm.height != PREVIEWSIZE))
+ resize_fast (&backup_ppm, PREVIEWSIZE, PREVIEWSIZE);
if (img_has_alpha)
- drawalpha (&preview_ppm, &alpha_ppm);
+ {
+ infile_copy_alpha_to_ppm (&alpha_backup_ppm);
+ if ((alpha_backup_ppm.width != PREVIEWSIZE) ||
+ (alpha_backup_ppm.height != PREVIEWSIZE))
+ resize_fast (&alpha_backup_ppm, PREVIEWSIZE, PREVIEWSIZE);
+ }
+ }
- gimp_preview_area_draw (GIMP_PREVIEW_AREA (preview),
- 0, 0, PREVIEWSIZE, PREVIEWSIZE,
- GIMP_RGB_IMAGE,
- preview_ppm.col,
- PREVIEWSIZE * 3);
+ if (!PPM_IS_INITED (&preview_ppm))
+ {
+ ppm_copy (&backup_ppm, &preview_ppm);
- ppm_kill (&preview_ppm);
if (img_has_alpha)
- ppm_kill (&alpha_ppm);
+ ppm_copy (&alpha_backup_ppm, &alpha_ppm);
+ }
+
+ if (d)
+ {
+ store_values ();
+
+ if (GPOINTER_TO_INT (d) != 2)
+ repaint (&preview_ppm, &alpha_ppm);
}
+
+ if (img_has_alpha)
+ drawalpha (&preview_ppm, &alpha_ppm);
+
+ gimp_preview_area_draw (GIMP_PREVIEW_AREA (preview),
+ 0, 0, PREVIEWSIZE, PREVIEWSIZE,
+ GIMP_RGB_IMAGE,
+ preview_ppm.col,
+ PREVIEWSIZE * 3);
+
+ ppm_kill (&preview_ppm);
+ if (img_has_alpha)
+ ppm_kill (&alpha_ppm);
}
static void
Modified: branches/weskaggs/plug-ins/gimpressionist/preview.h
==============================================================================
--- branches/weskaggs/plug-ins/gimpressionist/preview.h (original)
+++ branches/weskaggs/plug-ins/gimpressionist/preview.h Thu Jan 31 16:37:51 2008
@@ -1,3 +1,21 @@
+/* GIMP - The GNU Image Manipulation Program
+ * Copyright (C) 1995 Spencer Kimball and Peter Mattis
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
#ifndef __PREVIEW_H
#define __PREVIEW_H
Modified: branches/weskaggs/plug-ins/gimpressionist/random.h
==============================================================================
--- branches/weskaggs/plug-ins/gimpressionist/random.h (original)
+++ branches/weskaggs/plug-ins/gimpressionist/random.h Thu Jan 31 16:37:51 2008
@@ -1,3 +1,21 @@
+/* GIMP - The GNU Image Manipulation Program
+ * Copyright (C) 1995 Spencer Kimball and Peter Mattis
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
#ifndef __RAND_H
#define __RAND_H
Modified: branches/weskaggs/plug-ins/gimpressionist/repaint.c
==============================================================================
--- branches/weskaggs/plug-ins/gimpressionist/repaint.c (original)
+++ branches/weskaggs/plug-ins/gimpressionist/repaint.c Thu Jan 31 16:37:51 2008
@@ -1,3 +1,21 @@
+/* GIMP - The GNU Image Manipulation Program
+ * Copyright (C) 1995 Spencer Kimball and Peter Mattis
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
#include "config.h"
#include <stdlib.h>
Modified: branches/weskaggs/plug-ins/gimpressionist/size.c
==============================================================================
--- branches/weskaggs/plug-ins/gimpressionist/size.c (original)
+++ branches/weskaggs/plug-ins/gimpressionist/size.c Thu Jan 31 16:37:51 2008
@@ -1,3 +1,21 @@
+/* GIMP - The GNU Image Manipulation Program
+ * Copyright (C) 1995 Spencer Kimball and Peter Mattis
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
#include "config.h"
#include <gtk/gtk.h>
Modified: branches/weskaggs/plug-ins/gimpressionist/size.h
==============================================================================
--- branches/weskaggs/plug-ins/gimpressionist/size.h (original)
+++ branches/weskaggs/plug-ins/gimpressionist/size.h Thu Jan 31 16:37:51 2008
@@ -1,3 +1,21 @@
+/* GIMP - The GNU Image Manipulation Program
+ * Copyright (C) 1995 Spencer Kimball and Peter Mattis
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
#ifndef __SIZE_H
#define __SIZE_H
Modified: branches/weskaggs/plug-ins/gimpressionist/sizemap.c
==============================================================================
--- branches/weskaggs/plug-ins/gimpressionist/sizemap.c (original)
+++ branches/weskaggs/plug-ins/gimpressionist/sizemap.c Thu Jan 31 16:37:51 2008
@@ -1,3 +1,21 @@
+/* GIMP - The GNU Image Manipulation Program
+ * Copyright (C) 1995 Spencer Kimball and Peter Mattis
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
#include "config.h"
#include <gtk/gtk.h>
Modified: branches/weskaggs/plug-ins/gimpressionist/utils.c
==============================================================================
--- branches/weskaggs/plug-ins/gimpressionist/utils.c (original)
+++ branches/weskaggs/plug-ins/gimpressionist/utils.c Thu Jan 31 16:37:51 2008
@@ -1,7 +1,26 @@
+/* GIMP - The GNU Image Manipulation Program
+ * Copyright (C) 1995 Spencer Kimball and Peter Mattis
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
/*
* utils.c - various utility routines that don't fit anywhere else. Usually
* these routines don't affect the state of the program.
- * */
+ */
+
#include "config.h"
#include <string.h>
Modified: branches/weskaggs/plug-ins/pygimp/gimpmodule.c
==============================================================================
--- branches/weskaggs/plug-ins/pygimp/gimpmodule.c (original)
+++ branches/weskaggs/plug-ins/pygimp/gimpmodule.c Thu Jan 31 16:37:51 2008
@@ -837,30 +837,12 @@
GimpRGB rgb;
if (PyArg_ParseTuple(args, "O:set_background", &color)) {
- if (! pygimp_rgb_from_pyobject (color, &rgb)) {
- PyErr_Clear();
- PyArg_ParseTuple(args, "O!:set_background", PyGimpRGB_Type, &color);
+ if (!pygimp_rgb_from_pyobject(color, &rgb))
return NULL;
- }
} else {
- int r, g, b;
-
PyErr_Clear();
- if (!PyArg_ParseTuple(args, "(iii):set_background", &r, &g, &b)) {
- PyErr_Clear();
- if (!PyArg_ParseTuple(args, "iii:set_background", &r, &g, &b)) {
- PyErr_Clear();
- PyArg_ParseTuple(args, "O!:set_background",
- PyGimpRGB_Type, &color);
- return NULL;
- }
- }
-
- r = CLAMP(r, 0, 255);
- g = CLAMP(g, 0, 255);
- b = CLAMP(b, 0, 255);
-
- gimp_rgba_set_uchar(&rgb, r, g, b, 255);
+ if (!pygimp_rgb_from_pyobject(args, &rgb))
+ return NULL;
}
gimp_context_set_background(&rgb);
@@ -876,30 +858,12 @@
GimpRGB rgb;
if (PyArg_ParseTuple(args, "O:set_foreground", &color)) {
- if (! pygimp_rgb_from_pyobject (color, &rgb)) {
- PyErr_Clear();
- PyArg_ParseTuple(args, "O!:set_foreground", PyGimpRGB_Type, &color);
+ if (!pygimp_rgb_from_pyobject(color, &rgb))
return NULL;
- }
} else {
- int r, g, b;
-
PyErr_Clear();
- if (!PyArg_ParseTuple(args, "(iii):set_foreground", &r, &g, &b)) {
- PyErr_Clear();
- if (!PyArg_ParseTuple(args, "iii:set_foreground", &r, &g, &b)) {
- PyErr_Clear();
- PyArg_ParseTuple(args, "O!:set_foreground",
- PyGimpRGB_Type, &color);
- return NULL;
- }
- }
-
- r = CLAMP(r, 0, 255);
- g = CLAMP(g, 0, 255);
- b = CLAMP(b, 0, 255);
-
- gimp_rgba_set_uchar(&rgb, r, g, b, 255);
+ if (!pygimp_rgb_from_pyobject(args, &rgb))
+ return NULL;
}
gimp_context_set_foreground(&rgb);
Modified: branches/weskaggs/plug-ins/pygimp/pygimp-colors.c
==============================================================================
--- branches/weskaggs/plug-ins/pygimp/pygimp-colors.c (original)
+++ branches/weskaggs/plug-ins/pygimp/pygimp-colors.c Thu Jan 31 16:37:51 2008
@@ -2372,7 +2372,6 @@
return 0;
}
} else if (PySequence_Check(object)) {
- GimpRGB rgb;
PyObject *r, *g, *b, *a = NULL;
if (!PyArg_ParseTuple(object, "OOO|O", &r, &g, &b, &a))
@@ -2380,13 +2379,13 @@
#define SET_MEMBER(m) G_STMT_START { \
if (PyInt_Check(m)) \
- rgb.m = (double) PyInt_AS_LONG(m) / 255.0; \
+ color->m = (double) PyInt_AS_LONG(m) / 255.0; \
else if (PyFloat_Check(m)) \
- rgb.m = PyFloat_AS_DOUBLE(m); \
+ color->m = PyFloat_AS_DOUBLE(m); \
else { \
PyErr_SetString(PyExc_TypeError, \
#m " must be an int or a float"); \
- return -1; \
+ return 0; \
} \
} G_STMT_END
@@ -2397,7 +2396,11 @@
if (a)
SET_MEMBER(a);
else
- rgb.a = 1.0;
+ color->a = 1.0;
+
+ gimp_rgb_clamp(color);
+
+ return 1;
}
PyErr_SetString(PyExc_TypeError, "could not convert to GimpRGB");
Modified: branches/weskaggs/po/POTFILES.in
==============================================================================
--- branches/weskaggs/po/POTFILES.in (original)
+++ branches/weskaggs/po/POTFILES.in Thu Jan 31 16:37:51 2008
@@ -208,6 +208,9 @@
app/file/file-save.c
app/file/file-utils.c
+app/gegl/gimpcurvesconfig.c
+app/gegl/gimplevelsconfig.c
+
app/gui/gui.c
app/gui/gui-message.c
app/gui/session.c
Modified: branches/weskaggs/themes/Default/images/Makefile.am
==============================================================================
--- branches/weskaggs/themes/Default/images/Makefile.am (original)
+++ branches/weskaggs/themes/Default/images/Makefile.am Thu Jan 31 16:37:51 2008
@@ -315,6 +315,8 @@
tools/stock-tool-perspective-22.png \
tools/stock-tool-perspective-clone-16.png \
tools/stock-tool-perspective-clone-22.png \
+ tools/stock-tool-polygon-select-16.png \
+ tools/stock-tool-polygon-select-22.png \
tools/stock-tool-posterize-16.png \
tools/stock-tool-posterize-22.png \
tools/stock-tool-rect-select-16.png \
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]