gimp r27090 - in trunk: . app/tools
- From: mitch svn gnome org
- To: svn-commits-list gnome org
- Subject: gimp r27090 - in trunk: . app/tools
- Date: Tue, 30 Sep 2008 13:46:08 +0000 (UTC)
Author: mitch
Date: Tue Sep 30 13:46:08 2008
New Revision: 27090
URL: http://svn.gnome.org/viewvc/gimp?rev=27090&view=rev
Log:
2008-09-30 Michael Natterer <mitch gimp org>
* app/tools/gimpimagemaptool.[ch]: keep a "default_config" object
around and use it to reset the tool if it exists.
(gimp_image_map_tool_edit_as): set the default_config on the new
tool so "reset" goes back to the values the tool was started with.
* app/tools/gimpcolorbalencetool.c (gimp_color_balance_tool_reset)
* app/tools/gimpcurvestool.c (gimp_curves_tool_reset)
* app/tools/gimphuesaturationtool.c (gimp_hue_saturation_tool_reset)
* app/tools/gimplevelstool.c (gimp_levels_tool_reset): use the
default config to reset the tool here too if it exists.
Modified:
trunk/ChangeLog
trunk/app/tools/gimpcolorbalancetool.c
trunk/app/tools/gimpcurvestool.c
trunk/app/tools/gimphuesaturationtool.c
trunk/app/tools/gimpimagemaptool.c
trunk/app/tools/gimpimagemaptool.h
trunk/app/tools/gimplevelstool.c
Modified: trunk/app/tools/gimpcolorbalancetool.c
==============================================================================
--- trunk/app/tools/gimpcolorbalancetool.c (original)
+++ trunk/app/tools/gimpcolorbalancetool.c Tue Sep 30 13:46:08 2008
@@ -349,14 +349,24 @@
GimpColorBalanceTool *cb_tool = GIMP_COLOR_BALANCE_TOOL (im_tool);
GimpTransferMode range = cb_tool->config->range;
- g_object_freeze_notify (G_OBJECT (cb_tool->config));
+ g_object_freeze_notify (im_tool->config);
+
+ if (im_tool->default_config)
+ {
+ gimp_config_copy (GIMP_CONFIG (im_tool->default_config),
+ GIMP_CONFIG (im_tool->config),
+ 0);
+ }
+ else
+ {
+ gimp_config_reset (GIMP_CONFIG (im_tool->config));
+ }
- gimp_config_reset (GIMP_CONFIG (cb_tool->config));
g_object_set (cb_tool->config,
"range", range,
NULL);
- g_object_thaw_notify (G_OBJECT (cb_tool->config));
+ g_object_thaw_notify (im_tool->config);
}
static void
Modified: trunk/app/tools/gimpcurvestool.c
==============================================================================
--- trunk/app/tools/gimpcurvestool.c (original)
+++ trunk/app/tools/gimpcurvestool.c Tue Sep 30 13:46:08 2008
@@ -566,13 +566,35 @@
gimp_curves_tool_reset (GimpImageMapTool *image_map_tool)
{
GimpCurvesTool *tool = GIMP_CURVES_TOOL (image_map_tool);
+ GimpCurvesConfig *default_config;
GimpHistogramChannel channel;
+ default_config = GIMP_CURVES_CONFIG (image_map_tool->default_config);
+
for (channel = GIMP_HISTOGRAM_VALUE;
channel <= GIMP_HISTOGRAM_ALPHA;
channel++)
{
- gimp_curve_reset (tool->config->curve[channel], FALSE);
+ if (default_config)
+ {
+ GimpCurveType curve_type = tool->config->curve[channel]->curve_type;
+
+ g_object_freeze_notify (G_OBJECT (tool->config->curve[channel]));
+
+ gimp_config_copy (GIMP_CONFIG (default_config->curve[channel]),
+ GIMP_CONFIG (tool->config->curve[channel]),
+ 0);
+
+ g_object_set (tool->config->curve[channel],
+ "curve-type", curve_type,
+ NULL);
+
+ g_object_thaw_notify (G_OBJECT (tool->config->curve[channel]));
+ }
+ else
+ {
+ gimp_curve_reset (tool->config->curve[channel], FALSE);
+ }
}
}
Modified: trunk/app/tools/gimphuesaturationtool.c
==============================================================================
--- trunk/app/tools/gimphuesaturationtool.c (original)
+++ trunk/app/tools/gimphuesaturationtool.c Tue Sep 30 13:46:08 2008
@@ -464,14 +464,24 @@
GimpHueSaturationTool *hs_tool = GIMP_HUE_SATURATION_TOOL (image_map_tool);
GimpHueRange range = hs_tool->config->range;
- g_object_freeze_notify (G_OBJECT (hs_tool->config));
+ g_object_freeze_notify (image_map_tool->config);
+
+ if (image_map_tool->default_config)
+ {
+ gimp_config_copy (GIMP_CONFIG (image_map_tool->default_config),
+ GIMP_CONFIG (image_map_tool->config),
+ 0);
+ }
+ else
+ {
+ gimp_config_reset (GIMP_CONFIG (image_map_tool->config));
+ }
- gimp_config_reset (GIMP_CONFIG (hs_tool->config));
g_object_set (hs_tool->config,
"range", range,
NULL);
- g_object_thaw_notify (G_OBJECT (hs_tool->config));
+ g_object_thaw_notify (image_map_tool->config);
}
static void
Modified: trunk/app/tools/gimpimagemaptool.c
==============================================================================
--- trunk/app/tools/gimpimagemaptool.c (original)
+++ trunk/app/tools/gimpimagemaptool.c Tue Sep 30 13:46:08 2008
@@ -190,15 +190,16 @@
GIMP_DIRTY_DRAWABLE |
GIMP_DIRTY_SELECTION);
- 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;
- image_map_tool->main_vbox = NULL;
- image_map_tool->settings_box = NULL;
- image_map_tool->label_group = NULL;
+ image_map_tool->drawable = NULL;
+ image_map_tool->operation = NULL;
+ image_map_tool->config = NULL;
+ image_map_tool->default_config = NULL;
+ image_map_tool->image_map = NULL;
+
+ image_map_tool->shell = NULL;
+ image_map_tool->main_vbox = NULL;
+ image_map_tool->settings_box = NULL;
+ image_map_tool->label_group = NULL;
}
static GObject *
@@ -239,6 +240,12 @@
image_map_tool->config = NULL;
}
+ if (image_map_tool->default_config)
+ {
+ g_object_unref (image_map_tool->default_config);
+ image_map_tool->default_config = NULL;
+ }
+
if (image_map_tool->shell)
{
gtk_widget_destroy (image_map_tool->shell);
@@ -467,7 +474,16 @@
}
else if (tool->config)
{
- gimp_config_reset (GIMP_CONFIG (tool->config));
+ if (tool->default_config)
+ {
+ gimp_config_copy (GIMP_CONFIG (tool->default_config),
+ GIMP_CONFIG (tool->config),
+ 0);
+ }
+ else
+ {
+ gimp_config_reset (GIMP_CONFIG (tool->config));
+ }
}
}
@@ -674,9 +690,9 @@
new_tool = tool_manager_get_active (display->gimp);
- gimp_config_copy (config,
- GIMP_CONFIG (GIMP_IMAGE_MAP_TOOL (new_tool)->config),
- 0);
+ GIMP_IMAGE_MAP_TOOL (new_tool)->default_config = g_object_ref (config);
+
+ gimp_image_map_tool_reset (GIMP_IMAGE_MAP_TOOL (new_tool));
}
GtkWidget *
Modified: trunk/app/tools/gimpimagemaptool.h
==============================================================================
--- trunk/app/tools/gimpimagemaptool.h (original)
+++ trunk/app/tools/gimpimagemaptool.h Tue Sep 30 13:46:08 2008
@@ -43,6 +43,7 @@
GeglNode *operation;
GObject *config;
+ GObject *default_config;
GimpImageMapApplyFunc apply_func;
gpointer apply_data;
Modified: trunk/app/tools/gimplevelstool.c
==============================================================================
--- trunk/app/tools/gimplevelstool.c (original)
+++ trunk/app/tools/gimplevelstool.c Tue Sep 30 13:46:08 2008
@@ -698,14 +698,24 @@
GimpLevelsTool *tool = GIMP_LEVELS_TOOL (image_map_tool);
GimpHistogramChannel channel = tool->config->channel;
- g_object_freeze_notify (G_OBJECT (tool->config));
+ g_object_freeze_notify (image_map_tool->config);
+
+ if (image_map_tool->default_config)
+ {
+ gimp_config_copy (GIMP_CONFIG (image_map_tool->default_config),
+ GIMP_CONFIG (image_map_tool->config),
+ 0);
+ }
+ else
+ {
+ gimp_config_reset (GIMP_CONFIG (image_map_tool->config));
+ }
- gimp_config_reset (GIMP_CONFIG (tool->config));
g_object_set (tool->config,
"channel", channel,
NULL);
- g_object_thaw_notify (G_OBJECT (tool->config));
+ g_object_thaw_notify (image_map_tool->config);
}
static gboolean
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]