I've no idea here...
[gtkD.git] / gtkD / srcgstreamer / gstreamer / MiniObject.d
blob0045f18663acc6cf236ee035ac9c21a2cf8187a8
1 /*
2 * This file is part of gtkD.
4 * gtkD is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; either version 2.1 of the License, or
7 * (at your option) any later version.
9 * gtkD is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with gtkD; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 // generated automatically - do not change
20 // find conversion definition on APILookup.txt
21 // implement new conversion functionalities on the wrap.utils pakage
24 * Conversion parameters:
25 * inFile = gstreamer-GstMiniObject.html
26 * outPack = gstreamer
27 * outFile = MiniObject
28 * strct = GstMiniObject
29 * realStrct=
30 * ctorStrct=
31 * clss = MiniObject
32 * interf =
33 * class Code: No
34 * interface Code: No
35 * template for:
36 * extend =
37 * implements:
38 * prefixes:
39 * - gst_mini_object_
40 * omit structs:
41 * omit prefixes:
42 * omit code:
43 * imports:
44 * - glib.Str
45 * - gobject.Value
46 * structWrap:
47 * - GValue* -> Value
48 * - GstMiniObject -> MiniObject
49 * - GstMiniObject* -> MiniObject
50 * module aliases:
51 * local aliases:
54 module gstreamer.MiniObject;
56 version(noAssert)
58 version(Tango)
60 import tango.io.Stdout; // use the tango loging?
64 private import gstreamerc.gstreamertypes;
66 private import gstreamerc.gstreamer;
69 private import glib.Str;
70 private import gobject.Value;
75 /**
76 * Description
77 * GstMiniObject is a baseclass like GObject, but has been stripped down of
78 * features to be fast and small.
79 * It offers sub-classing and ref-counting in the same way as GObject does.
80 * It has no properties and no signal-support though.
81 * Last reviewed on 2005-11-23 (0.9.5)
83 public class MiniObject
86 /** the main Gtk struct */
87 protected GstMiniObject* gstMiniObject;
90 public GstMiniObject* getMiniObjectStruct()
92 return gstMiniObject;
96 /** the main Gtk struct as a void* */
97 protected void* getStruct()
99 return cast(void*)gstMiniObject;
103 * Sets our main struct and passes it to the parent class
105 public this (GstMiniObject* gstMiniObject)
107 version(noAssert)
109 if ( gstMiniObject is null )
111 int zero = 0;
112 version(Tango)
114 Stdout("struct gstMiniObject is null on constructor").newline;
116 else
118 printf("struct gstMiniObject is null on constructor");
120 zero = zero / zero;
123 else
125 assert(gstMiniObject !is null, "struct gstMiniObject is null on constructor");
127 this.gstMiniObject = gstMiniObject;
144 * Creates a new mini-object of the desired type.
145 * MT safe
146 * type:
147 * the GType of the mini-object to create
148 * Returns:
149 * the new mini-object.
151 public this (GType type)
153 // GstMiniObject* gst_mini_object_new (GType type);
154 this(cast(GstMiniObject*)gst_mini_object_new(type) );
158 * Creates a copy of the mini-object.
159 * MT safe
160 * mini_object:
161 * the mini-object to copy
162 * Returns:
163 * the new mini-object.
165 public MiniObject copy()
167 // GstMiniObject* gst_mini_object_copy (const GstMiniObject *mini_object);
168 return new MiniObject( gst_mini_object_copy(gstMiniObject) );
172 * Checks if a mini-object is writable. A mini-object is writable
173 * if the reference count is one and the GST_MINI_OBJECT_FLAG_READONLY
174 * flag is not set. Modification of a mini-object should only be
175 * done after verifying that it is writable.
176 * MT safe
177 * mini_object:
178 * the mini-object to check
179 * Returns:
180 * TRUE if the object is writable.
182 public int isWritable()
184 // gboolean gst_mini_object_is_writable (const GstMiniObject *mini_object);
185 return gst_mini_object_is_writable(gstMiniObject);
189 * Checks if a mini-object is writable. If not, a writeable copy is made and
190 * returned. This gives away the reference to the original mini object,
191 * and returns a reference to the new object.
192 * MT safe
193 * mini_object:
194 * the mini-object to make writable
195 * Returns:
196 * a mini-object (possibly the same pointer) that is writable.
198 public MiniObject makeWritable()
200 // GstMiniObject* gst_mini_object_make_writable (GstMiniObject *mini_object);
201 return new MiniObject( gst_mini_object_make_writable(gstMiniObject) );
205 * Increase the reference count of the mini-object.
206 * Note that the refcount affects the writeability
207 * of mini-object, see gst_mini_object_is_writable(). It is
208 * important to note that keeping additional references to
209 * GstMiniObject instances can potentially increase the number
210 * of memcpy operations in a pipeline, especially if the minibject
211 * is a GstBuffer.
212 * mini_object:
213 * the mini-object
214 * Returns:
215 * the mini-object.
217 public MiniObject doref()
219 // GstMiniObject* gst_mini_object_ref (GstMiniObject *mini_object);
220 return new MiniObject( gst_mini_object_ref(gstMiniObject) );
224 * Decreases the reference count of the mini-object, possibly freeing
225 * the mini-object.
226 * mini_object:
227 * the mini-object
229 public void unref()
231 // void gst_mini_object_unref (GstMiniObject *mini_object);
232 gst_mini_object_unref(gstMiniObject);
236 * Modifies a pointer to point to a new mini-object. The modification
237 * is done atomically, and the reference counts are updated correctly.
238 * Either newdata and the value pointed to by olddata may be NULL.
239 * olddata:
240 * pointer to a pointer to a mini-object to be replaced
241 * newdata:
242 * pointer to new mini-object
244 public static void replace(GstMiniObject** olddata, MiniObject newdata)
246 // void gst_mini_object_replace (GstMiniObject **olddata, GstMiniObject *newdata);
247 gst_mini_object_replace(olddata, (newdata is null) ? null : newdata.getMiniObjectStruct());
251 * Creates a new GParamSpec instance that hold GstMiniObject references.
252 * name:
253 * the canonical name of the property
254 * nick:
255 * the nickname of the property
256 * blurb:
257 * a short description of the property
258 * object_type:
259 * the GstMiniObjectType for the property
260 * flags:
261 * a combination of GParamFlags
262 * Returns:
263 * a newly allocated GParamSpec instance
265 public static GParamSpec* gstParamSpecMiniObject(char[] name, char[] nick, char[] blurb, GType objectType, GParamFlags flags)
267 // GParamSpec* gst_param_spec_mini_object (const char *name, const char *nick, const char *blurb, GType object_type, GParamFlags flags);
268 return gst_param_spec_mini_object(Str.toStringz(name), Str.toStringz(nick), Str.toStringz(blurb), objectType, flags);
272 * Set the contents of a GST_TYPE_MINI_OBJECT derived GValue to
273 * mini_object.
274 * The caller retains ownership of the reference.
275 * value:
276 * a valid GValue of GST_TYPE_MINI_OBJECT derived type
277 * mini_object:
278 * mini object value to set
280 public static void gstValueSetMiniObject(Value value, MiniObject miniObject)
282 // void gst_value_set_mini_object (GValue *value, GstMiniObject *mini_object);
283 gst_value_set_mini_object((value is null) ? null : value.getValueStruct(), (miniObject is null) ? null : miniObject.getMiniObjectStruct());
287 * Set the contents of a GST_TYPE_MINI_OBJECT derived GValue to
288 * mini_object.
289 * Takes over the ownership of the caller's reference to mini_object;
290 * the caller doesn't have to unref it any more.
291 * value:
292 * a valid GValue of GST_TYPE_MINI_OBJECT derived type
293 * mini_object:
294 * mini object value to take
296 public static void gstValueTakeMiniObject(Value value, MiniObject miniObject)
298 // void gst_value_take_mini_object (GValue *value, GstMiniObject *mini_object);
299 gst_value_take_mini_object((value is null) ? null : value.getValueStruct(), (miniObject is null) ? null : miniObject.getMiniObjectStruct());
303 * Get the contents of a GST_TYPE_MINI_OBJECT derived GValue.
304 * Does not increase the refcount of the returned object.
305 * value:
306 * a valid GValue of GST_TYPE_MINI_OBJECT derived type
307 * Returns:
308 * mini object contents of value
310 public static MiniObject gstValueGetMiniObject(Value value)
312 // GstMiniObject* gst_value_get_mini_object (const GValue *value);
313 return new MiniObject( gst_value_get_mini_object((value is null) ? null : value.getValueStruct()) );