alternative to assert
[gtkD.git] / gtkD / src / atk / StateSet.d
blobbe2361182a78c26db34164b75c218f58ac6ece03
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 = atk-AtkStateSet.html
26 * outPack = atk
27 * outFile = StateSet
28 * strct = AtkStateSet
29 * realStrct=
30 * ctorStrct=
31 * clss = StateSet
32 * interf =
33 * class Code: No
34 * interface Code: No
35 * template for:
36 * extend =
37 * implements:
38 * prefixes:
39 * - atk_state_set_
40 * omit structs:
41 * omit prefixes:
42 * omit code:
43 * imports:
44 * - glib.Str
45 * structWrap:
46 * module aliases:
47 * local aliases:
50 module atk.StateSet;
52 version(noAssert)
54 version(Tango)
56 import tango.io.Stdout; // use the tango loging?
60 private import gtkc.atktypes;
62 private import gtkc.atk;
65 private import glib.Str;
70 /**
71 * Description
72 * An AtkStateSet determines a component's state set. It is composed of a set
73 * of AtkStates.
75 public class StateSet
78 /** the main Gtk struct */
79 protected AtkStateSet* atkStateSet;
82 public AtkStateSet* getStateSetStruct()
84 return atkStateSet;
88 /** the main Gtk struct as a void* */
89 protected void* getStruct()
91 return cast(void*)atkStateSet;
94 /**
95 * Sets our main struct and passes it to the parent class
97 public this (AtkStateSet* atkStateSet)
99 version(noAssert)
101 if ( atkStateSet is null )
103 int zero = 0;
104 version(Tango)
106 Stdout("struct atkStateSet is null on constructor").newline;
108 else
110 printf("struct atkStateSet is null on constructor");
112 zero = zero / zero;
115 else
117 assert(atkStateSet !is null, "struct atkStateSet is null on constructor");
119 this.atkStateSet = atkStateSet;
126 * Creates a new empty state set.
127 * Returns:
128 * a new AtkStateSet
130 public this ()
132 // AtkStateSet* atk_state_set_new (void);
133 this(cast(AtkStateSet*)atk_state_set_new() );
137 * Checks whether the state set is empty, i.e. has no states set.
138 * set:
139 * an AtkStateType
140 * Returns:
141 * TRUE if set has no states set, otherwise FALSE
143 public int isEmpty()
145 // gboolean atk_state_set_is_empty (AtkStateSet *set);
146 return atk_state_set_is_empty(atkStateSet);
150 * Add a new state for the specified type to the current state set if
151 * it is not already present.
152 * set:
153 * an AtkStateSet
154 * type:
155 * an AtkStateType
156 * Returns:
157 * TRUE if the state for type is not already in set.
159 public int addState(AtkStateType type)
161 // gboolean atk_state_set_add_state (AtkStateSet *set, AtkStateType type);
162 return atk_state_set_add_state(atkStateSet, type);
166 * Add the states for the specified types to the current state set.
167 * set:
168 * an AtkStateSet
169 * types:
170 * an array of AtkStateType
171 * n_types:
172 * The number of elements in the array
174 public void addStates(AtkStateType* types, int nTypes)
176 // void atk_state_set_add_states (AtkStateSet *set, AtkStateType *types, gint n_types);
177 atk_state_set_add_states(atkStateSet, types, nTypes);
181 * Removes all states from the state set.
182 * set:
183 * an AtkStateSet
185 public void clearStates()
187 // void atk_state_set_clear_states (AtkStateSet *set);
188 atk_state_set_clear_states(atkStateSet);
192 * Checks whether the state for the specified type is in the specified set.
193 * set:
194 * an AtkStateSet
195 * type:
196 * an AtkStateType
197 * Returns:
198 * TRUE if type is the state type is in set.
200 public int containsState(AtkStateType type)
202 // gboolean atk_state_set_contains_state (AtkStateSet *set, AtkStateType type);
203 return atk_state_set_contains_state(atkStateSet, type);
207 * Checks whether the states for all the specified types are in the
208 * specified set.
209 * set:
210 * an AtkStateSet
211 * types:
212 * an array of AtkStateType
213 * n_types:
214 * The number of elements in the array
215 * Returns:
216 * TRUE if all the states for type are in set.
218 public int containsStates(AtkStateType* types, int nTypes)
220 // gboolean atk_state_set_contains_states (AtkStateSet *set, AtkStateType *types, gint n_types);
221 return atk_state_set_contains_states(atkStateSet, types, nTypes);
225 * Removes the state for the specified type from the state set.
226 * set:
227 * an AtkStateSet
228 * type:
229 * an AtkType
230 * Returns:
231 * TRUE if type was the state type is in set.
233 public int removeState(AtkStateType type)
235 // gboolean atk_state_set_remove_state (AtkStateSet *set, AtkStateType type);
236 return atk_state_set_remove_state(atkStateSet, type);
240 * Constructs the intersection of the two sets, returning NULL if the
241 * intersection is empty.
242 * set:
243 * an AtkStateSet
244 * compare_set:
245 * another AtkStateSet
246 * Returns:
247 * a new AtkStateSet which is the intersection of the two sets.
249 public AtkStateSet* andSets(AtkStateSet* compareSet)
251 // AtkStateSet* atk_state_set_and_sets (AtkStateSet *set, AtkStateSet *compare_set);
252 return atk_state_set_and_sets(atkStateSet, compareSet);
256 * Constructs the union of the two sets.
257 * set:
258 * an AtkStateSet
259 * compare_set:
260 * another AtkStateSet
261 * Returns:
262 * a new AtkStateSet which is the union of the two sets,
263 * returning NULL is empty.
265 public AtkStateSet* orSets(AtkStateSet* compareSet)
267 // AtkStateSet* atk_state_set_or_sets (AtkStateSet *set, AtkStateSet *compare_set);
268 return atk_state_set_or_sets(atkStateSet, compareSet);
272 * Constructs the exclusive-or of the two sets, returning NULL is empty.
273 * The set returned by this operation contains the states in exactly
274 * one of the two sets.
275 * set:
276 * an AtkStateSet
277 * compare_set:
278 * another AtkStateSet
279 * Returns:
280 * a new AtkStateSet which contains the states which are
281 * in exactly one of the two sets.
283 public AtkStateSet* xorSets(AtkStateSet* compareSet)
285 // AtkStateSet* atk_state_set_xor_sets (AtkStateSet *set, AtkStateSet *compare_set);
286 return atk_state_set_xor_sets(atkStateSet, compareSet);