1 // Generated by gmmproc 2.64.2 -- DO NOT MODIFY!
2
3
4 #include <glibmm.h>
5
6 #include <giomm/dbusproxy.h>
7 #include <giomm/private/dbusproxy_p.h>
8
9
10 /* Copyright (C) 2010 The giomm Development Team
11 *
12 * This library is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU Lesser General Public
14 * License as published by the Free Software Foundation; either
15 * version 2.1 of the License, or (at your option) any later version.
16 *
17 * This library is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * Lesser General Public License for more details.
21 *
22 * You should have received a copy of the GNU Lesser General Public
23 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
24 */
25
26 #include <gio/gio.h>
27 #include <glibmm/error.h>
28 #include <glibmm/exceptionhandler.h>
29 #include <glibmm/vectorutils.h>
30 #include <giomm/asyncresult.h>
31 #include <giomm/dbusconnection.h>
32 #include <giomm/dbusintrospection.h>
33 #include <giomm/slot_async.h>
34
35 namespace Gio
36 {
37
38 namespace DBus
39 {
40
41 // Help the generate code:
42 using MapChangedProperties = Proxy::MapChangedProperties;
43
Proxy(const Glib::RefPtr<Connection> & connection,const Glib::ustring & name,const Glib::ustring & object_path,const Glib::ustring & interface_name,const SlotAsyncReady & slot,const Glib::RefPtr<Cancellable> & cancellable,const Glib::RefPtr<InterfaceInfo> & info,ProxyFlags flags)44 Proxy::Proxy(const Glib::RefPtr<Connection>& connection, const Glib::ustring& name,
45 const Glib::ustring& object_path, const Glib::ustring& interface_name, const SlotAsyncReady& slot,
46 const Glib::RefPtr<Cancellable>& cancellable, const Glib::RefPtr<InterfaceInfo>& info,
47 ProxyFlags flags)
48 : // Mark this class as non-derived to allow C++ vfuncs to be skipped.
49 Glib::ObjectBase(nullptr),
50 Glib::Object(Glib::ConstructParams(proxy_class_.init(), "g-connection",Glib::unwrap(connection),"g-flags",static_cast<GDBusProxyFlags>(flags),"g-interface-info",Glib::unwrap(info),"g-name",Glib::c_str_or_nullptr(name),"g-object-path",Glib::c_str_or_nullptr(object_path),"g-interface-name",Glib::c_str_or_nullptr(interface_name), nullptr))
51 {
52 init_async(slot, cancellable);
53 }
54
Proxy(const Glib::RefPtr<Connection> & connection,const Glib::ustring & name,const Glib::ustring & object_path,const Glib::ustring & interface_name,const SlotAsyncReady & slot,const Glib::RefPtr<InterfaceInfo> & info,ProxyFlags flags)55 Proxy::Proxy(const Glib::RefPtr<Connection>& connection, const Glib::ustring& name,
56 const Glib::ustring& object_path, const Glib::ustring& interface_name, const SlotAsyncReady& slot,
57 const Glib::RefPtr<InterfaceInfo>& info, ProxyFlags flags)
58 : // Mark this class as non-derived to allow C++ vfuncs to be skipped.
59 Glib::ObjectBase(nullptr),
60 Glib::Object(Glib::ConstructParams(proxy_class_.init(), "g-connection",Glib::unwrap(connection),"g-flags",static_cast<GDBusProxyFlags>(flags),"g-interface-info",Glib::unwrap(info),"g-name",Glib::c_str_or_nullptr(name),"g-object-path",Glib::c_str_or_nullptr(object_path),"g-interface-name",Glib::c_str_or_nullptr(interface_name), nullptr))
61 {
62 init_async(slot);
63 }
64
Proxy(const Glib::RefPtr<Connection> & connection,const Glib::ustring & name,const Glib::ustring & object_path,const Glib::ustring & interface_name,const Glib::RefPtr<Cancellable> & cancellable,const Glib::RefPtr<InterfaceInfo> & info,ProxyFlags flags)65 Proxy::Proxy(const Glib::RefPtr<Connection>& connection, const Glib::ustring& name,
66 const Glib::ustring& object_path, const Glib::ustring& interface_name,
67 const Glib::RefPtr<Cancellable>& cancellable, const Glib::RefPtr<InterfaceInfo>& info,
68 ProxyFlags flags)
69 : // Mark this class as non-derived to allow C++ vfuncs to be skipped.
70 Glib::ObjectBase(nullptr),
71 Glib::Object(Glib::ConstructParams(proxy_class_.init(), "g-connection",Glib::unwrap(connection),"g-flags",static_cast<GDBusProxyFlags>(flags),"g-interface-info",Glib::unwrap(info),"g-name",Glib::c_str_or_nullptr(name),"g-object-path",Glib::c_str_or_nullptr(object_path),"g-interface-name",Glib::c_str_or_nullptr(interface_name), nullptr))
72 {
73 init(cancellable);
74 }
75
Proxy(const Glib::RefPtr<Connection> & connection,const Glib::ustring & name,const Glib::ustring & object_path,const Glib::ustring & interface_name,const Glib::RefPtr<InterfaceInfo> & info,ProxyFlags flags)76 Proxy::Proxy(const Glib::RefPtr<Connection>& connection, const Glib::ustring& name,
77 const Glib::ustring& object_path, const Glib::ustring& interface_name,
78 const Glib::RefPtr<InterfaceInfo>& info, ProxyFlags flags)
79 : // Mark this class as non-derived to allow C++ vfuncs to be skipped.
80 Glib::ObjectBase(nullptr),
81 Glib::Object(Glib::ConstructParams(proxy_class_.init(), "g-connection",Glib::unwrap(connection),"g-flags",static_cast<GDBusProxyFlags>(flags),"g-interface-info",Glib::unwrap(info),"g-name",Glib::c_str_or_nullptr(name),"g-object-path",Glib::c_str_or_nullptr(object_path),"g-interface-name",Glib::c_str_or_nullptr(interface_name), nullptr))
82 {
83 init();
84 }
85
Proxy(BusType bus_type,const Glib::ustring & name,const Glib::ustring & object_path,const Glib::ustring & interface_name,const SlotAsyncReady & slot,const Glib::RefPtr<Cancellable> & cancellable,const Glib::RefPtr<InterfaceInfo> & info,ProxyFlags flags)86 Proxy::Proxy(BusType bus_type, const Glib::ustring& name, const Glib::ustring& object_path,
87 const Glib::ustring& interface_name, const SlotAsyncReady& slot,
88 const Glib::RefPtr<Cancellable>& cancellable, const Glib::RefPtr<InterfaceInfo>& info,
89 ProxyFlags flags)
90 : // Mark this class as non-derived to allow C++ vfuncs to be skipped.
91 Glib::ObjectBase(nullptr),
92 Glib::Object(Glib::ConstructParams(proxy_class_.init(), "g-bus-type",static_cast<GBusType>(bus_type),"g-flags",static_cast<GDBusProxyFlags>(flags),"g-interface-info",Glib::unwrap(info),"g-name",Glib::c_str_or_nullptr(name),"g-object-path",Glib::c_str_or_nullptr(object_path),"g-interface-name",Glib::c_str_or_nullptr(interface_name), nullptr))
93 {
94 init_async(slot, cancellable);
95 }
96
Proxy(BusType bus_type,const Glib::ustring & name,const Glib::ustring & object_path,const Glib::ustring & interface_name,const SlotAsyncReady & slot,const Glib::RefPtr<InterfaceInfo> & info,ProxyFlags flags)97 Proxy::Proxy(BusType bus_type, const Glib::ustring& name, const Glib::ustring& object_path,
98 const Glib::ustring& interface_name, const SlotAsyncReady& slot,
99 const Glib::RefPtr<InterfaceInfo>& info, ProxyFlags flags)
100 : // Mark this class as non-derived to allow C++ vfuncs to be skipped.
101 Glib::ObjectBase(nullptr),
102 Glib::Object(Glib::ConstructParams(proxy_class_.init(), "g-bus-type",static_cast<GBusType>(bus_type),"g-flags",static_cast<GDBusProxyFlags>(flags),"g-interface-info",Glib::unwrap(info),"g-name",Glib::c_str_or_nullptr(name),"g-object-path",Glib::c_str_or_nullptr(object_path),"g-interface-name",Glib::c_str_or_nullptr(interface_name), nullptr))
103 {
104 init_async(slot);
105 }
106
Proxy(BusType bus_type,const Glib::ustring & name,const Glib::ustring & object_path,const Glib::ustring & interface_name,const Glib::RefPtr<Cancellable> & cancellable,const Glib::RefPtr<InterfaceInfo> & info,ProxyFlags flags)107 Proxy::Proxy(BusType bus_type, const Glib::ustring& name, const Glib::ustring& object_path,
108 const Glib::ustring& interface_name, const Glib::RefPtr<Cancellable>& cancellable,
109 const Glib::RefPtr<InterfaceInfo>& info, ProxyFlags flags)
110 : // Mark this class as non-derived to allow C++ vfuncs to be skipped.
111 Glib::ObjectBase(nullptr),
112 Glib::Object(Glib::ConstructParams(proxy_class_.init(), "g-bus-type",static_cast<GBusType>(bus_type),"g-flags",static_cast<GDBusProxyFlags>(flags),"g-interface-info",Glib::unwrap(info),"g-name",Glib::c_str_or_nullptr(name),"g-object-path",Glib::c_str_or_nullptr(object_path),"g-interface-name",Glib::c_str_or_nullptr(interface_name), nullptr))
113 {
114 init(cancellable);
115 }
116
Proxy(BusType bus_type,const Glib::ustring & name,const Glib::ustring & object_path,const Glib::ustring & interface_name,const Glib::RefPtr<InterfaceInfo> & info,ProxyFlags flags)117 Proxy::Proxy(BusType bus_type, const Glib::ustring& name, const Glib::ustring& object_path,
118 const Glib::ustring& interface_name, const Glib::RefPtr<InterfaceInfo>& info, ProxyFlags flags)
119 : // Mark this class as non-derived to allow C++ vfuncs to be skipped.
120 Glib::ObjectBase(nullptr),
121 Glib::Object(Glib::ConstructParams(proxy_class_.init(), "g-bus-type",static_cast<GBusType>(bus_type),"g-flags",static_cast<GDBusProxyFlags>(flags),"g-interface-info",Glib::unwrap(info),"g-name",Glib::c_str_or_nullptr(name),"g-object-path",Glib::c_str_or_nullptr(object_path),"g-interface-name",Glib::c_str_or_nullptr(interface_name), nullptr))
122 {
123 init();
124 }
125
126 void
create(const Glib::RefPtr<Connection> & connection,const Glib::ustring & name,const Glib::ustring & object_path,const Glib::ustring & interface_name,const SlotAsyncReady & slot,const Glib::RefPtr<Cancellable> & cancellable,const Glib::RefPtr<InterfaceInfo> & info,ProxyFlags flags)127 Proxy::create(const Glib::RefPtr<Connection>& connection, const Glib::ustring& name,
128 const Glib::ustring& object_path, const Glib::ustring& interface_name, const SlotAsyncReady& slot,
129 const Glib::RefPtr<Cancellable>& cancellable, const Glib::RefPtr<InterfaceInfo>& info,
130 ProxyFlags flags)
131 {
132 Proxy(connection, name, object_path, interface_name, slot, cancellable, info, flags);
133 }
134
135 void
create(const Glib::RefPtr<Connection> & connection,const Glib::ustring & name,const Glib::ustring & object_path,const Glib::ustring & interface_name,const SlotAsyncReady & slot,const Glib::RefPtr<InterfaceInfo> & info,ProxyFlags flags)136 Proxy::create(const Glib::RefPtr<Connection>& connection, const Glib::ustring& name,
137 const Glib::ustring& object_path, const Glib::ustring& interface_name, const SlotAsyncReady& slot,
138 const Glib::RefPtr<InterfaceInfo>& info, ProxyFlags flags)
139 {
140 Proxy(connection, name, object_path, interface_name, slot, info, flags);
141 }
142
143 Glib::RefPtr<Proxy>
create_sync(const Glib::RefPtr<Connection> & connection,const Glib::ustring & name,const Glib::ustring & object_path,const Glib::ustring & interface_name,const Glib::RefPtr<Cancellable> & cancellable,const Glib::RefPtr<InterfaceInfo> & info,ProxyFlags flags)144 Proxy::create_sync(const Glib::RefPtr<Connection>& connection, const Glib::ustring& name,
145 const Glib::ustring& object_path, const Glib::ustring& interface_name,
146 const Glib::RefPtr<Cancellable>& cancellable, const Glib::RefPtr<InterfaceInfo>& info,
147 ProxyFlags flags)
148 {
149 return Glib::RefPtr<Proxy>(
150 new Proxy(connection, name, object_path, interface_name, cancellable, info, flags));
151 }
152
153 Glib::RefPtr<Proxy>
create_sync(const Glib::RefPtr<Connection> & connection,const Glib::ustring & name,const Glib::ustring & object_path,const Glib::ustring & interface_name,const Glib::RefPtr<InterfaceInfo> & info,ProxyFlags flags)154 Proxy::create_sync(const Glib::RefPtr<Connection>& connection, const Glib::ustring& name,
155 const Glib::ustring& object_path, const Glib::ustring& interface_name,
156 const Glib::RefPtr<InterfaceInfo>& info, ProxyFlags flags)
157 {
158 return Glib::RefPtr<Proxy>(new Proxy(connection, name, object_path, interface_name, info, flags));
159 }
160
161 void
create_for_bus(BusType bus_type,const Glib::ustring & name,const Glib::ustring & object_path,const Glib::ustring & interface_name,const SlotAsyncReady & slot,const Glib::RefPtr<Cancellable> & cancellable,const Glib::RefPtr<InterfaceInfo> & info,ProxyFlags flags)162 Proxy::create_for_bus(BusType bus_type, const Glib::ustring& name, const Glib::ustring& object_path,
163 const Glib::ustring& interface_name, const SlotAsyncReady& slot,
164 const Glib::RefPtr<Cancellable>& cancellable, const Glib::RefPtr<InterfaceInfo>& info,
165 ProxyFlags flags)
166 {
167 Proxy(bus_type, name, object_path, interface_name, slot, cancellable, info, flags);
168 }
169
170 void
create_for_bus(BusType bus_type,const Glib::ustring & name,const Glib::ustring & object_path,const Glib::ustring & interface_name,const SlotAsyncReady & slot,const Glib::RefPtr<InterfaceInfo> & info,ProxyFlags flags)171 Proxy::create_for_bus(BusType bus_type, const Glib::ustring& name, const Glib::ustring& object_path,
172 const Glib::ustring& interface_name, const SlotAsyncReady& slot,
173 const Glib::RefPtr<InterfaceInfo>& info, ProxyFlags flags)
174 {
175 Proxy(bus_type, name, object_path, interface_name, slot, info, flags);
176 }
177
178 Glib::RefPtr<Proxy>
create_for_bus_sync(BusType bus_type,const Glib::ustring & name,const Glib::ustring & object_path,const Glib::ustring & interface_name,const Glib::RefPtr<Cancellable> & cancellable,const Glib::RefPtr<InterfaceInfo> & info,ProxyFlags flags)179 Proxy::create_for_bus_sync(BusType bus_type, const Glib::ustring& name,
180 const Glib::ustring& object_path, const Glib::ustring& interface_name,
181 const Glib::RefPtr<Cancellable>& cancellable, const Glib::RefPtr<InterfaceInfo>& info,
182 ProxyFlags flags)
183 {
184 return Glib::RefPtr<Proxy>(
185 new Proxy(bus_type, name, object_path, interface_name, cancellable, info, flags));
186 }
187
188 Glib::RefPtr<Proxy>
create_for_bus_sync(BusType bus_type,const Glib::ustring & name,const Glib::ustring & object_path,const Glib::ustring & interface_name,const Glib::RefPtr<InterfaceInfo> & info,ProxyFlags flags)189 Proxy::create_for_bus_sync(BusType bus_type, const Glib::ustring& name,
190 const Glib::ustring& object_path, const Glib::ustring& interface_name,
191 const Glib::RefPtr<InterfaceInfo>& info, ProxyFlags flags)
192 {
193 return Glib::RefPtr<Proxy>(new Proxy(bus_type, name, object_path, interface_name, info, flags));
194 }
195
196 void
get_cached_property(Glib::VariantBase & property,const Glib::ustring & property_name) const197 Proxy::get_cached_property(Glib::VariantBase& property, const Glib::ustring& property_name) const
198 {
199 GVariant* const g_variant =
200 g_dbus_proxy_get_cached_property(const_cast<GDBusProxy*>(gobj()), property_name.c_str());
201
202 property.init(g_variant, false /* no extra reference needed */);
203 }
204
205 } // namespace DBus
206
207 } // namespace Gio
208
209 namespace
210 {
211
212
Proxy_signal_properties_changed_callback(GDBusProxy * self,GVariant * p0,const gchar * const * p1,void * data)213 static void Proxy_signal_properties_changed_callback(GDBusProxy* self, GVariant* p0,const gchar*const* p1,void* data)
214 {
215 using namespace Gio::DBus;
216 using SlotType = sigc::slot< void,const MapChangedProperties&,const std::vector<Glib::ustring>& >;
217
218 auto obj = dynamic_cast<Proxy*>(Glib::ObjectBase::_get_current_wrapper((GObject*) self));
219 // Do not try to call a signal on a disassociated wrapper.
220 if(obj)
221 {
222 try
223 {
224 if(const auto slot = Glib::SignalProxyNormal::data_to_slot(data))
225 (*static_cast<SlotType*>(slot))(Glib::Variant<MapChangedProperties>(p0, true).get()
226 , Glib::ArrayHandler<Glib::ustring>::array_to_vector(p1, Glib::OWNERSHIP_NONE)
227 );
228 }
229 catch(...)
230 {
231 Glib::exception_handlers_invoke();
232 }
233 }
234 }
235
236 static const Glib::SignalProxyInfo Proxy_signal_properties_changed_info =
237 {
238 "g-properties-changed",
239 (GCallback) &Proxy_signal_properties_changed_callback,
240 (GCallback) &Proxy_signal_properties_changed_callback
241 };
242
243
Proxy_signal_signal_callback(GDBusProxy * self,const gchar * p0,const gchar * p1,GVariant * p2,void * data)244 static void Proxy_signal_signal_callback(GDBusProxy* self, const gchar* p0,const gchar* p1,GVariant* p2,void* data)
245 {
246 using namespace Gio::DBus;
247 using SlotType = sigc::slot< void,const Glib::ustring&,const Glib::ustring&,const Glib::VariantContainerBase& >;
248
249 auto obj = dynamic_cast<Proxy*>(Glib::ObjectBase::_get_current_wrapper((GObject*) self));
250 // Do not try to call a signal on a disassociated wrapper.
251 if(obj)
252 {
253 try
254 {
255 if(const auto slot = Glib::SignalProxyNormal::data_to_slot(data))
256 (*static_cast<SlotType*>(slot))(Glib::convert_const_gchar_ptr_to_ustring(p0)
257 , Glib::convert_const_gchar_ptr_to_ustring(p1)
258 , Glib::VariantContainerBase(p2, true)
259 );
260 }
261 catch(...)
262 {
263 Glib::exception_handlers_invoke();
264 }
265 }
266 }
267
268 static const Glib::SignalProxyInfo Proxy_signal_signal_info =
269 {
270 "g-signal",
271 (GCallback) &Proxy_signal_signal_callback,
272 (GCallback) &Proxy_signal_signal_callback
273 };
274
275
276 } // anonymous namespace
277
278 // static
value_type()279 GType Glib::Value<Gio::DBus::ProxyFlags>::value_type()
280 {
281 return g_dbus_proxy_flags_get_type();
282 }
283
284
285 namespace Glib
286 {
287
wrap(GDBusProxy * object,bool take_copy)288 Glib::RefPtr<Gio::DBus::Proxy> wrap(GDBusProxy* object, bool take_copy)
289 {
290 return Glib::RefPtr<Gio::DBus::Proxy>( dynamic_cast<Gio::DBus::Proxy*> (Glib::wrap_auto ((GObject*)(object), take_copy)) );
291 //We use dynamic_cast<> in case of multiple inheritance.
292 }
293
294 } /* namespace Glib */
295
296
297 namespace Gio
298 {
299
300 namespace DBus
301 {
302
303
304 /* The *_Class implementation: */
305
init()306 const Glib::Class& Proxy_Class::init()
307 {
308 if(!gtype_) // create the GType if necessary
309 {
310 // Glib::Class has to know the class init function to clone custom types.
311 class_init_func_ = &Proxy_Class::class_init_function;
312
313 // This is actually just optimized away, apparently with no harm.
314 // Make sure that the parent type has been created.
315 //CppClassParent::CppObjectType::get_type();
316
317 // Create the wrapper type, with the same class/instance size as the base type.
318 register_derived_type(g_dbus_proxy_get_type());
319
320 // Add derived versions of interfaces, if the C type implements any interfaces:
321 Initable::add_interface(get_type());
322 AsyncInitable::add_interface(get_type());
323
324 }
325
326 return *this;
327 }
328
329
class_init_function(void * g_class,void * class_data)330 void Proxy_Class::class_init_function(void* g_class, void* class_data)
331 {
332 const auto klass = static_cast<BaseClassType*>(g_class);
333 CppClassParent::class_init_function(klass, class_data);
334
335
336 klass->g_properties_changed = &g_properties_changed_callback;
337 klass->g_signal = &g_signal_callback;
338 }
339
340
g_properties_changed_callback(GDBusProxy * self,GVariant * p0,const gchar * const * p1)341 void Proxy_Class::g_properties_changed_callback(GDBusProxy* self, GVariant* p0, const gchar*const* p1)
342 {
343 const auto obj_base = static_cast<Glib::ObjectBase*>(
344 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
345
346 // Non-gtkmmproc-generated custom classes implicitly call the default
347 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
348 // generated classes can use this optimisation, which avoids the unnecessary
349 // parameter conversions if there is no possibility of the virtual function
350 // being overridden:
351 if(obj_base && obj_base->is_derived_())
352 {
353 const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
354 if(obj) // This can be NULL during destruction.
355 {
356 try // Trap C++ exceptions which would normally be lost because this is a C callback.
357 {
358 // Call the virtual member method, which derived classes might override.
359 obj->on_properties_changed(Glib::Variant<MapChangedProperties>(p0, true).get()
360 , Glib::ArrayHandler<Glib::ustring>::array_to_vector(p1, Glib::OWNERSHIP_NONE)
361 );
362 return;
363 }
364 catch(...)
365 {
366 Glib::exception_handlers_invoke();
367 }
368 }
369 }
370
371 const auto base = static_cast<BaseClassType*>(
372 g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
373 );
374
375 // Call the original underlying C function:
376 if(base && base->g_properties_changed)
377 (*base->g_properties_changed)(self, p0, p1);
378 }
g_signal_callback(GDBusProxy * self,const gchar * p0,const gchar * p1,GVariant * p2)379 void Proxy_Class::g_signal_callback(GDBusProxy* self, const gchar* p0, const gchar* p1, GVariant* p2)
380 {
381 const auto obj_base = static_cast<Glib::ObjectBase*>(
382 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
383
384 // Non-gtkmmproc-generated custom classes implicitly call the default
385 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
386 // generated classes can use this optimisation, which avoids the unnecessary
387 // parameter conversions if there is no possibility of the virtual function
388 // being overridden:
389 if(obj_base && obj_base->is_derived_())
390 {
391 const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
392 if(obj) // This can be NULL during destruction.
393 {
394 try // Trap C++ exceptions which would normally be lost because this is a C callback.
395 {
396 // Call the virtual member method, which derived classes might override.
397 obj->on_signal(Glib::convert_const_gchar_ptr_to_ustring(p0)
398 , Glib::convert_const_gchar_ptr_to_ustring(p1)
399 , Glib::VariantContainerBase(p2, true)
400 );
401 return;
402 }
403 catch(...)
404 {
405 Glib::exception_handlers_invoke();
406 }
407 }
408 }
409
410 const auto base = static_cast<BaseClassType*>(
411 g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
412 );
413
414 // Call the original underlying C function:
415 if(base && base->g_signal)
416 (*base->g_signal)(self, p0, p1, p2);
417 }
418
419
wrap_new(GObject * object)420 Glib::ObjectBase* Proxy_Class::wrap_new(GObject* object)
421 {
422 return new Proxy((GDBusProxy*)object);
423 }
424
425
426 /* The implementation: */
427
gobj_copy()428 GDBusProxy* Proxy::gobj_copy()
429 {
430 reference();
431 return gobj();
432 }
433
Proxy(const Glib::ConstructParams & construct_params)434 Proxy::Proxy(const Glib::ConstructParams& construct_params)
435 :
436 Glib::Object(construct_params)
437 {
438
439 }
440
Proxy(GDBusProxy * castitem)441 Proxy::Proxy(GDBusProxy* castitem)
442 :
443 Glib::Object((GObject*)(castitem))
444 {}
445
446
Proxy(Proxy && src)447 Proxy::Proxy(Proxy&& src) noexcept
448 : Glib::Object(std::move(src))
449 , Initable(std::move(src))
450 , AsyncInitable(std::move(src))
451 {}
452
operator =(Proxy && src)453 Proxy& Proxy::operator=(Proxy&& src) noexcept
454 {
455 Glib::Object::operator=(std::move(src));
456 Initable::operator=(std::move(src));
457 AsyncInitable::operator=(std::move(src));
458 return *this;
459 }
460
461
~Proxy()462 Proxy::~Proxy() noexcept
463 {}
464
465
466 Proxy::CppClassType Proxy::proxy_class_; // initialize static member
467
get_type()468 GType Proxy::get_type()
469 {
470 return proxy_class_.init().get_type();
471 }
472
473
get_base_type()474 GType Proxy::get_base_type()
475 {
476 return g_dbus_proxy_get_type();
477 }
478
479
create_finish(const Glib::RefPtr<AsyncResult> & res)480 Glib::RefPtr<Gio::DBus::Proxy> Proxy::create_finish(const Glib::RefPtr<AsyncResult>& res)
481 {
482 GError* gerror = nullptr;
483 Glib::RefPtr<Gio::DBus::Proxy> retvalue = Glib::wrap(g_dbus_proxy_new_finish(Glib::unwrap(res), &(gerror)));
484 if(gerror)
485 ::Glib::Error::throw_exception(gerror);
486 return retvalue;
487 }
488
create_for_bus_finish(const Glib::RefPtr<AsyncResult> & res)489 Glib::RefPtr<Gio::DBus::Proxy> Proxy::create_for_bus_finish(const Glib::RefPtr<AsyncResult>& res)
490 {
491 GError* gerror = nullptr;
492 Glib::RefPtr<Gio::DBus::Proxy> retvalue = Glib::wrap(g_dbus_proxy_new_for_bus_finish(Glib::unwrap(res), &(gerror)));
493 if(gerror)
494 ::Glib::Error::throw_exception(gerror);
495 return retvalue;
496 }
497
get_flags() const498 ProxyFlags Proxy::get_flags() const
499 {
500 return ((ProxyFlags)(g_dbus_proxy_get_flags(const_cast<GDBusProxy*>(gobj()))));
501 }
502
get_connection()503 Glib::RefPtr<Connection> Proxy::get_connection()
504 {
505 return Glib::wrap(g_dbus_proxy_get_connection(gobj()));
506 }
507
get_connection() const508 Glib::RefPtr<const Connection> Proxy::get_connection() const
509 {
510 return Glib::wrap(g_dbus_proxy_get_connection(const_cast<GDBusProxy*>(gobj())));
511 }
512
get_name() const513 Glib::ustring Proxy::get_name() const
514 {
515 return Glib::convert_const_gchar_ptr_to_ustring(g_dbus_proxy_get_name(const_cast<GDBusProxy*>(gobj())));
516 }
517
get_name_owner() const518 Glib::ustring Proxy::get_name_owner() const
519 {
520 return Glib::convert_return_gchar_ptr_to_ustring(g_dbus_proxy_get_name_owner(const_cast<GDBusProxy*>(gobj())));
521 }
522
get_object_path() const523 Glib::ustring Proxy::get_object_path() const
524 {
525 return Glib::convert_const_gchar_ptr_to_ustring(g_dbus_proxy_get_object_path(const_cast<GDBusProxy*>(gobj())));
526 }
527
get_interface_name() const528 Glib::ustring Proxy::get_interface_name() const
529 {
530 return Glib::convert_const_gchar_ptr_to_ustring(g_dbus_proxy_get_interface_name(const_cast<GDBusProxy*>(gobj())));
531 }
532
get_default_timeout() const533 int Proxy::get_default_timeout() const
534 {
535 return g_dbus_proxy_get_default_timeout(const_cast<GDBusProxy*>(gobj()));
536 }
537
set_default_timeout(int timeout_msec)538 void Proxy::set_default_timeout(int timeout_msec)
539 {
540 g_dbus_proxy_set_default_timeout(gobj(), timeout_msec);
541 }
542
set_cached_property(const Glib::ustring & property_name,const Glib::VariantBase & value)543 void Proxy::set_cached_property(const Glib::ustring& property_name, const Glib::VariantBase& value)
544 {
545 g_dbus_proxy_set_cached_property(gobj(), property_name.c_str(), const_cast<GVariant*>((value).gobj()));
546 }
547
get_cached_property_names() const548 Glib::StringArrayHandle Proxy::get_cached_property_names() const
549 {
550 return Glib::StringArrayHandle(g_dbus_proxy_get_cached_property_names(const_cast<GDBusProxy*>(gobj())), Glib::OWNERSHIP_DEEP);
551 }
552
set_interface_info(const Glib::RefPtr<InterfaceInfo> & info)553 void Proxy::set_interface_info(const Glib::RefPtr<InterfaceInfo>& info)
554 {
555 g_dbus_proxy_set_interface_info(gobj(), Glib::unwrap(info));
556 }
557
get_interface_info()558 Glib::RefPtr<InterfaceInfo> Proxy::get_interface_info()
559 {
560 return Glib::wrap(g_dbus_proxy_get_interface_info(gobj()));
561 }
562
get_interface_info() const563 Glib::RefPtr<const InterfaceInfo> Proxy::get_interface_info() const
564 {
565 return const_cast<Proxy*>(this)->get_interface_info();
566 }
567
call(const Glib::ustring & method_name,const SlotAsyncReady & slot,const Glib::RefPtr<Cancellable> & cancellable,const Glib::VariantContainerBase & parameters,int timeout_msec,CallFlags flags)568 void Proxy::call(const Glib::ustring& method_name, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, const Glib::VariantContainerBase& parameters, int timeout_msec, CallFlags flags)
569 {
570 // Create a copy of the slot.
571 auto slot_copy = new SlotAsyncReady(slot);
572
573 g_dbus_proxy_call(gobj(), method_name.c_str(), const_cast<GVariant*>((parameters).gobj()), ((GDBusCallFlags)(flags)), timeout_msec, const_cast<GCancellable*>(Glib::unwrap(cancellable)), &SignalProxy_async_callback, slot_copy);
574 }
575
call(const Glib::ustring & method_name,const SlotAsyncReady & slot,const Glib::VariantContainerBase & parameters,int timeout_msec,CallFlags flags)576 void Proxy::call(const Glib::ustring& method_name, const SlotAsyncReady& slot, const Glib::VariantContainerBase& parameters, int timeout_msec, CallFlags flags)
577 {
578 // Create a copy of the slot.
579 auto slot_copy = new SlotAsyncReady(slot);
580
581 g_dbus_proxy_call(gobj(), method_name.c_str(), const_cast<GVariant*>((parameters).gobj()), ((GDBusCallFlags)(flags)), timeout_msec, nullptr, &SignalProxy_async_callback, slot_copy);
582 }
583
call(const Glib::ustring & method_name,const Glib::RefPtr<Cancellable> & cancellable,const Glib::VariantContainerBase & parameters,int timeout_msec,CallFlags flags)584 void Proxy::call(const Glib::ustring& method_name, const Glib::RefPtr<Cancellable>& cancellable, const Glib::VariantContainerBase& parameters, int timeout_msec, CallFlags flags)
585 {
586 g_dbus_proxy_call(gobj(), method_name.c_str(), const_cast<GVariant*>((parameters).gobj()), ((GDBusCallFlags)(flags)), timeout_msec, const_cast<GCancellable*>(Glib::unwrap(cancellable)), nullptr, nullptr);
587 }
588
call(const Glib::ustring & method_name,const Glib::VariantContainerBase & parameters,int timeout_msec,CallFlags flags)589 void Proxy::call(const Glib::ustring& method_name, const Glib::VariantContainerBase& parameters, int timeout_msec, CallFlags flags)
590 {
591 g_dbus_proxy_call(gobj(), method_name.c_str(), const_cast<GVariant*>((parameters).gobj()), ((GDBusCallFlags)(flags)), timeout_msec, nullptr, nullptr, nullptr);
592 }
593
call_finish(const Glib::RefPtr<AsyncResult> & res)594 Glib::VariantContainerBase Proxy::call_finish(const Glib::RefPtr<AsyncResult>& res)
595 {
596 GError* gerror = nullptr;
597 Glib::VariantContainerBase retvalue = Glib::VariantContainerBase(g_dbus_proxy_call_finish(gobj(), Glib::unwrap(res), &(gerror)), false);
598 if(gerror)
599 ::Glib::Error::throw_exception(gerror);
600 return retvalue;
601 }
602
call_sync(const Glib::ustring & method_name,const Glib::RefPtr<Cancellable> & cancellable,const Glib::VariantContainerBase & parameters,int timeout_msec,CallFlags flags)603 Glib::VariantContainerBase Proxy::call_sync(const Glib::ustring& method_name, const Glib::RefPtr<Cancellable>& cancellable, const Glib::VariantContainerBase& parameters, int timeout_msec, CallFlags flags)
604 {
605 GError* gerror = nullptr;
606 Glib::VariantContainerBase retvalue = Glib::VariantContainerBase(g_dbus_proxy_call_sync(gobj(), method_name.c_str(), const_cast<GVariant*>((parameters).gobj()), ((GDBusCallFlags)(flags)), timeout_msec, const_cast<GCancellable*>(Glib::unwrap(cancellable)), &(gerror)), false);
607 if(gerror)
608 ::Glib::Error::throw_exception(gerror);
609 return retvalue;
610 }
611
call_sync(const Glib::ustring & method_name,const Glib::VariantContainerBase & parameters,int timeout_msec,CallFlags flags)612 Glib::VariantContainerBase Proxy::call_sync(const Glib::ustring& method_name, const Glib::VariantContainerBase& parameters, int timeout_msec, CallFlags flags)
613 {
614 GError* gerror = nullptr;
615 Glib::VariantContainerBase retvalue = Glib::VariantContainerBase(g_dbus_proxy_call_sync(gobj(), method_name.c_str(), const_cast<GVariant*>((parameters).gobj()), ((GDBusCallFlags)(flags)), timeout_msec, nullptr, &(gerror)), false);
616 if(gerror)
617 ::Glib::Error::throw_exception(gerror);
618 return retvalue;
619 }
620
621 #ifdef G_OS_UNIX
call(const Glib::ustring & method_name,const Glib::VariantContainerBase & parameters,const SlotAsyncReady & slot,const Glib::RefPtr<Cancellable> & cancellable,const Glib::RefPtr<UnixFDList> & fd_list,int timeout_msec,CallFlags flags)622 void Proxy::call(const Glib::ustring& method_name, const Glib::VariantContainerBase& parameters, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, const Glib::RefPtr<UnixFDList>& fd_list, int timeout_msec, CallFlags flags)
623 {
624 // Create a copy of the slot.
625 auto slot_copy = new SlotAsyncReady(slot);
626
627 g_dbus_proxy_call_with_unix_fd_list(gobj(), method_name.c_str(), const_cast<GVariant*>((parameters).gobj()), ((GDBusCallFlags)(flags)), timeout_msec, Glib::unwrap(fd_list), const_cast<GCancellable*>(Glib::unwrap(cancellable)), &SignalProxy_async_callback, slot_copy);
628 }
629 #endif // G_OS_UNIX
630
631 #ifdef G_OS_UNIX
call(const Glib::ustring & method_name,const Glib::VariantContainerBase & parameters,const SlotAsyncReady & slot,const Glib::RefPtr<UnixFDList> & fd_list,int timeout_msec,CallFlags flags)632 void Proxy::call(const Glib::ustring& method_name, const Glib::VariantContainerBase& parameters, const SlotAsyncReady& slot, const Glib::RefPtr<UnixFDList>& fd_list, int timeout_msec, CallFlags flags)
633 {
634 // Create a copy of the slot.
635 auto slot_copy = new SlotAsyncReady(slot);
636
637 g_dbus_proxy_call_with_unix_fd_list(gobj(), method_name.c_str(), const_cast<GVariant*>((parameters).gobj()), ((GDBusCallFlags)(flags)), timeout_msec, Glib::unwrap(fd_list), nullptr, &SignalProxy_async_callback, slot_copy);
638 }
639 #endif // G_OS_UNIX
640
641 #ifdef G_OS_UNIX
call(const Glib::ustring & method_name,const Glib::VariantContainerBase & parameters,const Glib::RefPtr<Cancellable> & cancellable,const Glib::RefPtr<UnixFDList> & fd_list,int timeout_msec,CallFlags flags)642 void Proxy::call(const Glib::ustring& method_name, const Glib::VariantContainerBase& parameters, const Glib::RefPtr<Cancellable>& cancellable, const Glib::RefPtr<UnixFDList>& fd_list, int timeout_msec, CallFlags flags)
643 {
644 g_dbus_proxy_call_with_unix_fd_list(gobj(), method_name.c_str(), const_cast<GVariant*>((parameters).gobj()), ((GDBusCallFlags)(flags)), timeout_msec, Glib::unwrap(fd_list), const_cast<GCancellable*>(Glib::unwrap(cancellable)), nullptr, nullptr);
645 }
646 #endif // G_OS_UNIX
647
648 #ifdef G_OS_UNIX
call(const Glib::ustring & method_name,const Glib::VariantContainerBase & parameters,const Glib::RefPtr<UnixFDList> & fd_list,int timeout_msec,CallFlags flags)649 void Proxy::call(const Glib::ustring& method_name, const Glib::VariantContainerBase& parameters, const Glib::RefPtr<UnixFDList>& fd_list, int timeout_msec, CallFlags flags)
650 {
651 g_dbus_proxy_call_with_unix_fd_list(gobj(), method_name.c_str(), const_cast<GVariant*>((parameters).gobj()), ((GDBusCallFlags)(flags)), timeout_msec, Glib::unwrap(fd_list), nullptr, nullptr, nullptr);
652 }
653 #endif // G_OS_UNIX
654
655 #ifdef G_OS_UNIX
call_finish(const Glib::RefPtr<AsyncResult> & res,Glib::RefPtr<UnixFDList> & out_fd_list)656 Glib::VariantContainerBase Proxy::call_finish(const Glib::RefPtr<AsyncResult>& res, Glib::RefPtr<UnixFDList>& out_fd_list)
657 {
658 GError* gerror = nullptr;
659 GUnixFDList* g_out_fd_list = nullptr;
660 Glib::VariantContainerBase retvalue = Glib::VariantContainerBase(g_dbus_proxy_call_with_unix_fd_list_finish(gobj(), &g_out_fd_list, Glib::unwrap(res), &(gerror)), false);
661 if(gerror)
662 ::Glib::Error::throw_exception(gerror);
663 out_fd_list = Glib::wrap(g_out_fd_list);
664 return retvalue;
665 }
666 #endif // G_OS_UNIX
667
668 #ifdef G_OS_UNIX
call_sync(const Glib::ustring & method_name,const Glib::VariantContainerBase & parameters,const Glib::RefPtr<Cancellable> & cancellable,const Glib::RefPtr<UnixFDList> & fd_list,Glib::RefPtr<UnixFDList> & out_fd_list,int timeout_msec,CallFlags flags)669 Glib::VariantContainerBase Proxy::call_sync(const Glib::ustring& method_name, const Glib::VariantContainerBase& parameters, const Glib::RefPtr<Cancellable>& cancellable, const Glib::RefPtr<UnixFDList>& fd_list, Glib::RefPtr<UnixFDList>& out_fd_list, int timeout_msec, CallFlags flags)
670 {
671 GError* gerror = nullptr;
672 GUnixFDList* g_out_fd_list = nullptr;
673 Glib::VariantContainerBase retvalue = Glib::VariantContainerBase(g_dbus_proxy_call_with_unix_fd_list_sync(gobj(), method_name.c_str(), const_cast<GVariant*>((parameters).gobj()), ((GDBusCallFlags)(flags)), timeout_msec, Glib::unwrap(fd_list), &g_out_fd_list, const_cast<GCancellable*>(Glib::unwrap(cancellable)), &(gerror)), false);
674 if(gerror)
675 ::Glib::Error::throw_exception(gerror);
676 out_fd_list = Glib::wrap(g_out_fd_list);
677 return retvalue;
678 }
679 #endif // G_OS_UNIX
680
681 #ifdef G_OS_UNIX
call_sync(const Glib::ustring & method_name,const Glib::VariantContainerBase & parameters,const Glib::RefPtr<UnixFDList> & fd_list,Glib::RefPtr<UnixFDList> & out_fd_list,int timeout_msec,CallFlags flags)682 Glib::VariantContainerBase Proxy::call_sync(const Glib::ustring& method_name, const Glib::VariantContainerBase& parameters, const Glib::RefPtr<UnixFDList>& fd_list, Glib::RefPtr<UnixFDList>& out_fd_list, int timeout_msec, CallFlags flags)
683 {
684 GError* gerror = nullptr;
685 GUnixFDList* g_out_fd_list = nullptr;
686 Glib::VariantContainerBase retvalue = Glib::VariantContainerBase(g_dbus_proxy_call_with_unix_fd_list_sync(gobj(), method_name.c_str(), const_cast<GVariant*>((parameters).gobj()), ((GDBusCallFlags)(flags)), timeout_msec, Glib::unwrap(fd_list), &g_out_fd_list, nullptr, &(gerror)), false);
687 if(gerror)
688 ::Glib::Error::throw_exception(gerror);
689 out_fd_list = Glib::wrap(g_out_fd_list);
690 return retvalue;
691 }
692 #endif // G_OS_UNIX
693
694
signal_properties_changed()695 Glib::SignalProxy< void,const MapChangedProperties&,const std::vector<Glib::ustring>& > Proxy::signal_properties_changed()
696 {
697 return Glib::SignalProxy< void,const MapChangedProperties&,const std::vector<Glib::ustring>& >(this, &Proxy_signal_properties_changed_info);
698 }
699
700
signal_signal()701 Glib::SignalProxy< void,const Glib::ustring&,const Glib::ustring&,const Glib::VariantContainerBase& > Proxy::signal_signal()
702 {
703 return Glib::SignalProxy< void,const Glib::ustring&,const Glib::ustring&,const Glib::VariantContainerBase& >(this, &Proxy_signal_signal_info);
704 }
705
706
property_g_connection() const707 Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Connection> > Proxy::property_g_connection() const
708 {
709 return Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Connection> >(this, "g-connection");
710 }
711
property_g_default_timeout()712 Glib::PropertyProxy< int > Proxy::property_g_default_timeout()
713 {
714 return Glib::PropertyProxy< int >(this, "g-default-timeout");
715 }
716
property_g_default_timeout() const717 Glib::PropertyProxy_ReadOnly< int > Proxy::property_g_default_timeout() const
718 {
719 return Glib::PropertyProxy_ReadOnly< int >(this, "g-default-timeout");
720 }
721
property_g_flags() const722 Glib::PropertyProxy_ReadOnly< ProxyFlags > Proxy::property_g_flags() const
723 {
724 return Glib::PropertyProxy_ReadOnly< ProxyFlags >(this, "g-flags");
725 }
726
property_g_interface_info()727 Glib::PropertyProxy< Glib::RefPtr<InterfaceInfo> > Proxy::property_g_interface_info()
728 {
729 return Glib::PropertyProxy< Glib::RefPtr<InterfaceInfo> >(this, "g-interface-info");
730 }
731
property_g_interface_info() const732 Glib::PropertyProxy_ReadOnly< Glib::RefPtr<InterfaceInfo> > Proxy::property_g_interface_info() const
733 {
734 return Glib::PropertyProxy_ReadOnly< Glib::RefPtr<InterfaceInfo> >(this, "g-interface-info");
735 }
736
property_g_interface_name() const737 Glib::PropertyProxy_ReadOnly< Glib::ustring > Proxy::property_g_interface_name() const
738 {
739 return Glib::PropertyProxy_ReadOnly< Glib::ustring >(this, "g-interface-name");
740 }
741
property_g_name() const742 Glib::PropertyProxy_ReadOnly< Glib::ustring > Proxy::property_g_name() const
743 {
744 return Glib::PropertyProxy_ReadOnly< Glib::ustring >(this, "g-name");
745 }
746
property_g_name_owner() const747 Glib::PropertyProxy_ReadOnly< Glib::ustring > Proxy::property_g_name_owner() const
748 {
749 return Glib::PropertyProxy_ReadOnly< Glib::ustring >(this, "g-name-owner");
750 }
751
property_g_object_path() const752 Glib::PropertyProxy_ReadOnly< Glib::ustring > Proxy::property_g_object_path() const
753 {
754 return Glib::PropertyProxy_ReadOnly< Glib::ustring >(this, "g-object-path");
755 }
756
757
on_properties_changed(const MapChangedProperties & changed_properties,const std::vector<Glib::ustring> & invalidated_properties)758 void Gio::DBus::Proxy::on_properties_changed(const MapChangedProperties& changed_properties, const std::vector<Glib::ustring>& invalidated_properties)
759 {
760 const auto base = static_cast<BaseClassType*>(
761 g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
762 );
763
764 if(base && base->g_properties_changed)
765 (*base->g_properties_changed)(gobj(),const_cast<GVariant*>(Glib::Variant<MapChangedProperties>::create(changed_properties).gobj()),Glib::ArrayHandler<Glib::ustring>::vector_to_array(invalidated_properties).data());
766 }
on_signal(const Glib::ustring & sender_name,const Glib::ustring & signal_name,const Glib::VariantContainerBase & parameters)767 void Gio::DBus::Proxy::on_signal(const Glib::ustring& sender_name, const Glib::ustring& signal_name, const Glib::VariantContainerBase& parameters)
768 {
769 const auto base = static_cast<BaseClassType*>(
770 g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
771 );
772
773 if(base && base->g_signal)
774 (*base->g_signal)(gobj(),sender_name.c_str(),signal_name.c_str(),const_cast<GVariant*>((parameters).gobj()));
775 }
776
777
778 } // namespace DBus
779
780 } // namespace Gio
781
782
783