Ardour  8.7-14-g57a6773833
gdkcolor.h
Go to the documentation of this file.
1 /* GDK - The GIMP Drawing Kit
2  * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
3  *
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.
8  *
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.
13  *
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.
18  */
19 
20 /*
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/.
25  */
26 
27 #ifndef __GDK_COLOR_H__
28 #define __GDK_COLOR_H__
29 
30 #if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
31 #error "Only <gdk/gdk.h> can be included directly."
32 #endif
33 
34 #include <cairo.h>
35 #include <gdk/gdktypes.h>
36 
37 G_BEGIN_DECLS
38 
39 /* The color type.
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.
45  */
46 struct _GdkColor
47 {
48  guint32 pixel;
49  guint16 red;
50  guint16 green;
51  guint16 blue;
52 };
53 
54 /* The colormap type.
55  */
56 
57 typedef struct _GdkColormapClass GdkColormapClass;
58 
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))
65 
66 #define GDK_TYPE_COLOR (gdk_color_get_type ())
67 
69 {
70  /*< private >*/
71  GObject parent_instance;
72 
73  /*< public >*/
74  gint GSEAL (size);
75  GdkColor *GSEAL (colors);
76 
77  /*< private >*/
78  GdkVisual *GSEAL (visual);
79 
80  gpointer GSEAL (windowing_data);
81 };
82 
84 {
85  GObjectClass parent_class;
86 
87 };
88 
89 GType gdk_colormap_get_type (void) G_GNUC_CONST;
90 
92  gboolean allocate);
93 
94 #ifndef GDK_DISABLE_DEPRECATED
97 #endif
98 
99 #ifndef GDK_MULTIHEAD_SAFE
101 #endif
102 
104 
105 #ifndef GDK_DISABLE_DEPRECATED
107 #endif
108 
109 #if !defined (GDK_DISABLE_DEPRECATED) || defined (GDK_COMPILATION)
110 /* Used by gdk_colors_store () */
112  gint ncolors);
113 #endif
114 
116  GdkColor *colors,
117  gint n_colors,
118  gboolean writeable,
119  gboolean best_match,
120  gboolean *success);
122  GdkColor *color,
123  gboolean writeable,
124  gboolean best_match);
126  const GdkColor *colors,
127  gint n_colors);
129  gulong pixel,
130  GdkColor *result);
131 
133 
136 gboolean gdk_color_parse (const gchar *spec,
137  GdkColor *color);
138 guint gdk_color_hash (const GdkColor *colora);
139 gboolean gdk_color_equal (const GdkColor *colora,
140  const GdkColor *colorb);
142 
143 GType gdk_color_get_type (void) G_GNUC_CONST;
144 
145 /* The following functions are deprecated */
146 #ifndef GDK_DISABLE_DEPRECATED
148  GdkColor *colors,
149  gint ncolors);
150 gint gdk_color_white (GdkColormap *colormap,
151  GdkColor *color);
152 gint gdk_color_black (GdkColormap *colormap,
153  GdkColor *color);
154 gint gdk_color_alloc (GdkColormap *colormap,
155  GdkColor *color);
157  GdkColor *color);
158 #endif /* GDK_DISABLE_DEPRECATED */
159 
160 #if !defined (GDK_DISABLE_DEPRECATED) || defined (GDK_COMPILATION)
161 /* Used by gdk_rgb_try_colormap () */
163  gboolean contiguous,
164  gulong *planes,
165  gint nplanes,
166  gulong *pixels,
167  gint npixels);
168 void gdk_colors_free (GdkColormap *colormap,
169  gulong *pixels,
170  gint npixels,
171  gulong planes);
172 #endif /* !GDK_DISABLE_DEPRECATED || GDK_COMPILATION */
173 
174 G_END_DECLS
175 
176 #endif /* __GDK_COLOR_H__ */
gint gdk_color_alloc(GdkColormap *colormap, GdkColor *color)
void gdk_colors_store(GdkColormap *colormap, GdkColor *colors, gint ncolors)
GdkVisual * gdk_colormap_get_visual(GdkColormap *colormap)
gint gdk_color_white(GdkColormap *colormap, GdkColor *color)
gint gdk_color_black(GdkColormap *colormap, GdkColor *color)
GdkScreen * gdk_colormap_get_screen(GdkColormap *cmap)
void gdk_colors_free(GdkColormap *colormap, gulong *pixels, gint npixels, gulong planes)
GType gdk_color_get_type(void) G_GNUC_CONST
GdkColormap * gdk_colormap_new(GdkVisual *visual, gboolean allocate)
gint gdk_colors_alloc(GdkColormap *colormap, gboolean contiguous, gulong *planes, gint nplanes, gulong *pixels, gint npixels)
GType gdk_colormap_get_type(void) G_GNUC_CONST
gint gdk_color_change(GdkColormap *colormap, GdkColor *color)
void gdk_colormap_query_color(GdkColormap *colormap, gulong pixel, GdkColor *result)
gboolean gdk_colormap_alloc_color(GdkColormap *colormap, GdkColor *color, gboolean writeable, gboolean best_match)
gboolean gdk_color_equal(const GdkColor *colora, const GdkColor *colorb)
guint gdk_color_hash(const GdkColor *colora)
gint gdk_colormap_alloc_colors(GdkColormap *colormap, GdkColor *colors, gint n_colors, gboolean writeable, gboolean best_match, gboolean *success)
gboolean gdk_color_parse(const gchar *spec, GdkColor *color)
void gdk_colormap_unref(GdkColormap *cmap)
void gdk_colormap_change(GdkColormap *colormap, gint ncolors)
gchar * gdk_color_to_string(const GdkColor *color)
GdkColormap * gdk_colormap_ref(GdkColormap *cmap)
void gdk_colormap_free_colors(GdkColormap *colormap, const GdkColor *colors, gint n_colors)
void gdk_color_free(GdkColor *color)
GdkColor * gdk_color_copy(const GdkColor *color)
gint gdk_colormap_get_system_size(void)
GdkColormap * gdk_colormap_get_system(void)
PBD::PropertyDescriptor< uint32_t > color
guint16 blue
Definition: gdkcolor.h:51
guint16 green
Definition: gdkcolor.h:50
guint16 red
Definition: gdkcolor.h:49
guint32 pixel
Definition: gdkcolor.h:48
GObjectClass parent_class
Definition: gdkcolor.h:85
gpointer GSEAL(windowing_data)
gint GSEAL(size)
GdkColor * GSEAL(colors)
GObject parent_instance
Definition: gdkcolor.h:71
GdkVisual * GSEAL(visual)