1 /*
2  * This file is part of gtkD.
3  *
4  * gtkD is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License
6  * as published by the Free Software Foundation; either version 3
7  * of the License, or (at your option) any later version, with
8  * some exceptions, please read the COPYING file.
9  *
10  * gtkD is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with gtkD; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
18  */
19  
20 // generated automatically - do not change
21 // find conversion definition on APILookup.txt
22 // implement new conversion functionalities on the wrap.utils pakage
23 
24 /*
25  * Conversion parameters:
26  * inFile  = GtkTreeStore.html
27  * outPack = gtk
28  * outFile = TreeStore
29  * strct   = GtkTreeStore
30  * realStrct=
31  * ctorStrct=
32  * clss    = TreeStore
33  * interf  = 
34  * class Code: Yes
35  * interface Code: No
36  * template for:
37  * extend  = 
38  * implements:
39  * 	- BuildableIF
40  * 	- TreeModelIF
41  * 	- TreeDragSourceIF
42  * 	- TreeDragDestIF
43  * 	- TreeSortableIF
44  * prefixes:
45  * 	- gtk_tree_store_
46  * omit structs:
47  * omit prefixes:
48  * omit code:
49  * 	- gtk_tree_store_set
50  * omit signals:
51  * imports:
52  * 	- glib.Str
53  * 	- gtk.TreeIter
54  * 	- gobject.Value
55  * 	- gtk.TreeNode
56  * 	- gdk.Pixbuf;
57  * 	- gobject.Value;
58  * 	- gtk.BuildableIF
59  * 	- gtk.BuildableT
60  * 	- gtk.TreeModelT
61  * 	- gtk.TreeModelIF
62  * 	- gtk.TreeDragSourceT
63  * 	- gtk.TreeDragSourceIF
64  * 	- gtk.TreeDragDestT
65  * 	- gtk.TreeDragDestIF
66  * 	- gtk.TreeSortableT
67  * 	- gtk.TreeSortableIF
68  * structWrap:
69  * 	- GValue* -> Value
70  * 	- GtkTreeIter* -> TreeIter
71  * module aliases:
72  * local aliases:
73  * overrides:
74  */
75 
76 module gtk.TreeStore;
77 
78 public  import gtkc.gtktypes;
79 
80 private import gtkc.gtk;
81 private import glib.ConstructionException;
82 private import gobject.ObjectG;
83 
84 private import glib.Str;
85 private import gtk.TreeIter;
86 private import gobject.Value;
87 private import gtk.TreeNode;
88 private import gdk.Pixbuf;;
89 private import gobject.Value;;
90 private import gtk.BuildableIF;
91 private import gtk.BuildableT;
92 private import gtk.TreeModelT;
93 private import gtk.TreeModelIF;
94 private import gtk.TreeDragSourceT;
95 private import gtk.TreeDragSourceIF;
96 private import gtk.TreeDragDestT;
97 private import gtk.TreeDragDestIF;
98 private import gtk.TreeSortableT;
99 private import gtk.TreeSortableIF;
100 
101 
102 private import gobject.ObjectG;
103 
104 /**
105  * The GtkTreeStore object is a list model for use with a GtkTreeView
106  * widget. It implements the GtkTreeModel interface, and consequentialy,
107  * can use all of the methods available there. It also implements the
108  * GtkTreeSortable interface so it can be sorted by the view. Finally,
109  * it also implements the tree
110  * drag and drop
111  * interfaces.
112  *
113  * GtkTreeStore as GtkBuildable
114  *
115  * The GtkTreeStore implementation of the GtkBuildable interface allows
116  * to specify the model columns with a <columns> element that may
117  * contain multiple <column> elements, each specifying one model
118  * column. The "type" attribute specifies the data type for the column.
119  *
120  * $(DDOC_COMMENT example)
121  */
122 public class TreeStore : ObjectG, BuildableIF, TreeModelIF, TreeDragSourceIF, TreeDragDestIF, TreeSortableIF
123 {
124 	
125 	/** the main Gtk struct */
126 	protected GtkTreeStore* gtkTreeStore;
127 	
128 	
129 	/** Get the main Gtk struct */
130 	public GtkTreeStore* getTreeStoreStruct()
131 	{
132 		return gtkTreeStore;
133 	}
134 	
135 	
136 	/** the main Gtk struct as a void* */
137 	protected override void* getStruct()
138 	{
139 		return cast(void*)gtkTreeStore;
140 	}
141 	
142 	/**
143 	 * Sets our main struct and passes it to the parent class
144 	 */
145 	public this (GtkTreeStore* gtkTreeStore)
146 	{
147 		super(cast(GObject*)gtkTreeStore);
148 		this.gtkTreeStore = gtkTreeStore;
149 	}
150 	
151 	protected override void setStruct(GObject* obj)
152 	{
153 		super.setStruct(obj);
154 		gtkTreeStore = cast(GtkTreeStore*)obj;
155 	}
156 	
157 	// add the Buildable capabilities
158 	mixin BuildableT!(GtkTreeStore);
159 	
160 	// add the TreeModel capabilities
161 	mixin TreeModelT!(GtkTreeStore);
162 	
163 	// add the TreeDragSource capabilities
164 	mixin TreeDragSourceT!(GtkTreeStore);
165 	
166 	// add the TreeDragDest capabilities
167 	mixin TreeDragDestT!(GtkTreeStore);
168 	
169 	// add the TreeSortable capabilities
170 	mixin TreeSortableT!(GtkTreeStore);
171 	
172 	/**
173 	 * Creates a top level iteractor.
174 	 * I don't think lists have but the top level iteractor
175 	 */
176 	TreeIter createIter(TreeIter parent=null)
177 	{
178 		GtkTreeIter* iter = new GtkTreeIter;
179 		gtk_tree_store_append(getTreeStoreStruct(), iter, (parent is null) ? null : parent.getTreeIterStruct());
180 		return new TreeIter(iter);
181 	}
182 	
183 	/**
184 	 * Sets one value into one cells.
185 	 * \todo confirm we need to destroy the Value instance
186 	 * Params:
187 	 *  iter = the tree iteractor, effectivly the row
188 	 *  column = to column number to set
189 	 *  value = the value
190 	 */
191 	void setValue(TreeIter iter, int column, string value)
192 	{
193 		gtk_tree_store_set(gtkTreeStore, iter.getTreeIterStruct(), column, Str.toStringz(value) , -1);
194 	}
195 	
196 	/** ditto */
197 	void setValue(TreeIter iter, int column, int value)
198 	{
199 		gtk_tree_store_set(gtkTreeStore, iter.getTreeIterStruct(), column, value, -1);
200 	}
201 	
202 	/** ditto */
203 	//TODO: confirm we need to destroy the Value instance
204 	void setValue(TreeIter iter, int column, Pixbuf pixbuf)
205 	{
206 		Value v = new Value(pixbuf);
207 		gtk_tree_store_set_value(gtkTreeStore, iter.getTreeIterStruct(), column, v.getValueStruct());
208 	}
209 	
210 	/**
211 	 * sets the values for one row
212 	 * Params:
213 	 *  iter = the row iteractor
214 	 *  columns = an arrays with the columns to set
215 	 *  values = an arrays with the values
216 	 */
217 	void set(TreeIter iter, int[] columns, char*[] values)
218 	{
219 		for ( int i=0 ; i<columns.length && i<values.length; i++ )
220 		{
221 			gtk_tree_store_set(
222 			gtkTreeStore,
223 			iter.getTreeIterStruct(),
224 			columns[i],
225 			values[i],-1);
226 		}
227 	}
228 	
229 	/** ditto */
230 	void set(TreeIter iter, int[] columns, string[] values)
231 	{
232 		for ( int i=0 ; i<columns.length && i<values.length; i++ )
233 		{
234 			gtk_tree_store_set(
235 			gtkTreeStore,
236 			iter.getTreeIterStruct(),
237 			columns[i],
238 			Str.toStringz(values[i]),-1);
239 		}
240 	}
241 	
242 	/**
243 	 * Sets an iteractor values from a tree node.
244 	 * This is the way to add a new row to the tree,
245 	 * the iteractor is either a top level iteractor created from createIter()
246 	 * or a nested iteractor created from append()
247 	 * Params:
248 	 *  iter = the iteractor to set
249 	 *  treeNode = the tree node
250 	 * See_Also: createIter(), append()
251 	 */
252 	void set(TreeIter iter, TreeNode treeNode)
253 	{
254 		int[] cols;
255 		string[] vals;
256 		for ( int i=0 ; i<treeNode.columnCount() ; i++ )
257 		{
258 			//printf(">>>>>>>>>>>>> requesting value for %d\n",i);
259 			cols ~= i;
260 			string value = treeNode.getNodeValue(i);
261 			if ( value  is  null )
262 			{
263 				vals ~= "";
264 			}
265 			else
266 			{
267 				vals ~= value;
268 			}
269 		}
270 		set(iter, cols, vals);
271 	}
272 	
273 	
274 	/**
275 	 * Creates and prepends a new row to tree_store. If parent is non-NULL, then it will prepend
276 	 * the new row before the first child of parent, otherwise it will prepend a row
277 	 * to the top level. iter will be changed to point to this new row. The row
278 	 * will be empty after this function is called. To fill in values, you need to
279 	 * call gtk_tree_store_set() or gtk_tree_store_set_value().
280 	 * Params:
281 	 *  parent = A valid GtkTreeIter, or NULL
282 	 */
283 	public TreeIter prepend(TreeIter parent)
284 	{
285 		TreeIter iter = new TreeIter();
286 		// void gtk_tree_store_prepend (GtkTreeStore *tree_store,  GtkTreeIter *iter,  GtkTreeIter *parent);
287 		gtk_tree_store_prepend(gtkTreeStore, iter.getTreeIterStruct(), (parent is null) ? null : parent.getTreeIterStruct());
288 		return iter;
289 	}
290 	
291 	/**
292 	 * Creates and appends a new row to tree_store. If parent is non-NULL, then it will append the
293 	 * new row after the last child of parent, otherwise it will append a row to
294 	 * the top level. iter will be changed to point to this new row. The row will
295 	 * be empty after this function is called. To fill in values, you need to call
296 	 * gtk_tree_store_set() or gtk_tree_store_set_value().
297 	 * Params:
298 	 *  parent = A valid GtkTreeIter, or NULL
299 	 */
300 	public TreeIter append(TreeIter parent)
301 	{
302 		TreeIter iter = new TreeIter();
303 		// void gtk_tree_store_append (GtkTreeStore *tree_store,  GtkTreeIter *iter,  GtkTreeIter *parent);
304 		gtk_tree_store_append(gtkTreeStore,
305 		iter.getTreeIterStruct(),
306 		(parent is null) ? null : parent.getTreeIterStruct());
307 		return iter;
308 	}
309 	
310 	/**
311 	 */
312 	
313 	/**
314 	 * Non vararg creation function. Used primarily by language bindings.
315 	 * Params:
316 	 * types = an array of GType types for the columns, from first to last. [array length=n_columns]
317 	 * Throws: ConstructionException GTK+ fails to create the object.
318 	 */
319 	public this (GType[] types)
320 	{
321 		// GtkTreeStore * gtk_tree_store_newv (gint n_columns,  GType *types);
322 		auto p = gtk_tree_store_newv(cast(int) types.length, types.ptr);
323 		if(p is null)
324 		{
325 			throw new ConstructionException("null returned by gtk_tree_store_newv(cast(int) types.length, types.ptr)");
326 		}
327 		this(cast(GtkTreeStore*) p);
328 	}
329 	
330 	/**
331 	 * This function is meant primarily for GObjects that inherit from
332 	 * GtkTreeStore, and should only be used when constructing a new
333 	 * GtkTreeStore. It will not function after a row has been added,
334 	 * or a method on the GtkTreeModel interface is called.
335 	 * Params:
336 	 * types = An array of GType types, one for each column. [array length=n_columns]
337 	 */
338 	public void setColumnTypes(GType[] types)
339 	{
340 		// void gtk_tree_store_set_column_types (GtkTreeStore *tree_store,  gint n_columns,  GType *types);
341 		gtk_tree_store_set_column_types(gtkTreeStore, cast(int) types.length, types.ptr);
342 	}
343 	
344 	/**
345 	 * Sets the data in the cell specified by iter and column.
346 	 * The type of value must be convertible to the type of the
347 	 * column.
348 	 * Params:
349 	 * iter = A valid GtkTreeIter for the row being modified
350 	 * column = column number to modify
351 	 * value = new value for the cell
352 	 */
353 	public void setValue(TreeIter iter, int column, Value value)
354 	{
355 		// void gtk_tree_store_set_value (GtkTreeStore *tree_store,  GtkTreeIter *iter,  gint column,  GValue *value);
356 		gtk_tree_store_set_value(gtkTreeStore, (iter is null) ? null : iter.getTreeIterStruct(), column, (value is null) ? null : value.getValueStruct());
357 	}
358 	
359 	/**
360 	 * See gtk_tree_store_set(); this version takes a va_list for
361 	 * use by language bindings.
362 	 * Params:
363 	 * iter = A valid GtkTreeIter for the row being modified
364 	 * varArgs = va_list of column/value pairs
365 	 */
366 	public void setValist(TreeIter iter, void* varArgs)
367 	{
368 		// void gtk_tree_store_set_valist (GtkTreeStore *tree_store,  GtkTreeIter *iter,  va_list var_args);
369 		gtk_tree_store_set_valist(gtkTreeStore, (iter is null) ? null : iter.getTreeIterStruct(), varArgs);
370 	}
371 	
372 	/**
373 	 * A variant of gtk_tree_store_set_valist() which takes
374 	 * the columns and values as two arrays, instead of varargs. This
375 	 * function is mainly intended for language bindings or in case
376 	 * the number of columns to change is not known until run-time.
377 	 * Since 2.12
378 	 * Params:
379 	 * iter = A valid GtkTreeIter for the row being modified
380 	 * columns = an array of column numbers. [array length=n_values]
381 	 * values = an array of GValues. [array length=n_values]
382 	 */
383 	public void setValuesv(TreeIter iter, int[] columns, GValue[] values)
384 	{
385 		// void gtk_tree_store_set_valuesv (GtkTreeStore *tree_store,  GtkTreeIter *iter,  gint *columns,  GValue *values,  gint n_values);
386 		gtk_tree_store_set_valuesv(gtkTreeStore, (iter is null) ? null : iter.getTreeIterStruct(), columns.ptr, values.ptr, cast(int) columns.length);
387 	}
388 	
389 	/**
390 	 * Removes iter from tree_store. After being removed, iter is set to the
391 	 * next valid row at that level, or invalidated if it previously pointed to the
392 	 * last one.
393 	 * Params:
394 	 * iter = A valid GtkTreeIter
395 	 * Returns: TRUE if iter is still valid, FALSE if not.
396 	 */
397 	public int remove(TreeIter iter)
398 	{
399 		// gboolean gtk_tree_store_remove (GtkTreeStore *tree_store,  GtkTreeIter *iter);
400 		return gtk_tree_store_remove(gtkTreeStore, (iter is null) ? null : iter.getTreeIterStruct());
401 	}
402 	
403 	/**
404 	 * Creates a new row at position. If parent is non-NULL, then the row will be
405 	 * made a child of parent. Otherwise, the row will be created at the toplevel.
406 	 * If position is -1 or is larger than the number of rows at that level, then
407 	 * the new row will be inserted to the end of the list. iter will be changed
408 	 * to point to this new row. The row will be empty after this function is
409 	 * called. To fill in values, you need to call gtk_tree_store_set() or
410 	 * gtk_tree_store_set_value().
411 	 * Params:
412 	 * iter = An unset GtkTreeIter to set to the new row. [out]
413 	 * parent = A valid GtkTreeIter, or NULL. [allow-none]
414 	 * position = position to insert the new row, or -1 for last
415 	 */
416 	public void insert(TreeIter iter, TreeIter parent, int position)
417 	{
418 		// void gtk_tree_store_insert (GtkTreeStore *tree_store,  GtkTreeIter *iter,  GtkTreeIter *parent,  gint position);
419 		gtk_tree_store_insert(gtkTreeStore, (iter is null) ? null : iter.getTreeIterStruct(), (parent is null) ? null : parent.getTreeIterStruct(), position);
420 	}
421 	
422 	/**
423 	 * Inserts a new row before sibling. If sibling is NULL, then the row will
424 	 * be appended to parent 's children. If parent and sibling are NULL, then
425 	 * the row will be appended to the toplevel. If both sibling and parent are
426 	 * set, then parent must be the parent of sibling. When sibling is set,
427 	 * parent is optional.
428 	 * iter will be changed to point to this new row. The row will be empty after
429 	 * this function is called. To fill in values, you need to call
430 	 * gtk_tree_store_set() or gtk_tree_store_set_value().
431 	 * Params:
432 	 * iter = An unset GtkTreeIter to set to the new row. [out]
433 	 * parent = A valid GtkTreeIter, or NULL. [allow-none]
434 	 * sibling = A valid GtkTreeIter, or NULL. [allow-none]
435 	 */
436 	public void insertBefore(TreeIter iter, TreeIter parent, TreeIter sibling)
437 	{
438 		// void gtk_tree_store_insert_before (GtkTreeStore *tree_store,  GtkTreeIter *iter,  GtkTreeIter *parent,  GtkTreeIter *sibling);
439 		gtk_tree_store_insert_before(gtkTreeStore, (iter is null) ? null : iter.getTreeIterStruct(), (parent is null) ? null : parent.getTreeIterStruct(), (sibling is null) ? null : sibling.getTreeIterStruct());
440 	}
441 	
442 	/**
443 	 * Inserts a new row after sibling. If sibling is NULL, then the row will be
444 	 * prepended to parent 's children. If parent and sibling are NULL, then
445 	 * the row will be prepended to the toplevel. If both sibling and parent are
446 	 * set, then parent must be the parent of sibling. When sibling is set,
447 	 * parent is optional.
448 	 * iter will be changed to point to this new row. The row will be empty after
449 	 * this function is called. To fill in values, you need to call
450 	 * gtk_tree_store_set() or gtk_tree_store_set_value().
451 	 * Params:
452 	 * iter = An unset GtkTreeIter to set to the new row. [out]
453 	 * parent = A valid GtkTreeIter, or NULL. [allow-none]
454 	 * sibling = A valid GtkTreeIter, or NULL. [allow-none]
455 	 */
456 	public void insertAfter(TreeIter iter, TreeIter parent, TreeIter sibling)
457 	{
458 		// void gtk_tree_store_insert_after (GtkTreeStore *tree_store,  GtkTreeIter *iter,  GtkTreeIter *parent,  GtkTreeIter *sibling);
459 		gtk_tree_store_insert_after(gtkTreeStore, (iter is null) ? null : iter.getTreeIterStruct(), (parent is null) ? null : parent.getTreeIterStruct(), (sibling is null) ? null : sibling.getTreeIterStruct());
460 	}
461 	
462 	/**
463 	 * A variant of gtk_tree_store_insert_with_values() which takes
464 	 * the columns and values as two arrays, instead of varargs. This
465 	 * function is mainly intended for language bindings.
466 	 * Since 2.10
467 	 * Params:
468 	 * iter = An unset GtkTreeIter to set the new row, or NULL. [out][allow-none]
469 	 * parent = A valid GtkTreeIter, or NULL. [allow-none]
470 	 * position = position to insert the new row, or -1 for last
471 	 * columns = an array of column numbers. [array length=n_values]
472 	 * values = an array of GValues. [array length=n_values]
473 	 */
474 	public void insertWithValuesv(TreeIter iter, TreeIter parent, int position, int[] columns, GValue[] values)
475 	{
476 		// void gtk_tree_store_insert_with_valuesv (GtkTreeStore *tree_store,  GtkTreeIter *iter,  GtkTreeIter *parent,  gint position,  gint *columns,  GValue *values,  gint n_values);
477 		gtk_tree_store_insert_with_valuesv(gtkTreeStore, (iter is null) ? null : iter.getTreeIterStruct(), (parent is null) ? null : parent.getTreeIterStruct(), position, columns.ptr, values.ptr, cast(int) columns.length);
478 	}
479 	
480 	/**
481 	 * Prepends a new row to tree_store. If parent is non-NULL, then it will prepend
482 	 * the new row before the first child of parent, otherwise it will prepend a row
483 	 * to the top level. iter will be changed to point to this new row. The row
484 	 * will be empty after this function is called. To fill in values, you need to
485 	 * call gtk_tree_store_set() or gtk_tree_store_set_value().
486 	 * Params:
487 	 * iter = An unset GtkTreeIter to set to the prepended row. [out]
488 	 * parent = A valid GtkTreeIter, or NULL. [allow-none]
489 	 */
490 	public void prepend(TreeIter iter, TreeIter parent)
491 	{
492 		// void gtk_tree_store_prepend (GtkTreeStore *tree_store,  GtkTreeIter *iter,  GtkTreeIter *parent);
493 		gtk_tree_store_prepend(gtkTreeStore, (iter is null) ? null : iter.getTreeIterStruct(), (parent is null) ? null : parent.getTreeIterStruct());
494 	}
495 	
496 	/**
497 	 * Appends a new row to tree_store. If parent is non-NULL, then it will append the
498 	 * new row after the last child of parent, otherwise it will append a row to
499 	 * the top level. iter will be changed to point to this new row. The row will
500 	 * be empty after this function is called. To fill in values, you need to call
501 	 * gtk_tree_store_set() or gtk_tree_store_set_value().
502 	 * Params:
503 	 * iter = An unset GtkTreeIter to set to the appended row. [out]
504 	 * parent = A valid GtkTreeIter, or NULL. [allow-none]
505 	 */
506 	public void append(TreeIter iter, TreeIter parent)
507 	{
508 		// void gtk_tree_store_append (GtkTreeStore *tree_store,  GtkTreeIter *iter,  GtkTreeIter *parent);
509 		gtk_tree_store_append(gtkTreeStore, (iter is null) ? null : iter.getTreeIterStruct(), (parent is null) ? null : parent.getTreeIterStruct());
510 	}
511 	
512 	/**
513 	 * Returns TRUE if iter is an ancestor of descendant. That is, iter is the
514 	 * parent (or grandparent or great-grandparent) of descendant.
515 	 * Params:
516 	 * iter = A valid GtkTreeIter
517 	 * descendant = A valid GtkTreeIter
518 	 * Returns: TRUE, if iter is an ancestor of descendant
519 	 */
520 	public int isAncestor(TreeIter iter, TreeIter descendant)
521 	{
522 		// gboolean gtk_tree_store_is_ancestor (GtkTreeStore *tree_store,  GtkTreeIter *iter,  GtkTreeIter *descendant);
523 		return gtk_tree_store_is_ancestor(gtkTreeStore, (iter is null) ? null : iter.getTreeIterStruct(), (descendant is null) ? null : descendant.getTreeIterStruct());
524 	}
525 	
526 	/**
527 	 * Returns the depth of iter. This will be 0 for anything on the root level, 1
528 	 * for anything down a level, etc.
529 	 * Params:
530 	 * iter = A valid GtkTreeIter
531 	 * Returns: The depth of iter
532 	 */
533 	public int iterDepth(TreeIter iter)
534 	{
535 		// gint gtk_tree_store_iter_depth (GtkTreeStore *tree_store,  GtkTreeIter *iter);
536 		return gtk_tree_store_iter_depth(gtkTreeStore, (iter is null) ? null : iter.getTreeIterStruct());
537 	}
538 	
539 	/**
540 	 * Removes all rows from tree_store
541 	 */
542 	public void clear()
543 	{
544 		// void gtk_tree_store_clear (GtkTreeStore *tree_store);
545 		gtk_tree_store_clear(gtkTreeStore);
546 	}
547 	
548 	/**
549 	 * WARNING: This function is slow. Only use it for debugging and/or testing
550 	 * purposes.
551 	 * Checks if the given iter is a valid iter for this GtkTreeStore.
552 	 * Since 2.2
553 	 * Params:
554 	 * iter = A GtkTreeIter.
555 	 * Returns: TRUE if the iter is valid, FALSE if the iter is invalid.
556 	 */
557 	public int iterIsValid(TreeIter iter)
558 	{
559 		// gboolean gtk_tree_store_iter_is_valid (GtkTreeStore *tree_store,  GtkTreeIter *iter);
560 		return gtk_tree_store_iter_is_valid(gtkTreeStore, (iter is null) ? null : iter.getTreeIterStruct());
561 	}
562 	
563 	/**
564 	 * Reorders the children of parent in tree_store to follow the order
565 	 * indicated by new_order. Note that this function only works with
566 	 * unsorted stores.
567 	 * Since 2.2
568 	 * Params:
569 	 * parent = A GtkTreeIter.
570 	 * newOrder = an array of integers mapping the new position of each child
571 	 * to its old position before the re-ordering,
572 	 * i.e. new_order[newpos] = oldpos. [array]
573 	 */
574 	public void reorder(TreeIter parent, int[] newOrder)
575 	{
576 		// void gtk_tree_store_reorder (GtkTreeStore *tree_store,  GtkTreeIter *parent,  gint *new_order);
577 		gtk_tree_store_reorder(gtkTreeStore, (parent is null) ? null : parent.getTreeIterStruct(), newOrder.ptr);
578 	}
579 	
580 	/**
581 	 * Swaps a and b in the same level of tree_store. Note that this function
582 	 * only works with unsorted stores.
583 	 * Since 2.2
584 	 * Params:
585 	 * a = A GtkTreeIter.
586 	 * b = Another GtkTreeIter.
587 	 */
588 	public void swap(TreeIter a, TreeIter b)
589 	{
590 		// void gtk_tree_store_swap (GtkTreeStore *tree_store,  GtkTreeIter *a,  GtkTreeIter *b);
591 		gtk_tree_store_swap(gtkTreeStore, (a is null) ? null : a.getTreeIterStruct(), (b is null) ? null : b.getTreeIterStruct());
592 	}
593 	
594 	/**
595 	 * Moves iter in tree_store to the position before position. iter and
596 	 * position should be in the same level. Note that this function only
597 	 * works with unsorted stores. If position is NULL, iter will be
598 	 * moved to the end of the level.
599 	 * Since 2.2
600 	 * Params:
601 	 * iter = A GtkTreeIter.
602 	 * position = A GtkTreeIter or NULL. [allow-none]
603 	 */
604 	public void moveBefore(TreeIter iter, TreeIter position)
605 	{
606 		// void gtk_tree_store_move_before (GtkTreeStore *tree_store,  GtkTreeIter *iter,  GtkTreeIter *position);
607 		gtk_tree_store_move_before(gtkTreeStore, (iter is null) ? null : iter.getTreeIterStruct(), (position is null) ? null : position.getTreeIterStruct());
608 	}
609 	
610 	/**
611 	 * Moves iter in tree_store to the position after position. iter and
612 	 * position should be in the same level. Note that this function only
613 	 * works with unsorted stores. If position is NULL, iter will be moved
614 	 * to the start of the level.
615 	 * Since 2.2
616 	 * Params:
617 	 * iter = A GtkTreeIter.
618 	 * position = A GtkTreeIter. [allow-none]
619 	 */
620 	public void moveAfter(TreeIter iter, TreeIter position)
621 	{
622 		// void gtk_tree_store_move_after (GtkTreeStore *tree_store,  GtkTreeIter *iter,  GtkTreeIter *position);
623 		gtk_tree_store_move_after(gtkTreeStore, (iter is null) ? null : iter.getTreeIterStruct(), (position is null) ? null : position.getTreeIterStruct());
624 	}
625 }