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 module gtk.RcProperty;
26 
27 private import glib.MemorySlice;
28 private import glib.Str;
29 private import glib.StringG;
30 private import gobject.ObjectG;
31 private import gobject.ParamSpec;
32 private import gobject.Value;
33 private import gtk.c.functions;
34 public  import gtk.c.types;
35 public  import gtkc.gtktypes;
36 private import gtkd.Loader;
37 
38 
39 /**
40  * Deprecated
41  */
42 public struct RcProperty
43 {
44 
45 	/**
46 	 * A #GtkRcPropertyParser for use with gtk_settings_install_property_parser()
47 	 * or gtk_widget_class_install_style_property_parser() which parses
48 	 * borders in the form
49 	 * `"{ left, right, top, bottom }"` for integers
50 	 * left, right, top and bottom.
51 	 *
52 	 * Params:
53 	 *     pspec = a #GParamSpec
54 	 *     gstring = the #GString to be parsed
55 	 *     propertyValue = a #GValue which must hold boxed values.
56 	 *
57 	 * Returns: %TRUE if @gstring could be parsed and @property_value
58 	 *     has been set to the resulting #GtkBorder.
59 	 */
60 	public static bool parseBorder(ParamSpec pspec, StringG gstring, Value propertyValue)
61 	{
62 		return gtk_rc_property_parse_border((pspec is null) ? null : pspec.getParamSpecStruct(), (gstring is null) ? null : gstring.getStringGStruct(), (propertyValue is null) ? null : propertyValue.getValueStruct()) != 0;
63 	}
64 
65 	/**
66 	 * A #GtkRcPropertyParser for use with gtk_settings_install_property_parser()
67 	 * or gtk_widget_class_install_style_property_parser() which parses a
68 	 * color given either by its name or in the form
69 	 * `{ red, green, blue }` where red, green and
70 	 * blue are integers between 0 and 65535 or floating-point numbers
71 	 * between 0 and 1.
72 	 *
73 	 * Params:
74 	 *     pspec = a #GParamSpec
75 	 *     gstring = the #GString to be parsed
76 	 *     propertyValue = a #GValue which must hold #GdkColor values.
77 	 *
78 	 * Returns: %TRUE if @gstring could be parsed and @property_value
79 	 *     has been set to the resulting #GdkColor.
80 	 */
81 	public static bool parseColor(ParamSpec pspec, StringG gstring, Value propertyValue)
82 	{
83 		return gtk_rc_property_parse_color((pspec is null) ? null : pspec.getParamSpecStruct(), (gstring is null) ? null : gstring.getStringGStruct(), (propertyValue is null) ? null : propertyValue.getValueStruct()) != 0;
84 	}
85 
86 	/**
87 	 * A #GtkRcPropertyParser for use with gtk_settings_install_property_parser()
88 	 * or gtk_widget_class_install_style_property_parser() which parses a single
89 	 * enumeration value.
90 	 *
91 	 * The enumeration value can be specified by its name, its nickname or
92 	 * its numeric value. For consistency with flags parsing, the value
93 	 * may be surrounded by parentheses.
94 	 *
95 	 * Params:
96 	 *     pspec = a #GParamSpec
97 	 *     gstring = the #GString to be parsed
98 	 *     propertyValue = a #GValue which must hold enum values.
99 	 *
100 	 * Returns: %TRUE if @gstring could be parsed and @property_value
101 	 *     has been set to the resulting #GEnumValue.
102 	 */
103 	public static bool parseEnum(ParamSpec pspec, StringG gstring, Value propertyValue)
104 	{
105 		return gtk_rc_property_parse_enum((pspec is null) ? null : pspec.getParamSpecStruct(), (gstring is null) ? null : gstring.getStringGStruct(), (propertyValue is null) ? null : propertyValue.getValueStruct()) != 0;
106 	}
107 
108 	/**
109 	 * A #GtkRcPropertyParser for use with gtk_settings_install_property_parser()
110 	 * or gtk_widget_class_install_style_property_parser() which parses flags.
111 	 *
112 	 * Flags can be specified by their name, their nickname or
113 	 * numerically. Multiple flags can be specified in the form
114 	 * `"( flag1 | flag2 | ... )"`.
115 	 *
116 	 * Params:
117 	 *     pspec = a #GParamSpec
118 	 *     gstring = the #GString to be parsed
119 	 *     propertyValue = a #GValue which must hold flags values.
120 	 *
121 	 * Returns: %TRUE if @gstring could be parsed and @property_value
122 	 *     has been set to the resulting flags value.
123 	 */
124 	public static bool parseFlags(ParamSpec pspec, StringG gstring, Value propertyValue)
125 	{
126 		return gtk_rc_property_parse_flags((pspec is null) ? null : pspec.getParamSpecStruct(), (gstring is null) ? null : gstring.getStringGStruct(), (propertyValue is null) ? null : propertyValue.getValueStruct()) != 0;
127 	}
128 
129 	/**
130 	 * A #GtkRcPropertyParser for use with gtk_settings_install_property_parser()
131 	 * or gtk_widget_class_install_style_property_parser() which parses a
132 	 * requisition in the form
133 	 * `"{ width, height }"` for integers %width and %height.
134 	 *
135 	 * Params:
136 	 *     pspec = a #GParamSpec
137 	 *     gstring = the #GString to be parsed
138 	 *     propertyValue = a #GValue which must hold boxed values.
139 	 *
140 	 * Returns: %TRUE if @gstring could be parsed and @property_value
141 	 *     has been set to the resulting #GtkRequisition.
142 	 */
143 	public static bool parseRequisition(ParamSpec pspec, StringG gstring, Value propertyValue)
144 	{
145 		return gtk_rc_property_parse_requisition((pspec is null) ? null : pspec.getParamSpecStruct(), (gstring is null) ? null : gstring.getStringGStruct(), (propertyValue is null) ? null : propertyValue.getValueStruct()) != 0;
146 	}
147 }