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 = GtkSourceLanguage.html
27 * outFile = SourceLanguage
28 * strct = GtkSourceLanguage
31 * clss = SourceLanguage
44 * - gsv.SourceStyleScheme
47 * - GtkSourceStyleScheme* -> SourceStyleScheme
52 module gsv
.SourceLanguage
;
58 import tango
.io
.Stdout
; // use the tango loging?
62 private import gsvc
.gsvtypes
;
64 private import gsvc
.gsv
;
67 private import gsv
.SourceStyleScheme
;
68 private import glib
.Str
;
76 private import gobject
.ObjectG
;
77 public class SourceLanguage
: ObjectG
80 /** the main Gtk struct */
81 protected GtkSourceLanguage
* gtkSourceLanguage
;
84 public GtkSourceLanguage
* getSourceLanguageStruct()
86 return gtkSourceLanguage
;
90 /** the main Gtk struct as a void* */
91 protected void* getStruct()
93 return cast(void*)gtkSourceLanguage
;
97 * Sets our main struct and passes it to the parent class
99 public this (GtkSourceLanguage
* gtkSourceLanguage
)
103 if ( gtkSourceLanguage
is null )
108 Stdout("struct gtkSourceLanguage is null on constructor").newline
;
112 printf("struct gtkSourceLanguage is null on constructor");
119 assert(gtkSourceLanguage
!is null, "struct gtkSourceLanguage is null on constructor");
121 super(cast(GObject
*)gtkSourceLanguage
);
122 this.gtkSourceLanguage
= gtkSourceLanguage
;
128 // imports for the signal processing
129 private import gobject
.Signals
;
130 private import gtkc
.gdktypes
;
131 int[char[]] connectedSignals
;
133 void delegate(char[], SourceLanguage
)[] onTagStyleChangedListeners
;
134 void addOnTagStyleChanged(void delegate(char[], SourceLanguage
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
136 if ( !("tag-style-changed" in connectedSignals
) )
141 cast(GCallback
)&callBackTagStyleChanged
,
145 connectedSignals
["tag-style-changed"] = 1;
147 onTagStyleChangedListeners
~= dlg
;
149 extern(C
) static void callBackTagStyleChanged(GtkSourceLanguage
* sourcelanguageStruct
, gchar
* arg1
, SourceLanguage sourceLanguage
)
151 bool consumed
= false;
153 foreach ( void delegate(char[], SourceLanguage
) dlg
; sourceLanguage
.onTagStyleChangedListeners
)
155 dlg(Str
.toString(arg1
), sourceLanguage
);
164 * Returns the localized name of the language.
166 * a GtkSourceLanguage.
168 * the name of language.
170 public char[] gtkSourceLanguageGetName()
172 // gchar* gtk_source_language_get_name (GtkSourceLanguage *language);
173 return Str
.toString(gtk_source_language_get_name(gtkSourceLanguage
) );
177 * Returns the localized section of the language.
178 * Each language belong to a section (ex. HTML belogs to the
181 * a GtkSourceLanguage.
183 * the section of language.
185 public char[] gtkSourceLanguageGetSection()
187 // gchar* gtk_source_language_get_section (GtkSourceLanguage *language);
188 return Str
.toString(gtk_source_language_get_section(gtkSourceLanguage
) );
192 * Returns a list of tags for the given language. You should unref the tags
193 * and free the list after usage.
195 * a GtkSourceLanguage.
197 * a list of GtkSourceTag objects.
199 public GSList
* gtkSourceLanguageGetTags()
201 // GSList* gtk_source_language_get_tags (GtkSourceLanguage *language);
202 return gtk_source_language_get_tags(gtkSourceLanguage
);
206 * Gets the value of the ESC character in the given language.
208 * a GtkSourceLanguage.
210 * the value of the ESC character.
212 public gunichar
gtkSourceLanguageGetEscapeChar()
214 // gunichar gtk_source_language_get_escape_char (GtkSourceLanguage *language);
215 return gtk_source_language_get_escape_char(gtkSourceLanguage
);
219 * Returns a list of mime types for the given language. After usage you should
220 * free each element of the list as well as the list itself.
222 * a GtkSourceLanguage.
224 * a list of mime types (strings).
226 public GSList
* gtkSourceLanguageGetMimeTypes()
228 // GSList* gtk_source_language_get_mime_types (GtkSourceLanguage *language);
229 return gtk_source_language_get_mime_types(gtkSourceLanguage
);
233 * Sets a list of mime_types for the given language.
234 * If mime_types is NULL this function will use the default mime
235 * types from the language file.
237 * a GtkSourceLanguage
239 * a list of mime types (strings).
241 public void gtkSourceLanguageSetMimeTypes(GSList
* mimeTypes
)
243 // void gtk_source_language_set_mime_types (GtkSourceLanguage *language, const GSList *mime_types);
244 gtk_source_language_set_mime_types(gtkSourceLanguage
, mimeTypes
);
248 * Gets the style scheme associated with the given language.
250 * a GtkSourceLanguage.
252 * a GtkSourceStyleScheme.
254 public SourceStyleScheme
gtkSourceLanguageGetStyleScheme()
256 // GtkSourceStyleScheme* gtk_source_language_get_style_scheme (GtkSourceLanguage *language);
257 return new SourceStyleScheme( gtk_source_language_get_style_scheme(gtkSourceLanguage
) );
261 * Sets the style scheme of the given language.
263 * a GtkSourceLanguage.
265 * a GtkSourceStyleScheme.
267 public void gtkSourceLanguageSetStyleScheme(SourceStyleScheme scheme
)
269 // void gtk_source_language_set_style_scheme (GtkSourceLanguage *language, GtkSourceStyleScheme *scheme);
270 gtk_source_language_set_style_scheme(gtkSourceLanguage
, (scheme
is null) ?
null : scheme
.getSourceStyleSchemeStruct());
274 * Gets the style of the tag whose ID is tag_id. If the style is
275 * not defined then returns the default style.
277 * a GtkSourceLanguage.
279 * the ID of a GtkSourceTag.
281 * a GtkSourceTagStyle.
283 public GtkSourceTagStyle
* gtkSourceLanguageGetTagStyle(char[] tagId
)
285 // GtkSourceTagStyle* gtk_source_language_get_tag_style (GtkSourceLanguage *language, const gchar *tag_id);
286 return gtk_source_language_get_tag_style(gtkSourceLanguage
, Str
.toStringz(tagId
));
290 * Sets the style of the tag whose ID is tag_id. If style is NULL
291 * restore the default style.
293 * a GtkSourceLanguage.
295 * the ID of a GtkSourceTag.
297 * a GtkSourceTagStyle.
299 public void gtkSourceLanguageSetTagStyle(char[] tagId
, GtkSourceTagStyle
* style
)
301 // void gtk_source_language_set_tag_style (GtkSourceLanguage *language, const gchar *tag_id, const GtkSourceTagStyle *style);
302 gtk_source_language_set_tag_style(gtkSourceLanguage
, Str
.toStringz(tagId
), style
);
306 * Gets the default style of the tag whose ID is tag_id.
308 * a GtkSourceLanguage.
310 * the ID of a GtkSourceTag.
312 * a GtkSourceTagStyle.
314 * The "tag-style-changed" signal
315 * void user_function (GtkSourceLanguage *sourcelanguage,
317 * gpointer user_data) : Run last
319 * the object which received the signal.
322 * user data set when the signal handler was connected.
324 public GtkSourceTagStyle
* gtkSourceLanguageGetTagDefaultStyle(char[] tagId
)
326 // GtkSourceTagStyle* gtk_source_language_get_tag_default_style (GtkSourceLanguage *language, const gchar *tag_id);
327 return gtk_source_language_get_tag_default_style(gtkSourceLanguage
, Str
.toStringz(tagId
));