1 /* GDK - The GIMP Drawing Kit
2 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
21 * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
22 * file for a list of people on the GTK+ Team. See the ChangeLog
23 * files for a list of changes. These files are distributed with
24 * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
27 #if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
28 #error "Only <gdk/gdk.h> can be included directly."
31 #ifndef __GDK_COLOR_H__
32 #define __GDK_COLOR_H__
35 #include <gdk/gdktypes.h>
40 * A color consists of red, green and blue values in the
41 * range 0-65535 and a pixel value. The pixel value is highly
42 * dependent on the depth and colormap which this color will
43 * be used to draw into. Therefore, sharing colors between
44 * colormaps is a bad idea.
57 typedef struct _GdkColormapClass GdkColormapClass;
59 #define GDK_TYPE_COLORMAP (gdk_colormap_get_type ())
60 #define GDK_COLORMAP(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_COLORMAP, GdkColormap))
61 #define GDK_COLORMAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_COLORMAP, GdkColormapClass))
62 #define GDK_IS_COLORMAP(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_COLORMAP))
63 #define GDK_IS_COLORMAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_COLORMAP))
64 #define GDK_COLORMAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_COLORMAP, GdkColormapClass))
66 #define GDK_TYPE_COLOR (gdk_color_get_type ())
71 GObject parent_instance;
80 gpointer windowing_data;
83 struct _GdkColormapClass
85 GObjectClass parent_class;
89 GType gdk_colormap_get_type (void) G_GNUC_CONST;
91 GdkColormap* gdk_colormap_new (GdkVisual *visual,
94 #ifndef GDK_DISABLE_DEPRECATED
95 GdkColormap* gdk_colormap_ref (GdkColormap *cmap);
96 void gdk_colormap_unref (GdkColormap *cmap);
99 #ifndef GDK_MULTIHEAD_SAFE
100 GdkColormap* gdk_colormap_get_system (void);
103 GdkScreen *gdk_colormap_get_screen (GdkColormap *cmap);
105 #ifndef GDK_DISABLE_DEPRECATED
106 gint gdk_colormap_get_system_size (void);
109 #if !defined (GDK_DISABLE_DEPRECATED) || defined (GDK_COMPILATION)
110 /* Used by gdk_colors_store () */
111 void gdk_colormap_change (GdkColormap *colormap,
115 gint gdk_colormap_alloc_colors (GdkColormap *colormap,
121 gboolean gdk_colormap_alloc_color (GdkColormap *colormap,
124 gboolean best_match);
125 void gdk_colormap_free_colors (GdkColormap *colormap,
126 const GdkColor *colors,
128 void gdk_colormap_query_color (GdkColormap *colormap,
132 GdkVisual *gdk_colormap_get_visual (GdkColormap *colormap);
134 GdkColor *gdk_color_copy (const GdkColor *color);
135 void gdk_color_free (GdkColor *color);
136 gboolean gdk_color_parse (const gchar *spec,
138 guint gdk_color_hash (const GdkColor *colora);
139 gboolean gdk_color_equal (const GdkColor *colora,
140 const GdkColor *colorb);
141 gchar * gdk_color_to_string (const GdkColor *color);
143 GType gdk_color_get_type (void) G_GNUC_CONST;
145 /* The following functions are deprecated */
146 #ifndef GDK_DISABLE_DEPRECATED
147 void gdk_colors_store (GdkColormap *colormap,
150 gint gdk_color_white (GdkColormap *colormap,
152 gint gdk_color_black (GdkColormap *colormap,
154 gint gdk_color_alloc (GdkColormap *colormap,
156 gint gdk_color_change (GdkColormap *colormap,
158 #endif /* GDK_DISABLE_DEPRECATED */
160 #if !defined (GDK_DISABLE_DEPRECATED) || defined (GDK_COMPILATION)
161 /* Used by gdk_rgb_try_colormap () */
162 gint gdk_colors_alloc (GdkColormap *colormap,
168 void gdk_colors_free (GdkColormap *colormap,
172 #endif /* !GDK_DISABLE_DEPRECATED || GDK_COMPILATION */
176 #endif /* __GDK_COLOR_H__ */