alternative to assert
[gtkD.git] / src / atk / ObjectFactory.d
blob8046e88a35841c47c67eab926f5e72010452fb6c
1 /*
2 * This file is part of duit.
4 * duit 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 * duit 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 duit; 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 = AtkObjectFactory.html
26 * outPack = atk
27 * outFile = ObjectFactory
28 * strct = AtkObjectFactory
29 * realStrct=
30 * ctorStrct=
31 * clss = ObjectFactory
32 * interf =
33 * class Code: No
34 * interface Code: No
35 * template for:
36 * extend =
37 * implements:
38 * prefixes:
39 * - atk_object_factory_
40 * omit structs:
41 * omit prefixes:
42 * omit code:
43 * imports:
44 * - gobject.ObjectG
45 * structWrap:
46 * - GObject* -> ObjectG
47 * local aliases:
50 module atk.ObjectFactory;
52 private import atk.atktypes;
54 private import lib.atk;
56 private import gobject.ObjectG;
58 /**
59 * Description
60 * This class is the base object class for a factory used to create an
61 * accessible object for a specific GType. The function
62 * atk_registry_set_factory_type() is normally called to store
63 * in the registry the factory type to be used to create an accessible of a
64 * particular GType.
66 private import gobject.ObjectG;
67 public class ObjectFactory : ObjectG
70 /** the main Gtk struct */
71 protected AtkObjectFactory* atkObjectFactory;
74 public AtkObjectFactory* getObjectFactoryStruct()
76 return atkObjectFactory;
80 /** the main Gtk struct as a void* */
81 protected void* getStruct()
83 return cast(void*)atkObjectFactory;
86 /**
87 * Sets our main struct and passes it to the parent class
89 public this (AtkObjectFactory* atkObjectFactory)
91 super(cast(GObject*)atkObjectFactory);
92 this.atkObjectFactory = atkObjectFactory;
95 /**
99 /**
100 * Provides an AtkObject that implements an accessibility interface
101 * on behalf of obj
102 * factory:
103 * The AtkObjectFactory associated with obj's
104 * object type
105 * obj:
106 * a GObject
107 * Returns:
108 * an AtkObject that implements an accessibility interface
109 * on behalf of obj
111 public AtkObject* createAccessible(ObjectG obj)
113 // AtkObject* atk_object_factory_create_accessible (AtkObjectFactory *factory, GObject *obj);
114 return atk_object_factory_create_accessible(atkObjectFactory, (obj is null) ? null : obj.getObjectGStruct());
118 * Gets the GType of the accessible which is created by the factory.
119 * factory:
120 * an AtkObjectFactory
121 * Returns:
122 * the type of the accessible which is created by the factory.
123 * The value G_TYPE_INVALID is returned if no type if found.
125 public GType getAccessibleType()
127 // GType atk_object_factory_get_accessible_type (AtkObjectFactory *factory);
128 return atk_object_factory_get_accessible_type(atkObjectFactory);
132 * Inform factory that it is no longer being used to create
133 * accessibles. When called, factory may need to inform
134 * AtkObjects which it has created that they need to be re-instantiated.
135 * Note: primarily used for runtime replacement of AtkObjectFactorys
136 * in object registries.
137 * factory:
138 * an AtkObjectFactory to invalidate
139 * See Also
140 * AtkRegistry
142 public void invalidate()
144 // void atk_object_factory_invalidate (AtkObjectFactory *factory);
145 atk_object_factory_invalidate(atkObjectFactory);