1 #ifndef __GDK_COLOR_H__
2 #define __GDK_COLOR_H__
4 #include <gdk/gdktypes.h>
8 #endif /* __cplusplus */
11 * A color consists of red, green and blue values in the
12 * range 0-65535 and a pixel value. The pixel value is highly
13 * dependent on the depth and colormap which this color will
14 * be used to draw into. Therefore, sharing colors between
15 * colormaps is a bad idea.
28 typedef struct _GdkColormapClass GdkColormapClass;
30 #define GDK_TYPE_COLORMAP (gdk_colormap_get_type ())
31 #define GDK_COLORMAP(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_COLORMAP, GdkColormap))
32 #define GDK_COLORMAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_COLORMAP, GdkColormapClass))
33 #define GDK_IS_COLORMAP(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_COLORMAP))
34 #define GDK_IS_COLORMAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_COLORMAP))
35 #define GDK_COLORMAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_COLORMAP, GdkColormapClass))
37 #define GDK_TYPE_COLOR (gdk_color_get_type ())
41 GObject parent_instance;
50 gpointer windowing_data;
53 struct _GdkColormapClass
55 GObjectClass parent_class;
59 GType gdk_colormap_get_type (void) G_GNUC_CONST;
61 GdkColormap* gdk_colormap_new (GdkVisual *visual,
64 #ifndef GDK_DISABLE_DEPRECATED
65 GdkColormap* gdk_colormap_ref (GdkColormap *cmap);
66 void gdk_colormap_unref (GdkColormap *cmap);
69 #ifndef GDK_MULTIHEAD_SAFE
70 GdkColormap* gdk_colormap_get_system (void);
73 GdkScreen *gdk_colormap_get_screen (GdkColormap *cmap);
75 #ifndef GDK_DISABLE_DEPRECATED
76 gint gdk_colormap_get_system_size (void);
79 #if !defined (GDK_DISABLE_DEPRECATED) || defined (GDK_COMPILATION)
80 /* Used by gdk_colors_store () */
81 void gdk_colormap_change (GdkColormap *colormap,
85 gint gdk_colormap_alloc_colors (GdkColormap *colormap,
91 gboolean gdk_colormap_alloc_color (GdkColormap *colormap,
95 void gdk_colormap_free_colors (GdkColormap *colormap,
98 void gdk_colormap_query_color (GdkColormap *colormap,
102 GdkVisual *gdk_colormap_get_visual (GdkColormap *colormap);
104 GdkColor *gdk_color_copy (const GdkColor *color);
105 void gdk_color_free (GdkColor *color);
106 gint gdk_color_parse (const gchar *spec,
108 guint gdk_color_hash (const GdkColor *colora);
109 gboolean gdk_color_equal (const GdkColor *colora,
110 const GdkColor *colorb);
112 GType gdk_color_get_type (void);
114 /* The following functions are deprecated */
115 #ifndef GDK_DISABLE_DEPRECATED
116 void gdk_colors_store (GdkColormap *colormap,
119 gint gdk_color_white (GdkColormap *colormap,
121 gint gdk_color_black (GdkColormap *colormap,
123 gint gdk_color_alloc (GdkColormap *colormap,
125 gint gdk_color_change (GdkColormap *colormap,
127 #endif /* GDK_DISABLE_DEPRECATED */
129 #if !defined (GDK_DISABLE_DEPRECATED) || defined (GDK_COMPILATION)
130 /* Used by gdk_rgb_try_colormap () */
131 gint gdk_colors_alloc (GdkColormap *colormap,
137 void gdk_colors_free (GdkColormap *colormap,
141 #endif /* !GDK_DISABLE_DEPRECATED || GDK_COMPILATION */
145 #endif /* __cplusplus */
147 #endif /* __GDK_COLOR_H__ */