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-Keyed-Data-Lists.html
47 * - GDataset* -> Dataset
53 private import glib
.glibtypes
;
55 private import lib
.glib
;
57 private import glib
.Quark
;
58 private import glib
.Dataset
;
62 * Keyed data lists provide lists of arbitrary data elements which can be accessed
63 * either with a string or with a GQuark corresponding to the
65 * The GQuark methods are quicker, since the strings have to be converted to
67 * Data lists are used for associating arbitrary data with
68 * GObjects, using g_object_set_data() and related functions.
69 * To create a datalist, use g_datalist_init().
70 * To add data elements to a datalist use g_datalist_id_set_data(),
71 * g_datalist_id_set_data_full(), g_datalist_set_data()
72 * and g_datalist_set_data_full().
73 * To get data elements from a datalist use g_datalist_id_get_data() and
74 * g_datalist_get_data().
75 * To iterate over all data elements in a datalist use g_datalist_foreach() (not thread-safe).
76 * To remove data elements from a datalist use g_datalist_id_remove_data() and
77 * g_datalist_remove_data().
78 * To remove all data elements from a datalist, use g_datalist_clear().
83 /** the main Gtk struct */
84 protected GData
* gData
;
87 public GData
* getDataListStruct()
93 /** the main Gtk struct as a void* */
94 protected void* getStruct()
96 return cast(void*)gData
;
100 * Sets our main struct and passes it to the parent class
102 public this (GData
* gData
)
112 * Resets the datalist to NULL.
113 * It does not free any memory or call any destroy functions.
115 * a pointer to a pointer to a datalist.
117 public static void init(GData
** datalist
)
119 // void g_datalist_init (GData **datalist);
120 g_datalist_init(datalist
);
125 * Sets the data corresponding to the given GQuark id, and the function to
126 * be called when the element is removed from the datalist.
127 * Any previous data with the same key is removed, and its
128 * destroy function is called.
132 * the GQuark to identify the data element.
134 * the data element or NULL to remove any previous element
135 * corresponding to key_id.
137 * the function to call when the data element is removed. This
138 * function will be called with the data element and can be used to free any
139 * memory allocated for it. If data is NULL, then destroy_func must
142 public static void idSetDataFull(GData
** datalist
, GQuark keyId
, void* data
, GDestroyNotify destroyFunc
)
144 // void g_datalist_id_set_data_full (GData **datalist, GQuark key_id, gpointer data, GDestroyNotify destroy_func);
145 g_datalist_id_set_data_full(datalist
, keyId
, data
, destroyFunc
);
149 * Retrieves the data element corresponding to key_id.
153 * the GQuark identifying a data element.
155 * the data element, or NULL if it is not found.
157 public static void* idGetData(GData
** datalist
, GQuark keyId
)
159 // gpointer g_datalist_id_get_data (GData **datalist, GQuark key_id);
160 return g_datalist_id_get_data(datalist
, keyId
);
165 * Removes an element, without calling its destroy notification function.
169 * the GQuark identifying a data element.
171 * the data previously stored at key_id, or NULL if none.
173 public static void* idRemoveNoNotify(GData
** datalist
, GQuark keyId
)
175 // gpointer g_datalist_id_remove_no_notify (GData **datalist, GQuark key_id);
176 return g_datalist_id_remove_no_notify(datalist
, keyId
);
185 * Calls the given function for each data element of the datalist.
186 * The function is called with each data element's GQuark id and data,
187 * together with the given user_data parameter.
188 * Note that this function is NOT thread-safe. So unless datalist
189 * can be protected from any modifications during invocation of this
190 * function, it should not be called.
194 * the function to call for each data element.
196 * user data to pass to the function.
198 public static void foreac(GData
** datalist
, GDataForeachFunc func
, void* userData
)
200 // void g_datalist_foreach (GData **datalist, GDataForeachFunc func, gpointer user_data);
201 g_datalist_foreach(datalist
, func
, userData
);
205 * Frees all the data elements of the datalist.
206 * The data elements' destroy functions are called if they have been set.
210 public static void clear(GData
** datalist
)
212 // void g_datalist_clear (GData **datalist);
213 g_datalist_clear(datalist
);
217 * Turns on flag values for a data list. This function is used
218 * to keep a small number of boolean flags in an object with
219 * a data list without using any additional space. It is
220 * not generally useful except in circumstances where space
221 * is very tight. (It is used in the base GObject type, for
224 * pointer to the location that holds a list
226 * the flags to turn on. The values of the flags are
227 * restricted by G_DATALIST_FLAGS_MASK (currently
228 * 3; giving two possible boolean flags).
229 * A value for flags that doesn't fit within the mask is
233 public static void setFlags(GData
** datalist
, uint flags
)
235 // void g_datalist_set_flags (GData **datalist, guint flags);
236 g_datalist_set_flags(datalist
, flags
);
240 * Turns off flag values for a data list. See g_datalist_unset_flags()
242 * pointer to the location that holds a list
244 * the flags to turn off. The values of the flags are
245 * restricted by G_DATALIST_FLAGS_MASK (currently
246 * 3: giving two possible boolean flags).
247 * A value for flags that doesn't fit within the mask is
251 public static void unsetFlags(GData
** datalist
, uint flags
)
253 // void g_datalist_unset_flags (GData **datalist, guint flags);
254 g_datalist_unset_flags(datalist
, flags
);
258 * Gets flags values packed in together with the datalist.
259 * See g_datalist_set_flags().
261 * pointer to the location that holds a list
263 * the flags of the datalist
266 public static uint getFlags(GData
** datalist
)
268 // guint g_datalist_get_flags (GData **datalist);
269 return g_datalist_get_flags(datalist
);