summaryrefslogtreecommitdiff
path: root/docs/reference/gdk/tmpl/gcs.sgml
blob: f5a16d35c700849d1c7fdc42098f373b0d8cd28d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
<!-- ##### SECTION Title ##### -->
Graphics Contexts

<!-- ##### SECTION Short_Description ##### -->
Objects to encapsulate drawing properties

<!-- ##### SECTION Long_Description ##### -->
<para>
All drawing operations in GDK take a 
<firstterm>graphics context</firstterm> (GC) argument. 
A graphics context encapsulates information about
the way things are drawn, such as the foreground
color or line width. By using graphics contexts, 
the number of arguments to each drawing call is
greatly reduced, and communication overhead is
minimized, since identical arguments do not need
to be passed repeatedly.
</para>
<para>
Most values of a graphics context can be set at
creation time by using gdk_gc_new_with_values(),
or can be set one-by-one using functions such
as gdk_gc_set_foreground(). A few of the values
in the GC, such as the dash pattern, can only
be set by the latter method.
</para>

<!-- ##### SECTION See_Also ##### -->
<para>

</para>

<!-- ##### SECTION Stability_Level ##### -->


<!-- ##### STRUCT GdkGC ##### -->
<para>
The #GdkGC structure represents a graphics context.
It is an opaque structure with no user-visible
elements.
</para>


<!-- ##### STRUCT GdkGCValues ##### -->
<para>
The #GdkGCValues structure holds a set of values used
to create or modify a graphics context.
</para>

@foreground: the foreground color. Note that gdk_gc_get_values()
  only sets the pixel value.
@background: the background color. Note that gdk_gc_get_values()
  only sets the pixel value.
@font: the default font.
@function: the bitwise operation used when drawing.
@fill: the fill style.
@tile: the tile pixmap.
@stipple: the stipple bitmap.
@clip_mask: the clip mask bitmap.
@subwindow_mode: the subwindow mode.
@ts_x_origin: the x origin of the tile or stipple.
@ts_y_origin: the y origin of the tile or stipple.
@clip_x_origin: the x origin of the clip mask.
@clip_y_origin: the y origin of the clip mask.
@graphics_exposures: whether graphics exposures are enabled.
@line_width: the line width.
@line_style: the way dashed lines are drawn.
@cap_style: the way the ends of lines are drawn.
@join_style: the way joins between lines are drawn.

<!-- ##### ENUM GdkGCValuesMask ##### -->
<para>
A set of bit flags used to indicate which fields
#GdkGCValues structure are set.
</para>

@GDK_GC_FOREGROUND: the @foreground is set.
@GDK_GC_BACKGROUND: the @background is set.
@GDK_GC_FONT: the @font is set.
@GDK_GC_FUNCTION: the @function is set.
@GDK_GC_FILL: the @fill is set.
@GDK_GC_TILE: the @tile is set.
@GDK_GC_STIPPLE: the @stipple is set.
@GDK_GC_CLIP_MASK: the @clip_mask is set.
@GDK_GC_SUBWINDOW: the @subwindow_mode is set.
@GDK_GC_TS_X_ORIGIN: the @ts_x_origin is set.
@GDK_GC_TS_Y_ORIGIN: the @ts_y_origin is set.
@GDK_GC_CLIP_X_ORIGIN: the @clip_x_origin is set.
@GDK_GC_CLIP_Y_ORIGIN: the @clip_y_origin is set.
@GDK_GC_EXPOSURES: the @graphics_exposures is set.
@GDK_GC_LINE_WIDTH: the @line_width is set.
@GDK_GC_LINE_STYLE: the @line_style is set.
@GDK_GC_CAP_STYLE: the @cap_style is set.
@GDK_GC_JOIN_STYLE: the @join_style is set.

<!-- ##### ENUM GdkFunction ##### -->
<para>
Determines how the bit values for the source pixels are combined with
the bit values for destination pixels to produce the final result. The
sixteen values here correspond to the 16 different possible 2x2 truth
tables.  Only a couple of these values are usually useful; for colored
images, only %GDK_COPY, %GDK_XOR and %GDK_INVERT are generally
useful. For bitmaps, %GDK_AND and %GDK_OR are also useful.
</para>

@GDK_COPY: <literal>dst = src</literal>
@GDK_INVERT: <literal>dst = NOT dst</literal>
@GDK_XOR: <literal>dst = src XOR dst</literal>
@GDK_CLEAR: <literal>dst = 0</literal>
@GDK_AND: <literal>dst = dst AND src</literal>
@GDK_AND_REVERSE: <literal>dst = src AND (NOT dst)</literal>
@GDK_AND_INVERT: <literal>dst = (NOT src) AND dst</literal>
@GDK_NOOP: <literal>dst = dst</literal>
@GDK_OR: <literal>dst = src OR dst</literal>
@GDK_EQUIV: <literal>dst = (NOT src) XOR dst</literal>
@GDK_OR_REVERSE: <literal>dst = src OR (NOT dst)</literal>
@GDK_COPY_INVERT: <literal>dst = NOT src</literal>
@GDK_OR_INVERT: <literal>dst = (NOT src) OR dst</literal>
@GDK_NAND: <literal>dst = (NOT src) OR (NOT dst)</literal>
@GDK_NOR: <literal>dst = (NOT src) AND (NOT dst)</literal>
@GDK_SET: <literal>dst = 1</literal>

<!-- ##### FUNCTION gdk_gc_new ##### -->
<para>
</para>

@drawable: 
@Returns: 


<!-- ##### FUNCTION gdk_gc_new_with_values ##### -->
<para>

</para>

@drawable: 
@values: 
@values_mask: 
@Returns: 


<!-- ##### FUNCTION gdk_gc_get_screen ##### -->
<para>

</para>

@gc: 
@Returns: 


<!-- ##### FUNCTION gdk_gc_ref ##### -->
<para>

</para>

@gc: 
@Returns: 


<!-- ##### FUNCTION gdk_gc_unref ##### -->
<para>

</para>

@gc: 


<!-- ##### MACRO gdk_gc_destroy ##### -->
<para>
This function is obsolete and should not be used.
</para>

@Deprecated: Use g_object_unref() instead
<!-- # Unused Parameters # -->
@gc: a #GdkGC.


<!-- ##### FUNCTION gdk_gc_set_values ##### -->
<para>

</para>

@gc: 
@values: 
@values_mask: 


<!-- ##### FUNCTION gdk_gc_get_values ##### -->
<para>

</para>

@gc: 
@values: 


<!-- ##### FUNCTION gdk_gc_set_foreground ##### -->
<para>

</para>

@gc: 
@color: 


<!-- ##### FUNCTION gdk_gc_set_background ##### -->
<para>

</para>

@gc: 
@color: 


<!-- ##### FUNCTION gdk_gc_set_rgb_fg_color ##### -->
<para>

</para>

@gc: 
@color: 


<!-- ##### FUNCTION gdk_gc_set_rgb_bg_color ##### -->
<para>

</para>

@gc: 
@color: 


<!-- ##### FUNCTION gdk_gc_set_font ##### -->
<para>

</para>

@gc: 
@font: 


<!-- ##### FUNCTION gdk_gc_set_function ##### -->
<para>

</para>

@gc: 
@function: 


<!-- ##### FUNCTION gdk_gc_set_fill ##### -->
<para>

</para>

@gc: 
@fill: 


<!-- ##### ENUM GdkFill ##### -->
<para>
Determines how primitives are drawn.
</para>

@GDK_SOLID: draw with the foreground color.
@GDK_TILED: draw with a tiled pixmap.
@GDK_STIPPLED: draw using the stipple bitmap. Pixels corresponding
  to bits in the stipple bitmap that are set will be drawn in the
  foreground color; pixels corresponding to bits that are
  not set will be left untouched.
@GDK_OPAQUE_STIPPLED: draw using the stipple bitmap. Pixels corresponding
  to bits in the stipple bitmap that are set will be drawn in the
  foreground color; pixels corresponding to bits that are
  not set will be drawn with the background color.

<!-- ##### FUNCTION gdk_gc_set_tile ##### -->
<para>

</para>

@gc: 
@tile: 


<!-- ##### FUNCTION gdk_gc_set_stipple ##### -->
<para>

</para>

@gc: 
@stipple: 


<!-- ##### FUNCTION gdk_gc_set_ts_origin ##### -->
<para>

</para>

@gc: 
@x: 
@y: 


<!-- ##### FUNCTION gdk_gc_set_clip_origin ##### -->
<para>

</para>

@gc: 
@x: 
@y: 


<!-- ##### FUNCTION gdk_gc_set_clip_mask ##### -->
<para>

</para>

@gc: 
@mask: 


<!-- ##### FUNCTION gdk_gc_set_clip_rectangle ##### -->
<para>
</para>

@gc: 
@rectangle: 


<!-- ##### FUNCTION gdk_gc_set_clip_region ##### -->
<para>

</para>

@gc: 
@region: 


<!-- ##### FUNCTION gdk_gc_set_subwindow ##### -->
<para>

</para>

@gc: 
@mode: 


<!-- ##### ENUM GdkSubwindowMode ##### -->
<para>
Determines how drawing onto a window will affect child
windows of that window. 
</para>

@GDK_CLIP_BY_CHILDREN: only draw onto the window itself.
@GDK_INCLUDE_INFERIORS: draw onto the window and child windows.

<!-- ##### FUNCTION gdk_gc_set_exposures ##### -->
<para>

</para>

@gc: 
@exposures: 


<!-- ##### FUNCTION gdk_gc_set_line_attributes ##### -->
<para>

</para>

@gc: 
@line_width: 
@line_style: 
@cap_style: 
@join_style: 


<!-- ##### ENUM GdkLineStyle ##### -->
<para>
Determines how lines are drawn.
</para>

@GDK_LINE_SOLID: lines are drawn solid.
@GDK_LINE_ON_OFF_DASH: even segments are drawn; odd segments are not drawn.
@GDK_LINE_DOUBLE_DASH: even segments are normally. Odd segments are drawn
  in the background color if the fill style is %GDK_SOLID, or in the background
  color masked by the stipple if the fill style is %GDK_STIPPLED.

<!-- ##### ENUM GdkCapStyle ##### -->
<para>
Determines how the end of lines are drawn.
</para>

@GDK_CAP_NOT_LAST: the same as %GDK_CAP_BUTT for lines of non-zero width.
       for zero width lines, the final point on the line will not be drawn.
@GDK_CAP_BUTT: the ends of the lines are drawn squared off and extending
       to the coordinates of the end point.
@GDK_CAP_ROUND: the ends of the lines are drawn as semicircles with the
       diameter equal to the line width and centered at the end point.
@GDK_CAP_PROJECTING: the ends of the lines are drawn squared off and extending
       half the width of the line beyond the end point.

<!-- ##### ENUM GdkJoinStyle ##### -->
<para>
Determines how the joins between segments of a polygon are drawn.
</para>

@GDK_JOIN_MITER: the sides of each line are extended to meet at an angle.
@GDK_JOIN_ROUND: the sides of the two lines are joined by a circular arc.
@GDK_JOIN_BEVEL: the sides of the two lines are joined by a straight line which
       makes an equal angle with each line.

<!-- ##### FUNCTION gdk_gc_set_dashes ##### -->
<para>

</para>

@gc: 
@dash_offset: 
@dash_list: 
@n: 


<!-- ##### FUNCTION gdk_gc_copy ##### -->
<para>

</para>

@dst_gc: 
@src_gc: 


<!-- ##### FUNCTION gdk_gc_set_colormap ##### -->
<para>

</para>

@gc: 
@colormap: 


<!-- ##### FUNCTION gdk_gc_get_colormap ##### -->
<para>

</para>

@gc: 
@Returns: 


<!-- ##### FUNCTION gdk_gc_offset ##### -->
<para>

</para>

@gc: 
@x_offset: 
@y_offset: