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 (__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;
75 GdkColor *GSEAL (colors);
78 GdkVisual *GSEAL (visual);
80 gpointer GSEAL (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_MULTIHEAD_SAFE
95 GdkColormap* gdk_colormap_get_system (void);
98 GdkScreen *gdk_colormap_get_screen (GdkColormap *cmap);
100 gint gdk_colormap_alloc_colors (GdkColormap *colormap,
106 gboolean gdk_colormap_alloc_color (GdkColormap *colormap,
109 gboolean best_match);
110 void gdk_colormap_free_colors (GdkColormap *colormap,
111 const GdkColor *colors,
114 GdkVisual *gdk_colormap_get_visual (GdkColormap *colormap);
116 GdkColor *gdk_color_copy (const GdkColor *color);
117 void gdk_color_free (GdkColor *color);
118 gboolean gdk_color_parse (const gchar *spec,
120 guint gdk_color_hash (const GdkColor *colora);
121 gboolean gdk_color_equal (const GdkColor *colora,
122 const GdkColor *colorb);
123 gchar * gdk_color_to_string (const GdkColor *color);
125 GType gdk_color_get_type (void) G_GNUC_CONST;
130 #endif /* __GDK_COLOR_H__ */