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