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  = glib-Sequences.html
27  * outPack = glib
28  * outFile = Sequence
29  * strct   = GSequence
30  * realStrct=
31  * ctorStrct=
32  * clss    = Sequence
33  * interf  = 
34  * class Code: No
35  * interface Code: No
36  * template for:
37  * extend  = 
38  * implements:
39  * prefixes:
40  * 	- g_sequence_
41  * omit structs:
42  * omit prefixes:
43  * 	- g_sequence_iter_
44  * omit code:
45  * omit signals:
46  * imports:
47  * 	- glib.SequenceIter
48  * structWrap:
49  * 	- GSequence* -> Sequence
50  * 	- GSequenceIter* -> SequenceIter
51  * module aliases:
52  * local aliases:
53  * overrides:
54  */
55 
56 module glib.Sequence;
57 
58 public  import gtkc.glibtypes;
59 
60 private import gtkc.glib;
61 private import glib.ConstructionException;
62 
63 
64 private import glib.SequenceIter;
65 
66 
67 
68 
69 /**
70  * Description
71  * The GSequence data structure has the API of a list, but is
72  * implemented internally with a balanced binary tree. This means that
73  * it is possible to maintain a sorted list of n elements in time O(n
74  * log n). The data contained in each element can be either integer
75  * values, by using of the Type Conversion Macros,
76  * or simply pointers to any type of data.
77  * A GSequence is accessed through iterators,
78  * represented by a GSequenceIter. An iterator represents a position
79  * between two elements of the sequence. For example, the
80  * begin iterator represents the gap immediately
81  * before the first element of the sequence, and the
82  * end iterator represents the gap immediately
83  * after the last element. In an empty sequence, the begin and end
84  * iterators are the same.
85  * Some methods on GSequence operate on ranges of items. For example
86  * g_sequence_foreach_range() will call a user-specified function on
87  * each element with the given range. The range is delimited by the
88  * gaps represented by the passed-in iterators, so if you pass in the
89  * begin and end iterators, the range in question is the entire
90  * sequence.
91  * The function g_sequence_get() is used with an iterator to access the
92  * element immediately following the gap that the iterator represents.
93  * The iterator is said to point to that element.
94  * Iterators are stable across most operations on a GSequence. For
95  * example an iterator pointing to some element of a sequence will
96  * continue to point to that element even after the sequence is sorted.
97  * Even moving an element to another sequence using for example
98  * g_sequence_move_range() will not invalidate the iterators pointing
99  * to it. The only operation that will invalidate an iterator is when
100  * the element it points to is removed from any sequence.
101  */
102 public class Sequence
103 {
104 	
105 	/** the main Gtk struct */
106 	protected GSequence* gSequence;
107 	
108 	
109 	public GSequence* getSequenceStruct()
110 	{
111 		return gSequence;
112 	}
113 	
114 	
115 	/** the main Gtk struct as a void* */
116 	protected void* getStruct()
117 	{
118 		return cast(void*)gSequence;
119 	}
120 	
121 	/**
122 	 * Sets our main struct and passes it to the parent class
123 	 */
124 	public this (GSequence* gSequence)
125 	{
126 		this.gSequence = gSequence;
127 	}
128 	
129 	/**
130 	 */
131 	
132 	/**
133 	 * Creates a new GSequence. The data_destroy function, if non-NULL will
134 	 * be called on all items when the sequence is destroyed and on items that
135 	 * are removed from the sequence.
136 	 * Since 2.14
137 	 * Params:
138 	 * dataDestroy = a GDestroyNotify function, or NULL
139 	 * Throws: ConstructionException GTK+ fails to create the object.
140 	 */
141 	public this (GDestroyNotify dataDestroy)
142 	{
143 		// GSequence * g_sequence_new (GDestroyNotify data_destroy);
144 		auto p = g_sequence_new(dataDestroy);
145 		if(p is null)
146 		{
147 			throw new ConstructionException("null returned by g_sequence_new(dataDestroy)");
148 		}
149 		this(cast(GSequence*) p);
150 	}
151 	
152 	/**
153 	 * Frees the memory allocated for seq. If seq has a data destroy
154 	 * function associated with it, that function is called on all items in
155 	 * seq.
156 	 * Since 2.14
157 	 */
158 	public void free()
159 	{
160 		// void g_sequence_free (GSequence *seq);
161 		g_sequence_free(gSequence);
162 	}
163 	
164 	/**
165 	 * Returns the length of seq
166 	 * Since 2.14
167 	 * Returns: the length of seq
168 	 */
169 	public int getLength()
170 	{
171 		// gint g_sequence_get_length (GSequence *seq);
172 		return g_sequence_get_length(gSequence);
173 	}
174 	
175 	/**
176 	 * Calls func for each item in the sequence passing user_data
177 	 * to the function.
178 	 * Since 2.14
179 	 * Params:
180 	 * func = the function to call for each item in seq
181 	 * userData = user data passed to func
182 	 */
183 	public void foreac(GFunc func, void* userData)
184 	{
185 		// void g_sequence_foreach (GSequence *seq,  GFunc func,  gpointer user_data);
186 		g_sequence_foreach(gSequence, func, userData);
187 	}
188 	
189 	/**
190 	 * Calls func for each item in the range (begin, end) passing
191 	 * user_data to the function.
192 	 * Since 2.14
193 	 * Params:
194 	 * begin = a GSequenceIter
195 	 * end = a GSequenceIter
196 	 * func = a GFunc
197 	 * userData = user data passed to func
198 	 */
199 	public static void foreachRange(SequenceIter begin, SequenceIter end, GFunc func, void* userData)
200 	{
201 		// void g_sequence_foreach_range (GSequenceIter *begin,  GSequenceIter *end,  GFunc func,  gpointer user_data);
202 		g_sequence_foreach_range((begin is null) ? null : begin.getSequenceIterStruct(), (end is null) ? null : end.getSequenceIterStruct(), func, userData);
203 	}
204 	
205 	/**
206 	 * Sorts seq using cmp_func.
207 	 * Since 2.14
208 	 * Params:
209 	 * cmpFunc = the GCompareDataFunc used to sort seq. This function is
210 	 * passed two items of seq and should return 0 if they are equal,
211 	 * a negative value if the first comes before the second, and a
212 	 * positive value if the second comes before the first.
213 	 * cmpData = user data passed to cmp_func
214 	 */
215 	public void sort(GCompareDataFunc cmpFunc, void* cmpData)
216 	{
217 		// void g_sequence_sort (GSequence *seq,  GCompareDataFunc cmp_func,  gpointer cmp_data);
218 		g_sequence_sort(gSequence, cmpFunc, cmpData);
219 	}
220 	
221 	/**
222 	 * Like g_sequence_sort(), but uses a GSequenceIterCompareFunc instead
223 	 * of a GCompareDataFunc as the compare function
224 	 * Since 2.14
225 	 * Params:
226 	 * cmpFunc = the GSequenceItercompare used to compare iterators in the
227 	 * sequence. It is called with two iterators pointing into seq. It should
228 	 * return 0 if the iterators are equal, a negative value if the first
229 	 * iterator comes before the second, and a positive value if the second
230 	 * iterator comes before the first.
231 	 * cmpData = user data passed to cmp_func
232 	 */
233 	public void sortIter(GSequenceIterCompareFunc cmpFunc, void* cmpData)
234 	{
235 		// void g_sequence_sort_iter (GSequence *seq,  GSequenceIterCompareFunc cmp_func,  gpointer cmp_data);
236 		g_sequence_sort_iter(gSequence, cmpFunc, cmpData);
237 	}
238 	
239 	/**
240 	 * Returns the begin iterator for seq.
241 	 * Since 2.14
242 	 * Returns: the begin iterator for seq.
243 	 */
244 	public SequenceIter getBeginIter()
245 	{
246 		// GSequenceIter * g_sequence_get_begin_iter (GSequence *seq);
247 		auto p = g_sequence_get_begin_iter(gSequence);
248 		
249 		if(p is null)
250 		{
251 			return null;
252 		}
253 		
254 		return new SequenceIter(cast(GSequenceIter*) p);
255 	}
256 	
257 	/**
258 	 * Returns the end iterator for seg
259 	 * Since 2.14
260 	 * Returns: the end iterator for seq
261 	 */
262 	public SequenceIter getEndIter()
263 	{
264 		// GSequenceIter * g_sequence_get_end_iter (GSequence *seq);
265 		auto p = g_sequence_get_end_iter(gSequence);
266 		
267 		if(p is null)
268 		{
269 			return null;
270 		}
271 		
272 		return new SequenceIter(cast(GSequenceIter*) p);
273 	}
274 	
275 	/**
276 	 * Returns the iterator at position pos. If pos is negative or larger
277 	 * than the number of items in seq, the end iterator is returned.
278 	 * Since 2.14
279 	 * Params:
280 	 * pos = a position in seq, or -1 for the end.
281 	 * Returns: The GSequenceIter at position pos
282 	 */
283 	public SequenceIter getIterAtPos(int pos)
284 	{
285 		// GSequenceIter * g_sequence_get_iter_at_pos (GSequence *seq,  gint pos);
286 		auto p = g_sequence_get_iter_at_pos(gSequence, pos);
287 		
288 		if(p is null)
289 		{
290 			return null;
291 		}
292 		
293 		return new SequenceIter(cast(GSequenceIter*) p);
294 	}
295 	
296 	/**
297 	 * Adds a new item to the end of seq.
298 	 * Since 2.14
299 	 * Params:
300 	 * data = the data for the new item
301 	 * Returns: an iterator pointing to the new item
302 	 */
303 	public SequenceIter append(void* data)
304 	{
305 		// GSequenceIter * g_sequence_append (GSequence *seq,  gpointer data);
306 		auto p = g_sequence_append(gSequence, data);
307 		
308 		if(p is null)
309 		{
310 			return null;
311 		}
312 		
313 		return new SequenceIter(cast(GSequenceIter*) p);
314 	}
315 	
316 	/**
317 	 * Adds a new item to the front of seq
318 	 * Since 2.14
319 	 * Params:
320 	 * data = the data for the new item
321 	 * Returns: an iterator pointing to the new item
322 	 */
323 	public SequenceIter prepend(void* data)
324 	{
325 		// GSequenceIter * g_sequence_prepend (GSequence *seq,  gpointer data);
326 		auto p = g_sequence_prepend(gSequence, data);
327 		
328 		if(p is null)
329 		{
330 			return null;
331 		}
332 		
333 		return new SequenceIter(cast(GSequenceIter*) p);
334 	}
335 	
336 	/**
337 	 * Inserts a new item just before the item pointed to by iter.
338 	 * Since 2.14
339 	 * Params:
340 	 * iter = a GSequenceIter
341 	 * data = the data for the new item
342 	 * Returns: an iterator pointing to the new item
343 	 */
344 	public static SequenceIter insertBefore(SequenceIter iter, void* data)
345 	{
346 		// GSequenceIter * g_sequence_insert_before (GSequenceIter *iter,  gpointer data);
347 		auto p = g_sequence_insert_before((iter is null) ? null : iter.getSequenceIterStruct(), data);
348 		
349 		if(p is null)
350 		{
351 			return null;
352 		}
353 		
354 		return new SequenceIter(cast(GSequenceIter*) p);
355 	}
356 	
357 	/**
358 	 * Moves the item pointed to by src to the position indicated by dest.
359 	 * After calling this function dest will point to the position immediately
360 	 * after src. It is allowed for src and dest to point into different
361 	 * sequences.
362 	 * Since 2.14
363 	 * Params:
364 	 * src = a GSequenceIter pointing to the item to move
365 	 * dest = a GSequenceIter pointing to the position to which
366 	 * the item is moved.
367 	 */
368 	public static void move(SequenceIter src, SequenceIter dest)
369 	{
370 		// void g_sequence_move (GSequenceIter *src,  GSequenceIter *dest);
371 		g_sequence_move((src is null) ? null : src.getSequenceIterStruct(), (dest is null) ? null : dest.getSequenceIterStruct());
372 	}
373 	
374 	/**
375 	 * Swaps the items pointed to by a and b. It is allowed for a and b
376 	 * to point into difference sequences.
377 	 * Since 2.14
378 	 * Params:
379 	 * a = a GSequenceIter
380 	 * b = a GSequenceIter
381 	 */
382 	public static void swap(SequenceIter a, SequenceIter b)
383 	{
384 		// void g_sequence_swap (GSequenceIter *a,  GSequenceIter *b);
385 		g_sequence_swap((a is null) ? null : a.getSequenceIterStruct(), (b is null) ? null : b.getSequenceIterStruct());
386 	}
387 	
388 	/**
389 	 * Inserts data into sequence using func to determine the new position.
390 	 * The sequence must already be sorted according to cmp_func; otherwise the
391 	 * new position of data is undefined.
392 	 * Since 2.14
393 	 * Params:
394 	 * data = the data to insert
395 	 * cmpFunc = the GCompareDataFunc used to compare items in the sequence. It
396 	 * is called with two items of the seq and user_data. It should
397 	 * return 0 if the items are equal, a negative value if the first
398 	 * item comes before the second, and a positive value if the second
399 	 * item comes before the first.
400 	 * cmpData = user data passed to cmp_func.
401 	 * Returns: a GSequenceIter pointing to the new item.
402 	 */
403 	public SequenceIter insertSorted(void* data, GCompareDataFunc cmpFunc, void* cmpData)
404 	{
405 		// GSequenceIter * g_sequence_insert_sorted (GSequence *seq,  gpointer data,  GCompareDataFunc cmp_func,  gpointer cmp_data);
406 		auto p = g_sequence_insert_sorted(gSequence, data, cmpFunc, cmpData);
407 		
408 		if(p is null)
409 		{
410 			return null;
411 		}
412 		
413 		return new SequenceIter(cast(GSequenceIter*) p);
414 	}
415 	
416 	/**
417 	 * Like g_sequence_insert_sorted(), but uses
418 	 * a GSequenceIterCompareFunc instead of a GCompareDataFunc as
419 	 * the compare function.
420 	 * Since 2.14
421 	 * Params:
422 	 * data = data for the new item
423 	 * iterCmp = the GSequenceItercompare used to compare iterators in the
424 	 * sequence. It is called with two iterators pointing into seq. It should
425 	 * return 0 if the iterators are equal, a negative value if the first
426 	 * iterator comes before the second, and a positive value if the second
427 	 * iterator comes before the first.
428 	 * cmpData = user data passed to cmp_func
429 	 * Returns: a GSequenceIter pointing to the new item
430 	 */
431 	public SequenceIter insertSortedIter(void* data, GSequenceIterCompareFunc iterCmp, void* cmpData)
432 	{
433 		// GSequenceIter * g_sequence_insert_sorted_iter (GSequence *seq,  gpointer data,  GSequenceIterCompareFunc iter_cmp,  gpointer cmp_data);
434 		auto p = g_sequence_insert_sorted_iter(gSequence, data, iterCmp, cmpData);
435 		
436 		if(p is null)
437 		{
438 			return null;
439 		}
440 		
441 		return new SequenceIter(cast(GSequenceIter*) p);
442 	}
443 	
444 	/**
445 	 * Moves the data pointed to a new position as indicated by cmp_func. This
446 	 * function should be called for items in a sequence already sorted according
447 	 * to cmp_func whenever some aspect of an item changes so that cmp_func
448 	 * may return different values for that item.
449 	 * Since 2.14
450 	 * Params:
451 	 * iter = A GSequenceIter
452 	 * cmpFunc = the GCompareDataFunc used to compare items in the sequence. It
453 	 * is called with two items of the seq and user_data. It should
454 	 * return 0 if the items are equal, a negative value if the first
455 	 * item comes before the second, and a positive value if the second
456 	 * item comes before the first.
457 	 * cmpData = user data passed to cmp_func.
458 	 */
459 	public static void sortChanged(SequenceIter iter, GCompareDataFunc cmpFunc, void* cmpData)
460 	{
461 		// void g_sequence_sort_changed (GSequenceIter *iter,  GCompareDataFunc cmp_func,  gpointer cmp_data);
462 		g_sequence_sort_changed((iter is null) ? null : iter.getSequenceIterStruct(), cmpFunc, cmpData);
463 	}
464 	
465 	/**
466 	 * Like g_sequence_sort_changed(), but uses
467 	 * a GSequenceIterCompareFunc instead of a GCompareDataFunc as
468 	 * the compare function.
469 	 * Since 2.14
470 	 * Params:
471 	 * iter = a GSequenceIter
472 	 * iterCmp = the GSequenceItercompare used to compare iterators in the
473 	 * sequence. It is called with two iterators pointing into seq. It should
474 	 * return 0 if the iterators are equal, a negative value if the first
475 	 * iterator comes before the second, and a positive value if the second
476 	 * iterator comes before the first.
477 	 * cmpData = user data passed to cmp_func
478 	 */
479 	public static void sortChangedIter(SequenceIter iter, GSequenceIterCompareFunc iterCmp, void* cmpData)
480 	{
481 		// void g_sequence_sort_changed_iter (GSequenceIter *iter,  GSequenceIterCompareFunc iter_cmp,  gpointer cmp_data);
482 		g_sequence_sort_changed_iter((iter is null) ? null : iter.getSequenceIterStruct(), iterCmp, cmpData);
483 	}
484 	
485 	/**
486 	 * Removes the item pointed to by iter. It is an error to pass the
487 	 * end iterator to this function.
488 	 * If the sequnce has a data destroy function associated with it, this
489 	 * function is called on the data for the removed item.
490 	 * Since 2.14
491 	 * Params:
492 	 * iter = a GSequenceIter
493 	 */
494 	public static void remove(SequenceIter iter)
495 	{
496 		// void g_sequence_remove (GSequenceIter *iter);
497 		g_sequence_remove((iter is null) ? null : iter.getSequenceIterStruct());
498 	}
499 	
500 	/**
501 	 * Removes all items in the (begin, end) range.
502 	 * If the sequence has a data destroy function associated with it, this
503 	 * function is called on the data for the removed items.
504 	 * Since 2.14
505 	 * Params:
506 	 * begin = a GSequenceIter
507 	 * end = a GSequenceIter
508 	 */
509 	public static void removeRange(SequenceIter begin, SequenceIter end)
510 	{
511 		// void g_sequence_remove_range (GSequenceIter *begin,  GSequenceIter *end);
512 		g_sequence_remove_range((begin is null) ? null : begin.getSequenceIterStruct(), (end is null) ? null : end.getSequenceIterStruct());
513 	}
514 	
515 	/**
516 	 * Inserts the (begin, end) range at the destination pointed to by ptr.
517 	 * The begin and end iters must point into the same sequence. It is
518 	 * allowed for dest to point to a different sequence than the one pointed
519 	 * into by begin and end.
520 	 * If dest is NULL, the range indicated by begin and end is
521 	 * removed from the sequence. If dest iter points to a place within
522 	 * the (begin, end) range, the range does not move.
523 	 * Since 2.14
524 	 * Params:
525 	 * dest = a GSequenceIter
526 	 * begin = a GSequenceIter
527 	 * end = a GSequenceIter
528 	 */
529 	public static void moveRange(SequenceIter dest, SequenceIter begin, SequenceIter end)
530 	{
531 		// void g_sequence_move_range (GSequenceIter *dest,  GSequenceIter *begin,  GSequenceIter *end);
532 		g_sequence_move_range((dest is null) ? null : dest.getSequenceIterStruct(), (begin is null) ? null : begin.getSequenceIterStruct(), (end is null) ? null : end.getSequenceIterStruct());
533 	}
534 	
535 	/**
536 	 * Returns an iterator pointing to the position where data would
537 	 * be inserted according to cmp_func and cmp_data.
538 	 * If you are simply searching for an existing element of the sequence,
539 	 * consider using g_sequence_lookup().
540 	 * Since 2.14
541 	 * Params:
542 	 * data = data for the new item
543 	 * cmpFunc = the GCompareDataFunc used to compare items in the sequence. It
544 	 * is called with two items of the seq and user_data. It should
545 	 * return 0 if the items are equal, a negative value if the first
546 	 * item comes before the second, and a positive value if the second
547 	 * item comes before the first.
548 	 * cmpData = user data passed to cmp_func.
549 	 * Returns: an GSequenceIter pointing to the position where data would have been inserted according to cmp_func and cmp_data.
550 	 */
551 	public SequenceIter search(void* data, GCompareDataFunc cmpFunc, void* cmpData)
552 	{
553 		// GSequenceIter * g_sequence_search (GSequence *seq,  gpointer data,  GCompareDataFunc cmp_func,  gpointer cmp_data);
554 		auto p = g_sequence_search(gSequence, data, cmpFunc, cmpData);
555 		
556 		if(p is null)
557 		{
558 			return null;
559 		}
560 		
561 		return new SequenceIter(cast(GSequenceIter*) p);
562 	}
563 	
564 	/**
565 	 * Like g_sequence_search(), but uses
566 	 * a GSequenceIterCompareFunc instead of a GCompareDataFunc as
567 	 * the compare function.
568 	 * If you are simply searching for an existing element of the sequence,
569 	 * consider using g_sequence_lookup_iter().
570 	 * Since 2.14
571 	 * Params:
572 	 * data = data for the new item
573 	 * iterCmp = the GSequenceIterCompare function used to compare iterators
574 	 * in the sequence. It is called with two iterators pointing into seq.
575 	 * It should return 0 if the iterators are equal, a negative value if the
576 	 * first iterator comes before the second, and a positive value if the
577 	 * second iterator comes before the first.
578 	 * cmpData = user data passed to iter_cmp
579 	 * Returns: a GSequenceIter pointing to the position in seq where data would have been inserted according to iter_cmp and cmp_data.
580 	 */
581 	public SequenceIter searchIter(void* data, GSequenceIterCompareFunc iterCmp, void* cmpData)
582 	{
583 		// GSequenceIter * g_sequence_search_iter (GSequence *seq,  gpointer data,  GSequenceIterCompareFunc iter_cmp,  gpointer cmp_data);
584 		auto p = g_sequence_search_iter(gSequence, data, iterCmp, cmpData);
585 		
586 		if(p is null)
587 		{
588 			return null;
589 		}
590 		
591 		return new SequenceIter(cast(GSequenceIter*) p);
592 	}
593 	
594 	/**
595 	 * Returns an iterator pointing to the position of the first item found
596 	 * equal to data according to cmp_func and cmp_data. If more than one item
597 	 * is equal, it is not guaranteed that it is the first which is returned.
598 	 * In that case, you can use g_sequence_iter_next() and g_sequence_iter_prev()
599 	 * to get others.
600 	 * Since 2.28
601 	 * Params:
602 	 * data = data to lookup
603 	 * cmpFunc = the GCompareDataFunc used to compare items in the sequence. It
604 	 * is called with two items of the seq and user_data. It should
605 	 * return 0 if the items are equal, a negative value if the first
606 	 * item comes before the second, and a positive value if the second
607 	 * item comes before the first.
608 	 * cmpData = user data passed to cmp_func.
609 	 * Returns: an GSequenceIter pointing to the position of the first item found equal to data according to cmp_func and cmp_data.
610 	 */
611 	public SequenceIter lookup(void* data, GCompareDataFunc cmpFunc, void* cmpData)
612 	{
613 		// GSequenceIter * g_sequence_lookup (GSequence *seq,  gpointer data,  GCompareDataFunc cmp_func,  gpointer cmp_data);
614 		auto p = g_sequence_lookup(gSequence, data, cmpFunc, cmpData);
615 		
616 		if(p is null)
617 		{
618 			return null;
619 		}
620 		
621 		return new SequenceIter(cast(GSequenceIter*) p);
622 	}
623 	
624 	/**
625 	 * Like g_sequence_lookup(), but uses
626 	 * a GSequenceIterCompareFunc instead of a GCompareDataFunc as
627 	 * the compare function.
628 	 * Since 2.28
629 	 * Params:
630 	 * data = data to lookup
631 	 * iterCmp = the GSequenceIterCompare function used to compare iterators
632 	 * in the sequence. It is called with two iterators pointing into seq.
633 	 * It should return 0 if the iterators are equal, a negative value if the
634 	 * first iterator comes before the second, and a positive value if the
635 	 * second iterator comes before the first.
636 	 * cmpData = user data passed to iter_cmp
637 	 * Returns: an GSequenceIter pointing to the position of the first item found equal to data according to cmp_func and cmp_data.
638 	 */
639 	public SequenceIter lookupIter(void* data, GSequenceIterCompareFunc iterCmp, void* cmpData)
640 	{
641 		// GSequenceIter * g_sequence_lookup_iter (GSequence *seq,  gpointer data,  GSequenceIterCompareFunc iter_cmp,  gpointer cmp_data);
642 		auto p = g_sequence_lookup_iter(gSequence, data, iterCmp, cmpData);
643 		
644 		if(p is null)
645 		{
646 			return null;
647 		}
648 		
649 		return new SequenceIter(cast(GSequenceIter*) p);
650 	}
651 	
652 	/**
653 	 * Returns the data that iter points to.
654 	 * Since 2.14
655 	 * Params:
656 	 * iter = a GSequenceIter
657 	 * Returns: the data that iter points to
658 	 */
659 	public static void* get(SequenceIter iter)
660 	{
661 		// gpointer g_sequence_get (GSequenceIter *iter);
662 		return g_sequence_get((iter is null) ? null : iter.getSequenceIterStruct());
663 	}
664 	
665 	/**
666 	 * Changes the data for the item pointed to by iter to be data. If
667 	 * the sequence has a data destroy function associated with it, that
668 	 * function is called on the existing data that iter pointed to.
669 	 * Since 2.14
670 	 * Params:
671 	 * iter = a GSequenceIter
672 	 * data = new data for the item
673 	 */
674 	public static void set(SequenceIter iter, void* data)
675 	{
676 		// void g_sequence_set (GSequenceIter *iter,  gpointer data);
677 		g_sequence_set((iter is null) ? null : iter.getSequenceIterStruct(), data);
678 	}
679 	
680 	/**
681 	 * Finds an iterator somewhere in the range (begin, end). This
682 	 * iterator will be close to the middle of the range, but is not
683 	 * guaranteed to be exactly in the middle.
684 	 * The begin and end iterators must both point to the same sequence and
685 	 * begin must come before or be equal to end in the sequence.
686 	 * Since 2.14
687 	 * Params:
688 	 * begin = a GSequenceIter
689 	 * end = a GSequenceIter
690 	 * Returns: A GSequenceIter pointing somewhere in the (begin, end) range.
691 	 */
692 	public static SequenceIter rangeGetMidpoint(SequenceIter begin, SequenceIter end)
693 	{
694 		// GSequenceIter * g_sequence_range_get_midpoint (GSequenceIter *begin,  GSequenceIter *end);
695 		auto p = g_sequence_range_get_midpoint((begin is null) ? null : begin.getSequenceIterStruct(), (end is null) ? null : end.getSequenceIterStruct());
696 		
697 		if(p is null)
698 		{
699 			return null;
700 		}
701 		
702 		return new SequenceIter(cast(GSequenceIter*) p);
703 	}
704 }