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.StaticPadTemplate;
26 
27 private import glib.Str;
28 private import glib.c.functions;
29 private import gobject.ObjectG;
30 private import gstreamer.Caps;
31 private import gstreamer.PadTemplate;
32 private import gstreamer.StaticCaps;
33 private import gstreamer.c.functions;
34 public  import gstreamer.c.types;
35 public  import gstreamerc.gstreamertypes;
36 private import gtkd.Loader;
37 
38 
39 /**
40  * Structure describing the #GstStaticPadTemplate.
41  */
42 public final class StaticPadTemplate
43 {
44 	/** the main Gtk struct */
45 	protected GstStaticPadTemplate* gstStaticPadTemplate;
46 	protected bool ownedRef;
47 
48 	/** Get the main Gtk struct */
49 	public GstStaticPadTemplate* getStaticPadTemplateStruct(bool transferOwnership = false)
50 	{
51 		if (transferOwnership)
52 			ownedRef = false;
53 		return gstStaticPadTemplate;
54 	}
55 
56 	/** the main Gtk struct as a void* */
57 	protected void* getStruct()
58 	{
59 		return cast(void*)gstStaticPadTemplate;
60 	}
61 
62 	/**
63 	 * Sets our main struct and passes it to the parent class.
64 	 */
65 	public this (GstStaticPadTemplate* gstStaticPadTemplate, bool ownedRef = false)
66 	{
67 		this.gstStaticPadTemplate = gstStaticPadTemplate;
68 		this.ownedRef = ownedRef;
69 	}
70 
71 	~this ()
72 	{
73 		if ( Linker.isLoaded(LIBRARY_GSTREAMER) && ownedRef )
74 			g_free(gstStaticPadTemplate);
75 	}
76 
77 
78 	/**
79 	 * the name of the template
80 	 */
81 	public @property string nameTemplate()
82 	{
83 		return Str.toString(gstStaticPadTemplate.nameTemplate);
84 	}
85 
86 	/** Ditto */
87 	public @property void nameTemplate(string value)
88 	{
89 		gstStaticPadTemplate.nameTemplate = Str.toStringz(value);
90 	}
91 
92 	/**
93 	 * the direction of the template
94 	 */
95 	public @property GstPadDirection direction()
96 	{
97 		return gstStaticPadTemplate.direction;
98 	}
99 
100 	/** Ditto */
101 	public @property void direction(GstPadDirection value)
102 	{
103 		gstStaticPadTemplate.direction = value;
104 	}
105 
106 	/**
107 	 * the presence of the template
108 	 */
109 	public @property GstPadPresence presence()
110 	{
111 		return gstStaticPadTemplate.presence;
112 	}
113 
114 	/** Ditto */
115 	public @property void presence(GstPadPresence value)
116 	{
117 		gstStaticPadTemplate.presence = value;
118 	}
119 
120 	/**
121 	 * the caps of the template.
122 	 */
123 	public @property GstStaticCaps staticCaps()
124 	{
125 		return gstStaticPadTemplate.staticCaps;
126 	}
127 
128 	/** Ditto */
129 	public @property void staticCaps(GstStaticCaps value)
130 	{
131 		gstStaticPadTemplate.staticCaps = value;
132 	}
133 
134 	/**
135 	 * Converts a #GstStaticPadTemplate into a #GstPadTemplate.
136 	 *
137 	 * Returns: a new #GstPadTemplate.
138 	 */
139 	public PadTemplate get()
140 	{
141 		auto p = gst_static_pad_template_get(gstStaticPadTemplate);
142 
143 		if(p is null)
144 		{
145 			return null;
146 		}
147 
148 		return ObjectG.getDObject!(PadTemplate)(cast(GstPadTemplate*) p);
149 	}
150 
151 	/**
152 	 * Gets the capabilities of the static pad template.
153 	 *
154 	 * Returns: the #GstCaps of the static pad template.
155 	 *     Unref after usage. Since the core holds an additional
156 	 *     ref to the returned caps, use gst_caps_make_writable()
157 	 *     on the returned caps to modify it.
158 	 */
159 	public Caps getCaps()
160 	{
161 		auto p = gst_static_pad_template_get_caps(gstStaticPadTemplate);
162 
163 		if(p is null)
164 		{
165 			return null;
166 		}
167 
168 		return ObjectG.getDObject!(Caps)(cast(GstCaps*) p, true);
169 	}
170 }