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(bool transferOwnership = false)
61 	{
62 		if (transferOwnership)
63 			ownedRef = false;
64 		return gstDynamicTypeFactory;
65 	}
66 
67 	/** the main Gtk struct as a void* */
68 	protected override void* getStruct()
69 	{
70 		return cast(void*)gstDynamicTypeFactory;
71 	}
72 
73 	protected override void setStruct(GObject* obj)
74 	{
75 		gstDynamicTypeFactory = cast(GstDynamicTypeFactory*)obj;
76 		super.setStruct(obj);
77 	}
78 
79 	/**
80 	 * Sets our main struct and passes it to the parent class.
81 	 */
82 	public this (GstDynamicTypeFactory* gstDynamicTypeFactory, bool ownedRef = false)
83 	{
84 		this.gstDynamicTypeFactory = gstDynamicTypeFactory;
85 		super(cast(GstPluginFeature*)gstDynamicTypeFactory, ownedRef);
86 	}
87 
88 
89 	/** */
90 	public static GType getType()
91 	{
92 		return gst_dynamic_type_factory_get_type();
93 	}
94 
95 	/** */
96 	public static GType load(string factoryname)
97 	{
98 		return gst_dynamic_type_factory_load(Str.toStringz(factoryname));
99 	}
100 }