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 = gtksourceview-2.0-Searching-in-a-GtkSourceBuffer.html 27 * outPack = gsv 28 * outFile = SourceSearch 29 * strct = 30 * realStrct= 31 * ctorStrct= 32 * clss = SourceSearch 33 * interf = 34 * class Code: No 35 * interface Code: No 36 * template for: 37 * extend = 38 * implements: 39 * prefixes: 40 * - gtk_source_iter_ 41 * omit structs: 42 * omit prefixes: 43 * omit code: 44 * omit signals: 45 * imports: 46 * - gtk.TextIter 47 * - glib.Str 48 * structWrap: 49 * - GtkTextIter* -> TextIter 50 * module aliases: 51 * local aliases: 52 * overrides: 53 */ 54 55 module gsv.SourceSearch; 56 57 public import gsvc.gsvtypes; 58 59 private import gsvc.gsv; 60 private import glib.ConstructionException; 61 private import gobject.ObjectG; 62 63 64 private import gtk.TextIter; 65 private import glib.Str; 66 67 68 69 70 /** 71 * Description 72 */ 73 public class SourceSearch 74 { 75 76 /** 77 */ 78 79 /** 80 * Same as gtk_text_iter_backward_search(), but supports case insensitive 81 * searching. 82 * Params: 83 * iter = a GtkTextIter where the search begins. 84 * str = search string. 85 * flags = bitmask of flags affecting the search. 86 * matchStart = return location for start of match, or NULL. 87 * matchEnd = return location for end of match, or NULL. 88 * limit = location of last possible match_start, or NULL for start of buffer. 89 * Returns: whether a match was found. 90 */ 91 public static int backwardSearch(TextIter iter, string str, GtkSourceSearchFlags flags, TextIter matchStart, TextIter matchEnd, TextIter limit) 92 { 93 // gboolean gtk_source_iter_backward_search (const GtkTextIter *iter, const gchar *str, GtkSourceSearchFlags flags, GtkTextIter *match_start, GtkTextIter *match_end, const GtkTextIter *limit); 94 return gtk_source_iter_backward_search((iter is null) ? null : iter.getTextIterStruct(), Str.toStringz(str), flags, (matchStart is null) ? null : matchStart.getTextIterStruct(), (matchEnd is null) ? null : matchEnd.getTextIterStruct(), (limit is null) ? null : limit.getTextIterStruct()); 95 } 96 97 /** 98 * Searches forward for str. Any match is returned by setting 99 * match_start to the first character of the match and match_end to the 100 * first character after the match. The search will not continue past 101 * limit. Note that a search is a linear or O(n) operation, so you 102 * may wish to use limit to avoid locking up your UI on large 103 * buffers. 104 * If the GTK_SOURCE_SEARCH_VISIBLE_ONLY flag is present, the match may 105 * have invisible text interspersed in str. i.e. str will be a 106 * possibly-noncontiguous subsequence of the matched range. similarly, 107 * if you specify GTK_SOURCE_SEARCH_TEXT_ONLY, the match may have 108 * pixbufs or child widgets mixed inside the matched range. If these 109 * flags are not given, the match must be exact; the special 0xFFFC 110 * character in str will match embedded pixbufs or child widgets. 111 * If you specify the GTK_SOURCE_SEARCH_CASE_INSENSITIVE flag, the text will 112 * be matched regardless of what case it is in. 113 * Same as gtk_text_iter_forward_search(), but supports case insensitive 114 * searching. 115 * Params: 116 * iter = start of search. 117 * str = a search string. 118 * flags = flags affecting how the search is done. 119 * matchStart = return location for start of match, or NULL. 120 * matchEnd = return location for end of match, or NULL. 121 * limit = bound for the search, or NULL for the end of the buffer. 122 * Returns: whether a match was found. 123 */ 124 public static int forwardSearch(TextIter iter, string str, GtkSourceSearchFlags flags, TextIter matchStart, TextIter matchEnd, TextIter limit) 125 { 126 // gboolean gtk_source_iter_forward_search (const GtkTextIter *iter, const gchar *str, GtkSourceSearchFlags flags, GtkTextIter *match_start, GtkTextIter *match_end, const GtkTextIter *limit); 127 return gtk_source_iter_forward_search((iter is null) ? null : iter.getTextIterStruct(), Str.toStringz(str), flags, (matchStart is null) ? null : matchStart.getTextIterStruct(), (matchEnd is null) ? null : matchEnd.getTextIterStruct(), (limit is null) ? null : limit.getTextIterStruct()); 128 } 129 }