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 module gstreamer.DynamicTypeFactory;
26 
27 private import glib.Str;
28 private import gstreamer.PluginFeature;
29 private import gstreamerc.gstreamer;
30 public  import gstreamerc.gstreamertypes;
31 
32 
33 /**
34  * #GstDynamicTypeFactory is used to represent a type that can be
35  * automatically loaded the first time it is used. For example,
36  * a non-standard type for use in caps fields.
37  * 
38  * In general, applications and plugins don't need to use the factory
39  * beyond registering the type in a plugin init function. Once that is
40  * done, the type is stored in the registry, and ready as soon as the
41  * registry is loaded.
42  * 
43  * ## Registering a type for dynamic loading
44  * 
45  * |[<!-- language="C" -->
46  * 
47  * static gboolean
48  * plugin_init (GstPlugin * plugin)
49  * {
50  * return gst_dynamic_type_register (plugin, GST_TYPE_CUSTOM_CAPS_FIELD);
51  * }
52  * ]|
53  */
54 public class DynamicTypeFactory : PluginFeature
55 {
56 	/** the main Gtk struct */
57 	protected GstDynamicTypeFactory* gstDynamicTypeFactory;
58 
59 	/** Get the main Gtk struct */
60 	public GstDynamicTypeFactory* getDynamicTypeFactoryStruct()
61 	{
62 		return gstDynamicTypeFactory;
63 	}
64 
65 	/** the main Gtk struct as a void* */
66 	protected override void* getStruct()
67 	{
68 		return cast(void*)gstDynamicTypeFactory;
69 	}
70 
71 	protected override void setStruct(GObject* obj)
72 	{
73 		gstDynamicTypeFactory = cast(GstDynamicTypeFactory*)obj;
74 		super.setStruct(obj);
75 	}
76 
77 	/**
78 	 * Sets our main struct and passes it to the parent class.
79 	 */
80 	public this (GstDynamicTypeFactory* gstDynamicTypeFactory, bool ownedRef = false)
81 	{
82 		this.gstDynamicTypeFactory = gstDynamicTypeFactory;
83 		super(cast(GstPluginFeature*)gstDynamicTypeFactory, ownedRef);
84 	}
85 
86 
87 	/** */
88 	public static GType getType()
89 	{
90 		return gst_dynamic_type_factory_get_type();
91 	}
92 
93 	/** */
94 	public static GType load(string factoryname)
95 	{
96 		return gst_dynamic_type_factory_load(Str.toStringz(factoryname));
97 	}
98 }