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