mirror of https://github.com/GNOME/gimp.git
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:
parent
07b6d2103b
commit
49fd45e277
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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__ */
|
||||
|
|
Loading…
Reference in New Issue