alternative to assert
[gtkD.git] / gtkD / src / gtk / Settings.d
blob01611b5bbc96f30bed818580d569bbd5408bf174
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 = GtkSettings.html
26 * outPack = gtk
27 * outFile = Settings
28 * strct = GtkSettings
29 * realStrct=
30 * ctorStrct=
31 * clss = Settings
32 * interf =
33 * class Code: No
34 * interface Code: No
35 * template for:
36 * extend =
37 * implements:
38 * prefixes:
39 * - gtk_settings_
40 * - gtk_
41 * omit structs:
42 * omit prefixes:
43 * omit code:
44 * imports:
45 * - glib.Str
46 * - gtk.Settings
47 * - gdk.Screen
48 * - glib.StringG
49 * - gobject.Value
50 * structWrap:
51 * - GString* -> StringG
52 * - GValue* -> Value
53 * - GdkScreen* -> Screen
54 * - GtkSettings* -> Settings
55 * module aliases:
56 * local aliases:
59 module gtk.Settings;
61 version(noAssert)
63 version(Tango)
65 import tango.io.Stdout; // use the tango loging?
69 private import gtkc.gtktypes;
71 private import gtkc.gtk;
74 private import glib.Str;
75 private import gtk.Settings;
76 private import gdk.Screen;
77 private import glib.StringG;
78 private import gobject.Value;
83 /**
84 * Description
86 private import gobject.ObjectG;
87 public class Settings : ObjectG
90 /** the main Gtk struct */
91 protected GtkSettings* gtkSettings;
94 public GtkSettings* getSettingsStruct()
96 return gtkSettings;
100 /** the main Gtk struct as a void* */
101 protected void* getStruct()
103 return cast(void*)gtkSettings;
107 * Sets our main struct and passes it to the parent class
109 public this (GtkSettings* gtkSettings)
111 version(noAssert)
113 if ( gtkSettings is null )
115 int zero = 0;
116 version(Tango)
118 Stdout("struct gtkSettings is null on constructor").newline;
120 else
122 printf("struct gtkSettings is null on constructor");
124 zero = zero / zero;
127 else
129 assert(gtkSettings !is null, "struct gtkSettings is null on constructor");
131 super(cast(GObject*)gtkSettings);
132 this.gtkSettings = gtkSettings;
141 * Gets the GtkSettings object for the default GDK screen, creating
142 * it if necessary. See gtk_settings_get_for_screen().
143 * Returns:
144 * a GtkSettings object. If there is no default
145 * screen, then returns NULL.
147 public static Settings getDefault()
149 // GtkSettings* gtk_settings_get_default (void);
150 return new Settings( gtk_settings_get_default() );
154 * Gets the GtkSettings object for screen, creating it if necessary.
155 * screen:
156 * a GdkScreen.
157 * Returns:
158 * a GtkSettings object.
159 * Since 2.2
161 public static Settings getForScreen(Screen screen)
163 // GtkSettings* gtk_settings_get_for_screen (GdkScreen *screen);
164 return new Settings( gtk_settings_get_for_screen((screen is null) ? null : screen.getScreenStruct()) );
168 * pspec:
170 public static void installProperty(GParamSpec* pspec)
172 // void gtk_settings_install_property (GParamSpec *pspec);
173 gtk_settings_install_property(pspec);
177 * pspec:
178 * parser:
180 public static void installPropertyParser(GParamSpec* pspec, GtkRcPropertyParser parser)
182 // void gtk_settings_install_property_parser (GParamSpec *pspec, GtkRcPropertyParser parser);
183 gtk_settings_install_property_parser(pspec, parser);
187 * A GtkRcPropertyParser for use with gtk_settings_install_property_parser()
188 * or gtk_widget_class_install_style_property_parser() which parses a
189 * color given either by its name or in the form
190 * { red, green, blue } where red, green and
191 * blue are integers between 0 and 65535 or floating-point numbers
192 * between 0 and 1.
193 * pspec:
194 * a GParamSpec
195 * gstring:
196 * the GString to be parsed
197 * property_value:
198 * a GValue which must hold GdkColor values.
199 * Returns:
200 * TRUE if gstring could be parsed and property_value
201 * has been set to the resulting GdkColor.
203 public static int rcPropertyParseColor(GParamSpec* pspec, StringG gstring, Value propertyValue)
205 // gboolean gtk_rc_property_parse_color (const GParamSpec *pspec, const GString *gstring, GValue *property_value);
206 return gtk_rc_property_parse_color(pspec, (gstring is null) ? null : gstring.getStringGStruct(), (propertyValue is null) ? null : propertyValue.getValueStruct());
210 * A GtkRcPropertyParser for use with gtk_settings_install_property_parser()
211 * or gtk_widget_class_install_style_property_parser() which parses a single
212 * enumeration value.
213 * The enumeration value can be specified by its name, its nickname or
214 * its numeric value. For consistency with flags parsing, the value
215 * may be surrounded by parentheses.
216 * pspec:
217 * a GParamSpec
218 * gstring:
219 * the GString to be parsed
220 * property_value:
221 * a GValue which must hold enum values.
222 * Returns:
223 * TRUE if gstring could be parsed and property_value
224 * has been set to the resulting GEnumValue.
226 public static int rcPropertyParseEnum(GParamSpec* pspec, StringG gstring, Value propertyValue)
228 // gboolean gtk_rc_property_parse_enum (const GParamSpec *pspec, const GString *gstring, GValue *property_value);
229 return gtk_rc_property_parse_enum(pspec, (gstring is null) ? null : gstring.getStringGStruct(), (propertyValue is null) ? null : propertyValue.getValueStruct());
233 * A GtkRcPropertyParser for use with gtk_settings_install_property_parser()
234 * or gtk_widget_class_install_style_property_parser() which parses flags.
235 * Flags can be specified by their name, their nickname or
236 * numerically. Multiple flags can be specified in the form
237 * "( flag1 | flag2 | ... )".
238 * pspec:
239 * a GParamSpec
240 * gstring:
241 * the GString to be parsed
242 * property_value:
243 * a GValue which must hold flags values.
244 * Returns:
245 * TRUE if gstring could be parsed and property_value
246 * has been set to the resulting flags value.
248 public static int rcPropertyParseFlags(GParamSpec* pspec, StringG gstring, Value propertyValue)
250 // gboolean gtk_rc_property_parse_flags (const GParamSpec *pspec, const GString *gstring, GValue *property_value);
251 return gtk_rc_property_parse_flags(pspec, (gstring is null) ? null : gstring.getStringGStruct(), (propertyValue is null) ? null : propertyValue.getValueStruct());
255 * A GtkRcPropertyParser for use with gtk_settings_install_property_parser()
256 * or gtk_widget_class_install_style_property_parser() which parses a
257 * requisition in the form
258 * "{ width, height }" for integers width and height.
259 * pspec:
260 * a GParamSpec
261 * gstring:
262 * the GString to be parsed
263 * property_value:
264 * a GValue which must hold boxed values.
265 * Returns:
266 * TRUE if gstring could be parsed and property_value
267 * has been set to the resulting GtkRequisition.
269 public static int rcPropertyParseRequisition(GParamSpec* pspec, StringG gstring, Value propertyValue)
271 // gboolean gtk_rc_property_parse_requisition (const GParamSpec *pspec, const GString *gstring, GValue *property_value);
272 return gtk_rc_property_parse_requisition(pspec, (gstring is null) ? null : gstring.getStringGStruct(), (propertyValue is null) ? null : propertyValue.getValueStruct());
276 * A GtkRcPropertyParser for use with gtk_settings_install_property_parser()
277 * or gtk_widget_class_install_style_property_parser() which parses
278 * borders in the form
279 * "{ left, right, top, bottom }" for integers
280 * left, right, top and bottom.
281 * pspec:
282 * a GParamSpec
283 * gstring:
284 * the GString to be parsed
285 * property_value:
286 * a GValue which must hold boxed values.
287 * Returns:
288 * TRUE if gstring could be parsed and property_value
289 * has been set to the resulting GtkBorder.
291 public static int rcPropertyParseBorder(GParamSpec* pspec, StringG gstring, Value propertyValue)
293 // gboolean gtk_rc_property_parse_border (const GParamSpec *pspec, const GString *gstring, GValue *property_value);
294 return gtk_rc_property_parse_border(pspec, (gstring is null) ? null : gstring.getStringGStruct(), (propertyValue is null) ? null : propertyValue.getValueStruct());
298 * settings:
299 * name:
300 * svalue:
302 public void setPropertyValue(char[] name, GtkSettingsValue* svalue)
304 // void gtk_settings_set_property_value (GtkSettings *settings, const gchar *name, const GtkSettingsValue *svalue);
305 gtk_settings_set_property_value(gtkSettings, Str.toStringz(name), svalue);
309 * settings:
310 * name:
311 * v_string:
312 * origin:
314 public void setStringProperty(char[] name, char[] vString, char[] origin)
316 // void gtk_settings_set_string_property (GtkSettings *settings, const gchar *name, const gchar *v_string, const gchar *origin);
317 gtk_settings_set_string_property(gtkSettings, Str.toStringz(name), Str.toStringz(vString), Str.toStringz(origin));
321 * settings:
322 * name:
323 * v_long:
324 * origin:
326 public void setLongProperty(char[] name, int vLong, char[] origin)
328 // void gtk_settings_set_long_property (GtkSettings *settings, const gchar *name, glong v_long, const gchar *origin);
329 gtk_settings_set_long_property(gtkSettings, Str.toStringz(name), vLong, Str.toStringz(origin));
333 * settings:
334 * name:
335 * v_double:
336 * origin:
337 * Property Details
338 * The "color-hash" property
339 * "color-hash" GHashTable : Read
340 * Holds a hash table representation of the gtk-color-scheme setting,
341 * mapping color names to GdkColors.
342 * Since 2.10
344 public void setDoubleProperty(char[] name, double vDouble, char[] origin)
346 // void gtk_settings_set_double_property (GtkSettings *settings, const gchar *name, gdouble v_double, const gchar *origin);
347 gtk_settings_set_double_property(gtkSettings, Str.toStringz(name), vDouble, Str.toStringz(origin));