~canonical-dx-team/ubuntu/maverick/gtk+2.0/menuproxy

« back to all changes in this revision

Viewing changes to docs/reference/gdk/html/gdk-Colormaps-and-Colors.html

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2007-05-04 12:24:25 UTC
  • mfrom: (1.1.21 upstream)
  • Revision ID: james.westby@ubuntu.com-20070504122425-0m8midgzrp40y8w2
Tags: 2.10.12-1ubuntu1
* Sync with Debian
* New upstream version:
  Fixed bugs:
  - 379414 file chooser warnings when changing path in the entry
  - 418585 GtkFileChooserDefault sizing code is not DPI independent
  - 419568 Crash in search if start with special letter
  - 435062 build dies with icon cache validation
  - 379399 Segfault to call gtk_print_operation_run twice.
  - 387889 cups backend has problems when there are too many printers
  - 418531 invalid read to gtkicontheme.c gtk_icon_theme_lookup_icon...
  - 423916 crash in color scheme code
  - 424042 Segmentation fault while quickly pressing Alt+arrows
  - 415260 Protect against negative indices when setting values in G...
  - 419171 XGetVisualInfo() may not set nxvisuals
  - 128852 Gdk cursors don't look good on win32
  - 344657 Ctrl-H doesn't toggle "Show Hidden Files" setting
  - 345345 PrintOperation::paginate is not emitted for class handler
  - 347567 GtkPrintOperation::end-print is not emitted if it's cance...
  - 369112 gtk_ui_manager_add_ui should accept unnamed separator
  - 392015 Selected menu item invisible on Windows Vista
  - 399253 MS-Windows Theme Bottom Tab placement rendering glitches
  - 399425 gtk_input_dialog_fill_axes() adds child to gtkscrolledwin...
  - 403251 [patch] little memory leak in GtkPrintJob
  - 403267 [patch] memory leak in GtkPageSetupUnixDialog
  - 403470 MS-Windows Theme tab placement other than on top leaks a ...
  - 404506 Windows system fonts that have multi-byte font names cann...
  - 405089 Incorrect window placement for GtkEventBox private window
  - 405515 Minor leak in gtkfilesystemmodel.c
  - 405539 gdk_pixbuf_save() for PNG saver can return FALSE without ...
  - 415681 gdk_window_clear_area includes an extra line and column o...
  - 418219 GtkRecentChooser should apply filter before sorting and c...
  - 418403 Scroll to printer after selecting it from settings
  - 421985 _gtk_print_operation_platform_backend_launch_preview
  - 421990 gtk_print_job_get_surface
  - 421993 gtk_print_operation_init
  - 423064 Conditional jump or move depends on uninitialised value(s...
  - 423722 Fix printing header in gtk-demo
  - 424168 gtk_print_operation_run on async preview
  - 425655 Don't install gtk+-unix-print-2.0.pc on non-UNIX platforms
  - 425786 GDK segfaults if XineramaQueryScreens fails
  - 428665 Lpr Backend gets stuck in infinite loop during gtk_enumer...
  - 429902 GtkPrintOperation leaks cairo contextes
  - 431997 First delay of GdkPixbufAnimationIter is wrong
  - 433242 Inconsistent scroll arrow position calculations
  - 433972 Placing gtk.Expander inside a gtk.TextView() changes gtk....
  - 434261 _gtk_toolbar_elide_underscores incorrectly handles some s...
  - 383354 ctrl-L should make 'Location' entry disappear
  - 418673 gtk_recent_manager_add_item
  - 429732 gtk_accel_group_finalize accesses invalid memory
  - 435028 WM_CLIENT_LEADER is wrong on the leader_window
  - 431067 Background of the header window is not updated
  - 338843 add recent files support inside the ui manager
  - 148535 add drop shadow to menus, tooltips, etc. under Windows XP
* debian/control.in:
  - Conflicts on ubuntulooks (<= 0.9.11-1)
* debian/patches/15_default-fallback-icon-theme.patch:
  - patch from Debian, fallback on gnome icon theme

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 
2
<html>
 
3
<head>
 
4
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
 
5
<title>Colormaps and Colors</title>
 
6
<meta name="generator" content="DocBook XSL Stylesheets V1.72.0">
 
7
<link rel="start" href="index.html" title="GDK Reference Manual">
 
8
<link rel="up" href="reference.html" title="API Reference">
 
9
<link rel="prev" href="gdk-Pixbufs.html" title="Pixbufs">
 
10
<link rel="next" href="gdk-Visuals.html" title="Visuals">
 
11
<meta name="generator" content="GTK-Doc V1.7 (XML mode)">
 
12
<link rel="stylesheet" href="style.css" type="text/css">
 
13
<link rel="reference" href="reference.html" title="API Reference">
 
14
<link rel="index" href="ix01.html" title="Index">
 
15
<link rel="index" href="ix02.html" title="Index of deprecated symbols">
 
16
<link rel="index" href="ix03.html" title="Index of new symbols in 2.2">
 
17
<link rel="index" href="ix04.html" title="Index of new symbols in 2.4">
 
18
<link rel="index" href="ix05.html" title="Index of new symbols in 2.6">
 
19
<link rel="index" href="ix06.html" title="Index of new symbols in 2.8">
 
20
<link rel="index" href="ix07.html" title="Index of new symbols in 2.10">
 
21
</head>
 
22
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
 
23
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
 
24
<tr valign="middle">
 
25
<td><a accesskey="p" href="gdk-Pixbufs.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
 
26
<td><a accesskey="u" href="reference.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
 
27
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
 
28
<th width="100%" align="center">GDK Reference Manual</th>
 
29
<td><a accesskey="n" href="gdk-Visuals.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
 
30
</tr>
 
31
<tr><td colspan="5" class="shortcuts"><nobr><a href="#id2660088" class="shortcut">Top</a>
 
32
                  &#160;|&#160;
 
33
                  <a href="#id2660882" class="shortcut">Description</a></nobr></td></tr>
 
34
</table>
 
35
<div class="refentry" lang="en">
 
36
<a name="gdk-Colormaps-and-Colors"></a><div class="titlepage"></div>
 
37
<div class="refnamediv"><table width="100%"><tr>
 
38
<td valign="top">
 
39
<h2>
 
40
<a name="id2660088"></a><span class="refentrytitle">Colormaps and Colors</span>
 
41
</h2>
 
42
<p>Colormaps and Colors &#8212; Manipulation of colors and colormaps</p>
 
43
</td>
 
44
<td valign="top" align="right"></td>
 
45
</tr></table></div>
 
46
<div class="refsynopsisdiv">
 
47
<h2>Synopsis</h2>
 
48
<pre class="synopsis">
 
49
 
 
50
#include &lt;gdk/gdk.h&gt;
 
51
 
 
52
 
 
53
                    <a href="gdk-Colormaps-and-Colors.html#GdkColor">GdkColor</a>;
 
54
                    <a href="gdk-Colormaps-and-Colors.html#GdkColormap">GdkColormap</a>;
 
55
<a href="gdk-Colormaps-and-Colors.html#GdkColormap">GdkColormap</a>*        <a href="gdk-Colormaps-and-Colors.html#gdk-colormap-new">gdk_colormap_new</a>                    (<a href="gdk-Visuals.html#GdkVisual">GdkVisual</a> *visual,
 
56
                                                         gboolean allocate);
 
57
<a href="gdk-Colormaps-and-Colors.html#GdkColormap">GdkColormap</a>*        <a href="gdk-Colormaps-and-Colors.html#gdk-colormap-ref">gdk_colormap_ref</a>                    (<a href="gdk-Colormaps-and-Colors.html#GdkColormap">GdkColormap</a> *cmap);
 
58
void                <a href="gdk-Colormaps-and-Colors.html#gdk-colormap-unref">gdk_colormap_unref</a>                  (<a href="gdk-Colormaps-and-Colors.html#GdkColormap">GdkColormap</a> *cmap);
 
59
<a href="gdk-Colormaps-and-Colors.html#GdkColormap">GdkColormap</a>*        <a href="gdk-Colormaps-and-Colors.html#gdk-colormap-get-system">gdk_colormap_get_system</a>             (void);
 
60
gint                <a href="gdk-Colormaps-and-Colors.html#gdk-colormap-get-system-size">gdk_colormap_get_system_size</a>        (void);
 
61
void                <a href="gdk-Colormaps-and-Colors.html#gdk-colormap-change">gdk_colormap_change</a>                 (<a href="gdk-Colormaps-and-Colors.html#GdkColormap">GdkColormap</a> *colormap,
 
62
                                                         gint ncolors);
 
63
gint                <a href="gdk-Colormaps-and-Colors.html#gdk-colormap-alloc-colors">gdk_colormap_alloc_colors</a>           (<a href="gdk-Colormaps-and-Colors.html#GdkColormap">GdkColormap</a> *colormap,
 
64
                                                         <a href="gdk-Colormaps-and-Colors.html#GdkColor">GdkColor</a> *colors,
 
65
                                                         gint ncolors,
 
66
                                                         gboolean writeable,
 
67
                                                         gboolean best_match,
 
68
                                                         gboolean *success);
 
69
gboolean            <a href="gdk-Colormaps-and-Colors.html#gdk-colormap-alloc-color">gdk_colormap_alloc_color</a>            (<a href="gdk-Colormaps-and-Colors.html#GdkColormap">GdkColormap</a> *colormap,
 
70
                                                         <a href="gdk-Colormaps-and-Colors.html#GdkColor">GdkColor</a> *color,
 
71
                                                         gboolean writeable,
 
72
                                                         gboolean best_match);
 
73
void                <a href="gdk-Colormaps-and-Colors.html#gdk-colormap-free-colors">gdk_colormap_free_colors</a>            (<a href="gdk-Colormaps-and-Colors.html#GdkColormap">GdkColormap</a> *colormap,
 
74
                                                         <a href="gdk-Colormaps-and-Colors.html#GdkColor">GdkColor</a> *colors,
 
75
                                                         gint ncolors);
 
76
void                <a href="gdk-Colormaps-and-Colors.html#gdk-colormap-query-color">gdk_colormap_query_color</a>            (<a href="gdk-Colormaps-and-Colors.html#GdkColormap">GdkColormap</a> *colormap,
 
77
                                                         gulong pixel,
 
78
                                                         <a href="gdk-Colormaps-and-Colors.html#GdkColor">GdkColor</a> *result);
 
79
<a href="gdk-Visuals.html#GdkVisual">GdkVisual</a>*          <a href="gdk-Colormaps-and-Colors.html#gdk-colormap-get-visual">gdk_colormap_get_visual</a>             (<a href="gdk-Colormaps-and-Colors.html#GdkColormap">GdkColormap</a> *colormap);
 
80
<a href="GdkScreen.html" title="GdkScreen">GdkScreen</a>*          <a href="gdk-Colormaps-and-Colors.html#gdk-colormap-get-screen">gdk_colormap_get_screen</a>             (<a href="gdk-Colormaps-and-Colors.html#GdkColormap">GdkColormap</a> *cmap);
 
81
void                <a href="gdk-Colormaps-and-Colors.html#gdk-colors-store">gdk_colors_store</a>                    (<a href="gdk-Colormaps-and-Colors.html#GdkColormap">GdkColormap</a> *colormap,
 
82
                                                         <a href="gdk-Colormaps-and-Colors.html#GdkColor">GdkColor</a> *colors,
 
83
                                                         gint ncolors);
 
84
<a href="gdk-Colormaps-and-Colors.html#GdkColor">GdkColor</a>*           <a href="gdk-Colormaps-and-Colors.html#gdk-color-copy">gdk_color_copy</a>                      (const <a href="gdk-Colormaps-and-Colors.html#GdkColor">GdkColor</a> *color);
 
85
void                <a href="gdk-Colormaps-and-Colors.html#gdk-color-free">gdk_color_free</a>                      (<a href="gdk-Colormaps-and-Colors.html#GdkColor">GdkColor</a> *color);
 
86
gint                <a href="gdk-Colormaps-and-Colors.html#gdk-colors-alloc">gdk_colors_alloc</a>                    (<a href="gdk-Colormaps-and-Colors.html#GdkColormap">GdkColormap</a> *colormap,
 
87
                                                         gboolean contiguous,
 
88
                                                         gulong *planes,
 
89
                                                         gint nplanes,
 
90
                                                         gulong *pixels,
 
91
                                                         gint npixels);
 
92
void                <a href="gdk-Colormaps-and-Colors.html#gdk-colors-free">gdk_colors_free</a>                     (<a href="gdk-Colormaps-and-Colors.html#GdkColormap">GdkColormap</a> *colormap,
 
93
                                                         gulong *pixels,
 
94
                                                         gint npixels,
 
95
                                                         gulong planes);
 
96
gint                <a href="gdk-Colormaps-and-Colors.html#gdk-color-white">gdk_color_white</a>                     (<a href="gdk-Colormaps-and-Colors.html#GdkColormap">GdkColormap</a> *colormap,
 
97
                                                         <a href="gdk-Colormaps-and-Colors.html#GdkColor">GdkColor</a> *color);
 
98
gint                <a href="gdk-Colormaps-and-Colors.html#gdk-color-black">gdk_color_black</a>                     (<a href="gdk-Colormaps-and-Colors.html#GdkColormap">GdkColormap</a> *colormap,
 
99
                                                         <a href="gdk-Colormaps-and-Colors.html#GdkColor">GdkColor</a> *color);
 
100
gboolean            <a href="gdk-Colormaps-and-Colors.html#gdk-color-parse">gdk_color_parse</a>                     (const gchar *spec,
 
101
                                                         <a href="gdk-Colormaps-and-Colors.html#GdkColor">GdkColor</a> *color);
 
102
gint                <a href="gdk-Colormaps-and-Colors.html#gdk-color-alloc">gdk_color_alloc</a>                     (<a href="gdk-Colormaps-and-Colors.html#GdkColormap">GdkColormap</a> *colormap,
 
103
                                                         <a href="gdk-Colormaps-and-Colors.html#GdkColor">GdkColor</a> *color);
 
104
gint                <a href="gdk-Colormaps-and-Colors.html#gdk-color-change">gdk_color_change</a>                    (<a href="gdk-Colormaps-and-Colors.html#GdkColormap">GdkColormap</a> *colormap,
 
105
                                                         <a href="gdk-Colormaps-and-Colors.html#GdkColor">GdkColor</a> *color);
 
106
gboolean            <a href="gdk-Colormaps-and-Colors.html#gdk-color-equal">gdk_color_equal</a>                     (const <a href="gdk-Colormaps-and-Colors.html#GdkColor">GdkColor</a> *colora,
 
107
                                                         const <a href="gdk-Colormaps-and-Colors.html#GdkColor">GdkColor</a> *colorb);
 
108
guint               <a href="gdk-Colormaps-and-Colors.html#gdk-color-hash">gdk_color_hash</a>                      (const <a href="gdk-Colormaps-and-Colors.html#GdkColor">GdkColor</a> *colora);
 
109
 
 
110
 
 
111
</pre>
 
112
</div>
 
113
<div class="refsect1" lang="en">
 
114
<a name="id2660882"></a><h2>Description</h2>
 
115
<p>
 
116
These functions are used to modify colormaps.
 
117
A colormap is an object that contains the mapping
 
118
between the color values stored in memory and
 
119
the RGB values that are used to display color
 
120
values. In general, colormaps only contain
 
121
significant information for pseudo-color visuals,
 
122
but even for other visual types, a colormap object
 
123
is required in some circumstances.
 
124
</p>
 
125
<p>
 
126
There are a couple of special colormaps that can
 
127
be retrieved. The system colormap (retrieved 
 
128
with <a href="gdk-Colormaps-and-Colors.html#gdk-colormap-get-system"><code class="function">gdk_colormap_get_system()</code></a>) is the default
 
129
colormap of the system. If you are using GdkRGB,
 
130
there is another colormap that is important - the
 
131
colormap in which GdkRGB works, retrieved with
 
132
<a href="gdk-GdkRGB.html#gdk-rgb-get-cmap"><code class="function">gdk_rgb_get_cmap()</code></a>. However, when using GdkRGB, 
 
133
it is not generally necessary to allocate colors
 
134
directly.
 
135
</p>
 
136
<p>
 
137
In previous revisions of this interface, a number
 
138
of functions that take a <a href="gdk-Colormaps-and-Colors.html#GdkColormap"><span class="type">GdkColormap</span></a> parameter
 
139
were replaced with functions whose names began
 
140
with "gdk_colormap_". This process will probably
 
141
be extended somewhat in the future - 
 
142
<a href="gdk-Colormaps-and-Colors.html#gdk-color-white"><code class="function">gdk_color_white()</code></a>, <a href="gdk-Colormaps-and-Colors.html#gdk-color-black"><code class="function">gdk_color_black()</code></a>, and 
 
143
<a href="gdk-Colormaps-and-Colors.html#gdk-color-change"><code class="function">gdk_color_change()</code></a> will probably become aliases.
 
144
</p>
 
145
</div>
 
146
<div class="refsect1" lang="en">
 
147
<a name="id2660980"></a><h2>Details</h2>
 
148
<div class="refsect2" lang="en">
 
149
<a name="id2660991"></a><h3>
 
150
<a name="GdkColor"></a>GdkColor</h3>
 
151
<a class="indexterm" name="id2661003"></a><pre class="programlisting">typedef struct {
 
152
  guint32 pixel;
 
153
  guint16 red;
 
154
  guint16 green;
 
155
  guint16 blue;
 
156
} GdkColor;
 
157
</pre>
 
158
<p>
 
159
The <a href="gdk-Colormaps-and-Colors.html#GdkColor"><span class="type">GdkColor</span></a> structure is used to describe an 
 
160
allocated or unallocated color.
 
161
</p>
 
162
<div class="variablelist"><table border="0">
 
163
<col align="left" valign="top">
 
164
<tbody>
 
165
<tr>
 
166
<td><span class="term">guint32&#160;<em class="structfield"><code>pixel</code></em>;</span></td>
 
167
<td>For allocated colors, the value used to
 
168
  draw this color on the screen.
 
169
</td>
 
170
</tr>
 
171
<tr>
 
172
<td><span class="term">guint16&#160;<em class="structfield"><code>red</code></em>;</span></td>
 
173
<td>The red component of the color. This is
 
174
  a value between 0 and 65535, with 65535 indicating
 
175
  full intensitiy.
 
176
</td>
 
177
</tr>
 
178
<tr>
 
179
<td><span class="term">guint16&#160;<em class="structfield"><code>green</code></em>;</span></td>
 
180
<td>The blue component of the color.
 
181
</td>
 
182
</tr>
 
183
<tr>
 
184
<td><span class="term">guint16&#160;<em class="structfield"><code>blue</code></em>;</span></td>
 
185
<td>The green component of the color.
 
186
 
 
187
</td>
 
188
</tr>
 
189
</tbody>
 
190
</table></div>
 
191
</div>
 
192
<hr>
 
193
<div class="refsect2" lang="en">
 
194
<a name="id2661117"></a><h3>
 
195
<a name="GdkColormap"></a>GdkColormap</h3>
 
196
<a class="indexterm" name="id2661129"></a><pre class="programlisting">typedef struct {
 
197
  gint      size;
 
198
  GdkColor *colors;
 
199
} GdkColormap;
 
200
</pre>
 
201
<p>
 
202
The colormap structure contains the following public fields.
 
203
</p>
 
204
<div class="variablelist"><table border="0">
 
205
<col align="left" valign="top">
 
206
<tbody>
 
207
<tr>
 
208
<td><span class="term">gint&#160;<em class="structfield"><code>size</code></em>;</span></td>
 
209
<td>For pseudo-color colormaps, the number of colors
 
210
  in the colormap.
 
211
</td>
 
212
</tr>
 
213
<tr>
 
214
<td><span class="term"><a href="gdk-Colormaps-and-Colors.html#GdkColor">GdkColor</a>&#160;*<em class="structfield"><code>colors</code></em>;</span></td>
 
215
<td>An array containing the current values in the
 
216
  colormap. This can be used to map from pixel values
 
217
  back to RGB values. This is only meaningful for
 
218
  pseudo-color colormaps.
 
219
 
 
220
</td>
 
221
</tr>
 
222
</tbody>
 
223
</table></div>
 
224
</div>
 
225
<hr>
 
226
<div class="refsect2" lang="en">
 
227
<a name="id2661195"></a><h3>
 
228
<a name="gdk-colormap-new"></a>gdk_colormap_new ()</h3>
 
229
<a class="indexterm" name="id2661208"></a><pre class="programlisting"><a href="gdk-Colormaps-and-Colors.html#GdkColormap">GdkColormap</a>*        gdk_colormap_new                    (<a href="gdk-Visuals.html#GdkVisual">GdkVisual</a> *visual,
 
230
                                                         gboolean allocate);</pre>
 
231
<p>
 
232
Creates a new colormap for the given visual.</p>
 
233
<p>
 
234
</p>
 
235
<div class="variablelist"><table border="0">
 
236
<col align="left" valign="top">
 
237
<tbody>
 
238
<tr>
 
239
<td><span class="term"><em class="parameter"><code>visual</code></em>&#160;:</span></td>
 
240
<td> a <a href="gdk-Visuals.html#GdkVisual"><span class="type">GdkVisual</span></a>.
 
241
</td>
 
242
</tr>
 
243
<tr>
 
244
<td><span class="term"><em class="parameter"><code>allocate</code></em>&#160;:</span></td>
 
245
<td> if <code class="literal">TRUE</code>, the newly created colormap will be
 
246
a private colormap, and all colors in it will be
 
247
allocated for the applications use.
 
248
</td>
 
249
</tr>
 
250
<tr>
 
251
<td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
 
252
<td> the new <a href="gdk-Colormaps-and-Colors.html#GdkColormap"><span class="type">GdkColormap</span></a>.
 
253
</td>
 
254
</tr>
 
255
</tbody>
 
256
</table></div>
 
257
</div>
 
258
<hr>
 
259
<div class="refsect2" lang="en">
 
260
<a name="id2661318"></a><h3>
 
261
<a name="gdk-colormap-ref"></a>gdk_colormap_ref ()</h3>
 
262
<a class="indexterm" name="id2661333"></a><pre class="programlisting"><a href="gdk-Colormaps-and-Colors.html#GdkColormap">GdkColormap</a>*        gdk_colormap_ref                    (<a href="gdk-Colormaps-and-Colors.html#GdkColormap">GdkColormap</a> *cmap);</pre>
 
263
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
 
264
<h3 class="title">Warning</h3>
 
265
<p><code class="literal">gdk_colormap_ref</code> is deprecated and should not be used in newly-written code.</p>
 
266
</div>
 
267
<p>
 
268
Deprecated function; use <code class="function">g_object_ref()</code> instead.</p>
 
269
<p>
 
270
 
 
271
</p>
 
272
<div class="variablelist"><table border="0">
 
273
<col align="left" valign="top">
 
274
<tbody>
 
275
<tr>
 
276
<td><span class="term"><em class="parameter"><code>cmap</code></em>&#160;:</span></td>
 
277
<td> a <a href="gdk-Colormaps-and-Colors.html#GdkColormap"><span class="type">GdkColormap</span></a>
 
278
</td>
 
279
</tr>
 
280
<tr>
 
281
<td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
 
282
<td> the colormap
 
283
</td>
 
284
</tr>
 
285
</tbody>
 
286
</table></div>
 
287
</div>
 
288
<hr>
 
289
<div class="refsect2" lang="en">
 
290
<a name="id2661424"></a><h3>
 
291
<a name="gdk-colormap-unref"></a>gdk_colormap_unref ()</h3>
 
292
<a class="indexterm" name="id2661440"></a><pre class="programlisting">void                gdk_colormap_unref                  (<a href="gdk-Colormaps-and-Colors.html#GdkColormap">GdkColormap</a> *cmap);</pre>
 
293
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
 
294
<h3 class="title">Warning</h3>
 
295
<p><code class="literal">gdk_colormap_unref</code> is deprecated and should not be used in newly-written code.</p>
 
296
</div>
 
297
<p>
 
298
Deprecated function; use <code class="function">g_object_ref()</code> instead.</p>
 
299
<p>
 
300
 
 
301
</p>
 
302
<div class="variablelist"><table border="0">
 
303
<col align="left" valign="top">
 
304
<tbody><tr>
 
305
<td><span class="term"><em class="parameter"><code>cmap</code></em>&#160;:</span></td>
 
306
<td> a <a href="gdk-Colormaps-and-Colors.html#GdkColormap"><span class="type">GdkColormap</span></a>
 
307
</td>
 
308
</tr></tbody>
 
309
</table></div>
 
310
</div>
 
311
<hr>
 
312
<div class="refsect2" lang="en">
 
313
<a name="id2661520"></a><h3>
 
314
<a name="gdk-colormap-get-system"></a>gdk_colormap_get_system ()</h3>
 
315
<a class="indexterm" name="id2661534"></a><pre class="programlisting"><a href="gdk-Colormaps-and-Colors.html#GdkColormap">GdkColormap</a>*        gdk_colormap_get_system             (void);</pre>
 
316
<p>
 
317
Gets the system's default colormap for the default screen. (See
 
318
<code class="function">gdk_colormap_get_system_for_screen()</code>)</p>
 
319
<p>
 
320
</p>
 
321
<div class="variablelist"><table border="0">
 
322
<col align="left" valign="top">
 
323
<tbody><tr>
 
324
<td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
 
325
<td> the default colormap.
 
326
</td>
 
327
</tr></tbody>
 
328
</table></div>
 
329
</div>
 
330
<hr>
 
331
<div class="refsect2" lang="en">
 
332
<a name="id2661588"></a><h3>
 
333
<a name="gdk-colormap-get-system-size"></a>gdk_colormap_get_system_size ()</h3>
 
334
<a class="indexterm" name="id2661603"></a><pre class="programlisting">gint                gdk_colormap_get_system_size        (void);</pre>
 
335
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
 
336
<h3 class="title">Warning</h3>
 
337
<p><code class="literal">gdk_colormap_get_system_size</code> is deprecated and should not be used in newly-written code.</p>
 
338
</div>
 
339
<p>
 
340
Returns the size of the system's default colormap.
 
341
(See the description of struct <a href="gdk-Colormaps-and-Colors.html#GdkColormap"><span class="type">GdkColormap</span></a> for an
 
342
explanation of the size of a colormap.)</p>
 
343
<p>
 
344
</p>
 
345
<div class="variablelist"><table border="0">
 
346
<col align="left" valign="top">
 
347
<tbody><tr>
 
348
<td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
 
349
<td> the size of the system's default colormap.
 
350
</td>
 
351
</tr></tbody>
 
352
</table></div>
 
353
</div>
 
354
<hr>
 
355
<div class="refsect2" lang="en">
 
356
<a name="id2661666"></a><h3>
 
357
<a name="gdk-colormap-change"></a>gdk_colormap_change ()</h3>
 
358
<a class="indexterm" name="id2661681"></a><pre class="programlisting">void                gdk_colormap_change                 (<a href="gdk-Colormaps-and-Colors.html#GdkColormap">GdkColormap</a> *colormap,
 
359
                                                         gint ncolors);</pre>
 
360
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
 
361
<h3 class="title">Warning</h3>
 
362
<p><code class="literal">gdk_colormap_change</code> is deprecated and should not be used in newly-written code.</p>
 
363
</div>
 
364
<p>
 
365
Changes the value of the first <em class="parameter"><code>ncolors</code></em> in a private colormap
 
366
to match the values in the <em class="structfield"><code>colors</code></em>
 
367
array in the colormap. This function is obsolete and
 
368
should not be used. See <a href="gdk-Colormaps-and-Colors.html#gdk-color-change"><code class="function">gdk_color_change()</code></a>.</p>
 
369
<p>
 
370
</p>
 
371
<div class="variablelist"><table border="0">
 
372
<col align="left" valign="top">
 
373
<tbody>
 
374
<tr>
 
375
<td><span class="term"><em class="parameter"><code>colormap</code></em>&#160;:</span></td>
 
376
<td> a <a href="gdk-Colormaps-and-Colors.html#GdkColormap"><span class="type">GdkColormap</span></a>.
 
377
</td>
 
378
</tr>
 
379
<tr>
 
380
<td><span class="term"><em class="parameter"><code>ncolors</code></em>&#160;:</span></td>
 
381
<td> the number of colors to change.
 
382
</td>
 
383
</tr>
 
384
</tbody>
 
385
</table></div>
 
386
</div>
 
387
<hr>
 
388
<div class="refsect2" lang="en">
 
389
<a name="id2661795"></a><h3>
 
390
<a name="gdk-colormap-alloc-colors"></a>gdk_colormap_alloc_colors ()</h3>
 
391
<a class="indexterm" name="id2661809"></a><pre class="programlisting">gint                gdk_colormap_alloc_colors           (<a href="gdk-Colormaps-and-Colors.html#GdkColormap">GdkColormap</a> *colormap,
 
392
                                                         <a href="gdk-Colormaps-and-Colors.html#GdkColor">GdkColor</a> *colors,
 
393
                                                         gint ncolors,
 
394
                                                         gboolean writeable,
 
395
                                                         gboolean best_match,
 
396
                                                         gboolean *success);</pre>
 
397
<p>
 
398
Allocates colors from a colormap.</p>
 
399
<p>
 
400
</p>
 
401
<div class="variablelist"><table border="0">
 
402
<col align="left" valign="top">
 
403
<tbody>
 
404
<tr>
 
405
<td><span class="term"><em class="parameter"><code>colormap</code></em>&#160;:</span></td>
 
406
<td> a <a href="gdk-Colormaps-and-Colors.html#GdkColormap"><span class="type">GdkColormap</span></a>.
 
407
</td>
 
408
</tr>
 
409
<tr>
 
410
<td><span class="term"><em class="parameter"><code>colors</code></em>&#160;:</span></td>
 
411
<td> The color values to allocate. On return, the pixel
 
412
   values for allocated colors will be filled in.
 
413
</td>
 
414
</tr>
 
415
<tr>
 
416
<td><span class="term"><em class="parameter"><code>ncolors</code></em>&#160;:</span></td>
 
417
<td> The number of colors in <em class="parameter"><code>colors</code></em>.
 
418
</td>
 
419
</tr>
 
420
<tr>
 
421
<td><span class="term"><em class="parameter"><code>writeable</code></em>&#160;:</span></td>
 
422
<td> If <code class="literal">TRUE</code>, the colors are allocated writeable
 
423
   (their values can later be changed using <a href="gdk-Colormaps-and-Colors.html#gdk-color-change"><code class="function">gdk_color_change()</code></a>).
 
424
   Writeable colors cannot be shared between applications.
 
425
</td>
 
426
</tr>
 
427
<tr>
 
428
<td><span class="term"><em class="parameter"><code>best_match</code></em>&#160;:</span></td>
 
429
<td> If <code class="literal">TRUE</code>, GDK will attempt to do matching against
 
430
   existing colors if the colors cannot be allocated as requested.
 
431
</td>
 
432
</tr>
 
433
<tr>
 
434
<td><span class="term"><em class="parameter"><code>success</code></em>&#160;:</span></td>
 
435
<td> An array of length <em class="parameter"><code>ncolors</code></em>. On return, this
 
436
  indicates whether the corresponding color in <em class="parameter"><code>colors</code></em> was
 
437
  successfully allocated or not.
 
438
</td>
 
439
</tr>
 
440
<tr>
 
441
<td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
 
442
<td> The number of colors that were not successfully 
 
443
allocated.
 
444
</td>
 
445
</tr>
 
446
</tbody>
 
447
</table></div>
 
448
</div>
 
449
<hr>
 
450
<div class="refsect2" lang="en">
 
451
<a name="id2662043"></a><h3>
 
452
<a name="gdk-colormap-alloc-color"></a>gdk_colormap_alloc_color ()</h3>
 
453
<a class="indexterm" name="id2662056"></a><pre class="programlisting">gboolean            gdk_colormap_alloc_color            (<a href="gdk-Colormaps-and-Colors.html#GdkColormap">GdkColormap</a> *colormap,
 
454
                                                         <a href="gdk-Colormaps-and-Colors.html#GdkColor">GdkColor</a> *color,
 
455
                                                         gboolean writeable,
 
456
                                                         gboolean best_match);</pre>
 
457
<p>
 
458
Allocates a single color from a colormap.</p>
 
459
<p>
 
460
</p>
 
461
<div class="variablelist"><table border="0">
 
462
<col align="left" valign="top">
 
463
<tbody>
 
464
<tr>
 
465
<td><span class="term"><em class="parameter"><code>colormap</code></em>&#160;:</span></td>
 
466
<td> a <a href="gdk-Colormaps-and-Colors.html#GdkColormap"><span class="type">GdkColormap</span></a>.
 
467
</td>
 
468
</tr>
 
469
<tr>
 
470
<td><span class="term"><em class="parameter"><code>color</code></em>&#160;:</span></td>
 
471
<td> the color to allocate. On return the
 
472
   <em class="structfield"><code>pixel</code></em> field will be
 
473
   filled in if allocation succeeds.
 
474
</td>
 
475
</tr>
 
476
<tr>
 
477
<td><span class="term"><em class="parameter"><code>writeable</code></em>&#160;:</span></td>
 
478
<td> If <code class="literal">TRUE</code>, the color is allocated writeable
 
479
   (their values can later be changed using <a href="gdk-Colormaps-and-Colors.html#gdk-color-change"><code class="function">gdk_color_change()</code></a>).
 
480
   Writeable colors cannot be shared between applications.
 
481
</td>
 
482
</tr>
 
483
<tr>
 
484
<td><span class="term"><em class="parameter"><code>best_match</code></em>&#160;:</span></td>
 
485
<td> If <code class="literal">TRUE</code>, GDK will attempt to do matching against
 
486
   existing colors if the color cannot be allocated as requested.
 
487
</td>
 
488
</tr>
 
489
<tr>
 
490
<td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
 
491
<td> <code class="literal">TRUE</code> if the allocation succeeded.
 
492
</td>
 
493
</tr>
 
494
</tbody>
 
495
</table></div>
 
496
</div>
 
497
<hr>
 
498
<div class="refsect2" lang="en">
 
499
<a name="id2662240"></a><h3>
 
500
<a name="gdk-colormap-free-colors"></a>gdk_colormap_free_colors ()</h3>
 
501
<a class="indexterm" name="id2662253"></a><pre class="programlisting">void                gdk_colormap_free_colors            (<a href="gdk-Colormaps-and-Colors.html#GdkColormap">GdkColormap</a> *colormap,
 
502
                                                         <a href="gdk-Colormaps-and-Colors.html#GdkColor">GdkColor</a> *colors,
 
503
                                                         gint ncolors);</pre>
 
504
<p>
 
505
Frees previously allocated colors.</p>
 
506
<p>
 
507
</p>
 
508
<div class="variablelist"><table border="0">
 
509
<col align="left" valign="top">
 
510
<tbody>
 
511
<tr>
 
512
<td><span class="term"><em class="parameter"><code>colormap</code></em>&#160;:</span></td>
 
513
<td> a <a href="gdk-Colormaps-and-Colors.html#GdkColormap"><span class="type">GdkColormap</span></a>.
 
514
</td>
 
515
</tr>
 
516
<tr>
 
517
<td><span class="term"><em class="parameter"><code>colors</code></em>&#160;:</span></td>
 
518
<td> the colors to free.
 
519
</td>
 
520
</tr>
 
521
<tr>
 
522
<td><span class="term"><em class="parameter"><code>ncolors</code></em>&#160;:</span></td>
 
523
<td> the number of colors in <em class="parameter"><code>colors</code></em>.
 
524
</td>
 
525
</tr>
 
526
</tbody>
 
527
</table></div>
 
528
</div>
 
529
<hr>
 
530
<div class="refsect2" lang="en">
 
531
<a name="id2662360"></a><h3>
 
532
<a name="gdk-colormap-query-color"></a>gdk_colormap_query_color ()</h3>
 
533
<a class="indexterm" name="id2662373"></a><pre class="programlisting">void                gdk_colormap_query_color            (<a href="gdk-Colormaps-and-Colors.html#GdkColormap">GdkColormap</a> *colormap,
 
534
                                                         gulong pixel,
 
535
                                                         <a href="gdk-Colormaps-and-Colors.html#GdkColor">GdkColor</a> *result);</pre>
 
536
<p>
 
537
Locates the RGB color in <em class="parameter"><code>colormap</code></em> corresponding to the given
 
538
hardware pixel <em class="parameter"><code>pixel</code></em>. <em class="parameter"><code>pixel</code></em> must be a valid pixel in the
 
539
colormap; it's a programmer error to call this function with a
 
540
pixel which is not in the colormap. Hardware pixels are normally
 
541
obtained from <a href="gdk-Colormaps-and-Colors.html#gdk-colormap-alloc-colors"><code class="function">gdk_colormap_alloc_colors()</code></a>, or from a <a href="gdk-Images.html#GdkImage"><span class="type">GdkImage</span></a>. (A
 
542
<a href="gdk-Images.html#GdkImage"><span class="type">GdkImage</span></a> contains image data in hardware format, a <a
 
543
href="../gdk-pixbuf/gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf"
 
544
><span class="type">GdkPixbuf</span></a>
 
545
contains image data in a canonical 24-bit RGB format.)
 
546
</p>
 
547
<p>
 
548
This function is rarely useful; it's used for example to
 
549
implement the eyedropper feature in <span class="type">GtkColorSelection</span>.</p>
 
550
<p>
 
551
 
 
552
</p>
 
553
<div class="variablelist"><table border="0">
 
554
<col align="left" valign="top">
 
555
<tbody>
 
556
<tr>
 
557
<td><span class="term"><em class="parameter"><code>colormap</code></em>&#160;:</span></td>
 
558
<td> a <a href="gdk-Colormaps-and-Colors.html#GdkColormap"><span class="type">GdkColormap</span></a>
 
559
</td>
 
560
</tr>
 
561
<tr>
 
562
<td><span class="term"><em class="parameter"><code>pixel</code></em>&#160;:</span></td>
 
563
<td> pixel value in hardware display format
 
564
</td>
 
565
</tr>
 
566
<tr>
 
567
<td><span class="term"><em class="parameter"><code>result</code></em>&#160;:</span></td>
 
568
<td> <a href="gdk-Colormaps-and-Colors.html#GdkColor"><span class="type">GdkColor</span></a> with red, green, blue fields initialized
 
569
</td>
 
570
</tr>
 
571
</tbody>
 
572
</table></div>
 
573
</div>
 
574
<hr>
 
575
<div class="refsect2" lang="en">
 
576
<a name="id2662555"></a><h3>
 
577
<a name="gdk-colormap-get-visual"></a>gdk_colormap_get_visual ()</h3>
 
578
<a class="indexterm" name="id2662569"></a><pre class="programlisting"><a href="gdk-Visuals.html#GdkVisual">GdkVisual</a>*          gdk_colormap_get_visual             (<a href="gdk-Colormaps-and-Colors.html#GdkColormap">GdkColormap</a> *colormap);</pre>
 
579
<p>
 
580
Returns the visual for which a given colormap was created.</p>
 
581
<p>
 
582
</p>
 
583
<div class="variablelist"><table border="0">
 
584
<col align="left" valign="top">
 
585
<tbody>
 
586
<tr>
 
587
<td><span class="term"><em class="parameter"><code>colormap</code></em>&#160;:</span></td>
 
588
<td> a <a href="gdk-Colormaps-and-Colors.html#GdkColormap"><span class="type">GdkColormap</span></a>.
 
589
</td>
 
590
</tr>
 
591
<tr>
 
592
<td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
 
593
<td> the visual of the colormap.
 
594
</td>
 
595
</tr>
 
596
</tbody>
 
597
</table></div>
 
598
</div>
 
599
<hr>
 
600
<div class="refsect2" lang="en">
 
601
<a name="id2662638"></a><h3>
 
602
<a name="gdk-colormap-get-screen"></a>gdk_colormap_get_screen ()</h3>
 
603
<a class="indexterm" name="id2662653"></a><pre class="programlisting"><a href="GdkScreen.html" title="GdkScreen">GdkScreen</a>*          gdk_colormap_get_screen             (<a href="gdk-Colormaps-and-Colors.html#GdkColormap">GdkColormap</a> *cmap);</pre>
 
604
<p>
 
605
Gets the screen for which this colormap was created.</p>
 
606
<p>
 
607
 
 
608
</p>
 
609
<div class="variablelist"><table border="0">
 
610
<col align="left" valign="top">
 
611
<tbody>
 
612
<tr>
 
613
<td><span class="term"><em class="parameter"><code>cmap</code></em>&#160;:</span></td>
 
614
<td> a <a href="gdk-Colormaps-and-Colors.html#GdkColormap"><span class="type">GdkColormap</span></a>
 
615
</td>
 
616
</tr>
 
617
<tr>
 
618
<td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
 
619
<td> the screen for which this colormap was created.
 
620
 
 
621
</td>
 
622
</tr>
 
623
</tbody>
 
624
</table></div>
 
625
<p class="since">Since  2.2
 
626
</p>
 
627
</div>
 
628
<hr>
 
629
<div class="refsect2" lang="en">
 
630
<a name="id2662729"></a><h3>
 
631
<a name="gdk-colors-store"></a>gdk_colors_store ()</h3>
 
632
<a class="indexterm" name="id2662744"></a><pre class="programlisting">void                gdk_colors_store                    (<a href="gdk-Colormaps-and-Colors.html#GdkColormap">GdkColormap</a> *colormap,
 
633
                                                         <a href="gdk-Colormaps-and-Colors.html#GdkColor">GdkColor</a> *colors,
 
634
                                                         gint ncolors);</pre>
 
635
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
 
636
<h3 class="title">Warning</h3>
 
637
<p><code class="literal">gdk_colors_store</code> is deprecated and should not be used in newly-written code.</p>
 
638
</div>
 
639
<p>
 
640
Changes the value of the first <em class="parameter"><code>ncolors</code></em> colors in
 
641
a private colormap. This function is obsolete and
 
642
should not be used. See <a href="gdk-Colormaps-and-Colors.html#gdk-color-change"><code class="function">gdk_color_change()</code></a>.</p>
 
643
<p>
 
644
</p>
 
645
<div class="variablelist"><table border="0">
 
646
<col align="left" valign="top">
 
647
<tbody>
 
648
<tr>
 
649
<td><span class="term"><em class="parameter"><code>colormap</code></em>&#160;:</span></td>
 
650
<td> a <a href="gdk-Colormaps-and-Colors.html#GdkColormap"><span class="type">GdkColormap</span></a>.
 
651
</td>
 
652
</tr>
 
653
<tr>
 
654
<td><span class="term"><em class="parameter"><code>colors</code></em>&#160;:</span></td>
 
655
<td> the new color values.
 
656
</td>
 
657
</tr>
 
658
<tr>
 
659
<td><span class="term"><em class="parameter"><code>ncolors</code></em>&#160;:</span></td>
 
660
<td> the number of colors to change.
 
661
</td>
 
662
</tr>
 
663
</tbody>
 
664
</table></div>
 
665
</div>
 
666
<hr>
 
667
<div class="refsect2" lang="en">
 
668
<a name="id2662876"></a><h3>
 
669
<a name="gdk-color-copy"></a>gdk_color_copy ()</h3>
 
670
<a class="indexterm" name="id2662888"></a><pre class="programlisting"><a href="gdk-Colormaps-and-Colors.html#GdkColor">GdkColor</a>*           gdk_color_copy                      (const <a href="gdk-Colormaps-and-Colors.html#GdkColor">GdkColor</a> *color);</pre>
 
671
<p>
 
672
Makes a copy of a color structure. The result
 
673
must be freed using <a href="gdk-Colormaps-and-Colors.html#gdk-color-free"><code class="function">gdk_color_free()</code></a>.</p>
 
674
<p>
 
675
</p>
 
676
<div class="variablelist"><table border="0">
 
677
<col align="left" valign="top">
 
678
<tbody>
 
679
<tr>
 
680
<td><span class="term"><em class="parameter"><code>color</code></em>&#160;:</span></td>
 
681
<td> a <a href="gdk-Colormaps-and-Colors.html#GdkColor"><span class="type">GdkColor</span></a>.
 
682
</td>
 
683
</tr>
 
684
<tr>
 
685
<td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
 
686
<td> a copy of <em class="parameter"><code>color</code></em>.
 
687
</td>
 
688
</tr>
 
689
</tbody>
 
690
</table></div>
 
691
</div>
 
692
<hr>
 
693
<div class="refsect2" lang="en">
 
694
<a name="id2662973"></a><h3>
 
695
<a name="gdk-color-free"></a>gdk_color_free ()</h3>
 
696
<a class="indexterm" name="id2662986"></a><pre class="programlisting">void                gdk_color_free                      (<a href="gdk-Colormaps-and-Colors.html#GdkColor">GdkColor</a> *color);</pre>
 
697
<p>
 
698
Frees a color structure created with 
 
699
<a href="gdk-Colormaps-and-Colors.html#gdk-color-copy"><code class="function">gdk_color_copy()</code></a>.</p>
 
700
<p>
 
701
</p>
 
702
<div class="variablelist"><table border="0">
 
703
<col align="left" valign="top">
 
704
<tbody><tr>
 
705
<td><span class="term"><em class="parameter"><code>color</code></em>&#160;:</span></td>
 
706
<td> a <a href="gdk-Colormaps-and-Colors.html#GdkColor"><span class="type">GdkColor</span></a>.
 
707
</td>
 
708
</tr></tbody>
 
709
</table></div>
 
710
</div>
 
711
<hr>
 
712
<div class="refsect2" lang="en">
 
713
<a name="id2663054"></a><h3>
 
714
<a name="gdk-colors-alloc"></a>gdk_colors_alloc ()</h3>
 
715
<a class="indexterm" name="id2663069"></a><pre class="programlisting">gint                gdk_colors_alloc                    (<a href="gdk-Colormaps-and-Colors.html#GdkColormap">GdkColormap</a> *colormap,
 
716
                                                         gboolean contiguous,
 
717
                                                         gulong *planes,
 
718
                                                         gint nplanes,
 
719
                                                         gulong *pixels,
 
720
                                                         gint npixels);</pre>
 
721
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
 
722
<h3 class="title">Warning</h3>
 
723
<p><code class="literal">gdk_colors_alloc</code> is deprecated and should not be used in newly-written code.</p>
 
724
</div>
 
725
<p>
 
726
Allocates colors from a colormap. This function
 
727
is obsolete. See <a href="gdk-Colormaps-and-Colors.html#gdk-colormap-alloc-colors"><code class="function">gdk_colormap_alloc_colors()</code></a>.
 
728
For full documentation of the fields, see 
 
729
the Xlib documentation for <code class="function"><code class="function">XAllocColorCells()</code></code>.</p>
 
730
<p>
 
731
</p>
 
732
<div class="variablelist"><table border="0">
 
733
<col align="left" valign="top">
 
734
<tbody>
 
735
<tr>
 
736
<td><span class="term"><em class="parameter"><code>colormap</code></em>&#160;:</span></td>
 
737
<td> a <a href="gdk-Colormaps-and-Colors.html#GdkColormap"><span class="type">GdkColormap</span></a>.
 
738
</td>
 
739
</tr>
 
740
<tr>
 
741
<td><span class="term"><em class="parameter"><code>contiguous</code></em>&#160;:</span></td>
 
742
<td> if <code class="literal">TRUE</code>, the colors should be allocated
 
743
   in contiguous color cells.
 
744
</td>
 
745
</tr>
 
746
<tr>
 
747
<td><span class="term"><em class="parameter"><code>planes</code></em>&#160;:</span></td>
 
748
<td> an array in which to store the plane masks.
 
749
</td>
 
750
</tr>
 
751
<tr>
 
752
<td><span class="term"><em class="parameter"><code>nplanes</code></em>&#160;:</span></td>
 
753
<td> the number of planes to allocate. (Or zero,
 
754
   to indicate that the color allocation should not be planar.)
 
755
</td>
 
756
</tr>
 
757
<tr>
 
758
<td><span class="term"><em class="parameter"><code>pixels</code></em>&#160;:</span></td>
 
759
<td> an array into which to store allocated pixel values.
 
760
</td>
 
761
</tr>
 
762
<tr>
 
763
<td><span class="term"><em class="parameter"><code>npixels</code></em>&#160;:</span></td>
 
764
<td> the number of pixels in each plane to allocate.
 
765
</td>
 
766
</tr>
 
767
<tr>
 
768
<td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
 
769
<td> <code class="literal">TRUE</code> if the allocation was successful
 
770
</td>
 
771
</tr>
 
772
</tbody>
 
773
</table></div>
 
774
</div>
 
775
<hr>
 
776
<div class="refsect2" lang="en">
 
777
<a name="id2663312"></a><h3>
 
778
<a name="gdk-colors-free"></a>gdk_colors_free ()</h3>
 
779
<a class="indexterm" name="id2663327"></a><pre class="programlisting">void                gdk_colors_free                     (<a href="gdk-Colormaps-and-Colors.html#GdkColormap">GdkColormap</a> *colormap,
 
780
                                                         gulong *pixels,
 
781
                                                         gint npixels,
 
782
                                                         gulong planes);</pre>
 
783
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
 
784
<h3 class="title">Warning</h3>
 
785
<p><code class="literal">gdk_colors_free</code> is deprecated and should not be used in newly-written code.</p>
 
786
</div>
 
787
<p>
 
788
Frees colors allocated with <a href="gdk-Colormaps-and-Colors.html#gdk-colors-alloc"><code class="function">gdk_colors_alloc()</code></a>. This
 
789
function is obsolete. See <a href="gdk-Colormaps-and-Colors.html#gdk-colormap-free-colors"><code class="function">gdk_colormap_free_colors()</code></a>.</p>
 
790
<p>
 
791
</p>
 
792
<div class="variablelist"><table border="0">
 
793
<col align="left" valign="top">
 
794
<tbody>
 
795
<tr>
 
796
<td><span class="term"><em class="parameter"><code>colormap</code></em>&#160;:</span></td>
 
797
<td> a <a href="gdk-Colormaps-and-Colors.html#GdkColormap"><span class="type">GdkColormap</span></a>.
 
798
</td>
 
799
</tr>
 
800
<tr>
 
801
<td><span class="term"><em class="parameter"><code>pixels</code></em>&#160;:</span></td>
 
802
<td> the pixel values of the colors to free.
 
803
</td>
 
804
</tr>
 
805
<tr>
 
806
<td><span class="term"><em class="parameter"><code>npixels</code></em>&#160;:</span></td>
 
807
<td> the number of values in <em class="parameter"><code>pixels</code></em>.
 
808
</td>
 
809
</tr>
 
810
<tr>
 
811
<td><span class="term"><em class="parameter"><code>planes</code></em>&#160;:</span></td>
 
812
<td> the plane masks for all planes to free, OR'd together.
 
813
</td>
 
814
</tr>
 
815
</tbody>
 
816
</table></div>
 
817
</div>
 
818
<hr>
 
819
<div class="refsect2" lang="en">
 
820
<a name="id2663491"></a><h3>
 
821
<a name="gdk-color-white"></a>gdk_color_white ()</h3>
 
822
<a class="indexterm" name="id2663506"></a><pre class="programlisting">gint                gdk_color_white                     (<a href="gdk-Colormaps-and-Colors.html#GdkColormap">GdkColormap</a> *colormap,
 
823
                                                         <a href="gdk-Colormaps-and-Colors.html#GdkColor">GdkColor</a> *color);</pre>
 
824
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
 
825
<h3 class="title">Warning</h3>
 
826
<p><code class="literal">gdk_color_white</code> is deprecated and should not be used in newly-written code.</p>
 
827
</div>
 
828
<p>
 
829
Returns the white color for a given colormap. The resulting
 
830
value has already allocated been allocated.</p>
 
831
<p>
 
832
</p>
 
833
<div class="variablelist"><table border="0">
 
834
<col align="left" valign="top">
 
835
<tbody>
 
836
<tr>
 
837
<td><span class="term"><em class="parameter"><code>colormap</code></em>&#160;:</span></td>
 
838
<td> a <a href="gdk-Colormaps-and-Colors.html#GdkColormap"><span class="type">GdkColormap</span></a>.
 
839
</td>
 
840
</tr>
 
841
<tr>
 
842
<td><span class="term"><em class="parameter"><code>color</code></em>&#160;:</span></td>
 
843
<td> the location to store the color.
 
844
</td>
 
845
</tr>
 
846
<tr>
 
847
<td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
 
848
<td> <code class="literal">TRUE</code> if the allocation succeeded.
 
849
</td>
 
850
</tr>
 
851
</tbody>
 
852
</table></div>
 
853
</div>
 
854
<hr>
 
855
<div class="refsect2" lang="en">
 
856
<a name="id2663621"></a><h3>
 
857
<a name="gdk-color-black"></a>gdk_color_black ()</h3>
 
858
<a class="indexterm" name="id2663636"></a><pre class="programlisting">gint                gdk_color_black                     (<a href="gdk-Colormaps-and-Colors.html#GdkColormap">GdkColormap</a> *colormap,
 
859
                                                         <a href="gdk-Colormaps-and-Colors.html#GdkColor">GdkColor</a> *color);</pre>
 
860
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
 
861
<h3 class="title">Warning</h3>
 
862
<p><code class="literal">gdk_color_black</code> is deprecated and should not be used in newly-written code.</p>
 
863
</div>
 
864
<p>
 
865
Returns the black color for a given colormap. The resulting
 
866
value has already benn allocated.</p>
 
867
<p>
 
868
</p>
 
869
<div class="variablelist"><table border="0">
 
870
<col align="left" valign="top">
 
871
<tbody>
 
872
<tr>
 
873
<td><span class="term"><em class="parameter"><code>colormap</code></em>&#160;:</span></td>
 
874
<td> a <a href="gdk-Colormaps-and-Colors.html#GdkColormap"><span class="type">GdkColormap</span></a>.
 
875
</td>
 
876
</tr>
 
877
<tr>
 
878
<td><span class="term"><em class="parameter"><code>color</code></em>&#160;:</span></td>
 
879
<td> the location to store the color.
 
880
</td>
 
881
</tr>
 
882
<tr>
 
883
<td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
 
884
<td> <code class="literal">TRUE</code> if the allocation succeeded.
 
885
</td>
 
886
</tr>
 
887
</tbody>
 
888
</table></div>
 
889
</div>
 
890
<hr>
 
891
<div class="refsect2" lang="en">
 
892
<a name="id2663750"></a><h3>
 
893
<a name="gdk-color-parse"></a>gdk_color_parse ()</h3>
 
894
<a class="indexterm" name="id2663763"></a><pre class="programlisting">gboolean            gdk_color_parse                     (const gchar *spec,
 
895
                                                         <a href="gdk-Colormaps-and-Colors.html#GdkColor">GdkColor</a> *color);</pre>
 
896
<p>
 
897
Parses a textual specification of a color and fill in
 
898
the <em class="structfield"><code>red</code></em>,
 
899
<em class="structfield"><code>green</code></em>, and 
 
900
<em class="structfield"><code>blue</code></em> fields of a 
 
901
<a href="gdk-Colormaps-and-Colors.html#GdkColor"><span class="type">GdkColor</span></a> structure. The color is <span class="emphasis"><em>not</em></span> 
 
902
allocated, you must call <a href="gdk-Colormaps-and-Colors.html#gdk-colormap-alloc-color"><code class="function">gdk_colormap_alloc_color()</code></a> yourself.
 
903
The text string can be in any of the forms accepted
 
904
by <code class="function">XParseColor</code>; these include
 
905
name for a color from <code class="filename">rgb.txt</code>, such as
 
906
<code class="literal">DarkSlateGray</code>, or a hex specification
 
907
such as <code class="literal">#3050b2</code> or <code class="literal">#35b</code>.</p>
 
908
<p>
 
909
</p>
 
910
<div class="variablelist"><table border="0">
 
911
<col align="left" valign="top">
 
912
<tbody>
 
913
<tr>
 
914
<td><span class="term"><em class="parameter"><code>spec</code></em>&#160;:</span></td>
 
915
<td> the string specifying the color.
 
916
</td>
 
917
</tr>
 
918
<tr>
 
919
<td><span class="term"><em class="parameter"><code>color</code></em>&#160;:</span></td>
 
920
<td> the <a href="gdk-Colormaps-and-Colors.html#GdkColor"><span class="type">GdkColor</span></a> to fill in
 
921
</td>
 
922
</tr>
 
923
<tr>
 
924
<td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
 
925
<td> <code class="literal">TRUE</code> if the parsing succeeded.
 
926
</td>
 
927
</tr>
 
928
</tbody>
 
929
</table></div>
 
930
</div>
 
931
<hr>
 
932
<div class="refsect2" lang="en">
 
933
<a name="id2663930"></a><h3>
 
934
<a name="gdk-color-alloc"></a>gdk_color_alloc ()</h3>
 
935
<a class="indexterm" name="id2663946"></a><pre class="programlisting">gint                gdk_color_alloc                     (<a href="gdk-Colormaps-and-Colors.html#GdkColormap">GdkColormap</a> *colormap,
 
936
                                                         <a href="gdk-Colormaps-and-Colors.html#GdkColor">GdkColor</a> *color);</pre>
 
937
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
 
938
<h3 class="title">Warning</h3>
 
939
<p><code class="literal">gdk_color_alloc</code> is deprecated and should not be used in newly-written code. Use <a href="gdk-Colormaps-and-Colors.html#gdk-colormap-alloc-color"><code class="function">gdk_colormap_alloc_color()</code></a> instead.</p>
 
940
</div>
 
941
<p>
 
942
Allocates a single color from a colormap.</p>
 
943
<p>
 
944
</p>
 
945
<div class="variablelist"><table border="0">
 
946
<col align="left" valign="top">
 
947
<tbody>
 
948
<tr>
 
949
<td><span class="term"><em class="parameter"><code>colormap</code></em>&#160;:</span></td>
 
950
<td> a <a href="gdk-Colormaps-and-Colors.html#GdkColormap"><span class="type">GdkColormap</span></a>.
 
951
</td>
 
952
</tr>
 
953
<tr>
 
954
<td><span class="term"><em class="parameter"><code>color</code></em>&#160;:</span></td>
 
955
<td> The color to allocate. On return, the 
 
956
   <em class="structfield"><code>pixel</code></em> field will be filled in.
 
957
</td>
 
958
</tr>
 
959
<tr>
 
960
<td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
 
961
<td> <code class="literal">TRUE</code> if the allocation succeeded.
 
962
 
 
963
</td>
 
964
</tr>
 
965
</tbody>
 
966
</table></div>
 
967
</div>
 
968
<hr>
 
969
<div class="refsect2" lang="en">
 
970
<a name="id2664074"></a><h3>
 
971
<a name="gdk-color-change"></a>gdk_color_change ()</h3>
 
972
<a class="indexterm" name="id2664089"></a><pre class="programlisting">gint                gdk_color_change                    (<a href="gdk-Colormaps-and-Colors.html#GdkColormap">GdkColormap</a> *colormap,
 
973
                                                         <a href="gdk-Colormaps-and-Colors.html#GdkColor">GdkColor</a> *color);</pre>
 
974
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
 
975
<h3 class="title">Warning</h3>
 
976
<p><code class="literal">gdk_color_change</code> is deprecated and should not be used in newly-written code.</p>
 
977
</div>
 
978
<p>
 
979
Changes the value of a color that has already
 
980
been allocated. If <em class="parameter"><code>colormap</code></em> is not a private
 
981
colormap, then the color must have been allocated
 
982
using <a href="gdk-Colormaps-and-Colors.html#gdk-colormap-alloc-colors"><code class="function">gdk_colormap_alloc_colors()</code></a> with the 
 
983
<em class="parameter"><code>writeable</code></em> set to <code class="literal">TRUE</code>.</p>
 
984
<p>
 
985
</p>
 
986
<div class="variablelist"><table border="0">
 
987
<col align="left" valign="top">
 
988
<tbody>
 
989
<tr>
 
990
<td><span class="term"><em class="parameter"><code>colormap</code></em>&#160;:</span></td>
 
991
<td> a <a href="gdk-Colormaps-and-Colors.html#GdkColormap"><span class="type">GdkColormap</span></a>.
 
992
</td>
 
993
</tr>
 
994
<tr>
 
995
<td><span class="term"><em class="parameter"><code>color</code></em>&#160;:</span></td>
 
996
<td> a <a href="gdk-Colormaps-and-Colors.html#GdkColor"><span class="type">GdkColor</span></a>, with the color to change
 
997
in the <em class="structfield"><code>pixel</code></em> field,
 
998
and the new value in the remaining fields.
 
999
</td>
 
1000
</tr>
 
1001
<tr>
 
1002
<td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
 
1003
<td> <code class="literal">TRUE</code> if the color was successfully changed.
 
1004
</td>
 
1005
</tr>
 
1006
</tbody>
 
1007
</table></div>
 
1008
</div>
 
1009
<hr>
 
1010
<div class="refsect2" lang="en">
 
1011
<a name="id2664250"></a><h3>
 
1012
<a name="gdk-color-equal"></a>gdk_color_equal ()</h3>
 
1013
<a class="indexterm" name="id2664262"></a><pre class="programlisting">gboolean            gdk_color_equal                     (const <a href="gdk-Colormaps-and-Colors.html#GdkColor">GdkColor</a> *colora,
 
1014
                                                         const <a href="gdk-Colormaps-and-Colors.html#GdkColor">GdkColor</a> *colorb);</pre>
 
1015
<p>
 
1016
Compares two colors.</p>
 
1017
<p>
 
1018
</p>
 
1019
<div class="variablelist"><table border="0">
 
1020
<col align="left" valign="top">
 
1021
<tbody>
 
1022
<tr>
 
1023
<td><span class="term"><em class="parameter"><code>colora</code></em>&#160;:</span></td>
 
1024
<td> a <a href="gdk-Colormaps-and-Colors.html#GdkColor"><span class="type">GdkColor</span></a>.
 
1025
</td>
 
1026
</tr>
 
1027
<tr>
 
1028
<td><span class="term"><em class="parameter"><code>colorb</code></em>&#160;:</span></td>
 
1029
<td> another <a href="gdk-Colormaps-and-Colors.html#GdkColor"><span class="type">GdkColor</span></a>.
 
1030
</td>
 
1031
</tr>
 
1032
<tr>
 
1033
<td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
 
1034
<td> <code class="literal">TRUE</code> if the two colors compare equal
 
1035
</td>
 
1036
</tr>
 
1037
</tbody>
 
1038
</table></div>
 
1039
</div>
 
1040
<hr>
 
1041
<div class="refsect2" lang="en">
 
1042
<a name="id2664370"></a><h3>
 
1043
<a name="gdk-color-hash"></a>gdk_color_hash ()</h3>
 
1044
<a class="indexterm" name="id2664383"></a><pre class="programlisting">guint               gdk_color_hash                      (const <a href="gdk-Colormaps-and-Colors.html#GdkColor">GdkColor</a> *colora);</pre>
 
1045
<p>
 
1046
A hash function suitable for using for a hash
 
1047
table that stores <a href="gdk-Colormaps-and-Colors.html#GdkColor"><span class="type">GdkColor</span></a>'s.</p>
 
1048
<p>
 
1049
</p>
 
1050
<div class="variablelist"><table border="0">
 
1051
<col align="left" valign="top">
 
1052
<tbody>
 
1053
<tr>
 
1054
<td><span class="term"><em class="parameter"><code>colora</code></em>&#160;:</span></td>
 
1055
<td> a <a href="gdk-Colormaps-and-Colors.html#GdkColor"><span class="type">GdkColor</span></a>.
 
1056
</td>
 
1057
</tr>
 
1058
<tr>
 
1059
<td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
 
1060
<td> The hash function appled to <em class="parameter"><code>colora</code></em>
 
1061
</td>
 
1062
</tr>
 
1063
</tbody>
 
1064
</table></div>
 
1065
</div>
 
1066
</div>
 
1067
</div>
 
1068
</body>
 
1069
</html>