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 = glib-Quarks.html
52 private import glib
.glibtypes
;
54 private import lib
.glib
;
56 private import glib
.ErrorG
;
57 private import glib
.Str
;
61 * Quarks are associations between strings and integer identifiers.
62 * Given either the string or the GQuark identifier it is possible to
64 * Quarks are used for both
67 * To create a new quark from a string, use g_quark_from_string() or
68 * g_quark_from_static_string().
69 * To find the string corresponding to a given GQuark, use g_quark_to_string().
70 * To find the GQuark corresponding to a given string, use g_quark_try_string().
71 * Another use for the string pool maintained for the quark functions is string
72 * interning, using g_intern_string() or g_intern_static_string(). An interned string
73 * is a canonical representation for a string. One important advantage of interned strings
74 * is that they can be compared for equality by a simple pointer comparision, rather than
80 /** the main Gtk struct */
81 protected GQuark
* gQuark
;
84 public GQuark
* getQuarkStruct()
90 /** the main Gtk struct as a void* */
91 protected void* getStruct()
93 return cast(void*)gQuark
;
97 * Sets our main struct and passes it to the parent class
99 public this (GQuark
* gQuark
)
101 this.gQuark
= gQuark
;
109 * Gets the GQuark identifying the given string.
110 * If the string does not currently have an associated GQuark, a new
111 * GQuark is created, using a copy of the string.
115 * the GQuark identifying the string.
117 public static GQuark
fromString(char[] string
)
119 // GQuark g_quark_from_string (const gchar *string);
120 return g_quark_from_string(Str
.toStringz(string
));
124 * Gets the GQuark identifying the given (static) string.
125 * If the string does not currently have an associated GQuark, a new
126 * GQuark is created, linked to the given string.
127 * Note that this function is identical to g_quark_from_string() except
128 * that if a new GQuark is created the string itself is used rather than
129 * a copy. This saves memory, but can only be used if the string will
130 * always exist. It can be used with statically
131 * allocated strings in the main program, but not with statically
132 * allocated memory in dynamically loaded modules, if you expect to
133 * ever unload the module again (e.g. do not use this function in
134 * GTK+ theme engines).
138 * the GQuark identifying the string.
140 public static GQuark
fromStaticString(char[] string
)
142 // GQuark g_quark_from_static_string (const gchar *string);
143 return g_quark_from_static_string(Str
.toStringz(string
));
147 * Gets the string associated with the given GQuark.
151 * the string associated with the GQuark.
153 public static char[] toString(GQuark quark
)
155 // const gchar* g_quark_to_string (GQuark quark);
156 return Str
.toString(g_quark_to_string(quark
) );
160 * Gets the GQuark associated with the given string, or 0 if the string has
161 * no associated GQuark.
162 * If you want the GQuark to be created if it doesn't already exist, use
163 * g_quark_from_string() or g_quark_from_static_string().
167 * the GQuark associated with the string, or 0 if there is no
168 * GQuark associated with the string.
170 public static GQuark
tryString(char[] string
)
172 // GQuark g_quark_try_string (const gchar *string);
173 return g_quark_try_string(Str
.toStringz(string
));
177 * Returns a canonical representation for string. Interned strings can
178 * be compared for equality by comparing the pointers, instead of using strcmp().
182 * a canonical representation for the string
185 public static char[] gInternString(char[] string
)
187 // const gchar* g_intern_string (const gchar *string);
188 return Str
.toString(g_intern_string(Str
.toStringz(string
)) );
192 * Returns a canonical representation for string. Interned strings can
193 * be compared for equality by comparing the pointers, instead of using strcmp().
194 * g_intern_static_string() does not copy the string, therefore string must
195 * not be freed or modified.
199 * a canonical representation for the string
202 public static char[] gInternStaticString(char[] string
)
204 // const gchar* g_intern_static_string (const gchar *string);
205 return Str
.toString(g_intern_static_string(Str
.toStringz(string
)) );