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 module gsv.RegionIter; 26 27 private import gobject.ObjectG; 28 private import gsvc.gsv; 29 public import gsvc.gsvtypes; 30 private import gtk.TextIter; 31 32 33 /** 34 * #GtkSourceRegionIter is an opaque datatype; ignore all its fields. 35 * Initialize the iter with gtk_source_region_get_start_region_iter(). 36 * 37 * Since: 3.22 38 */ 39 public class RegionIter 40 { 41 /** the main Gtk struct */ 42 protected GtkSourceRegionIter* gtkSourceRegionIter; 43 protected bool ownedRef; 44 45 /** Get the main Gtk struct */ 46 public GtkSourceRegionIter* getRegionIterStruct() 47 { 48 return gtkSourceRegionIter; 49 } 50 51 /** the main Gtk struct as a void* */ 52 protected void* getStruct() 53 { 54 return cast(void*)gtkSourceRegionIter; 55 } 56 57 /** 58 * Sets our main struct and passes it to the parent class. 59 */ 60 public this (GtkSourceRegionIter* gtkSourceRegionIter, bool ownedRef = false) 61 { 62 this.gtkSourceRegionIter = gtkSourceRegionIter; 63 this.ownedRef = ownedRef; 64 } 65 66 67 /** 68 * Gets the subregion at this iterator. 69 * 70 * Params: 71 * start = iterator to initialize with the subregion start, or %NULL. 72 * end = iterator to initialize with the subregion end, or %NULL. 73 * 74 * Returns: %TRUE if @start and @end have been set successfully (if non-%NULL), 75 * or %FALSE if @iter is the end iterator or if the region is empty. 76 * 77 * Since: 3.22 78 */ 79 public bool getSubregion(out TextIter start, out TextIter end) 80 { 81 GtkTextIter* outstart = gMalloc!GtkTextIter(); 82 GtkTextIter* outend = gMalloc!GtkTextIter(); 83 84 auto p = gtk_source_region_iter_get_subregion(gtkSourceRegionIter, outstart, outend) != 0; 85 86 start = ObjectG.getDObject!(TextIter)(outstart, true); 87 end = ObjectG.getDObject!(TextIter)(outend, true); 88 89 return p; 90 } 91 92 /** 93 * Returns: whether @iter is the end iterator. 94 * 95 * Since: 3.22 96 */ 97 public bool isEnd() 98 { 99 return gtk_source_region_iter_is_end(gtkSourceRegionIter) != 0; 100 } 101 102 /** 103 * Moves @iter to the next subregion. 104 * 105 * Returns: %TRUE if @iter moved and is dereferenceable, or %FALSE if @iter has 106 * been set to the end iterator. 107 * 108 * Since: 3.22 109 */ 110 public bool next() 111 { 112 return gtk_source_region_iter_next(gtkSourceRegionIter) != 0; 113 } 114 }