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  * 	- gsv.SourceStyle
47  * 	- glib.Str
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 
64 private import gsv.SourceStyle;
65 private import glib.Str;
66 
67 
68 
69 private import gobject.ObjectG;
70 
71 /**
72  * Description
73  * GtkSourceStyleScheme contains all the text styles to be used in
74  * GtkSourceView and GtkSourceBuffer. For instance, it contains text styles
75  * for syntax highlighting, it may contain foreground and background color for
76  * non-highlighted text, color for the line numbers, etc.
77  * Style schemes are stored in XML files. The format of a scheme file is
78  * the documented in the
79  * style scheme reference.
80  */
81 public class SourceStyleScheme : ObjectG
82 {
83 	
84 	/** the main Gtk struct */
85 	protected GtkSourceStyleScheme* gtkSourceStyleScheme;
86 	
87 	
88 	public GtkSourceStyleScheme* getSourceStyleSchemeStruct()
89 	{
90 		return gtkSourceStyleScheme;
91 	}
92 	
93 	
94 	/** the main Gtk struct as a void* */
95 	protected override void* getStruct()
96 	{
97 		return cast(void*)gtkSourceStyleScheme;
98 	}
99 	
100 	/**
101 	 * Sets our main struct and passes it to the parent class
102 	 */
103 	public this (GtkSourceStyleScheme* gtkSourceStyleScheme)
104 	{
105 		super(cast(GObject*)gtkSourceStyleScheme);
106 		this.gtkSourceStyleScheme = gtkSourceStyleScheme;
107 	}
108 	
109 	protected override void setStruct(GObject* obj)
110 	{
111 		super.setStruct(obj);
112 		gtkSourceStyleScheme = cast(GtkSourceStyleScheme*)obj;
113 	}
114 	
115 	/**
116 	 */
117 	
118 	/**
119 	 * Since 2.0
120 	 * Returns: scheme id.
121 	 */
122 	public string getId()
123 	{
124 		// const gchar * gtk_source_style_scheme_get_id (GtkSourceStyleScheme *scheme);
125 		return Str.toString(gtk_source_style_scheme_get_id(gtkSourceStyleScheme));
126 	}
127 	
128 	/**
129 	 * Since 2.0
130 	 * Returns: scheme name.
131 	 */
132 	public string getName()
133 	{
134 		// const gchar * gtk_source_style_scheme_get_name (GtkSourceStyleScheme *scheme);
135 		return Str.toString(gtk_source_style_scheme_get_name(gtkSourceStyleScheme));
136 	}
137 	
138 	/**
139 	 * Since 2.0
140 	 * Returns: scheme description (if defined) or NULL.
141 	 */
142 	public string getDescription()
143 	{
144 		// const gchar * gtk_source_style_scheme_get_description  (GtkSourceStyleScheme *scheme);
145 		return Str.toString(gtk_source_style_scheme_get_description(gtkSourceStyleScheme));
146 	}
147 	
148 	/**
149 	 * Since 2.0
150 	 * Returns: a NULL-terminated array containing the scheme authors or NULL if no author is specified by the style scheme.
151 	 */
152 	public string[] getAuthors()
153 	{
154 		// const gchar * const * gtk_source_style_scheme_get_authors  (GtkSourceStyleScheme *scheme);
155 		return Str.toStringArray(gtk_source_style_scheme_get_authors(gtkSourceStyleScheme));
156 	}
157 	
158 	/**
159 	 * Since 2.0
160 	 * Returns: scheme file name if the scheme was created parsing a style scheme file or NULL in the other cases.
161 	 */
162 	public string getFilename()
163 	{
164 		// const gchar * gtk_source_style_scheme_get_filename  (GtkSourceStyleScheme *scheme);
165 		return Str.toString(gtk_source_style_scheme_get_filename(gtkSourceStyleScheme));
166 	}
167 	
168 	/**
169 	 * Since 2.0
170 	 * Params:
171 	 * styleId = id of the style to retrieve.
172 	 * 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.
173 	 */
174 	public SourceStyle getStyle(string styleId)
175 	{
176 		// GtkSourceStyle * gtk_source_style_scheme_get_style (GtkSourceStyleScheme *scheme,  const gchar *style_id);
177 		auto p = gtk_source_style_scheme_get_style(gtkSourceStyleScheme, Str.toStringz(styleId));
178 		
179 		if(p is null)
180 		{
181 			return null;
182 		}
183 		
184 		return ObjectG.getDObject!(SourceStyle)(cast(GtkSourceStyle*) p);
185 	}
186 }