1 // Generated by gmmproc 2.64.2 -- DO NOT MODIFY!
2
3
4 #include <glibmm.h>
5
6 #include <giomm/dbusmessage.h>
7 #include <giomm/private/dbusmessage_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
29 #ifdef G_OS_UNIX
30 #include <giomm/unixfdlist.h>
31 #endif // G_OS_UNIX
32
33 namespace Gio
34 {
35
36 namespace DBus
37 {
38
39 using ByteOrder = Message::ByteOrder;
40
41 void
get_body(Glib::VariantBase & value) const42 Message::get_body(Glib::VariantBase& value) const
43 {
44 GVariant* const g_value = g_dbus_message_get_body(const_cast<GDBusMessage*>(gobj()));
45
46 if (!g_value)
47 return;
48
49 value.init(g_value, true /* take a reference */);
50 }
51
52 void
get_header(Glib::VariantBase & value,MessageHeaderField header_field) const53 Message::get_header(Glib::VariantBase& value, MessageHeaderField header_field) const
54 {
55 GVariant* const g_value = g_dbus_message_get_header(
56 const_cast<GDBusMessage*>(gobj()), ((GDBusMessageHeaderField)(header_field)));
57
58 if (!g_value)
59 return;
60
61 value.init(g_value, true /* take a reference */);
62 }
63
64 #ifdef G_OS_UNIX
65 void
unset_unix_fd_list()66 Message::unset_unix_fd_list()
67 {
68 g_dbus_message_set_unix_fd_list(gobj(), nullptr);
69 }
70 #endif // G_OS_UNIX
71
72 } // namespace DBus
73
74 } // namespace Gio
75
76 namespace
77 {
78 } // anonymous namespace
79
80 // static
value_type()81 GType Glib::Value<Gio::DBus::CapabilityFlags>::value_type()
82 {
83 return g_dbus_capability_flags_get_type();
84 }
85
86
87 namespace Glib
88 {
89
wrap(GDBusMessage * object,bool take_copy)90 Glib::RefPtr<Gio::DBus::Message> wrap(GDBusMessage* object, bool take_copy)
91 {
92 return Glib::RefPtr<Gio::DBus::Message>( dynamic_cast<Gio::DBus::Message*> (Glib::wrap_auto ((GObject*)(object), take_copy)) );
93 //We use dynamic_cast<> in case of multiple inheritance.
94 }
95
96 } /* namespace Glib */
97
98
99 namespace Gio
100 {
101
102 namespace DBus
103 {
104
105
106 /* The *_Class implementation: */
107
init()108 const Glib::Class& Message_Class::init()
109 {
110 if(!gtype_) // create the GType if necessary
111 {
112 // Glib::Class has to know the class init function to clone custom types.
113 class_init_func_ = &Message_Class::class_init_function;
114
115 // This is actually just optimized away, apparently with no harm.
116 // Make sure that the parent type has been created.
117 //CppClassParent::CppObjectType::get_type();
118
119 // Create the wrapper type, with the same class/instance size as the base type.
120 register_derived_type(g_dbus_message_get_type());
121
122 // Add derived versions of interfaces, if the C type implements any interfaces:
123
124 }
125
126 return *this;
127 }
128
129
class_init_function(void * g_class,void * class_data)130 void Message_Class::class_init_function(void* g_class, void* class_data)
131 {
132 const auto klass = static_cast<BaseClassType*>(g_class);
133 CppClassParent::class_init_function(klass, class_data);
134
135
136 }
137
138
wrap_new(GObject * object)139 Glib::ObjectBase* Message_Class::wrap_new(GObject* object)
140 {
141 return new Message((GDBusMessage*)object);
142 }
143
144
145 /* The implementation: */
146
gobj_copy()147 GDBusMessage* Message::gobj_copy()
148 {
149 reference();
150 return gobj();
151 }
152
Message(const Glib::ConstructParams & construct_params)153 Message::Message(const Glib::ConstructParams& construct_params)
154 :
155 Glib::Object(construct_params)
156 {
157
158 }
159
Message(GDBusMessage * castitem)160 Message::Message(GDBusMessage* castitem)
161 :
162 Glib::Object((GObject*)(castitem))
163 {}
164
165
Message(Message && src)166 Message::Message(Message&& src) noexcept
167 : Glib::Object(std::move(src))
168 {}
169
operator =(Message && src)170 Message& Message::operator=(Message&& src) noexcept
171 {
172 Glib::Object::operator=(std::move(src));
173 return *this;
174 }
175
176
~Message()177 Message::~Message() noexcept
178 {}
179
180
181 Message::CppClassType Message::message_class_; // initialize static member
182
get_type()183 GType Message::get_type()
184 {
185 return message_class_.init().get_type();
186 }
187
188
get_base_type()189 GType Message::get_base_type()
190 {
191 return g_dbus_message_get_type();
192 }
193
194
Message()195 Message::Message()
196 :
197 // Mark this class as non-derived to allow C++ vfuncs to be skipped.
198 Glib::ObjectBase(nullptr),
199 Glib::Object(Glib::ConstructParams(message_class_.init()))
200 {
201
202
203 }
204
create()205 Glib::RefPtr<Message> Message::create()
206 {
207 return Glib::RefPtr<Message>( new Message() );
208 }
209
create_signal(const Glib::ustring & path,const Glib::ustring & iface,const Glib::ustring & signal)210 Glib::RefPtr<Message> Message::create_signal(const Glib::ustring& path, const Glib::ustring& iface, const Glib::ustring& signal)
211 {
212 return Glib::wrap(g_dbus_message_new_signal(path.c_str(), iface.c_str(), signal.c_str()));
213 }
214
create_method_call(const Glib::ustring & name,const Glib::ustring & path,const Glib::ustring & iface,const Glib::ustring & method)215 Glib::RefPtr<Message> Message::create_method_call(const Glib::ustring& name, const Glib::ustring& path, const Glib::ustring& iface, const Glib::ustring& method)
216 {
217 return Glib::wrap(g_dbus_message_new_method_call(name.c_str(), path.c_str(), iface.c_str(), method.c_str()));
218 }
219
create_method_reply(const Glib::RefPtr<Message> & method_call_message)220 Glib::RefPtr<Message> Message::create_method_reply(const Glib::RefPtr<Message>& method_call_message)
221 {
222 return Glib::wrap(g_dbus_message_new_method_reply(Glib::unwrap(method_call_message)));
223 }
224
create_method_error_literal(const Glib::RefPtr<const Message> & method_call_message,const Glib::ustring & error_name,const Glib::ustring & error_message)225 Glib::RefPtr<Message> Message::create_method_error_literal(const Glib::RefPtr<const Message>& method_call_message, const Glib::ustring& error_name, const Glib::ustring& error_message)
226 {
227 return Glib::wrap(g_dbus_message_new_method_error_literal(const_cast<GDBusMessage*>(Glib::unwrap(method_call_message)), error_name.c_str(), error_message.c_str()));
228 }
229
create_from_blob(const guchar * blob,gsize blob_len,CapabilityFlags capabilities)230 Glib::RefPtr<Message> Message::create_from_blob(const guchar* blob, gsize blob_len, CapabilityFlags capabilities)
231 {
232 GError* gerror = nullptr;
233 Glib::RefPtr<Message> retvalue = Glib::wrap(g_dbus_message_new_from_blob(const_cast<guchar*>(blob), blob_len, ((GDBusCapabilityFlags)(capabilities)), &(gerror)));
234 if(gerror)
235 ::Glib::Error::throw_exception(gerror);
236 return retvalue;
237 }
238
print(guint indent)239 Glib::ustring Message::print(guint indent)
240 {
241 return Glib::convert_return_gchar_ptr_to_ustring(g_dbus_message_print(gobj(), indent));
242 }
243
get_locked() const244 bool Message::get_locked() const
245 {
246 return g_dbus_message_get_locked(const_cast<GDBusMessage*>(gobj()));
247 }
248
lock()249 void Message::lock()
250 {
251 g_dbus_message_lock(gobj());
252 }
253
copy() const254 Glib::RefPtr<Message> Message::copy() const
255 {
256 GError* gerror = nullptr;
257 Glib::RefPtr<Message> retvalue = Glib::wrap(g_dbus_message_copy(const_cast<GDBusMessage*>(gobj()), &(gerror)));
258 if(gerror)
259 ::Glib::Error::throw_exception(gerror);
260 return retvalue;
261 }
262
get_message_type() const263 MessageType Message::get_message_type() const
264 {
265 return ((MessageType)(g_dbus_message_get_message_type(const_cast<GDBusMessage*>(gobj()))));
266 }
267
set_message_type(MessageType type)268 void Message::set_message_type(MessageType type)
269 {
270 g_dbus_message_set_message_type(gobj(), ((GDBusMessageType)(type)));
271 }
272
get_byte_order() const273 ByteOrder Message::get_byte_order() const
274 {
275 return (ByteOrder)(g_dbus_message_get_byte_order(const_cast<GDBusMessage*>(gobj())));
276 }
277
set_byte_order(ByteOrder byte_order)278 void Message::set_byte_order(ByteOrder byte_order)
279 {
280 g_dbus_message_set_byte_order(gobj(), (GDBusMessageByteOrder)(byte_order));
281 }
282
get_serial() const283 guint32 Message::get_serial() const
284 {
285 return g_dbus_message_get_serial(const_cast<GDBusMessage*>(gobj()));
286 }
287
set_serial(guint32 serial)288 void Message::set_serial(guint32 serial)
289 {
290 g_dbus_message_set_serial(gobj(), serial);
291 }
292
get_flags() const293 MessageFlags Message::get_flags() const
294 {
295 return ((MessageFlags)(g_dbus_message_get_flags(const_cast<GDBusMessage*>(gobj()))));
296 }
297
set_flags(MessageFlags flags)298 void Message::set_flags(MessageFlags flags)
299 {
300 g_dbus_message_set_flags(gobj(), ((GDBusMessageFlags)(flags)));
301 }
302
set_body(const Glib::VariantBase & body)303 void Message::set_body(const Glib::VariantBase& body)
304 {
305 g_dbus_message_set_body(gobj(), const_cast<GVariant*>((body).gobj()));
306 }
307
308 #ifdef G_OS_UNIX
get_unix_fd_list()309 Glib::RefPtr<UnixFDList> Message::get_unix_fd_list()
310 {
311 Glib::RefPtr<UnixFDList> retvalue = Glib::wrap(g_dbus_message_get_unix_fd_list(gobj()));
312 if(retvalue)
313 retvalue->reference(); //The function does not do a ref for us.
314 return retvalue;
315 }
316 #endif // G_OS_UNIX
317
318 #ifdef G_OS_UNIX
get_unix_fd_list() const319 Glib::RefPtr<const UnixFDList> Message::get_unix_fd_list() const
320 {
321 return const_cast<Message*>(this)->get_unix_fd_list();
322 }
323 #endif // G_OS_UNIX
324
325 #ifdef G_OS_UNIX
set_unix_fd_list(const Glib::RefPtr<UnixFDList> & fd_list)326 void Message::set_unix_fd_list(const Glib::RefPtr<UnixFDList>& fd_list)
327 {
328 g_dbus_message_set_unix_fd_list(gobj(), Glib::unwrap(fd_list));
329 }
330 #endif // G_OS_UNIX
331
get_num_unix_fds() const332 guint32 Message::get_num_unix_fds() const
333 {
334 return g_dbus_message_get_num_unix_fds(const_cast<GDBusMessage*>(gobj()));
335 }
336
set_num_unix_fds(guint32 value)337 void Message::set_num_unix_fds(guint32 value)
338 {
339 g_dbus_message_set_num_unix_fds(gobj(), value);
340 }
341
set_header(MessageHeaderField header_field,const Glib::VariantBase & value)342 void Message::set_header(MessageHeaderField header_field, const Glib::VariantBase& value)
343 {
344 g_dbus_message_set_header(gobj(), ((GDBusMessageHeaderField)(header_field)), const_cast<GVariant*>((value).gobj()));
345 }
346
get_header_fields() const347 Glib::ArrayHandle<guchar> Message::get_header_fields() const
348 {
349 return Glib::ArrayHandle<guchar>(g_dbus_message_get_header_fields(const_cast<GDBusMessage*>(gobj())));
350 }
351
get_destination() const352 Glib::ustring Message::get_destination() const
353 {
354 return Glib::convert_const_gchar_ptr_to_ustring(g_dbus_message_get_destination(const_cast<GDBusMessage*>(gobj())));
355 }
356
set_destination(const Glib::ustring & value)357 void Message::set_destination(const Glib::ustring& value)
358 {
359 g_dbus_message_set_destination(gobj(), value.c_str());
360 }
361
get_error_name() const362 Glib::ustring Message::get_error_name() const
363 {
364 return Glib::convert_const_gchar_ptr_to_ustring(g_dbus_message_get_error_name(const_cast<GDBusMessage*>(gobj())));
365 }
366
set_error_name(const Glib::ustring & value)367 void Message::set_error_name(const Glib::ustring& value)
368 {
369 g_dbus_message_set_error_name(gobj(), value.c_str());
370 }
371
get_interface() const372 Glib::ustring Message::get_interface() const
373 {
374 return Glib::convert_const_gchar_ptr_to_ustring(g_dbus_message_get_interface(const_cast<GDBusMessage*>(gobj())));
375 }
376
set_interface(const Glib::ustring & value)377 void Message::set_interface(const Glib::ustring& value)
378 {
379 g_dbus_message_set_interface(gobj(), value.c_str());
380 }
381
get_member() const382 Glib::ustring Message::get_member() const
383 {
384 return Glib::convert_const_gchar_ptr_to_ustring(g_dbus_message_get_member(const_cast<GDBusMessage*>(gobj())));
385 }
386
set_member(const Glib::ustring & value)387 void Message::set_member(const Glib::ustring& value)
388 {
389 g_dbus_message_set_member(gobj(), value.c_str());
390 }
391
get_path() const392 Glib::ustring Message::get_path() const
393 {
394 return Glib::convert_const_gchar_ptr_to_ustring(g_dbus_message_get_path(const_cast<GDBusMessage*>(gobj())));
395 }
396
set_path(const Glib::ustring & value)397 void Message::set_path(const Glib::ustring& value)
398 {
399 g_dbus_message_set_path(gobj(), value.c_str());
400 }
401
get_reply_serial() const402 guint32 Message::get_reply_serial() const
403 {
404 return g_dbus_message_get_reply_serial(const_cast<GDBusMessage*>(gobj()));
405 }
406
set_reply_serial(guint32 value)407 void Message::set_reply_serial(guint32 value)
408 {
409 g_dbus_message_set_reply_serial(gobj(), value);
410 }
411
get_sender() const412 Glib::ustring Message::get_sender() const
413 {
414 return Glib::convert_const_gchar_ptr_to_ustring(g_dbus_message_get_sender(const_cast<GDBusMessage*>(gobj())));
415 }
416
set_sender(const Glib::ustring & value)417 void Message::set_sender(const Glib::ustring& value)
418 {
419 g_dbus_message_set_sender(gobj(), value.c_str());
420 }
421
get_signature() const422 Glib::ustring Message::get_signature() const
423 {
424 return Glib::convert_const_gchar_ptr_to_ustring(g_dbus_message_get_signature(const_cast<GDBusMessage*>(gobj())));
425 }
426
set_signature(const Glib::ustring & value)427 void Message::set_signature(const Glib::ustring& value)
428 {
429 g_dbus_message_set_signature(gobj(), value.c_str());
430 }
431
get_arg0() const432 Glib::ustring Message::get_arg0() const
433 {
434 return Glib::convert_const_gchar_ptr_to_ustring(g_dbus_message_get_arg0(const_cast<GDBusMessage*>(gobj())));
435 }
436
bytes_needed(const guchar * blob,gsize blob_len)437 gssize Message::bytes_needed(const guchar* blob, gsize blob_len)
438 {
439 GError* gerror = nullptr;
440 gssize retvalue = g_dbus_message_bytes_needed(const_cast<guchar*>(blob), blob_len, &(gerror));
441 if(gerror)
442 ::Glib::Error::throw_exception(gerror);
443 return retvalue;
444 }
445
to_blob(gsize & out_size,CapabilityFlags capabilities)446 guchar* Message::to_blob(gsize& out_size, CapabilityFlags capabilities)
447 {
448 GError* gerror = nullptr;
449 guchar* retvalue = g_dbus_message_to_blob(gobj(), &(out_size), ((GDBusCapabilityFlags)(capabilities)), &(gerror));
450 if(gerror)
451 ::Glib::Error::throw_exception(gerror);
452 return retvalue;
453 }
454
to_exception()455 void Message::to_exception()
456 {
457 GError* gerror = nullptr;
458 g_dbus_message_to_gerror(gobj(), &(gerror));
459 if(gerror)
460 ::Glib::Error::throw_exception(gerror);
461 }
462
463
property_locked() const464 Glib::PropertyProxy_ReadOnly< bool > Message::property_locked() const
465 {
466 return Glib::PropertyProxy_ReadOnly< bool >(this, "locked");
467 }
468
469
470 } // namespace DBus
471
472 } // namespace Gio
473
474
475