1 /*
2  * This file is part of gtkD.
3  *
4  * gtkD is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License
6  * as published by the Free Software Foundation; either version 3
7  * of the License, or (at your option) any later version, with
8  * some exceptions, please read the COPYING file.
9  *
10  * gtkD is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with gtkD; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
18  */
19  
20 // generated automatically - do not change
21 // find conversion definition on APILookup.txt
22 // implement new conversion functionalities on the wrap.utils pakage
23 
24 /*
25  * Conversion parameters:
26  * inFile  = gdk-Graphics-Contexts.html
27  * outPack = gdk
28  * outFile = GC
29  * strct   = GdkGC
30  * realStrct=
31  * ctorStrct=
32  * clss    = GC
33  * interf  = 
34  * class Code: No
35  * interface Code: No
36  * template for:
37  * extend  = 
38  * implements:
39  * prefixes:
40  * 	- gdk_gc_
41  * omit structs:
42  * omit prefixes:
43  * omit code:
44  * 	- gdk_gc_ref
45  * 	- gdk_gc_unref
46  * omit signals:
47  * imports:
48  * 	- gdk.Drawable
49  * 	- gdk.Screen
50  * 	- gdk.Color
51  * 	- gdk.Font
52  * 	- gdk.Pixmap
53  * 	- gdk.Bitmap
54  * 	- gdk.Rectangle
55  * 	- gdk.Region
56  * 	- gdk.Colormap
57  * structWrap:
58  * 	- GdkBitmap* -> Bitmap
59  * 	- GdkColor* -> Color
60  * 	- GdkColormap* -> Colormap
61  * 	- GdkDrawable* -> Drawable
62  * 	- GdkFont* -> Font
63  * 	- GdkGC* -> GC
64  * 	- GdkPixmap* -> Pixmap
65  * 	- GdkRectangle* -> Rectangle
66  * 	- GdkRegion* -> Region
67  * 	- GdkScreen* -> Screen
68  * module aliases:
69  * local aliases:
70  * overrides:
71  */
72 
73 module gdk.GC;
74 
75 public  import gtkc.gdktypes;
76 
77 private import gtkc.gdk;
78 private import glib.ConstructionException;
79 private import gobject.ObjectG;
80 
81 
82 private import gdk.Drawable;
83 private import gdk.Screen;
84 private import gdk.Color;
85 private import gdk.Font;
86 private import gdk.Pixmap;
87 private import gdk.Bitmap;
88 private import gdk.Rectangle;
89 private import gdk.Region;
90 private import gdk.Colormap;
91 
92 
93 
94 private import gobject.ObjectG;
95 
96 /**
97  * Description
98  * All drawing operations in GDK take a
99  * graphics context (GC) argument.
100  * A graphics context encapsulates information about
101  * the way things are drawn, such as the foreground
102  * color or line width. By using graphics contexts,
103  * the number of arguments to each drawing call is
104  * greatly reduced, and communication overhead is
105  * minimized, since identical arguments do not need
106  * to be passed repeatedly.
107  * Most values of a graphics context can be set at
108  * creation time by using gdk_gc_new_with_values(),
109  * or can be set one-by-one using functions such
110  * as gdk_gc_set_foreground(). A few of the values
111  * in the GC, such as the dash pattern, can only
112  * be set by the latter method.
113  */
114 public class GC : ObjectG
115 {
116 	
117 	/** the main Gtk struct */
118 	protected GdkGC* gdkGC;
119 	
120 	
121 	public GdkGC* getGCStruct()
122 	{
123 		return gdkGC;
124 	}
125 	
126 	
127 	/** the main Gtk struct as a void* */
128 	protected override void* getStruct()
129 	{
130 		return cast(void*)gdkGC;
131 	}
132 	
133 	/**
134 	 * Sets our main struct and passes it to the parent class
135 	 */
136 	public this (GdkGC* gdkGC)
137 	{
138 		super(cast(GObject*)gdkGC);
139 		this.gdkGC = gdkGC;
140 	}
141 	
142 	protected override void setStruct(GObject* obj)
143 	{
144 		super.setStruct(obj);
145 		gdkGC = cast(GdkGC*)obj;
146 	}
147 	
148 	/**
149 	 */
150 	
151 	/**
152 	 * Warning
153 	 * gdk_gc_new has been deprecated since version 2.22 and should not be used in newly-written code. Use Cairo for rendering.
154 	 * Create a new graphics context with default values.
155 	 * Params:
156 	 * drawable = a GdkDrawable. The created GC must always be used
157 	 * with drawables of the same depth as this one.
158 	 * Throws: ConstructionException GTK+ fails to create the object.
159 	 */
160 	public this (Drawable drawable)
161 	{
162 		// GdkGC * gdk_gc_new (GdkDrawable *drawable);
163 		auto p = gdk_gc_new((drawable is null) ? null : drawable.getDrawableStruct());
164 		if(p is null)
165 		{
166 			throw new ConstructionException("null returned by gdk_gc_new((drawable is null) ? null : drawable.getDrawableStruct())");
167 		}
168 		this(cast(GdkGC*) p);
169 	}
170 	
171 	/**
172 	 * Warning
173 	 * gdk_gc_new_with_values has been deprecated since version 2.22 and should not be used in newly-written code. Use Cairo for rendering.
174 	 * Create a new GC with the given initial values.
175 	 * Params:
176 	 * drawable = a GdkDrawable. The created GC must always be used
177 	 * with drawables of the same depth as this one.
178 	 * values = a structure containing initial values for the GC.
179 	 * valuesMask = a bit mask indicating which fields in values
180 	 * are set.
181 	 * Throws: ConstructionException GTK+ fails to create the object.
182 	 */
183 	public this (Drawable drawable, GdkGCValues* values, GdkGCValuesMask valuesMask)
184 	{
185 		// GdkGC * gdk_gc_new_with_values (GdkDrawable *drawable,  GdkGCValues *values,  GdkGCValuesMask values_mask);
186 		auto p = gdk_gc_new_with_values((drawable is null) ? null : drawable.getDrawableStruct(), values, valuesMask);
187 		if(p is null)
188 		{
189 			throw new ConstructionException("null returned by gdk_gc_new_with_values((drawable is null) ? null : drawable.getDrawableStruct(), values, valuesMask)");
190 		}
191 		this(cast(GdkGC*) p);
192 	}
193 	
194 	/**
195 	 * Warning
196 	 * gdk_gc_get_screen is deprecated and should not be used in newly-written code.
197 	 * Gets the GdkScreen for which gc was created
198 	 * Since 2.2
199 	 * Returns: the GdkScreen for gc.
200 	 */
201 	public Screen getScreen()
202 	{
203 		// GdkScreen * gdk_gc_get_screen (GdkGC *gc);
204 		auto p = gdk_gc_get_screen(gdkGC);
205 		
206 		if(p is null)
207 		{
208 			return null;
209 		}
210 		
211 		return ObjectG.getDObject!(Screen)(cast(GdkScreen*) p);
212 	}
213 	
214 	/**
215 	 * Warning
216 	 * gdk_gc_set_values has been deprecated since version 2.22 and should not be used in newly-written code. Use Cairo for rendering.
217 	 * Sets attributes of a graphics context in bulk. For each flag set in
218 	 * values_mask, the corresponding field will be read from values and
219 	 * set as the new value for gc. If you're only setting a few values
220 	 * on gc, calling individual "setter" functions is likely more
221 	 * convenient.
222 	 * Params:
223 	 * values = struct containing the new values
224 	 * valuesMask = mask indicating which struct fields are to be used
225 	 */
226 	public void setValues(GdkGCValues* values, GdkGCValuesMask valuesMask)
227 	{
228 		// void gdk_gc_set_values (GdkGC *gc,  GdkGCValues *values,  GdkGCValuesMask values_mask);
229 		gdk_gc_set_values(gdkGC, values, valuesMask);
230 	}
231 	
232 	/**
233 	 * Warning
234 	 * gdk_gc_get_values has been deprecated since version 2.22 and should not be used in newly-written code. Use Cairo for rendering.
235 	 * Retrieves the current values from a graphics context. Note that
236 	 * only the pixel values of the values->foreground and values->background
237 	 * are filled, use gdk_colormap_query_color() to obtain the rgb values
238 	 * if you need them.
239 	 * Params:
240 	 * values = the GdkGCValues structure in which to store the results.
241 	 */
242 	public void getValues(GdkGCValues* values)
243 	{
244 		// void gdk_gc_get_values (GdkGC *gc,  GdkGCValues *values);
245 		gdk_gc_get_values(gdkGC, values);
246 	}
247 	
248 	/**
249 	 * Warning
250 	 * gdk_gc_set_foreground has been deprecated since version 2.22 and should not be used in newly-written code. Use gdk_cairo_set_source_color() to use a GdkColor
251 	 * as the source in Cairo.
252 	 * Sets the foreground color for a graphics context.
253 	 * Note that this function uses color->pixel, use
254 	 * gdk_gc_set_rgb_fg_color() to specify the foreground
255 	 * color as red, green, blue components.
256 	 * Params:
257 	 * color = the new foreground color.
258 	 */
259 	public void setForeground(Color color)
260 	{
261 		// void gdk_gc_set_foreground (GdkGC *gc,  const GdkColor *color);
262 		gdk_gc_set_foreground(gdkGC, (color is null) ? null : color.getColorStruct());
263 	}
264 	
265 	/**
266 	 * Warning
267 	 * gdk_gc_set_background has been deprecated since version 2.22 and should not be used in newly-written code. Use gdk_cairo_set_source_color() to use a GdkColor
268 	 * as the source in Cairo. Note that if you want to draw a background and a
269 	 * foreground in Cairo, you need to call drawing functions (like cairo_fill())
270 	 * twice.
271 	 * Sets the background color for a graphics context.
272 	 * Note that this function uses color->pixel, use
273 	 * gdk_gc_set_rgb_bg_color() to specify the background
274 	 * color as red, green, blue components.
275 	 * Params:
276 	 * color = the new background color.
277 	 */
278 	public void setBackground(Color color)
279 	{
280 		// void gdk_gc_set_background (GdkGC *gc,  const GdkColor *color);
281 		gdk_gc_set_background(gdkGC, (color is null) ? null : color.getColorStruct());
282 	}
283 	
284 	/**
285 	 * Warning
286 	 * gdk_gc_set_rgb_fg_color has been deprecated since version 2.22 and should not be used in newly-written code. Use gdk_cairo_set_source_color() instead.
287 	 * Set the foreground color of a GC using an unallocated color. The
288 	 * pixel value for the color will be determined using GdkRGB. If the
289 	 * colormap for the GC has not previously been initialized for GdkRGB,
290 	 * then for pseudo-color colormaps (colormaps with a small modifiable
291 	 * number of colors), a colorcube will be allocated in the colormap.
292 	 * Calling this function for a GC without a colormap is an error.
293 	 * Params:
294 	 * color = an unallocated GdkColor.
295 	 */
296 	public void setRgbFgColor(Color color)
297 	{
298 		// void gdk_gc_set_rgb_fg_color (GdkGC *gc,  const GdkColor *color);
299 		gdk_gc_set_rgb_fg_color(gdkGC, (color is null) ? null : color.getColorStruct());
300 	}
301 	
302 	/**
303 	 * Warning
304 	 * gdk_gc_set_rgb_bg_color has been deprecated since version 2.22 and should not be used in newly-written code. Use gdk_cairo_set_source_color() instead.
305 	 * Set the background color of a GC using an unallocated color. The
306 	 * pixel value for the color will be determined using GdkRGB. If the
307 	 * colormap for the GC has not previously been initialized for GdkRGB,
308 	 * then for pseudo-color colormaps (colormaps with a small modifiable
309 	 * number of colors), a colorcube will be allocated in the colormap.
310 	 * Calling this function for a GC without a colormap is an error.
311 	 * Params:
312 	 * color = an unallocated GdkColor.
313 	 */
314 	public void setRgbBgColor(Color color)
315 	{
316 		// void gdk_gc_set_rgb_bg_color (GdkGC *gc,  const GdkColor *color);
317 		gdk_gc_set_rgb_bg_color(gdkGC, (color is null) ? null : color.getColorStruct());
318 	}
319 	
320 	/**
321 	 * Warning
322 	 * gdk_gc_set_font is deprecated and should not be used in newly-written code.
323 	 * Sets the font for a graphics context. (Note that
324 	 * all text-drawing functions in GDK take a font
325 	 * argument; the value set here is used when that
326 	 * argument is NULL.)
327 	 * Params:
328 	 * font = the new font.
329 	 */
330 	public void setFont(Font font)
331 	{
332 		// void gdk_gc_set_font (GdkGC *gc,  GdkFont *font);
333 		gdk_gc_set_font(gdkGC, (font is null) ? null : font.getFontStruct());
334 	}
335 	
336 	/**
337 	 * Warning
338 	 * gdk_gc_set_function has been deprecated since version 2.22 and should not be used in newly-written code. Use cairo_set_operator() with Cairo.
339 	 * Determines how the current pixel values and the
340 	 * pixel values being drawn are combined to produce
341 	 * the final pixel values.
342 	 */
343 	public void setFunction(GdkFunction funct)
344 	{
345 		// void gdk_gc_set_function (GdkGC *gc,  GdkFunction function);
346 		gdk_gc_set_function(gdkGC, funct);
347 	}
348 	
349 	/**
350 	 * Warning
351 	 * gdk_gc_set_fill has been deprecated since version 2.22 and should not be used in newly-written code. You can achieve tiling in Cairo by using
352 	 * cairo_pattern_set_extend() on the source. For stippling, see the
353 	 * deprecation comments on gdk_gc_set_stipple().
354 	 * Set the fill mode for a graphics context.
355 	 * Params:
356 	 * fill = the new fill mode.
357 	 */
358 	public void setFill(GdkFill fill)
359 	{
360 		// void gdk_gc_set_fill (GdkGC *gc,  GdkFill fill);
361 		gdk_gc_set_fill(gdkGC, fill);
362 	}
363 	
364 	/**
365 	 * Warning
366 	 * gdk_gc_set_tile has been deprecated since version 2.22 and should not be used in newly-written code. The following code snippet sets a tiling GdkPixmap
367 	 * Params:
368 	 * tile = the new tile pixmap.
369 	 */
370 	public void setTile(Pixmap tile)
371 	{
372 		// void gdk_gc_set_tile (GdkGC *gc,  GdkPixmap *tile);
373 		gdk_gc_set_tile(gdkGC, (tile is null) ? null : tile.getPixmapStruct());
374 	}
375 	
376 	/**
377 	 * Warning
378 	 * gdk_gc_set_stipple has been deprecated since version 2.22 and should not be used in newly-written code. Stippling has no direct replacement in Cairo. If you
379 	 * want to achieve an identical look, you can use the stipple bitmap as a
380 	 * mask. Most likely, this involves rendering the source to an intermediate
381 	 * surface using cairo_push_group() first, so that you can then use
382 	 * cairo_mask() to achieve the stippled look.
383 	 * Set the stipple bitmap for a graphics context. The
384 	 * stipple will only be used if the fill mode is
385 	 * GDK_STIPPLED or GDK_OPAQUE_STIPPLED.
386 	 * Params:
387 	 * stipple = the new stipple bitmap.
388 	 */
389 	public void setStipple(Pixmap stipple)
390 	{
391 		// void gdk_gc_set_stipple (GdkGC *gc,  GdkPixmap *stipple);
392 		gdk_gc_set_stipple(gdkGC, (stipple is null) ? null : stipple.getPixmapStruct());
393 	}
394 	
395 	/**
396 	 * Warning
397 	 * gdk_gc_set_ts_origin has been deprecated since version 2.22 and should not be used in newly-written code. You can set the origin for tiles and stipples in Cairo
398 	 * by changing the source's matrix using cairo_pattern_set_matrix(). Or you
399 	 * can specify it with gdk_cairo_set_source_pixmap() as shown in the example
400 	 * for gdk_gc_set_tile().
401 	 * Set the origin when using tiles or stipples with
402 	 * the GC. The tile or stipple will be aligned such
403 	 * that the upper left corner of the tile or stipple
404 	 * will coincide with this point.
405 	 * Params:
406 	 * x = the x-coordinate of the origin.
407 	 * y = the y-coordinate of the origin.
408 	 */
409 	public void setTsOrigin(int x, int y)
410 	{
411 		// void gdk_gc_set_ts_origin (GdkGC *gc,  gint x,  gint y);
412 		gdk_gc_set_ts_origin(gdkGC, x, y);
413 	}
414 	
415 	/**
416 	 * Warning
417 	 * gdk_gc_set_clip_origin has been deprecated since version 2.22 and should not be used in newly-written code. Use cairo_translate() before applying the clip path in
418 	 * Cairo.
419 	 * Sets the origin of the clip mask. The coordinates are
420 	 * interpreted relative to the upper-left corner of
421 	 * the destination drawable of the current operation.
422 	 * Params:
423 	 * x = the x-coordinate of the origin.
424 	 * y = the y-coordinate of the origin.
425 	 */
426 	public void setClipOrigin(int x, int y)
427 	{
428 		// void gdk_gc_set_clip_origin (GdkGC *gc,  gint x,  gint y);
429 		gdk_gc_set_clip_origin(gdkGC, x, y);
430 	}
431 	
432 	/**
433 	 * Warning
434 	 * gdk_gc_set_clip_mask has been deprecated since version 2.22 and should not be used in newly-written code. Use cairo_mask() instead.
435 	 * Sets the clip mask for a graphics context from a bitmap.
436 	 * The clip mask is interpreted relative to the clip
437 	 * origin. (See gdk_gc_set_clip_origin()).
438 	 * Params:
439 	 * mask = a bitmap.
440 	 */
441 	public void setClipMask(Bitmap mask)
442 	{
443 		// void gdk_gc_set_clip_mask (GdkGC *gc,  GdkBitmap *mask);
444 		gdk_gc_set_clip_mask(gdkGC, (mask is null) ? null : mask.getBitmapStruct());
445 	}
446 	
447 	/**
448 	 * Warning
449 	 * gdk_gc_set_clip_rectangle has been deprecated since version 2.22 and should not be used in newly-written code. Use cairo_rectangle() and cairo_clip() in Cairo.
450 	 * Sets the clip mask for a graphics context from a
451 	 * rectangle. The clip mask is interpreted relative to the clip
452 	 * origin. (See gdk_gc_set_clip_origin()).
453 	 * Params:
454 	 * rectangle = the rectangle to clip to.
455 	 */
456 	public void setClipRectangle(Rectangle rectangle)
457 	{
458 		// void gdk_gc_set_clip_rectangle (GdkGC *gc,  const GdkRectangle *rectangle);
459 		gdk_gc_set_clip_rectangle(gdkGC, (rectangle is null) ? null : rectangle.getRectangleStruct());
460 	}
461 	
462 	/**
463 	 * Warning
464 	 * gdk_gc_set_clip_region has been deprecated since version 2.22 and should not be used in newly-written code. Use gdk_cairo_region() and cairo_clip() in Cairo.
465 	 * Sets the clip mask for a graphics context from a region structure.
466 	 * The clip mask is interpreted relative to the clip origin. (See
467 	 * gdk_gc_set_clip_origin()).
468 	 * Params:
469 	 * region = the GdkRegion.
470 	 */
471 	public void setClipRegion(Region region)
472 	{
473 		// void gdk_gc_set_clip_region (GdkGC *gc,  const GdkRegion *region);
474 		gdk_gc_set_clip_region(gdkGC, (region is null) ? null : region.getRegionStruct());
475 	}
476 	
477 	/**
478 	 * Warning
479 	 * gdk_gc_set_subwindow has been deprecated since version 2.22 and should not be used in newly-written code. There is no replacement. If you need to control
480 	 * subwindows, you must use drawing operations of the underlying window
481 	 * system manually. Cairo will always use GDK_INCLUDE_INFERIORS on sources
482 	 * and masks and GDK_CLIP_BY_CHILDREN on targets.
483 	 * Sets how drawing with this GC on a window will affect child
484 	 * windows of that window.
485 	 * Params:
486 	 * mode = the subwindow mode.
487 	 */
488 	public void setSubwindow(GdkSubwindowMode mode)
489 	{
490 		// void gdk_gc_set_subwindow (GdkGC *gc,  GdkSubwindowMode mode);
491 		gdk_gc_set_subwindow(gdkGC, mode);
492 	}
493 	
494 	/**
495 	 * Warning
496 	 * gdk_gc_set_exposures has been deprecated since version 2.22 and should not be used in newly-written code. There is no replacement. If you need to control
497 	 * exposures, you must use drawing operations of the underlying window
498 	 * system or use gdk_window_invalidate_rect(). Cairo will never
499 	 * generate exposures.
500 	 * Sets whether copying non-visible portions of a drawable
501 	 * using this graphics context generate exposure events
502 	 * for the corresponding regions of the destination
503 	 * drawable. (See gdk_draw_drawable()).
504 	 * Params:
505 	 * exposures = if TRUE, exposure events will be generated.
506 	 */
507 	public void setExposures(int exposures)
508 	{
509 		// void gdk_gc_set_exposures (GdkGC *gc,  gboolean exposures);
510 		gdk_gc_set_exposures(gdkGC, exposures);
511 	}
512 	
513 	/**
514 	 * Warning
515 	 * gdk_gc_set_line_attributes has been deprecated since version 2.22 and should not be used in newly-written code. Use the Cairo functions cairo_set_line_width(),
516 	 * cairo_set_line_join(), cairo_set_line_cap() and cairo_set_dash()
517 	 * to affect the stroking behavior in Cairo. Keep in mind that the default
518 	 * attributes of a cairo_t are different from the default attributes of
519 	 * a GdkGC.
520 	 * Sets various attributes of how lines are drawn. See
521 	 * the corresponding members of GdkGCValues for full
522 	 * explanations of the arguments.
523 	 * Params:
524 	 * lineWidth = the width of lines.
525 	 * lineStyle = the dash-style for lines.
526 	 * capStyle = the manner in which the ends of lines are drawn.
527 	 * joinStyle = the in which lines are joined together.
528 	 */
529 	public void setLineAttributes(int lineWidth, GdkLineStyle lineStyle, GdkCapStyle capStyle, GdkJoinStyle joinStyle)
530 	{
531 		// void gdk_gc_set_line_attributes (GdkGC *gc,  gint line_width,  GdkLineStyle line_style,  GdkCapStyle cap_style,  GdkJoinStyle join_style);
532 		gdk_gc_set_line_attributes(gdkGC, lineWidth, lineStyle, capStyle, joinStyle);
533 	}
534 	
535 	/**
536 	 * Warning
537 	 * gdk_gc_set_dashes has been deprecated since version 2.22 and should not be used in newly-written code. Use cairo_set_dash() to set the dash in Cairo.
538 	 * Sets the way dashed-lines are drawn. Lines will be
539 	 * drawn with alternating on and off segments of the
540 	 * lengths specified in dash_list. The manner in
541 	 * which the on and off segments are drawn is determined
542 	 * by the line_style value of the GC. (This can
543 	 * be changed with gdk_gc_set_line_attributes().)
544 	 * The dash_offset defines the phase of the pattern,
545 	 * specifying how many pixels into the dash-list the pattern
546 	 * should actually begin.
547 	 * Params:
548 	 * dashOffset = the phase of the dash pattern.
549 	 * dashList = an array of dash lengths.
550 	 * n = the number of elements in dash_list.
551 	 */
552 	public void setDashes(int dashOffset, byte[] dashList)
553 	{
554 		// void gdk_gc_set_dashes (GdkGC *gc,  gint dash_offset,  gint8 dash_list[],  gint n);
555 		gdk_gc_set_dashes(gdkGC, dashOffset, dashList.ptr, cast(int) dashList.length);
556 	}
557 	
558 	/**
559 	 * Warning
560 	 * gdk_gc_copy has been deprecated since version 2.22 and should not be used in newly-written code. Use Cairo for drawing. cairo_save() and cairo_restore()
561 	 * can be helpful in cases where you'd have copied a GdkGC.
562 	 * Copy the set of values from one graphics context
563 	 * onto another graphics context.
564 	 * Params:
565 	 * srcGc = the source graphics context.
566 	 */
567 	public void copy(GC srcGc)
568 	{
569 		// void gdk_gc_copy (GdkGC *dst_gc,  GdkGC *src_gc);
570 		gdk_gc_copy(gdkGC, (srcGc is null) ? null : srcGc.getGCStruct());
571 	}
572 	
573 	/**
574 	 * Warning
575 	 * gdk_gc_set_colormap has been deprecated since version 2.22 and should not be used in newly-written code. There is no replacement. Cairo handles colormaps
576 	 * automatically, so there is no need to care about them.
577 	 * Sets the colormap for the GC to the given colormap. The depth
578 	 * of the colormap's visual must match the depth of the drawable
579 	 * for which the GC was created.
580 	 * Params:
581 	 * colormap = a GdkColormap
582 	 */
583 	public void setColormap(Colormap colormap)
584 	{
585 		// void gdk_gc_set_colormap (GdkGC *gc,  GdkColormap *colormap);
586 		gdk_gc_set_colormap(gdkGC, (colormap is null) ? null : colormap.getColormapStruct());
587 	}
588 	
589 	/**
590 	 * Warning
591 	 * gdk_gc_get_colormap has been deprecated since version 2.22 and should not be used in newly-written code. There is no replacement. Cairo handles colormaps
592 	 * automatically, so there is no need to care about them.
593 	 * Retrieves the colormap for a given GC, if it exists.
594 	 * A GC will have a colormap if the drawable for which it was created
595 	 * has a colormap, or if a colormap was set explicitely with
596 	 * gdk_gc_set_colormap.
597 	 * Returns: the colormap of gc, or NULL if gc doesn't have one.
598 	 */
599 	public Colormap getColormap()
600 	{
601 		// GdkColormap * gdk_gc_get_colormap (GdkGC *gc);
602 		auto p = gdk_gc_get_colormap(gdkGC);
603 		
604 		if(p is null)
605 		{
606 			return null;
607 		}
608 		
609 		return ObjectG.getDObject!(Colormap)(cast(GdkColormap*) p);
610 	}
611 	
612 	/**
613 	 * Warning
614 	 * gdk_gc_offset has been deprecated since version 2.22 and should not be used in newly-written code. There is no direct replacement, as this is just a
615 	 * convenience function for gdk_gc_set_ts_origin and gdk_gc_set_clip_origin().
616 	 * Offset attributes such as the clip and tile-stipple origins
617 	 * of the GC so that drawing at x - x_offset, y - y_offset with
618 	 * the offset GC has the same effect as drawing at x, y with the original
619 	 * GC.
620 	 * Params:
621 	 * xOffset = amount by which to offset the GC in the X direction
622 	 * yOffset = amount by which to offset the GC in the Y direction
623 	 */
624 	public void offset(int xOffset, int yOffset)
625 	{
626 		// void gdk_gc_offset (GdkGC *gc,  gint x_offset,  gint y_offset);
627 		gdk_gc_offset(gdkGC, xOffset, yOffset);
628 	}
629 }