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 gstreamer.c.functions;
30 public  import gstreamer.c.types;
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  * Since: 1.12
55  */
56 public class DynamicTypeFactory : PluginFeature
57 {
58 	/** the main Gtk struct */
59 	protected GstDynamicTypeFactory* gstDynamicTypeFactory;
60 
61 	/** Get the main Gtk struct */
62 	public GstDynamicTypeFactory* getDynamicTypeFactoryStruct(bool transferOwnership = false)
63 	{
64 		if (transferOwnership)
65 			ownedRef = false;
66 		return gstDynamicTypeFactory;
67 	}
68 
69 	/** the main Gtk struct as a void* */
70 	protected override void* getStruct()
71 	{
72 		return cast(void*)gstDynamicTypeFactory;
73 	}
74 
75 	/**
76 	 * Sets our main struct and passes it to the parent class.
77 	 */
78 	public this (GstDynamicTypeFactory* gstDynamicTypeFactory, bool ownedRef = false)
79 	{
80 		this.gstDynamicTypeFactory = gstDynamicTypeFactory;
81 		super(cast(GstPluginFeature*)gstDynamicTypeFactory, ownedRef);
82 	}
83 
84 
85 	/** */
86 	public static GType getType()
87 	{
88 		return gst_dynamic_type_factory_get_type();
89 	}
90 
91 	/** */
92 	public static GType load(string factoryname)
93 	{
94 		return gst_dynamic_type_factory_load(Str.toStringz(factoryname));
95 	}
96 }