alternative to assert
[gtkD.git] / gtkD / src / gtk / GCs.d
blobee8f046d0ef4ae5d93a9c8d5e70a657e3cfd45d6
1 /*
2 * This file is part of gtkD.
4 * gtkD is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; either version 2.1 of the License, or
7 * (at your option) any later version.
9 * gtkD is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with gtkD; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 // generated automatically - do not change
20 // find conversion definition on APILookup.txt
21 // implement new conversion functionalities on the wrap.utils pakage
24 * Conversion parameters:
25 * inFile = gtk-Graphics-Contexts.html
26 * outPack = gtk
27 * outFile = GCs
28 * strct =
29 * realStrct=
30 * ctorStrct=
31 * clss = GCs
32 * interf =
33 * class Code: No
34 * interface Code: No
35 * template for:
36 * extend =
37 * implements:
38 * prefixes:
39 * - gtk_gc_
40 * - gtk_
41 * omit structs:
42 * omit prefixes:
43 * omit code:
44 * imports:
45 * - gdk.GC
46 * - gdk.Colormap
47 * structWrap:
48 * - GdkColormap* -> Colormap
49 * - GdkGC* -> GC
50 * module aliases:
51 * local aliases:
54 module gtk.GCs;
56 version(noAssert)
58 version(Tango)
60 import tango.io.Stdout; // use the tango loging?
64 private import gtkc.gtktypes;
66 private import gtkc.gtk;
69 private import gdk.GC;
70 private import gdk.Colormap;
75 /**
76 * Description
77 * These functions provide access to a shared pool of GdkGC objects.
78 * When a new GdkGC is needed, gtk_gc_get() is called with the required depth,
79 * colormap and GdkGCValues. If a GdkGC with the required properties already
80 * exists then that is returned. If not, a new GdkGC is created.
81 * When the GdkGC is no longer needed, gtk_gc_release() should be called.
83 public class GCs
86 /**
89 /**
90 * Gets a GdkGC with the given depth, colormap and GdkGCValues.
91 * If a GdkGC with the given properties already exists then it is returned,
92 * otherwise a new GdkGC is created.
93 * The returned GdkGC should be released with gtk_gc_release() when it is no
94 * longer needed.
95 * depth:
96 * the depth of the GdkGC to create.
97 * colormap:
98 * the GdkColormap (FIXME: I don't know why this is needed).
99 * values:
100 * a GdkGCValues struct containing settings for the GdkGC.
101 * values_mask:
102 * a set of flags indicating which of the fields in values has
103 * been set.
104 * Returns:
105 * a GdkGC.
107 public static GC get(int depth, Colormap colormap, GdkGCValues* values, GdkGCValuesMask valuesMask)
109 // GdkGC* gtk_gc_get (gint depth, GdkColormap *colormap, GdkGCValues *values, GdkGCValuesMask values_mask);
110 return new GC( gtk_gc_get(depth, (colormap is null) ? null : colormap.getColormapStruct(), values, valuesMask) );
114 * Releases a GdkGC allocated using gtk_gc_get().
115 * gc:
116 * a GdkGC.
118 public static void release(GC gc)
120 // void gtk_gc_release (GdkGC *gc);
121 gtk_gc_release((gc is null) ? null : gc.getGCStruct());