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
51 * - GString* -> StringG
53 * - GdkScreen* -> Screen
54 * - GtkSettings* -> Settings
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
;
86 private import gobject
.ObjectG
;
87 public class Settings
: ObjectG
90 /** the main Gtk struct */
91 protected GtkSettings
* gtkSettings
;
94 public GtkSettings
* getSettingsStruct()
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
)
113 if ( gtkSettings
is null )
118 Stdout("struct gtkSettings is null on constructor").newline
;
122 printf("struct gtkSettings is null on constructor");
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().
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.
158 * a GtkSettings object.
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()) );
170 public static void installProperty(GParamSpec
* pspec
)
172 // void gtk_settings_install_property (GParamSpec *pspec);
173 gtk_settings_install_property(pspec
);
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
196 * the GString to be parsed
198 * a GValue which must hold GdkColor values.
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
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.
219 * the GString to be parsed
221 * a GValue which must hold enum values.
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 | ... )".
241 * the GString to be parsed
243 * a GValue which must hold flags values.
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.
262 * the GString to be parsed
264 * a GValue which must hold boxed values.
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.
284 * the GString to be parsed
286 * a GValue which must hold boxed values.
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());
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
);
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
));
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
));
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.
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
));