alternative to assert
[gtkD.git] / src / gtk / GCs.d
blobab84253900d467e7088e627ee4e0f7eef7b7bd25
1 /*
2 * This file is part of duit.
4 * duit 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 * duit 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 duit; 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 * local aliases:
53 module gtk.GCs;
55 private import gtk.gtktypes;
57 private import lib.gtk;
59 private import gdk.GC;
60 private import gdk.Colormap;
62 /**
63 * Description
64 * These functions provide access to a shared pool of GdkGC objects.
65 * When a new GdkGC is needed, gtk_gc_get() is called with the required depth,
66 * colormap and GdkGCValues. If a GdkGC with the required properties already
67 * exists then that is returned. If not, a new GdkGC is created.
68 * When the GdkGC is no longer needed, gtk_gc_release() should be called.
70 public class GCs
73 /**
76 /**
77 * Gets a GdkGC with the given depth, colormap and GdkGCValues.
78 * If a GdkGC with the given properties already exists then it is returned,
79 * otherwise a new GdkGC is created.
80 * The returned GdkGC should be released with gtk_gc_release() when it is no
81 * longer needed.
82 * depth:
83 * the depth of the GdkGC to create.
84 * colormap:
85 * the GdkColormap (FIXME: I don't know why this is needed).
86 * values:
87 * a GdkGCValues struct containing settings for the GdkGC.
88 * values_mask:
89 * a set of flags indicating which of the fields in values has
90 * been set.
91 * Returns:
92 * a GdkGC.
94 public static GC get(int depth, Colormap colormap, GdkGCValues* values, GdkGCValuesMask valuesMask)
96 // GdkGC* gtk_gc_get (gint depth, GdkColormap *colormap, GdkGCValues *values, GdkGCValuesMask values_mask);
97 return new GC( gtk_gc_get(depth, (colormap is null) ? null : colormap.getColormapStruct(), values, valuesMask) );
101 * Releases a GdkGC allocated using gtk_gc_get().
102 * gc:
103 * a GdkGC.
105 public static void release(GC gc)
107 // void gtk_gc_release (GdkGC *gc);
108 gtk_gc_release((gc is null) ? null : gc.getGCStruct());