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