alternative to assert
[gtkD.git] / gtkD / srcsv / gsv / SourceTag.d
blobccad8266f10dabf2517a8d4a81033c70d303b2c7
1 /*
2 * This file is part of gtkD.
4 * gtkD 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 * gtkD 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 gtkD; 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 = GtkSourceTag.html
26 * outPack = gsv
27 * outFile = SourceTag
28 * strct = GtkSourceTag
29 * realStrct=
30 * ctorStrct=
31 * clss = SourceTag
32 * interf =
33 * class Code: No
34 * interface Code: No
35 * template for:
36 * extend =
37 * implements:
38 * prefixes:
39 * - gtk_source_tag_
40 * omit structs:
41 * omit prefixes:
42 * omit code:
43 * imports:
44 * - gsv.SourceTagStyle
45 * - glib.Str
46 * structWrap:
47 * - GtkSourceTagStyle* -> SourceTagStyle
48 * module aliases:
49 * local aliases:
52 module gsv.SourceTag;
54 version(noAssert)
56 version(Tango)
58 import tango.io.Stdout; // use the tango loging?
62 private import gsvc.gsvtypes;
64 private import gsvc.gsv;
67 private import gsv.SourceTagStyle;
68 private import glib.Str;
73 /**
74 * Description
76 private import gtk.TextTag;
77 public class SourceTag : TextTag
80 /** the main Gtk struct */
81 protected GtkSourceTag* gtkSourceTag;
84 public GtkSourceTag* getSourceTagStruct()
86 return gtkSourceTag;
90 /** the main Gtk struct as a void* */
91 protected void* getStruct()
93 return cast(void*)gtkSourceTag;
96 /**
97 * Sets our main struct and passes it to the parent class
99 public this (GtkSourceTag* gtkSourceTag)
101 version(noAssert)
103 if ( gtkSourceTag is null )
105 int zero = 0;
106 version(Tango)
108 Stdout("struct gtkSourceTag is null on constructor").newline;
110 else
112 printf("struct gtkSourceTag is null on constructor");
114 zero = zero / zero;
117 else
119 assert(gtkSourceTag !is null, "struct gtkSourceTag is null on constructor");
121 super(cast(GtkTextTag*)gtkSourceTag);
122 this.gtkSourceTag = gtkSourceTag;
135 * Gets the style associated with the given tag.
136 * tag:
137 * a GtkSourceTag.
138 * Returns:
139 * a GtkSourceTagStyle if found, or NULL if not found.
141 public SourceTagStyle getStyle()
143 // GtkSourceTagStyle* gtk_source_tag_get_style (GtkSourceTag *tag);
144 return new SourceTagStyle( gtk_source_tag_get_style(gtkSourceTag) );
148 * Associates a given style with the given tag.
149 * tag:
150 * a GtkSourceTag.
151 * style:
152 * a GtkSourceTagStyle.
154 public void setStyle(SourceTagStyle style)
156 // void gtk_source_tag_set_style (GtkSourceTag *tag, const GtkSourceTagStyle *style);
157 gtk_source_tag_set_style(gtkSourceTag, (style is null) ? null : style.getSourceTagStyleStruct());
161 * Creates a new syntax tag object with the provided arguments.
162 * id:
163 * the ID for the tag.
164 * name:
165 * the name of the tag.
166 * pattern_start:
167 * the starting pattern.
168 * pattern_end:
169 * the ending pattern.
170 * Returns:
171 * a new syntax tag, as a GtkTextTag.
173 public static GtkTextTag* gtkSyntaxTagNew(char[] id, char[] name, char[] patternStart, char[] patternEnd)
175 // GtkTextTag* gtk_syntax_tag_new (const gchar *id, const gchar *name, const gchar *pattern_start, const gchar *pattern_end);
176 return gtk_syntax_tag_new(Str.toStringz(id), Str.toStringz(name), Str.toStringz(patternStart), Str.toStringz(patternEnd));
180 * Creates a new pattern tag object with the provided arguments.
181 * id:
182 * the ID for the tag.
183 * name:
184 * the name of the tag.
185 * pattern:
186 * the pattern.
187 * Returns:
188 * a new pattern tag, as a GtkTextTag.
190 public static GtkTextTag* gtkPatternTagNew(char[] id, char[] name, char[] pattern)
192 // GtkTextTag* gtk_pattern_tag_new (const gchar *id, const gchar *name, const gchar *pattern);
193 return gtk_pattern_tag_new(Str.toStringz(id), Str.toStringz(name), Str.toStringz(pattern));
197 * Creates a new keyword list tag object with the provided arguments.
198 * id:
199 * the ID for the tag.
200 * name:
201 * the name of the tag.
202 * keywords:
203 * a list of keywords.
204 * case_sensitive:
205 * whether the tag should be case sensitive.
206 * match_empty_string_at_beginning:
207 * whether the tag should match empty
208 * string at the beginning.
209 * match_empty_string_at_end:
210 * whether the tag should match empty
211 * string at the end.
212 * beginning_regex:
213 * the beginning regular expression.
214 * end_regex:
215 * the ending regular expression.
216 * Returns:
217 * a new keyword list tag, as a GtkTextTag.
219 public static GtkTextTag* gtkKeywordListTagNew(char[] id, char[] name, GSList* keywords, int caseSensitive, int matchEmptyStringAtBeginning, int matchEmptyStringAtEnd, char[] beginningRegex, char[] endRegex)
221 // GtkTextTag* gtk_keyword_list_tag_new (const gchar *id, const gchar *name, const GSList *keywords, gboolean case_sensitive, gboolean match_empty_string_at_beginning, gboolean match_empty_string_at_end, const gchar *beginning_regex, const gchar *end_regex);
222 return gtk_keyword_list_tag_new(Str.toStringz(id), Str.toStringz(name), keywords, caseSensitive, matchEmptyStringAtBeginning, matchEmptyStringAtEnd, Str.toStringz(beginningRegex), Str.toStringz(endRegex));
227 * Creates a new line comment tag object with the provided arguments.
228 * id:
229 * the ID for the tag.
230 * name:
231 * the name of the tag.
232 * pattern_start:
233 * the starting pattern.
234 * Returns:
235 * a new line comment tag, as a GtkTextTag.
237 public static GtkTextTag* gtkLineCommentTagNew(char[] id, char[] name, char[] patternStart)
239 // GtkTextTag* gtk_line_comment_tag_new (const gchar *id, const gchar *name, const gchar *pattern_start);
240 return gtk_line_comment_tag_new(Str.toStringz(id), Str.toStringz(name), Str.toStringz(patternStart));
244 * Creates a new string tag object with the provided arguments.
245 * id:
246 * the ID for the tag.
247 * name:
248 * the name of the tag.
249 * pattern_start:
250 * the starting pattern.
251 * pattern_end:
252 * the ending pattern.
253 * end_at_line_end:
254 * whether the ending pattern should be suffixed by an end-of-line character.
255 * Returns:
256 * a new string tag, as a GtkTextTag.
257 * Property Details
258 * The "id" property
259 * "id" gchararray : Read / Write / Construct Only
260 * ID used to refer to the source tag.
261 * Default value: NULL
263 public static GtkTextTag* gtkStringTagNew(char[] id, char[] name, char[] patternStart, char[] patternEnd, int endAtLineEnd)
265 // GtkTextTag* gtk_string_tag_new (const gchar *id, const gchar *name, const gchar *pattern_start, const gchar *pattern_end, gboolean end_at_line_end);
266 return gtk_string_tag_new(Str.toStringz(id), Str.toStringz(name), Str.toStringz(patternStart), Str.toStringz(patternEnd), endAtLineEnd);