gimp r24698 - in trunk: . app/gegl app/tools
- From: mitch svn gnome org
- To: svn-commits-list gnome org
- Subject: gimp r24698 - in trunk: . app/gegl app/tools
- Date: Thu, 24 Jan 2008 09:06:50 +0000 (GMT)
Author: mitch
Date: Thu Jan 24 09:06:50 2008
New Revision: 24698
URL: http://svn.gnome.org/viewvc/gimp?rev=24698&view=rev
Log:
2008-01-24 Michael Natterer <mitch gimp org>
* app/gegl/gimpcolorizeconfig.[ch]: added reset() and to_cruft()
functions.
* app/tools/gimpcolorizetool.c: use them.
Modified:
trunk/ChangeLog
trunk/app/gegl/gimpcolorizeconfig.c
trunk/app/gegl/gimpcolorizeconfig.h
trunk/app/tools/gimpcolorizetool.c
Modified: trunk/app/gegl/gimpcolorizeconfig.c
==============================================================================
--- trunk/app/gegl/gimpcolorizeconfig.c (original)
+++ trunk/app/gegl/gimpcolorizeconfig.c Thu Jan 24 09:06:50 2008
@@ -25,6 +25,9 @@
#include "gegl-types.h"
+/* temp cruft */
+#include "base/colorize.h"
+
#include "gimpcolorizeconfig.h"
@@ -145,3 +148,33 @@
break;
}
}
+
+
+/* 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
+gimp_colorize_config_to_cruft (GimpColorizeConfig *config,
+ Colorize *cruft)
+{
+ g_return_if_fail (GIMP_IS_COLORIZE_CONFIG (config));
+ g_return_if_fail (cruft != NULL);
+
+ cruft->hue = config->hue * 360.0;
+ cruft->saturation = config->saturation * 100.0;
+ cruft->lightness = config->lightness * 100.0;
+
+ colorize_calculate (cruft);
+}
Modified: trunk/app/gegl/gimpcolorizeconfig.h
==============================================================================
--- trunk/app/gegl/gimpcolorizeconfig.h (original)
+++ trunk/app/gegl/gimpcolorizeconfig.h Thu Jan 24 09:06:50 2008
@@ -50,5 +50,11 @@
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);
+
#endif /* __GIMP_COLORIZE_CONFIG_H__ */
Modified: trunk/app/tools/gimpcolorizetool.c
==============================================================================
--- trunk/app/tools/gimpcolorizetool.c (original)
+++ trunk/app/tools/gimpcolorizetool.c Thu Jan 24 09:06:50 2008
@@ -155,11 +155,7 @@
return FALSE;
}
- g_object_set (col_tool->config,
- "hue", 0.5,
- "saturation", 0.5,
- "lightness", 0.0,
- NULL);
+ gimp_colorize_config_reset (col_tool->config);
GIMP_TOOL_CLASS (parent_class)->initialize (tool, display, error);
@@ -193,14 +189,8 @@
gimp_colorize_tool_map (GimpImageMapTool *image_map_tool)
{
GimpColorizeTool *col_tool = GIMP_COLORIZE_TOOL (image_map_tool);
- GimpColorizeConfig *config = col_tool->config;
- Colorize *colorize = col_tool->colorize;
- colorize->hue = config->hue * 360.0;
- colorize->saturation = config->saturation * 100.0;
- colorize->lightness = config->lightness * 100.0;
-
- colorize_calculate (colorize);
+ gimp_colorize_config_to_cruft (col_tool->config, col_tool->colorize);
}
@@ -282,11 +272,7 @@
{
GimpColorizeTool *col_tool = GIMP_COLORIZE_TOOL (image_map_tool);
- g_object_set (col_tool->config,
- "hue", 0.5,
- "saturation", 0.5,
- "lightness", 0.0,
- NULL);
+ gimp_colorize_config_reset (col_tool->config);
colorize_update_sliders (col_tool);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]