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.ValueList;
26 
27 private import glib.MemorySlice;
28 private import gobject.ObjectG;
29 private import gobject.Value;
30 private import gstreamer.c.functions;
31 public  import gstreamer.c.types;
32 
33 
34 /**
35  * A fundamental type that describes an unordered list of #GValue
36  */
37 public class ValueList
38 {
39 	/** the main Gtk struct */
40 	protected GstValueList* gstValueList;
41 	protected bool ownedRef;
42 
43 	/** Get the main Gtk struct */
44 	public GstValueList* getValueListStruct(bool transferOwnership = false)
45 	{
46 		if (transferOwnership)
47 			ownedRef = false;
48 		return gstValueList;
49 	}
50 
51 	/** the main Gtk struct as a void* */
52 	protected void* getStruct()
53 	{
54 		return cast(void*)gstValueList;
55 	}
56 
57 	/**
58 	 * Sets our main struct and passes it to the parent class.
59 	 */
60 	public this (GstValueList* gstValueList, bool ownedRef = false)
61 	{
62 		this.gstValueList = gstValueList;
63 		this.ownedRef = ownedRef;
64 	}
65 
66 
67 	/** */
68 	public static GType getType()
69 	{
70 		return gst_value_list_get_type();
71 	}
72 
73 	/**
74 	 * Appends @append_value to the GstValueList in @value.
75 	 *
76 	 * Params:
77 	 *     value = a #GValue of type #GST_TYPE_LIST
78 	 *     appendValue = the value to append
79 	 *
80 	 * Since: 1.2
81 	 */
82 	public static void appendAndTakeValue(Value value, Value appendValue)
83 	{
84 		gst_value_list_append_and_take_value((value is null) ? null : value.getValueStruct(), (appendValue is null) ? null : appendValue.getValueStruct());
85 	}
86 
87 	/**
88 	 * Appends @append_value to the GstValueList in @value.
89 	 *
90 	 * Params:
91 	 *     value = a #GValue of type #GST_TYPE_LIST
92 	 *     appendValue = the value to append
93 	 */
94 	public static void appendValue(Value value, Value appendValue)
95 	{
96 		gst_value_list_append_value((value is null) ? null : value.getValueStruct(), (appendValue is null) ? null : appendValue.getValueStruct());
97 	}
98 
99 	/**
100 	 * Concatenates copies of @value1 and @value2 into a list.  Values that are not
101 	 * of type #GST_TYPE_LIST are treated as if they were lists of length 1.
102 	 * @dest will be initialized to the type #GST_TYPE_LIST.
103 	 *
104 	 * Params:
105 	 *     dest = an uninitialized #GValue to take the result
106 	 *     value1 = a #GValue
107 	 *     value2 = a #GValue
108 	 */
109 	public static void concat(out Value dest, Value value1, Value value2)
110 	{
111 		GValue* outdest = sliceNew!GValue();
112 
113 		gst_value_list_concat(outdest, (value1 is null) ? null : value1.getValueStruct(), (value2 is null) ? null : value2.getValueStruct());
114 
115 		dest = ObjectG.getDObject!(Value)(outdest, true);
116 	}
117 
118 	/**
119 	 * Gets the number of values contained in @value.
120 	 *
121 	 * Params:
122 	 *     value = a #GValue of type #GST_TYPE_LIST
123 	 *
124 	 * Returns: the number of values
125 	 */
126 	public static uint getSize(Value value)
127 	{
128 		return gst_value_list_get_size((value is null) ? null : value.getValueStruct());
129 	}
130 
131 	/**
132 	 * Gets the value that is a member of the list contained in @value and
133 	 * has the index @index.
134 	 *
135 	 * Params:
136 	 *     value = a #GValue of type #GST_TYPE_LIST
137 	 *     index = index of value to get from the list
138 	 *
139 	 * Returns: the value at the given index
140 	 */
141 	public static Value getValue(Value value, uint index)
142 	{
143 		auto __p = gst_value_list_get_value((value is null) ? null : value.getValueStruct(), index);
144 
145 		if(__p is null)
146 		{
147 			return null;
148 		}
149 
150 		return ObjectG.getDObject!(Value)(cast(GValue*) __p);
151 	}
152 
153 	/**
154 	 * Initializes and pre-allocates a #GValue of type #GST_VALUE_LIST.
155 	 *
156 	 * Params:
157 	 *     value = A zero-filled (uninitialized) #GValue structure
158 	 *     prealloc = The number of entries to pre-allocate in the list
159 	 *
160 	 * Returns: The #GValue structure that has been passed in
161 	 *
162 	 * Since: 1.18
163 	 */
164 	public static Value init(Value value, uint prealloc)
165 	{
166 		auto __p = gst_value_list_init((value is null) ? null : value.getValueStruct(), prealloc);
167 
168 		if(__p is null)
169 		{
170 			return null;
171 		}
172 
173 		return ObjectG.getDObject!(Value)(cast(GValue*) __p);
174 	}
175 
176 	/**
177 	 * Merges copies of @value1 and @value2.  Values that are not
178 	 * of type #GST_TYPE_LIST are treated as if they were lists of length 1.
179 	 *
180 	 * The result will be put into @dest and will either be a list that will not
181 	 * contain any duplicates, or a non-list type (if @value1 and @value2
182 	 * were equal).
183 	 *
184 	 * Params:
185 	 *     dest = an uninitialized #GValue to take the result
186 	 *     value1 = a #GValue
187 	 *     value2 = a #GValue
188 	 */
189 	public static void merge(out Value dest, Value value1, Value value2)
190 	{
191 		GValue* outdest = sliceNew!GValue();
192 
193 		gst_value_list_merge(outdest, (value1 is null) ? null : value1.getValueStruct(), (value2 is null) ? null : value2.getValueStruct());
194 
195 		dest = ObjectG.getDObject!(Value)(outdest, true);
196 	}
197 
198 	/**
199 	 * Prepends @prepend_value to the GstValueList in @value.
200 	 *
201 	 * Params:
202 	 *     value = a #GValue of type #GST_TYPE_LIST
203 	 *     prependValue = the value to prepend
204 	 */
205 	public static void prependValue(Value value, Value prependValue)
206 	{
207 		gst_value_list_prepend_value((value is null) ? null : value.getValueStruct(), (prependValue is null) ? null : prependValue.getValueStruct());
208 	}
209 }