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  * Conversion parameters:
26  * inFile  = AtkRegistry.html
27  * outPack = atk
28  * outFile = Registry
29  * strct   = AtkRegistry
30  * realStrct=
31  * ctorStrct=
32  * clss    = Registry
33  * interf  = 
34  * class Code: No
35  * interface Code: No
36  * template for:
37  * extend  = 
38  * implements:
39  * prefixes:
40  * 	- atk_registry_
41  * omit structs:
42  * omit prefixes:
43  * omit code:
44  * omit signals:
45  * imports:
46  * 	- atk.ObjectFactory
47  * 	- atk.Registry
48  * structWrap:
49  * 	- AtkObjectFactory* -> ObjectFactory
50  * 	- AtkRegistry* -> Registry
51  * module aliases:
52  * local aliases:
53  * overrides:
54  */
55 
56 module atk.Registry;
57 
58 public  import gtkc.atktypes;
59 
60 private import gtkc.atk;
61 private import glib.ConstructionException;
62 private import gobject.ObjectG;
63 
64 
65 private import atk.ObjectFactory;
66 private import atk.Registry;
67 
68 
69 
70 private import gobject.ObjectG;
71 
72 /**
73  * Description
74  * The AtkRegistry is normally used to create appropriate ATK "peers" for user
75  * interface components. Application developers usually need only interact with
76  * the AtkRegistry by associating appropriate ATK implementation classes with
77  * GObject classes via the atk_registry_set_factory_type call, passing the
78  * appropriate GType for application custom widget classes.
79  */
80 public class Registry : ObjectG
81 {
82 	
83 	/** the main Gtk struct */
84 	protected AtkRegistry* atkRegistry;
85 	
86 	
87 	public AtkRegistry* getRegistryStruct()
88 	{
89 		return atkRegistry;
90 	}
91 	
92 	
93 	/** the main Gtk struct as a void* */
94 	protected override void* getStruct()
95 	{
96 		return cast(void*)atkRegistry;
97 	}
98 	
99 	/**
100 	 * Sets our main struct and passes it to the parent class
101 	 */
102 	public this (AtkRegistry* atkRegistry)
103 	{
104 		super(cast(GObject*)atkRegistry);
105 		this.atkRegistry = atkRegistry;
106 	}
107 	
108 	protected override void setStruct(GObject* obj)
109 	{
110 		super.setStruct(obj);
111 		atkRegistry = cast(AtkRegistry*)obj;
112 	}
113 	
114 	/**
115 	 */
116 	
117 	/**
118 	 * Params:
119 	 * type = an AtkObject type
120 	 * factoryType = an AtkObjectFactory type to associate with type. Must
121 	 * implement AtkObject appropriate for type.
122 	 */
123 	public void setFactoryType(GType type, GType factoryType)
124 	{
125 		// void atk_registry_set_factory_type (AtkRegistry *registry,  GType type,  GType factory_type);
126 		atk_registry_set_factory_type(atkRegistry, type, factoryType);
127 	}
128 	
129 	/**
130 	 * Provides a GType indicating the AtkObjectFactory subclass
131 	 * associated with type.
132 	 * Params:
133 	 * type = a GType with which to look up the associated AtkObjectFactory
134 	 * subclass
135 	 * Returns: a GType associated with type type
136 	 */
137 	public GType getFactoryType(GType type)
138 	{
139 		// GType atk_registry_get_factory_type (AtkRegistry *registry,  GType type);
140 		return atk_registry_get_factory_type(atkRegistry, type);
141 	}
142 	
143 	/**
144 	 * Gets an AtkObjectFactory appropriate for creating AtkObjects
145 	 * appropriate for type.
146 	 * Params:
147 	 * type = a GType with which to look up the associated AtkObjectFactory
148 	 * Returns: an AtkObjectFactory appropriate for creating AtkObjects appropriate for type. [transfer none]
149 	 */
150 	public ObjectFactory getFactory(GType type)
151 	{
152 		// AtkObjectFactory * atk_registry_get_factory (AtkRegistry *registry,  GType type);
153 		auto p = atk_registry_get_factory(atkRegistry, type);
154 		
155 		if(p is null)
156 		{
157 			return null;
158 		}
159 		
160 		return ObjectG.getDObject!(ObjectFactory)(cast(AtkObjectFactory*) p);
161 	}
162 	
163 	/**
164 	 * Gets a default implementation of the AtkObjectFactory/type
165 	 * registry.
166 	 * Note: For most toolkit maintainers, this will be the correct
167 	 * registry for registering new AtkObject factories. Following
168 	 * a call to this function, maintainers may call atk_registry_set_factory_type()
169 	 * to associate an AtkObjectFactory subclass with the GType of objects
170 	 * for whom accessibility information will be provided.
171 	 * Returns: a default implementation of the AtkObjectFactory/type registry. [transfer full]
172 	 */
173 	public static Registry atkGetDefaultRegistry()
174 	{
175 		// AtkRegistry * atk_get_default_registry (void);
176 		auto p = atk_get_default_registry();
177 		
178 		if(p is null)
179 		{
180 			return null;
181 		}
182 		
183 		return ObjectG.getDObject!(Registry)(cast(AtkRegistry*) p);
184 	}
185 }