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  = GtkSourceStyleScheme.html
27  * outPack = gsv
28  * outFile = SourceStyleScheme
29  * strct   = GtkSourceStyleScheme
30  * realStrct=
31  * ctorStrct=
32  * clss    = SourceStyleScheme
33  * interf  = 
34  * class Code: No
35  * interface Code: No
36  * template for:
37  * extend  = 
38  * implements:
39  * prefixes:
40  * 	- gtk_source_style_scheme_
41  * omit structs:
42  * omit prefixes:
43  * omit code:
44  * omit signals:
45  * imports:
46  * 	- glib.Str
47  * 	- gsv.SourceStyle
48  * structWrap:
49  * 	- GtkSourceStyle* -> SourceStyle
50  * module aliases:
51  * local aliases:
52  * overrides:
53  */
54 
55 module gsv.SourceStyleScheme;
56 
57 public  import gsvc.gsvtypes;
58 
59 private import gsvc.gsv;
60 private import glib.ConstructionException;
61 private import gobject.ObjectG;
62 
63 private import glib.Str;
64 private import gsv.SourceStyle;
65 
66 
67 private import gobject.ObjectG;
68 
69 /**
70  * GtkSourceStyleScheme contains all the text styles to be used in
71  * GtkSourceView and GtkSourceBuffer. For instance, it contains text styles
72  * for syntax highlighting, it may contain foreground and background color for
73  * non-highlighted text, color for the line numbers, etc.
74  *
75  * Style schemes are stored in XML files. The format of a scheme file is
76  * documented in the
77  * style scheme reference.
78  */
79 public class SourceStyleScheme : ObjectG
80 {
81 	
82 	/** the main Gtk struct */
83 	protected GtkSourceStyleScheme* gtkSourceStyleScheme;
84 	
85 	
86 	/** Get the main Gtk struct */
87 	public GtkSourceStyleScheme* getSourceStyleSchemeStruct()
88 	{
89 		return gtkSourceStyleScheme;
90 	}
91 	
92 	
93 	/** the main Gtk struct as a void* */
94 	protected override void* getStruct()
95 	{
96 		return cast(void*)gtkSourceStyleScheme;
97 	}
98 	
99 	/**
100 	 * Sets our main struct and passes it to the parent class
101 	 */
102 	public this (GtkSourceStyleScheme* gtkSourceStyleScheme)
103 	{
104 		super(cast(GObject*)gtkSourceStyleScheme);
105 		this.gtkSourceStyleScheme = gtkSourceStyleScheme;
106 	}
107 	
108 	protected override void setStruct(GObject* obj)
109 	{
110 		super.setStruct(obj);
111 		gtkSourceStyleScheme = cast(GtkSourceStyleScheme*)obj;
112 	}
113 	
114 	/**
115 	 */
116 	
117 	/**
118 	 * Since 2.0
119 	 * Returns: scheme id.
120 	 */
121 	public string getId()
122 	{
123 		// const gchar * gtk_source_style_scheme_get_id (GtkSourceStyleScheme *scheme);
124 		return Str.toString(gtk_source_style_scheme_get_id(gtkSourceStyleScheme));
125 	}
126 	
127 	/**
128 	 * Since 2.0
129 	 * Returns: scheme name.
130 	 */
131 	public string getName()
132 	{
133 		// const gchar * gtk_source_style_scheme_get_name (GtkSourceStyleScheme *scheme);
134 		return Str.toString(gtk_source_style_scheme_get_name(gtkSourceStyleScheme));
135 	}
136 	
137 	/**
138 	 * Since 2.0
139 	 * Returns: scheme description (if defined), or NULL.
140 	 */
141 	public string getDescription()
142 	{
143 		// const gchar * gtk_source_style_scheme_get_description  (GtkSourceStyleScheme *scheme);
144 		return Str.toString(gtk_source_style_scheme_get_description(gtkSourceStyleScheme));
145 	}
146 	
147 	/**
148 	 * Since 2.0
149 	 * Returns: a NULL-terminated array containing the scheme authors or NULL if no author is specified by the style scheme. [array zero-terminated=1][transfer none]
150 	 */
151 	public string[] getAuthors()
152 	{
153 		// const gchar * const * gtk_source_style_scheme_get_authors  (GtkSourceStyleScheme *scheme);
154 		return Str.toStringArray(gtk_source_style_scheme_get_authors(gtkSourceStyleScheme));
155 	}
156 	
157 	/**
158 	 * Since 2.0
159 	 * Returns: scheme file name if the scheme was created parsing a style scheme file or NULL in the other cases.
160 	 */
161 	public string getFilename()
162 	{
163 		// const gchar * gtk_source_style_scheme_get_filename  (GtkSourceStyleScheme *scheme);
164 		return Str.toString(gtk_source_style_scheme_get_filename(gtkSourceStyleScheme));
165 	}
166 	
167 	/**
168 	 * Since 2.0
169 	 * Params:
170 	 * styleId = id of the style to retrieve.
171 	 * Returns: style which corresponds to style_id in the scheme, or NULL when no style with this name found. It is owned by scheme and may not be unref'ed. [transfer none]
172 	 */
173 	public SourceStyle getStyle(string styleId)
174 	{
175 		// GtkSourceStyle * gtk_source_style_scheme_get_style (GtkSourceStyleScheme *scheme,  const gchar *style_id);
176 		auto p = gtk_source_style_scheme_get_style(gtkSourceStyleScheme, Str.toStringz(styleId));
177 		
178 		if(p is null)
179 		{
180 			return null;
181 		}
182 		
183 		return ObjectG.getDObject!(SourceStyle)(cast(GtkSourceStyle*) p);
184 	}
185 }