alternative to assert
[gtkD.git] / gtkD / src / atk / Registry.d
blobdf99342439e0f4e930e6bb08ea66923bb38dfe11
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 = AtkRegistry.html
26 * outPack = atk
27 * outFile = Registry
28 * strct = AtkRegistry
29 * realStrct=
30 * ctorStrct=
31 * clss = Registry
32 * interf =
33 * class Code: No
34 * interface Code: No
35 * template for:
36 * extend =
37 * implements:
38 * prefixes:
39 * - atk_registry_
40 * omit structs:
41 * omit prefixes:
42 * omit code:
43 * imports:
44 * structWrap:
45 * module aliases:
46 * local aliases:
49 module atk.Registry;
51 version(noAssert)
53 version(Tango)
55 import tango.io.Stdout; // use the tango loging?
59 private import gtkc.atktypes;
61 private import gtkc.atk;
68 /**
69 * Description
70 * The AtkRegistry is normally used to create appropriate ATK "peers" for user
71 * interface components. Application developers usually need only interact with
72 * the AtkRegistry by associating appropriate ATK implementation classes with
73 * GObject classes via the atk_registry_set_factory_type call, passing the
74 * appropriate GType for application custom widget classes.
76 private import gobject.ObjectG;
77 public class Registry : ObjectG
80 /** the main Gtk struct */
81 protected AtkRegistry* atkRegistry;
84 public AtkRegistry* getRegistryStruct()
86 return atkRegistry;
90 /** the main Gtk struct as a void* */
91 protected void* getStruct()
93 return cast(void*)atkRegistry;
96 /**
97 * Sets our main struct and passes it to the parent class
99 public this (AtkRegistry* atkRegistry)
101 version(noAssert)
103 if ( atkRegistry is null )
105 int zero = 0;
106 version(Tango)
108 Stdout("struct atkRegistry is null on constructor").newline;
110 else
112 printf("struct atkRegistry is null on constructor");
114 zero = zero / zero;
117 else
119 assert(atkRegistry !is null, "struct atkRegistry is null on constructor");
121 super(cast(GObject*)atkRegistry);
122 this.atkRegistry = atkRegistry;
130 * Associate an AtkObjectFactory subclass with a GType. Note:
131 * The associated factory_type will thereafter be responsible for
132 * the creation of new AtkObject implementations for instances
133 * appropriate for type.
134 * registry:
135 * the AtkRegistry in which to register the type association
136 * type:
137 * an AtkObject type
138 * factory_type:
139 * an AtkObjectFactory type to associate with type. Must
140 * implement AtkObject appropriate for type.
142 public void setFactoryType(GType type, GType factoryType)
144 // void atk_registry_set_factory_type (AtkRegistry *registry, GType type, GType factory_type);
145 atk_registry_set_factory_type(atkRegistry, type, factoryType);
149 * Provides a GType indicating the AtkObjectFactory subclass
150 * associated with type.
151 * registry:
152 * an AtkRegistry
153 * type:
154 * a GType with which to look up the associated AtkObjectFactory
155 * subclass
156 * Returns:
157 * a GType associated with type type
159 public GType getFactoryType(GType type)
161 // GType atk_registry_get_factory_type (AtkRegistry *registry, GType type);
162 return atk_registry_get_factory_type(atkRegistry, type);
166 * Gets an AtkObjectFactory appropriate for creating AtkObjects
167 * appropriate for type.
168 * registry:
169 * an AtkRegistry
170 * type:
171 * a GType with which to look up the associated AtkObjectFactory
172 * Returns:
173 * an AtkObjectFactory appropriate for creating AtkObjects
174 * appropriate for type.
176 public AtkObjectFactory* getFactory(GType type)
178 // AtkObjectFactory* atk_registry_get_factory (AtkRegistry *registry, GType type);
179 return atk_registry_get_factory(atkRegistry, type);
183 * Gets a default implementation of the AtkObjectFactory/type
184 * registry.
185 * Note: For most toolkit maintainers, this will be the correct
186 * registry for registering new AtkObject factories. Following
187 * a call to this function, maintainers may call atk_registry_set_factory_type()
188 * to associate an AtkObjectFactory subclass with the GType of objects
189 * for whom accessibility information will be provided.
190 * Returns:
191 * a default implementation of the AtkObjectFactory/type
192 * registry
194 public static AtkRegistry* atkGetDefaultRegistry()
196 // AtkRegistry* atk_get_default_registry (void);
197 return atk_get_default_registry();