diff options
author | Murray Cumming <murrayc@murrayc.com> | 2016-02-26 22:46:55 +0100 |
---|---|---|
committer | Murray Cumming <murrayc@murrayc.com> | 2016-02-26 22:46:55 +0100 |
commit | e1eb5c1d651a8906074feda2d2a0ad103e838949 (patch) | |
tree | e387d5498d9c2dd53170126b3497b28c25c5d47a /gio/src/dbusinterfacevtable.ccg | |
parent | dc111022570a417f396b81cdaef1a5db58022017 (diff) | |
download | glibmm-e1eb5c1d651a8906074feda2d2a0ad103e838949.tar.gz |
Run clang-format on the .ccg files.
This seems to work.
Diffstat (limited to 'gio/src/dbusinterfacevtable.ccg')
-rw-r--r-- | gio/src/dbusinterfacevtable.ccg | 95 |
1 files changed, 42 insertions, 53 deletions
diff --git a/gio/src/dbusinterfacevtable.ccg b/gio/src/dbusinterfacevtable.ccg index 9d6834c6..c6ffd89d 100644 --- a/gio/src/dbusinterfacevtable.ccg +++ b/gio/src/dbusinterfacevtable.ccg @@ -29,59 +29,53 @@ namespace { -extern "C" -{ +extern "C" { -static void DBusInterfaceVTable_MethodCall_giomm_callback( - GDBusConnection* connection, const char* sender, const char* object_path, - const char* interface_name, const char* method_name, GVariant* parameters, - GDBusMethodInvocation* invocation, void* user_data) +static void +DBusInterfaceVTable_MethodCall_giomm_callback(GDBusConnection* connection, const char* sender, + const char* object_path, const char* interface_name, const char* method_name, + GVariant* parameters, GDBusMethodInvocation* invocation, void* user_data) { - Gio::DBus::InterfaceVTable* vtable = - static_cast<Gio::DBus::InterfaceVTable*>(user_data); + Gio::DBus::InterfaceVTable* vtable = static_cast<Gio::DBus::InterfaceVTable*>(user_data); - Gio::DBus::InterfaceVTable::SlotInterfaceMethodCall* the_slot = - vtable->get_slot_method_call(); + Gio::DBus::InterfaceVTable::SlotInterfaceMethodCall* the_slot = vtable->get_slot_method_call(); try { // Note that we use VariantContainerBase instead of VariantBase for the // GVariant, because it is documented as being a tuple (list of values). - (*the_slot)(Glib::wrap(connection, true), (sender ? sender : ""), - object_path, interface_name, method_name, - Glib::VariantContainerBase(parameters, true), Glib::wrap(invocation, true)); + (*the_slot)(Glib::wrap(connection, true), (sender ? sender : ""), object_path, interface_name, + method_name, Glib::VariantContainerBase(parameters, true), Glib::wrap(invocation, true)); } - catch(...) + catch (...) { Glib::exception_handlers_invoke(); } } -static GVariant* DBusInterfaceVTable_GetProperty_giomm_callback( - GDBusConnection* connection, const char* sender, const char* object_path, - const char* interface_name, const char* property_name, GError** error, +static GVariant* +DBusInterfaceVTable_GetProperty_giomm_callback(GDBusConnection* connection, const char* sender, + const char* object_path, const char* interface_name, const char* property_name, GError** error, void* user_data) { - Gio::DBus::InterfaceVTable* vtable = - static_cast<Gio::DBus::InterfaceVTable*>(user_data); + Gio::DBus::InterfaceVTable* vtable = static_cast<Gio::DBus::InterfaceVTable*>(user_data); - Gio::DBus::InterfaceVTable::SlotInterfaceGetProperty* the_slot = - vtable->get_slot_get_property(); + Gio::DBus::InterfaceVTable::SlotInterfaceGetProperty* the_slot = vtable->get_slot_get_property(); try { Glib::VariantBase result; - (*the_slot)(result, Glib::wrap(connection, true), sender, object_path, - interface_name, property_name); + (*the_slot)( + result, Glib::wrap(connection, true), sender, object_path, interface_name, property_name); return result.gobj_copy(); } - catch(const Glib::Error& ex) + catch (const Glib::Error& ex) { - if(error) + if (error) *error = g_error_copy(ex.gobj()); } - catch(...) + catch (...) { Glib::exception_handlers_invoke(); } @@ -89,29 +83,26 @@ static GVariant* DBusInterfaceVTable_GetProperty_giomm_callback( return nullptr; } -static gboolean DBusInterfaceVTable_SetProperty_giomm_callback( - GDBusConnection* connection, const char* sender, const char* object_path, - const char* interface_name, const char* property_name, GVariant* value, +static gboolean +DBusInterfaceVTable_SetProperty_giomm_callback(GDBusConnection* connection, const char* sender, + const char* object_path, const char* interface_name, const char* property_name, GVariant* value, GError** error, void* user_data) { - Gio::DBus::InterfaceVTable* vtable = - static_cast<Gio::DBus::InterfaceVTable*>(user_data); + Gio::DBus::InterfaceVTable* vtable = static_cast<Gio::DBus::InterfaceVTable*>(user_data); - Gio::DBus::InterfaceVTable::SlotInterfaceSetProperty* the_slot = - vtable->get_slot_set_property(); + Gio::DBus::InterfaceVTable::SlotInterfaceSetProperty* the_slot = vtable->get_slot_set_property(); try { - return static_cast<gboolean>((*the_slot)(Glib::wrap(connection, true), - sender, object_path, interface_name, property_name, - Glib::VariantBase(value, true))); + return static_cast<gboolean>((*the_slot)(Glib::wrap(connection, true), sender, object_path, + interface_name, property_name, Glib::VariantBase(value, true))); } - catch(const Glib::Error& ex) + catch (const Glib::Error& ex) { - if(error) + if (error) *error = g_error_copy(ex.gobj()); } - catch(...) + catch (...) { Glib::exception_handlers_invoke(); } @@ -120,7 +111,6 @@ static gboolean DBusInterfaceVTable_SetProperty_giomm_callback( } } // extern "C" - } namespace Gio @@ -129,11 +119,9 @@ namespace Gio namespace DBus { -InterfaceVTable::InterfaceVTable( - const SlotInterfaceMethodCall& slot_method_call, +InterfaceVTable::InterfaceVTable(const SlotInterfaceMethodCall& slot_method_call, const SlotInterfaceGetProperty& slot_get_property, - const SlotInterfaceSetProperty& slot_set_property -) + const SlotInterfaceSetProperty& slot_set_property) : slot_method_call_(new SlotInterfaceMethodCall(slot_method_call)), slot_get_property_(new SlotInterfaceGetProperty(slot_get_property)), slot_set_property_(new SlotInterfaceSetProperty(slot_set_property)) @@ -144,17 +132,18 @@ InterfaceVTable::InterfaceVTable( } InterfaceVTable::InterfaceVTable(InterfaceVTable&& other) noexcept -: gobject_(std::move(other.gobject_)), - slot_method_call_(std::move(other.slot_method_call_)), - slot_get_property_(std::move(other.slot_get_property_)), - slot_set_property_(std::move(other.slot_set_property_)) + : gobject_(std::move(other.gobject_)), + slot_method_call_(std::move(other.slot_method_call_)), + slot_get_property_(std::move(other.slot_get_property_)), + slot_set_property_(std::move(other.slot_set_property_)) { other.slot_method_call_ = nullptr; other.slot_get_property_ = nullptr; other.slot_set_property_ = nullptr; } -InterfaceVTable& InterfaceVTable::operator=(InterfaceVTable&& other) noexcept +InterfaceVTable& +InterfaceVTable::operator=(InterfaceVTable&& other) noexcept { delete slot_method_call_; delete slot_get_property_; @@ -180,23 +169,23 @@ InterfaceVTable::~InterfaceVTable() } InterfaceVTable::SlotInterfaceMethodCall* - InterfaceVTable::get_slot_method_call() const +InterfaceVTable::get_slot_method_call() const { return slot_method_call_; } InterfaceVTable::SlotInterfaceGetProperty* - InterfaceVTable::get_slot_get_property() const +InterfaceVTable::get_slot_get_property() const { return slot_get_property_; } InterfaceVTable::SlotInterfaceSetProperty* - InterfaceVTable::get_slot_set_property() const +InterfaceVTable::get_slot_set_property() const { return slot_set_property_; } -} //namespace DBus +} // namespace DBus } // namespace Gio |