Debian Codegraph @

gstreamer/gstreamermm/childproxy.h

raw symbols SCIP
1 // Generated by gmmproc 2.50.1 -- DO NOT MODIFY!
2 #ifndef _GSTREAMERMM_CHILDPROXY_H
3 #define _GSTREAMERMM_CHILDPROXY_H
4
5
6 #include <glibmm/ustring.h>
7 #include <sigc++/sigc++.h>
8
9 /* gstreamermm - a C++ wrapper for gstreamer
10 *
11 * Copyright 2008-2016 The gstreamermm Development Team
12 *
13 * This library is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU Lesser General Public
15 * License as published by the Free Software Foundation; either
16 * version 2.1 of the License, or (at your option) any later version.
17 *
18 * This library is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 * Lesser General Public License for more details.
22 *
23 * You should have received a copy of the GNU Lesser General Public
24 * License along with this library; if not, write to the Free
25 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26 */
27
28 #include <gst/gstchildproxy.h>
29 #include <glibmm/interface.h>
30
31
32 #ifndef DOXYGEN_SHOULD_SKIP_THIS
33 using GstChildProxy = struct _GstChildProxy;
34 using GstChildProxyClass = struct _GstChildProxyClass;
35 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
36
37
38 #ifndef DOXYGEN_SHOULD_SKIP_THIS
39 namespace Gst
40 { class ChildProxy_Class; } // namespace Gst
41 #endif // DOXYGEN_SHOULD_SKIP_THIS
42
43 namespace Gst
44 {
45
46 class Object;
47
48 /**
49 * Interface for multi child elements.
50 *
51 * This interface abstracts handling of property sets for elements with
52 * children. Imagine elements such as mixers or polyphonic generators. They all
53 * have multiple Gst::Pad or some kind of voice objects. Another use case are
54 * container elements like Gst::Bin.
55 * The element implementing the interface acts as a parent for those child
56 * objects.
57 *
58 * By implementing this interface the child properties can be accessed from the
59 * parent element by using get_proxy_property() and set_proxy_property().
60 *
61 * Property names are written as "child-name::property-name". The whole naming
62 * scheme is recursive. Thus "child1::child2::property" is valid too, if
63 * "child1" and "child2" implement the Gst::ChildProxy interface.
64 *
65 * Last reviewed on 2016-05-16 (1.8.0)
66 *
67 * @ingroup GstInterfaces
68 */
69
70 class ChildProxy : public Glib::Interface
71 {
72
73 #ifndef DOXYGEN_SHOULD_SKIP_THIS
74
75 public:
76 using CppObjectType = ChildProxy;
77 using CppClassType = ChildProxy_Class;
78 using BaseObjectType = GstChildProxy;
79 using BaseClassType = GstChildProxyInterface;
80
81 // noncopyable
82 ChildProxy(const ChildProxy&) = delete;
83 ChildProxy& operator=(const ChildProxy&) = delete;
84
85 private:
86 friend class ChildProxy_Class;
87 static CppClassType childproxy_class_;
88
89 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
90 protected:
91 /**
92 * You should derive from this class to use it.
93 */
94 ChildProxy();
95
96 #ifndef DOXYGEN_SHOULD_SKIP_THIS
97 /** Called by constructors of derived classes. Provide the result of
98 * the Class init() function to ensure that it is properly
99 * initialized.
100 *
101 * @param interface_class The Class object for the derived type.
102 */
103 explicit ChildProxy(const Glib::Interface_Class& interface_class);
104
105 public:
106 // This is public so that C++ wrapper instances can be
107 // created for C instances of unwrapped types.
108 // For instance, if an unexpected C type implements the C interface.
109 explicit ChildProxy(GstChildProxy* castitem);
110
111 protected:
112 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
113
114 public:
115
116 ChildProxy(ChildProxy&& src) noexcept;
117 ChildProxy& operator=(ChildProxy&& src) noexcept;
118
119 ~ChildProxy() noexcept override;
120
121 static void add_interface(GType gtype_implementer);
122
123 /** Get the GType for this class, for use with the underlying GObject type system.
124 */
125 static GType get_type() G_GNUC_CONST;
126
127 #ifndef DOXYGEN_SHOULD_SKIP_THIS
128 static GType get_base_type() G_GNUC_CONST;
129 #endif
130
131 ///Provides access to the underlying C GObject.
132 GstChildProxy* gobj() { return reinterpret_cast<GstChildProxy*>(gobject_); }
133
134 ///Provides access to the underlying C GObject.
135 const GstChildProxy* gobj() const { return reinterpret_cast<GstChildProxy*>(gobject_); }
136
137 private:
138
139
140 public:
141
142 /** Gets the number of child objects this parent contains.
143 *
144 * @return The number of child objects
145 *
146 * MT safe.
147 */
148 guint get_children_count() const;
149
150
151 /** Looks up a child element by the given name.
152 *
153 * This virtual method has a default implementation that uses Gst::Object
154 * together with Gst::Object::get_name(). If the interface is to be used with
155 * Objects, this methods needs to be overridden.
156 *
157 * @param name The child's name.
158 * @return The child object or <tt>nullptr</tt> if
159 * not found. Unref after usage.
160 *
161 * MT safe.
162 */
163 Glib::RefPtr<Gst::Object> get_child(const Glib::ustring& name);
164
165 /** Looks up a child element by the given name.
166 *
167 * This virtual method has a default implementation that uses Gst::Object
168 * together with Gst::Object::get_name(). If the interface is to be used with
169 * Objects, this methods needs to be overridden.
170 *
171 * @param name The child's name.
172 * @return The child object or <tt>nullptr</tt> if
173 * not found. Unref after usage.
174 *
175 * MT safe.
176 */
177 Glib::RefPtr<const Gst::Object> get_child(const Glib::ustring& name) const;
178
179
180 /** Fetches a child by its number.
181 *
182 * @param index The child's position in the child list.
183 * @return The child object or <tt>nullptr</tt> if
184 * not found (index too high). Unref after usage.
185 *
186 * MT safe.
187 */
188 Glib::RefPtr<Glib::Object> get_child(guint index);
189
190 /** Fetches a child by its number.
191 *
192 * @param index The child's position in the child list.
193 * @return The child object or <tt>nullptr</tt> if
194 * not found (index too high). Unref after usage.
195 *
196 * MT safe.
197 */
198 Glib::RefPtr<const Glib::Object> get_child(guint index) const;
199
200
201 /** Looks up which object and ParamSpec would be effected by the given @a name.
202 *
203 * MT safe.
204 *
205 * @param name Name of the property to look up.
206 * @param target Pointer to a Object that
207 * takes the real object to set property on.
208 * @param pspec Pointer to take the ParamSpec
209 * describing the property.
210 * @return <tt>true</tt> if @a target and @a pspec could be found. <tt>false</tt> otherwise. In that
211 * case the values for @a pspec and @a target are not modified. Unref @a target after
212 * usage. For plain GObjects @a target is the same as @a object.
213 */
214
215 //TODO: Maybe GParamSpec should be wrapped in glibmm?
216 bool lookup(const Glib::ustring& name, Glib::RefPtr<Glib::Object>& target, GParamSpec*& pspec);
217
218 /** Gets a single property using the Gst::ChildProxy mechanism.
219 * @param name The property to get.
220 * @param value An empty Glib::ValueBase in which to store the property.
221 * @return This Gst::ChildProxy so more properties can be retrieved if
222 * needed.
223 */
224 Glib::RefPtr<Gst::ChildProxy> get_proxy_property(const Glib::ustring& name, Glib::ValueBase& value);
225
226
227 /** Gets a single property using the Gst::ChildProxy mechanism.
228 * @param name The property to get.
229 * @param value An empty Glib::ValueBase in which to store the property.
230 * @return This Gst::ChildProxy so more properties can be retrieved if
231 * needed.
232 */
233 Glib::RefPtr<const Gst::ChildProxy> get_proxy_property(const Glib::ustring& name, Glib::ValueBase& value) const;
234
235
236 /** Sets a single property using the Gst::ChildProxy mechanism.
237 * @param name The property to get.
238 * @param value The Glib::ValueBase to set the property to (non-empty).
239 * @return This Gst::ChildProxy so more properties can be set.
240 */
241 Glib::RefPtr<Gst::ChildProxy> set_proxy_property(const Glib::ustring& name, const Glib::ValueBase& value);
242
243
244 /** Emits the "child-added" signal.
245 *
246 * @param child The newly added child.
247 * @param name The name of the new child.
248 */
249 void child_added(const Glib::RefPtr<Gst::Object>& child, const Glib::ustring& name);
250
251 /** Emits the "child-removed" signal.
252 *
253 * @param child The removed child.
254 * @param name The name of the old child.
255 */
256 void child_removed(const Glib::RefPtr<Gst::Object>& child, const Glib::ustring& name);
257
258
259 /**
260 * @par Slot Prototype:
261 * <tt>void on_my_%child_added(const Glib::RefPtr<Gst::Object>& object, const Glib::ustring& name)</tt>
262 *
263 * Will be emitted after the @a object was added to the @a child_proxy.
264 *
265 * @param object The Object that was added.
266 * @param name The name of the new child.
267 */
268
269 Glib::SignalProxy< void,const Glib::RefPtr<Gst::Object>&,const Glib::ustring& > signal_child_added();
270
271
272 /**
273 * @par Slot Prototype:
274 * <tt>void on_my_%child_removed(const Glib::RefPtr<Gst::Object>& object, const Glib::ustring& name)</tt>
275 *
276 * Will be emitted after the @a object was removed from the @a child_proxy.
277 *
278 * @param object The Object that was removed.
279 * @param name The name of the old child.
280 */
281
282 Glib::SignalProxy< void,const Glib::RefPtr<Gst::Object>&,const Glib::ustring& > signal_child_removed();
283
284
285 /** Virtual method to fetch the child by name.
286 */
287 virtual Glib::RefPtr<Glib::Object> get_child_by_name_vfunc(const Glib::ustring& name) const;
288
289
290 /** Virtual method to fetch the child by index.
291 */
292 virtual Glib::RefPtr<Glib::Object> get_child_by_index_vfunc(guint index) const;
293
294
295 /** Virtual method to get the children count.
296 */
297 virtual guint get_children_count_vfunc() const;
298
299
300 public:
301
302 public:
303 //C++ methods used to invoke GTK+ virtual functions:
304
305 protected:
306 //GTK+ Virtual Functions (override these to change behaviour):
307
308 //Default Signal Handlers::
309 /// This is a default handler for the signal signal_child_added().
310 virtual void on_child_added(const Glib::RefPtr<Gst::Object>& object, const Glib::ustring& name);
311 /// This is a default handler for the signal signal_child_removed().
312 virtual void on_child_removed(const Glib::RefPtr<Gst::Object>& object, const Glib::ustring& name);
313
314
315 };
316
317 } // namespace Gst
318
319
320 namespace Glib
321 {
322 /** A Glib::wrap() method for this object.
323 *
324 * @param object The C instance.
325 * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
326 * @result A C++ instance that wraps this C instance.
327 *
328 * @relates Gst::ChildProxy
329 */
330 Glib::RefPtr<Gst::ChildProxy> wrap(GstChildProxy* object, bool take_copy = false);
331
332 } // namespace Glib
333
334
335 #endif /* _GSTREAMERMM_CHILDPROXY_H */
336