[gimp/gtk3-port: 195/227] app: remove gimp_rgb_get,set_gdk_color()
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/gtk3-port: 195/227] app: remove gimp_rgb_get,set_gdk_color()
- Date: Tue, 9 Jun 2015 22:25:18 +0000 (UTC)
commit 96a620598849dd41d30e208d0d0019ff199b6664
Author: Michael Natterer <mitch gimp org>
Date: Wed Feb 23 08:57:00 2011 +0100
app: remove gimp_rgb_get,set_gdk_color()
and inline the few lines into their only users.
app/widgets/gimptextbuffer.c | 5 ++-
app/widgets/gimptexttag.c | 8 ++++-
app/widgets/gimpwidgets-utils.c | 50 ---------------------------------------
app/widgets/gimpwidgets-utils.h | 4 ---
4 files changed, 9 insertions(+), 58 deletions(-)
---
diff --git a/app/widgets/gimptextbuffer.c b/app/widgets/gimptextbuffer.c
index 6c5da93..41ecdcb 100644
--- a/app/widgets/gimptextbuffer.c
+++ b/app/widgets/gimptextbuffer.c
@@ -33,7 +33,6 @@
#include "gimptextbuffer.h"
#include "gimptextbuffer-serialize.h"
#include "gimptexttag.h"
-#include "gimpwidgets-utils.h"
#include "gimp-intl.h"
@@ -954,7 +953,9 @@ gimp_text_buffer_get_color_tag (GimpTextBuffer *buffer,
g_snprintf (name, sizeof (name), "color-#%02x%02x%02x",
r, g, b);
- gimp_rgb_get_gdk_color (color, &gdk_color);
+ gdk_color.red = (r << 8) | r;
+ gdk_color.green = (g << 8) | g;
+ gdk_color.blue = (b << 8) | b;
tag = gtk_text_buffer_create_tag (GTK_TEXT_BUFFER (buffer),
name,
diff --git a/app/widgets/gimptexttag.c b/app/widgets/gimptexttag.c
index dee775b..ec6d2b2 100644
--- a/app/widgets/gimptexttag.c
+++ b/app/widgets/gimptexttag.c
@@ -28,7 +28,6 @@
#include "widgets-types.h"
#include "gimptexttag.h"
-#include "gimpwidgets-utils.h"
gint
@@ -86,12 +85,17 @@ gimp_text_tag_get_color (GtkTextTag *tag,
GimpRGB *color)
{
GdkColor *gdk_color;
+ guchar r, g, b;
g_object_get (tag,
GIMP_TEXT_PROP_NAME_COLOR, &gdk_color,
NULL);
- gimp_rgb_set_gdk_color (color, gdk_color);
+ r = gdk_color->red >> 8;
+ g = gdk_color->green >> 8;
+ b = gdk_color->blue >> 8;
+
+ gimp_rgb_set_uchar (color, r, g, b);
gdk_color_free (gdk_color);
}
diff --git a/app/widgets/gimpwidgets-utils.c b/app/widgets/gimpwidgets-utils.c
index ba058f9..e173ef4 100644
--- a/app/widgets/gimpwidgets-utils.c
+++ b/app/widgets/gimpwidgets-utils.c
@@ -834,56 +834,6 @@ gimp_get_monitor_resolution (GdkScreen *screen,
*yres = ROUND (y);
}
-
-/**
- * gimp_rgb_get_gdk_color:
- * @rgb: the source color as #GimpRGB
- * @gdk_color: pointer to a #GdkColor
- *
- * Initializes @gdk_color from a #GimpRGB. This function does not
- * allocate the color for you. Depending on how you want to use it,
- * you may have to call gdk_colormap_alloc_color().
- **/
-void
-gimp_rgb_get_gdk_color (const GimpRGB *rgb,
- GdkColor *gdk_color)
-{
- guchar r, g, b;
-
- g_return_if_fail (rgb != NULL);
- g_return_if_fail (gdk_color != NULL);
-
- gimp_rgb_get_uchar (rgb, &r, &g, &b);
-
- gdk_color->red = (r << 8) | r;
- 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);
-}
-
gboolean
gimp_get_style_color (GtkWidget *widget,
const gchar *property_name,
diff --git a/app/widgets/gimpwidgets-utils.h b/app/widgets/gimpwidgets-utils.h
index 297c5a8..6bc84d1 100644
--- a/app/widgets/gimpwidgets-utils.h
+++ b/app/widgets/gimpwidgets-utils.h
@@ -73,10 +73,6 @@ void gimp_get_monitor_resolution (GdkScreen *screen
gint monitor,
gdouble *xres,
gdouble *yres);
-void gimp_rgb_get_gdk_color (const GimpRGB *rgb,
- GdkColor *gdk_color);
-void gimp_rgb_set_gdk_color (GimpRGB *rgb,
- const GdkColor *gdk_color);
gboolean gimp_get_style_color (GtkWidget *widget,
const gchar *property_name,
GdkRGBA *color);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]