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 = AtkRelation.html
47 * - GPtrArray* -> PtrArray
58 import tango
.io
.Stdout
; // use the tango loging?
62 private import gtkc
.atktypes
;
64 private import gtkc
.atk
;
67 private import glib
.PtrArray
;
68 private import glib
.Str
;
75 * An AtkRelation describes a relation between an object and one or more
76 * other objects. The actual relations that an object has with other objects
77 * are defined as an AtkRelationSet, which is a set of AtkRelations.
79 private import gobject
.ObjectG
;
80 public class Relation
: ObjectG
83 /** the main Gtk struct */
84 protected AtkRelation
* atkRelation
;
87 public AtkRelation
* getRelationStruct()
93 /** the main Gtk struct as a void* */
94 protected void* getStruct()
96 return cast(void*)atkRelation
;
100 * Sets our main struct and passes it to the parent class
102 public this (AtkRelation
* atkRelation
)
106 if ( atkRelation
is null )
111 Stdout("struct atkRelation is null on constructor").newline
;
115 printf("struct atkRelation is null on constructor");
122 assert(atkRelation
!is null, "struct atkRelation is null on constructor");
124 super(cast(GObject
*)atkRelation
);
125 this.atkRelation
= atkRelation
;
134 * Associate name with a new AtkRelationType
138 * an AtkRelationType associated with name
140 public static AtkRelationType
typeRegister(char[] name
)
142 // AtkRelationType atk_relation_type_register (const gchar *name);
143 return atk_relation_type_register(Str
.toStringz(name
));
147 * Gets the description string describing the AtkRelationType type.
149 * The AtkRelationType whose name is required
151 * the string describing the AtkRelationType
153 public static char[] typeGetName(AtkRelationType type
)
155 // const gchar* atk_relation_type_get_name (AtkRelationType type);
156 return Str
.toString(atk_relation_type_get_name(type
) );
160 * Get the AtkRelationType type corresponding to a relation name.
162 * a string which is the (non-localized) name of an ATK relation type.
164 * the AtkRelationType enumerated type corresponding to the specified name,
165 * or ATK_RELATION_NULL if no matching relation type is found.
167 public static AtkRelationType
typeForName(char[] name
)
169 // AtkRelationType atk_relation_type_for_name (const gchar *name);
170 return atk_relation_type_for_name(Str
.toStringz(name
));
174 * Create a new relation for the specified key and the specified list
177 * an array of pointers to AtkObjects
179 * number of AtkObjects pointed to by targets
181 * an AtkRelationType with which to create the new
184 * a pointer to a new AtkRelation
186 public this (AtkObject
** targets
, int nTargets
, AtkRelationType relationship
)
188 // AtkRelation* atk_relation_new (AtkObject **targets, gint n_targets, AtkRelationType relationship);
189 this(cast(AtkRelation
*)atk_relation_new(targets
, nTargets
, relationship
) );
193 * Gets the type of relation
197 * the type of relation
199 public AtkRelationType
getRelationType()
201 // AtkRelationType atk_relation_get_relation_type (AtkRelation *relation);
202 return atk_relation_get_relation_type(atkRelation
);
206 * Gets the target list of relation
210 * the target list of relation
212 public PtrArray
getTarget()
214 // GPtrArray* atk_relation_get_target (AtkRelation *relation);
215 return new PtrArray( atk_relation_get_target(atkRelation
) );
219 * Adds the specified AtkObject to the target for the relation, if it is
220 * not already present.
227 * The "relation-type" property
228 * "relation-type" AtkRelationType : Read / Write
229 * The type of the relation.
230 * Default value: ATK_RELATION_NULL
232 public void addTarget(AtkObject
* target
)
234 // void atk_relation_add_target (AtkRelation *relation, AtkObject *target);
235 atk_relation_add_target(atkRelation
, target
);