1 #ifndef __GDK_COLOR_H__
2 #define __GDK_COLOR_H__
5 #include <gdk/gdktypes.h>
9 #endif /* __cplusplus */
12 * A color consists of red, green and blue values in the
13 * range 0-65535 and a pixel value. The pixel value is highly
14 * dependent on the depth and colormap which this color will
15 * be used to draw into. Therefore, sharing colors between
16 * colormaps is a bad idea.
29 typedef struct _GdkColormapClass GdkColormapClass;
31 #define GDK_TYPE_COLORMAP (gdk_colormap_get_type ())
32 #define GDK_COLORMAP(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_COLORMAP, GdkColormap))
33 #define GDK_COLORMAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_COLORMAP, GdkColormapClass))
34 #define GDK_IS_COLORMAP(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_COLORMAP))
35 #define GDK_IS_COLORMAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_COLORMAP))
36 #define GDK_COLORMAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_COLORMAP, GdkColormapClass))
38 #define GDK_TYPE_COLOR (gdk_color_get_type ())
42 GObject parent_instance;
51 gpointer windowing_data;
54 struct _GdkColormapClass
56 GObjectClass parent_class;
60 GType gdk_colormap_get_type (void) G_GNUC_CONST;
62 GdkColormap* gdk_colormap_new (GdkVisual *visual,
65 #ifndef GDK_DISABLE_DEPRECATED
66 GdkColormap* gdk_colormap_ref (GdkColormap *cmap);
67 void gdk_colormap_unref (GdkColormap *cmap);
70 #ifndef GDK_MULTIHEAD_SAFE
71 GdkColormap* gdk_colormap_get_system (void);
74 GdkScreen *gdk_colormap_get_screen (GdkColormap *cmap);
76 #ifndef GDK_DISABLE_DEPRECATED
77 gint gdk_colormap_get_system_size (void);
80 #if !defined (GDK_DISABLE_DEPRECATED) || defined (GDK_COMPILATION)
81 /* Used by gdk_colors_store () */
82 void gdk_colormap_change (GdkColormap *colormap,
86 gint gdk_colormap_alloc_colors (GdkColormap *colormap,
92 gboolean gdk_colormap_alloc_color (GdkColormap *colormap,
96 void gdk_colormap_free_colors (GdkColormap *colormap,
99 void gdk_colormap_query_color (GdkColormap *colormap,
103 GdkVisual *gdk_colormap_get_visual (GdkColormap *colormap);
105 GdkColor *gdk_color_copy (const GdkColor *color);
106 void gdk_color_free (GdkColor *color);
107 gint gdk_color_parse (const gchar *spec,
109 guint gdk_color_hash (const GdkColor *colora);
110 gboolean gdk_color_equal (const GdkColor *colora,
111 const GdkColor *colorb);
113 GType gdk_color_get_type (void) G_GNUC_CONST;
115 void gdk_cairo_set_source_color (cairo_t *cr,
118 /* The following functions are deprecated */
119 #ifndef GDK_DISABLE_DEPRECATED
120 void gdk_colors_store (GdkColormap *colormap,
123 gint gdk_color_white (GdkColormap *colormap,
125 gint gdk_color_black (GdkColormap *colormap,
127 gint gdk_color_alloc (GdkColormap *colormap,
129 gint gdk_color_change (GdkColormap *colormap,
131 #endif /* GDK_DISABLE_DEPRECATED */
133 #if !defined (GDK_DISABLE_DEPRECATED) || defined (GDK_COMPILATION)
134 /* Used by gdk_rgb_try_colormap () */
135 gint gdk_colors_alloc (GdkColormap *colormap,
141 void gdk_colors_free (GdkColormap *colormap,
145 #endif /* !GDK_DISABLE_DEPRECATED || GDK_COMPILATION */
149 #endif /* __cplusplus */
151 #endif /* __GDK_COLOR_H__ */