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  * Conversion parameters:
26  * inFile  = gstreamer-GstStructure.html
27  * outPack = gstreamer
28  * outFile = Structure
29  * strct   = GstStructure
30  * realStrct=
31  * ctorStrct=
32  * clss    = Structure
33  * interf  = 
34  * class Code: No
35  * interface Code: No
36  * template for:
37  * extend  = 
38  * implements:
39  * prefixes:
40  * 	- gst_structure_
41  * 	- gst_
42  * omit structs:
43  * omit prefixes:
44  * omit code:
45  * omit signals:
46  * imports:
47  * 	- glib.Str
48  * 	- glib.Date
49  * 	- gobject.Value
50  * structWrap:
51  * 	- GDate* -> Date
52  * 	- GValue* -> Value
53  * 	- GstStructure* -> Structure
54  * module aliases:
55  * local aliases:
56  * overrides:
57  * 	- toString
58  */
59 
60 module gstreamer.Structure;
61 
62 public  import gstreamerc.gstreamertypes;
63 
64 private import gstreamerc.gstreamer;
65 private import glib.ConstructionException;
66 private import gobject.ObjectG;
67 
68 
69 private import glib.Str;
70 private import glib.Date;
71 private import gobject.Value;
72 
73 
74 
75 
76 /**
77  * Description
78  * A GstStructure is a collection of key/value pairs. The keys are expressed
79  * as GQuarks and the values can be of any GType.
80  * In addition to the key/value pairs, a GstStructure also has a name.
81  * GstStructure is used by various GStreamer subsystems to store information
82  * in a flexible and extensible way. A GstStructure does not have a refcount
83  * because it usually is part of a higher level object such as GstCaps. It
84  * provides a means to enforce mutability using the refcount of the parent
85  * with the gst_structure_set_parent_refcount() method.
86  * A GstStructure can be created with gst_structure_empty_new() or
87  * gst_structure_new(), which both take a name and an optional set of
88  * key/value pairs along with the types of the values.
89  * Field values can be changed with gst_structure_set_value() or
90  * gst_structure_set().
91  * Field values can be retrieved with gst_structure_get_value() or the more
92  * convenient gst_structure_get_*() functions.
93  * Fields can be removed with gst_structure_remove_field() or
94  * gst_structure_remove_fields().
95  * Last reviewed on 2005-11-09 (0.9.4)
96  */
97 public class Structure
98 {
99 	
100 	/** the main Gtk struct */
101 	protected GstStructure* gstStructure;
102 	
103 	
104 	public GstStructure* getStructureStruct()
105 	{
106 		return gstStructure;
107 	}
108 	
109 	
110 	/** the main Gtk struct as a void* */
111 	protected void* getStruct()
112 	{
113 		return cast(void*)gstStructure;
114 	}
115 	
116 	/**
117 	 * Sets our main struct and passes it to the parent class
118 	 */
119 	public this (GstStructure* gstStructure)
120 	{
121 		this.gstStructure = gstStructure;
122 	}
123 	
124 	/**
125 	 */
126 	
127 	/**
128 	 * Creates a new, empty GstStructure with the given name.
129 	 * Params:
130 	 * name = name of new structure
131 	 * Returns: a new, empty GstStructure
132 	 */
133 	public static Structure emptyNew(string name)
134 	{
135 		// GstStructure* gst_structure_empty_new (const gchar *name);
136 		auto p = gst_structure_empty_new(Str.toStringz(name));
137 		
138 		if(p is null)
139 		{
140 			return null;
141 		}
142 		
143 		return ObjectG.getDObject!(Structure)(cast(GstStructure*) p);
144 	}
145 	
146 	/**
147 	 * Creates a new, empty GstStructure with the given name as a GQuark.
148 	 * Params:
149 	 * quark = name of new structure
150 	 * Returns: a new, empty GstStructure
151 	 */
152 	public static Structure idEmptyNew(GQuark quark)
153 	{
154 		// GstStructure* gst_structure_id_empty_new (GQuark quark);
155 		auto p = gst_structure_id_empty_new(quark);
156 		
157 		if(p is null)
158 		{
159 			return null;
160 		}
161 		
162 		return ObjectG.getDObject!(Structure)(cast(GstStructure*) p);
163 	}
164 	
165 	/**
166 	 * Creates a new GstStructure with the given name. Structure fields
167 	 * are set according to the varargs in a manner similar to
168 	 * gst_structure_new.
169 	 * Params:
170 	 * name = name of new structure
171 	 * firstfield = name of first field to set
172 	 * varargs = variable argument list
173 	 * Throws: ConstructionException GTK+ fails to create the object.
174 	 */
175 	public this (string name, string firstfield, void* varargs)
176 	{
177 		// GstStructure* gst_structure_new_valist (const gchar *name,  const gchar *firstfield,  va_list varargs);
178 		auto p = gst_structure_new_valist(Str.toStringz(name), Str.toStringz(firstfield), varargs);
179 		if(p is null)
180 		{
181 			throw new ConstructionException("null returned by gst_structure_new_valist(Str.toStringz(name), Str.toStringz(firstfield), varargs)");
182 		}
183 		this(cast(GstStructure*) p);
184 	}
185 	
186 	/**
187 	 * Duplicates a GstStructure and all its fields and values.
188 	 * Returns: a new GstStructure.
189 	 */
190 	public Structure copy()
191 	{
192 		// GstStructure* gst_structure_copy (const GstStructure *structure);
193 		auto p = gst_structure_copy(gstStructure);
194 		
195 		if(p is null)
196 		{
197 			return null;
198 		}
199 		
200 		return ObjectG.getDObject!(Structure)(cast(GstStructure*) p);
201 	}
202 	
203 	/**
204 	 * Frees a GstStructure and all its fields and values. The structure must not
205 	 * have a parent when this function is called.
206 	 */
207 	public void free()
208 	{
209 		// void gst_structure_free (GstStructure *structure);
210 		gst_structure_free(gstStructure);
211 	}
212 	
213 	/**
214 	 * Get the name of structure as a string.
215 	 * Returns: the name of the structure.
216 	 */
217 	public string getName()
218 	{
219 		// const gchar* gst_structure_get_name (const GstStructure *structure);
220 		return Str.toString(gst_structure_get_name(gstStructure));
221 	}
222 	
223 	/**
224 	 * Checks if the structure has the given name
225 	 * Params:
226 	 * name = structure name to check for
227 	 * Returns: TRUE if name matches the name of the structure.
228 	 */
229 	public int hasName(string name)
230 	{
231 		// gboolean gst_structure_has_name (const GstStructure *structure,  const gchar *name);
232 		return gst_structure_has_name(gstStructure, Str.toStringz(name));
233 	}
234 	
235 	/**
236 	 * Sets the name of the structure to the given name. The string
237 	 * provided is copied before being used.
238 	 * Params:
239 	 * name = the new name of the structure
240 	 */
241 	public void setName(string name)
242 	{
243 		// void gst_structure_set_name (GstStructure *structure,  const gchar *name);
244 		gst_structure_set_name(gstStructure, Str.toStringz(name));
245 	}
246 	
247 	/**
248 	 * Get the name of structure as a GQuark.
249 	 * Returns: the quark representing the name of the structure.
250 	 */
251 	public GQuark getNameId()
252 	{
253 		// GQuark gst_structure_get_name_id (const GstStructure *structure);
254 		return gst_structure_get_name_id(gstStructure);
255 	}
256 	
257 	/**
258 	 * Get the value of the field with GQuark field.
259 	 * Params:
260 	 * field = the GQuark of the field to get
261 	 * Returns: the GValue corresponding to the field with the given name identifier.
262 	 */
263 	public Value idGetValue(GQuark field)
264 	{
265 		// const GValue* gst_structure_id_get_value (const GstStructure *structure,  GQuark field);
266 		auto p = gst_structure_id_get_value(gstStructure, field);
267 		
268 		if(p is null)
269 		{
270 			return null;
271 		}
272 		
273 		return ObjectG.getDObject!(Value)(cast(GValue*) p);
274 	}
275 	
276 	/**
277 	 * Sets the field with the given GQuark field to value. If the field
278 	 * does not exist, it is created. If the field exists, the previous
279 	 * value is replaced and freed.
280 	 * Params:
281 	 * field = a GQuark representing a field
282 	 * value = the new value of the field
283 	 */
284 	public void idSetValue(GQuark field, Value value)
285 	{
286 		// void gst_structure_id_set_value (GstStructure *structure,  GQuark field,  const GValue *value);
287 		gst_structure_id_set_value(gstStructure, field, (value is null) ? null : value.getValueStruct());
288 	}
289 	
290 	/**
291 	 * Get the value of the field with name fieldname.
292 	 * Params:
293 	 * fieldname = the name of the field to get
294 	 * Returns: the GValue corresponding to the field with the given name.
295 	 */
296 	public Value getValue(string fieldname)
297 	{
298 		// const GValue* gst_structure_get_value (const GstStructure *structure,  const gchar *fieldname);
299 		auto p = gst_structure_get_value(gstStructure, Str.toStringz(fieldname));
300 		
301 		if(p is null)
302 		{
303 			return null;
304 		}
305 		
306 		return ObjectG.getDObject!(Value)(cast(GValue*) p);
307 	}
308 	
309 	/**
310 	 * Sets the field with the given name field to value. If the field
311 	 * does not exist, it is created. If the field exists, the previous
312 	 * value is replaced and freed.
313 	 * Params:
314 	 * fieldname = the name of the field to set
315 	 * value = the new value of the field
316 	 */
317 	public void setValue(string fieldname, Value value)
318 	{
319 		// void gst_structure_set_value (GstStructure *structure,  const gchar *fieldname,  const GValue *value);
320 		gst_structure_set_value(gstStructure, Str.toStringz(fieldname), (value is null) ? null : value.getValueStruct());
321 	}
322 	
323 	/**
324 	 * va_list form of gst_structure_set().
325 	 * Params:
326 	 * fieldname = the name of the field to set
327 	 * varargs = variable arguments
328 	 */
329 	public void setValist(string fieldname, void* varargs)
330 	{
331 		// void gst_structure_set_valist (GstStructure *structure,  const gchar *fieldname,  va_list varargs);
332 		gst_structure_set_valist(gstStructure, Str.toStringz(fieldname), varargs);
333 	}
334 	
335 	/**
336 	 * va_list form of gst_structure_id_set().
337 	 * Params:
338 	 * fieldname = the name of the field to set
339 	 * varargs = variable arguments
340 	 * Since 0.10.10
341 	 */
342 	public void idSetValist(GQuark fieldname, void* varargs)
343 	{
344 		// void gst_structure_id_set_valist (GstStructure *structure,  GQuark fieldname,  va_list varargs);
345 		gst_structure_id_set_valist(gstStructure, fieldname, varargs);
346 	}
347 	
348 	/**
349 	 * Removes the field with the given name. If the field with the given
350 	 * name does not exist, the structure is unchanged.
351 	 * Params:
352 	 * fieldname = the name of the field to remove
353 	 */
354 	public void removeField(string fieldname)
355 	{
356 		// void gst_structure_remove_field (GstStructure *structure,  const gchar *fieldname);
357 		gst_structure_remove_field(gstStructure, Str.toStringz(fieldname));
358 	}
359 	
360 	/**
361 	 * va_list form of gst_structure_remove_fields().
362 	 * Params:
363 	 * fieldname = the name of the field to remove
364 	 * varargs = NULL-terminated list of more fieldnames to remove
365 	 */
366 	public void removeFieldsValist(string fieldname, void* varargs)
367 	{
368 		// void gst_structure_remove_fields_valist (GstStructure *structure,  const gchar *fieldname,  va_list varargs);
369 		gst_structure_remove_fields_valist(gstStructure, Str.toStringz(fieldname), varargs);
370 	}
371 	
372 	/**
373 	 * Removes all fields in a GstStructure.
374 	 */
375 	public void removeAllFields()
376 	{
377 		// void gst_structure_remove_all_fields (GstStructure *structure);
378 		gst_structure_remove_all_fields(gstStructure);
379 	}
380 	
381 	/**
382 	 * Finds the field with the given name, and returns the type of the
383 	 * value it contains. If the field is not found, G_TYPE_INVALID is
384 	 * returned.
385 	 * Params:
386 	 * fieldname = the name of the field
387 	 * Returns: the GValue of the field
388 	 */
389 	public GType getFieldType(string fieldname)
390 	{
391 		// GType gst_structure_get_field_type (const GstStructure *structure,  const gchar *fieldname);
392 		return gst_structure_get_field_type(gstStructure, Str.toStringz(fieldname));
393 	}
394 	
395 	/**
396 	 * Calls the provided function once for each field in the GstStructure. The
397 	 * function must not modify the fields. Also see gst_structure_map_in_place().
398 	 * Params:
399 	 * func = a function to call for each field
400 	 * userData = private data
401 	 * Returns: TRUE if the supplied function returns TRUE For each of the fields, FALSE otherwise.
402 	 */
403 	public int foreac(GstStructureForeachFunc func, void* userData)
404 	{
405 		// gboolean gst_structure_foreach (const GstStructure *structure,  GstStructureForeachFunc func,  gpointer user_data);
406 		return gst_structure_foreach(gstStructure, func, userData);
407 	}
408 	
409 	/**
410 	 * Get the number of fields in the structure.
411 	 * Returns: the number of fields in the structure
412 	 */
413 	public int nFields()
414 	{
415 		// gint gst_structure_n_fields (const GstStructure *structure);
416 		return gst_structure_n_fields(gstStructure);
417 	}
418 	
419 	/**
420 	 * Check if structure contains a field named fieldname.
421 	 * Params:
422 	 * fieldname = the name of a field
423 	 * Returns: TRUE if the structure contains a field with the given name
424 	 */
425 	public int hasField(string fieldname)
426 	{
427 		// gboolean gst_structure_has_field (const GstStructure *structure,  const gchar *fieldname);
428 		return gst_structure_has_field(gstStructure, Str.toStringz(fieldname));
429 	}
430 	
431 	/**
432 	 * Check if structure contains a field named fieldname and with GType type.
433 	 * Params:
434 	 * fieldname = the name of a field
435 	 * type = the type of a value
436 	 * Returns: TRUE if the structure contains a field with the given name and type
437 	 */
438 	public int hasFieldTyped(string fieldname, GType type)
439 	{
440 		// gboolean gst_structure_has_field_typed (const GstStructure *structure,  const gchar *fieldname,  GType type);
441 		return gst_structure_has_field_typed(gstStructure, Str.toStringz(fieldname), type);
442 	}
443 	
444 	/**
445 	 * Sets the boolean pointed to by value corresponding to the value of the
446 	 * given field. Caller is responsible for making sure the field exists
447 	 * and has the correct type.
448 	 * Params:
449 	 * fieldname = the name of a field
450 	 * value = a pointer to a gboolean to set
451 	 * Returns: TRUE if the value could be set correctly. If there was no field with fieldname or the existing field did not contain a boolean, this function returns FALSE.
452 	 */
453 	public int getBoolean(string fieldname, out int value)
454 	{
455 		// gboolean gst_structure_get_boolean (const GstStructure *structure,  const gchar *fieldname,  gboolean *value);
456 		return gst_structure_get_boolean(gstStructure, Str.toStringz(fieldname), &value);
457 	}
458 	
459 	/**
460 	 * Sets the int pointed to by value corresponding to the value of the
461 	 * given field. Caller is responsible for making sure the field exists
462 	 * and has the correct type.
463 	 * Returns: TRUE if the value could be set correctly. If there was no field
464 	 * with fieldname or the existing field did not contain an int, this function
465 	 * Params:
466 	 * fieldname = the name of a field
467 	 * value = a pointer to an int to set
468 	 * Returns: FALSE.
469 	 */
470 	public int getInt(string fieldname, out int value)
471 	{
472 		// gboolean gst_structure_get_int (const GstStructure *structure,  const gchar *fieldname,  gint *value);
473 		return gst_structure_get_int(gstStructure, Str.toStringz(fieldname), &value);
474 	}
475 	
476 	/**
477 	 * Sets the GstFourcc pointed to by value corresponding to the value of the
478 	 * given field. Caller is responsible for making sure the field exists
479 	 * and has the correct type.
480 	 * Returns: TRUE if the value could be set correctly. If there was no field
481 	 * with fieldname or the existing field did not contain a fourcc, this function
482 	 * Params:
483 	 * fieldname = the name of a field
484 	 * value = a pointer to a GstFourcc to set
485 	 * Returns: FALSE.
486 	 */
487 	public int getFourcc(string fieldname, out uint value)
488 	{
489 		// gboolean gst_structure_get_fourcc (const GstStructure *structure,  const gchar *fieldname,  guint32 *value);
490 		return gst_structure_get_fourcc(gstStructure, Str.toStringz(fieldname), &value);
491 	}
492 	
493 	/**
494 	 * Sets the double pointed to by value corresponding to the value of the
495 	 * given field. Caller is responsible for making sure the field exists
496 	 * and has the correct type.
497 	 * Params:
498 	 * fieldname = the name of a field
499 	 * value = a pointer to a GstFourcc to set
500 	 * Returns: TRUE if the value could be set correctly. If there was no field with fieldname or the existing field did not contain a double, this function returns FALSE.
501 	 */
502 	public int getDouble(string fieldname, out double value)
503 	{
504 		// gboolean gst_structure_get_double (const GstStructure *structure,  const gchar *fieldname,  gdouble *value);
505 		return gst_structure_get_double(gstStructure, Str.toStringz(fieldname), &value);
506 	}
507 	
508 	/**
509 	 * Finds the field corresponding to fieldname, and returns the string
510 	 * contained in the field's value. Caller is responsible for making
511 	 * sure the field exists and has the correct type.
512 	 * The string should not be modified, and remains valid until the next
513 	 * call to a gst_structure_*() function with the given structure.
514 	 * Params:
515 	 * fieldname = the name of a field
516 	 * Returns: a pointer to the string or NULL when the field did not exist or did not contain a string.
517 	 */
518 	public string getString(string fieldname)
519 	{
520 		// const gchar* gst_structure_get_string (const GstStructure *structure,  const gchar *fieldname);
521 		return Str.toString(gst_structure_get_string(gstStructure, Str.toStringz(fieldname)));
522 	}
523 	
524 	/**
525 	 * Sets the date pointed to by value corresponding to the date of the
526 	 * given field. Caller is responsible for making sure the field exists
527 	 * and has the correct type.
528 	 * Returns: TRUE if the value could be set correctly. If there was no field
529 	 * with fieldname or the existing field did not contain a data, this function
530 	 * Params:
531 	 * fieldname = the name of a field
532 	 * value = a pointer to a GDate to set
533 	 * Returns: FALSE.
534 	 */
535 	public int getDate(string fieldname, out Date value)
536 	{
537 		// gboolean gst_structure_get_date (const GstStructure *structure,  const gchar *fieldname,  GDate **value);
538 		GDate* outvalue = null;
539 		
540 		auto p = gst_structure_get_date(gstStructure, Str.toStringz(fieldname), &outvalue);
541 		
542 		value = ObjectG.getDObject!(Date)(outvalue);
543 		return p;
544 	}
545 	
546 	/**
547 	 * Sets the clock time pointed to by value corresponding to the clock time
548 	 * of the given field. Caller is responsible for making sure the field exists
549 	 * and has the correct type.
550 	 * Params:
551 	 * fieldname = the name of a field
552 	 * value = a pointer to a GstClockTime to set
553 	 * Returns: TRUE if the value could be set correctly. If there was no field with fieldname or the existing field did not contain a GstClockTime, this function returns FALSE.
554 	 */
555 	public int getClockTime(string fieldname, out GstClockTime value)
556 	{
557 		// gboolean gst_structure_get_clock_time (const GstStructure *structure,  const gchar *fieldname,  GstClockTime *value);
558 		return gst_structure_get_clock_time(gstStructure, Str.toStringz(fieldname), &value);
559 	}
560 	
561 	/**
562 	 * Sets the int pointed to by value corresponding to the value of the
563 	 * given field. Caller is responsible for making sure the field exists,
564 	 * has the correct type and that the enumtype is correct.
565 	 * Params:
566 	 * fieldname = the name of a field
567 	 * enumtype = the enum type of a field
568 	 * value = a pointer to an int to set
569 	 * Returns: TRUE if the value could be set correctly. If there was no field with fieldname or the existing field did not contain an enum of the given type, this function returns FALSE.
570 	 */
571 	public int getEnum(string fieldname, GType enumtype, out int value)
572 	{
573 		// gboolean gst_structure_get_enum (const GstStructure *structure,  const gchar *fieldname,  GType enumtype,  gint *value);
574 		return gst_structure_get_enum(gstStructure, Str.toStringz(fieldname), enumtype, &value);
575 	}
576 	
577 	/**
578 	 * Sets the integers pointed to by value_numerator and value_denominator
579 	 * corresponding to the value of the given field. Caller is responsible
580 	 * for making sure the field exists and has the correct type.
581 	 * Params:
582 	 * fieldname = the name of a field
583 	 * valueNumerator = a pointer to an int to set
584 	 * valueDenominator = a pointer to an int to set
585 	 * Returns: TRUE if the values could be set correctly. If there was no field with fieldname or the existing field did not contain a GstFraction, this function returns FALSE.
586 	 */
587 	public int getFraction(string fieldname, out int valueNumerator, out int valueDenominator)
588 	{
589 		// gboolean gst_structure_get_fraction (const GstStructure *structure,  const gchar *fieldname,  gint *value_numerator,  gint *value_denominator);
590 		return gst_structure_get_fraction(gstStructure, Str.toStringz(fieldname), &valueNumerator, &valueDenominator);
591 	}
592 	
593 	/**
594 	 * Calls the provided function once for each field in the GstStructure. In
595 	 * contrast to gst_structure_foreach(), the function may modify but not delete the
596 	 * fields. The structure must be mutable.
597 	 * Params:
598 	 * func = a function to call for each field
599 	 * userData = private data
600 	 * Returns: TRUE if the supplied function returns TRUE For each of the fields, FALSE otherwise.
601 	 */
602 	public int mapInPlace(GstStructureMapFunc func, void* userData)
603 	{
604 		// gboolean gst_structure_map_in_place (GstStructure *structure,  GstStructureMapFunc func,  gpointer user_data);
605 		return gst_structure_map_in_place(gstStructure, func, userData);
606 	}
607 	
608 	/**
609 	 * Get the name of the given field number, counting from 0 onwards.
610 	 * Params:
611 	 * index = the index to get the name of
612 	 * Returns: the name of the given field number
613 	 */
614 	public string nthFieldName(uint index)
615 	{
616 		// const gchar* gst_structure_nth_field_name (const GstStructure *structure,  guint index);
617 		return Str.toString(gst_structure_nth_field_name(gstStructure, index));
618 	}
619 	
620 	/**
621 	 * Sets the parent_refcount field of GstStructure. This field is used to
622 	 * determine whether a structure is mutable or not. This function should only be
623 	 * called by code implementing parent objects of GstStructure, as described in
624 	 * the MT Refcounting section of the design documents.
625 	 * Params:
626 	 * refcount = a pointer to the parent's refcount
627 	 */
628 	public void setParentRefcount(int* refcount)
629 	{
630 		// void gst_structure_set_parent_refcount (GstStructure *structure,  gint *refcount);
631 		gst_structure_set_parent_refcount(gstStructure, refcount);
632 	}
633 	
634 	/**
635 	 * Converts structure to a human-readable string representation.
636 	 * Returns: a pointer to string allocated by g_malloc(). g_free() after usage.
637 	 */
638 	public override string toString()
639 	{
640 		// gchar* gst_structure_to_string (const GstStructure *structure);
641 		return Str.toString(gst_structure_to_string(gstStructure));
642 	}
643 	
644 	/**
645 	 * Creates a GstStructure from a string representation.
646 	 * If end is not NULL, a pointer to the place inside the given string
647 	 * where parsing ended will be returned.
648 	 * Params:
649 	 * string = a string representation of a GstStructure.
650 	 * end = pointer to store the end of the string in.
651 	 * Returns: a new GstStructure or NULL when the string could not be parsed. Free after usage.
652 	 */
653 	public static Structure fromString(string string, out string end)
654 	{
655 		// GstStructure* gst_structure_from_string (const gchar *string,  gchar **end);
656 		char* outend = null;
657 		
658 		auto p = gst_structure_from_string(Str.toStringz(string), &outend);
659 		
660 		end = Str.toString(outend);
661 		
662 		if(p is null)
663 		{
664 			return null;
665 		}
666 		
667 		return ObjectG.getDObject!(Structure)(cast(GstStructure*) p);
668 	}
669 	
670 	/**
671 	 * Fixates a GstStructure by changing the given field to the nearest
672 	 * integer to target that is a subset of the existing field.
673 	 * Params:
674 	 * fieldName = a field in structure
675 	 * target = the target value of the fixation
676 	 * Returns: TRUE if the structure could be fixated
677 	 */
678 	public int fixateFieldNearestInt(string fieldName, int target)
679 	{
680 		// gboolean gst_structure_fixate_field_nearest_int  (GstStructure *structure,  const char *field_name,  int target);
681 		return gst_structure_fixate_field_nearest_int(gstStructure, Str.toStringz(fieldName), target);
682 	}
683 	
684 	/**
685 	 * Fixates a GstStructure by changing the given field to the nearest
686 	 * double to target that is a subset of the existing field.
687 	 * Params:
688 	 * fieldName = a field in structure
689 	 * target = the target value of the fixation
690 	 * Returns: TRUE if the structure could be fixated
691 	 */
692 	public int fixateFieldNearestDouble(string fieldName, double target)
693 	{
694 		// gboolean gst_structure_fixate_field_nearest_double  (GstStructure *structure,  const char *field_name,  double target);
695 		return gst_structure_fixate_field_nearest_double(gstStructure, Str.toStringz(fieldName), target);
696 	}
697 	
698 	/**
699 	 * Fixates a GstStructure by changing the given field to the nearest
700 	 * fraction to target_numerator/target_denominator that is a subset
701 	 * of the existing field.
702 	 * Params:
703 	 * fieldName = a field in structure
704 	 * targetNumerator = The numerator of the target value of the fixation
705 	 * targetDenominator = The denominator of the target value of the fixation
706 	 * Returns: TRUE if the structure could be fixated
707 	 */
708 	public int fixateFieldNearestFraction(string fieldName, int targetNumerator, int targetDenominator)
709 	{
710 		// gboolean gst_structure_fixate_field_nearest_fraction  (GstStructure *structure,  const char *field_name,  const gint target_numerator,  const gint target_denominator);
711 		return gst_structure_fixate_field_nearest_fraction(gstStructure, Str.toStringz(fieldName), targetNumerator, targetDenominator);
712 	}
713 	
714 	/**
715 	 * Fixates a GstStructure by changing the given field_name field to the given
716 	 * target boolean if that field is not fixed yet.
717 	 * Params:
718 	 * fieldName = a field in structure
719 	 * target = the target value of the fixation
720 	 * Returns: TRUE if the structure could be fixated
721 	 */
722 	public int fixateFieldBoolean(string fieldName, int target)
723 	{
724 		// gboolean gst_structure_fixate_field_boolean (GstStructure *structure,  const char *field_name,  gboolean target);
725 		return gst_structure_fixate_field_boolean(gstStructure, Str.toStringz(fieldName), target);
726 	}
727 }