alternative to assert
[gtkD.git] / gtkD / srcgstreamer / gstreamer / MiniObject.d
blob941c9eb68ffb89427655f0fffb4e2ea9e3105da9
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 private import gstreamerc.gstreamertypes;
58 private import gstreamerc.gstreamer;
60 private import glib.Str;
61 private import gobject.Value;
65 /**
66 * Description
67 * GstMiniObject is a baseclass like GObject, but has been stripped down of
68 * features to be fast and small.
69 * It offers sub-classing and ref-counting in the same way as GObject does.
70 * It has no properties and no signal-support though.
71 * Last reviewed on 2005-11-23 (0.9.5)
73 public class MiniObject
76 /** the main Gtk struct */
77 protected GstMiniObject* gstMiniObject;
80 public GstMiniObject* getMiniObjectStruct()
82 return gstMiniObject;
86 /** the main Gtk struct as a void* */
87 protected void* getStruct()
89 return cast(void*)gstMiniObject;
92 /**
93 * Sets our main struct and passes it to the parent class
95 public this (GstMiniObject* gstMiniObject)
97 this.gstMiniObject = gstMiniObject;
114 * Creates a new mini-object of the desired type.
115 * MT safe
116 * type:
117 * the GType of the mini-object to create
118 * Returns:
119 * the new mini-object.
121 public this (GType type)
123 // GstMiniObject* gst_mini_object_new (GType type);
124 this(cast(GstMiniObject*)gst_mini_object_new(type) );
128 * Creates a copy of the mini-object.
129 * MT safe
130 * mini_object:
131 * the mini-object to copy
132 * Returns:
133 * the new mini-object.
135 public MiniObject copy()
137 // GstMiniObject* gst_mini_object_copy (const GstMiniObject *mini_object);
138 return new MiniObject( gst_mini_object_copy(gstMiniObject) );
142 * Checks if a mini-object is writable. A mini-object is writable
143 * if the reference count is one and the GST_MINI_OBJECT_FLAG_READONLY
144 * flag is not set. Modification of a mini-object should only be
145 * done after verifying that it is writable.
146 * MT safe
147 * mini_object:
148 * the mini-object to check
149 * Returns:
150 * TRUE if the object is writable.
152 public int isWritable()
154 // gboolean gst_mini_object_is_writable (const GstMiniObject *mini_object);
155 return gst_mini_object_is_writable(gstMiniObject);
159 * Checks if a mini-object is writable. If not, a writeable copy is made and
160 * returned. This gives away the reference to the original mini object,
161 * and returns a reference to the new object.
162 * MT safe
163 * mini_object:
164 * the mini-object to make writable
165 * Returns:
166 * a mini-object (possibly the same pointer) that is writable.
168 public MiniObject makeWritable()
170 // GstMiniObject* gst_mini_object_make_writable (GstMiniObject *mini_object);
171 return new MiniObject( gst_mini_object_make_writable(gstMiniObject) );
175 * Increase the reference count of the mini-object.
176 * Note that the refcount affects the writeability
177 * of mini-object, see gst_mini_object_is_writable(). It is
178 * important to note that keeping additional references to
179 * GstMiniObject instances can potentially increase the number
180 * of memcpy operations in a pipeline, especially if the minibject
181 * is a GstBuffer.
182 * mini_object:
183 * the mini-object
184 * Returns:
185 * the mini-object.
187 public MiniObject doref()
189 // GstMiniObject* gst_mini_object_ref (GstMiniObject *mini_object);
190 return new MiniObject( gst_mini_object_ref(gstMiniObject) );
194 * Decreases the reference count of the mini-object, possibly freeing
195 * the mini-object.
196 * mini_object:
197 * the mini-object
199 public void unref()
201 // void gst_mini_object_unref (GstMiniObject *mini_object);
202 gst_mini_object_unref(gstMiniObject);
206 * Modifies a pointer to point to a new mini-object. The modification
207 * is done atomically, and the reference counts are updated correctly.
208 * Either newdata and the value pointed to by olddata may be NULL.
209 * olddata:
210 * pointer to a pointer to a mini-object to be replaced
211 * newdata:
212 * pointer to new mini-object
214 public static void replace(GstMiniObject** olddata, MiniObject newdata)
216 // void gst_mini_object_replace (GstMiniObject **olddata, GstMiniObject *newdata);
217 gst_mini_object_replace(olddata, (newdata is null) ? null : newdata.getMiniObjectStruct());
221 * Creates a new GParamSpec instance that hold GstMiniObject references.
222 * name:
223 * the canonical name of the property
224 * nick:
225 * the nickname of the property
226 * blurb:
227 * a short description of the property
228 * object_type:
229 * the GstMiniObjectType for the property
230 * flags:
231 * a combination of GParamFlags
232 * Returns:
233 * a newly allocated GParamSpec instance
235 public static GParamSpec* gstParamSpecMiniObject(char[] name, char[] nick, char[] blurb, GType objectType, GParamFlags flags)
237 // GParamSpec* gst_param_spec_mini_object (const char *name, const char *nick, const char *blurb, GType object_type, GParamFlags flags);
238 return gst_param_spec_mini_object(Str.toStringz(name), Str.toStringz(nick), Str.toStringz(blurb), objectType, flags);
242 * Set the contents of a GST_TYPE_MINI_OBJECT derived GValue to
243 * mini_object.
244 * The caller retains ownership of the reference.
245 * value:
246 * a valid GValue of GST_TYPE_MINI_OBJECT derived type
247 * mini_object:
248 * mini object value to set
250 public static void gstValueSetMiniObject(Value value, MiniObject miniObject)
252 // void gst_value_set_mini_object (GValue *value, GstMiniObject *mini_object);
253 gst_value_set_mini_object((value is null) ? null : value.getValueStruct(), (miniObject is null) ? null : miniObject.getMiniObjectStruct());
257 * Set the contents of a GST_TYPE_MINI_OBJECT derived GValue to
258 * mini_object.
259 * Takes over the ownership of the caller's reference to mini_object;
260 * the caller doesn't have to unref it any more.
261 * value:
262 * a valid GValue of GST_TYPE_MINI_OBJECT derived type
263 * mini_object:
264 * mini object value to take
266 public static void gstValueTakeMiniObject(Value value, MiniObject miniObject)
268 // void gst_value_take_mini_object (GValue *value, GstMiniObject *mini_object);
269 gst_value_take_mini_object((value is null) ? null : value.getValueStruct(), (miniObject is null) ? null : miniObject.getMiniObjectStruct());
273 * Get the contents of a GST_TYPE_MINI_OBJECT derived GValue.
274 * Does not increase the refcount of the returned object.
275 * value:
276 * a valid GValue of GST_TYPE_MINI_OBJECT derived type
277 * Returns:
278 * mini object contents of value
280 public static MiniObject gstValueGetMiniObject(Value value)
282 // GstMiniObject* gst_value_get_mini_object (const GValue *value);
283 return new MiniObject( gst_value_get_mini_object((value is null) ? null : value.getValueStruct()) );