added new function gimp_rgb_set_gdk_color().

2003-10-22  Sven Neumann  <sven@gimp.org>

	* app/widgets/gimpwidgets-utils.[ch]: added new function
	gimp_rgb_set_gdk_color().

	* app/config/gimprc.c (gimp_rc_load): unlinking the broken gimprc
	doesn't really help so don't do it. GIMP will continue to complain
	until the gimprc is fixed.
This commit is contained in:
Sven Neumann 2003-10-22 14:31:44 +00:00 committed by Sven Neumann
parent 07b6d2103b
commit 49fd45e277
4 changed files with 36 additions and 3 deletions

View File

@ -1,3 +1,12 @@
2003-10-22 Sven Neumann <sven@gimp.org>
* app/widgets/gimpwidgets-utils.[ch]: added new function
gimp_rgb_set_gdk_color().
* app/config/gimprc.c (gimp_rc_load): unlinking the broken gimprc
doesn't really help so don't do it. GIMP will continue to complain
until the gimprc is fixed.
2003-10-22 Sven Neumann <sven@gimp.org>
* app/core/gimptemplate.c: no need to reimplement the default

View File

@ -359,9 +359,7 @@ gimp_rc_load (GimpRc *rc)
{
g_message (error->message);
if (gimp_config_file_backup_on_error (rc->user_gimprc,
"gimprc", NULL))
unlink (rc->user_gimprc);
gimp_config_file_backup_on_error (rc->user_gimprc, "gimprc", NULL);
}
g_clear_error (&error);

View File

@ -633,3 +633,27 @@ gimp_rgb_get_gdk_color (const GimpRGB *rgb,
gdk_color->green = (g << 8) | g;
gdk_color->blue = (b << 8) | b;
}
/**
* gimp_rgb_set_gdk_color:
* @rgb: a #GimpRGB that is to be set
* @gdk_color: pointer to the source #GdkColor
*
* Initializes @rgb from a #GdkColor. This function does not touch
* the alpha value of @rgb.
**/
void
gimp_rgb_set_gdk_color (GimpRGB *rgb,
const GdkColor *gdk_color)
{
guchar r, g, b;
g_return_if_fail (rgb != NULL);
g_return_if_fail (gdk_color != NULL);
r = gdk_color->red >> 8;
g = gdk_color->green >> 8;
b = gdk_color->blue >> 8;
gimp_rgb_set_uchar (rgb, r, g, b);
}

View File

@ -64,6 +64,8 @@ void gimp_get_screen_resolution (GdkScreen *screen,
void gimp_rgb_get_gdk_color (const GimpRGB *rgb,
GdkColor *gdk_color);
void gimp_rgb_set_gdk_color (GimpRGB *rgb,
const GdkColor *gdk_color);
#endif /* __GIMP_WIDGETS_UTILS_H__ */