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 #ifndef __GDK_COLOR_H__
28 #define __GDK_COLOR_H__
31 #include <gdk/gdktypes.h>
36 * A color consists of red, green and blue values in the
37 * range 0-65535 and a pixel value. The pixel value is highly
38 * dependent on the depth and colormap which this color will
39 * be used to draw into. Therefore, sharing colors between
40 * colormaps is a bad idea.
53 typedef struct _GdkColormapClass GdkColormapClass;
55 #define GDK_TYPE_COLORMAP (gdk_colormap_get_type ())
56 #define GDK_COLORMAP(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_COLORMAP, GdkColormap))
57 #define GDK_COLORMAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_COLORMAP, GdkColormapClass))
58 #define GDK_IS_COLORMAP(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_COLORMAP))
59 #define GDK_IS_COLORMAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_COLORMAP))
60 #define GDK_COLORMAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_COLORMAP, GdkColormapClass))
62 #define GDK_TYPE_COLOR (gdk_color_get_type ())
67 GObject parent_instance;
76 gpointer windowing_data;
79 struct _GdkColormapClass
81 GObjectClass parent_class;
85 GType gdk_colormap_get_type (void) G_GNUC_CONST;
87 GdkColormap* gdk_colormap_new (GdkVisual *visual,
90 #ifndef GDK_DISABLE_DEPRECATED
91 GdkColormap* gdk_colormap_ref (GdkColormap *cmap);
92 void gdk_colormap_unref (GdkColormap *cmap);
95 #ifndef GDK_MULTIHEAD_SAFE
96 GdkColormap* gdk_colormap_get_system (void);
99 GdkScreen *gdk_colormap_get_screen (GdkColormap *cmap);
101 #ifndef GDK_DISABLE_DEPRECATED
102 gint gdk_colormap_get_system_size (void);
105 #if !defined (GDK_DISABLE_DEPRECATED) || defined (GDK_COMPILATION)
106 /* Used by gdk_colors_store () */
107 void gdk_colormap_change (GdkColormap *colormap,
111 gint gdk_colormap_alloc_colors (GdkColormap *colormap,
117 gboolean gdk_colormap_alloc_color (GdkColormap *colormap,
120 gboolean best_match);
121 void gdk_colormap_free_colors (GdkColormap *colormap,
124 void gdk_colormap_query_color (GdkColormap *colormap,
128 GdkVisual *gdk_colormap_get_visual (GdkColormap *colormap);
130 GdkColor *gdk_color_copy (const GdkColor *color);
131 void gdk_color_free (GdkColor *color);
132 gint gdk_color_parse (const gchar *spec,
134 guint gdk_color_hash (const GdkColor *colora);
135 gboolean gdk_color_equal (const GdkColor *colora,
136 const GdkColor *colorb);
138 GType gdk_color_get_type (void) G_GNUC_CONST;
140 /* The following functions are deprecated */
141 #ifndef GDK_DISABLE_DEPRECATED
142 void gdk_colors_store (GdkColormap *colormap,
145 gint gdk_color_white (GdkColormap *colormap,
147 gint gdk_color_black (GdkColormap *colormap,
149 gint gdk_color_alloc (GdkColormap *colormap,
151 gint gdk_color_change (GdkColormap *colormap,
153 #endif /* GDK_DISABLE_DEPRECATED */
155 #if !defined (GDK_DISABLE_DEPRECATED) || defined (GDK_COMPILATION)
156 /* Used by gdk_rgb_try_colormap () */
157 gint gdk_colors_alloc (GdkColormap *colormap,
163 void gdk_colors_free (GdkColormap *colormap,
167 #endif /* !GDK_DISABLE_DEPRECATED || GDK_COMPILATION */
171 #endif /* __GDK_COLOR_H__ */