From 7a2537866b2e495be9397834fc9edbc829cfd52c Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 28 Oct 2016 17:08:25 -0400 Subject: [PATCH] Drop GdkColor It is deprecated and no longer used. --- docs/reference/gdk/gdk-docs.sgml | 1 - docs/reference/gdk/gdk4-sections.txt | 18 --- gdk/Makefile.am | 10 +- gdk/deprecated/gdkcolor.c | 202 --------------------------- gdk/deprecated/gdkcolor.h | 87 ------------ gdk/gdk.h | 4 - gdk/gdkcairo.h | 1 - gdk/gdktypes.h | 1 - 8 files changed, 1 insertion(+), 323 deletions(-) delete mode 100644 gdk/deprecated/gdkcolor.c delete mode 100644 gdk/deprecated/gdkcolor.h diff --git a/docs/reference/gdk/gdk-docs.sgml b/docs/reference/gdk/gdk-docs.sgml index 19125711c1..f671c8fd5e 100644 --- a/docs/reference/gdk/gdk-docs.sgml +++ b/docs/reference/gdk/gdk-docs.sgml @@ -53,7 +53,6 @@ Deprecated - diff --git a/docs/reference/gdk/gdk4-sections.txt b/docs/reference/gdk/gdk4-sections.txt index bbae1d92b4..d4fa3eeff3 100644 --- a/docs/reference/gdk/gdk4-sections.txt +++ b/docs/reference/gdk/gdk4-sections.txt @@ -220,24 +220,6 @@ gdk_pixbuf_get_from_window gdk_pixbuf_get_from_surface -
-Colors -colors -GdkColor -gdk_color_copy -gdk_color_free -gdk_color_parse -gdk_color_equal -gdk_color_hash -gdk_color_to_string - - -GDK_TYPE_COLOR - - -gdk_color_get_type -
-
RGBA Colors rgba_colors diff --git a/gdk/Makefile.am b/gdk/Makefile.am index a84448e4ce..8f0ba00cc2 100644 --- a/gdk/Makefile.am +++ b/gdk/Makefile.am @@ -92,12 +92,8 @@ gdk_public_h_sources = \ gdkvisual.h \ gdkwindow.h -deprecated_h_sources = \ - deprecated/gdkcolor.h - gdk_h_sources = \ - $(gdk_public_h_sources) \ - $(deprecated_h_sources) + $(gdk_public_h_sources) gdk_private_headers = \ gdk-private.h \ @@ -124,11 +120,7 @@ gdk_private_headers = \ gdkvisualprivate.h \ gdkx.h -deprecated_c_sources = \ - deprecated/gdkcolor.c - gdk_c_sources = \ - $(deprecated_c_sources) \ gdk-private.c \ gdk.c \ gdkapplaunchcontext.c \ diff --git a/gdk/deprecated/gdkcolor.c b/gdk/deprecated/gdkcolor.c deleted file mode 100644 index fb45a87706..0000000000 --- a/gdk/deprecated/gdkcolor.c +++ /dev/null @@ -1,202 +0,0 @@ -/* GDK - The GIMP Drawing Kit - * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - */ - -/* - * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS - * file for a list of people on the GTK+ Team. See the ChangeLog - * files for a list of changes. These files are distributed with - * GTK+ at ftp://ftp.gtk.org/pub/gtk/. - */ - -#include "config.h" - -#include "gdkcolor.h" - -#include "gdkscreen.h" -#include "gdkinternals.h" - -#include - -G_GNUC_BEGIN_IGNORE_DEPRECATIONS - -/** - * SECTION:colors - * @Short_description: Manipulation of colors - * @Title: Colors - * - * A #GdkColor represents a color. - * - * When working with cairo, it is often more convenient - * to use a #GdkRGBA instead, and #GdkColor has been - * deprecated in favor of #GdkRGBA. - */ - - -/** - * gdk_color_copy: - * @color: a #GdkColor - * - * Makes a copy of a #GdkColor. - * - * The result must be freed using gdk_color_free(). - * - * Returns: a copy of @color - * - * Deprecated: 3.14: Use #GdkRGBA - */ -GdkColor* -gdk_color_copy (const GdkColor *color) -{ - GdkColor *new_color; - - g_return_val_if_fail (color != NULL, NULL); - - new_color = g_slice_new (GdkColor); - *new_color = *color; - return new_color; -} - -/** - * gdk_color_free: - * @color: a #GdkColor - * - * Frees a #GdkColor created with gdk_color_copy(). - * - * Deprecated: 3.14: Use #GdkRGBA - */ -void -gdk_color_free (GdkColor *color) -{ - g_return_if_fail (color != NULL); - - g_slice_free (GdkColor, color); -} - -/** - * gdk_color_hash: - * @color: a #GdkColor - * - * A hash function suitable for using for a hash - * table that stores #GdkColors. - * - * Returns: The hash function applied to @color - * - * Deprecated: 3.14: Use #GdkRGBA - */ -guint -gdk_color_hash (const GdkColor *color) -{ - return ((color->red) + - (color->green << 11) + - (color->blue << 22) + - (color->blue >> 6)); -} - -/** - * gdk_color_equal: - * @colora: a #GdkColor - * @colorb: another #GdkColor - * - * Compares two colors. - * - * Returns: %TRUE if the two colors compare equal - * - * Deprecated: 3.14: Use #GdkRGBA - */ -gboolean -gdk_color_equal (const GdkColor *colora, - const GdkColor *colorb) -{ - g_return_val_if_fail (colora != NULL, FALSE); - g_return_val_if_fail (colorb != NULL, FALSE); - - return ((colora->red == colorb->red) && - (colora->green == colorb->green) && - (colora->blue == colorb->blue)); -} - -G_DEFINE_BOXED_TYPE (GdkColor, gdk_color, - gdk_color_copy, - gdk_color_free) - -/** - * gdk_color_parse: - * @spec: the string specifying the color - * @color: (out): the #GdkColor to fill in - * - * Parses a textual specification of a color and fill in the - * @red, @green, and @blue fields of a #GdkColor. - * - * The string can either one of a large set of standard names - * (taken from the X11 `rgb.txt` file), or it can be a hexadecimal - * value in the form “\#rgb” “\#rrggbb”, “\#rrrgggbbb” or - * “\#rrrrggggbbbb” where “r”, “g” and “b” are hex digits of - * the red, green, and blue components of the color, respectively. - * (White in the four forms is “\#fff”, “\#ffffff”, “\#fffffffff” - * and “\#ffffffffffff”). - * - * Returns: %TRUE if the parsing succeeded - * - * Deprecated: 3.14: Use #GdkRGBA - */ -gboolean -gdk_color_parse (const gchar *spec, - GdkColor *color) -{ - PangoColor pango_color; - - if (pango_color_parse (&pango_color, spec)) - { - color->red = pango_color.red; - color->green = pango_color.green; - color->blue = pango_color.blue; - - return TRUE; - } - else - return FALSE; -} - -/** - * gdk_color_to_string: - * @color: a #GdkColor - * - * Returns a textual specification of @color in the hexadecimal - * form “\#rrrrggggbbbb” where “r”, “g” and “b” are hex digits - * representing the red, green and blue components respectively. - * - * The returned string can be parsed by gdk_color_parse(). - * - * Returns: a newly-allocated text string - * - * Since: 2.12 - * - * Deprecated: 3.14: Use #GdkRGBA - */ -gchar * -gdk_color_to_string (const GdkColor *color) -{ - PangoColor pango_color; - - g_return_val_if_fail (color != NULL, NULL); - - pango_color.red = color->red; - pango_color.green = color->green; - pango_color.blue = color->blue; - - return pango_color_to_string (&pango_color); -} diff --git a/gdk/deprecated/gdkcolor.h b/gdk/deprecated/gdkcolor.h deleted file mode 100644 index 1ffccbe81b..0000000000 --- a/gdk/deprecated/gdkcolor.h +++ /dev/null @@ -1,87 +0,0 @@ -/* GDK - The GIMP Drawing Kit - * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - */ - -/* - * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS - * file for a list of people on the GTK+ Team. See the ChangeLog - * files for a list of changes. These files are distributed with - * GTK+ at ftp://ftp.gtk.org/pub/gtk/. - */ - -#ifndef __GDK_COLOR_H__ -#define __GDK_COLOR_H__ - -#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION) -#error "Only can be included directly." -#endif - -#include -#include -#include - -G_BEGIN_DECLS - - -/** - * GdkColor: - * @pixel: For allocated colors, the pixel value used to - * draw this color on the screen. Not used anymore. - * @red: The red component of the color. This is - * a value between 0 and 65535, with 65535 indicating - * full intensity - * @green: The green component of the color - * @blue: The blue component of the color - * - * A #GdkColor is used to describe a color, - * similar to the XColor struct used in the X11 drawing API. - * - * Deprecated: 3.14: Use #GdkRGBA - */ -struct _GdkColor -{ - guint32 pixel; - guint16 red; - guint16 green; - guint16 blue; -}; - -#define GDK_TYPE_COLOR (gdk_color_get_type ()) - -GDK_DEPRECATED_IN_3_14_FOR(gdk_rgba_get_type) -GType gdk_color_get_type (void) G_GNUC_CONST; - -GDK_DEPRECATED_IN_3_14_FOR(gdk_rgba_copy) -GdkColor *gdk_color_copy (const GdkColor *color); -GDK_DEPRECATED_IN_3_14_FOR(gdk_rgba_free) -void gdk_color_free (GdkColor *color); - -GDK_DEPRECATED_IN_3_14_FOR(gdk_rgba_hash) -guint gdk_color_hash (const GdkColor *color); -GDK_DEPRECATED_IN_3_14_FOR(gdk_rgba_equal) -gboolean gdk_color_equal (const GdkColor *colora, - const GdkColor *colorb); - -GDK_DEPRECATED_IN_3_14_FOR(gdk_rgba_parse) -gboolean gdk_color_parse (const gchar *spec, - GdkColor *color); -GDK_DEPRECATED_IN_3_14_FOR(gdk_rgba_to_string) -gchar * gdk_color_to_string (const GdkColor *color); - - -G_END_DECLS - -#endif /* __GDK_COLOR_H__ */ diff --git a/gdk/gdk.h b/gdk/gdk.h index 3878f10820..4a3b9201ea 100644 --- a/gdk/gdk.h +++ b/gdk/gdk.h @@ -63,10 +63,6 @@ #include #include -#ifndef GDK_DISABLE_DEPRECATED -#include -#endif - #include #undef __GDK_H_INSIDE__ diff --git a/gdk/gdkcairo.h b/gdk/gdkcairo.h index ec7b5f5b41..1b3b961d35 100644 --- a/gdk/gdkcairo.h +++ b/gdk/gdkcairo.h @@ -23,7 +23,6 @@ #endif #include -#include #include #include #include diff --git a/gdk/gdktypes.h b/gdk/gdktypes.h index 0dac77419a..a4ce12ba08 100644 --- a/gdk/gdktypes.h +++ b/gdk/gdktypes.h @@ -129,7 +129,6 @@ typedef struct _GdkAtom *GdkAtom; #define GDK_NONE _GDK_MAKE_ATOM (0) /* Forward declarations of commonly used types */ -typedef struct _GdkColor GdkColor; typedef struct _GdkRGBA GdkRGBA; typedef struct _GdkCursor GdkCursor; typedef struct _GdkVisual GdkVisual;