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 = gobject-Value-arrays.html
27 * outFile = ValueArray
45 * - gobject.ValueArray
48 * - GValueArray* -> ValueArray
52 module gobject
.ValueArray
;
54 private import gobject
.gobjecttypes
;
56 private import lib
.gobject
;
58 private import gobject
.Value
;
59 private import gobject
.ValueArray
;
63 * The prime purpose of a GValueArray is for it to be used as an object property
64 * that holds an array of values. A GValueArray wraps an array of GValue elements
65 * in order for it to be used as a boxed type through G_TYPE_VALUE_ARRAY.
67 public class ValueArray
70 /** the main Gtk struct */
71 protected GValueArray
* gValueArray
;
74 public GValueArray
* getValueArrayStruct()
80 /** the main Gtk struct as a void* */
81 protected void* getStruct()
83 return cast(void*)gValueArray
;
87 * Sets our main struct and passes it to the parent class
89 public this (GValueArray
* gValueArray
)
91 this.gValueArray
= gValueArray
;
99 * Return a pointer to the value at index_ containd in value_array.
101 * GValueArray to get a value from
103 * index of the value of interest
105 * pointer to a value at index_ in value_array
107 public Value
getNth(uint index
)
109 // GValue* g_value_array_get_nth (GValueArray *value_array, guint index_);
110 return new Value( g_value_array_get_nth(gValueArray
, index
) );
114 * Allocate and initialize a new GValueArray, optionally preserve space
115 * for n_prealloced elements. New arrays always contain 0 elements,
116 * regardless of the value of n_prealloced.
118 * number of values to preallocate space for
120 * a newly allocated GValueArray with 0 values
122 public this (uint nPrealloced
)
124 // GValueArray* g_value_array_new (guint n_prealloced);
125 this(cast(GValueArray
*)g_value_array_new(nPrealloced
) );
129 * Construct an exact copy of a GValueArray by duplicating all its
132 * GValueArray to copy
134 * Newly allocated copy of GValueArray
136 public ValueArray
copy()
138 // GValueArray* g_value_array_copy (const GValueArray *value_array);
139 return new ValueArray( g_value_array_copy(gValueArray
) );
143 * Free a GValueArray including its contents.
145 * GValueArray to free
149 // void g_value_array_free (GValueArray *value_array);
150 g_value_array_free(gValueArray
);
154 * Insert a copy of value as last element of value_array.
156 * GValueArray to add an element to
158 * GValue to copy into GValueArray
160 * the GValueArray passed in as value_array
162 public ValueArray
append(Value value
)
164 // GValueArray* g_value_array_append (GValueArray *value_array, const GValue *value);
165 return new ValueArray( g_value_array_append(gValueArray
, (value
is null) ?
null : value
.getValueStruct()) );
169 * Insert a copy of value as first element of value_array.
171 * GValueArray to add an element to
173 * GValue to copy into GValueArray
175 * the GValueArray passed in as value_array
177 public ValueArray
prepend(Value value
)
179 // GValueArray* g_value_array_prepend (GValueArray *value_array, const GValue *value);
180 return new ValueArray( g_value_array_prepend(gValueArray
, (value
is null) ?
null : value
.getValueStruct()) );
184 * Insert a copy of value at specified position into value_array.
186 * GValueArray to add an element to
188 * insertion position, must be <= value_array->n_values
190 * GValue to copy into GValueArray
192 * the GValueArray passed in as value_array
194 public ValueArray
insert(uint index
, Value value
)
196 // GValueArray* g_value_array_insert (GValueArray *value_array, guint index_, const GValue *value);
197 return new ValueArray( g_value_array_insert(gValueArray
, index
, (value
is null) ?
null : value
.getValueStruct()) );
201 * Remove the value at position index_ from value_array.
203 * GValueArray to remove an element from
205 * position of value to remove, must be < value_array->n_values
207 * the GValueArray passed in as value_array
209 public ValueArray
remove(uint index
)
211 // GValueArray* g_value_array_remove (GValueArray *value_array, guint index_);
212 return new ValueArray( g_value_array_remove(gValueArray
, index
) );
216 * Sort value_array using compare_func to compare the elements accoring to
217 * the semantics of GCompareFunc.
218 * The current implementation uses Quick-Sort as sorting algorithm.
220 * GValueArray to sort
222 * function to compare elements
224 * the GValueArray passed in as value_array
226 public ValueArray
sort(GCompareFunc compareFunc
)
228 // GValueArray* g_value_array_sort (GValueArray *value_array, GCompareFunc compare_func);
229 return new ValueArray( g_value_array_sort(gValueArray
, compareFunc
) );
233 * Sort value_array using compare_func to compare the elements accoring
234 * to the semantics of GCompareDataFunc.
235 * The current implementation uses Quick-Sort as sorting algorithm.
237 * GValueArray to sort
239 * function to compare elements
241 * extra data argument provided for compare_func
243 * the GValueArray passed in as value_array
245 * GValue, GParamSpecValueArray, g_param_spec_value_array()
247 public ValueArray
sortWithData(GCompareDataFunc compareFunc
, void* userData
)
249 // GValueArray* g_value_array_sort_with_data (GValueArray *value_array, GCompareDataFunc compare_func, gpointer user_data);
250 return new ValueArray( g_value_array_sort_with_data(gValueArray
, compareFunc
, userData
) );