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  */
74 public class Registry : ObjectG
75 {
76 	
77 	/** the main Gtk struct */
78 	protected AtkRegistry* atkRegistry;
79 	
80 	
81 	public AtkRegistry* getRegistryStruct()
82 	{
83 		return atkRegistry;
84 	}
85 	
86 	
87 	/** the main Gtk struct as a void* */
88 	protected override void* getStruct()
89 	{
90 		return cast(void*)atkRegistry;
91 	}
92 	
93 	/**
94 	 * Sets our main struct and passes it to the parent class
95 	 */
96 	public this (AtkRegistry* atkRegistry)
97 	{
98 		super(cast(GObject*)atkRegistry);
99 		this.atkRegistry = atkRegistry;
100 	}
101 	
102 	protected override void setStruct(GObject* obj)
103 	{
104 		super.setStruct(obj);
105 		atkRegistry = cast(AtkRegistry*)obj;
106 	}
107 	
108 	/**
109 	 */
110 	
111 	/**
112 	 * Params:
113 	 * type = an AtkObject type
114 	 * factoryType = an AtkObjectFactory type to associate with type. Must
115 	 * implement AtkObject appropriate for type.
116 	 */
117 	public void setFactoryType(GType type, GType factoryType)
118 	{
119 		// void atk_registry_set_factory_type (AtkRegistry *registry,  GType type,  GType factory_type);
120 		atk_registry_set_factory_type(atkRegistry, type, factoryType);
121 	}
122 	
123 	/**
124 	 * Provides a GType indicating the AtkObjectFactory subclass
125 	 * associated with type.
126 	 * Params:
127 	 * type = a GType with which to look up the associated AtkObjectFactory
128 	 * subclass
129 	 * Returns: a GType associated with type type
130 	 */
131 	public GType getFactoryType(GType type)
132 	{
133 		// GType atk_registry_get_factory_type (AtkRegistry *registry,  GType type);
134 		return atk_registry_get_factory_type(atkRegistry, type);
135 	}
136 	
137 	/**
138 	 * Gets an AtkObjectFactory appropriate for creating AtkObjects
139 	 * appropriate for type.
140 	 * Params:
141 	 * type = a GType with which to look up the associated AtkObjectFactory
142 	 * Returns: an AtkObjectFactory appropriate for creating AtkObjects appropriate for type. [transfer none]
143 	 */
144 	public ObjectFactory getFactory(GType type)
145 	{
146 		// AtkObjectFactory * atk_registry_get_factory (AtkRegistry *registry,  GType type);
147 		auto p = atk_registry_get_factory(atkRegistry, type);
148 		
149 		if(p is null)
150 		{
151 			return null;
152 		}
153 		
154 		return ObjectG.getDObject!(ObjectFactory)(cast(AtkObjectFactory*) p);
155 	}
156 	
157 	/**
158 	 * Gets a default implementation of the AtkObjectFactory/type
159 	 * registry.
160 	 * Note: For most toolkit maintainers, this will be the correct
161 	 * registry for registering new AtkObject factories. Following
162 	 * a call to this function, maintainers may call atk_registry_set_factory_type()
163 	 * to associate an AtkObjectFactory subclass with the GType of objects
164 	 * for whom accessibility information will be provided.
165 	 * Returns: a default implementation of the AtkObjectFactory/type registry. [transfer full]
166 	 */
167 	public static Registry atkGetDefaultRegistry()
168 	{
169 		// AtkRegistry * atk_get_default_registry (void);
170 		auto p = atk_get_default_registry();
171 		
172 		if(p is null)
173 		{
174 			return null;
175 		}
176 		
177 		return ObjectG.getDObject!(Registry)(cast(AtkRegistry*) p);
178 	}
179 }