diff options
Diffstat (limited to 'gio/src')
87 files changed, 2585 insertions, 3372 deletions
diff --git a/gio/src/action.ccg b/gio/src/action.ccg index 5b5d3bd6..9dbb598a 100644 --- a/gio/src/action.ccg +++ b/gio/src/action.ccg @@ -24,7 +24,8 @@ namespace Gio { -void Action::activate() +void +Action::activate() { g_action_activate(gobj(), nullptr); } diff --git a/gio/src/actionmap.ccg b/gio/src/actionmap.ccg index 20194d43..da803bb8 100644 --- a/gio/src/actionmap.ccg +++ b/gio/src/actionmap.ccg @@ -23,105 +23,114 @@ namespace Gio { -Glib::RefPtr<SimpleAction> ActionMap::add_action(const Glib::ustring& name) +Glib::RefPtr<SimpleAction> +ActionMap::add_action(const Glib::ustring& name) { auto action = SimpleAction::create(name); add_action(action); return action; } -Glib::RefPtr<SimpleAction> ActionMap::add_action_with_parameter(const Glib::ustring& name, const ActivateWithParameterSlot& slot) +Glib::RefPtr<SimpleAction> +ActionMap::add_action_with_parameter( + const Glib::ustring& name, const ActivateWithParameterSlot& slot) { auto action = add_action(name); action->signal_activate().connect(slot); return action; } -Glib::RefPtr<SimpleAction> ActionMap::add_action(const Glib::ustring& name, const ActivateSlot& slot) +Glib::RefPtr<SimpleAction> +ActionMap::add_action(const Glib::ustring& name, const ActivateSlot& slot) { auto action = add_action(name); - action->signal_activate().connect( - sigc::hide(slot)); + action->signal_activate().connect(sigc::hide(slot)); return action; } - -Glib::RefPtr<SimpleAction> ActionMap::add_action_bool(const Glib::ustring& name, bool state) +Glib::RefPtr<SimpleAction> +ActionMap::add_action_bool(const Glib::ustring& name, bool state) { auto action = SimpleAction::create_bool(name, state); add_action(action); return action; } -//TODO: Use a slot that takes a bool? -Glib::RefPtr<SimpleAction> ActionMap::add_action_bool(const Glib::ustring& name, const ActivateSlot& slot, bool state) +// TODO: Use a slot that takes a bool? +Glib::RefPtr<SimpleAction> +ActionMap::add_action_bool(const Glib::ustring& name, const ActivateSlot& slot, bool state) { auto action = add_action_bool(name, state); - action->signal_activate().connect( - sigc::hide(slot)); + action->signal_activate().connect(sigc::hide(slot)); return action; } -//TODO: Use a slot that takes a string? -Glib::RefPtr<SimpleAction> ActionMap::add_action_radio_string(const Glib::ustring& name, const Glib::ustring& state) +// TODO: Use a slot that takes a string? +Glib::RefPtr<SimpleAction> +ActionMap::add_action_radio_string(const Glib::ustring& name, const Glib::ustring& state) { auto action = SimpleAction::create_radio_string(name, state); add_action(action); return action; } +namespace +{ -namespace { - -//Handle the normal activate signal, calling instead a slot that takes the specific type: -static void on_action_radio_string(const Glib::VariantBase& parameter, const Gio::ActionMap::ActivateWithStringParameterSlot& slot) +// Handle the normal activate signal, calling instead a slot that takes the specific type: +static void +on_action_radio_string( + const Glib::VariantBase& parameter, const Gio::ActionMap::ActivateWithStringParameterSlot& slot) { - //TODO: This syntax is odd: - const auto variantDerived = - parameter.cast_dynamic< Glib::Variant<Glib::ustring> >(parameter); + // TODO: This syntax is odd: + const auto variantDerived = parameter.cast_dynamic<Glib::Variant<Glib::ustring>>(parameter); const auto str = variantDerived.get(); slot(str); } -} //anonymous namespace +} // anonymous namespace -Glib::RefPtr<SimpleAction> ActionMap::add_action_radio_string(const Glib::ustring& name, const ActivateWithStringParameterSlot& slot, const Glib::ustring& state) +Glib::RefPtr<SimpleAction> +ActionMap::add_action_radio_string(const Glib::ustring& name, + const ActivateWithStringParameterSlot& slot, const Glib::ustring& state) { auto action = add_action_radio_string(name, state); - action->signal_activate().connect( - sigc::bind(sigc::ptr_fun(&on_action_radio_string), slot)); + action->signal_activate().connect(sigc::bind(sigc::ptr_fun(&on_action_radio_string), slot)); return action; } -namespace { +namespace +{ -//Handle the normal activate signal, calling instead a slot that takes the specific type: -static void on_action_radio_int(const Glib::VariantBase& parameter, const Gio::ActionMap::ActivateWithIntParameterSlot& slot) +// Handle the normal activate signal, calling instead a slot that takes the specific type: +static void +on_action_radio_int( + const Glib::VariantBase& parameter, const Gio::ActionMap::ActivateWithIntParameterSlot& slot) { - //TODO: This syntax is odd: - const auto variantDerived = - parameter.cast_dynamic< Glib::Variant<int> >(parameter); + // TODO: This syntax is odd: + const auto variantDerived = parameter.cast_dynamic<Glib::Variant<int>>(parameter); const auto str = variantDerived.get(); slot(str); } -} //anonymous namespace +} // anonymous namespace -//TODO: Use a slot that takes an integer? -Glib::RefPtr<SimpleAction> ActionMap::add_action_radio_integer(const Glib::ustring& name, gint32 state) +// TODO: Use a slot that takes an integer? +Glib::RefPtr<SimpleAction> +ActionMap::add_action_radio_integer(const Glib::ustring& name, gint32 state) { auto action = SimpleAction::create_radio_integer(name, state); add_action(action); return action; } -Glib::RefPtr<SimpleAction> ActionMap::add_action_radio_integer(const Glib::ustring& name, const ActivateWithIntParameterSlot& slot, gint32 state) +Glib::RefPtr<SimpleAction> +ActionMap::add_action_radio_integer( + const Glib::ustring& name, const ActivateWithIntParameterSlot& slot, gint32 state) { auto action = add_action_radio_integer(name, state); - action->signal_activate().connect( - sigc::bind(sigc::ptr_fun(&on_action_radio_int), slot)); + action->signal_activate().connect(sigc::bind(sigc::ptr_fun(&on_action_radio_int), slot)); return action; } - } // namespace Gio diff --git a/gio/src/appinfo.ccg b/gio/src/appinfo.ccg index c9c251ea..57cb8665 100644 --- a/gio/src/appinfo.ccg +++ b/gio/src/appinfo.ccg @@ -26,17 +26,14 @@ namespace Gio { Glib::RefPtr<AppInfo> -AppInfo::create_from_commandline(const std::string& commandline, - const std::string& application_name, - AppInfoCreateFlags flags) +AppInfo::create_from_commandline( + const std::string& commandline, const std::string& application_name, AppInfoCreateFlags flags) { GAppInfo* capp_info = nullptr; GError* gerror = nullptr; - capp_info = g_app_info_create_from_commandline(commandline.c_str(), - application_name.c_str(), - static_cast<GAppInfoCreateFlags>(flags), - &gerror); + capp_info = g_app_info_create_from_commandline(commandline.c_str(), application_name.c_str(), + static_cast<GAppInfoCreateFlags>(flags), &gerror); if (gerror) ::Glib::Error::throw_exception(gerror); @@ -44,62 +41,66 @@ AppInfo::create_from_commandline(const std::string& commandline, return Glib::wrap(capp_info); } -Glib::RefPtr<AppInfo> AppInfo::create_duplicate() const +Glib::RefPtr<AppInfo> +AppInfo::create_duplicate() const { - return Glib::wrap(g_app_info_dup(const_cast<GAppInfo*>(gobj()))); + return Glib::wrap(g_app_info_dup(const_cast<GAppInfo*>(gobj()))); } -bool AppInfo::launch(const Glib::RefPtr<Gio::File>& file, const Glib::RefPtr<AppLaunchContext>& launch_context) +bool +AppInfo::launch( + const Glib::RefPtr<Gio::File>& file, const Glib::RefPtr<AppLaunchContext>& launch_context) { - std::vector< Glib::RefPtr<Gio::File> > vec = {file}; + std::vector<Glib::RefPtr<Gio::File>> vec = { file }; GError* gerror = nullptr; const bool retvalue = g_app_info_launch(gobj(), - Glib::ListHandler<Glib::RefPtr<Gio::File> >::vector_to_list(vec).data(), + Glib::ListHandler<Glib::RefPtr<Gio::File>>::vector_to_list(vec).data(), Glib::unwrap(launch_context), &(gerror)); - if(gerror) + if (gerror) ::Glib::Error::throw_exception(gerror); return retvalue; } -bool AppInfo::launch(const Glib::RefPtr<Gio::File>& file) +bool +AppInfo::launch(const Glib::RefPtr<Gio::File>& file) { - std::vector< Glib::RefPtr<Gio::File> > vec = {file}; + std::vector<Glib::RefPtr<Gio::File>> vec = { file }; GError* gerror = nullptr; const bool retvalue = g_app_info_launch(gobj(), - Glib::ListHandler<Glib::RefPtr<Gio::File> >::vector_to_list(vec).data (), - nullptr, &(gerror)); - if(gerror) + Glib::ListHandler<Glib::RefPtr<Gio::File>>::vector_to_list(vec).data(), nullptr, &(gerror)); + if (gerror) ::Glib::Error::throw_exception(gerror); return retvalue; } -bool AppInfo::launch_uri(const std::string& uri, const Glib::RefPtr<AppLaunchContext>& launch_context) +bool +AppInfo::launch_uri(const std::string& uri, const Glib::RefPtr<AppLaunchContext>& launch_context) { - std::vector<std::string> vec = {uri}; + std::vector<std::string> vec = { uri }; GError* gerror = nullptr; - const bool retvalue = g_app_info_launch_uris(gobj(), - Glib::ListHandler<std::string>::vector_to_list(vec).data (), - Glib::unwrap(launch_context), &(gerror)); - if(gerror) + const bool retvalue = + g_app_info_launch_uris(gobj(), Glib::ListHandler<std::string>::vector_to_list(vec).data(), + Glib::unwrap(launch_context), &(gerror)); + if (gerror) ::Glib::Error::throw_exception(gerror); return retvalue; } -bool AppInfo::launch_uri(const std::string& uri) +bool +AppInfo::launch_uri(const std::string& uri) { - std::vector<std::string> vec = {uri}; + std::vector<std::string> vec = { uri }; GError* gerror = nullptr; - const bool retvalue = g_app_info_launch_uris(gobj(), - Glib::ListHandler<std::string>::vector_to_list(vec).data (), nullptr, - &(gerror)); - if(gerror) + const bool retvalue = g_app_info_launch_uris( + gobj(), Glib::ListHandler<std::string>::vector_to_list(vec).data(), nullptr, &(gerror)); + if (gerror) ::Glib::Error::throw_exception(gerror); return retvalue; diff --git a/gio/src/application.ccg b/gio/src/application.ccg index d8dd6e26..7b80eed1 100644 --- a/gio/src/application.ccg +++ b/gio/src/application.ccg @@ -25,7 +25,7 @@ namespace // anonymous { -//TODO: At the next ABI break, implement the pimpl idiom. Then we need not use +// TODO: At the next ABI break, implement the pimpl idiom. Then we need not use // a GQuark for ExtraApplicationData, which should be renamed to // struct Gio::Application::Impl. // These are new data members that can't be added to Gio::Application now, @@ -36,7 +36,7 @@ struct ExtraApplicationData ~ExtraApplicationData() { - for(auto str : option_entry_strings) + for (auto str : option_entry_strings) { g_free(str); } @@ -46,19 +46,21 @@ struct ExtraApplicationData GQuark quark_extra_application_data = g_quark_from_static_string("glibmm__Gio::Application::quark_extra_application_data"); -void Application_delete_extra_application_data(gpointer data) +void +Application_delete_extra_application_data(gpointer data) { ExtraApplicationData* extra_application_data = static_cast<ExtraApplicationData*>(data); delete extra_application_data; } -static void Application_signal_open_callback(GApplication* self, GFile** files, - gint n_files, const gchar* hint, void* data) +static void +Application_signal_open_callback( + GApplication* self, GFile** files, gint n_files, const gchar* hint, void* data) { - typedef sigc::slot< void, const Gio::Application::type_vec_files&, const Glib::ustring& > SlotType; + typedef sigc::slot<void, const Gio::Application::type_vec_files&, const Glib::ustring&> SlotType; Gio::Application::type_vec_files vec_files(n_files); - for(int i = 0; i < n_files; ++i) + for (int i = 0; i < n_files; ++i) { vec_files[i] = Glib::wrap(files[i], true); } @@ -66,16 +68,17 @@ static void Application_signal_open_callback(GApplication* self, GFile** files, const auto hint_str = (hint ? hint : Glib::ustring()); // Do not try to call a signal on a disassociated wrapper. - if(Glib::ObjectBase::_get_current_wrapper((GObject*) self)) + if (Glib::ObjectBase::_get_current_wrapper((GObject*)self)) { try { - if(const auto slot = Glib::SignalProxyNormal::data_to_slot(data)) { + if (const auto slot = Glib::SignalProxyNormal::data_to_slot(data)) + { (*static_cast<SlotType*>(slot))(vec_files, hint_str); return; } } - catch(...) + catch (...) { Glib::exception_handlers_invoke(); } @@ -84,11 +87,12 @@ static void Application_signal_open_callback(GApplication* self, GFile** files, return; } -static void Application_signal_open_notify_callback(GApplication* self, GFile** files, - gint n_files, const gchar *hint, void* data) +static void +Application_signal_open_notify_callback( + GApplication* self, GFile** files, gint n_files, const gchar* hint, void* data) { using namespace Gio; - typedef sigc::slot< void, const Application::type_vec_files&, const Glib::ustring& > SlotType; + typedef sigc::slot<void, const Application::type_vec_files&, const Glib::ustring&> SlotType; Application::type_vec_files vec_files(n_files); for (int i = 0; i < n_files; i++) @@ -99,17 +103,17 @@ static void Application_signal_open_notify_callback(GApplication* self, GFile** const auto hint_str = (hint ? hint : Glib::ustring()); // Do not try to call a signal on a disassociated wrapper. - if(Glib::ObjectBase::_get_current_wrapper((GObject*) self)) + if (Glib::ObjectBase::_get_current_wrapper((GObject*)self)) { try { - if(const auto slot = Glib::SignalProxyNormal::data_to_slot(data)) + if (const auto slot = Glib::SignalProxyNormal::data_to_slot(data)) { (*static_cast<SlotType*>(slot))(vec_files, hint_str); return; } } - catch(...) + catch (...) { Glib::exception_handlers_invoke(); } @@ -118,12 +122,9 @@ static void Application_signal_open_notify_callback(GApplication* self, GFile** return; } -static const Glib::SignalProxyInfo Application_signal_open_info = -{ - "open", - (GCallback) &Application_signal_open_callback, - (GCallback) &Application_signal_open_notify_callback -}; +static const Glib::SignalProxyInfo Application_signal_open_info = { "open", + (GCallback)&Application_signal_open_callback, + (GCallback)&Application_signal_open_notify_callback }; // The add_main_option_entry*() methods that take a slot parameter are handled // similarly to the corresponding Glib::OptionGroup::add_entry*() methods. @@ -143,7 +144,8 @@ public: short_name_(short_name), slot_string_(new Glib::OptionGroup::SlotOptionArgString(slot)), slot_filename_(nullptr) - { } + { + } explicit OptionArgCallbackData(const Gio::Application* application, gchar short_name, const Glib::OptionGroup::SlotOptionArgFilename& slot) @@ -151,17 +153,19 @@ public: short_name_(short_name), slot_string_(nullptr), slot_filename_(new Glib::OptionGroup::SlotOptionArgFilename(slot)) - { } + { + } - const Gio::Application* get_application() const { return application_; } + const Gio::Application* get_application() const { return application_; } gchar get_short_name() const { return short_name_; } bool is_filename_option() const { return slot_filename_ != nullptr; } - const Glib::OptionGroup::SlotOptionArgString* get_slot_string() const - { return slot_string_; } + const Glib::OptionGroup::SlotOptionArgString* get_slot_string() const { return slot_string_; } const Glib::OptionGroup::SlotOptionArgFilename* get_slot_filename() const - { return slot_filename_; } + { + return slot_filename_; + } ~OptionArgCallbackData() { @@ -189,8 +193,9 @@ OptionArgCallbackDataMap option_arg_callback_data; // Accesses to option_arg_callback_data must be thread-safe. std::mutex option_arg_callback_data_mutex; -gboolean Application_option_arg_callback(const gchar* option_name, const gchar* value, - gpointer /* data */, GError** error) +gboolean +Application_option_arg_callback( + const gchar* option_name, const gchar* value, gpointer /* data */, GError** error) { const Glib::ustring cpp_option_name(option_name); @@ -201,15 +206,15 @@ gboolean Application_option_arg_callback(const gchar* option_name, const gchar* if (option_name[1] == '-') { // Long option name. - const auto long_option_name = Glib::ustring(option_name+2); + const auto long_option_name = Glib::ustring(option_name + 2); iterFind = option_arg_callback_data.find(long_option_name); } else { // Short option name. const auto short_option_name = option_name[1]; - for (iterFind = option_arg_callback_data.begin(); - iterFind != option_arg_callback_data.end(); ++iterFind) + for (iterFind = option_arg_callback_data.begin(); iterFind != option_arg_callback_data.end(); + ++iterFind) { if (iterFind->second->get_short_name() == short_option_name) break; @@ -219,7 +224,9 @@ gboolean Application_option_arg_callback(const gchar* option_name, const gchar* if (iterFind == option_arg_callback_data.end()) { Glib::OptionError(Glib::OptionError::UNKNOWN_OPTION, "Application_option_arg_callback(): " - "Unknown option " + cpp_option_name).propagate(error); + "Unknown option " + + cpp_option_name) + .propagate(error); return false; } @@ -258,24 +265,20 @@ gboolean Application_option_arg_callback(const gchar* option_name, const gchar* namespace Gio { - -const Glib::Class& Application::custom_class_init() +const Glib::Class& +Application::custom_class_init() { Glib::init(); Gio::init(); return application_class_.init(); } - Application::Application(const Glib::ustring& application_id, ApplicationFlags flags) -: - // Mark this class as non-derived to allow C++ vfuncs to be skipped. +: // Mark this class as non-derived to allow C++ vfuncs to be skipped. Glib::ObjectBase(nullptr), Glib::Object(Glib::ConstructParams(custom_class_init(), "application_id", - Glib::c_str_or_nullptr(application_id), - "flags", ((GApplicationFlags)(flags)), nullptr)) + Glib::c_str_or_nullptr(application_id), "flags", ((GApplicationFlags)(flags)), nullptr)) { - } Application::~Application() noexcept @@ -295,17 +298,18 @@ Application::~Application() noexcept } } -//static -void Application::unset_default() +// static +void +Application::unset_default() { g_application_set_default(nullptr); } -void Application_Class::open_callback(GApplication* self, GFile** files, - gint n_files, const gchar *hint) +void +Application_Class::open_callback(GApplication* self, GFile** files, gint n_files, const gchar* hint) { - const auto obj_base = static_cast<Glib::ObjectBase*>( - Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + const auto obj_base = + static_cast<Glib::ObjectBase*>(Glib::ObjectBase::_get_current_wrapper((GObject*)self)); // Non-gtkmmproc-generated custom classes implicitly call the default // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- @@ -313,16 +317,17 @@ void Application_Class::open_callback(GApplication* self, GFile** files, // parameter conversions if there is no possibility of the virtual function // being overridden: - if(obj_base && obj_base->is_derived_()) + if (obj_base && obj_base->is_derived_()) { const auto obj = dynamic_cast<CppObjectType* const>(obj_base); - if(obj) // This can be nullptr during destruction. + if (obj) // This can be nullptr during destruction. { try // Trap C++ exceptions which would normally be lost because this is a C callback. { // Call the virtual member method, which derived classes might override. Application::type_vec_files vec_files(n_files); - for (int i = 0; i < n_files; i++) { + for (int i = 0; i < n_files; i++) + { vec_files[i] = Glib::wrap(files[i], true); } @@ -331,66 +336,72 @@ void Application_Class::open_callback(GApplication* self, GFile** files, obj->on_open(vec_files, hint_str); return; } - catch(...) + catch (...) { Glib::exception_handlers_invoke(); } } } - const auto base = static_cast<BaseClassType*>( - g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). + const auto base = static_cast<BaseClassType*>(g_type_class_peek_parent(G_OBJECT_GET_CLASS( + self)) // Get the parent class of the object class (The original underlying C class). ); // Call the original underlying C function: - if(base && base->open) + if (base && base->open) (*base->open)(self, files, n_files, hint); } -Glib::SignalProxy< void, const Application::type_vec_files&, const Glib::ustring& > Application::signal_open() +Glib::SignalProxy<void, const Application::type_vec_files&, const Glib::ustring&> +Application::signal_open() { - return Glib::SignalProxy< void, const Application::type_vec_files&, const Glib::ustring& >(this, &Application_signal_open_info); + return Glib::SignalProxy<void, const Application::type_vec_files&, const Glib::ustring&>( + this, &Application_signal_open_info); } -void Gio::Application::on_open(const Application::type_vec_files& files, const Glib::ustring& hint) +void +Gio::Application::on_open(const Application::type_vec_files& files, const Glib::ustring& hint) { - const auto base = static_cast<BaseClassType*>( - g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class). - ); + const auto base = static_cast<BaseClassType*>(g_type_class_peek_parent(G_OBJECT_GET_CLASS( + gobject_)) // Get the parent class of the object class (The original underlying C class). + ); - if(base && base->open) { + if (base && base->open) + { (*base->open)(gobj(), - Glib::ArrayHandler<type_vec_files::value_type>::vector_to_array(files).data(), - files.size(), + Glib::ArrayHandler<type_vec_files::value_type>::vector_to_array(files).data(), files.size(), hint.c_str()); } } -void Application::open(const type_vec_files& files, const Glib::ustring& hint) +void +Application::open(const type_vec_files& files, const Glib::ustring& hint) { g_application_open(gobj(), - Glib::ArrayHandler<type_vec_files::value_type>::vector_to_array(files).data(), - files.size(), + Glib::ArrayHandler<type_vec_files::value_type>::vector_to_array(files).data(), files.size(), hint.c_str()); } -void Application::open(const Glib::RefPtr<Gio::File>& file, const Glib::ustring& hint) +void +Application::open(const Glib::RefPtr<Gio::File>& file, const Glib::ustring& hint) { type_vec_files files(1); files[0] = file; open(files, hint); } -void Application::add_main_option_entry(OptionType arg_type, const Glib::ustring& long_name, - gchar short_name, const Glib::ustring& description, const Glib::ustring& arg_description, int flags) +void +Application::add_main_option_entry(OptionType arg_type, const Glib::ustring& long_name, + gchar short_name, const Glib::ustring& description, const Glib::ustring& arg_description, + int flags) { - add_main_option_entry_private((GOptionArg)arg_type, long_name, short_name, - description, arg_description, flags); + add_main_option_entry_private( + (GOptionArg)arg_type, long_name, short_name, description, arg_description, flags); } -void Application::add_main_option_entry( - const Glib::OptionGroup::SlotOptionArgString& slot, const Glib::ustring& long_name, - gchar short_name, const Glib::ustring& description, +void +Application::add_main_option_entry(const Glib::OptionGroup::SlotOptionArgString& slot, + const Glib::ustring& long_name, gchar short_name, const Glib::ustring& description, const Glib::ustring& arg_description, int flags) { { @@ -403,13 +414,13 @@ void Application::add_main_option_entry( option_arg_callback_data[long_name] = callback_data; } // option_arg_callback_data_mutex.unlock() - add_main_option_entry_private(G_OPTION_ARG_CALLBACK, long_name, short_name, - description, arg_description, flags & ~Glib::OptionEntry::FLAG_FILENAME); + add_main_option_entry_private(G_OPTION_ARG_CALLBACK, long_name, short_name, description, + arg_description, flags & ~Glib::OptionEntry::FLAG_FILENAME); } -void Application::add_main_option_entry_filename( - const Glib::OptionGroup::SlotOptionArgFilename& slot, const Glib::ustring& long_name, - gchar short_name, const Glib::ustring& description, +void +Application::add_main_option_entry_filename(const Glib::OptionGroup::SlotOptionArgFilename& slot, + const Glib::ustring& long_name, gchar short_name, const Glib::ustring& description, const Glib::ustring& arg_description, int flags) { { @@ -422,14 +433,17 @@ void Application::add_main_option_entry_filename( option_arg_callback_data[long_name] = callback_data; } // option_arg_callback_data_mutex.unlock() - add_main_option_entry_private(G_OPTION_ARG_CALLBACK, long_name, short_name, - description, arg_description, flags | Glib::OptionEntry::FLAG_FILENAME); + add_main_option_entry_private(G_OPTION_ARG_CALLBACK, long_name, short_name, description, + arg_description, flags | Glib::OptionEntry::FLAG_FILENAME); } -void Application::add_main_option_entry_private(GOptionArg arg, const Glib::ustring& long_name, - gchar short_name, const Glib::ustring& description, const Glib::ustring& arg_description, int flags) +void +Application::add_main_option_entry_private(GOptionArg arg, const Glib::ustring& long_name, + gchar short_name, const Glib::ustring& description, const Glib::ustring& arg_description, + int flags) { - // Create a temporary array, just so we can give the correct thing to g_application_add_main_option_entries(): + // Create a temporary array, just so we can give the correct thing to + // g_application_add_main_option_entries(): GOptionEntry array[2]; std::memset(array, 0, 2 * sizeof(GOptionEntry)); // null-termination @@ -485,7 +499,8 @@ void Application::add_main_option_entry_private(GOptionArg arg, const Glib::ustr g_application_add_main_option_entries(gobj(), array); } -void Application::unset_resource_base_path() +void +Application::unset_resource_base_path() { g_application_set_resource_base_path(gobj(), nullptr /* see the C docs. */); } diff --git a/gio/src/applicationcommandline.ccg b/gio/src/applicationcommandline.ccg index 1e16f2de..7fbee67e 100644 --- a/gio/src/applicationcommandline.ccg +++ b/gio/src/applicationcommandline.ccg @@ -21,14 +21,16 @@ namespace Gio { -void ApplicationCommandLine::print(const Glib::ustring& message) +void +ApplicationCommandLine::print(const Glib::ustring& message) { g_application_command_line_print(gobj(), "%s", message.c_str()); } -void ApplicationCommandLine::printerr(const Glib::ustring& message) +void +ApplicationCommandLine::printerr(const Glib::ustring& message) { g_application_command_line_printerr(gobj(), "%s", message.c_str()); } -} //namespace Gio +} // namespace Gio diff --git a/gio/src/asyncinitable.ccg b/gio/src/asyncinitable.ccg index 6710c170..79960709 100644 --- a/gio/src/asyncinitable.ccg +++ b/gio/src/asyncinitable.ccg @@ -24,58 +24,57 @@ namespace Gio { -void AsyncInitable::init_async(const SlotAsyncReady& slot, - const Glib::RefPtr<Cancellable>& cancellable, int io_priority) +void +AsyncInitable::init_async( + const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, int io_priority) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. auto slot_copy = new SlotAsyncReady(slot); - g_async_initable_init_async(gobj(), io_priority, Glib::unwrap(cancellable), - &SignalProxy_async_callback, slot_copy); + g_async_initable_init_async( + gobj(), io_priority, Glib::unwrap(cancellable), &SignalProxy_async_callback, slot_copy); } -void AsyncInitable::init_async(const SlotAsyncReady& slot, int io_priority) +void +AsyncInitable::init_async(const SlotAsyncReady& slot, int io_priority) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. auto slot_copy = new SlotAsyncReady(slot); - g_async_initable_init_async(gobj(), io_priority, nullptr, - &SignalProxy_async_callback, slot_copy); + g_async_initable_init_async(gobj(), io_priority, nullptr, &SignalProxy_async_callback, slot_copy); } -void AsyncInitable_Class::init_async_vfunc_callback(GAsyncInitable* self, - int io_priority, GCancellable* cancellable, GAsyncReadyCallback callback, - gpointer user_data) +void +AsyncInitable_Class::init_async_vfunc_callback(GAsyncInitable* self, int io_priority, + GCancellable* cancellable, GAsyncReadyCallback callback, gpointer user_data) { - const auto obj_base = static_cast<Glib::ObjectBase*>( - Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + const auto obj_base = + static_cast<Glib::ObjectBase*>(Glib::ObjectBase::_get_current_wrapper((GObject*)self)); // Non-gtkmmproc-generated custom classes implicitly call the default // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- // generated classes can use this optimisation, which avoids the unnecessary // parameter conversions if there is no possibility of the virtual function // being overridden: - if(obj_base && obj_base->is_derived_()) + if (obj_base && obj_base->is_derived_()) { const auto obj = dynamic_cast<CppObjectType* const>(obj_base); - if(obj) // This can be nullptr during destruction. + if (obj) // This can be nullptr during destruction. { try // Trap C++ exceptions which would normally be lost because this is a C callback. { // Get the slot. - Gio::SlotAsyncReady* the_slot = - static_cast<Gio::SlotAsyncReady*>(user_data); + Gio::SlotAsyncReady* the_slot = static_cast<Gio::SlotAsyncReady*>(user_data); // Call the virtual member method, which derived classes might override. - obj->init_async_vfunc(*the_slot, Glib::wrap(cancellable, true), - io_priority); + obj->init_async_vfunc(*the_slot, Glib::wrap(cancellable, true), io_priority); return; } - catch(...) + catch (...) { Glib::exception_handlers_invoke(); } @@ -83,52 +82,56 @@ void AsyncInitable_Class::init_async_vfunc_callback(GAsyncInitable* self, } const auto base = static_cast<BaseClassType*>( - g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). -g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. -) ); + g_type_interface_peek_parent( // Get the parent interface of the interface (The original + // underlying C interface). + g_type_interface_peek( + G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. + )); // Call the original underlying C function: - if(base && base->init_async) + if (base && base->init_async) (*base->init_async)(self, io_priority, cancellable, callback, user_data); - } -void Gio::AsyncInitable::init_async_vfunc(const SlotAsyncReady& slot, - const Glib::RefPtr<Cancellable>& cancellable, int io_priority) +void +Gio::AsyncInitable::init_async_vfunc( + const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, int io_priority) { const auto base = static_cast<BaseClassType*>( - g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). -g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. -) ); + g_type_interface_peek_parent( // Get the parent interface of the interface (The original + // underlying C interface). + g_type_interface_peek( + G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. + )); - if(base && base->init_async) + if (base && base->init_async) { - (*base->init_async)(gobj(), io_priority, - const_cast<GCancellable*>(Glib::unwrap(cancellable)), + (*base->init_async)(gobj(), io_priority, const_cast<GCancellable*>(Glib::unwrap(cancellable)), &SignalProxy_async_callback, const_cast<SlotAsyncReady*>(&slot)); } } -gboolean AsyncInitable_Class::init_finish_vfunc_callback(GAsyncInitable* self, - GAsyncResult* res, GError** error) +gboolean +AsyncInitable_Class::init_finish_vfunc_callback( + GAsyncInitable* self, GAsyncResult* res, GError** error) { - const auto obj_base = static_cast<Glib::ObjectBase*>( - Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + const auto obj_base = + static_cast<Glib::ObjectBase*>(Glib::ObjectBase::_get_current_wrapper((GObject*)self)); // Non-gtkmmproc-generated custom classes implicitly call the default // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- // generated classes can use this optimisation, which avoids the unnecessary // parameter conversions if there is no possibility of the virtual function // being overridden: - if(obj_base && obj_base->is_derived_()) + if (obj_base && obj_base->is_derived_()) { const auto obj = dynamic_cast<CppObjectType* const>(obj_base); - if(obj) // This can be nullptr during destruction. + if (obj) // This can be nullptr during destruction. { try // Trap C++ exceptions which would normally be lost because this is a C callback. { // Call the virtual member method, which derived classes might override. return static_cast<int>(obj->init_finish_vfunc(Glib::wrap(res, true))); } - catch(...) + catch (...) { Glib::exception_handlers_invoke(); } @@ -136,33 +139,36 @@ gboolean AsyncInitable_Class::init_finish_vfunc_callback(GAsyncInitable* self, } const auto base = static_cast<BaseClassType*>( - g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). -g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. -) ); + g_type_interface_peek_parent( // Get the parent interface of the interface (The original + // underlying C interface). + g_type_interface_peek( + G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface. + )); // Call the original underlying C function: - if(base && base->init_finish) + if (base && base->init_finish) return (*base->init_finish)(self, res, error); - typedef gboolean RType; return RType(); } -bool Gio::AsyncInitable::init_finish_vfunc(const Glib::RefPtr<AsyncResult>& res) +bool +Gio::AsyncInitable::init_finish_vfunc(const Glib::RefPtr<AsyncResult>& res) { const auto base = static_cast<BaseClassType*>( - g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface). -g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. -) ); + g_type_interface_peek_parent( // Get the parent interface of the interface (The original + // underlying C interface). + g_type_interface_peek( + G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface. + )); - if(base && base->init_finish) + if (base && base->init_finish) { GError* gerror = nullptr; - bool const result = (*base->init_finish)(gobj(), Glib::unwrap(res), - &gerror); + bool const result = (*base->init_finish)(gobj(), Glib::unwrap(res), &gerror); - if(gerror) + if (gerror) ::Glib::Error::throw_exception(gerror); return result; diff --git a/gio/src/asyncresult.ccg b/gio/src/asyncresult.ccg index d6a4e463..252fb872 100644 --- a/gio/src/asyncresult.ccg +++ b/gio/src/asyncresult.ccg @@ -24,22 +24,26 @@ namespace Gio { -static GObject* unwrap_objectbase_custom(const Glib::RefPtr<Glib::ObjectBase>& cpp_instance) +static GObject* +unwrap_objectbase_custom(const Glib::RefPtr<Glib::ObjectBase>& cpp_instance) { return (cpp_instance ? cpp_instance->gobj() : nullptr); } -Glib::RefPtr<Glib::ObjectBase> AsyncResult::get_source_object_base() +Glib::RefPtr<Glib::ObjectBase> +AsyncResult::get_source_object_base() { auto cobj = g_async_result_get_source_object(gobj()); - auto cppobj = Glib::wrap_auto(cobj); //ObjectBase::_get_current_wrapper(cobj); - return Glib::RefPtr<Glib::ObjectBase>(cppobj); //g_async_result_get_source_object() gives us a ref, unusually. - //TODO: For some reason this fails: Glib::wrap(cobj); + auto cppobj = Glib::wrap_auto(cobj); // ObjectBase::_get_current_wrapper(cobj); + return Glib::RefPtr<Glib::ObjectBase>( + cppobj); // g_async_result_get_source_object() gives us a ref, unusually. + // TODO: For some reason this fails: Glib::wrap(cobj); } -Glib::RefPtr<const Glib::ObjectBase> AsyncResult::get_source_object_base() const +Glib::RefPtr<const Glib::ObjectBase> +AsyncResult::get_source_object_base() const { return const_cast<AsyncResult*>(this)->get_source_object_base(); } -} //namespace Gio +} // namespace Gio diff --git a/gio/src/bufferedinputstream.ccg b/gio/src/bufferedinputstream.ccg index 11e7d400..862db1c5 100644 --- a/gio/src/bufferedinputstream.ccg +++ b/gio/src/bufferedinputstream.ccg @@ -23,44 +23,35 @@ namespace Gio { -Glib::RefPtr<BufferedInputStream> BufferedInputStream::create_sized(const Glib::RefPtr<InputStream>& base_stream, gsize buffer_size) +Glib::RefPtr<BufferedInputStream> +BufferedInputStream::create_sized(const Glib::RefPtr<InputStream>& base_stream, gsize buffer_size) { return Glib::RefPtr<Gio::BufferedInputStream>(new BufferedInputStream(base_stream, buffer_size)); } -void BufferedInputStream::fill_async(const SlotAsyncReady& slot, - gssize count, - const Glib::RefPtr<Cancellable>& cancellable, - int io_priority) +void +BufferedInputStream::fill_async(const SlotAsyncReady& slot, gssize count, + const Glib::RefPtr<Cancellable>& cancellable, int io_priority) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - auto slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); - g_buffered_input_stream_fill_async(gobj(), - count, - io_priority, - Glib::unwrap(cancellable), - &SignalProxy_async_callback, - slot_copy); + g_buffered_input_stream_fill_async( + gobj(), count, io_priority, Glib::unwrap(cancellable), &SignalProxy_async_callback, slot_copy); } -void BufferedInputStream::fill_async(const SlotAsyncReady& slot, - gssize count, - int io_priority) +void +BufferedInputStream::fill_async(const SlotAsyncReady& slot, gssize count, int io_priority) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. - auto slot_copy = new SlotAsyncReady(slot); + auto slot_copy = new SlotAsyncReady(slot); - g_buffered_input_stream_fill_async(gobj(), - count, - io_priority, - nullptr, - &SignalProxy_async_callback, - slot_copy); + g_buffered_input_stream_fill_async( + gobj(), count, io_priority, nullptr, &SignalProxy_async_callback, slot_copy); } -} // namespace Gio +} // namespace Gio diff --git a/gio/src/bufferedoutputstream.ccg b/gio/src/bufferedoutputstream.ccg index c2708997..3985649b 100644 --- a/gio/src/bufferedoutputstream.ccg +++ b/gio/src/bufferedoutputstream.ccg @@ -23,9 +23,10 @@ namespace Gio { -Glib::RefPtr<BufferedOutputStream> BufferedOutputStream::create_sized(const Glib::RefPtr<OutputStream>& base_stream, gsize size) +Glib::RefPtr<BufferedOutputStream> +BufferedOutputStream::create_sized(const Glib::RefPtr<OutputStream>& base_stream, gsize size) { return Glib::RefPtr<Gio::BufferedOutputStream>(new BufferedOutputStream(base_stream, size)); } -} // namespace Gio +} // namespace Gio diff --git a/gio/src/cancellable.ccg b/gio/src/cancellable.ccg index 787990e1..151f478b 100644 --- a/gio/src/cancellable.ccg +++ b/gio/src/cancellable.ccg @@ -20,22 +20,25 @@ #include <gio/gio.h> #include <glibmm/exceptionhandler.h> -namespace Gio { +namespace Gio +{ extern "C" { -void delete_slot(gpointer data) +void +delete_slot(gpointer data) { - Cancellable::SlotCancelledCallback* callback = - reinterpret_cast<Cancellable::SlotCancelledCallback*>(data); - delete callback; + Cancellable::SlotCancelledCallback* callback = + reinterpret_cast<Cancellable::SlotCancelledCallback*>(data); + delete callback; } -void slot_cancelled_proxy(GCancellable * /*cancellable*/, gpointer data) +void +slot_cancelled_proxy(GCancellable* /*cancellable*/, gpointer data) { - Cancellable::SlotCancelledCallback* callback = - reinterpret_cast<Cancellable::SlotCancelledCallback*>(data); - (*callback)(); + Cancellable::SlotCancelledCallback* callback = + reinterpret_cast<Cancellable::SlotCancelledCallback*>(data); + (*callback)(); } } // extern "C" @@ -43,11 +46,8 @@ void slot_cancelled_proxy(GCancellable * /*cancellable*/, gpointer data) gulong Cancellable::connect(const SlotCancelledCallback& slot) { - auto slot_copy = new SlotCancelledCallback(slot); - return g_cancellable_connect (gobj(), - G_CALLBACK(slot_cancelled_proxy), - slot_copy, - &delete_slot); + auto slot_copy = new SlotCancelledCallback(slot); + return g_cancellable_connect(gobj(), G_CALLBACK(slot_cancelled_proxy), slot_copy, &delete_slot); } } // namespace Gio diff --git a/gio/src/charsetconverter.ccg b/gio/src/charsetconverter.ccg index 967d9c3e..e9d69db8 100644 --- a/gio/src/charsetconverter.ccg +++ b/gio/src/charsetconverter.ccg @@ -20,10 +20,9 @@ namespace Gio { -CharsetConverter::CharsetConverter(const Glib::ustring& to_charset, - const Glib::ustring& from_charset) -: _CONSTRUCT("to-charset", to_charset.c_str(), "from-charset", - from_charset.c_str()) +CharsetConverter::CharsetConverter( + const Glib::ustring& to_charset, const Glib::ustring& from_charset) +: _CONSTRUCT("to-charset", to_charset.c_str(), "from-charset", from_charset.c_str()) { } diff --git a/gio/src/datainputstream.ccg b/gio/src/datainputstream.ccg index 2209e48a..3665ac98 100644 --- a/gio/src/datainputstream.ccg +++ b/gio/src/datainputstream.ccg @@ -24,193 +24,200 @@ namespace Gio { -bool DataInputStream::read_line(std::string& line, const Glib::RefPtr<Cancellable>& cancellable) +bool +DataInputStream::read_line(std::string& line, const Glib::RefPtr<Cancellable>& cancellable) { GError* gerror = nullptr; char* c_line = g_data_input_stream_read_line(gobj(), - nullptr, // pass nullptr since we can easily determine the length from the returned std::string - Glib::unwrap(cancellable), - &gerror); - if(gerror) + nullptr, // pass nullptr since we can easily determine the length from the returned std::string + Glib::unwrap(cancellable), &gerror); + if (gerror) ::Glib::Error::throw_exception(gerror); - if (c_line) { - line = c_line; - g_free (c_line); - return true; - } - // end of stream reached, return failure status - return false; + if (c_line) + { + line = c_line; + g_free(c_line); + return true; + } + // end of stream reached, return failure status + return false; } -bool DataInputStream::read_line(std::string& line) +bool +DataInputStream::read_line(std::string& line) { GError* gerror = nullptr; char* c_line = g_data_input_stream_read_line(gobj(), - nullptr, // pass nullptr since we can easily determine the length from the returned std::string - nullptr, - &gerror); - if(gerror) + nullptr, // pass nullptr since we can easily determine the length from the returned std::string + nullptr, &gerror); + if (gerror) ::Glib::Error::throw_exception(gerror); - if (c_line) { - line = c_line; - g_free(c_line); - return true; - } - // end of stream reached, return failure status - return false; + if (c_line) + { + line = c_line; + g_free(c_line); + return true; + } + // end of stream reached, return failure status + return false; } -void DataInputStream::read_line_async(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, int io_priority) +void +DataInputStream::read_line_async( + const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, int io_priority) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. auto slot_copy = new SlotAsyncReady(slot); - g_data_input_stream_read_line_async(gobj(), - io_priority, - Glib::unwrap(cancellable), - &SignalProxy_async_callback, - slot_copy); + g_data_input_stream_read_line_async( + gobj(), io_priority, Glib::unwrap(cancellable), &SignalProxy_async_callback, slot_copy); } -bool DataInputStream::read_line_finish(const Glib::RefPtr<AsyncResult>& result, std::string& data) +bool +DataInputStream::read_line_finish(const Glib::RefPtr<AsyncResult>& result, std::string& data) { GError* gerror = nullptr; gsize size = 0; - gchar* buffer = g_data_input_stream_read_line_finish(gobj(), Glib::unwrap(result), &size, &(gerror)); - if(gerror) + gchar* buffer = + g_data_input_stream_read_line_finish(gobj(), Glib::unwrap(result), &size, &(gerror)); + if (gerror) ::Glib::Error::throw_exception(gerror); bool retval = false; - if(buffer && size) + if (buffer && size) { retval = (buffer != nullptr); data = std::string(buffer, size); - g_free (buffer); + g_free(buffer); } return retval; } -bool DataInputStream::read_until(std::string& data, const std::string& stop_chars, const Glib::RefPtr<Cancellable>& cancellable) +bool +DataInputStream::read_until( + std::string& data, const std::string& stop_chars, const Glib::RefPtr<Cancellable>& cancellable) { GError* gerror = nullptr; - char* c_str = g_data_input_stream_read_until(gobj(), - stop_chars.c_str(), - nullptr, // pass nullptr since we can easily determine the length from the returned std::string - Glib::unwrap(cancellable), - &gerror); - if(gerror) + char* c_str = g_data_input_stream_read_until(gobj(), stop_chars.c_str(), + nullptr, // pass nullptr since we can easily determine the length from the returned std::string + Glib::unwrap(cancellable), &gerror); + if (gerror) ::Glib::Error::throw_exception(gerror); - if (c_str) { - data = c_str; - g_free (c_str); - return true; - } - // end of stream reached, return failure status - return false; + if (c_str) + { + data = c_str; + g_free(c_str); + return true; + } + // end of stream reached, return failure status + return false; } /** non-cancellable version of read_until() */ -bool DataInputStream::read_until(std::string& data, const std::string& stop_chars) +bool +DataInputStream::read_until(std::string& data, const std::string& stop_chars) { GError* gerror = nullptr; - char* c_str = g_data_input_stream_read_until(gobj(), - stop_chars.c_str(), - nullptr, // pass nullptr since we can easily determine the length from the returned std::string - nullptr, - &gerror); - if(gerror) + char* c_str = g_data_input_stream_read_until(gobj(), stop_chars.c_str(), + nullptr, // pass nullptr since we can easily determine the length from the returned std::string + nullptr, &gerror); + if (gerror) ::Glib::Error::throw_exception(gerror); - if (c_str) { - data = c_str; - g_free (c_str); - return true; - } - // end of stream reached, return failure status - return false; + if (c_str) + { + data = c_str; + g_free(c_str); + return true; + } + // end of stream reached, return failure status + return false; } -void DataInputStream::read_until_async(const std::string& stop_chars, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, int io_priority) +void +DataInputStream::read_until_async(const std::string& stop_chars, const SlotAsyncReady& slot, + const Glib::RefPtr<Cancellable>& cancellable, int io_priority) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. auto slot_copy = new SlotAsyncReady(slot); - g_data_input_stream_read_until_async(gobj(), stop_chars.c_str(), - io_priority, - Glib::unwrap(cancellable), - &SignalProxy_async_callback, - slot_copy); + g_data_input_stream_read_until_async(gobj(), stop_chars.c_str(), io_priority, + Glib::unwrap(cancellable), &SignalProxy_async_callback, slot_copy); } -bool DataInputStream::read_until_finish(const Glib::RefPtr<AsyncResult>& result, std::string& data) +bool +DataInputStream::read_until_finish(const Glib::RefPtr<AsyncResult>& result, std::string& data) { GError* gerror = nullptr; gsize size = 0; - gchar* buffer = g_data_input_stream_read_until_finish(gobj(), Glib::unwrap(result), &size, &(gerror)); - if(gerror) + gchar* buffer = + g_data_input_stream_read_until_finish(gobj(), Glib::unwrap(result), &size, &(gerror)); + if (gerror) ::Glib::Error::throw_exception(gerror); bool retval = false; - if(buffer && size) + if (buffer && size) { retval = (buffer != nullptr); data = std::string(buffer, size); - g_free (buffer); + g_free(buffer); } return retval; } - -bool DataInputStream::read_upto(std::string& data, const std::string& stop_chars, const Glib::RefPtr<Cancellable>& cancellable) +bool +DataInputStream::read_upto( + std::string& data, const std::string& stop_chars, const Glib::RefPtr<Cancellable>& cancellable) { GError* gerror = nullptr; - char* c_str = g_data_input_stream_read_upto(gobj(), - stop_chars.c_str(), -1, /* null-terminated */ - nullptr, // pass nullptr since we can easily determine the length from the returned std::string - Glib::unwrap(cancellable), - &gerror); - if(gerror) + char* c_str = g_data_input_stream_read_upto(gobj(), stop_chars.c_str(), -1, /* null-terminated */ + nullptr, // pass nullptr since we can easily determine the length from the returned std::string + Glib::unwrap(cancellable), &gerror); + if (gerror) ::Glib::Error::throw_exception(gerror); - if (c_str) { - data = c_str; - g_free (c_str); - return true; - } - // end of stream reached, return failure status - return false; + if (c_str) + { + data = c_str; + g_free(c_str); + return true; + } + // end of stream reached, return failure status + return false; } /** non-cancellable version of read_upto() */ -bool DataInputStream::read_upto(std::string& data, const std::string& stop_chars) +bool +DataInputStream::read_upto(std::string& data, const std::string& stop_chars) { GError* gerror = nullptr; - char* c_str = g_data_input_stream_read_upto(gobj(), - stop_chars.c_str(), -1, /* null-terminated */ + char* c_str = g_data_input_stream_read_upto(gobj(), stop_chars.c_str(), -1, /* null-terminated */ nullptr, // pass nullptr since we can easily determine the length from the returned std::string - nullptr, - &gerror); + nullptr, &gerror); - if(gerror) + if (gerror) ::Glib::Error::throw_exception(gerror); - if (c_str) { - data = c_str; - g_free (c_str); - return true; + if (c_str) + { + data = c_str; + g_free(c_str); + return true; } // end of stream reached, return failure status return false; } -void DataInputStream::read_upto_async(const std::string& stop_chars, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, int io_priority) +void +DataInputStream::read_upto_async(const std::string& stop_chars, const SlotAsyncReady& slot, + const Glib::RefPtr<Cancellable>& cancellable, int io_priority) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter @@ -218,30 +225,28 @@ void DataInputStream::read_upto_async(const std::string& stop_chars, const SlotA auto slot_copy = new SlotAsyncReady(slot); g_data_input_stream_read_upto_async(gobj(), stop_chars.c_str(), -1, /* null-terminated */ - io_priority, - Glib::unwrap(cancellable), - &SignalProxy_async_callback, - slot_copy); + io_priority, Glib::unwrap(cancellable), &SignalProxy_async_callback, slot_copy); } -bool DataInputStream::read_upto_finish(const Glib::RefPtr<AsyncResult>& result, std::string& data) +bool +DataInputStream::read_upto_finish(const Glib::RefPtr<AsyncResult>& result, std::string& data) { GError* gerror = nullptr; gsize size = 0; - gchar* buffer = g_data_input_stream_read_upto_finish(gobj(), Glib::unwrap(result), &size, &(gerror)); - if(gerror) + gchar* buffer = + g_data_input_stream_read_upto_finish(gobj(), Glib::unwrap(result), &size, &(gerror)); + if (gerror) ::Glib::Error::throw_exception(gerror); bool retval = false; - if(buffer && size) + if (buffer && size) { retval = (buffer != nullptr); data = std::string(buffer, size); - g_free (buffer); + g_free(buffer); } return retval; } - } // namespace Gio diff --git a/gio/src/dbusactiongroup.ccg b/gio/src/dbusactiongroup.ccg index fd077938..b8012ef9 100644 --- a/gio/src/dbusactiongroup.ccg +++ b/gio/src/dbusactiongroup.ccg @@ -21,4 +21,4 @@ namespace Gio { -}// namespace Gio +} // namespace Gio diff --git a/gio/src/dbusaddress.ccg b/gio/src/dbusaddress.ccg index b69fb27c..30f2366c 100644 --- a/gio/src/dbusaddress.ccg +++ b/gio/src/dbusaddress.ccg @@ -30,150 +30,151 @@ namespace DBus namespace Address { -bool is_address(const std::string& string) +bool +is_address(const std::string& string) { return static_cast<bool>(g_dbus_is_address(string.c_str())); } -bool is_supported(const std::string& address) +bool +is_supported(const std::string& address) { GError* gerror = nullptr; bool const result = g_dbus_is_supported_address(address.c_str(), &gerror); - if(gerror) + if (gerror) ::Glib::Error::throw_exception(gerror); return result; } -void get_stream(const std::string& address, const SlotAsyncReady slot, +void +get_stream(const std::string& address, const SlotAsyncReady slot, const Glib::RefPtr<Cancellable>& cancellable) { auto slot_copy = new SlotAsyncReady(slot); - g_dbus_address_get_stream(address.c_str(), Glib::unwrap(cancellable), - &SignalProxy_async_callback, slot_copy); + g_dbus_address_get_stream( + address.c_str(), Glib::unwrap(cancellable), &SignalProxy_async_callback, slot_copy); } -void get_stream(const std::string& address, const SlotAsyncReady slot) +void +get_stream(const std::string& address, const SlotAsyncReady slot) { auto slot_copy = new SlotAsyncReady(slot); - g_dbus_address_get_stream(address.c_str(), nullptr, &SignalProxy_async_callback, - slot_copy); + g_dbus_address_get_stream(address.c_str(), nullptr, &SignalProxy_async_callback, slot_copy); } -Glib::RefPtr<IOStream> get_stream_finish(const Glib::RefPtr<AsyncResult>& res, - std::string& out_guid) +Glib::RefPtr<IOStream> +get_stream_finish(const Glib::RefPtr<AsyncResult>& res, std::string& out_guid) { GError* gerror = nullptr; gchar* g_out_guid = nullptr; auto result = - Glib::wrap(g_dbus_address_get_stream_finish(Glib::unwrap(res), - &g_out_guid, &gerror)); + Glib::wrap(g_dbus_address_get_stream_finish(Glib::unwrap(res), &g_out_guid, &gerror)); - if(gerror) + if (gerror) ::Glib::Error::throw_exception(gerror); out_guid = g_out_guid; return result; } -Glib::RefPtr<IOStream> get_stream_finish(const Glib::RefPtr<AsyncResult>& res) +Glib::RefPtr<IOStream> +get_stream_finish(const Glib::RefPtr<AsyncResult>& res) { GError* gerror = nullptr; - auto result = - Glib::wrap(g_dbus_address_get_stream_finish(Glib::unwrap(res), nullptr, - &gerror)); + auto result = Glib::wrap(g_dbus_address_get_stream_finish(Glib::unwrap(res), nullptr, &gerror)); - if(gerror) + if (gerror) ::Glib::Error::throw_exception(gerror); return result; } -Glib::RefPtr<IOStream> get_stream_sync(const std::string& address, - const Glib::RefPtr<Cancellable>& cancellable, std::string& out_guid) +Glib::RefPtr<IOStream> +get_stream_sync( + const std::string& address, const Glib::RefPtr<Cancellable>& cancellable, std::string& out_guid) { GError* gerror = nullptr; gchar* g_out_guid = nullptr; - auto result = - Glib::wrap(g_dbus_address_get_stream_sync(address.c_str(), - &g_out_guid, Glib::unwrap(cancellable), &gerror)); + auto result = Glib::wrap(g_dbus_address_get_stream_sync( + address.c_str(), &g_out_guid, Glib::unwrap(cancellable), &gerror)); - if(gerror) + if (gerror) ::Glib::Error::throw_exception(gerror); out_guid = g_out_guid; return result; } -Glib::RefPtr<IOStream> get_stream_sync(const std::string& address, - std::string& out_guid) +Glib::RefPtr<IOStream> +get_stream_sync(const std::string& address, std::string& out_guid) { GError* gerror = nullptr; gchar* g_out_guid = nullptr; auto result = - Glib::wrap(g_dbus_address_get_stream_sync(address.c_str(), - &g_out_guid, nullptr, &gerror)); + Glib::wrap(g_dbus_address_get_stream_sync(address.c_str(), &g_out_guid, nullptr, &gerror)); - if(gerror) + if (gerror) ::Glib::Error::throw_exception(gerror); out_guid = g_out_guid; return result; } -Glib::RefPtr<IOStream> get_stream_sync(const std::string& address, - const Glib::RefPtr<Cancellable>& cancellable) +Glib::RefPtr<IOStream> +get_stream_sync(const std::string& address, const Glib::RefPtr<Cancellable>& cancellable) { GError* gerror = nullptr; - auto result = - Glib::wrap(g_dbus_address_get_stream_sync(address.c_str(), nullptr, - Glib::unwrap(cancellable), &gerror)); + auto result = Glib::wrap( + g_dbus_address_get_stream_sync(address.c_str(), nullptr, Glib::unwrap(cancellable), &gerror)); - if(gerror) + if (gerror) ::Glib::Error::throw_exception(gerror); return result; } -Glib::RefPtr<IOStream> get_stream_sync(const std::string& address) +Glib::RefPtr<IOStream> +get_stream_sync(const std::string& address) { GError* gerror = nullptr; auto result = Glib::wrap(g_dbus_address_get_stream_sync(address.c_str(), nullptr, nullptr, &gerror)); - if(gerror) + if (gerror) ::Glib::Error::throw_exception(gerror); return result; } -std::string get_for_bus_sync(BusType bus_type, - const Glib::RefPtr<Cancellable>& cancellable) +std::string +get_for_bus_sync(BusType bus_type, const Glib::RefPtr<Cancellable>& cancellable) { GError* gerror = nullptr; std::string result(g_dbus_address_get_for_bus_sync( static_cast<GBusType>(bus_type), Glib::unwrap(cancellable), &gerror)); - if(gerror) + if (gerror) ::Glib::Error::throw_exception(gerror); return result; } -std::string get_for_bus_sync(BusType bus_type) +std::string +get_for_bus_sync(BusType bus_type) { GError* gerror = nullptr; - std::string result(g_dbus_address_get_for_bus_sync( - static_cast<GBusType>(bus_type), nullptr, &gerror)); + std::string result( + g_dbus_address_get_for_bus_sync(static_cast<GBusType>(bus_type), nullptr, &gerror)); - if(gerror) + if (gerror) ::Glib::Error::throw_exception(gerror); return result; diff --git a/gio/src/dbusauthobserver.ccg b/gio/src/dbusauthobserver.ccg index 5a181e47..7ca00c72 100644 --- a/gio/src/dbusauthobserver.ccg +++ b/gio/src/dbusauthobserver.ccg @@ -21,7 +21,7 @@ #include <glibmm/exceptionhandler.h> #include <giomm/credentials.h> -//To help the generated code: +// To help the generated code: typedef Gio::Credentials Credentials; typedef Gio::IOStream IOStream; diff --git a/gio/src/dbusconnection.ccg b/gio/src/dbusconnection.ccg index a2f67b36..557d6958 100644 --- a/gio/src/dbusconnection.ccg +++ b/gio/src/dbusconnection.ccg @@ -29,13 +29,12 @@ namespace { -extern "C" -{ +extern "C" { -static void DBusConnection_Signal_giomm_callback(GDBusConnection* connection, - const char* sender_name, const char* object_path, - const char* interface_name, const char* signal_name, GVariant* parameters, - void* user_data) +static void +DBusConnection_Signal_giomm_callback(GDBusConnection* connection, const char* sender_name, + const char* object_path, const char* interface_name, const char* signal_name, + GVariant* parameters, void* user_data) { Gio::DBus::Connection::SlotSignal* the_slot = static_cast<Gio::DBus::Connection::SlotSignal*>(user_data); @@ -46,20 +45,21 @@ static void DBusConnection_Signal_giomm_callback(GDBusConnection* connection, (object_path ? object_path : ""), (interface_name ? interface_name : ""), (signal_name ? signal_name : ""), Glib::VariantContainerBase(parameters, true)); } - catch(...) + catch (...) { Glib::exception_handlers_invoke(); } } -static void DBusConnection_Signal_giomm_callback_destroy(void* data) +static void +DBusConnection_Signal_giomm_callback_destroy(void* data) { delete static_cast<Gio::DBus::Connection::SlotSignal*>(data); } -static GDBusMessage* DBusConnection_Message_Filter_giomm_callback( - GDBusConnection* connection, GDBusMessage* message, gboolean incoming, - void* user_data) +static GDBusMessage* +DBusConnection_Message_Filter_giomm_callback( + GDBusConnection* connection, GDBusMessage* message, gboolean incoming, void* user_data) { Gio::DBus::Connection::SlotMessageFilter* the_slot = static_cast<Gio::DBus::Connection::SlotMessageFilter*>(user_data); @@ -67,11 +67,10 @@ static GDBusMessage* DBusConnection_Message_Filter_giomm_callback( try { auto result = (*the_slot)( - Glib::wrap(connection, true), Glib::wrap(message, true), - static_cast<bool>(incoming)); + Glib::wrap(connection, true), Glib::wrap(message, true), static_cast<bool>(incoming)); return (result) ? result->gobj_copy() : nullptr; } - catch(...) + catch (...) { Glib::exception_handlers_invoke(); } @@ -79,13 +78,13 @@ static GDBusMessage* DBusConnection_Message_Filter_giomm_callback( return message; } -static void DBusConnection_Message_Filter_giomm_callback_destroy(void* data) +static void +DBusConnection_Message_Filter_giomm_callback_destroy(void* data) { delete static_cast<Gio::DBus::Connection::SlotMessageFilter*>(data); } } // extern "C" - } namespace Gio @@ -94,213 +93,148 @@ namespace Gio namespace DBus { -Connection::Connection(const Glib::RefPtr<IOStream>& stream, - const std::string& guid, - const Glib::RefPtr<AuthObserver>& observer, - const SlotAsyncReady& slot, - const Glib::RefPtr<Cancellable>& cancellable, - ConnectionFlags flags) -: - _CONSTRUCT("stream", Glib::unwrap(stream), - "guid", Glib::c_str_or_nullptr(guid), - "flags", static_cast<GDBusConnectionFlags>(flags), - "authentication-observer", Glib::unwrap(observer)) +Connection::Connection(const Glib::RefPtr<IOStream>& stream, const std::string& guid, + const Glib::RefPtr<AuthObserver>& observer, const SlotAsyncReady& slot, + const Glib::RefPtr<Cancellable>& cancellable, ConnectionFlags flags) +: _CONSTRUCT("stream", Glib::unwrap(stream), "guid", Glib::c_str_or_nullptr(guid), "flags", + static_cast<GDBusConnectionFlags>(flags), "authentication-observer", Glib::unwrap(observer)) { init_async(slot, cancellable); } -Connection::Connection(const Glib::RefPtr<IOStream>& stream, - const std::string& guid, - const SlotAsyncReady& slot, - const Glib::RefPtr<Cancellable>& cancellable, - ConnectionFlags flags) -: - _CONSTRUCT("stream", Glib::unwrap(stream), - "guid", Glib::c_str_or_nullptr(guid), - "flags", static_cast<GDBusConnectionFlags>(flags), - "authentication-observer", static_cast<GDBusAuthObserver*>(nullptr)) +Connection::Connection(const Glib::RefPtr<IOStream>& stream, const std::string& guid, + const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, ConnectionFlags flags) +: _CONSTRUCT("stream", Glib::unwrap(stream), "guid", Glib::c_str_or_nullptr(guid), "flags", + static_cast<GDBusConnectionFlags>(flags), "authentication-observer", + static_cast<GDBusAuthObserver*>(nullptr)) { init_async(slot, cancellable); } -Connection::Connection(const Glib::RefPtr<IOStream>& stream, - const std::string& guid, - const Glib::RefPtr<AuthObserver>& observer, - const SlotAsyncReady& slot, - ConnectionFlags flags) -: - _CONSTRUCT("stream", Glib::unwrap(stream), - "guid", Glib::c_str_or_nullptr(guid), - "flags", static_cast<GDBusConnectionFlags>(flags), - "authentication-observer", Glib::unwrap(observer)) +Connection::Connection(const Glib::RefPtr<IOStream>& stream, const std::string& guid, + const Glib::RefPtr<AuthObserver>& observer, const SlotAsyncReady& slot, ConnectionFlags flags) +: _CONSTRUCT("stream", Glib::unwrap(stream), "guid", Glib::c_str_or_nullptr(guid), "flags", + static_cast<GDBusConnectionFlags>(flags), "authentication-observer", Glib::unwrap(observer)) { init_async(slot); } -Connection::Connection(const Glib::RefPtr<IOStream>& stream, - const std::string& guid, - const SlotAsyncReady& slot, - ConnectionFlags flags) -: - _CONSTRUCT("stream", Glib::unwrap(stream), - "guid", Glib::c_str_or_nullptr(guid), - "flags", static_cast<GDBusConnectionFlags>(flags), - "authentication-observer", static_cast<GDBusAuthObserver*>(nullptr)) +Connection::Connection(const Glib::RefPtr<IOStream>& stream, const std::string& guid, + const SlotAsyncReady& slot, ConnectionFlags flags) +: _CONSTRUCT("stream", Glib::unwrap(stream), "guid", Glib::c_str_or_nullptr(guid), "flags", + static_cast<GDBusConnectionFlags>(flags), "authentication-observer", + static_cast<GDBusAuthObserver*>(nullptr)) { init_async(slot); } -Connection::Connection(const std::string& address, - const Glib::RefPtr<AuthObserver>& observer, - const SlotAsyncReady& slot, - const Glib::RefPtr<Cancellable>& cancellable, - ConnectionFlags flags) -: - _CONSTRUCT("address", Glib::c_str_or_nullptr(address), - "flags", static_cast<GDBusConnectionFlags>(flags), - "authentication-observer", Glib::unwrap(observer)) +Connection::Connection(const std::string& address, const Glib::RefPtr<AuthObserver>& observer, + const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, ConnectionFlags flags) +: _CONSTRUCT("address", Glib::c_str_or_nullptr(address), "flags", + static_cast<GDBusConnectionFlags>(flags), "authentication-observer", Glib::unwrap(observer)) { init_async(slot, cancellable); } -Connection::Connection(const std::string& address, - const SlotAsyncReady& slot, - const Glib::RefPtr<Cancellable>& cancellable, - ConnectionFlags flags) -: - _CONSTRUCT("address", Glib::c_str_or_nullptr(address), - "flags", static_cast<GDBusConnectionFlags>(flags), - "authentication-observer", static_cast<GDBusAuthObserver*>(nullptr)) +Connection::Connection(const std::string& address, const SlotAsyncReady& slot, + const Glib::RefPtr<Cancellable>& cancellable, ConnectionFlags flags) +: _CONSTRUCT("address", Glib::c_str_or_nullptr(address), "flags", + static_cast<GDBusConnectionFlags>(flags), "authentication-observer", + static_cast<GDBusAuthObserver*>(nullptr)) { init_async(slot, cancellable); } -Connection::Connection(const std::string& address, - const Glib::RefPtr<AuthObserver>& observer, - const SlotAsyncReady& slot, - ConnectionFlags flags) -: - _CONSTRUCT("address", Glib::c_str_or_nullptr(address), - "flags", static_cast<GDBusConnectionFlags>(flags), - "authentication-observer", Glib::unwrap(observer)) +Connection::Connection(const std::string& address, const Glib::RefPtr<AuthObserver>& observer, + const SlotAsyncReady& slot, ConnectionFlags flags) +: _CONSTRUCT("address", Glib::c_str_or_nullptr(address), "flags", + static_cast<GDBusConnectionFlags>(flags), "authentication-observer", Glib::unwrap(observer)) { init_async(slot); } -Connection::Connection(const std::string& address, - const SlotAsyncReady& slot, - ConnectionFlags flags) -: - _CONSTRUCT("address", Glib::c_str_or_nullptr(address), - "flags", static_cast<GDBusConnectionFlags>(flags), - "authentication-observer", static_cast<GDBusAuthObserver*>(nullptr)) +Connection::Connection( + const std::string& address, const SlotAsyncReady& slot, ConnectionFlags flags) +: _CONSTRUCT("address", Glib::c_str_or_nullptr(address), "flags", + static_cast<GDBusConnectionFlags>(flags), "authentication-observer", + static_cast<GDBusAuthObserver*>(nullptr)) { init_async(slot); } -Connection::Connection(const Glib::RefPtr<IOStream>& stream, - const std::string& guid, - const Glib::RefPtr<AuthObserver>& observer, - const Glib::RefPtr<Cancellable>& cancellable, +Connection::Connection(const Glib::RefPtr<IOStream>& stream, const std::string& guid, + const Glib::RefPtr<AuthObserver>& observer, const Glib::RefPtr<Cancellable>& cancellable, ConnectionFlags flags) -: - _CONSTRUCT("stream", Glib::unwrap(stream), - "guid", Glib::c_str_or_nullptr(guid), - "flags", static_cast<GDBusConnectionFlags>(flags), - "authentication-observer", Glib::unwrap(observer)) +: _CONSTRUCT("stream", Glib::unwrap(stream), "guid", Glib::c_str_or_nullptr(guid), "flags", + static_cast<GDBusConnectionFlags>(flags), "authentication-observer", Glib::unwrap(observer)) { init(cancellable); } -Connection::Connection(const Glib::RefPtr<IOStream>& stream, - const std::string& guid, - const Glib::RefPtr<Cancellable>& cancellable, - ConnectionFlags flags) -: - _CONSTRUCT("stream", Glib::unwrap(stream), - "guid", Glib::c_str_or_nullptr(guid), - "flags", static_cast<GDBusConnectionFlags>(flags), - "authentication-observer", static_cast<GDBusAuthObserver*>(nullptr)) +Connection::Connection(const Glib::RefPtr<IOStream>& stream, const std::string& guid, + const Glib::RefPtr<Cancellable>& cancellable, ConnectionFlags flags) +: _CONSTRUCT("stream", Glib::unwrap(stream), "guid", Glib::c_str_or_nullptr(guid), "flags", + static_cast<GDBusConnectionFlags>(flags), "authentication-observer", + static_cast<GDBusAuthObserver*>(nullptr)) { init(cancellable); } -Connection::Connection(const Glib::RefPtr<IOStream>& stream, - const std::string& guid, - const Glib::RefPtr<AuthObserver>& observer, - ConnectionFlags flags) -: - _CONSTRUCT("stream", Glib::unwrap(stream), - "guid", Glib::c_str_or_nullptr(guid), - "flags", static_cast<GDBusConnectionFlags>(flags), - "authentication-observer", Glib::unwrap(observer)) +Connection::Connection(const Glib::RefPtr<IOStream>& stream, const std::string& guid, + const Glib::RefPtr<AuthObserver>& observer, ConnectionFlags flags) +: _CONSTRUCT("stream", Glib::unwrap(stream), "guid", Glib::c_str_or_nullptr(guid), "flags", + static_cast<GDBusConnectionFlags>(flags), "authentication-observer", Glib::unwrap(observer)) { init(); } -Connection::Connection(const Glib::RefPtr<IOStream>& stream, - const std::string& guid, - ConnectionFlags flags) -: - _CONSTRUCT("stream", Glib::unwrap(stream), - "guid", Glib::c_str_or_nullptr(guid), - "flags", static_cast<GDBusConnectionFlags>(flags), - "authentication-observer", static_cast<GDBusAuthObserver*>(nullptr)) +Connection::Connection( + const Glib::RefPtr<IOStream>& stream, const std::string& guid, ConnectionFlags flags) +: _CONSTRUCT("stream", Glib::unwrap(stream), "guid", Glib::c_str_or_nullptr(guid), "flags", + static_cast<GDBusConnectionFlags>(flags), "authentication-observer", + static_cast<GDBusAuthObserver*>(nullptr)) { init(); } -Connection::Connection(const std::string& address, - const Glib::RefPtr<AuthObserver>& observer, - const Glib::RefPtr<Cancellable>& cancellable, - ConnectionFlags flags) -: - _CONSTRUCT("address", Glib::c_str_or_nullptr(address), - "flags", static_cast<GDBusConnectionFlags>(flags), - "authentication-observer", Glib::unwrap(observer)) +Connection::Connection(const std::string& address, const Glib::RefPtr<AuthObserver>& observer, + const Glib::RefPtr<Cancellable>& cancellable, ConnectionFlags flags) +: _CONSTRUCT("address", Glib::c_str_or_nullptr(address), "flags", + static_cast<GDBusConnectionFlags>(flags), "authentication-observer", Glib::unwrap(observer)) { init(cancellable); } -Connection::Connection(const std::string& address, - const Glib::RefPtr<Cancellable>& cancellable, - ConnectionFlags flags) -: - _CONSTRUCT("address", Glib::c_str_or_nullptr(address), - "flags", static_cast<GDBusConnectionFlags>(flags), - "authentication-observer", static_cast<GDBusAuthObserver*>(nullptr)) +Connection::Connection( + const std::string& address, const Glib::RefPtr<Cancellable>& cancellable, ConnectionFlags flags) +: _CONSTRUCT("address", Glib::c_str_or_nullptr(address), "flags", + static_cast<GDBusConnectionFlags>(flags), "authentication-observer", + static_cast<GDBusAuthObserver*>(nullptr)) { init(cancellable); } -Connection::Connection(const std::string& address, - const Glib::RefPtr<AuthObserver>& observer, - ConnectionFlags flags) -: - _CONSTRUCT("address", Glib::c_str_or_nullptr(address), - "flags", static_cast<GDBusConnectionFlags>(flags), - "authentication-observer", Glib::unwrap(observer)) +Connection::Connection( + const std::string& address, const Glib::RefPtr<AuthObserver>& observer, ConnectionFlags flags) +: _CONSTRUCT("address", Glib::c_str_or_nullptr(address), "flags", + static_cast<GDBusConnectionFlags>(flags), "authentication-observer", Glib::unwrap(observer)) { init(); } -Connection::Connection(const std::string& address, - ConnectionFlags flags) -: - _CONSTRUCT("address", Glib::c_str_or_nullptr(address), - "flags", static_cast<GDBusConnectionFlags>(flags), - "authentication-observer", static_cast<GDBusAuthObserver*>(nullptr)) +Connection::Connection(const std::string& address, ConnectionFlags flags) +: _CONSTRUCT("address", Glib::c_str_or_nullptr(address), "flags", + static_cast<GDBusConnectionFlags>(flags), "authentication-observer", + static_cast<GDBusAuthObserver*>(nullptr)) { init(); } -//static -void Connection::create(const Glib::RefPtr<IOStream>& stream, - const std::string& guid, - const Glib::RefPtr<AuthObserver>& observer, - const SlotAsyncReady& slot, - const Glib::RefPtr<Cancellable>& cancellable, - ConnectionFlags flags) +// static +void +Connection::create(const Glib::RefPtr<IOStream>& stream, const std::string& guid, + const Glib::RefPtr<AuthObserver>& observer, const SlotAsyncReady& slot, + const Glib::RefPtr<Cancellable>& cancellable, ConnectionFlags flags) { // Note that this does not return anything, because it is async - see // create_finish(). @@ -308,12 +242,10 @@ void Connection::create(const Glib::RefPtr<IOStream>& stream, Connection(stream, guid, observer, slot, cancellable, flags); } -//static -void Connection::create(const Glib::RefPtr<IOStream>& stream, - const std::string& guid, - const SlotAsyncReady& slot, - const Glib::RefPtr<Cancellable>& cancellable, - ConnectionFlags flags) +// static +void +Connection::create(const Glib::RefPtr<IOStream>& stream, const std::string& guid, + const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, ConnectionFlags flags) { // Note that this does not return anything, because it is async - see // create_finish(). @@ -321,314 +253,275 @@ void Connection::create(const Glib::RefPtr<IOStream>& stream, Connection(stream, guid, slot, cancellable, flags); } -//static -void Connection::create(const Glib::RefPtr<IOStream>& stream, - const std::string& guid, - const Glib::RefPtr<AuthObserver>& observer, - const SlotAsyncReady& slot, - ConnectionFlags flags) +// static +void +Connection::create(const Glib::RefPtr<IOStream>& stream, const std::string& guid, + const Glib::RefPtr<AuthObserver>& observer, const SlotAsyncReady& slot, ConnectionFlags flags) { // Note that this does not return anything, because it is async - see // create_finish(). Connection(stream, guid, observer, slot, flags); } -//static -void Connection::create(const Glib::RefPtr<IOStream>& stream, - const std::string& guid, - const SlotAsyncReady& slot, - ConnectionFlags flags) +// static +void +Connection::create(const Glib::RefPtr<IOStream>& stream, const std::string& guid, + const SlotAsyncReady& slot, ConnectionFlags flags) { // Note that this does not return anything, because it is async - see // create_finish(). Connection(stream, guid, slot, flags); } -//static -Glib::RefPtr<Connection> Connection::create_sync( - const Glib::RefPtr<IOStream>& stream, - const std::string& guid, - const Glib::RefPtr<AuthObserver>& observer, - const Glib::RefPtr<Cancellable>& cancellable, +// static +Glib::RefPtr<Connection> +Connection::create_sync(const Glib::RefPtr<IOStream>& stream, const std::string& guid, + const Glib::RefPtr<AuthObserver>& observer, const Glib::RefPtr<Cancellable>& cancellable, ConnectionFlags flags) { - return Glib::RefPtr<Connection>(new Connection(stream, guid, - observer, cancellable, flags)); + return Glib::RefPtr<Connection>(new Connection(stream, guid, observer, cancellable, flags)); } -//static -Glib::RefPtr<Connection> Connection::create_sync( - const Glib::RefPtr<IOStream>& stream, - const std::string& guid, - const Glib::RefPtr<Cancellable>& cancellable, - ConnectionFlags flags) +// static +Glib::RefPtr<Connection> +Connection::create_sync(const Glib::RefPtr<IOStream>& stream, const std::string& guid, + const Glib::RefPtr<Cancellable>& cancellable, ConnectionFlags flags) { - return Glib::RefPtr<Connection>(new Connection(stream, guid, - cancellable, flags)); + return Glib::RefPtr<Connection>(new Connection(stream, guid, cancellable, flags)); } -//static -Glib::RefPtr<Connection> Connection::create_sync( - const Glib::RefPtr<IOStream>& stream, - const std::string& guid, - const Glib::RefPtr<AuthObserver>& observer, - ConnectionFlags flags) +// static +Glib::RefPtr<Connection> +Connection::create_sync(const Glib::RefPtr<IOStream>& stream, const std::string& guid, + const Glib::RefPtr<AuthObserver>& observer, ConnectionFlags flags) { - return Glib::RefPtr<Connection>(new Connection(stream, guid, - observer, flags)); + return Glib::RefPtr<Connection>(new Connection(stream, guid, observer, flags)); } -//static -Glib::RefPtr<Connection> Connection::create_sync( - const Glib::RefPtr<IOStream>& stream, - const std::string& guid, - ConnectionFlags flags) +// static +Glib::RefPtr<Connection> +Connection::create_sync( + const Glib::RefPtr<IOStream>& stream, const std::string& guid, ConnectionFlags flags) { - return Glib::RefPtr<Connection>(new Connection(stream, guid, - flags)); + return Glib::RefPtr<Connection>(new Connection(stream, guid, flags)); } -//static -void Connection::create_for_address(const std::string& address, - const Glib::RefPtr<AuthObserver>& observer, - const SlotAsyncReady& slot, - const Glib::RefPtr<Cancellable>& cancellable, - ConnectionFlags flags) +// static +void +Connection::create_for_address(const std::string& address, + const Glib::RefPtr<AuthObserver>& observer, const SlotAsyncReady& slot, + const Glib::RefPtr<Cancellable>& cancellable, ConnectionFlags flags) { // Note that this does not return anything, because it is async - see // create_finish(). Connection(address, observer, slot, cancellable, flags); } -//static -void Connection::create_for_address(const std::string& address, - const SlotAsyncReady& slot, - const Glib::RefPtr<Cancellable>& cancellable, - ConnectionFlags flags) +// static +void +Connection::create_for_address(const std::string& address, const SlotAsyncReady& slot, + const Glib::RefPtr<Cancellable>& cancellable, ConnectionFlags flags) { // Note that this does not return anything, because it is async - see // create_finish(). Connection(address, slot, cancellable, flags); } -//static -void Connection::create_for_address(const std::string& address, - const Glib::RefPtr<AuthObserver>& observer, - const SlotAsyncReady& slot, - ConnectionFlags flags) +// static +void +Connection::create_for_address(const std::string& address, + const Glib::RefPtr<AuthObserver>& observer, const SlotAsyncReady& slot, ConnectionFlags flags) { // Note that this does not return anything, because it is async - see // create_finish(). Connection(address, observer, slot, flags); } -//static -void Connection::create_for_address(const std::string& address, - const SlotAsyncReady& slot, - ConnectionFlags flags) +// static +void +Connection::create_for_address( + const std::string& address, const SlotAsyncReady& slot, ConnectionFlags flags) { // Note that this does not return anything, because it is async - see // create_finish(). Connection(address, slot, flags); } -//static -Glib::RefPtr<Connection> Connection::create_for_address_sync( - const std::string& address, - const Glib::RefPtr<AuthObserver>& observer, - const Glib::RefPtr<Cancellable>& cancellable, +// static +Glib::RefPtr<Connection> +Connection::create_for_address_sync(const std::string& address, + const Glib::RefPtr<AuthObserver>& observer, const Glib::RefPtr<Cancellable>& cancellable, ConnectionFlags flags) { - return Glib::RefPtr<Connection>(new Connection(address, observer, - cancellable, flags)); + return Glib::RefPtr<Connection>(new Connection(address, observer, cancellable, flags)); } -//static -Glib::RefPtr<Connection> Connection::create_for_address_sync( - const std::string& address, - const Glib::RefPtr<Cancellable>& cancellable, - ConnectionFlags flags) +// static +Glib::RefPtr<Connection> +Connection::create_for_address_sync( + const std::string& address, const Glib::RefPtr<Cancellable>& cancellable, ConnectionFlags flags) { - return Glib::RefPtr<Connection>(new Connection(address, cancellable, - flags)); + return Glib::RefPtr<Connection>(new Connection(address, cancellable, flags)); } -//static -Glib::RefPtr<Connection> Connection::create_for_address_sync( - const std::string& address, - const Glib::RefPtr<AuthObserver>& observer, - ConnectionFlags flags) +// static +Glib::RefPtr<Connection> +Connection::create_for_address_sync( + const std::string& address, const Glib::RefPtr<AuthObserver>& observer, ConnectionFlags flags) { - return Glib::RefPtr<Connection>(new Connection(address, observer, - flags)); + return Glib::RefPtr<Connection>(new Connection(address, observer, flags)); } -//static -Glib::RefPtr<Connection> Connection::create_for_address_sync( - const std::string& address, - ConnectionFlags flags) +// static +Glib::RefPtr<Connection> +Connection::create_for_address_sync(const std::string& address, ConnectionFlags flags) { return Glib::RefPtr<Connection>(new Connection(address, flags)); } -//static -void Connection::get(BusType bus_type, const SlotAsyncReady& slot, - const Glib::RefPtr<Cancellable>& cancellable) +// static +void +Connection::get( + BusType bus_type, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable) { auto slot_copy = new SlotAsyncReady(slot); - g_bus_get(static_cast<GBusType>(bus_type), Glib::unwrap(cancellable), - &SignalProxy_async_callback, slot_copy); + g_bus_get(static_cast<GBusType>(bus_type), Glib::unwrap(cancellable), &SignalProxy_async_callback, + slot_copy); } -//static -void Connection::get(BusType bus_type, const SlotAsyncReady& slot) +// static +void +Connection::get(BusType bus_type, const SlotAsyncReady& slot) { auto slot_copy = new SlotAsyncReady(slot); - g_bus_get(static_cast<GBusType>(bus_type), nullptr, &SignalProxy_async_callback, - slot_copy); + g_bus_get(static_cast<GBusType>(bus_type), nullptr, &SignalProxy_async_callback, slot_copy); } -void Connection::close() +void +Connection::close() { g_dbus_connection_close(gobj(), nullptr, nullptr, nullptr); } -void Connection::close(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable) +void +Connection::close(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable) { auto slot_copy = new SlotAsyncReady(slot); - g_dbus_connection_close(gobj(), - Glib::unwrap(cancellable), - &SignalProxy_async_callback, - slot_copy); + g_dbus_connection_close( + gobj(), Glib::unwrap(cancellable), &SignalProxy_async_callback, slot_copy); } -void Connection::close(const SlotAsyncReady& slot) +void +Connection::close(const SlotAsyncReady& slot) { auto slot_copy = new SlotAsyncReady(slot); - g_dbus_connection_close(gobj(), - nullptr, - &SignalProxy_async_callback, - slot_copy); + g_dbus_connection_close(gobj(), nullptr, &SignalProxy_async_callback, slot_copy); } -void Connection::flush() +void +Connection::flush() { g_dbus_connection_flush(gobj(), nullptr, nullptr, nullptr); } -void Connection::flush(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable) +void +Connection::flush(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable) { auto slot_copy = new SlotAsyncReady(slot); - g_dbus_connection_flush(gobj(), - Glib::unwrap(cancellable), - &SignalProxy_async_callback, - slot_copy); + g_dbus_connection_flush( + gobj(), Glib::unwrap(cancellable), &SignalProxy_async_callback, slot_copy); } -void Connection::flush(const SlotAsyncReady& slot) +void +Connection::flush(const SlotAsyncReady& slot) { auto slot_copy = new SlotAsyncReady(slot); - g_dbus_connection_flush(gobj(), - nullptr, - &SignalProxy_async_callback, - slot_copy); + g_dbus_connection_flush(gobj(), nullptr, &SignalProxy_async_callback, slot_copy); } -bool Connection::send_message(const Glib::RefPtr<Message>& message, - SendMessageFlags flags) +bool +Connection::send_message(const Glib::RefPtr<Message>& message, SendMessageFlags flags) { GError* gerror = nullptr; - const bool result = g_dbus_connection_send_message(gobj(), - Glib::unwrap(message), static_cast<GDBusSendMessageFlags>(flags), nullptr, - &gerror); + const bool result = g_dbus_connection_send_message( + gobj(), Glib::unwrap(message), static_cast<GDBusSendMessageFlags>(flags), nullptr, &gerror); - if(gerror) + if (gerror) ::Glib::Error::throw_exception(gerror); return result; } -void Connection::send_message_with_reply(const Glib::RefPtr<Message>& message, int timeout_msec,const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable) +void +Connection::send_message_with_reply(const Glib::RefPtr<Message>& message, int timeout_msec, + const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable) { auto slot_copy = new SlotAsyncReady(slot); volatile guint32 out_serial = 0; g_dbus_connection_send_message_with_reply(gobj(), Glib::unwrap(message), - static_cast<GDBusSendMessageFlags>(message->get_flags()), - timeout_msec, &out_serial, - Glib::unwrap(cancellable), &SignalProxy_async_callback, - slot_copy); + static_cast<GDBusSendMessageFlags>(message->get_flags()), timeout_msec, &out_serial, + Glib::unwrap(cancellable), &SignalProxy_async_callback, slot_copy); message->set_serial(out_serial); } -void Connection::send_message_with_reply(const Glib::RefPtr<Message>& message, int timeout_msec,const SlotAsyncReady& slot) +void +Connection::send_message_with_reply( + const Glib::RefPtr<Message>& message, int timeout_msec, const SlotAsyncReady& slot) { auto slot_copy = new SlotAsyncReady(slot); volatile guint32 out_serial = 0; g_dbus_connection_send_message_with_reply(gobj(), Glib::unwrap(message), - static_cast<GDBusSendMessageFlags>(message->get_flags()), - timeout_msec, &out_serial, - nullptr, &SignalProxy_async_callback, - slot_copy); + static_cast<GDBusSendMessageFlags>(message->get_flags()), timeout_msec, &out_serial, nullptr, + &SignalProxy_async_callback, slot_copy); message->set_serial(out_serial); } -Glib::RefPtr<Message> Connection::send_message_with_reply_sync( - const Glib::RefPtr<Message>& message, - const Glib::RefPtr<Cancellable>& cancellable, - gint timeout_msec) +Glib::RefPtr<Message> +Connection::send_message_with_reply_sync(const Glib::RefPtr<Message>& message, + const Glib::RefPtr<Cancellable>& cancellable, gint timeout_msec) { volatile guint32 out_serial = 0; GError* gerror = nullptr; - GDBusMessage* result = - g_dbus_connection_send_message_with_reply_sync(gobj(), - Glib::unwrap(message), - static_cast<GDBusSendMessageFlags>(message->get_flags()), - timeout_msec, &out_serial, Glib::unwrap(cancellable), &gerror); + GDBusMessage* result = g_dbus_connection_send_message_with_reply_sync(gobj(), + Glib::unwrap(message), static_cast<GDBusSendMessageFlags>(message->get_flags()), timeout_msec, + &out_serial, Glib::unwrap(cancellable), &gerror); - if(gerror) + if (gerror) ::Glib::Error::throw_exception(gerror); message->set_serial(out_serial); return Glib::wrap(result); } -Glib::RefPtr<Message> Connection::send_message_with_reply_sync( - const Glib::RefPtr<Message>& message, - gint timeout_msec) +Glib::RefPtr<Message> +Connection::send_message_with_reply_sync(const Glib::RefPtr<Message>& message, gint timeout_msec) { volatile guint32 out_serial = 0; GError* gerror = nullptr; - GDBusMessage* result = - g_dbus_connection_send_message_with_reply_sync(gobj(), - Glib::unwrap(message), - static_cast<GDBusSendMessageFlags>(message->get_flags()), timeout_msec, + GDBusMessage* result = g_dbus_connection_send_message_with_reply_sync(gobj(), + Glib::unwrap(message), static_cast<GDBusSendMessageFlags>(message->get_flags()), timeout_msec, &out_serial, nullptr, &gerror); - if(gerror) + if (gerror) ::Glib::Error::throw_exception(gerror); message->set_serial(out_serial); return Glib::wrap(result); } -void Connection::call( - const Glib::ustring& object_path, - const Glib::ustring& interface_name, - const Glib::ustring& method_name, - const Glib::VariantContainerBase& parameters, - const SlotAsyncReady& slot, - const Glib::RefPtr<Cancellable>& cancellable, - const Glib::ustring& bus_name, - int timeout_msec, - CallFlags flags, - const Glib::VariantType& reply_type) +void +Connection::call(const Glib::ustring& object_path, const Glib::ustring& interface_name, + const Glib::ustring& method_name, const Glib::VariantContainerBase& parameters, + const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, + const Glib::ustring& bus_name, int timeout_msec, CallFlags flags, + const Glib::VariantType& reply_type) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter @@ -636,23 +529,17 @@ void Connection::call( auto slot_copy = new SlotAsyncReady(slot); g_dbus_connection_call(gobj(), Glib::c_str_or_nullptr(bus_name), object_path.c_str(), - interface_name.c_str(), method_name.c_str(), - const_cast<GVariant*>(parameters.gobj()), reply_type.gobj(), - static_cast<GDBusCallFlags>(flags), timeout_msec, - Glib::unwrap(cancellable), &SignalProxy_async_callback, slot_copy); + interface_name.c_str(), method_name.c_str(), const_cast<GVariant*>(parameters.gobj()), + reply_type.gobj(), static_cast<GDBusCallFlags>(flags), timeout_msec, Glib::unwrap(cancellable), + &SignalProxy_async_callback, slot_copy); } // Non-cancellable version. -void Connection::call( - const Glib::ustring& object_path, - const Glib::ustring& interface_name, - const Glib::ustring& method_name, - const Glib::VariantContainerBase& parameters, - const SlotAsyncReady& slot, - const Glib::ustring& bus_name, - int timeout_msec, - CallFlags flags, - const Glib::VariantType& reply_type) +void +Connection::call(const Glib::ustring& object_path, const Glib::ustring& interface_name, + const Glib::ustring& method_name, const Glib::VariantContainerBase& parameters, + const SlotAsyncReady& slot, const Glib::ustring& bus_name, int timeout_msec, CallFlags flags, + const Glib::VariantType& reply_type) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter @@ -660,77 +547,58 @@ void Connection::call( auto slot_copy = new SlotAsyncReady(slot); g_dbus_connection_call(gobj(), Glib::c_str_or_nullptr(bus_name), object_path.c_str(), - interface_name.c_str(), method_name.c_str(), - const_cast<GVariant*>(parameters.gobj()), reply_type.gobj(), - static_cast<GDBusCallFlags>(flags), timeout_msec, nullptr, + interface_name.c_str(), method_name.c_str(), const_cast<GVariant*>(parameters.gobj()), + reply_type.gobj(), static_cast<GDBusCallFlags>(flags), timeout_msec, nullptr, &SignalProxy_async_callback, slot_copy); } -Glib::VariantContainerBase Connection::call_sync( - const Glib::ustring& object_path, - const Glib::ustring& interface_name, - const Glib::ustring& method_name, - const Glib::VariantContainerBase& parameters, - const Glib::RefPtr<Cancellable>& cancellable, - const Glib::ustring& bus_name, - int timeout_msec, - CallFlags flags, - const Glib::VariantType& reply_type) +Glib::VariantContainerBase +Connection::call_sync(const Glib::ustring& object_path, const Glib::ustring& interface_name, + const Glib::ustring& method_name, const Glib::VariantContainerBase& parameters, + const Glib::RefPtr<Cancellable>& cancellable, const Glib::ustring& bus_name, int timeout_msec, + CallFlags flags, const Glib::VariantType& reply_type) { GError* gerror = nullptr; - GVariant* const gvariant = - g_dbus_connection_call_sync(gobj(), Glib::c_str_or_nullptr(bus_name), object_path.c_str(), - interface_name.c_str(), method_name.c_str(), - const_cast<GVariant*>(parameters.gobj()), reply_type.gobj(), - static_cast<GDBusCallFlags>(flags), timeout_msec, - Glib::unwrap(cancellable), &gerror); + GVariant* const gvariant = g_dbus_connection_call_sync(gobj(), Glib::c_str_or_nullptr(bus_name), + object_path.c_str(), interface_name.c_str(), method_name.c_str(), + const_cast<GVariant*>(parameters.gobj()), reply_type.gobj(), static_cast<GDBusCallFlags>(flags), + timeout_msec, Glib::unwrap(cancellable), &gerror); - if(gerror) + if (gerror) ::Glib::Error::throw_exception(gerror); - return Glib::VariantContainerBase(gvariant, false); //Dont' take an extra reference. + return Glib::VariantContainerBase(gvariant, false); // Dont' take an extra reference. } // Non-cancellable version. -Glib::VariantContainerBase Connection::call_sync( - const Glib::ustring& object_path, - const Glib::ustring& interface_name, - const Glib::ustring& method_name, - const Glib::VariantContainerBase& parameters, - const Glib::ustring& bus_name, - int timeout_msec, - CallFlags flags, - const Glib::VariantType& reply_type) +Glib::VariantContainerBase +Connection::call_sync(const Glib::ustring& object_path, const Glib::ustring& interface_name, + const Glib::ustring& method_name, const Glib::VariantContainerBase& parameters, + const Glib::ustring& bus_name, int timeout_msec, CallFlags flags, + const Glib::VariantType& reply_type) { GError* gerror = nullptr; GVariant* const gvariant = g_dbus_connection_call_sync(gobj(), Glib::c_str_or_nullptr(bus_name), object_path.c_str(), - interface_name.c_str(), method_name.c_str(), - const_cast<GVariant*>(parameters.gobj()), reply_type.gobj(), - static_cast<GDBusCallFlags>(flags), timeout_msec, nullptr, &gerror); + interface_name.c_str(), method_name.c_str(), const_cast<GVariant*>(parameters.gobj()), + reply_type.gobj(), static_cast<GDBusCallFlags>(flags), timeout_msec, nullptr, &gerror); - if(gerror) + if (gerror) ::Glib::Error::throw_exception(gerror); - return Glib::VariantContainerBase(gvariant, false); //Dont' take an extra reference. + return Glib::VariantContainerBase(gvariant, false); // Dont' take an extra reference. } #ifdef G_OS_UNIX // With a UnixFDList. -void Connection::call( - const Glib::ustring& object_path, - const Glib::ustring& interface_name, - const Glib::ustring& method_name, - const Glib::VariantContainerBase& parameters, - const SlotAsyncReady& slot, - const Glib::RefPtr<Cancellable>& cancellable, - const Glib::RefPtr<UnixFDList>& fd_list, - const Glib::ustring& bus_name, - int timeout_msec, - CallFlags flags, - const Glib::VariantType& reply_type) +void +Connection::call(const Glib::ustring& object_path, const Glib::ustring& interface_name, + const Glib::ustring& method_name, const Glib::VariantContainerBase& parameters, + const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, + const Glib::RefPtr<UnixFDList>& fd_list, const Glib::ustring& bus_name, int timeout_msec, + CallFlags flags, const Glib::VariantType& reply_type) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter @@ -739,23 +607,18 @@ void Connection::call( g_dbus_connection_call_with_unix_fd_list(gobj(), Glib::c_str_or_nullptr(bus_name), object_path.c_str(), interface_name.c_str(), method_name.c_str(), - const_cast<GVariant*>(parameters.gobj()), reply_type.gobj(), - static_cast<GDBusCallFlags>(flags), timeout_msec, Glib::unwrap(fd_list), - Glib::unwrap(cancellable), &SignalProxy_async_callback, slot_copy); + const_cast<GVariant*>(parameters.gobj()), reply_type.gobj(), static_cast<GDBusCallFlags>(flags), + timeout_msec, Glib::unwrap(fd_list), Glib::unwrap(cancellable), &SignalProxy_async_callback, + slot_copy); } // Non-cancellable version (with a UnixFDList). -void Connection::call( - const Glib::ustring& object_path, - const Glib::ustring& interface_name, - const Glib::ustring& method_name, - const Glib::VariantContainerBase& parameters, - const SlotAsyncReady& slot, - const Glib::RefPtr<UnixFDList>& fd_list, - const Glib::ustring& bus_name, - int timeout_msec, - CallFlags flags, - const Glib::VariantType& reply_type) +void +Connection::call(const Glib::ustring& object_path, const Glib::ustring& interface_name, + const Glib::ustring& method_name, const Glib::VariantContainerBase& parameters, + const SlotAsyncReady& slot, const Glib::RefPtr<UnixFDList>& fd_list, + const Glib::ustring& bus_name, int timeout_msec, CallFlags flags, + const Glib::VariantType& reply_type) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter @@ -764,111 +627,99 @@ void Connection::call( g_dbus_connection_call_with_unix_fd_list(gobj(), Glib::c_str_or_nullptr(bus_name), object_path.c_str(), interface_name.c_str(), method_name.c_str(), - const_cast<GVariant*>(parameters.gobj()), reply_type.gobj(), - static_cast<GDBusCallFlags>(flags), timeout_msec, Glib::unwrap(fd_list), - nullptr, &SignalProxy_async_callback, slot_copy); + const_cast<GVariant*>(parameters.gobj()), reply_type.gobj(), static_cast<GDBusCallFlags>(flags), + timeout_msec, Glib::unwrap(fd_list), nullptr, &SignalProxy_async_callback, slot_copy); } #endif // G_OS_UNIX -void Connection::emit_signal( - const Glib::ustring& object_path, - const Glib::ustring& interface_name, - const Glib::ustring& signal_name, - const Glib::ustring& destination_bus_name, - const Glib::VariantContainerBase& parameters) +void +Connection::emit_signal(const Glib::ustring& object_path, const Glib::ustring& interface_name, + const Glib::ustring& signal_name, const Glib::ustring& destination_bus_name, + const Glib::VariantContainerBase& parameters) { GError* gerror = nullptr; // destination_bus_name is checked to see if it is empty so that nullptr can be passed // to the C API. This is done because the bus name can be nullptr in the C API, // meaning that the signal should be emitted to all the listeners. - g_dbus_connection_emit_signal(gobj(), - Glib::c_str_or_nullptr(destination_bus_name), + g_dbus_connection_emit_signal(gobj(), Glib::c_str_or_nullptr(destination_bus_name), object_path.c_str(), interface_name.c_str(), signal_name.c_str(), const_cast<GVariant*>(parameters.gobj()), &gerror); - if(gerror) + if (gerror) ::Glib::Error::throw_exception(gerror); } -guint Connection::signal_subscribe( - const SlotSignal& slot, - const Glib::ustring& sender, - const Glib::ustring& interface_name, - const Glib::ustring& member, - const Glib::ustring& object_path, - const Glib::ustring& arg0, - SignalFlags flags) +guint +Connection::signal_subscribe(const SlotSignal& slot, const Glib::ustring& sender, + const Glib::ustring& interface_name, const Glib::ustring& member, + const Glib::ustring& object_path, const Glib::ustring& arg0, SignalFlags flags) { auto slot_copy = new SlotSignal(slot); - return g_dbus_connection_signal_subscribe(gobj(), - Glib::c_str_or_nullptr(sender), - Glib::c_str_or_nullptr(interface_name), - Glib::c_str_or_nullptr(member), - Glib::c_str_or_nullptr(object_path), - Glib::c_str_or_nullptr(arg0), - static_cast<GDBusSignalFlags>(flags), - &DBusConnection_Signal_giomm_callback, slot_copy, + return g_dbus_connection_signal_subscribe(gobj(), Glib::c_str_or_nullptr(sender), + Glib::c_str_or_nullptr(interface_name), Glib::c_str_or_nullptr(member), + Glib::c_str_or_nullptr(object_path), Glib::c_str_or_nullptr(arg0), + static_cast<GDBusSignalFlags>(flags), &DBusConnection_Signal_giomm_callback, slot_copy, &DBusConnection_Signal_giomm_callback_destroy); } -guint Connection::add_filter(const SlotMessageFilter& slot) +guint +Connection::add_filter(const SlotMessageFilter& slot) { auto slot_copy = new SlotMessageFilter(slot); - return g_dbus_connection_add_filter(gobj(), - &DBusConnection_Message_Filter_giomm_callback, slot_copy, - DBusConnection_Message_Filter_giomm_callback_destroy); + return g_dbus_connection_add_filter(gobj(), &DBusConnection_Message_Filter_giomm_callback, + slot_copy, DBusConnection_Message_Filter_giomm_callback_destroy); } -guint Connection::register_object(const Glib::ustring& object_path, - const Glib::RefPtr<InterfaceInfo>& interface_info, - const InterfaceVTable& vtable) +guint +Connection::register_object(const Glib::ustring& object_path, + const Glib::RefPtr<InterfaceInfo>& interface_info, const InterfaceVTable& vtable) { GError* gerror = nullptr; - const guint result = g_dbus_connection_register_object(gobj(), - object_path.c_str(), Glib::unwrap(interface_info), - vtable.gobj(), const_cast<InterfaceVTable*>(&vtable), nullptr, &gerror); + const guint result = + g_dbus_connection_register_object(gobj(), object_path.c_str(), Glib::unwrap(interface_info), + vtable.gobj(), const_cast<InterfaceVTable*>(&vtable), nullptr, &gerror); - if(gerror) + if (gerror) ::Glib::Error::throw_exception(gerror); return result; } -guint Connection::register_object(const Glib::ustring& object_path, - const Glib::RefPtr<InterfaceInfo>& interface_info) +guint +Connection::register_object( + const Glib::ustring& object_path, const Glib::RefPtr<InterfaceInfo>& interface_info) { GError* gerror = nullptr; - const guint result = g_dbus_connection_register_object(gobj(), - object_path.c_str(), Glib::unwrap(interface_info), - nullptr, nullptr, nullptr, &gerror); + const guint result = g_dbus_connection_register_object( + gobj(), object_path.c_str(), Glib::unwrap(interface_info), nullptr, nullptr, nullptr, &gerror); - if(gerror) + if (gerror) ::Glib::Error::throw_exception(gerror); return result; } -guint Connection::register_subtree(const Glib::ustring& object_path, - const SubtreeVTable& vtable, SubtreeFlags flags) +guint +Connection::register_subtree( + const Glib::ustring& object_path, const SubtreeVTable& vtable, SubtreeFlags flags) { GError* gerror = nullptr; - const guint result = g_dbus_connection_register_subtree(gobj(), - object_path.c_str(), - vtable.gobj(), static_cast<GDBusSubtreeFlags>(flags), - const_cast<SubtreeVTable*>(&vtable), nullptr, &gerror); + const guint result = + g_dbus_connection_register_subtree(gobj(), object_path.c_str(), vtable.gobj(), + static_cast<GDBusSubtreeFlags>(flags), const_cast<SubtreeVTable*>(&vtable), nullptr, &gerror); - if(gerror) + if (gerror) ::Glib::Error::throw_exception(gerror); return result; } -} //namespace DBus +} // namespace DBus } // namespace Gio diff --git a/gio/src/dbuserrorutils.ccg b/gio/src/dbuserrorutils.ccg index a5db2cec..d4e34906 100644 --- a/gio/src/dbuserrorutils.ccg +++ b/gio/src/dbuserrorutils.ccg @@ -30,17 +30,20 @@ namespace DBus namespace ErrorUtils { -bool is_remote_error(const Glib::Error& error) +bool +is_remote_error(const Glib::Error& error) { return static_cast<bool>(g_dbus_error_is_remote_error(error.gobj())); } -Glib::ustring get_remote_error(const Glib::Error& error) +Glib::ustring +get_remote_error(const Glib::Error& error) { return Glib::convert_const_gchar_ptr_to_ustring(g_dbus_error_get_remote_error(error.gobj())); } -bool strip_remote_error(Glib::Error& error) +bool +strip_remote_error(Glib::Error& error) { return static_cast<bool>(g_dbus_error_strip_remote_error(error.gobj())); } 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 diff --git a/gio/src/dbusintrospection.ccg b/gio/src/dbusintrospection.ccg index 788ea319..4a37d378 100644 --- a/gio/src/dbusintrospection.ccg +++ b/gio/src/dbusintrospection.ccg @@ -26,29 +26,31 @@ namespace Gio namespace DBus { -//We hand-code this because g_dbus_node_info_lookup_interface() doesn't -//do this when it takes a nullptr. -//See bug https://bugzilla.gnome.org/show_bug.cgi?id=646417 -Glib::RefPtr<InterfaceInfo> NodeInfo::lookup_interface() +// We hand-code this because g_dbus_node_info_lookup_interface() doesn't +// do this when it takes a nullptr. +// See bug https://bugzilla.gnome.org/show_bug.cgi?id=646417 +Glib::RefPtr<InterfaceInfo> +NodeInfo::lookup_interface() { Glib::RefPtr<InterfaceInfo> retvalue; - if(!gobj() || !(gobj()->interfaces)) + if (!gobj() || !(gobj()->interfaces)) return retvalue; retvalue = Glib::wrap(gobj()->interfaces[0]); - if(retvalue) - retvalue->reference(); //The function does not do a ref for us. + if (retvalue) + retvalue->reference(); // The function does not do a ref for us. return retvalue; } -Glib::RefPtr<const InterfaceInfo> NodeInfo::lookup_interface() const +Glib::RefPtr<const InterfaceInfo> +NodeInfo::lookup_interface() const { return const_cast<NodeInfo*>(this)->lookup_interface(); } -} //namespace DBus +} // namespace DBus } // namespace Gio diff --git a/gio/src/dbusmessage.ccg b/gio/src/dbusmessage.ccg index 25e72192..fb2cd8aa 100644 --- a/gio/src/dbusmessage.ccg +++ b/gio/src/dbusmessage.ccg @@ -22,7 +22,7 @@ #ifdef G_OS_UNIX #include <giomm/unixfdlist.h> -#endif //G_OS_UNIX +#endif // G_OS_UNIX namespace Gio { @@ -32,37 +32,37 @@ namespace DBus typedef Message::ByteOrder ByteOrder; -void Message::get_body(Glib::VariantBase& value) const +void +Message::get_body(Glib::VariantBase& value) const { - GVariant* const g_value = - g_dbus_message_get_body(const_cast<GDBusMessage*>(gobj())); + GVariant* const g_value = g_dbus_message_get_body(const_cast<GDBusMessage*>(gobj())); - if(!g_value) + if (!g_value) return; value.init(g_value, true /* take a reference */); } -void Message::get_header(Glib::VariantBase& value, - MessageHeaderField header_field) const +void +Message::get_header(Glib::VariantBase& value, MessageHeaderField header_field) const { - GVariant* const g_value = - g_dbus_message_get_header(const_cast<GDBusMessage*>(gobj()), - ((GDBusMessageHeaderField)(header_field))); + GVariant* const g_value = g_dbus_message_get_header( + const_cast<GDBusMessage*>(gobj()), ((GDBusMessageHeaderField)(header_field))); - if(!g_value) + if (!g_value) return; value.init(g_value, true /* take a reference */); } #ifdef G_OS_UNIX -void Message::unset_unix_fd_list() +void +Message::unset_unix_fd_list() { g_dbus_message_set_unix_fd_list(gobj(), nullptr); } -#endif //G_OS_UNIX +#endif // G_OS_UNIX -} //namespace DBus +} // namespace DBus } // namespace Gio diff --git a/gio/src/dbusownname.ccg b/gio/src/dbusownname.ccg index 49de2042..db1a37b3 100644 --- a/gio/src/dbusownname.ccg +++ b/gio/src/dbusownname.ccg @@ -31,11 +31,10 @@ struct OwnSlots Gio::DBus::SlotNameLost* name_lost_slot; }; -extern "C" -{ +extern "C" { -static void Bus_Acquired_giomm_callback(GDBusConnection* connection, - const gchar* name, gpointer data) +static void +Bus_Acquired_giomm_callback(GDBusConnection* connection, const gchar* name, gpointer data) { auto slots = static_cast<OwnSlots*>(data); auto the_slot = slots->bus_acquired_slot; @@ -44,14 +43,14 @@ static void Bus_Acquired_giomm_callback(GDBusConnection* connection, { (*the_slot)(Glib::wrap(connection, true), Glib::convert_const_gchar_ptr_to_ustring(name)); } - catch(...) + catch (...) { Glib::exception_handlers_invoke(); } } -static void Bus_Name_Acquired_giomm_callback(GDBusConnection* connection, - const gchar* name, gpointer data) +static void +Bus_Name_Acquired_giomm_callback(GDBusConnection* connection, const gchar* name, gpointer data) { auto slots = static_cast<OwnSlots*>(data); auto the_slot = slots->name_acquired_slot; @@ -60,14 +59,14 @@ static void Bus_Name_Acquired_giomm_callback(GDBusConnection* connection, { (*the_slot)(Glib::wrap(connection, true), Glib::convert_const_gchar_ptr_to_ustring(name)); } - catch(...) + catch (...) { Glib::exception_handlers_invoke(); } } -static void Bus_Name_Lost_giomm_callback(GDBusConnection* connection, - const gchar* name, gpointer data) +static void +Bus_Name_Lost_giomm_callback(GDBusConnection* connection, const gchar* name, gpointer data) { auto slots = static_cast<OwnSlots*>(data); auto the_slot = slots->name_lost_slot; @@ -76,23 +75,24 @@ static void Bus_Name_Lost_giomm_callback(GDBusConnection* connection, { (*the_slot)(Glib::wrap(connection, true), Glib::convert_const_gchar_ptr_to_ustring(name)); } - catch(...) + catch (...) { Glib::exception_handlers_invoke(); } } -static void Bus_Own_Name_giomm_callback_destroy(void* data) +static void +Bus_Own_Name_giomm_callback_destroy(void* data) { - auto slots = static_cast<OwnSlots*>(data); + auto slots = static_cast<OwnSlots*>(data); - if(slots->bus_acquired_slot) + if (slots->bus_acquired_slot) delete slots->bus_acquired_slot; - if(slots->name_acquired_slot) + if (slots->name_acquired_slot) delete slots->name_acquired_slot; - if(slots->name_lost_slot) + if (slots->name_lost_slot) delete slots->name_lost_slot; delete slots; @@ -102,21 +102,16 @@ static void Bus_Own_Name_giomm_callback_destroy(void* data) } // anonymous namespace - namespace Gio { namespace DBus { -guint own_name( - BusType bus_type, - const Glib::ustring& name, - const SlotBusAcquired& bus_acquired_slot, - const SlotNameAcquired& name_acquired_slot, - const SlotNameLost& name_lost_slot, - BusNameOwnerFlags flags -) +guint +own_name(BusType bus_type, const Glib::ustring& name, const SlotBusAcquired& bus_acquired_slot, + const SlotNameAcquired& name_acquired_slot, const SlotNameLost& name_lost_slot, + BusNameOwnerFlags flags) { auto slots = new OwnSlots; @@ -131,7 +126,8 @@ guint own_name( &Bus_Own_Name_giomm_callback_destroy); } -void unown_name(guint owner_id) +void +unown_name(guint owner_id) { g_bus_unown_name(owner_id); } diff --git a/gio/src/dbusproxy.ccg b/gio/src/dbusproxy.ccg index aac660ec..a8185739 100644 --- a/gio/src/dbusproxy.ccg +++ b/gio/src/dbusproxy.ccg @@ -30,348 +30,245 @@ namespace Gio namespace DBus { -//Help the generate code: +// Help the generate code: typedef Proxy::MapChangedProperties MapChangedProperties; -Proxy::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, +Proxy::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) -: -_CONSTRUCT("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)) +: _CONSTRUCT("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)) { init_async(slot, cancellable); } -Proxy::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) -: -_CONSTRUCT("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)) +Proxy::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) +: _CONSTRUCT("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)) { init_async(slot); } -Proxy::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, +Proxy::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) -: -_CONSTRUCT("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)) +: _CONSTRUCT("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)) { init(cancellable); } -Proxy::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) -: -_CONSTRUCT("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)) +Proxy::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) +: _CONSTRUCT("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)) { init(); } -Proxy::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, +Proxy::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) -: -_CONSTRUCT("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)) +: _CONSTRUCT("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)) { init_async(slot, cancellable); } -Proxy::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) -: -_CONSTRUCT("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)) +Proxy::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) +: _CONSTRUCT("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)) { init_async(slot); } -Proxy::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) -: -_CONSTRUCT("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)) +Proxy::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) +: _CONSTRUCT("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)) { init(cancellable); } -Proxy::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) -: -_CONSTRUCT("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)) +Proxy::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) +: _CONSTRUCT("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)) { init(); } -void Proxy::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, +void +Proxy::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) { - Proxy(connection, name, object_path, interface_name, slot, - cancellable, info, flags); + Proxy(connection, name, object_path, interface_name, slot, cancellable, info, flags); } -void Proxy::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) +void +Proxy::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) { Proxy(connection, name, object_path, interface_name, slot, info, flags); } Glib::RefPtr<Proxy> -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, +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) { - return Glib::RefPtr<Proxy>(new Proxy(connection, name, - object_path, interface_name, cancellable, info, flags)); + return Glib::RefPtr<Proxy>( + new Proxy(connection, name, object_path, interface_name, cancellable, info, flags)); } Glib::RefPtr<Proxy> -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) +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) { - return Glib::RefPtr<Proxy>(new Proxy(connection, name, - object_path, interface_name, info, flags)); + return Glib::RefPtr<Proxy>(new Proxy(connection, name, object_path, interface_name, info, flags)); } -void Proxy::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, +void +Proxy::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) { - Proxy(bus_type, name, object_path, interface_name, slot, cancellable, - info, flags); + Proxy(bus_type, name, object_path, interface_name, slot, cancellable, info, flags); } -void Proxy::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) +void +Proxy::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) { Proxy(bus_type, name, object_path, interface_name, slot, info, flags); } -Glib::RefPtr<Proxy> 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, +Glib::RefPtr<Proxy> +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) { - return Glib::RefPtr<Proxy>(new Proxy(bus_type, name, - object_path, interface_name, cancellable, info, flags)); + return Glib::RefPtr<Proxy>( + new Proxy(bus_type, name, object_path, interface_name, cancellable, info, flags)); } -Glib::RefPtr<Proxy> 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) +Glib::RefPtr<Proxy> +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) { - return Glib::RefPtr<Proxy>(new Proxy(bus_type, name, - object_path, interface_name, info, flags)); + return Glib::RefPtr<Proxy>(new Proxy(bus_type, name, object_path, interface_name, info, flags)); } -void Proxy::get_cached_property(Glib::VariantBase& property, - const Glib::ustring& property_name) const +void +Proxy::get_cached_property(Glib::VariantBase& property, const Glib::ustring& property_name) const { GVariant* const g_variant = - g_dbus_proxy_get_cached_property(const_cast<GDBusProxy*>(gobj()), - property_name.c_str()); + g_dbus_proxy_get_cached_property(const_cast<GDBusProxy*>(gobj()), property_name.c_str()); property.init(g_variant, false /* no extra reference needed */); } -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 -) +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) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. auto slot_copy = new SlotAsyncReady(slot); - g_dbus_proxy_call(gobj(), method_name.c_str(), - const_cast<GVariant*>(parameters.gobj()), - static_cast<GDBusCallFlags>(flags), timeout_msec, - Glib::unwrap(cancellable), &SignalProxy_async_callback, slot_copy); + g_dbus_proxy_call(gobj(), method_name.c_str(), const_cast<GVariant*>(parameters.gobj()), + static_cast<GDBusCallFlags>(flags), timeout_msec, Glib::unwrap(cancellable), + &SignalProxy_async_callback, slot_copy); } -void Proxy::call(const Glib::ustring& method_name, - const SlotAsyncReady& slot, - const Glib::VariantContainerBase& parameters, - int timeout_msec, - CallFlags flags -) +void +Proxy::call(const Glib::ustring& method_name, const SlotAsyncReady& slot, + const Glib::VariantContainerBase& parameters, int timeout_msec, CallFlags flags) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. auto slot_copy = new SlotAsyncReady(slot); - g_dbus_proxy_call(gobj(), method_name.c_str(), - const_cast<GVariant*>(parameters.gobj()), - static_cast<GDBusCallFlags>(flags), timeout_msec, - nullptr, &SignalProxy_async_callback, slot_copy); + g_dbus_proxy_call(gobj(), method_name.c_str(), const_cast<GVariant*>(parameters.gobj()), + static_cast<GDBusCallFlags>(flags), timeout_msec, nullptr, &SignalProxy_async_callback, + slot_copy); } -Glib::VariantContainerBase Proxy::call_sync( - const Glib::ustring& method_name, - const Glib::RefPtr<Cancellable>& cancellable, - const Glib::VariantContainerBase& parameters, - int timeout_msec, - CallFlags flags -) +Glib::VariantContainerBase +Proxy::call_sync(const Glib::ustring& method_name, const Glib::RefPtr<Cancellable>& cancellable, + const Glib::VariantContainerBase& parameters, int timeout_msec, CallFlags flags) { GError* g_error = nullptr; GVariant* const gvariant = - g_dbus_proxy_call_sync(gobj(), method_name.c_str(), - const_cast<GVariant*>(parameters.gobj()), - static_cast<GDBusCallFlags>(flags), timeout_msec, - Glib::unwrap(cancellable), &g_error); + g_dbus_proxy_call_sync(gobj(), method_name.c_str(), const_cast<GVariant*>(parameters.gobj()), + static_cast<GDBusCallFlags>(flags), timeout_msec, Glib::unwrap(cancellable), &g_error); - if(g_error) + if (g_error) ::Glib::Error::throw_exception(g_error); - return Glib::VariantContainerBase(gvariant, false); //Dont' take an extra reference. + return Glib::VariantContainerBase(gvariant, false); // Dont' take an extra reference. } -Glib::VariantContainerBase Proxy::call_sync( - const Glib::ustring& method_name, - const Glib::VariantContainerBase& parameters, - int timeout_msec, - CallFlags flags -) +Glib::VariantContainerBase +Proxy::call_sync(const Glib::ustring& method_name, const Glib::VariantContainerBase& parameters, + int timeout_msec, CallFlags flags) { GError* g_error = nullptr; GVariant* const gvariant = - g_dbus_proxy_call_sync(gobj(), method_name.c_str(), - const_cast<GVariant*>(parameters.gobj()), - static_cast<GDBusCallFlags>(flags), timeout_msec, nullptr, &g_error); + g_dbus_proxy_call_sync(gobj(), method_name.c_str(), const_cast<GVariant*>(parameters.gobj()), + static_cast<GDBusCallFlags>(flags), timeout_msec, nullptr, &g_error); - if(g_error) + if (g_error) ::Glib::Error::throw_exception(g_error); - return Glib::VariantContainerBase(gvariant, false); //Dont' take an extra reference. + return Glib::VariantContainerBase(gvariant, false); // Dont' take an extra reference. } #ifdef G_OS_UNIX // With a UnixFDList. -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) +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) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter @@ -379,19 +276,15 @@ void Proxy::call( auto slot_copy = new SlotAsyncReady(slot); g_dbus_proxy_call_with_unix_fd_list(gobj(), method_name.c_str(), - const_cast<GVariant*>(parameters.gobj()), - static_cast<GDBusCallFlags>(flags), timeout_msec, Glib::unwrap(fd_list), - Glib::unwrap(cancellable), &SignalProxy_async_callback, slot_copy); + const_cast<GVariant*>(parameters.gobj()), static_cast<GDBusCallFlags>(flags), timeout_msec, + Glib::unwrap(fd_list), Glib::unwrap(cancellable), &SignalProxy_async_callback, slot_copy); } // Non-cancellable version (with a UnixFDList). -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) +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) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter @@ -399,12 +292,11 @@ void Proxy::call( auto slot_copy = new SlotAsyncReady(slot); g_dbus_proxy_call_with_unix_fd_list(gobj(), method_name.c_str(), - const_cast<GVariant*>(parameters.gobj()), - static_cast<GDBusCallFlags>(flags), timeout_msec, Glib::unwrap(fd_list), - nullptr, &SignalProxy_async_callback, slot_copy); + const_cast<GVariant*>(parameters.gobj()), static_cast<GDBusCallFlags>(flags), timeout_msec, + Glib::unwrap(fd_list), nullptr, &SignalProxy_async_callback, slot_copy); } #endif // G_OS_UNIX -} //namespace DBus +} // namespace DBus } // namespace Gio diff --git a/gio/src/dbusserver.ccg b/gio/src/dbusserver.ccg index 36c8af08..2d6aea8d 100644 --- a/gio/src/dbusserver.ccg +++ b/gio/src/dbusserver.ccg @@ -27,85 +27,66 @@ namespace Gio namespace DBus { -Server::Server(const std::string& address, - const std::string& guid, - const Glib::RefPtr<AuthObserver>& observer, - const Glib::RefPtr<Cancellable>& cancellable, +Server::Server(const std::string& address, const std::string& guid, + const Glib::RefPtr<AuthObserver>& observer, const Glib::RefPtr<Cancellable>& cancellable, ServerFlags flags) - : _CONSTRUCT("address", Glib::c_str_or_nullptr(address), - "flags", static_cast<GDBusServerFlags>(flags), - "guid", Glib::c_str_or_nullptr(guid), +: _CONSTRUCT("address", Glib::c_str_or_nullptr(address), "flags", + static_cast<GDBusServerFlags>(flags), "guid", Glib::c_str_or_nullptr(guid), "authentication-observer", Glib::unwrap(observer)) { init(cancellable); } -Server::Server(const std::string& address, - const std::string& guid, - const Glib::RefPtr<Cancellable>& cancellable, - ServerFlags flags) - : _CONSTRUCT("address", Glib::c_str_or_nullptr(address), - "flags", static_cast<GDBusServerFlags>(flags), - "guid", Glib::c_str_or_nullptr(guid), +Server::Server(const std::string& address, const std::string& guid, + const Glib::RefPtr<Cancellable>& cancellable, ServerFlags flags) +: _CONSTRUCT("address", Glib::c_str_or_nullptr(address), "flags", + static_cast<GDBusServerFlags>(flags), "guid", Glib::c_str_or_nullptr(guid), "authentication-observer", static_cast<GDBusAuthObserver*>(nullptr)) { init(cancellable); } -Server::Server(const std::string& address, - const std::string& guid, - const Glib::RefPtr<AuthObserver>& observer, - ServerFlags flags) - : _CONSTRUCT("address", Glib::c_str_or_nullptr(address), - "flags", static_cast<GDBusServerFlags>(flags), - "guid", Glib::c_str_or_nullptr(guid), +Server::Server(const std::string& address, const std::string& guid, + const Glib::RefPtr<AuthObserver>& observer, ServerFlags flags) +: _CONSTRUCT("address", Glib::c_str_or_nullptr(address), "flags", + static_cast<GDBusServerFlags>(flags), "guid", Glib::c_str_or_nullptr(guid), "authentication-observer", Glib::unwrap(observer)) { init(); } -Server::Server(const std::string& address, - const std::string& guid, - ServerFlags flags) - : _CONSTRUCT("address", Glib::c_str_or_nullptr(address), - "flags", static_cast<GDBusServerFlags>(flags), - "guid", Glib::c_str_or_nullptr(guid), +Server::Server(const std::string& address, const std::string& guid, ServerFlags flags) +: _CONSTRUCT("address", Glib::c_str_or_nullptr(address), "flags", + static_cast<GDBusServerFlags>(flags), "guid", Glib::c_str_or_nullptr(guid), "authentication-observer", static_cast<GDBusAuthObserver*>(nullptr)) { init(); } -Glib::RefPtr<Server> Server::create_sync(const std::string& address, - const std::string& guid, - const Glib::RefPtr<AuthObserver>& observer, - const Glib::RefPtr<Cancellable>& cancellable, +Glib::RefPtr<Server> +Server::create_sync(const std::string& address, const std::string& guid, + const Glib::RefPtr<AuthObserver>& observer, const Glib::RefPtr<Cancellable>& cancellable, ServerFlags flags) { - return Glib::RefPtr<Server>(new Server(address, guid, observer, - cancellable, flags)); + return Glib::RefPtr<Server>(new Server(address, guid, observer, cancellable, flags)); } -Glib::RefPtr<Server> Server::create_sync(const std::string& address, - const std::string& guid, - const Glib::RefPtr<Cancellable>& cancellable, - ServerFlags flags) +Glib::RefPtr<Server> +Server::create_sync(const std::string& address, const std::string& guid, + const Glib::RefPtr<Cancellable>& cancellable, ServerFlags flags) { - return Glib::RefPtr<Server>(new Server(address, guid, - cancellable, flags)); + return Glib::RefPtr<Server>(new Server(address, guid, cancellable, flags)); } -Glib::RefPtr<Server> Server::create_sync(const std::string& address, - const std::string& guid, - const Glib::RefPtr<AuthObserver>& observer, - ServerFlags flags) +Glib::RefPtr<Server> +Server::create_sync(const std::string& address, const std::string& guid, + const Glib::RefPtr<AuthObserver>& observer, ServerFlags flags) { - return Glib::RefPtr<Server>(new Server(address, guid, observer, - flags)); + return Glib::RefPtr<Server>(new Server(address, guid, observer, flags)); } -Glib::RefPtr<Server> Server::create_sync(const std::string& address, - const std::string& guid, - ServerFlags flags) +Glib::RefPtr<Server> +Server::create_sync(const std::string& address, const std::string& guid, ServerFlags flags) { return Glib::RefPtr<Server>(new Server(address, guid, flags)); } diff --git a/gio/src/dbussubtreevtable.ccg b/gio/src/dbussubtreevtable.ccg index 1b0e2956..0445386e 100644 --- a/gio/src/dbussubtreevtable.ccg +++ b/gio/src/dbussubtreevtable.ccg @@ -29,35 +29,31 @@ namespace { -extern "C" -{ +extern "C" { -static char** DBusSubtreeVTable_Enumerate_giomm_callback( - GDBusConnection* connection, const char* sender, const char* object_path, - void* user_data) +static char** +DBusSubtreeVTable_Enumerate_giomm_callback( + GDBusConnection* connection, const char* sender, const char* object_path, void* user_data) { - Gio::DBus::SubtreeVTable* vtable = - static_cast<Gio::DBus::SubtreeVTable*>(user_data); + Gio::DBus::SubtreeVTable* vtable = static_cast<Gio::DBus::SubtreeVTable*>(user_data); - Gio::DBus::SubtreeVTable::SlotSubtreeEnumerate* the_slot = - vtable->get_slot_enumerate(); + Gio::DBus::SubtreeVTable::SlotSubtreeEnumerate* the_slot = vtable->get_slot_enumerate(); try { - auto result = - (*the_slot)(Glib::wrap(connection, true), sender, object_path); + auto result = (*the_slot)(Glib::wrap(connection, true), sender, object_path); // This will be freed by the caller. char** ret = g_new(char*, result.size()); - for(std::vector<Glib::ustring>::size_type i = 0; i < result.size(); i++) + for (std::vector<Glib::ustring>::size_type i = 0; i < result.size(); i++) { ret[i] = g_strdup(result[i].c_str()); } return ret; } - catch(...) + catch (...) { Glib::exception_handlers_invoke(); } @@ -65,34 +61,30 @@ static char** DBusSubtreeVTable_Enumerate_giomm_callback( return nullptr; } -static GDBusInterfaceInfo** DBusSubtreeVTable_Introspect_giomm_callback( - GDBusConnection* connection, const char* sender, const char* object_path, - const char* node, void* user_data) +static GDBusInterfaceInfo** +DBusSubtreeVTable_Introspect_giomm_callback(GDBusConnection* connection, const char* sender, + const char* object_path, const char* node, void* user_data) { - Gio::DBus::SubtreeVTable* vtable = - static_cast<Gio::DBus::SubtreeVTable*>(user_data); + Gio::DBus::SubtreeVTable* vtable = static_cast<Gio::DBus::SubtreeVTable*>(user_data); - Gio::DBus::SubtreeVTable::SlotSubtreeIntrospect* the_slot = - vtable->get_slot_introspect(); + Gio::DBus::SubtreeVTable::SlotSubtreeIntrospect* the_slot = vtable->get_slot_introspect(); try { - auto result = - (*the_slot)(Glib::wrap(connection, true), sender, object_path, node); + auto result = (*the_slot)(Glib::wrap(connection, true), sender, object_path, node); // This will be freed by the caller, along with unreferencing its members. GDBusInterfaceInfo** info = g_new(GDBusInterfaceInfo*, result.size()); - for(std::vector< Glib::RefPtr<Gio::DBus::InterfaceInfo> >::size_type i = 0; - i < result.size(); i++) + for (std::vector<Glib::RefPtr<Gio::DBus::InterfaceInfo>>::size_type i = 0; i < result.size(); + i++) { - info[i] = static_cast<GDBusInterfaceInfo*>( - g_object_ref(result[i]->gobj())); + info[i] = static_cast<GDBusInterfaceInfo*>(g_object_ref(result[i]->gobj())); } return info; } - catch(...) + catch (...) { Glib::exception_handlers_invoke(); } @@ -100,28 +92,25 @@ static GDBusInterfaceInfo** DBusSubtreeVTable_Introspect_giomm_callback( return nullptr; } -static const GDBusInterfaceVTable* DBusSubtreeVTable_Dispatch_giomm_callback( - GDBusConnection* connection, const char* sender, const char* object_path, - const char* interface_name, const char* node, void** out_user_data, +static const GDBusInterfaceVTable* +DBusSubtreeVTable_Dispatch_giomm_callback(GDBusConnection* connection, const char* sender, + const char* object_path, const char* interface_name, const char* node, void** out_user_data, void* user_data) { - Gio::DBus::SubtreeVTable* vtable_subtree = - static_cast<Gio::DBus::SubtreeVTable*>(user_data); + Gio::DBus::SubtreeVTable* vtable_subtree = static_cast<Gio::DBus::SubtreeVTable*>(user_data); - Gio::DBus::SubtreeVTable::SlotSubtreeDispatch* the_slot = - vtable_subtree->get_slot_dispatch(); + Gio::DBus::SubtreeVTable::SlotSubtreeDispatch* the_slot = vtable_subtree->get_slot_dispatch(); try { - const Gio::DBus::InterfaceVTable* vtable_iface = - (*the_slot)(Glib::wrap(connection, true), sender, object_path, - interface_name, (node ? node : "")); + const Gio::DBus::InterfaceVTable* vtable_iface = (*the_slot)( + Glib::wrap(connection, true), sender, object_path, interface_name, (node ? node : "")); *out_user_data = const_cast<Gio::DBus::InterfaceVTable*>(vtable_iface); return vtable_iface->gobj(); } - catch(...) + catch (...) { Glib::exception_handlers_invoke(); } @@ -130,7 +119,6 @@ static const GDBusInterfaceVTable* DBusSubtreeVTable_Dispatch_giomm_callback( } } // extern "C" - } namespace Gio @@ -139,12 +127,8 @@ namespace Gio namespace DBus { - -SubtreeVTable::SubtreeVTable( - const SlotSubtreeEnumerate& slot_enumerate, - const SlotSubtreeIntrospect& slot_introspect, - const SlotSubtreeDispatch& slot_dispatch -) +SubtreeVTable::SubtreeVTable(const SlotSubtreeEnumerate& slot_enumerate, + const SlotSubtreeIntrospect& slot_introspect, const SlotSubtreeDispatch& slot_dispatch) : slot_enumerate_(new SlotSubtreeEnumerate(slot_enumerate)), slot_introspect_(new SlotSubtreeIntrospect(slot_introspect)), slot_dispatch_(new SlotSubtreeDispatch(slot_dispatch)) @@ -155,17 +139,18 @@ SubtreeVTable::SubtreeVTable( } SubtreeVTable::SubtreeVTable(SubtreeVTable&& other) noexcept -: gobject_(std::move(other.gobject_)), - slot_enumerate_(std::move(other.slot_enumerate_)), - slot_introspect_(std::move(other.slot_introspect_)), - slot_dispatch_(std::move(other.slot_dispatch_)) + : gobject_(std::move(other.gobject_)), + slot_enumerate_(std::move(other.slot_enumerate_)), + slot_introspect_(std::move(other.slot_introspect_)), + slot_dispatch_(std::move(other.slot_dispatch_)) { other.slot_enumerate_ = nullptr; other.slot_introspect_ = nullptr; other.slot_dispatch_ = nullptr; } -SubtreeVTable& SubtreeVTable::operator=(SubtreeVTable&& other) noexcept +SubtreeVTable& +SubtreeVTable::operator=(SubtreeVTable&& other) noexcept { delete slot_enumerate_; delete slot_introspect_; @@ -191,23 +176,23 @@ SubtreeVTable::~SubtreeVTable() } SubtreeVTable::SlotSubtreeEnumerate* - SubtreeVTable::get_slot_enumerate() const +SubtreeVTable::get_slot_enumerate() const { return slot_enumerate_; } SubtreeVTable::SlotSubtreeIntrospect* - SubtreeVTable::get_slot_introspect() const +SubtreeVTable::get_slot_introspect() const { return slot_introspect_; } SubtreeVTable::SlotSubtreeDispatch* - SubtreeVTable::get_slot_dispatch() const +SubtreeVTable::get_slot_dispatch() const { return slot_dispatch_; } -} //namespace DBus +} // namespace DBus } // namespace Gio diff --git a/gio/src/dbusutils.ccg b/gio/src/dbusutils.ccg index 195b73c5..a614bceb 100644 --- a/gio/src/dbusutils.ccg +++ b/gio/src/dbusutils.ccg @@ -26,32 +26,38 @@ namespace Gio namespace DBus { -std::string generate_guid() +std::string +generate_guid() { return Glib::convert_const_gchar_ptr_to_stdstring(g_dbus_generate_guid()); } -bool is_guid(const std::string& string) +bool +is_guid(const std::string& string) { return static_cast<bool>(g_dbus_is_guid(string.c_str())); } -bool is_name(const Glib::ustring& string) +bool +is_name(const Glib::ustring& string) { return static_cast<bool>(g_dbus_is_name(string.c_str())); } -bool is_unique_name(const Glib::ustring& string) +bool +is_unique_name(const Glib::ustring& string) { return static_cast<bool>(g_dbus_is_unique_name(string.c_str())); } -bool is_member_name(const Glib::ustring& string) +bool +is_member_name(const Glib::ustring& string) { return static_cast<bool>(g_dbus_is_member_name(string.c_str())); } -bool is_interface_name(const Glib::ustring& string) +bool +is_interface_name(const Glib::ustring& string) { return static_cast<bool>(g_dbus_is_interface_name(string.c_str())); } diff --git a/gio/src/dbuswatchname.ccg b/gio/src/dbuswatchname.ccg index 0900b6a0..fa7a1ee3 100644 --- a/gio/src/dbuswatchname.ccg +++ b/gio/src/dbuswatchname.ccg @@ -30,11 +30,11 @@ struct WatchSlots Gio::DBus::SlotNameVanished* name_vanished_slot; }; -extern "C" -{ +extern "C" { -static void Bus_Name_Appeared_giomm_callback(GDBusConnection* connection, - const gchar* name, const char* name_owner, gpointer data) +static void +Bus_Name_Appeared_giomm_callback( + GDBusConnection* connection, const gchar* name, const char* name_owner, gpointer data) { auto slots = static_cast<WatchSlots*>(data); auto the_slot = slots->name_appeared_slot; @@ -44,14 +44,14 @@ static void Bus_Name_Appeared_giomm_callback(GDBusConnection* connection, (*the_slot)(Glib::wrap(connection, true), Glib::convert_const_gchar_ptr_to_ustring(name), Glib::convert_const_gchar_ptr_to_ustring(name_owner)); } - catch(...) + catch (...) { Glib::exception_handlers_invoke(); } } -static void Bus_Name_Vanished_giomm_callback(GDBusConnection* connection, - const gchar* name, gpointer data) +static void +Bus_Name_Vanished_giomm_callback(GDBusConnection* connection, const gchar* name, gpointer data) { auto slots = static_cast<WatchSlots*>(data); auto the_slot = slots->name_vanished_slot; @@ -60,20 +60,21 @@ static void Bus_Name_Vanished_giomm_callback(GDBusConnection* connection, { (*the_slot)(Glib::wrap(connection, true), Glib::convert_const_gchar_ptr_to_ustring(name)); } - catch(...) + catch (...) { Glib::exception_handlers_invoke(); } } -static void Bus_Watch_Name_giomm_callback_destroy(void* data) +static void +Bus_Watch_Name_giomm_callback_destroy(void* data) { - auto slots = static_cast<WatchSlots*>(data); + auto slots = static_cast<WatchSlots*>(data); - if(slots->name_appeared_slot) + if (slots->name_appeared_slot) delete slots->name_appeared_slot; - if(slots->name_vanished_slot) + if (slots->name_vanished_slot) delete slots->name_vanished_slot; delete slots; @@ -83,20 +84,15 @@ static void Bus_Watch_Name_giomm_callback_destroy(void* data) } // anonymous namespace - namespace Gio { namespace DBus { -guint watch_name( - BusType bus_type, - const Glib::ustring& name, - const SlotNameAppeared& name_appeared_slot, - const SlotNameVanished& name_vanished_slot, - BusNameWatcherFlags flags -) +guint +watch_name(BusType bus_type, const Glib::ustring& name, const SlotNameAppeared& name_appeared_slot, + const SlotNameVanished& name_vanished_slot, BusNameWatcherFlags flags) { auto slots = new WatchSlots; @@ -105,18 +101,14 @@ guint watch_name( slots->name_vanished_slot = new SlotNameVanished(name_vanished_slot); return g_bus_watch_name(static_cast<GBusType>(bus_type), name.c_str(), - static_cast<GBusNameWatcherFlags>(flags), - &Bus_Name_Appeared_giomm_callback, &Bus_Name_Vanished_giomm_callback, - slots, &Bus_Watch_Name_giomm_callback_destroy); + static_cast<GBusNameWatcherFlags>(flags), &Bus_Name_Appeared_giomm_callback, + &Bus_Name_Vanished_giomm_callback, slots, &Bus_Watch_Name_giomm_callback_destroy); } -guint watch_name( - const Glib::RefPtr<Connection>& connection, - const Glib::ustring& name, - const SlotNameAppeared& name_appeared_slot, - const SlotNameVanished& name_vanished_slot, - BusNameWatcherFlags flags -) +guint +watch_name(const Glib::RefPtr<Connection>& connection, const Glib::ustring& name, + const SlotNameAppeared& name_appeared_slot, const SlotNameVanished& name_vanished_slot, + BusNameWatcherFlags flags) { auto slots = new WatchSlots; @@ -124,13 +116,13 @@ guint watch_name( slots->name_appeared_slot = new SlotNameAppeared(name_appeared_slot); slots->name_vanished_slot = new SlotNameVanished(name_vanished_slot); - return g_bus_watch_name_on_connection(Glib::unwrap(connection), - name.c_str(), static_cast<GBusNameWatcherFlags>(flags), - &Bus_Name_Appeared_giomm_callback, &Bus_Name_Vanished_giomm_callback, - slots, &Bus_Watch_Name_giomm_callback_destroy); + return g_bus_watch_name_on_connection(Glib::unwrap(connection), name.c_str(), + static_cast<GBusNameWatcherFlags>(flags), &Bus_Name_Appeared_giomm_callback, + &Bus_Name_Vanished_giomm_callback, slots, &Bus_Watch_Name_giomm_callback_destroy); } -void unwatch_name(guint watcher_id) +void +unwatch_name(guint watcher_id) { g_bus_unwatch_name(watcher_id); } diff --git a/gio/src/drive.ccg b/gio/src/drive.ccg index 0adb0dcc..c75dd14d 100644 --- a/gio/src/drive.ccg +++ b/gio/src/drive.ccg @@ -26,100 +26,96 @@ namespace Gio { -void Drive::eject(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, MountUnmountFlags flags) +void +Drive::eject( + const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, MountUnmountFlags flags) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. auto slot_copy = new SlotAsyncReady(slot); - g_drive_eject_with_operation(gobj(), - static_cast<GMountUnmountFlags>(flags), - nullptr, // mount_operation - Glib::unwrap(cancellable), - &SignalProxy_async_callback, - slot_copy); + g_drive_eject_with_operation(gobj(), static_cast<GMountUnmountFlags>(flags), + nullptr, // mount_operation + Glib::unwrap(cancellable), &SignalProxy_async_callback, slot_copy); } -void Drive::eject(const SlotAsyncReady& slot, MountUnmountFlags flags) +void +Drive::eject(const SlotAsyncReady& slot, MountUnmountFlags flags) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. auto slot_copy = new SlotAsyncReady(slot); - g_drive_eject_with_operation(gobj(), - static_cast<GMountUnmountFlags>(flags), - nullptr, // mount_operation - nullptr, // cancellable - &SignalProxy_async_callback, - slot_copy); + g_drive_eject_with_operation(gobj(), static_cast<GMountUnmountFlags>(flags), + nullptr, // mount_operation + nullptr, // cancellable + &SignalProxy_async_callback, slot_copy); } -void Drive::eject(const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, MountUnmountFlags flags) +void +Drive::eject(const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsyncReady& slot, + const Glib::RefPtr<Cancellable>& cancellable, MountUnmountFlags flags) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. auto slot_copy = new SlotAsyncReady(slot); - g_drive_eject_with_operation(gobj(), - static_cast<GMountUnmountFlags>(flags), - Glib::unwrap(mount_operation), - Glib::unwrap(cancellable), - &SignalProxy_async_callback, - slot_copy); + g_drive_eject_with_operation(gobj(), static_cast<GMountUnmountFlags>(flags), + Glib::unwrap(mount_operation), Glib::unwrap(cancellable), &SignalProxy_async_callback, + slot_copy); } -void Drive::eject(const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsyncReady& slot, MountUnmountFlags flags) +void +Drive::eject(const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsyncReady& slot, + MountUnmountFlags flags) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. auto slot_copy = new SlotAsyncReady(slot); - g_drive_eject_with_operation(gobj(), - static_cast<GMountUnmountFlags>(flags), - Glib::unwrap(mount_operation), - nullptr, // cancellable - &SignalProxy_async_callback, - slot_copy); + g_drive_eject_with_operation(gobj(), static_cast<GMountUnmountFlags>(flags), + Glib::unwrap(mount_operation), + nullptr, // cancellable + &SignalProxy_async_callback, slot_copy); } -void Drive::eject(const Glib::RefPtr<MountOperation>& mount_operation, MountUnmountFlags flags) +void +Drive::eject(const Glib::RefPtr<MountOperation>& mount_operation, MountUnmountFlags flags) { - g_drive_eject_with_operation(gobj(), - static_cast<GMountUnmountFlags>(flags), - Glib::unwrap(mount_operation), - nullptr, // cancellable - nullptr, // callback - nullptr); // user_data + g_drive_eject_with_operation(gobj(), static_cast<GMountUnmountFlags>(flags), + Glib::unwrap(mount_operation), + nullptr, // cancellable + nullptr, // callback + nullptr); // user_data } -void Drive::eject(MountUnmountFlags flags) +void +Drive::eject(MountUnmountFlags flags) { - g_drive_eject_with_operation(gobj(), - static_cast<GMountUnmountFlags>(flags), - nullptr, // mount_operation - nullptr, // cancellable - nullptr, // callback - nullptr); // user_data + g_drive_eject_with_operation(gobj(), static_cast<GMountUnmountFlags>(flags), + nullptr, // mount_operation + nullptr, // cancellable + nullptr, // callback + nullptr); // user_data } -void Drive::poll_for_media(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable) +void +Drive::poll_for_media(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. auto slot_copy = new SlotAsyncReady(slot); - g_drive_poll_for_media(gobj(), - Glib::unwrap(cancellable), - &SignalProxy_async_callback, - slot_copy); + g_drive_poll_for_media(gobj(), Glib::unwrap(cancellable), &SignalProxy_async_callback, slot_copy); } -void Drive::poll_for_media(const SlotAsyncReady& slot) +void +Drive::poll_for_media(const SlotAsyncReady& slot) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter @@ -127,93 +123,68 @@ void Drive::poll_for_media(const SlotAsyncReady& slot) auto slot_copy = new SlotAsyncReady(slot); g_drive_poll_for_media(gobj(), - nullptr, // cancellable - &SignalProxy_async_callback, - slot_copy); + nullptr, // cancellable + &SignalProxy_async_callback, slot_copy); } -void Drive::poll_for_media() +void +Drive::poll_for_media() { g_drive_poll_for_media(gobj(), - nullptr, // cancellable - nullptr, - nullptr); + nullptr, // cancellable + nullptr, nullptr); } void Drive::stop(const Glib::RefPtr<MountOperation>& mount_operation, - const Glib::RefPtr<Cancellable>& cancellable, - const SlotAsyncReady& slot, - MountUnmountFlags flags) + const Glib::RefPtr<Cancellable>& cancellable, const SlotAsyncReady& slot, MountUnmountFlags flags) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. auto slot_copy = new SlotAsyncReady(slot); - g_drive_stop(gobj(), - static_cast<GMountUnmountFlags>(flags), - Glib::unwrap(mount_operation), - Glib::unwrap(cancellable), - &SignalProxy_async_callback, - slot_copy); + g_drive_stop(gobj(), static_cast<GMountUnmountFlags>(flags), Glib::unwrap(mount_operation), + Glib::unwrap(cancellable), &SignalProxy_async_callback, slot_copy); } void -Drive::stop(const Glib::RefPtr<MountOperation>& mount_operation, - const SlotAsyncReady& slot, - MountUnmountFlags flags) +Drive::stop(const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsyncReady& slot, + MountUnmountFlags flags) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. auto slot_copy = new SlotAsyncReady(slot); - g_drive_stop(gobj(), - static_cast<GMountUnmountFlags>(flags), - Glib::unwrap(mount_operation), - nullptr, - &SignalProxy_async_callback, - slot_copy); + g_drive_stop(gobj(), static_cast<GMountUnmountFlags>(flags), Glib::unwrap(mount_operation), + nullptr, &SignalProxy_async_callback, slot_copy); } - void Drive::start(const Glib::RefPtr<MountOperation>& mount_operation, - const Glib::RefPtr<Cancellable>& cancellable, - const SlotAsyncReady& slot, - DriveStartFlags flags) + const Glib::RefPtr<Cancellable>& cancellable, const SlotAsyncReady& slot, DriveStartFlags flags) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. auto slot_copy = new SlotAsyncReady(slot); - g_drive_start(gobj(), - static_cast<GDriveStartFlags>(flags), - Glib::unwrap(mount_operation), - Glib::unwrap(cancellable), - &SignalProxy_async_callback, - slot_copy); + g_drive_start(gobj(), static_cast<GDriveStartFlags>(flags), Glib::unwrap(mount_operation), + Glib::unwrap(cancellable), &SignalProxy_async_callback, slot_copy); } void -Drive::start(const Glib::RefPtr<MountOperation>& mount_operation, - const SlotAsyncReady& slot, - DriveStartFlags flags) +Drive::start(const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsyncReady& slot, + DriveStartFlags flags) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. auto slot_copy = new SlotAsyncReady(slot); - g_drive_start(gobj(), - static_cast<GDriveStartFlags>(flags), - Glib::unwrap(mount_operation), - nullptr, - &SignalProxy_async_callback, - slot_copy); + g_drive_start(gobj(), static_cast<GDriveStartFlags>(flags), Glib::unwrap(mount_operation), + nullptr, &SignalProxy_async_callback, slot_copy); } } // namespace Gio - diff --git a/gio/src/emblem.ccg b/gio/src/emblem.ccg index c146baae..5317f389 100644 --- a/gio/src/emblem.ccg +++ b/gio/src/emblem.ccg @@ -22,4 +22,4 @@ namespace Gio { -} //namespace Gio +} // namespace Gio diff --git a/gio/src/emblemedicon.ccg b/gio/src/emblemedicon.ccg index 695e1d50..faa8e37d 100644 --- a/gio/src/emblemedicon.ccg +++ b/gio/src/emblemedicon.ccg @@ -22,10 +22,8 @@ namespace Gio { -EmblemedIcon::EmblemedIcon(const Glib::RefPtr<Icon>& icon) -: - _CONSTRUCT("icon", Glib::unwrap(icon)) +EmblemedIcon::EmblemedIcon(const Glib::RefPtr<Icon>& icon) : _CONSTRUCT("icon", Glib::unwrap(icon)) { } -} //namespace Gio +} // namespace Gio diff --git a/gio/src/enums.ccg b/gio/src/enums.ccg index ce51b4b6..24ee9e89 100644 --- a/gio/src/enums.ccg +++ b/gio/src/enums.ccg @@ -16,4 +16,3 @@ * License along with this library; if not, write to the Free * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ - diff --git a/gio/src/file.ccg b/gio/src/file.ccg index 0aeb8ba4..b9b8771c 100644 --- a/gio/src/file.ccg +++ b/gio/src/file.ccg @@ -30,9 +30,8 @@ typedef std::pair<Gio::File::SlotFileMeasureProgress*, Gio::SlotAsyncReady*> Mea typedef std::pair<Gio::File::SlotReadMore*, Gio::SlotAsyncReady*> LoadPartialSlots; static void -SignalProxy_file_progress_callback(goffset current_num_bytes, - goffset total_num_bytes, - gpointer data) +SignalProxy_file_progress_callback( + goffset current_num_bytes, goffset total_num_bytes, gpointer data) { auto the_slot = static_cast<Gio::File::SlotFileProgress*>(data); @@ -40,9 +39,8 @@ SignalProxy_file_progress_callback(goffset current_num_bytes, { (*the_slot)(current_num_bytes, total_num_bytes); - } - catch(...) + catch (...) { Glib::exception_handlers_invoke(); } @@ -59,13 +57,13 @@ SignalProxy_file_copy_async_callback(GObject*, GAsyncResult* res, void* data) try { - if(*the_slot) + if (*the_slot) { auto result = Glib::wrap(res, true /* take copy */); (*the_slot)(result); } } - catch(...) + catch (...) { Glib::exception_handlers_invoke(); } @@ -75,7 +73,6 @@ SignalProxy_file_copy_async_callback(GObject*, GAsyncResult* res, void* data) delete slot_pair; } - // Same as SignalProxy_async_callback, except that this one knows that // the slot is packed in a pair. The operation is assumed to be finished // after the callback is triggered, so we delete that pair here. @@ -87,13 +84,13 @@ SignalProxy_file_measure_async_callback(GObject*, GAsyncResult* res, void* data) try { - if(*the_slot) + if (*the_slot) { auto result = Glib::wrap(res, true /* take copy */); (*the_slot)(result); } } - catch(...) + catch (...) { Glib::exception_handlers_invoke(); } @@ -104,7 +101,8 @@ SignalProxy_file_measure_async_callback(GObject*, GAsyncResult* res, void* data) } static gboolean -SignalProxy_load_partial_contents_read_more_callback(const char* file_contents, goffset file_size, gpointer data) +SignalProxy_load_partial_contents_read_more_callback( + const char* file_contents, goffset file_size, gpointer data) { auto slot_pair = static_cast<LoadPartialSlots*>(data); auto the_slot = slot_pair->first; @@ -115,9 +113,8 @@ SignalProxy_load_partial_contents_read_more_callback(const char* file_contents, { result = (*the_slot)(file_contents, file_size); - } - catch(...) + catch (...) { Glib::exception_handlers_invoke(); } @@ -139,7 +136,7 @@ SignalProxy_load_partial_contents_ready_callback(GObject*, GAsyncResult* res, vo auto result = Glib::wrap(res, true /* take copy */); (*the_slot)(result); } - catch(...) + catch (...) { Glib::exception_handlers_invoke(); } @@ -150,21 +147,18 @@ SignalProxy_load_partial_contents_ready_callback(GObject*, GAsyncResult* res, vo } static void -SignalProxy_file_measure_progress_callback(gboolean reporting, - guint64 current_size, - guint64 num_dirs, - guint64 num_files, - gpointer data) +SignalProxy_file_measure_progress_callback( + gboolean reporting, guint64 current_size, guint64 num_dirs, guint64 num_files, gpointer data) { - Gio::File::SlotFileMeasureProgress* the_slot = static_cast<Gio::File::SlotFileMeasureProgress*>(data); + Gio::File::SlotFileMeasureProgress* the_slot = + static_cast<Gio::File::SlotFileMeasureProgress*>(data); try { (*the_slot)(reporting, current_size, num_dirs, num_files); - } - catch(...) + catch (...) { Glib::exception_handlers_invoke(); } @@ -172,7 +166,8 @@ SignalProxy_file_measure_progress_callback(gboolean reporting, } // anonymous namespace -namespace Gio { +namespace Gio +{ Glib::RefPtr<File> File::create_for_path(const std::string& path) @@ -210,42 +205,33 @@ File::read_async(const SlotAsyncReady& slot, int io_priority) // and deleted in the callback. SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); - g_file_read_async(gobj(), - io_priority, - nullptr, - &SignalProxy_async_callback, - slot_copy); + g_file_read_async(gobj(), io_priority, nullptr, &SignalProxy_async_callback, slot_copy); } void -File::read_async(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, int io_priority) +File::read_async( + const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, int io_priority) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); - g_file_read_async(gobj(), - io_priority, - Glib::unwrap(cancellable), - &SignalProxy_async_callback, - slot_copy); + g_file_read_async( + gobj(), io_priority, Glib::unwrap(cancellable), &SignalProxy_async_callback, slot_copy); } void -File::append_to_async(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, FileCreateFlags flags, int io_priority) +File::append_to_async(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, + FileCreateFlags flags, int io_priority) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); - g_file_append_to_async(gobj(), - static_cast<GFileCreateFlags>(flags), - io_priority, - Glib::unwrap(cancellable), - &SignalProxy_async_callback, - slot_copy); + g_file_append_to_async(gobj(), static_cast<GFileCreateFlags>(flags), io_priority, + Glib::unwrap(cancellable), &SignalProxy_async_callback, slot_copy); } void @@ -256,28 +242,22 @@ File::append_to_async(const SlotAsyncReady& slot, FileCreateFlags flags, int io_ // and deleted in the callback. SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); - g_file_append_to_async(gobj(), - static_cast<GFileCreateFlags>(flags), - io_priority, - nullptr, // cancellable - &SignalProxy_async_callback, - slot_copy); + g_file_append_to_async(gobj(), static_cast<GFileCreateFlags>(flags), io_priority, + nullptr, // cancellable + &SignalProxy_async_callback, slot_copy); } void -File::create_file_async(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, FileCreateFlags flags, int io_priority) +File::create_file_async(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, + FileCreateFlags flags, int io_priority) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); - g_file_create_async(gobj(), - static_cast<GFileCreateFlags>(flags), - io_priority, - Glib::unwrap(cancellable), - &SignalProxy_async_callback, - slot_copy); + g_file_create_async(gobj(), static_cast<GFileCreateFlags>(flags), io_priority, + Glib::unwrap(cancellable), &SignalProxy_async_callback, slot_copy); } void @@ -288,81 +268,65 @@ File::create_file_async(const SlotAsyncReady& slot, FileCreateFlags flags, int i // and deleted in the callback. SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); - g_file_create_async(gobj(), - static_cast<GFileCreateFlags>(flags), - io_priority, - nullptr, // cancellable - &SignalProxy_async_callback, - slot_copy); + g_file_create_async(gobj(), static_cast<GFileCreateFlags>(flags), io_priority, + nullptr, // cancellable + &SignalProxy_async_callback, slot_copy); } void -File::create_file_readwrite_async(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, FileCreateFlags flags, int io_priority) +File::create_file_readwrite_async(const SlotAsyncReady& slot, + const Glib::RefPtr<Cancellable>& cancellable, FileCreateFlags flags, int io_priority) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); - g_file_create_async(gobj(), - static_cast<GFileCreateFlags>(flags), - io_priority, - Glib::unwrap(cancellable), - &SignalProxy_async_callback, - slot_copy); + g_file_create_async(gobj(), static_cast<GFileCreateFlags>(flags), io_priority, + Glib::unwrap(cancellable), &SignalProxy_async_callback, slot_copy); } void -File::create_file_readwrite_async(const SlotAsyncReady& slot, FileCreateFlags flags, int io_priority) +File::create_file_readwrite_async( + const SlotAsyncReady& slot, FileCreateFlags flags, int io_priority) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); - g_file_create_readwrite_async(gobj(), - static_cast<GFileCreateFlags>(flags), - io_priority, - nullptr, // cancellable - &SignalProxy_async_callback, - slot_copy); + g_file_create_readwrite_async(gobj(), static_cast<GFileCreateFlags>(flags), io_priority, + nullptr, // cancellable + &SignalProxy_async_callback, slot_copy); } - void -File::replace_async(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, const std::string& etag, bool make_backup, FileCreateFlags flags, int io_priority) +File::replace_async(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, + const std::string& etag, bool make_backup, FileCreateFlags flags, int io_priority) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); - g_file_replace_async(gobj(), - Glib::c_str_or_nullptr(etag), - make_backup, - static_cast<GFileCreateFlags>(flags), - io_priority, - Glib::unwrap(cancellable), - &SignalProxy_async_callback, - slot_copy); + g_file_replace_async(gobj(), Glib::c_str_or_nullptr(etag), make_backup, + static_cast<GFileCreateFlags>(flags), io_priority, Glib::unwrap(cancellable), + &SignalProxy_async_callback, slot_copy); } void -File::replace_async(const SlotAsyncReady& slot, const std::string& etag, bool make_backup, FileCreateFlags flags, int io_priority) +File::replace_async(const SlotAsyncReady& slot, const std::string& etag, bool make_backup, + FileCreateFlags flags, int io_priority) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); - g_file_replace_async(gobj(), - Glib::c_str_or_nullptr(etag), - make_backup, - static_cast<GFileCreateFlags>(flags), - io_priority, - nullptr, // cancellable - &SignalProxy_async_callback, - slot_copy); + g_file_replace_async(gobj(), Glib::c_str_or_nullptr(etag), make_backup, + static_cast<GFileCreateFlags>(flags), io_priority, + nullptr, // cancellable + &SignalProxy_async_callback, slot_copy); } void @@ -373,264 +337,251 @@ File::open_readwrite_async(const SlotAsyncReady& slot, int io_priority) // and deleted in the callback. SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); - g_file_open_readwrite_async(gobj(), - io_priority, - nullptr, - &SignalProxy_async_callback, - slot_copy); + g_file_open_readwrite_async(gobj(), io_priority, nullptr, &SignalProxy_async_callback, slot_copy); } void -File::open_readwrite_async(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, int io_priority) +File::open_readwrite_async( + const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, int io_priority) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); - g_file_open_readwrite_async(gobj(), - io_priority, - Glib::unwrap(cancellable), - &SignalProxy_async_callback, - slot_copy); + g_file_open_readwrite_async( + gobj(), io_priority, Glib::unwrap(cancellable), &SignalProxy_async_callback, slot_copy); } void -File::replace_readwrite_async(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, const std::string& etag, bool make_backup, FileCreateFlags flags, int io_priority) +File::replace_readwrite_async(const SlotAsyncReady& slot, + const Glib::RefPtr<Cancellable>& cancellable, const std::string& etag, bool make_backup, + FileCreateFlags flags, int io_priority) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); - g_file_replace_readwrite_async(gobj(), - Glib::c_str_or_nullptr(etag), - make_backup, - static_cast<GFileCreateFlags>(flags), - io_priority, - Glib::unwrap(cancellable), - &SignalProxy_async_callback, - slot_copy); + g_file_replace_readwrite_async(gobj(), Glib::c_str_or_nullptr(etag), make_backup, + static_cast<GFileCreateFlags>(flags), io_priority, Glib::unwrap(cancellable), + &SignalProxy_async_callback, slot_copy); } void -File::replace_readwrite_async(const SlotAsyncReady& slot, const std::string& etag, bool make_backup, FileCreateFlags flags, int io_priority) +File::replace_readwrite_async(const SlotAsyncReady& slot, const std::string& etag, bool make_backup, + FileCreateFlags flags, int io_priority) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); - g_file_replace_readwrite_async(gobj(), - Glib::c_str_or_nullptr(etag), - make_backup, - static_cast<GFileCreateFlags>(flags), - io_priority, - nullptr, // cancellable - &SignalProxy_async_callback, - slot_copy); + g_file_replace_readwrite_async(gobj(), Glib::c_str_or_nullptr(etag), make_backup, + static_cast<GFileCreateFlags>(flags), io_priority, + nullptr, // cancellable + &SignalProxy_async_callback, slot_copy); } -FileType File::query_file_type(FileQueryInfoFlags flags) const +FileType +File::query_file_type(FileQueryInfoFlags flags) const { - return (FileType)g_file_query_file_type(const_cast<GFile*>(gobj()), (GFileQueryInfoFlags)flags, nullptr); + return (FileType)g_file_query_file_type( + const_cast<GFile*>(gobj()), (GFileQueryInfoFlags)flags, nullptr); } -Glib::RefPtr<FileInfo> File::query_info(const Glib::RefPtr<Cancellable>& cancellable, const std::string& attributes, FileQueryInfoFlags flags) const +Glib::RefPtr<FileInfo> +File::query_info(const Glib::RefPtr<Cancellable>& cancellable, const std::string& attributes, + FileQueryInfoFlags flags) const { GError* gerror = nullptr; - auto retvalue = Glib::wrap(g_file_query_info(const_cast<GFile*>(gobj()), attributes.c_str(), ((GFileQueryInfoFlags)(flags)), const_cast<GCancellable*>(Glib::unwrap(cancellable)), &(gerror))); - if(gerror) + auto retvalue = Glib::wrap(g_file_query_info(const_cast<GFile*>(gobj()), attributes.c_str(), + ((GFileQueryInfoFlags)(flags)), const_cast<GCancellable*>(Glib::unwrap(cancellable)), + &(gerror))); + if (gerror) ::Glib::Error::throw_exception(gerror); return retvalue; } -Glib::RefPtr<FileInfo> File::query_info(const std::string& attributes, FileQueryInfoFlags flags) const +Glib::RefPtr<FileInfo> +File::query_info(const std::string& attributes, FileQueryInfoFlags flags) const { GError* gerror = nullptr; - auto retvalue = Glib::wrap(g_file_query_info(const_cast<GFile*>(gobj()), attributes.c_str(), ((GFileQueryInfoFlags)(flags)), nullptr, &(gerror))); - if(gerror) + auto retvalue = Glib::wrap(g_file_query_info(const_cast<GFile*>(gobj()), attributes.c_str(), + ((GFileQueryInfoFlags)(flags)), nullptr, &(gerror))); + if (gerror) ::Glib::Error::throw_exception(gerror); return retvalue; } void -File::query_info_async(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, const std::string& attributes, FileQueryInfoFlags flags, int io_priority) const +File::query_info_async(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, + const std::string& attributes, FileQueryInfoFlags flags, int io_priority) const { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); - g_file_query_info_async(const_cast<GFile*>(gobj()), - attributes.c_str(), - static_cast<GFileQueryInfoFlags>(flags), - io_priority, - Glib::unwrap(cancellable), - &SignalProxy_async_callback, - slot_copy); + g_file_query_info_async(const_cast<GFile*>(gobj()), attributes.c_str(), + static_cast<GFileQueryInfoFlags>(flags), io_priority, Glib::unwrap(cancellable), + &SignalProxy_async_callback, slot_copy); } void -File::query_info_async(const SlotAsyncReady& slot, const std::string& attributes, FileQueryInfoFlags flags, int io_priority) const +File::query_info_async(const SlotAsyncReady& slot, const std::string& attributes, + FileQueryInfoFlags flags, int io_priority) const { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); - g_file_query_info_async(const_cast<GFile*>(gobj()), - attributes.c_str(), - static_cast<GFileQueryInfoFlags>(flags), - io_priority, - nullptr, // cancellable - &SignalProxy_async_callback, - slot_copy); + g_file_query_info_async(const_cast<GFile*>(gobj()), attributes.c_str(), + static_cast<GFileQueryInfoFlags>(flags), io_priority, + nullptr, // cancellable + &SignalProxy_async_callback, slot_copy); } - -Glib::RefPtr<FileInfo> File::query_filesystem_info(const Glib::RefPtr<Cancellable>& cancellable, const std::string& attributes) +Glib::RefPtr<FileInfo> +File::query_filesystem_info( + const Glib::RefPtr<Cancellable>& cancellable, const std::string& attributes) { GError* gerror = nullptr; - auto retvalue = Glib::wrap(g_file_query_filesystem_info(gobj(), attributes.c_str(), const_cast<GCancellable*>(Glib::unwrap(cancellable)), &(gerror))); - if(gerror) + auto retvalue = Glib::wrap(g_file_query_filesystem_info( + gobj(), attributes.c_str(), const_cast<GCancellable*>(Glib::unwrap(cancellable)), &(gerror))); + if (gerror) ::Glib::Error::throw_exception(gerror); return retvalue; } -Glib::RefPtr<FileInfo> File::query_filesystem_info(const std::string& attributes) +Glib::RefPtr<FileInfo> +File::query_filesystem_info(const std::string& attributes) { GError* gerror = nullptr; - auto retvalue = Glib::wrap(g_file_query_filesystem_info(gobj(), attributes.c_str(), nullptr, &(gerror))); - if(gerror) + auto retvalue = + Glib::wrap(g_file_query_filesystem_info(gobj(), attributes.c_str(), nullptr, &(gerror))); + if (gerror) ::Glib::Error::throw_exception(gerror); return retvalue; } void -File::query_filesystem_info_async(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, const std::string& attributes, int io_priority) const +File::query_filesystem_info_async(const SlotAsyncReady& slot, + const Glib::RefPtr<Cancellable>& cancellable, const std::string& attributes, + int io_priority) const { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); - g_file_query_filesystem_info_async(const_cast<GFile*>(gobj()), - attributes.c_str(), - io_priority, - Glib::unwrap(cancellable), - &SignalProxy_async_callback, - slot_copy); + g_file_query_filesystem_info_async(const_cast<GFile*>(gobj()), attributes.c_str(), io_priority, + Glib::unwrap(cancellable), &SignalProxy_async_callback, slot_copy); } void -File::query_filesystem_info_async(const SlotAsyncReady& slot, const std::string& attributes, int io_priority) const +File::query_filesystem_info_async( + const SlotAsyncReady& slot, const std::string& attributes, int io_priority) const { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); - g_file_query_filesystem_info_async(const_cast<GFile*>(gobj()), - attributes.c_str(), - io_priority, - nullptr, // cancellable - &SignalProxy_async_callback, - slot_copy); + g_file_query_filesystem_info_async(const_cast<GFile*>(gobj()), attributes.c_str(), io_priority, + nullptr, // cancellable + &SignalProxy_async_callback, slot_copy); } -Glib::RefPtr<FileEnumerator> File::enumerate_children(const Glib::RefPtr<Cancellable>& cancellable, const std::string& attributes, FileQueryInfoFlags flags) +Glib::RefPtr<FileEnumerator> +File::enumerate_children(const Glib::RefPtr<Cancellable>& cancellable, + const std::string& attributes, FileQueryInfoFlags flags) { GError* gerror = nullptr; - auto retvalue = Glib::wrap(g_file_enumerate_children(gobj(), attributes.c_str(), ((GFileQueryInfoFlags)(flags)), const_cast<GCancellable*>(Glib::unwrap(cancellable)), &(gerror))); - if(gerror) + auto retvalue = + Glib::wrap(g_file_enumerate_children(gobj(), attributes.c_str(), ((GFileQueryInfoFlags)(flags)), + const_cast<GCancellable*>(Glib::unwrap(cancellable)), &(gerror))); + if (gerror) ::Glib::Error::throw_exception(gerror); return retvalue; } -Glib::RefPtr<FileEnumerator> File::enumerate_children(const std::string& attributes, FileQueryInfoFlags flags) +Glib::RefPtr<FileEnumerator> +File::enumerate_children(const std::string& attributes, FileQueryInfoFlags flags) { GError* gerror = nullptr; - auto retvalue = Glib::wrap(g_file_enumerate_children(gobj(), attributes.c_str(), ((GFileQueryInfoFlags)(flags)), nullptr, &(gerror))); - if(gerror) + auto retvalue = Glib::wrap(g_file_enumerate_children( + gobj(), attributes.c_str(), ((GFileQueryInfoFlags)(flags)), nullptr, &(gerror))); + if (gerror) ::Glib::Error::throw_exception(gerror); return retvalue; } void -File::enumerate_children_async(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, const std::string& attributes, FileQueryInfoFlags flags, int io_priority) +File::enumerate_children_async(const SlotAsyncReady& slot, + const Glib::RefPtr<Cancellable>& cancellable, const std::string& attributes, + FileQueryInfoFlags flags, int io_priority) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); - g_file_enumerate_children_async(gobj(), - attributes.c_str(), - static_cast<GFileQueryInfoFlags>(flags), - io_priority, - Glib::unwrap(cancellable), - &SignalProxy_async_callback, - slot_copy); + g_file_enumerate_children_async(gobj(), attributes.c_str(), + static_cast<GFileQueryInfoFlags>(flags), io_priority, Glib::unwrap(cancellable), + &SignalProxy_async_callback, slot_copy); } void -File::enumerate_children_async(const SlotAsyncReady& slot, const std::string& attributes, FileQueryInfoFlags flags, int io_priority) +File::enumerate_children_async(const SlotAsyncReady& slot, const std::string& attributes, + FileQueryInfoFlags flags, int io_priority) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); - g_file_enumerate_children_async(gobj(), - attributes.c_str(), - static_cast<GFileQueryInfoFlags>(flags), - io_priority, - nullptr, - &SignalProxy_async_callback, - slot_copy); + g_file_enumerate_children_async(gobj(), attributes.c_str(), + static_cast<GFileQueryInfoFlags>(flags), io_priority, nullptr, &SignalProxy_async_callback, + slot_copy); } void -File::set_display_name_async(const Glib::ustring& display_name, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, int io_priority) +File::set_display_name_async(const Glib::ustring& display_name, const SlotAsyncReady& slot, + const Glib::RefPtr<Cancellable>& cancellable, int io_priority) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); - g_file_set_display_name_async(gobj(), - display_name.c_str(), - io_priority, - Glib::unwrap(cancellable), - &SignalProxy_async_callback, - slot_copy); + g_file_set_display_name_async(gobj(), display_name.c_str(), io_priority, + Glib::unwrap(cancellable), &SignalProxy_async_callback, slot_copy); } void -File::set_display_name_async(const Glib::ustring& display_name, const SlotAsyncReady& slot, int io_priority) +File::set_display_name_async( + const Glib::ustring& display_name, const SlotAsyncReady& slot, int io_priority) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); - g_file_set_display_name_async(gobj(), - display_name.c_str(), - io_priority, - nullptr, - &SignalProxy_async_callback, - slot_copy); + g_file_set_display_name_async( + gobj(), display_name.c_str(), io_priority, nullptr, &SignalProxy_async_callback, slot_copy); } bool -File::copy(const Glib::RefPtr<File>& destination, const SlotFileProgress& slot, const Glib::RefPtr<Cancellable>& cancellable, FileCopyFlags flags) +File::copy(const Glib::RefPtr<File>& destination, const SlotFileProgress& slot, + const Glib::RefPtr<Cancellable>& cancellable, FileCopyFlags flags) { GError* gerror = nullptr; bool res; @@ -640,13 +591,8 @@ File::copy(const Glib::RefPtr<File>& destination, const SlotFileProgress& slot, // and deleted in the callback. SlotFileProgress* slot_copy = new SlotFileProgress(slot); - res = g_file_copy(gobj(), - Glib::unwrap(destination), - static_cast<GFileCopyFlags>(flags), - Glib::unwrap(cancellable), - &SignalProxy_file_progress_callback, - slot_copy, - &gerror); + res = g_file_copy(gobj(), Glib::unwrap(destination), static_cast<GFileCopyFlags>(flags), + Glib::unwrap(cancellable), &SignalProxy_file_progress_callback, slot_copy, &gerror); delete slot_copy; @@ -667,13 +613,8 @@ File::copy(const Glib::RefPtr<File>& destination, const SlotFileProgress& slot, // and deleted in the callback. SlotFileProgress* slot_copy = new SlotFileProgress(slot); - res = g_file_copy(gobj(), - Glib::unwrap(destination), - static_cast<GFileCopyFlags>(flags), - nullptr, - &SignalProxy_file_progress_callback, - slot_copy, - &gerror); + res = g_file_copy(gobj(), Glib::unwrap(destination), static_cast<GFileCopyFlags>(flags), nullptr, + &SignalProxy_file_progress_callback, slot_copy, &gerror); delete slot_copy; @@ -687,13 +628,8 @@ bool File::copy(const Glib::RefPtr<File>& destination, FileCopyFlags flags) { GError* gerror = nullptr; - bool res = g_file_copy(gobj(), - Glib::unwrap(destination), - static_cast<GFileCopyFlags>(flags), - nullptr, - nullptr, - nullptr, - &gerror); + bool res = g_file_copy(gobj(), Glib::unwrap(destination), static_cast<GFileCopyFlags>(flags), + nullptr, nullptr, nullptr, &gerror); if (gerror) ::Glib::Error::throw_exception(gerror); @@ -702,12 +638,9 @@ File::copy(const Glib::RefPtr<File>& destination, FileCopyFlags flags) } void -File::copy_async(const Glib::RefPtr<File>& destination, - const SlotFileProgress& slot_progress, - const SlotAsyncReady& slot_ready, - const Glib::RefPtr<Cancellable>& cancellable, - FileCopyFlags flags, - int io_priority) +File::copy_async(const Glib::RefPtr<File>& destination, const SlotFileProgress& slot_progress, + const SlotAsyncReady& slot_ready, const Glib::RefPtr<Cancellable>& cancellable, + FileCopyFlags flags, int io_priority) { // Create a new pair which will hold copies of passed slots. // This will be deleted in the SignalProxy_file_copy_async_callback() callback @@ -718,46 +651,28 @@ File::copy_async(const Glib::RefPtr<File>& destination, slots->first = slot_progress_copy; slots->second = slot_ready_copy; - g_file_copy_async(gobj(), - Glib::unwrap(destination), - static_cast<GFileCopyFlags>(flags), - io_priority, - Glib::unwrap(cancellable), - &SignalProxy_file_progress_callback, - slot_progress_copy, - &SignalProxy_file_copy_async_callback, - slots); + g_file_copy_async(gobj(), Glib::unwrap(destination), static_cast<GFileCopyFlags>(flags), + io_priority, Glib::unwrap(cancellable), &SignalProxy_file_progress_callback, slot_progress_copy, + &SignalProxy_file_copy_async_callback, slots); } void -File::copy_async(const Glib::RefPtr<File>& destination, - const SlotAsyncReady& slot_ready, - const Glib::RefPtr<Cancellable>& cancellable, - FileCopyFlags flags, - int io_priority) +File::copy_async(const Glib::RefPtr<File>& destination, const SlotAsyncReady& slot_ready, + const Glib::RefPtr<Cancellable>& cancellable, FileCopyFlags flags, int io_priority) { // Create copies of slots. // Pointers to them will be passed through the callbacks' data parameter // and deleted in the corresponding callback. SlotAsyncReady* slot_ready_copy = new SlotAsyncReady(slot_ready); - g_file_copy_async(gobj(), - Glib::unwrap(destination), - static_cast<GFileCopyFlags>(flags), - io_priority, - Glib::unwrap(cancellable), - nullptr, - nullptr, - &SignalProxy_async_callback, - slot_ready_copy); + g_file_copy_async(gobj(), Glib::unwrap(destination), static_cast<GFileCopyFlags>(flags), + io_priority, Glib::unwrap(cancellable), nullptr, nullptr, &SignalProxy_async_callback, + slot_ready_copy); } void -File::copy_async(const Glib::RefPtr<File>& destination, - const SlotFileProgress& slot_progress, - const SlotAsyncReady& slot_ready, - FileCopyFlags flags, - int io_priority) +File::copy_async(const Glib::RefPtr<File>& destination, const SlotFileProgress& slot_progress, + const SlotAsyncReady& slot_ready, FileCopyFlags flags, int io_priority) { // Create a new pair which will hold copies of passed slots. // This will be deleted in the SignalProxy_file_copy_async_callback() callback @@ -768,41 +683,27 @@ File::copy_async(const Glib::RefPtr<File>& destination, slots->first = slot_progress_copy; slots->second = slot_ready_copy; - g_file_copy_async(gobj(), - Glib::unwrap(destination), - static_cast<GFileCopyFlags>(flags), - io_priority, - nullptr, - &SignalProxy_file_progress_callback, - slot_progress_copy, - &SignalProxy_file_copy_async_callback, - slots); + g_file_copy_async(gobj(), Glib::unwrap(destination), static_cast<GFileCopyFlags>(flags), + io_priority, nullptr, &SignalProxy_file_progress_callback, slot_progress_copy, + &SignalProxy_file_copy_async_callback, slots); } void -File::copy_async(const Glib::RefPtr<File>& destination, - const SlotAsyncReady& slot_ready, - FileCopyFlags flags, - int io_priority) +File::copy_async(const Glib::RefPtr<File>& destination, const SlotAsyncReady& slot_ready, + FileCopyFlags flags, int io_priority) { // Create copies of slots. // Pointers to them will be passed through the callbacks' data parameter // and deleted in the corresponding callback. SlotAsyncReady* slot_ready_copy = new SlotAsyncReady(slot_ready); - g_file_copy_async(gobj(), - Glib::unwrap(destination), - static_cast<GFileCopyFlags>(flags), - io_priority, - nullptr, - nullptr, - nullptr, - &SignalProxy_async_callback, - slot_ready_copy); + g_file_copy_async(gobj(), Glib::unwrap(destination), static_cast<GFileCopyFlags>(flags), + io_priority, nullptr, nullptr, nullptr, &SignalProxy_async_callback, slot_ready_copy); } bool -File::move(const Glib::RefPtr<File>& destination, const SlotFileProgress& slot, const Glib::RefPtr<Cancellable>& cancellable, FileCopyFlags flags) +File::move(const Glib::RefPtr<File>& destination, const SlotFileProgress& slot, + const Glib::RefPtr<Cancellable>& cancellable, FileCopyFlags flags) { GError* gerror = nullptr; bool res; @@ -812,13 +713,8 @@ File::move(const Glib::RefPtr<File>& destination, const SlotFileProgress& slot, // and deleted in the callback. SlotFileProgress* slot_copy = new SlotFileProgress(slot); - res = g_file_move(gobj(), - Glib::unwrap(destination), - static_cast<GFileCopyFlags>(flags), - Glib::unwrap(cancellable), - &SignalProxy_file_progress_callback, - slot_copy, - &gerror); + res = g_file_move(gobj(), Glib::unwrap(destination), static_cast<GFileCopyFlags>(flags), + Glib::unwrap(cancellable), &SignalProxy_file_progress_callback, slot_copy, &gerror); delete slot_copy; @@ -839,13 +735,8 @@ File::move(const Glib::RefPtr<File>& destination, const SlotFileProgress& slot, // and deleted in the callback. SlotFileProgress* slot_copy = new SlotFileProgress(slot); - res = g_file_move(gobj(), - Glib::unwrap(destination), - static_cast<GFileCopyFlags>(flags), - nullptr, - &SignalProxy_file_progress_callback, - slot_copy, - &gerror); + res = g_file_move(gobj(), Glib::unwrap(destination), static_cast<GFileCopyFlags>(flags), nullptr, + &SignalProxy_file_progress_callback, slot_copy, &gerror); delete slot_copy; @@ -861,13 +752,8 @@ File::move(const Glib::RefPtr<File>& destination, FileCopyFlags flags) GError* gerror = nullptr; bool res; - res = g_file_move(gobj(), - Glib::unwrap(destination), - static_cast<GFileCopyFlags>(flags), - nullptr, - nullptr, - nullptr, - &gerror); + res = g_file_move(gobj(), Glib::unwrap(destination), static_cast<GFileCopyFlags>(flags), nullptr, + nullptr, nullptr, &gerror); if (gerror) ::Glib::Error::throw_exception(gerror); @@ -876,51 +762,40 @@ File::move(const Glib::RefPtr<File>& destination, FileCopyFlags flags) } void -File::set_attributes_async(const Glib::RefPtr<FileInfo>& info, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, FileQueryInfoFlags flags, int io_priority) +File::set_attributes_async(const Glib::RefPtr<FileInfo>& info, const SlotAsyncReady& slot, + const Glib::RefPtr<Cancellable>& cancellable, FileQueryInfoFlags flags, int io_priority) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); - g_file_set_attributes_async(gobj(), - Glib::unwrap(info), - static_cast<GFileQueryInfoFlags>(flags), - io_priority, - Glib::unwrap(cancellable), - &SignalProxy_async_callback, - slot_copy); + g_file_set_attributes_async(gobj(), Glib::unwrap(info), static_cast<GFileQueryInfoFlags>(flags), + io_priority, Glib::unwrap(cancellable), &SignalProxy_async_callback, slot_copy); } void -File::set_attributes_async(const Glib::RefPtr<FileInfo>& info, const SlotAsyncReady& slot, FileQueryInfoFlags flags, int io_priority) +File::set_attributes_async(const Glib::RefPtr<FileInfo>& info, const SlotAsyncReady& slot, + FileQueryInfoFlags flags, int io_priority) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); - g_file_set_attributes_async(gobj(), - Glib::unwrap(info), - static_cast<GFileQueryInfoFlags>(flags), - io_priority, - nullptr, - &SignalProxy_async_callback, - slot_copy); + g_file_set_attributes_async(gobj(), Glib::unwrap(info), static_cast<GFileQueryInfoFlags>(flags), + io_priority, nullptr, &SignalProxy_async_callback, slot_copy); } bool -File::set_attributes_finish(const Glib::RefPtr<AsyncResult>& result, - const Glib::RefPtr<FileInfo>& info) +File::set_attributes_finish( + const Glib::RefPtr<AsyncResult>& result, const Glib::RefPtr<FileInfo>& info) { GError* gerror = nullptr; GFileInfo* cinfo = Glib::unwrap(info); bool res; - res = g_file_set_attributes_finish(gobj(), - Glib::unwrap(result), - &cinfo, - &gerror); + res = g_file_set_attributes_finish(gobj(), Glib::unwrap(result), &cinfo, &gerror); if (gerror) ::Glib::Error::throw_exception(gerror); @@ -928,75 +803,63 @@ File::set_attributes_finish(const Glib::RefPtr<AsyncResult>& result, return res; } - -void File::mount_mountable(const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, MountMountFlags flags) +void +File::mount_mountable(const Glib::RefPtr<MountOperation>& mount_operation, + const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, MountMountFlags flags) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); - g_file_mount_mountable(gobj(), - static_cast<GMountMountFlags>(flags), - Glib::unwrap(mount_operation), - Glib::unwrap(cancellable), - &SignalProxy_async_callback, - slot_copy); + g_file_mount_mountable(gobj(), static_cast<GMountMountFlags>(flags), + Glib::unwrap(mount_operation), Glib::unwrap(cancellable), &SignalProxy_async_callback, + slot_copy); } -void File::mount_mountable(const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsyncReady& slot, MountMountFlags flags) +void +File::mount_mountable(const Glib::RefPtr<MountOperation>& mount_operation, + const SlotAsyncReady& slot, MountMountFlags flags) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); - g_file_mount_mountable(gobj(), - static_cast<GMountMountFlags>(flags), - Glib::unwrap(mount_operation), - nullptr, - &SignalProxy_async_callback, - slot_copy); + g_file_mount_mountable(gobj(), static_cast<GMountMountFlags>(flags), + Glib::unwrap(mount_operation), nullptr, &SignalProxy_async_callback, slot_copy); } -void File::mount_mountable(const SlotAsyncReady& slot, MountMountFlags flags) +void +File::mount_mountable(const SlotAsyncReady& slot, MountMountFlags flags) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); - g_file_mount_mountable(gobj(), - static_cast<GMountMountFlags>(flags), - nullptr, - nullptr, - &SignalProxy_async_callback, - slot_copy); + g_file_mount_mountable(gobj(), static_cast<GMountMountFlags>(flags), nullptr, nullptr, + &SignalProxy_async_callback, slot_copy); } -void File::mount_mountable(MountMountFlags flags) +void +File::mount_mountable(MountMountFlags flags) { - g_file_mount_mountable(gobj(), - static_cast<GMountMountFlags>(flags), - nullptr, - nullptr, - nullptr, - nullptr); + g_file_mount_mountable( + gobj(), static_cast<GMountMountFlags>(flags), nullptr, nullptr, nullptr, nullptr); } -void File::unmount_mountable(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, MountUnmountFlags flags) +void +File::unmount_mountable( + const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, MountUnmountFlags flags) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); - g_file_unmount_mountable_with_operation(gobj(), - static_cast<GMountUnmountFlags>(flags), - nullptr, - Glib::unwrap(cancellable), - &SignalProxy_async_callback, - slot_copy); + g_file_unmount_mountable_with_operation(gobj(), static_cast<GMountUnmountFlags>(flags), nullptr, + Glib::unwrap(cancellable), &SignalProxy_async_callback, slot_copy); } void @@ -1007,181 +870,143 @@ File::unmount_mountable(const SlotAsyncReady& slot, MountUnmountFlags flags) // and deleted in the callback. SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); - g_file_unmount_mountable_with_operation(gobj(), - static_cast<GMountUnmountFlags>(flags), - nullptr, - nullptr, - &SignalProxy_async_callback, - slot_copy); + g_file_unmount_mountable_with_operation(gobj(), static_cast<GMountUnmountFlags>(flags), nullptr, + nullptr, &SignalProxy_async_callback, slot_copy); } void File::unmount_mountable(MountUnmountFlags flags) { - g_file_unmount_mountable_with_operation(gobj(), - static_cast<GMountUnmountFlags>(flags), - nullptr, - nullptr, - nullptr, - nullptr); + g_file_unmount_mountable_with_operation( + gobj(), static_cast<GMountUnmountFlags>(flags), nullptr, nullptr, nullptr, nullptr); } -void File::unmount_mountable(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, const Glib::RefPtr<MountOperation>& mount_operation, MountUnmountFlags flags) +void +File::unmount_mountable(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, + const Glib::RefPtr<MountOperation>& mount_operation, MountUnmountFlags flags) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); - g_file_unmount_mountable_with_operation(gobj(), - static_cast<GMountUnmountFlags>(flags), - Glib::unwrap(mount_operation), - Glib::unwrap(cancellable), - &SignalProxy_async_callback, - slot_copy); + g_file_unmount_mountable_with_operation(gobj(), static_cast<GMountUnmountFlags>(flags), + Glib::unwrap(mount_operation), Glib::unwrap(cancellable), &SignalProxy_async_callback, + slot_copy); } void -File::unmount_mountable(const SlotAsyncReady& slot, const Glib::RefPtr<MountOperation>& mount_operation, MountUnmountFlags flags) +File::unmount_mountable(const SlotAsyncReady& slot, + const Glib::RefPtr<MountOperation>& mount_operation, MountUnmountFlags flags) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); - g_file_unmount_mountable_with_operation(gobj(), - static_cast<GMountUnmountFlags>(flags), - Glib::unwrap(mount_operation), - nullptr, - &SignalProxy_async_callback, - slot_copy); + g_file_unmount_mountable_with_operation(gobj(), static_cast<GMountUnmountFlags>(flags), + Glib::unwrap(mount_operation), nullptr, &SignalProxy_async_callback, slot_copy); } void -File::unmount_mountable(const Glib::RefPtr<MountOperation>& mount_operation, MountUnmountFlags flags) +File::unmount_mountable( + const Glib::RefPtr<MountOperation>& mount_operation, MountUnmountFlags flags) { - g_file_unmount_mountable_with_operation(gobj(), - static_cast<GMountUnmountFlags>(flags), - Glib::unwrap(mount_operation), - nullptr, - nullptr, - nullptr); + g_file_unmount_mountable_with_operation(gobj(), static_cast<GMountUnmountFlags>(flags), + Glib::unwrap(mount_operation), nullptr, nullptr, nullptr); } - - -void File::mount_enclosing_volume(const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, MountMountFlags flags) +void +File::mount_enclosing_volume(const Glib::RefPtr<MountOperation>& mount_operation, + const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, MountMountFlags flags) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); - g_file_mount_enclosing_volume(gobj(), - static_cast<GMountMountFlags>(flags), - Glib::unwrap(mount_operation), - Glib::unwrap(cancellable), - &SignalProxy_async_callback, - slot_copy); + g_file_mount_enclosing_volume(gobj(), static_cast<GMountMountFlags>(flags), + Glib::unwrap(mount_operation), Glib::unwrap(cancellable), &SignalProxy_async_callback, + slot_copy); } -void File::mount_enclosing_volume(const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsyncReady& slot, MountMountFlags flags) +void +File::mount_enclosing_volume(const Glib::RefPtr<MountOperation>& mount_operation, + const SlotAsyncReady& slot, MountMountFlags flags) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); - g_file_mount_enclosing_volume(gobj(), - static_cast<GMountMountFlags>(flags), - Glib::unwrap(mount_operation), - nullptr, - &SignalProxy_async_callback, - slot_copy); + g_file_mount_enclosing_volume(gobj(), static_cast<GMountMountFlags>(flags), + Glib::unwrap(mount_operation), nullptr, &SignalProxy_async_callback, slot_copy); } -void File::mount_enclosing_volume(const SlotAsyncReady& slot, MountMountFlags flags) +void +File::mount_enclosing_volume(const SlotAsyncReady& slot, MountMountFlags flags) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); - g_file_mount_enclosing_volume(gobj(), - static_cast<GMountMountFlags>(flags), - nullptr, - nullptr, - &SignalProxy_async_callback, - slot_copy); + g_file_mount_enclosing_volume(gobj(), static_cast<GMountMountFlags>(flags), nullptr, nullptr, + &SignalProxy_async_callback, slot_copy); } -void File::mount_enclosing_volume(MountMountFlags flags) +void +File::mount_enclosing_volume(MountMountFlags flags) { - g_file_mount_enclosing_volume(gobj(), - static_cast<GMountMountFlags>(flags), - nullptr, - nullptr, - nullptr, - nullptr); + g_file_mount_enclosing_volume( + gobj(), static_cast<GMountMountFlags>(flags), nullptr, nullptr, nullptr, nullptr); } void -File::eject_mountable(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, const Glib::RefPtr<MountOperation>& mount_operation, MountUnmountFlags flags) +File::eject_mountable(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, + const Glib::RefPtr<MountOperation>& mount_operation, MountUnmountFlags flags) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); - g_file_eject_mountable_with_operation(gobj(), - static_cast<GMountUnmountFlags>(flags), - Glib::unwrap(mount_operation), - Glib::unwrap(cancellable), - &SignalProxy_async_callback, - slot_copy); + g_file_eject_mountable_with_operation(gobj(), static_cast<GMountUnmountFlags>(flags), + Glib::unwrap(mount_operation), Glib::unwrap(cancellable), &SignalProxy_async_callback, + slot_copy); } void -File::eject_mountable(const SlotAsyncReady& slot, const Glib::RefPtr<MountOperation>& mount_operation, MountUnmountFlags flags) +File::eject_mountable(const SlotAsyncReady& slot, + const Glib::RefPtr<MountOperation>& mount_operation, MountUnmountFlags flags) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); - g_file_eject_mountable_with_operation(gobj(), - static_cast<GMountUnmountFlags>(flags), - Glib::unwrap(mount_operation), - nullptr, - &SignalProxy_async_callback, - slot_copy); + g_file_eject_mountable_with_operation(gobj(), static_cast<GMountUnmountFlags>(flags), + Glib::unwrap(mount_operation), nullptr, &SignalProxy_async_callback, slot_copy); } void File::eject_mountable(const Glib::RefPtr<MountOperation>& mount_operation, MountUnmountFlags flags) { - g_file_eject_mountable_with_operation(gobj(), - static_cast<GMountUnmountFlags>(flags), - Glib::unwrap(mount_operation), - nullptr, - nullptr, - nullptr); + g_file_eject_mountable_with_operation(gobj(), static_cast<GMountUnmountFlags>(flags), + Glib::unwrap(mount_operation), nullptr, nullptr, nullptr); } void -File::eject_mountable(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, MountUnmountFlags flags) +File::eject_mountable( + const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, MountUnmountFlags flags) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); - g_file_eject_mountable_with_operation(gobj(), - static_cast<GMountUnmountFlags>(flags), - nullptr, - Glib::unwrap(cancellable), - &SignalProxy_async_callback, - slot_copy); + g_file_eject_mountable_with_operation(gobj(), static_cast<GMountUnmountFlags>(flags), nullptr, + Glib::unwrap(cancellable), &SignalProxy_async_callback, slot_copy); } void @@ -1192,23 +1017,15 @@ File::eject_mountable(const SlotAsyncReady& slot, MountUnmountFlags flags) // and deleted in the callback. SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); - g_file_eject_mountable_with_operation(gobj(), - static_cast<GMountUnmountFlags>(flags), - nullptr, - nullptr, - &SignalProxy_async_callback, - slot_copy); + g_file_eject_mountable_with_operation(gobj(), static_cast<GMountUnmountFlags>(flags), nullptr, + nullptr, &SignalProxy_async_callback, slot_copy); } void File::eject_mountable(MountUnmountFlags flags) { - g_file_eject_mountable_with_operation(gobj(), - static_cast<GMountUnmountFlags>(flags), - nullptr, - nullptr, - nullptr, - nullptr); + g_file_eject_mountable_with_operation( + gobj(), static_cast<GMountUnmountFlags>(flags), nullptr, nullptr, nullptr, nullptr); } void @@ -1219,10 +1036,8 @@ File::load_contents_async(const SlotAsyncReady& slot, const Glib::RefPtr<Cancell // and deleted in the callback. SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); - g_file_load_contents_async(gobj(), - Glib::unwrap(cancellable), - &SignalProxy_async_callback, - slot_copy); + g_file_load_contents_async( + gobj(), Glib::unwrap(cancellable), &SignalProxy_async_callback, slot_copy); } void @@ -1233,14 +1048,12 @@ File::load_contents_async(const SlotAsyncReady& slot) // and deleted in the callback. SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); - g_file_load_contents_async(gobj(), - nullptr, - &SignalProxy_async_callback, - slot_copy); + g_file_load_contents_async(gobj(), nullptr, &SignalProxy_async_callback, slot_copy); } void -File::load_partial_contents_async(const SlotReadMore& slot_read_more, const SlotAsyncReady& slot_async_ready, const Glib::RefPtr<Cancellable>& cancellable) +File::load_partial_contents_async(const SlotReadMore& slot_read_more, + const SlotAsyncReady& slot_async_ready, const Glib::RefPtr<Cancellable>& cancellable) { // Create a new pair which will hold copies of passed slots. // This will be deleted in the SignalProxy_load_partial_contents_ready_callback() callback @@ -1251,16 +1064,14 @@ File::load_partial_contents_async(const SlotReadMore& slot_read_more, const Slot slots->first = slot_read_more_copy; slots->second = slot_async_copy; - g_file_load_partial_contents_async(gobj(), - Glib::unwrap(cancellable), - &SignalProxy_load_partial_contents_read_more_callback, - &SignalProxy_load_partial_contents_ready_callback, - slots); + g_file_load_partial_contents_async(gobj(), Glib::unwrap(cancellable), + &SignalProxy_load_partial_contents_read_more_callback, + &SignalProxy_load_partial_contents_ready_callback, slots); } void -File::load_partial_contents_async(const SlotReadMore& slot_read_more, - const SlotAsyncReady& slot_async_ready) +File::load_partial_contents_async( + const SlotReadMore& slot_read_more, const SlotAsyncReady& slot_async_ready) { // Create a new pair which will hold copies of passed slots. // This will be deleted in the SignalProxy_load_partial_contents_ready_callback() callback @@ -1271,64 +1082,77 @@ File::load_partial_contents_async(const SlotReadMore& slot_read_more, slots->first = slot_read_more_copy; slots->second = slot_async_copy; - g_file_load_partial_contents_async(gobj(), - nullptr, - &SignalProxy_load_partial_contents_read_more_callback, - &SignalProxy_load_partial_contents_ready_callback, - slots); + g_file_load_partial_contents_async(gobj(), nullptr, + &SignalProxy_load_partial_contents_read_more_callback, + &SignalProxy_load_partial_contents_ready_callback, slots); } -void File::replace_contents(const char* contents, gsize length, const std::string& etag, std::string& new_etag, const Glib::RefPtr<Cancellable>& cancellable, bool make_backup, FileCreateFlags flags) +void +File::replace_contents(const char* contents, gsize length, const std::string& etag, + std::string& new_etag, const Glib::RefPtr<Cancellable>& cancellable, bool make_backup, + FileCreateFlags flags) { GError* gerror = nullptr; gchar* c_etag_new = nullptr; - g_file_replace_contents(gobj(), contents, length, Glib::c_str_or_nullptr(etag), static_cast<int>(make_backup), ((GFileCreateFlags)(flags)), &c_etag_new, const_cast<GCancellable*>(Glib::unwrap(cancellable)), &(gerror)); - if(gerror) + g_file_replace_contents(gobj(), contents, length, Glib::c_str_or_nullptr(etag), + static_cast<int>(make_backup), ((GFileCreateFlags)(flags)), &c_etag_new, + const_cast<GCancellable*>(Glib::unwrap(cancellable)), &(gerror)); + if (gerror) ::Glib::Error::throw_exception(gerror); - if(c_etag_new) + if (c_etag_new) new_etag = c_etag_new; else new_etag = std::string(); } -void File::replace_contents(const char* contents, gsize length, const std::string& etag, std::string& new_etag, bool make_backup, FileCreateFlags flags) +void +File::replace_contents(const char* contents, gsize length, const std::string& etag, + std::string& new_etag, bool make_backup, FileCreateFlags flags) { GError* gerror = nullptr; gchar* c_etag_new = nullptr; - g_file_replace_contents(gobj(), contents, length, Glib::c_str_or_nullptr(etag), static_cast<int>(make_backup), ((GFileCreateFlags)(flags)), &c_etag_new, nullptr, &(gerror)); - if(gerror) + g_file_replace_contents(gobj(), contents, length, Glib::c_str_or_nullptr(etag), + static_cast<int>(make_backup), ((GFileCreateFlags)(flags)), &c_etag_new, nullptr, &(gerror)); + if (gerror) ::Glib::Error::throw_exception(gerror); - if(c_etag_new) + if (c_etag_new) new_etag = c_etag_new; else new_etag = std::string(); } -void File::replace_contents(const std::string& contents, const std::string& etag, std::string& new_etag, const Glib::RefPtr<Cancellable>& cancellable, bool make_backup, FileCreateFlags flags) +void +File::replace_contents(const std::string& contents, const std::string& etag, std::string& new_etag, + const Glib::RefPtr<Cancellable>& cancellable, bool make_backup, FileCreateFlags flags) { GError* gerror = nullptr; gchar* c_etag_new = nullptr; - g_file_replace_contents(gobj(), contents.c_str(), contents.size(), Glib::c_str_or_nullptr(etag), static_cast<int>(make_backup), ((GFileCreateFlags)(flags)), &c_etag_new, const_cast<GCancellable*>(Glib::unwrap(cancellable)), &(gerror)); - if(gerror) + g_file_replace_contents(gobj(), contents.c_str(), contents.size(), Glib::c_str_or_nullptr(etag), + static_cast<int>(make_backup), ((GFileCreateFlags)(flags)), &c_etag_new, + const_cast<GCancellable*>(Glib::unwrap(cancellable)), &(gerror)); + if (gerror) ::Glib::Error::throw_exception(gerror); - if(c_etag_new) + if (c_etag_new) new_etag = c_etag_new; else new_etag = std::string(); } -void File::replace_contents(const std::string& contents, const std::string& etag, std::string& new_etag, bool make_backup, FileCreateFlags flags) +void +File::replace_contents(const std::string& contents, const std::string& etag, std::string& new_etag, + bool make_backup, FileCreateFlags flags) { GError* gerror = nullptr; gchar* c_etag_new = nullptr; - g_file_replace_contents(gobj(), contents.c_str(), contents.size(), Glib::c_str_or_nullptr(etag), static_cast<int>(make_backup), ((GFileCreateFlags)(flags)), &c_etag_new, nullptr, &(gerror)); - if(gerror) + g_file_replace_contents(gobj(), contents.c_str(), contents.size(), Glib::c_str_or_nullptr(etag), + static_cast<int>(make_backup), ((GFileCreateFlags)(flags)), &c_etag_new, nullptr, &(gerror)); + if (gerror) ::Glib::Error::throw_exception(gerror); - if(c_etag_new) + if (c_etag_new) new_etag = c_etag_new; else new_etag = std::string(); @@ -1336,287 +1160,258 @@ void File::replace_contents(const std::string& contents, const std::string& etag void File::replace_contents_async(const SlotAsyncReady& slot, - const Glib::RefPtr<Cancellable>& cancellable, - const char* contents, - gsize length, - const std::string& etag, - bool make_backup, - FileCreateFlags flags) + const Glib::RefPtr<Cancellable>& cancellable, const char* contents, gsize length, + const std::string& etag, bool make_backup, FileCreateFlags flags) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); - g_file_replace_contents_async(gobj(), - contents, - length, - Glib::c_str_or_nullptr(etag), - make_backup, - static_cast<GFileCreateFlags>(flags), - Glib::unwrap(cancellable), - &SignalProxy_async_callback, - slot_copy); + g_file_replace_contents_async(gobj(), contents, length, Glib::c_str_or_nullptr(etag), make_backup, + static_cast<GFileCreateFlags>(flags), Glib::unwrap(cancellable), &SignalProxy_async_callback, + slot_copy); } void -File::replace_contents_async(const SlotAsyncReady& slot, - const char* contents, - gsize length, - const std::string& etag, - bool make_backup, - FileCreateFlags flags) +File::replace_contents_async(const SlotAsyncReady& slot, const char* contents, gsize length, + const std::string& etag, bool make_backup, FileCreateFlags flags) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); - g_file_replace_contents_async(gobj(), - contents, - length, - Glib::c_str_or_nullptr(etag), - make_backup, - static_cast<GFileCreateFlags>(flags), - nullptr, - &SignalProxy_async_callback, - slot_copy); + g_file_replace_contents_async(gobj(), contents, length, Glib::c_str_or_nullptr(etag), make_backup, + static_cast<GFileCreateFlags>(flags), nullptr, &SignalProxy_async_callback, slot_copy); } void File::replace_contents_async(const SlotAsyncReady& slot, - const Glib::RefPtr<Cancellable>& cancellable, - const std::string& contents, - const std::string& etag, - bool make_backup, - FileCreateFlags flags) + const Glib::RefPtr<Cancellable>& cancellable, const std::string& contents, + const std::string& etag, bool make_backup, FileCreateFlags flags) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); - g_file_replace_contents_async(gobj(), - contents.c_str(), - contents.size(), - Glib::c_str_or_nullptr(etag), - make_backup, - static_cast<GFileCreateFlags>(flags), - Glib::unwrap(cancellable), - &SignalProxy_async_callback, - slot_copy); + g_file_replace_contents_async(gobj(), contents.c_str(), contents.size(), + Glib::c_str_or_nullptr(etag), make_backup, static_cast<GFileCreateFlags>(flags), + Glib::unwrap(cancellable), &SignalProxy_async_callback, slot_copy); } void -File::replace_contents_async(const SlotAsyncReady& slot, - const std::string& contents, - const std::string& etag, - bool make_backup, - FileCreateFlags flags) +File::replace_contents_async(const SlotAsyncReady& slot, const std::string& contents, + const std::string& etag, bool make_backup, FileCreateFlags flags) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); - g_file_replace_contents_async(gobj(), - contents.c_str(), - contents.size(), - Glib::c_str_or_nullptr(etag), - make_backup, - static_cast<GFileCreateFlags>(flags), - nullptr, - &SignalProxy_async_callback, - slot_copy); + g_file_replace_contents_async(gobj(), contents.c_str(), contents.size(), + Glib::c_str_or_nullptr(etag), make_backup, static_cast<GFileCreateFlags>(flags), nullptr, + &SignalProxy_async_callback, slot_copy); } -void File::replace_contents_finish(const Glib::RefPtr<AsyncResult>& result, std::string& new_etag) +void +File::replace_contents_finish(const Glib::RefPtr<AsyncResult>& result, std::string& new_etag) { GError* gerror = nullptr; gchar* c_new_etag = nullptr; g_file_replace_contents_finish(gobj(), Glib::unwrap(result), &c_new_etag, &(gerror)); - if(gerror) + if (gerror) ::Glib::Error::throw_exception(gerror); - if(c_new_etag) + if (c_new_etag) new_etag = c_new_etag; else - new_etag = std::string(); + new_etag = std::string(); } - -void File::replace_contents_finish(const Glib::RefPtr<AsyncResult>& result) +void +File::replace_contents_finish(const Glib::RefPtr<AsyncResult>& result) { GError* gerror = nullptr; g_file_replace_contents_finish(gobj(), Glib::unwrap(result), nullptr, &(gerror)); - if(gerror) + if (gerror) ::Glib::Error::throw_exception(gerror); } - void File::replace_contents_bytes_async(const SlotAsyncReady& slot, - const Glib::RefPtr<Cancellable>& cancellable, - const Glib::RefPtr<const Glib::Bytes>& contents, - const std::string& etag, - bool make_backup, - FileCreateFlags flags) + const Glib::RefPtr<Cancellable>& cancellable, const Glib::RefPtr<const Glib::Bytes>& contents, + const std::string& etag, bool make_backup, FileCreateFlags flags) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); - g_file_replace_contents_bytes_async(gobj(), - const_cast<GBytes*>(Glib::unwrap(contents)), - Glib::c_str_or_nullptr(etag), - make_backup, - static_cast<GFileCreateFlags>(flags), - Glib::unwrap(cancellable), - &SignalProxy_async_callback, - slot_copy); + g_file_replace_contents_bytes_async(gobj(), const_cast<GBytes*>(Glib::unwrap(contents)), + Glib::c_str_or_nullptr(etag), make_backup, static_cast<GFileCreateFlags>(flags), + Glib::unwrap(cancellable), &SignalProxy_async_callback, slot_copy); } void File::replace_contents_bytes_async(const SlotAsyncReady& slot, - const Glib::RefPtr<const Glib::Bytes>& contents, - const std::string& etag, - bool make_backup, - FileCreateFlags flags) + const Glib::RefPtr<const Glib::Bytes>& contents, const std::string& etag, bool make_backup, + FileCreateFlags flags) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); - g_file_replace_contents_bytes_async(gobj(), - const_cast<GBytes*>(Glib::unwrap(contents)), - Glib::c_str_or_nullptr(etag), - make_backup, - static_cast<GFileCreateFlags>(flags), - nullptr, - &SignalProxy_async_callback, - slot_copy); + g_file_replace_contents_bytes_async(gobj(), const_cast<GBytes*>(Glib::unwrap(contents)), + Glib::c_str_or_nullptr(etag), make_backup, static_cast<GFileCreateFlags>(flags), nullptr, + &SignalProxy_async_callback, slot_copy); } - -Glib::RefPtr<FileOutputStream> File::replace(const Glib::RefPtr<Cancellable>& cancellable, const std::string& etag, bool make_backup, FileCreateFlags flags) +Glib::RefPtr<FileOutputStream> +File::replace(const Glib::RefPtr<Cancellable>& cancellable, const std::string& etag, + bool make_backup, FileCreateFlags flags) { GError* gerror = nullptr; - auto retvalue = Glib::wrap(g_file_replace(gobj(), Glib::c_str_or_nullptr(etag), static_cast<int>(make_backup), ((GFileCreateFlags)(flags)), const_cast<GCancellable*>(Glib::unwrap(cancellable)), &(gerror))); - if(gerror) + auto retvalue = Glib::wrap(g_file_replace(gobj(), Glib::c_str_or_nullptr(etag), + static_cast<int>(make_backup), ((GFileCreateFlags)(flags)), + const_cast<GCancellable*>(Glib::unwrap(cancellable)), &(gerror))); + if (gerror) ::Glib::Error::throw_exception(gerror); return retvalue; } -Glib::RefPtr<FileOutputStream> File::replace(const std::string& etag, bool make_backup, FileCreateFlags flags) +Glib::RefPtr<FileOutputStream> +File::replace(const std::string& etag, bool make_backup, FileCreateFlags flags) { GError* gerror = nullptr; - auto retvalue = Glib::wrap(g_file_replace(gobj(), Glib::c_str_or_nullptr(etag), static_cast<int>(make_backup), ((GFileCreateFlags)(flags)), nullptr, &(gerror))); - if(gerror) + auto retvalue = Glib::wrap(g_file_replace(gobj(), Glib::c_str_or_nullptr(etag), + static_cast<int>(make_backup), ((GFileCreateFlags)(flags)), nullptr, &(gerror))); + if (gerror) ::Glib::Error::throw_exception(gerror); return retvalue; } - -Glib::RefPtr<FileIOStream> File::replace_readwrite(const Glib::RefPtr<Cancellable>& cancellable, const std::string& etag, bool make_backup, FileCreateFlags flags) +Glib::RefPtr<FileIOStream> +File::replace_readwrite(const Glib::RefPtr<Cancellable>& cancellable, const std::string& etag, + bool make_backup, FileCreateFlags flags) { GError* gerror = nullptr; - auto retvalue = Glib::wrap(g_file_replace_readwrite(gobj(), Glib::c_str_or_nullptr(etag), static_cast<int>(make_backup), ((GFileCreateFlags)(flags)), const_cast<GCancellable*>(Glib::unwrap(cancellable)), &(gerror))); - if(gerror) + auto retvalue = Glib::wrap(g_file_replace_readwrite(gobj(), Glib::c_str_or_nullptr(etag), + static_cast<int>(make_backup), ((GFileCreateFlags)(flags)), + const_cast<GCancellable*>(Glib::unwrap(cancellable)), &(gerror))); + if (gerror) ::Glib::Error::throw_exception(gerror); return retvalue; } -Glib::RefPtr<FileIOStream> File::replace_readwrite(const std::string& etag, bool make_backup, FileCreateFlags flags) +Glib::RefPtr<FileIOStream> +File::replace_readwrite(const std::string& etag, bool make_backup, FileCreateFlags flags) { GError* gerror = nullptr; - auto retvalue = Glib::wrap(g_file_replace_readwrite(gobj(), Glib::c_str_or_nullptr(etag), static_cast<int>(make_backup), ((GFileCreateFlags)(flags)), nullptr, &(gerror))); - if(gerror) + auto retvalue = Glib::wrap(g_file_replace_readwrite(gobj(), Glib::c_str_or_nullptr(etag), + static_cast<int>(make_backup), ((GFileCreateFlags)(flags)), nullptr, &(gerror))); + if (gerror) ::Glib::Error::throw_exception(gerror); return retvalue; } - - -Glib::RefPtr<FileMonitor> File::monitor_directory(const Glib::RefPtr<Cancellable>& cancellable, FileMonitorFlags flags) +Glib::RefPtr<FileMonitor> +File::monitor_directory(const Glib::RefPtr<Cancellable>& cancellable, FileMonitorFlags flags) { GError* gerror = nullptr; - auto retvalue = Glib::wrap(g_file_monitor_directory(gobj(), ((GFileMonitorFlags)(flags)), const_cast<GCancellable*>(Glib::unwrap(cancellable)), &(gerror))); - if(gerror) + auto retvalue = Glib::wrap(g_file_monitor_directory(gobj(), ((GFileMonitorFlags)(flags)), + const_cast<GCancellable*>(Glib::unwrap(cancellable)), &(gerror))); + if (gerror) ::Glib::Error::throw_exception(gerror); return retvalue; } -Glib::RefPtr<FileMonitor> File::monitor_directory(FileMonitorFlags flags) +Glib::RefPtr<FileMonitor> +File::monitor_directory(FileMonitorFlags flags) { GError* gerror = nullptr; - auto retvalue = Glib::wrap(g_file_monitor_directory(gobj(), ((GFileMonitorFlags)(flags)), nullptr, &(gerror))); - if(gerror) + auto retvalue = + Glib::wrap(g_file_monitor_directory(gobj(), ((GFileMonitorFlags)(flags)), nullptr, &(gerror))); + if (gerror) ::Glib::Error::throw_exception(gerror); return retvalue; } -Glib::RefPtr<FileMonitor> File::monitor_file(const Glib::RefPtr<Cancellable>& cancellable, FileMonitorFlags flags) +Glib::RefPtr<FileMonitor> +File::monitor_file(const Glib::RefPtr<Cancellable>& cancellable, FileMonitorFlags flags) { GError* gerror = nullptr; - auto retvalue = Glib::wrap(g_file_monitor_file(gobj(), ((GFileMonitorFlags)(flags)), const_cast<GCancellable*>(Glib::unwrap(cancellable)), &(gerror))); - if(gerror) + auto retvalue = Glib::wrap(g_file_monitor_file(gobj(), ((GFileMonitorFlags)(flags)), + const_cast<GCancellable*>(Glib::unwrap(cancellable)), &(gerror))); + if (gerror) ::Glib::Error::throw_exception(gerror); return retvalue; } -Glib::RefPtr<FileMonitor> File::monitor_file(FileMonitorFlags flags) +Glib::RefPtr<FileMonitor> +File::monitor_file(FileMonitorFlags flags) { GError* gerror = nullptr; - auto retvalue = Glib::wrap(g_file_monitor_file(gobj(), ((GFileMonitorFlags)(flags)), nullptr, &(gerror))); - if(gerror) + auto retvalue = + Glib::wrap(g_file_monitor_file(gobj(), ((GFileMonitorFlags)(flags)), nullptr, &(gerror))); + if (gerror) ::Glib::Error::throw_exception(gerror); return retvalue; } - -Glib::RefPtr<FileMonitor> File::monitor(const Glib::RefPtr<Cancellable>& cancellable, FileMonitorFlags flags) +Glib::RefPtr<FileMonitor> +File::monitor(const Glib::RefPtr<Cancellable>& cancellable, FileMonitorFlags flags) { GError* gerror = nullptr; - auto retvalue = Glib::wrap(g_file_monitor(gobj(), ((GFileMonitorFlags)(flags)), const_cast<GCancellable*>(Glib::unwrap(cancellable)), &(gerror))); - if(gerror) + auto retvalue = Glib::wrap(g_file_monitor(gobj(), ((GFileMonitorFlags)(flags)), + const_cast<GCancellable*>(Glib::unwrap(cancellable)), &(gerror))); + if (gerror) ::Glib::Error::throw_exception(gerror); return retvalue; } -Glib::RefPtr<FileMonitor> File::monitor(FileMonitorFlags flags) +Glib::RefPtr<FileMonitor> +File::monitor(FileMonitorFlags flags) { GError* gerror = nullptr; - auto retvalue = Glib::wrap(g_file_monitor(gobj(), ((GFileMonitorFlags)(flags)), nullptr, &(gerror))); - if(gerror) + auto retvalue = + Glib::wrap(g_file_monitor(gobj(), ((GFileMonitorFlags)(flags)), nullptr, &(gerror))); + if (gerror) ::Glib::Error::throw_exception(gerror); return retvalue; } - -void File::measure_disk_usage(const Glib::RefPtr<Cancellable>& cancellable, const SlotFileMeasureProgress& slot_progress, guint64& disk_usage, guint64& num_dirs, guint64& num_files, FileMeasureFlags flags) +void +File::measure_disk_usage(const Glib::RefPtr<Cancellable>& cancellable, + const SlotFileMeasureProgress& slot_progress, guint64& disk_usage, guint64& num_dirs, + guint64& num_files, FileMeasureFlags flags) { GError* gerror = nullptr; g_file_measure_disk_usage(gobj(), ((GFileMeasureFlags)(flags)), const_cast<GCancellable*>(Glib::unwrap(cancellable)), - &SignalProxy_file_measure_progress_callback, const_cast<SlotFileMeasureProgress*>(&slot_progress), - &disk_usage, &num_dirs, &num_files, &(gerror)); - if(gerror) + &SignalProxy_file_measure_progress_callback, + const_cast<SlotFileMeasureProgress*>(&slot_progress), &disk_usage, &num_dirs, &num_files, + &(gerror)); + if (gerror) ::Glib::Error::throw_exception(gerror); } -void File::measure_disk_usage_async(const SlotAsyncReady& slot_ready, const Glib::RefPtr<Cancellable>& cancellable, const SlotFileMeasureProgress& slot_progress, FileMeasureFlags flags, int io_priority) +void +File::measure_disk_usage_async(const SlotAsyncReady& slot_ready, + const Glib::RefPtr<Cancellable>& cancellable, const SlotFileMeasureProgress& slot_progress, + FileMeasureFlags flags, int io_priority) { // Create a new pair which will hold copies of passed slots. // This will be deleted in the SignalProxy_file_measure_async_callback() callback @@ -1627,160 +1422,147 @@ void File::measure_disk_usage_async(const SlotAsyncReady& slot_ready, const Glib slots->first = slot_progress_copy; slots->second = slot_ready_copy; - g_file_measure_disk_usage_async(gobj(), - ((GFileMeasureFlags)(flags)), - io_priority, + g_file_measure_disk_usage_async(gobj(), ((GFileMeasureFlags)(flags)), io_priority, const_cast<GCancellable*>(Glib::unwrap(cancellable)), - &SignalProxy_file_measure_progress_callback, const_cast<SlotFileMeasureProgress*>(&slot_progress), - &SignalProxy_file_measure_async_callback, slots); + &SignalProxy_file_measure_progress_callback, + const_cast<SlotFileMeasureProgress*>(&slot_progress), &SignalProxy_file_measure_async_callback, + slots); } -void File::start_mountable(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, const Glib::RefPtr<MountOperation>& start_operation, DriveStartFlags flags) +void +File::start_mountable(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, + const Glib::RefPtr<MountOperation>& start_operation, DriveStartFlags flags) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); - g_file_start_mountable(gobj(), - ((GDriveStartFlags)(flags)), - Glib::unwrap(start_operation), - Glib::unwrap(cancellable), - &SignalProxy_async_callback, - slot_copy); + g_file_start_mountable(gobj(), ((GDriveStartFlags)(flags)), Glib::unwrap(start_operation), + Glib::unwrap(cancellable), &SignalProxy_async_callback, slot_copy); } -void File::start_mountable(const SlotAsyncReady& slot, const Glib::RefPtr<MountOperation>& start_operation, DriveStartFlags flags) +void +File::start_mountable(const SlotAsyncReady& slot, + const Glib::RefPtr<MountOperation>& start_operation, DriveStartFlags flags) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); - g_file_start_mountable(gobj(), - ((GDriveStartFlags)(flags)), - Glib::unwrap(start_operation), - nullptr, - &SignalProxy_async_callback, - slot_copy); + g_file_start_mountable(gobj(), ((GDriveStartFlags)(flags)), Glib::unwrap(start_operation), + nullptr, &SignalProxy_async_callback, slot_copy); } -void File::stop_mountable(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, const Glib::RefPtr<MountOperation>& start_operation, MountUnmountFlags flags) +void +File::stop_mountable(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, + const Glib::RefPtr<MountOperation>& start_operation, MountUnmountFlags flags) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); - g_file_stop_mountable(gobj(), - ((GMountUnmountFlags)(flags)), - Glib::unwrap(start_operation), - Glib::unwrap(cancellable), - &SignalProxy_async_callback, - slot_copy); + g_file_stop_mountable(gobj(), ((GMountUnmountFlags)(flags)), Glib::unwrap(start_operation), + Glib::unwrap(cancellable), &SignalProxy_async_callback, slot_copy); } -void File::stop_mountable(const SlotAsyncReady& slot, const Glib::RefPtr<MountOperation>& start_operation, MountUnmountFlags flags) +void +File::stop_mountable(const SlotAsyncReady& slot, + const Glib::RefPtr<MountOperation>& start_operation, MountUnmountFlags flags) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); - g_file_stop_mountable(gobj(), - ((GMountUnmountFlags)(flags)), - Glib::unwrap(start_operation), - nullptr, - &SignalProxy_async_callback, - slot_copy); + g_file_stop_mountable(gobj(), ((GMountUnmountFlags)(flags)), Glib::unwrap(start_operation), + nullptr, &SignalProxy_async_callback, slot_copy); } - -void File::poll_mountable(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable) +void +File::poll_mountable(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); - g_file_poll_mountable(gobj(), - Glib::unwrap(cancellable), - &SignalProxy_async_callback, - slot_copy); + g_file_poll_mountable(gobj(), Glib::unwrap(cancellable), &SignalProxy_async_callback, slot_copy); } -void File::poll_mountable(const SlotAsyncReady& slot) +void +File::poll_mountable(const SlotAsyncReady& slot) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); - g_file_poll_mountable(gobj(), - nullptr, - &SignalProxy_async_callback, - slot_copy); + g_file_poll_mountable(gobj(), nullptr, &SignalProxy_async_callback, slot_copy); } -void File::find_enclosing_mount_async(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, int io_priority) +void +File::find_enclosing_mount_async( + const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, int io_priority) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); - g_file_find_enclosing_mount_async(gobj(), - io_priority, - Glib::unwrap(cancellable), - &SignalProxy_async_callback, - slot_copy); + g_file_find_enclosing_mount_async( + gobj(), io_priority, Glib::unwrap(cancellable), &SignalProxy_async_callback, slot_copy); } -void File::find_enclosing_mount_async(const SlotAsyncReady& slot, int io_priority) +void +File::find_enclosing_mount_async(const SlotAsyncReady& slot, int io_priority) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); - g_file_find_enclosing_mount_async(gobj(), - io_priority, - nullptr, - &SignalProxy_async_callback, - slot_copy); + g_file_find_enclosing_mount_async( + gobj(), io_priority, nullptr, &SignalProxy_async_callback, slot_copy); } -bool File::set_attributes_from_info(const Glib::RefPtr<FileInfo>& info, const Glib::RefPtr<Cancellable>& cancellable, FileQueryInfoFlags flags) +bool +File::set_attributes_from_info(const Glib::RefPtr<FileInfo>& info, + const Glib::RefPtr<Cancellable>& cancellable, FileQueryInfoFlags flags) { GError* gerror = nullptr; - bool retvalue = g_file_set_attributes_from_info(gobj(), Glib::unwrap(info), ((GFileQueryInfoFlags)(flags)), const_cast<GCancellable*>(Glib::unwrap(cancellable)), &(gerror)); - if(gerror) + bool retvalue = + g_file_set_attributes_from_info(gobj(), Glib::unwrap(info), ((GFileQueryInfoFlags)(flags)), + const_cast<GCancellable*>(Glib::unwrap(cancellable)), &(gerror)); + if (gerror) ::Glib::Error::throw_exception(gerror); return retvalue; } -bool File::set_attributes_from_info(const Glib::RefPtr<FileInfo>& info, FileQueryInfoFlags flags) +bool +File::set_attributes_from_info(const Glib::RefPtr<FileInfo>& info, FileQueryInfoFlags flags) { GError* gerror = nullptr; - bool retvalue = g_file_set_attributes_from_info(gobj(), Glib::unwrap(info), ((GFileQueryInfoFlags)(flags)), nullptr, &(gerror)); - if(gerror) + bool retvalue = g_file_set_attributes_from_info( + gobj(), Glib::unwrap(info), ((GFileQueryInfoFlags)(flags)), nullptr, &(gerror)); + if (gerror) ::Glib::Error::throw_exception(gerror); return retvalue; } bool -File::copy_attributes(const Glib::RefPtr<File>& destination, const Glib::RefPtr<Cancellable>& cancellable, FileCopyFlags flags) +File::copy_attributes(const Glib::RefPtr<File>& destination, + const Glib::RefPtr<Cancellable>& cancellable, FileCopyFlags flags) { GError* gerror = nullptr; bool res; - res = g_file_copy_attributes(gobj(), - Glib::unwrap(destination), - static_cast<GFileCopyFlags>(flags), - Glib::unwrap(cancellable), - &gerror); + res = g_file_copy_attributes(gobj(), Glib::unwrap(destination), + static_cast<GFileCopyFlags>(flags), Glib::unwrap(cancellable), &gerror); if (gerror) ::Glib::Error::throw_exception(gerror); @@ -1794,11 +1576,8 @@ File::copy_attributes(const Glib::RefPtr<File>& destination, FileCopyFlags flags GError* gerror = nullptr; bool res; - res = g_file_copy_attributes(gobj(), - Glib::unwrap(destination), - static_cast<GFileCopyFlags>(flags), - nullptr, - &gerror); + res = g_file_copy_attributes( + gobj(), Glib::unwrap(destination), static_cast<GFileCopyFlags>(flags), nullptr, &gerror); if (gerror) ::Glib::Error::throw_exception(gerror); @@ -1806,72 +1585,87 @@ File::copy_attributes(const Glib::RefPtr<File>& destination, FileCopyFlags flags return res; } -Glib::RefPtr<FileOutputStream> File::create_file(const Glib::RefPtr<Cancellable>& cancellable, FileCreateFlags flags) +Glib::RefPtr<FileOutputStream> +File::create_file(const Glib::RefPtr<Cancellable>& cancellable, FileCreateFlags flags) { GError* gerror = nullptr; - auto retvalue = Glib::wrap(g_file_create(gobj(), ((GFileCreateFlags)(flags)), const_cast<GCancellable*>(Glib::unwrap(cancellable)), &(gerror))); - if(gerror) + auto retvalue = Glib::wrap(g_file_create(gobj(), ((GFileCreateFlags)(flags)), + const_cast<GCancellable*>(Glib::unwrap(cancellable)), &(gerror))); + if (gerror) ::Glib::Error::throw_exception(gerror); return retvalue; } -Glib::RefPtr<FileOutputStream> File::create_file(FileCreateFlags flags) +Glib::RefPtr<FileOutputStream> +File::create_file(FileCreateFlags flags) { GError* gerror = nullptr; - auto retvalue = Glib::wrap(g_file_create(gobj(), ((GFileCreateFlags)(flags)), nullptr, &(gerror))); - if(gerror) + auto retvalue = + Glib::wrap(g_file_create(gobj(), ((GFileCreateFlags)(flags)), nullptr, &(gerror))); + if (gerror) ::Glib::Error::throw_exception(gerror); return retvalue; } -Glib::RefPtr<FileIOStream> File::create_file_readwrite(const Glib::RefPtr<Cancellable>& cancellable, FileCreateFlags flags) +Glib::RefPtr<FileIOStream> +File::create_file_readwrite(const Glib::RefPtr<Cancellable>& cancellable, FileCreateFlags flags) { GError* gerror = nullptr; - auto retvalue = Glib::wrap(g_file_create_readwrite(gobj(), ((GFileCreateFlags)(flags)), const_cast<GCancellable*>(Glib::unwrap(cancellable)), &(gerror))); - if(gerror) + auto retvalue = Glib::wrap(g_file_create_readwrite(gobj(), ((GFileCreateFlags)(flags)), + const_cast<GCancellable*>(Glib::unwrap(cancellable)), &(gerror))); + if (gerror) ::Glib::Error::throw_exception(gerror); return retvalue; } -Glib::RefPtr<FileIOStream> File::create_file_readwrite(FileCreateFlags flags) +Glib::RefPtr<FileIOStream> +File::create_file_readwrite(FileCreateFlags flags) { GError* gerror = nullptr; - auto retvalue = Glib::wrap(g_file_create_readwrite(gobj(), ((GFileCreateFlags)(flags)), nullptr, &(gerror))); - if(gerror) + auto retvalue = + Glib::wrap(g_file_create_readwrite(gobj(), ((GFileCreateFlags)(flags)), nullptr, &(gerror))); + if (gerror) ::Glib::Error::throw_exception(gerror); return retvalue; } -Glib::RefPtr<FileOutputStream> File::append_to(const Glib::RefPtr<Cancellable>& cancellable, FileCreateFlags flags) +Glib::RefPtr<FileOutputStream> +File::append_to(const Glib::RefPtr<Cancellable>& cancellable, FileCreateFlags flags) { GError* gerror = nullptr; - auto retvalue = Glib::wrap(g_file_append_to(gobj(), ((GFileCreateFlags)(flags)), const_cast<GCancellable*>(Glib::unwrap(cancellable)), &(gerror))); - if(gerror) + auto retvalue = Glib::wrap(g_file_append_to(gobj(), ((GFileCreateFlags)(flags)), + const_cast<GCancellable*>(Glib::unwrap(cancellable)), &(gerror))); + if (gerror) ::Glib::Error::throw_exception(gerror); return retvalue; } -Glib::RefPtr<FileOutputStream> File::append_to(FileCreateFlags flags) +Glib::RefPtr<FileOutputStream> +File::append_to(FileCreateFlags flags) { GError* gerror = nullptr; - auto retvalue = Glib::wrap(g_file_append_to(gobj(), ((GFileCreateFlags)(flags)), nullptr, &(gerror))); - if(gerror) + auto retvalue = + Glib::wrap(g_file_append_to(gobj(), ((GFileCreateFlags)(flags)), nullptr, &(gerror))); + if (gerror) ::Glib::Error::throw_exception(gerror); return retvalue; } -bool File::load_contents(const Glib::RefPtr<Cancellable>& cancellable, char*& contents, gsize& length, std::string& etag_out) +bool +File::load_contents(const Glib::RefPtr<Cancellable>& cancellable, char*& contents, gsize& length, + std::string& etag_out) { GError* gerror = nullptr; gchar* cetag_out = nullptr; - bool retvalue = g_file_load_contents(gobj(), Glib::unwrap(cancellable), &contents, &(length), &cetag_out, &(gerror)); - if(gerror) + bool retvalue = g_file_load_contents( + gobj(), Glib::unwrap(cancellable), &contents, &(length), &cetag_out, &(gerror)); + if (gerror) ::Glib::Error::throw_exception(gerror); etag_out = Glib::convert_return_gchar_ptr_to_stdstring(cetag_out); @@ -1879,22 +1673,26 @@ bool File::load_contents(const Glib::RefPtr<Cancellable>& cancellable, char*& co return retvalue; } -bool File::load_contents(const Glib::RefPtr<Cancellable>& cancellable, char*& contents, gsize& length) +bool +File::load_contents(const Glib::RefPtr<Cancellable>& cancellable, char*& contents, gsize& length) { GError* gerror = nullptr; - bool retvalue = g_file_load_contents(gobj(), Glib::unwrap(cancellable), &contents, &(length), nullptr, &(gerror)); - if(gerror) + bool retvalue = g_file_load_contents( + gobj(), Glib::unwrap(cancellable), &contents, &(length), nullptr, &(gerror)); + if (gerror) ::Glib::Error::throw_exception(gerror); return retvalue; } -bool File::load_contents(char*& contents, gsize& length, std::string& etag_out) +bool +File::load_contents(char*& contents, gsize& length, std::string& etag_out) { GError* gerror = nullptr; gchar* cetag_out = nullptr; - bool retvalue = g_file_load_contents(gobj(), nullptr, &contents, &(length), &cetag_out, &(gerror)); - if(gerror) + bool retvalue = + g_file_load_contents(gobj(), nullptr, &contents, &(length), &cetag_out, &(gerror)); + if (gerror) ::Glib::Error::throw_exception(gerror); etag_out = Glib::convert_return_gchar_ptr_to_stdstring(cetag_out); @@ -1902,22 +1700,26 @@ bool File::load_contents(char*& contents, gsize& length, std::string& etag_out) return retvalue; } -bool File::load_contents(char*& contents, gsize& length) +bool +File::load_contents(char*& contents, gsize& length) { GError* gerror = nullptr; bool retvalue = g_file_load_contents(gobj(), nullptr, &contents, &(length), nullptr, &(gerror)); - if(gerror) + if (gerror) ::Glib::Error::throw_exception(gerror); return retvalue; } -bool File::load_contents_finish(const Glib::RefPtr<AsyncResult>& result, char*& contents, gsize& length, std::string& etag_out) +bool +File::load_contents_finish( + const Glib::RefPtr<AsyncResult>& result, char*& contents, gsize& length, std::string& etag_out) { GError* gerror = nullptr; gchar* cetag_out = nullptr; - bool retvalue = g_file_load_contents_finish(gobj(), Glib::unwrap(result), &contents, &(length), &cetag_out, &(gerror)); - if(gerror) + bool retvalue = g_file_load_contents_finish( + gobj(), Glib::unwrap(result), &contents, &(length), &cetag_out, &(gerror)); + if (gerror) ::Glib::Error::throw_exception(gerror); etag_out = Glib::convert_return_gchar_ptr_to_stdstring(cetag_out); @@ -1925,22 +1727,27 @@ bool File::load_contents_finish(const Glib::RefPtr<AsyncResult>& result, char*& return retvalue; } -bool File::load_contents_finish(const Glib::RefPtr<AsyncResult>& result, char*& contents, gsize& length) +bool +File::load_contents_finish(const Glib::RefPtr<AsyncResult>& result, char*& contents, gsize& length) { GError* gerror = nullptr; - bool retvalue = g_file_load_contents_finish(gobj(), Glib::unwrap(result), &contents, &(length), nullptr, &(gerror)); - if(gerror) + bool retvalue = g_file_load_contents_finish( + gobj(), Glib::unwrap(result), &contents, &(length), nullptr, &(gerror)); + if (gerror) ::Glib::Error::throw_exception(gerror); return retvalue; } -bool File::load_partial_contents_finish(const Glib::RefPtr<AsyncResult>& result, char*& contents, gsize& length, std::string& etag_out) +bool +File::load_partial_contents_finish( + const Glib::RefPtr<AsyncResult>& result, char*& contents, gsize& length, std::string& etag_out) { GError* gerror = nullptr; gchar* cetag_out = nullptr; - bool retvalue = g_file_load_partial_contents_finish(gobj(), Glib::unwrap(result), &contents, &(length), &cetag_out, &(gerror)); - if(gerror) + bool retvalue = g_file_load_partial_contents_finish( + gobj(), Glib::unwrap(result), &contents, &(length), &cetag_out, &(gerror)); + if (gerror) ::Glib::Error::throw_exception(gerror); etag_out = Glib::convert_return_gchar_ptr_to_stdstring(cetag_out); @@ -1948,121 +1755,96 @@ bool File::load_partial_contents_finish(const Glib::RefPtr<AsyncResult>& result, return retvalue; } -bool File::load_partial_contents_finish(const Glib::RefPtr<AsyncResult>& result, char*& contents, gsize& length) +bool +File::load_partial_contents_finish( + const Glib::RefPtr<AsyncResult>& result, char*& contents, gsize& length) { GError* gerror = nullptr; - bool retvalue = g_file_load_partial_contents_finish(gobj(), Glib::unwrap(result), &contents, &(length), nullptr, &(gerror)); - if(gerror) + bool retvalue = g_file_load_partial_contents_finish( + gobj(), Glib::unwrap(result), &contents, &(length), nullptr, &(gerror)); + if (gerror) ::Glib::Error::throw_exception(gerror); return retvalue; } -bool File::has_parent() const +bool +File::has_parent() const { return g_file_has_parent(const_cast<GFile*>(gobj()), nullptr); } - void -File::remove_async(const SlotAsyncReady& slot_ready, - const Glib::RefPtr<Cancellable>& cancellable, - int io_priority) +File::remove_async( + const SlotAsyncReady& slot_ready, const Glib::RefPtr<Cancellable>& cancellable, int io_priority) { // Create copies of slots. // Pointers to them will be passed through the callbacks' data parameter // and deleted in the corresponding callback. SlotAsyncReady* slot_ready_copy = new SlotAsyncReady(slot_ready); - g_file_delete_async(gobj(), - io_priority, - Glib::unwrap(cancellable), - &SignalProxy_async_callback, - slot_ready_copy); + g_file_delete_async( + gobj(), io_priority, Glib::unwrap(cancellable), &SignalProxy_async_callback, slot_ready_copy); } void -File::remove_async(const SlotAsyncReady& slot_ready, - int io_priority) +File::remove_async(const SlotAsyncReady& slot_ready, int io_priority) { // Create copies of slots. // Pointers to them will be passed through the callbacks' data parameter // and deleted in the corresponding callback. SlotAsyncReady* slot_ready_copy = new SlotAsyncReady(slot_ready); - g_file_delete_async(gobj(), - io_priority, - nullptr, - &SignalProxy_async_callback, - slot_ready_copy); + g_file_delete_async(gobj(), io_priority, nullptr, &SignalProxy_async_callback, slot_ready_copy); } - void -File::trash_async(const SlotAsyncReady& slot_ready, - const Glib::RefPtr<Cancellable>& cancellable, - int io_priority) +File::trash_async( + const SlotAsyncReady& slot_ready, const Glib::RefPtr<Cancellable>& cancellable, int io_priority) { // Create copies of slots. // Pointers to them will be passed through the callbacks' data parameter // and deleted in the corresponding callback. SlotAsyncReady* slot_ready_copy = new SlotAsyncReady(slot_ready); - g_file_trash_async(gobj(), - io_priority, - Glib::unwrap(cancellable), - &SignalProxy_async_callback, - slot_ready_copy); + g_file_trash_async( + gobj(), io_priority, Glib::unwrap(cancellable), &SignalProxy_async_callback, slot_ready_copy); } void -File::trash_async(const SlotAsyncReady& slot_ready, - int io_priority) +File::trash_async(const SlotAsyncReady& slot_ready, int io_priority) { // Create copies of slots. // Pointers to them will be passed through the callbacks' data parameter // and deleted in the corresponding callback. SlotAsyncReady* slot_ready_copy = new SlotAsyncReady(slot_ready); - g_file_trash_async(gobj(), - io_priority, - nullptr, - &SignalProxy_async_callback, - slot_ready_copy); + g_file_trash_async(gobj(), io_priority, nullptr, &SignalProxy_async_callback, slot_ready_copy); } void -File::make_directory_async(const SlotAsyncReady& slot_ready, - const Glib::RefPtr<Cancellable>& cancellable, - int io_priority) +File::make_directory_async( + const SlotAsyncReady& slot_ready, const Glib::RefPtr<Cancellable>& cancellable, int io_priority) { // Create copies of slots. // Pointers to them will be passed through the callbacks' data parameter // and deleted in the corresponding callback. SlotAsyncReady* slot_ready_copy = new SlotAsyncReady(slot_ready); - g_file_make_directory_async(gobj(), - io_priority, - Glib::unwrap(cancellable), - &SignalProxy_async_callback, - slot_ready_copy); + g_file_make_directory_async( + gobj(), io_priority, Glib::unwrap(cancellable), &SignalProxy_async_callback, slot_ready_copy); } void -File::make_directory_async(const SlotAsyncReady& slot_ready, - int io_priority) +File::make_directory_async(const SlotAsyncReady& slot_ready, int io_priority) { // Create copies of slots. // Pointers to them will be passed through the callbacks' data parameter // and deleted in the corresponding callback. SlotAsyncReady* slot_ready_copy = new SlotAsyncReady(slot_ready); - g_file_make_directory_async(gobj(), - io_priority, - nullptr, - &SignalProxy_async_callback, - slot_ready_copy); + g_file_make_directory_async( + gobj(), io_priority, nullptr, &SignalProxy_async_callback, slot_ready_copy); } - } // namespace Gio diff --git a/gio/src/fileattributeinfo.ccg b/gio/src/fileattributeinfo.ccg index d3e95977..9cf96757 100644 --- a/gio/src/fileattributeinfo.ccg +++ b/gio/src/fileattributeinfo.ccg @@ -23,8 +23,7 @@ namespace Gio { FileAttributeInfo::FileAttributeInfo(const GFileAttributeInfo* ginfo) - : - m_name(ginfo->name ? ginfo->name : ""), +: m_name(ginfo->name ? ginfo->name : ""), m_type(static_cast<FileAttributeType>(ginfo->type)), m_flags(static_cast<FileAttributeInfoFlags>(ginfo->flags)) { @@ -45,13 +44,14 @@ FileAttributeInfo::operator=(const FileAttributeInfo& other) } FileAttributeInfo::FileAttributeInfo(FileAttributeInfo&& other) noexcept -: m_name(std::move(other.m_name)), - m_type(std::move(other.m_type)), - m_flags(std::move(other.m_flags)) + : m_name(std::move(other.m_name)), + m_type(std::move(other.m_type)), + m_flags(std::move(other.m_flags)) { } -FileAttributeInfo& FileAttributeInfo::operator=(FileAttributeInfo&& other) noexcept +FileAttributeInfo& +FileAttributeInfo::operator=(FileAttributeInfo&& other) noexcept { m_name = std::move(other.m_name); m_type = std::move(other.m_type); @@ -83,4 +83,3 @@ FileAttributeInfo::get_flags() const } } // namespace Gio - diff --git a/gio/src/fileattributeinfolist.ccg b/gio/src/fileattributeinfolist.ccg index 717b731e..98d0efa8 100644 --- a/gio/src/fileattributeinfolist.ccg +++ b/gio/src/fileattributeinfolist.ccg @@ -27,7 +27,8 @@ FileAttributeInfoList::operator bool() const return !empty(); } -bool FileAttributeInfoList::empty() const +bool +FileAttributeInfoList::empty() const { return gobj() == nullptr; } @@ -36,8 +37,7 @@ FileAttributeInfo FileAttributeInfoList::lookup(const std::string& name) const { auto cobject = const_cast<GFileAttributeInfoList*>(gobj()); - const GFileAttributeInfo* cinfo = - g_file_attribute_info_list_lookup (cobject, name.c_str()); + const GFileAttributeInfo* cinfo = g_file_attribute_info_list_lookup(cobject, name.c_str()); FileAttributeInfo info(cinfo); return info; diff --git a/gio/src/fileenumerator.ccg b/gio/src/fileenumerator.ccg index aff8c88a..b59cca0c 100644 --- a/gio/src/fileenumerator.ccg +++ b/gio/src/fileenumerator.ccg @@ -27,19 +27,16 @@ namespace Gio { void -FileEnumerator::next_files_async(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, int num_files, int io_priority) +FileEnumerator::next_files_async(const SlotAsyncReady& slot, + const Glib::RefPtr<Cancellable>& cancellable, int num_files, int io_priority) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. auto slot_copy = new SlotAsyncReady(slot); - g_file_enumerator_next_files_async(gobj(), - num_files, - io_priority, - Glib::unwrap(cancellable), - &SignalProxy_async_callback, - slot_copy); + g_file_enumerator_next_files_async(gobj(), num_files, io_priority, Glib::unwrap(cancellable), + &SignalProxy_async_callback, slot_copy); } void @@ -50,45 +47,35 @@ FileEnumerator::next_files_async(const SlotAsyncReady& slot, int num_files, int // and deleted in the callback. auto slot_copy = new SlotAsyncReady(slot); - g_file_enumerator_next_files_async(gobj(), - num_files, - io_priority, - nullptr, // cancellable - &SignalProxy_async_callback, - slot_copy); + g_file_enumerator_next_files_async(gobj(), num_files, io_priority, + nullptr, // cancellable + &SignalProxy_async_callback, slot_copy); } void -FileEnumerator::close_async(int io_priority, - const Glib::RefPtr<Cancellable>& cancellable, - const SlotAsyncReady& slot) +FileEnumerator::close_async( + int io_priority, const Glib::RefPtr<Cancellable>& cancellable, const SlotAsyncReady& slot) { -// Create a copy of the slot. + // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. auto slot_copy = new SlotAsyncReady(slot); - g_file_enumerator_close_async(gobj(), - io_priority, - Glib::unwrap(cancellable), - &SignalProxy_async_callback, - slot_copy); + g_file_enumerator_close_async( + gobj(), io_priority, Glib::unwrap(cancellable), &SignalProxy_async_callback, slot_copy); } void -FileEnumerator::close_async(int io_priority, - const SlotAsyncReady& slot) +FileEnumerator::close_async(int io_priority, const SlotAsyncReady& slot) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. auto slot_copy = new SlotAsyncReady(slot); - g_file_enumerator_close_async(gobj(), - io_priority, - nullptr, // cancellable - &SignalProxy_async_callback, - slot_copy); + g_file_enumerator_close_async(gobj(), io_priority, + nullptr, // cancellable + &SignalProxy_async_callback, slot_copy); } } // namespace Gio diff --git a/gio/src/fileinfo.ccg b/gio/src/fileinfo.ccg index 8d7bd9ae..fa359957 100644 --- a/gio/src/fileinfo.ccg +++ b/gio/src/fileinfo.ccg @@ -19,7 +19,8 @@ #include <gio/gio.h> -namespace Gio { +namespace Gio +{ // FileAttributeMatcher @@ -29,7 +30,8 @@ FileAttributeMatcher::create(const std::string& attributes) return Glib::wrap(g_file_attribute_matcher_new(attributes.c_str())); } -Glib::TimeVal FileInfo::modification_time() const +Glib::TimeVal +FileInfo::modification_time() const { Glib::TimeVal result; g_file_info_get_modification_time(const_cast<GFileInfo*>(gobj()), (GTimeVal*)(&result)); diff --git a/gio/src/fileinputstream.ccg b/gio/src/fileinputstream.ccg index 769cbae2..ef1b73e4 100644 --- a/gio/src/fileinputstream.ccg +++ b/gio/src/fileinputstream.ccg @@ -24,56 +24,55 @@ namespace Gio { -Glib::RefPtr<FileInfo> FileInputStream::query_info(const Glib::RefPtr<Cancellable>& cancellable, const std::string& attributes) +Glib::RefPtr<FileInfo> +FileInputStream::query_info( + const Glib::RefPtr<Cancellable>& cancellable, const std::string& attributes) { GError* gerror = nullptr; - auto retvalue = Glib::wrap(g_file_input_stream_query_info(gobj(), g_strdup((attributes).c_str()), const_cast<GCancellable*>(Glib::unwrap(cancellable)), &(gerror))); - if(gerror) + auto retvalue = Glib::wrap(g_file_input_stream_query_info(gobj(), g_strdup((attributes).c_str()), + const_cast<GCancellable*>(Glib::unwrap(cancellable)), &(gerror))); + if (gerror) ::Glib::Error::throw_exception(gerror); return retvalue; } -Glib::RefPtr<FileInfo> FileInputStream::query_info(const std::string& attributes) +Glib::RefPtr<FileInfo> +FileInputStream::query_info(const std::string& attributes) { GError* gerror = nullptr; - auto retvalue = Glib::wrap(g_file_input_stream_query_info(gobj(), g_strdup((attributes).c_str()), nullptr, &(gerror))); - if(gerror) + auto retvalue = Glib::wrap( + g_file_input_stream_query_info(gobj(), g_strdup((attributes).c_str()), nullptr, &(gerror))); + if (gerror) ::Glib::Error::throw_exception(gerror); return retvalue; } void -FileInputStream::query_info_async(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, const std::string& attributes, int io_priority) +FileInputStream::query_info_async(const SlotAsyncReady& slot, + const Glib::RefPtr<Cancellable>& cancellable, const std::string& attributes, int io_priority) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. auto slot_copy = new SlotAsyncReady(slot); - g_file_input_stream_query_info_async(gobj(), - const_cast<char*>(attributes.c_str()), - io_priority, - Glib::unwrap(cancellable), - &SignalProxy_async_callback, - slot_copy); + g_file_input_stream_query_info_async(gobj(), const_cast<char*>(attributes.c_str()), io_priority, + Glib::unwrap(cancellable), &SignalProxy_async_callback, slot_copy); } void -FileInputStream::query_info_async(const SlotAsyncReady& slot, const std::string& attributes, int io_priority) +FileInputStream::query_info_async( + const SlotAsyncReady& slot, const std::string& attributes, int io_priority) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. auto slot_copy = new SlotAsyncReady(slot); - g_file_input_stream_query_info_async(gobj(), - const_cast<char*>(attributes.c_str()), - io_priority, - nullptr, - &SignalProxy_async_callback, - slot_copy); + g_file_input_stream_query_info_async(gobj(), const_cast<char*>(attributes.c_str()), io_priority, + nullptr, &SignalProxy_async_callback, slot_copy); } } // namespace Gio diff --git a/gio/src/fileiostream.ccg b/gio/src/fileiostream.ccg index 1ef1bb60..21002d36 100644 --- a/gio/src/fileiostream.ccg +++ b/gio/src/fileiostream.ccg @@ -24,56 +24,55 @@ namespace Gio { -Glib::RefPtr<FileInfo> FileIOStream::query_info(const Glib::RefPtr<Cancellable>& cancellable, const std::string& attributes) +Glib::RefPtr<FileInfo> +FileIOStream::query_info( + const Glib::RefPtr<Cancellable>& cancellable, const std::string& attributes) { GError* gerror = nullptr; - auto retvalue = Glib::wrap(g_file_io_stream_query_info(gobj(), g_strdup((attributes).c_str()), const_cast<GCancellable*>(Glib::unwrap(cancellable)), &(gerror))); - if(gerror) + auto retvalue = Glib::wrap(g_file_io_stream_query_info(gobj(), g_strdup((attributes).c_str()), + const_cast<GCancellable*>(Glib::unwrap(cancellable)), &(gerror))); + if (gerror) ::Glib::Error::throw_exception(gerror); return retvalue; } -Glib::RefPtr<FileInfo> FileIOStream::query_info(const std::string& attributes) +Glib::RefPtr<FileInfo> +FileIOStream::query_info(const std::string& attributes) { GError* gerror = nullptr; - auto retvalue = Glib::wrap(g_file_io_stream_query_info(gobj(), g_strdup((attributes).c_str()), nullptr, &(gerror))); - if(gerror) + auto retvalue = Glib::wrap( + g_file_io_stream_query_info(gobj(), g_strdup((attributes).c_str()), nullptr, &(gerror))); + if (gerror) ::Glib::Error::throw_exception(gerror); return retvalue; } void -FileIOStream::query_info_async(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, const std::string& attributes, int io_priority) +FileIOStream::query_info_async(const SlotAsyncReady& slot, + const Glib::RefPtr<Cancellable>& cancellable, const std::string& attributes, int io_priority) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. auto slot_copy = new SlotAsyncReady(slot); - g_file_io_stream_query_info_async(gobj(), - const_cast<char*>(attributes.c_str()), - io_priority, - Glib::unwrap(cancellable), - &SignalProxy_async_callback, - slot_copy); + g_file_io_stream_query_info_async(gobj(), const_cast<char*>(attributes.c_str()), io_priority, + Glib::unwrap(cancellable), &SignalProxy_async_callback, slot_copy); } void -FileIOStream::query_info_async(const SlotAsyncReady& slot, const std::string& attributes, int io_priority) +FileIOStream::query_info_async( + const SlotAsyncReady& slot, const std::string& attributes, int io_priority) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. auto slot_copy = new SlotAsyncReady(slot); - g_file_io_stream_query_info_async(gobj(), - const_cast<char*>(attributes.c_str()), - io_priority, - nullptr, - &SignalProxy_async_callback, - slot_copy); + g_file_io_stream_query_info_async(gobj(), const_cast<char*>(attributes.c_str()), io_priority, + nullptr, &SignalProxy_async_callback, slot_copy); } } // namespace Gio diff --git a/gio/src/filemonitor.ccg b/gio/src/filemonitor.ccg index 45b0d1ae..3161de1d 100644 --- a/gio/src/filemonitor.ccg +++ b/gio/src/filemonitor.ccg @@ -21,7 +21,7 @@ #include <giomm/file.h> #include <gio/gio.h> -namespace Gio { - +namespace Gio +{ } // namespace Gio diff --git a/gio/src/filenamecompleter.ccg b/gio/src/filenamecompleter.ccg index 45b0d1ae..3161de1d 100644 --- a/gio/src/filenamecompleter.ccg +++ b/gio/src/filenamecompleter.ccg @@ -21,7 +21,7 @@ #include <giomm/file.h> #include <gio/gio.h> -namespace Gio { - +namespace Gio +{ } // namespace Gio diff --git a/gio/src/fileoutputstream.ccg b/gio/src/fileoutputstream.ccg index 429d5cb0..2e8040c0 100644 --- a/gio/src/fileoutputstream.ccg +++ b/gio/src/fileoutputstream.ccg @@ -26,60 +26,59 @@ namespace Gio { -Glib::RefPtr<FileInfo> FileOutputStream::query_info(const Glib::RefPtr<Cancellable>& cancellable, const std::string& attributes) +Glib::RefPtr<FileInfo> +FileOutputStream::query_info( + const Glib::RefPtr<Cancellable>& cancellable, const std::string& attributes) { GError* gerror = nullptr; - auto retvalue = Glib::wrap(g_file_output_stream_query_info(gobj(), g_strdup((attributes).c_str()), const_cast<GCancellable*>(Glib::unwrap(cancellable)), &(gerror))); - if(gerror) + auto retvalue = Glib::wrap(g_file_output_stream_query_info(gobj(), g_strdup((attributes).c_str()), + const_cast<GCancellable*>(Glib::unwrap(cancellable)), &(gerror))); + if (gerror) ::Glib::Error::throw_exception(gerror); - if(retvalue) - retvalue->reference(); //The function does not do a ref for us. + if (retvalue) + retvalue->reference(); // The function does not do a ref for us. return retvalue; } -Glib::RefPtr<FileInfo> FileOutputStream::query_info(const std::string& attributes) +Glib::RefPtr<FileInfo> +FileOutputStream::query_info(const std::string& attributes) { GError* gerror = nullptr; - auto retvalue = Glib::wrap(g_file_output_stream_query_info(gobj(), g_strdup((attributes).c_str()), nullptr, &(gerror))); - if(gerror) + auto retvalue = Glib::wrap( + g_file_output_stream_query_info(gobj(), g_strdup((attributes).c_str()), nullptr, &(gerror))); + if (gerror) ::Glib::Error::throw_exception(gerror); - if(retvalue) - retvalue->reference(); //The function does not do a ref for us. + if (retvalue) + retvalue->reference(); // The function does not do a ref for us. return retvalue; } void -FileOutputStream::query_info_async(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, const std::string& attributes, int io_priority) +FileOutputStream::query_info_async(const SlotAsyncReady& slot, + const Glib::RefPtr<Cancellable>& cancellable, const std::string& attributes, int io_priority) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. auto slot_copy = new SlotAsyncReady(slot); - g_file_output_stream_query_info_async(gobj(), - const_cast<char*>(attributes.c_str()), - io_priority, - Glib::unwrap(cancellable), - &SignalProxy_async_callback, - slot_copy); + g_file_output_stream_query_info_async(gobj(), const_cast<char*>(attributes.c_str()), io_priority, + Glib::unwrap(cancellable), &SignalProxy_async_callback, slot_copy); } void -FileOutputStream::query_info_async(const SlotAsyncReady& slot, const std::string& attributes, int io_priority) +FileOutputStream::query_info_async( + const SlotAsyncReady& slot, const std::string& attributes, int io_priority) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. auto slot_copy = new SlotAsyncReady(slot); - g_file_output_stream_query_info_async(gobj(), - const_cast<char*>(attributes.c_str()), - io_priority, - nullptr, - &SignalProxy_async_callback, - slot_copy); + g_file_output_stream_query_info_async(gobj(), const_cast<char*>(attributes.c_str()), io_priority, + nullptr, &SignalProxy_async_callback, slot_copy); } } // namespace Gio diff --git a/gio/src/icon.ccg b/gio/src/icon.ccg index 583897a2..fdc6c872 100644 --- a/gio/src/icon.ccg +++ b/gio/src/icon.ccg @@ -20,21 +20,22 @@ #include <gio/gio.h> #include <glibmm/error.h> -namespace Gio { +namespace Gio +{ bool Icon::equal(const Glib::RefPtr<Icon>& other) const { return static_cast<bool>( - g_icon_equal(const_cast<GIcon*>(this->gobj()), - const_cast<GIcon*>(other->gobj()))); + g_icon_equal(const_cast<GIcon*>(this->gobj()), const_cast<GIcon*>(other->gobj()))); } -Glib::RefPtr<Icon> Icon::create(const std::string& str) +Glib::RefPtr<Icon> +Icon::create(const std::string& str) { GError* gerror = nullptr; auto icon = g_icon_new_for_string(str.c_str(), &gerror); - if(gerror) + if (gerror) ::Glib::Error::throw_exception(gerror); return Glib::wrap(icon); diff --git a/gio/src/inetaddress.ccg b/gio/src/inetaddress.ccg index cc87cc05..f8c926fd 100644 --- a/gio/src/inetaddress.ccg +++ b/gio/src/inetaddress.ccg @@ -22,22 +22,22 @@ namespace Gio { -Glib::RefPtr<InetAddress> InetAddress::create(const Glib::ustring& string) +Glib::RefPtr<InetAddress> +InetAddress::create(const Glib::ustring& string) { - return Glib::wrap (g_inet_address_new_from_string (string.c_str ())); + return Glib::wrap(g_inet_address_new_from_string(string.c_str())); } Glib::RefPtr<InetAddress> InetAddress::create_any(SocketFamily family) { - return Glib::wrap (g_inet_address_new_any ((GSocketFamily) family)); + return Glib::wrap(g_inet_address_new_any((GSocketFamily)family)); } - Glib::RefPtr<InetAddress> InetAddress::create_loopback(SocketFamily family) { - return Glib::wrap (g_inet_address_new_loopback ((GSocketFamily) family)); + return Glib::wrap(g_inet_address_new_loopback((GSocketFamily)family)); } -} //namespace Gio +} // namespace Gio diff --git a/gio/src/inetsocketaddress.ccg b/gio/src/inetsocketaddress.ccg index c146baae..5317f389 100644 --- a/gio/src/inetsocketaddress.ccg +++ b/gio/src/inetsocketaddress.ccg @@ -22,4 +22,4 @@ namespace Gio { -} //namespace Gio +} // namespace Gio diff --git a/gio/src/inputstream.ccg b/gio/src/inputstream.ccg index 9a6ca6c7..97160032 100644 --- a/gio/src/inputstream.ccg +++ b/gio/src/inputstream.ccg @@ -26,20 +26,16 @@ namespace Gio { void -InputStream::read_async(void* buffer, gsize count, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, int io_priority) +InputStream::read_async(void* buffer, gsize count, const SlotAsyncReady& slot, + const Glib::RefPtr<Cancellable>& cancellable, int io_priority) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. auto slot_copy = new SlotAsyncReady(slot); - g_input_stream_read_async(gobj(), - buffer, - count, - io_priority, - Glib::unwrap(cancellable), - &SignalProxy_async_callback, - slot_copy); + g_input_stream_read_async(gobj(), buffer, count, io_priority, Glib::unwrap(cancellable), + &SignalProxy_async_callback, slot_copy); } void @@ -50,31 +46,21 @@ InputStream::read_async(void* buffer, gsize count, const SlotAsyncReady& slot, i // and deleted in the callback. auto slot_copy = new SlotAsyncReady(slot); - g_input_stream_read_async(gobj(), - buffer, - count, - io_priority, - nullptr, - &SignalProxy_async_callback, - slot_copy); + g_input_stream_read_async( + gobj(), buffer, count, io_priority, nullptr, &SignalProxy_async_callback, slot_copy); } - void -InputStream::read_all_async(void* buffer, gsize count, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, int io_priority) +InputStream::read_all_async(void* buffer, gsize count, const SlotAsyncReady& slot, + const Glib::RefPtr<Cancellable>& cancellable, int io_priority) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. auto slot_copy = new SlotAsyncReady(slot); - g_input_stream_read_all_async(gobj(), - buffer, - count, - io_priority, - Glib::unwrap(cancellable), - &SignalProxy_async_callback, - slot_copy); + g_input_stream_read_all_async(gobj(), buffer, count, io_priority, Glib::unwrap(cancellable), + &SignalProxy_async_callback, slot_copy); } void @@ -85,30 +71,21 @@ InputStream::read_all_async(void* buffer, gsize count, const SlotAsyncReady& slo // and deleted in the callback. auto slot_copy = new SlotAsyncReady(slot); - g_input_stream_read_all_async(gobj(), - buffer, - count, - io_priority, - nullptr, - &SignalProxy_async_callback, - slot_copy); + g_input_stream_read_all_async( + gobj(), buffer, count, io_priority, nullptr, &SignalProxy_async_callback, slot_copy); } - void -InputStream::read_bytes_async(gsize count, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, int io_priority) +InputStream::read_bytes_async(gsize count, const SlotAsyncReady& slot, + const Glib::RefPtr<Cancellable>& cancellable, int io_priority) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. auto slot_copy = new SlotAsyncReady(slot); - g_input_stream_read_bytes_async(gobj(), - count, - io_priority, - Glib::unwrap(cancellable), - &SignalProxy_async_callback, - slot_copy); + g_input_stream_read_bytes_async( + gobj(), count, io_priority, Glib::unwrap(cancellable), &SignalProxy_async_callback, slot_copy); } void @@ -119,29 +96,21 @@ InputStream::read_bytes_async(gsize count, const SlotAsyncReady& slot, int io_pr // and deleted in the callback. auto slot_copy = new SlotAsyncReady(slot); - g_input_stream_read_bytes_async(gobj(), - count, - io_priority, - nullptr, - &SignalProxy_async_callback, - slot_copy); + g_input_stream_read_bytes_async( + gobj(), count, io_priority, nullptr, &SignalProxy_async_callback, slot_copy); } - void -InputStream::skip_async(gsize count, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, int io_priority) +InputStream::skip_async(gsize count, const SlotAsyncReady& slot, + const Glib::RefPtr<Cancellable>& cancellable, int io_priority) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. auto slot_copy = new SlotAsyncReady(slot); - g_input_stream_skip_async(gobj(), - count, - io_priority, - Glib::unwrap(cancellable), - &SignalProxy_async_callback, - slot_copy); + g_input_stream_skip_async( + gobj(), count, io_priority, Glib::unwrap(cancellable), &SignalProxy_async_callback, slot_copy); } void @@ -152,27 +121,21 @@ InputStream::skip_async(gsize count, const SlotAsyncReady& slot, int io_priority // and deleted in the callback. auto slot_copy = new SlotAsyncReady(slot); - g_input_stream_skip_async(gobj(), - count, - io_priority, - nullptr, - &SignalProxy_async_callback, - slot_copy); + g_input_stream_skip_async( + gobj(), count, io_priority, nullptr, &SignalProxy_async_callback, slot_copy); } void -InputStream::close_async(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, int io_priority) +InputStream::close_async( + const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, int io_priority) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. auto slot_copy = new SlotAsyncReady(slot); - g_input_stream_close_async(gobj(), - io_priority, - Glib::unwrap(cancellable), - &SignalProxy_async_callback, - slot_copy); + g_input_stream_close_async( + gobj(), io_priority, Glib::unwrap(cancellable), &SignalProxy_async_callback, slot_copy); } void @@ -183,12 +146,7 @@ InputStream::close_async(const SlotAsyncReady& slot, int io_priority) // and deleted in the callback. auto slot_copy = new SlotAsyncReady(slot); - g_input_stream_close_async(gobj(), - io_priority, - nullptr, - &SignalProxy_async_callback, - slot_copy); + g_input_stream_close_async(gobj(), io_priority, nullptr, &SignalProxy_async_callback, slot_copy); } - } // namespace Gio diff --git a/gio/src/iostream.ccg b/gio/src/iostream.ccg index 057bda85..6242c79e 100644 --- a/gio/src/iostream.ccg +++ b/gio/src/iostream.ccg @@ -26,18 +26,16 @@ namespace Gio { void -IOStream::close_async(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, int io_priority) +IOStream::close_async( + const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, int io_priority) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. auto slot_copy = new SlotAsyncReady(slot); - g_io_stream_close_async(gobj(), - io_priority, - Glib::unwrap(cancellable), - &SignalProxy_async_callback, - slot_copy); + g_io_stream_close_async( + gobj(), io_priority, Glib::unwrap(cancellable), &SignalProxy_async_callback, slot_copy); } void @@ -48,40 +46,33 @@ IOStream::close_async(const SlotAsyncReady& slot, int io_priority) // and deleted in the callback. auto slot_copy = new SlotAsyncReady(slot); - g_io_stream_close_async(gobj(), - io_priority, - nullptr, - &SignalProxy_async_callback, - slot_copy); + g_io_stream_close_async(gobj(), io_priority, nullptr, &SignalProxy_async_callback, slot_copy); } void -IOStream::splice_async(const Glib::RefPtr<IOStream>& stream2, - const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, - IOStreamSpliceFlags flags, int io_priority) +IOStream::splice_async(const Glib::RefPtr<IOStream>& stream2, const SlotAsyncReady& slot, + const Glib::RefPtr<Cancellable>& cancellable, IOStreamSpliceFlags flags, int io_priority) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. auto slot_copy = new SlotAsyncReady(slot); - g_io_stream_splice_async(gobj(), Glib::unwrap(stream2), - static_cast<GIOStreamSpliceFlags>(flags), io_priority, - Glib::unwrap(cancellable), &SignalProxy_async_callback, slot_copy); + g_io_stream_splice_async(gobj(), Glib::unwrap(stream2), static_cast<GIOStreamSpliceFlags>(flags), + io_priority, Glib::unwrap(cancellable), &SignalProxy_async_callback, slot_copy); } void -IOStream::splice_async(const Glib::RefPtr<IOStream>& stream2, - const SlotAsyncReady& slot, IOStreamSpliceFlags flags, int io_priority) +IOStream::splice_async(const Glib::RefPtr<IOStream>& stream2, const SlotAsyncReady& slot, + IOStreamSpliceFlags flags, int io_priority) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. auto slot_copy = new SlotAsyncReady(slot); - g_io_stream_splice_async(gobj(), Glib::unwrap(stream2), - static_cast<GIOStreamSpliceFlags>(flags), io_priority, nullptr, - &SignalProxy_async_callback, slot_copy); + g_io_stream_splice_async(gobj(), Glib::unwrap(stream2), static_cast<GIOStreamSpliceFlags>(flags), + io_priority, nullptr, &SignalProxy_async_callback, slot_copy); } } // namespace Gio diff --git a/gio/src/loadableicon.ccg b/gio/src/loadableicon.ccg index 718d3012..9ccc741f 100644 --- a/gio/src/loadableicon.ccg +++ b/gio/src/loadableicon.ccg @@ -31,18 +31,14 @@ LoadableIcon::load(int size, Glib::ustring& type, const Glib::RefPtr<Cancellable char* c_type; GError* gerror = nullptr; auto retval = - Glib::wrap(g_loadable_icon_load(gobj(), - size, - &c_type, - Glib::unwrap(cancellable), - &gerror)); - if(gerror) + Glib::wrap(g_loadable_icon_load(gobj(), size, &c_type, Glib::unwrap(cancellable), &gerror)); + if (gerror) ::Glib::Error::throw_exception(gerror); type = c_type; g_free(c_type); - if(retval) - retval->reference(); //The function does not do a ref for us. + if (retval) + retval->reference(); // The function does not do a ref for us. return retval; } @@ -51,36 +47,28 @@ LoadableIcon::load(int size, Glib::ustring& type) { char* c_type; GError* gerror = nullptr; - auto retval = - Glib::wrap(g_loadable_icon_load(gobj(), - size, - &c_type, - nullptr, - &gerror)); - if(gerror) + auto retval = Glib::wrap(g_loadable_icon_load(gobj(), size, &c_type, nullptr, &gerror)); + if (gerror) ::Glib::Error::throw_exception(gerror); type = c_type; g_free(c_type); - if(retval) - retval->reference(); //The function does not do a ref for us. + if (retval) + retval->reference(); // The function does not do a ref for us. return retval; } void -LoadableIcon::load_async(int size, const SlotAsyncReady& slot, const - Glib::RefPtr<Cancellable>& cancellable) +LoadableIcon::load_async( + int size, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. auto slot_copy = new SlotAsyncReady(slot); - g_loadable_icon_load_async(gobj(), - size, - Glib::unwrap(cancellable), - &SignalProxy_async_callback, - slot_copy); + g_loadable_icon_load_async( + gobj(), size, Glib::unwrap(cancellable), &SignalProxy_async_callback, slot_copy); } void @@ -91,11 +79,7 @@ LoadableIcon::load_async(int size, const SlotAsyncReady& slot) // and deleted in the callback. auto slot_copy = new SlotAsyncReady(slot); - g_loadable_icon_load_async(gobj(), - size, - nullptr, - &SignalProxy_async_callback, - slot_copy); + g_loadable_icon_load_async(gobj(), size, nullptr, &SignalProxy_async_callback, slot_copy); } } // namespace Gio diff --git a/gio/src/memoryinputstream.ccg b/gio/src/memoryinputstream.ccg index 72ceb52a..e8965282 100644 --- a/gio/src/memoryinputstream.ccg +++ b/gio/src/memoryinputstream.ccg @@ -26,9 +26,9 @@ class SlotWithData { public: SlotWithData(const Gio::MemoryInputStream::SlotDestroyData& slot, void* data) - : - m_slot(new Gio::MemoryInputStream::SlotDestroyData(slot)), m_data(data) - { } + : m_slot(new Gio::MemoryInputStream::SlotDestroyData(slot)), m_data(data) + { + } ~SlotWithData() { delete m_slot; } @@ -39,7 +39,8 @@ private: void* m_data; }; -void destroy_data_callback(void* user_data) +void +destroy_data_callback(void* user_data) { auto slot_with_data = static_cast<SlotWithData*>(user_data); g_return_if_fail(slot_with_data != nullptr); @@ -62,27 +63,30 @@ namespace Gio { _DEPRECATE_IFDEF_START -void MemoryInputStream::add_data(const std::string& data) +void +MemoryInputStream::add_data(const std::string& data) { - char *data_copy = g_strdup (data.c_str ()); + char* data_copy = g_strdup(data.c_str()); g_memory_input_stream_add_data(gobj(), data_copy, -1, g_free); } -void MemoryInputStream::add_data(const void* data, gssize len) +void +MemoryInputStream::add_data(const void* data, gssize len) { - char *data_copy = nullptr; + char* data_copy = nullptr; // copy the data so that the caller doesn't need to keep the data alive if (len < 0) - data_copy = g_strdup (static_cast<const gchar*>(data)); + data_copy = g_strdup(static_cast<const gchar*>(data)); else - data_copy = static_cast<gchar*>(g_memdup (data, len)); + data_copy = static_cast<gchar*>(g_memdup(data, len)); g_memory_input_stream_add_data(gobj(), data_copy, len, g_free); } _DEPRECATE_IFDEF_END -void MemoryInputStream::add_data(const void* data, gssize len, const SlotDestroyData& destroy_slot) +void +MemoryInputStream::add_data(const void* data, gssize len, const SlotDestroyData& destroy_slot) { auto slot_with_data = new SlotWithData(destroy_slot, const_cast<void*>(data)); auto bytes = g_bytes_new_with_free_func(data, len, &destroy_data_callback, slot_with_data); diff --git a/gio/src/menuattributeiter.ccg b/gio/src/menuattributeiter.ccg index 08e8d4e8..83ea74a2 100644 --- a/gio/src/menuattributeiter.ccg +++ b/gio/src/menuattributeiter.ccg @@ -20,14 +20,13 @@ namespace Gio { -bool MenuAttributeIter::get_next(Glib::ustring& out_name, - Glib::VariantBase& value) +bool +MenuAttributeIter::get_next(Glib::ustring& out_name, Glib::VariantBase& value) { const char* g_out_name = nullptr; GVariant* g_value = nullptr; - bool const result = g_menu_attribute_iter_get_next(gobj(), &g_out_name, - &g_value); + bool const result = g_menu_attribute_iter_get_next(gobj(), &g_out_name, &g_value); out_name = g_out_name; value.init(g_value); diff --git a/gio/src/menuitem.ccg b/gio/src/menuitem.ccg index 6483f42d..6912c056 100644 --- a/gio/src/menuitem.ccg +++ b/gio/src/menuitem.ccg @@ -20,57 +20,60 @@ namespace Gio { -MenuItem::MenuItem(const Glib::ustring& label, const Glib::ustring& detailed_action) -: _CONSTRUCT() +MenuItem::MenuItem(const Glib::ustring& label, const Glib::ustring& detailed_action) : _CONSTRUCT() { - if(!label.empty()) + if (!label.empty()) set_label(label); - if(!detailed_action.empty()) + if (!detailed_action.empty()) set_detailed_action(detailed_action); } MenuItem::MenuItem(const Glib::ustring& label, const Glib::RefPtr<MenuModel>& submenu) : _CONSTRUCT() { - if(!label.empty()) + if (!label.empty()) set_label(label); set_submenu(submenu); } -MenuItem::MenuItem(const Glib::RefPtr<MenuModel>& submenu) -: _CONSTRUCT() +MenuItem::MenuItem(const Glib::RefPtr<MenuModel>& submenu) : _CONSTRUCT() { set_submenu(submenu); } _DEPRECATE_IFDEF_START -void MenuItem::set_action_and_target(const Glib::ustring& action) +void +MenuItem::set_action_and_target(const Glib::ustring& action) { g_menu_item_set_action_and_target_value(gobj(), action.c_str(), nullptr); } _DEPRECATE_IFDEF_END -void MenuItem::set_action(const Glib::ustring& action) +void +MenuItem::set_action(const Glib::ustring& action) { g_menu_item_set_action_and_target_value(gobj(), action.c_str(), nullptr); } -void MenuItem::unset_target() +void +MenuItem::unset_target() { - const gchar *action_name = nullptr; - g_menu_item_get_attribute (gobj(), G_MENU_ATTRIBUTE_ACTION, "&s", &action_name); - + const gchar* action_name = nullptr; + g_menu_item_get_attribute(gobj(), G_MENU_ATTRIBUTE_ACTION, "&s", &action_name); + g_menu_item_set_action_and_target_value(gobj(), action_name, nullptr); } -void MenuItem::unset_action_and_target() +void +MenuItem::unset_action_and_target() { g_menu_item_set_action_and_target_value(gobj(), nullptr, nullptr); } -void MenuItem::unset_icon() +void +MenuItem::unset_icon() { g_menu_item_set_icon(gobj(), nullptr); } diff --git a/gio/src/menulinkiter.ccg b/gio/src/menulinkiter.ccg index b41fbb11..542e46d2 100644 --- a/gio/src/menulinkiter.ccg +++ b/gio/src/menulinkiter.ccg @@ -21,8 +21,8 @@ namespace Gio { -bool MenuLinkIter::get_next(Glib::ustring& out_link, - Glib::RefPtr<MenuModel>& value) +bool +MenuLinkIter::get_next(Glib::ustring& out_link, Glib::RefPtr<MenuModel>& value) { const char* g_out_link = nullptr; GMenuModel* g_value = nullptr; diff --git a/gio/src/menumodel.ccg b/gio/src/menumodel.ccg index 5d6612eb..48b9b2bb 100644 --- a/gio/src/menumodel.ccg +++ b/gio/src/menumodel.ccg @@ -23,26 +23,20 @@ namespace Gio { // Make sure the order here is the same order as in Gio::MenuAttribute. -static const char* const _attribute_strings[] = -{ - G_MENU_ATTRIBUTE_ACTION, - G_MENU_ATTRIBUTE_LABEL, - G_MENU_ATTRIBUTE_TARGET -}; +static const char* const _attribute_strings[] = { G_MENU_ATTRIBUTE_ACTION, G_MENU_ATTRIBUTE_LABEL, + G_MENU_ATTRIBUTE_TARGET }; -const char* giomm_get_menu_attribute(MenuAttribute attribute) +const char* +giomm_get_menu_attribute(MenuAttribute attribute) { return _attribute_strings[attribute]; } // Make sure the order here is the same order as in Gio::MenuLink. -static const char* const _link_strings[] = -{ - G_MENU_LINK_SECTION, - G_MENU_LINK_SUBMENU -}; +static const char* const _link_strings[] = { G_MENU_LINK_SECTION, G_MENU_LINK_SUBMENU }; -const char* giomm_get_menu_link(MenuLink link) +const char* +giomm_get_menu_link(MenuLink link) { return _link_strings[link]; } diff --git a/gio/src/mount.ccg b/gio/src/mount.ccg index ae2e619b..6b78a8b2 100644 --- a/gio/src/mount.ccg +++ b/gio/src/mount.ccg @@ -27,275 +27,239 @@ namespace Gio { -void Mount::unmount(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, MountUnmountFlags flags) +void +Mount::unmount( + const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, MountUnmountFlags flags) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. auto slot_copy = new SlotAsyncReady(slot); - g_mount_unmount_with_operation(gobj(), - GMountUnmountFlags(flags), - nullptr, // mount_operation - Glib::unwrap(cancellable), - &SignalProxy_async_callback, - slot_copy); + g_mount_unmount_with_operation(gobj(), GMountUnmountFlags(flags), + nullptr, // mount_operation + Glib::unwrap(cancellable), &SignalProxy_async_callback, slot_copy); } -void Mount::unmount(const SlotAsyncReady& slot, MountUnmountFlags flags) +void +Mount::unmount(const SlotAsyncReady& slot, MountUnmountFlags flags) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. auto slot_copy = new SlotAsyncReady(slot); - g_mount_unmount_with_operation(gobj(), - GMountUnmountFlags(flags), - nullptr, // mount_operation - nullptr, // cancellable - &SignalProxy_async_callback, - slot_copy); + g_mount_unmount_with_operation(gobj(), GMountUnmountFlags(flags), + nullptr, // mount_operation + nullptr, // cancellable + &SignalProxy_async_callback, slot_copy); } -void Mount::unmount(MountUnmountFlags flags) +void +Mount::unmount(MountUnmountFlags flags) { - g_mount_unmount_with_operation(gobj(), - GMountUnmountFlags(flags), - nullptr, // mount_operation - nullptr, // cancellable - nullptr, // callback - nullptr); // data + g_mount_unmount_with_operation(gobj(), GMountUnmountFlags(flags), + nullptr, // mount_operation + nullptr, // cancellable + nullptr, // callback + nullptr); // data } -void Mount::unmount(const Glib::RefPtr<MountOperation>& mount_operation, - const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, MountUnmountFlags flags) +void +Mount::unmount(const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsyncReady& slot, + const Glib::RefPtr<Cancellable>& cancellable, MountUnmountFlags flags) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. auto slot_copy = new SlotAsyncReady(slot); - g_mount_unmount_with_operation(gobj(), - GMountUnmountFlags(flags), - Glib::unwrap(mount_operation), - Glib::unwrap(cancellable), - &SignalProxy_async_callback, - slot_copy); + g_mount_unmount_with_operation(gobj(), GMountUnmountFlags(flags), Glib::unwrap(mount_operation), + Glib::unwrap(cancellable), &SignalProxy_async_callback, slot_copy); } -void Mount::unmount(const Glib::RefPtr<MountOperation>& mount_operation, - const SlotAsyncReady& slot, MountUnmountFlags flags) +void +Mount::unmount(const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsyncReady& slot, + MountUnmountFlags flags) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. auto slot_copy = new SlotAsyncReady(slot); - g_mount_unmount_with_operation(gobj(), - GMountUnmountFlags(flags), - Glib::unwrap(mount_operation), - nullptr, // cancellable - &SignalProxy_async_callback, - slot_copy); + g_mount_unmount_with_operation(gobj(), GMountUnmountFlags(flags), Glib::unwrap(mount_operation), + nullptr, // cancellable + &SignalProxy_async_callback, slot_copy); } -void Mount::unmount(const Glib::RefPtr<MountOperation>& mount_operation, - MountUnmountFlags flags) +void +Mount::unmount(const Glib::RefPtr<MountOperation>& mount_operation, MountUnmountFlags flags) { - g_mount_unmount_with_operation(gobj(), - GMountUnmountFlags(flags), - Glib::unwrap(mount_operation), - nullptr, // cancellable - nullptr, // callback - nullptr); // data + g_mount_unmount_with_operation(gobj(), GMountUnmountFlags(flags), Glib::unwrap(mount_operation), + nullptr, // cancellable + nullptr, // callback + nullptr); // data } - -void Mount::remount(const Glib::RefPtr<MountOperation>& operation, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, MountMountFlags flags) +void +Mount::remount(const Glib::RefPtr<MountOperation>& operation, const SlotAsyncReady& slot, + const Glib::RefPtr<Cancellable>& cancellable, MountMountFlags flags) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. auto slot_copy = new SlotAsyncReady(slot); - g_mount_remount(gobj(), - static_cast<GMountMountFlags>(flags), - Glib::unwrap(operation), - Glib::unwrap(cancellable), - &SignalProxy_async_callback, - slot_copy); + g_mount_remount(gobj(), static_cast<GMountMountFlags>(flags), Glib::unwrap(operation), + Glib::unwrap(cancellable), &SignalProxy_async_callback, slot_copy); } -void Mount::remount(const Glib::RefPtr<MountOperation>& operation, const SlotAsyncReady& slot, MountMountFlags flags) +void +Mount::remount( + const Glib::RefPtr<MountOperation>& operation, const SlotAsyncReady& slot, MountMountFlags flags) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. auto slot_copy = new SlotAsyncReady(slot); - g_mount_remount(gobj(), - static_cast<GMountMountFlags>(flags), - Glib::unwrap(operation), - nullptr, - &SignalProxy_async_callback, - slot_copy); + g_mount_remount(gobj(), static_cast<GMountMountFlags>(flags), Glib::unwrap(operation), nullptr, + &SignalProxy_async_callback, slot_copy); } -void Mount::remount(const Glib::RefPtr<MountOperation>& operation, MountMountFlags flags) +void +Mount::remount(const Glib::RefPtr<MountOperation>& operation, MountMountFlags flags) { - g_mount_remount(gobj(), - static_cast<GMountMountFlags>(flags), - Glib::unwrap(operation), - nullptr, - nullptr, - nullptr); + g_mount_remount(gobj(), static_cast<GMountMountFlags>(flags), Glib::unwrap(operation), nullptr, + nullptr, nullptr); } -void Mount::remount(MountMountFlags flags) +void +Mount::remount(MountMountFlags flags) { - g_mount_remount(gobj(), - static_cast<GMountMountFlags>(flags), - nullptr, - nullptr, - nullptr, - nullptr); + g_mount_remount(gobj(), static_cast<GMountMountFlags>(flags), nullptr, nullptr, nullptr, nullptr); } -void Mount::eject(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, MountUnmountFlags flags) +void +Mount::eject( + const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, MountUnmountFlags flags) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. auto slot_copy = new SlotAsyncReady(slot); - g_mount_eject_with_operation(gobj(), - GMountUnmountFlags(flags), - nullptr, // mount_operation - Glib::unwrap(cancellable), - &SignalProxy_async_callback, - slot_copy); + g_mount_eject_with_operation(gobj(), GMountUnmountFlags(flags), + nullptr, // mount_operation + Glib::unwrap(cancellable), &SignalProxy_async_callback, slot_copy); } -void Mount::eject(const SlotAsyncReady& slot, MountUnmountFlags flags) +void +Mount::eject(const SlotAsyncReady& slot, MountUnmountFlags flags) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. auto slot_copy = new SlotAsyncReady(slot); - g_mount_eject_with_operation(gobj(), - GMountUnmountFlags(flags), - nullptr, // mount_operation - nullptr, // cancellable - &SignalProxy_async_callback, - slot_copy); + g_mount_eject_with_operation(gobj(), GMountUnmountFlags(flags), + nullptr, // mount_operation + nullptr, // cancellable + &SignalProxy_async_callback, slot_copy); } -void Mount::eject(MountUnmountFlags flags) +void +Mount::eject(MountUnmountFlags flags) { - g_mount_eject_with_operation(gobj(), - GMountUnmountFlags(flags), - nullptr, // mount_operation - nullptr, // cancellable - nullptr, // callback - nullptr); // data + g_mount_eject_with_operation(gobj(), GMountUnmountFlags(flags), + nullptr, // mount_operation + nullptr, // cancellable + nullptr, // callback + nullptr); // data } -void Mount::eject(const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, MountUnmountFlags flags) +void +Mount::eject(const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsyncReady& slot, + const Glib::RefPtr<Cancellable>& cancellable, MountUnmountFlags flags) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. auto slot_copy = new SlotAsyncReady(slot); - g_mount_eject_with_operation(gobj(), - GMountUnmountFlags(flags), - Glib::unwrap(mount_operation), - Glib::unwrap(cancellable), - &SignalProxy_async_callback, - slot_copy); + g_mount_eject_with_operation(gobj(), GMountUnmountFlags(flags), Glib::unwrap(mount_operation), + Glib::unwrap(cancellable), &SignalProxy_async_callback, slot_copy); } -void Mount::eject(const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsyncReady& slot, MountUnmountFlags flags) +void +Mount::eject(const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsyncReady& slot, + MountUnmountFlags flags) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. auto slot_copy = new SlotAsyncReady(slot); - g_mount_eject_with_operation(gobj(), - GMountUnmountFlags(flags), - Glib::unwrap(mount_operation), - nullptr, // cancellable - &SignalProxy_async_callback, - slot_copy); + g_mount_eject_with_operation(gobj(), GMountUnmountFlags(flags), Glib::unwrap(mount_operation), + nullptr, // cancellable + &SignalProxy_async_callback, slot_copy); } -void Mount::eject(const Glib::RefPtr<MountOperation>& mount_operation, MountUnmountFlags flags) +void +Mount::eject(const Glib::RefPtr<MountOperation>& mount_operation, MountUnmountFlags flags) { - g_mount_eject_with_operation(gobj(), - GMountUnmountFlags(flags), - Glib::unwrap(mount_operation), - nullptr, // cancellable - nullptr, // callback - nullptr); // data + g_mount_eject_with_operation(gobj(), GMountUnmountFlags(flags), Glib::unwrap(mount_operation), + nullptr, // cancellable + nullptr, // callback + nullptr); // data } - -void Mount::guess_content_type(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, bool force_rescan) +void +Mount::guess_content_type( + const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, bool force_rescan) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. auto slot_copy = new SlotAsyncReady(slot); - g_mount_guess_content_type(gobj(), - force_rescan, - Glib::unwrap(cancellable), - &SignalProxy_async_callback, - slot_copy); + g_mount_guess_content_type( + gobj(), force_rescan, Glib::unwrap(cancellable), &SignalProxy_async_callback, slot_copy); } -void Mount::guess_content_type(const SlotAsyncReady& slot, bool force_rescan) +void +Mount::guess_content_type(const SlotAsyncReady& slot, bool force_rescan) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. auto slot_copy = new SlotAsyncReady(slot); - g_mount_guess_content_type(gobj(), - force_rescan, - nullptr, - &SignalProxy_async_callback, - slot_copy); + g_mount_guess_content_type(gobj(), force_rescan, nullptr, &SignalProxy_async_callback, slot_copy); } -void Mount::guess_content_type(bool force_rescan) +void +Mount::guess_content_type(bool force_rescan) { - g_mount_guess_content_type(gobj(), - force_rescan, - nullptr, - nullptr, - nullptr); + g_mount_guess_content_type(gobj(), force_rescan, nullptr, nullptr, nullptr); } -void Mount::guess_content_type_sync(const Glib::RefPtr<Cancellable>& cancellable, bool force_rescan) +void +Mount::guess_content_type_sync(const Glib::RefPtr<Cancellable>& cancellable, bool force_rescan) { - GError* gerror = nullptr; - g_mount_guess_content_type_sync(gobj(), force_rescan, Glib::unwrap(cancellable), - &gerror); - if(gerror) - ::Glib::Error::throw_exception(gerror); + GError* gerror = nullptr; + g_mount_guess_content_type_sync(gobj(), force_rescan, Glib::unwrap(cancellable), &gerror); + if (gerror) + ::Glib::Error::throw_exception(gerror); } -void Mount::guess_content_type_sync(bool force_rescan) +void +Mount::guess_content_type_sync(bool force_rescan) { - GError* gerror = nullptr; - g_mount_guess_content_type_sync(gobj(), force_rescan, nullptr, &gerror); - if(gerror) - ::Glib::Error::throw_exception(gerror); + GError* gerror = nullptr; + g_mount_guess_content_type_sync(gobj(), force_rescan, nullptr, &gerror); + if (gerror) + ::Glib::Error::throw_exception(gerror); } - } // namespace Gio - diff --git a/gio/src/networkaddress.ccg b/gio/src/networkaddress.ccg index dad0dcf1..43e2d879 100644 --- a/gio/src/networkaddress.ccg +++ b/gio/src/networkaddress.ccg @@ -28,14 +28,13 @@ namespace Gio Glib::RefPtr<NetworkAddress> NetworkAddress::parse(const std::string& host_and_port, guint16 default_port) { - GError *error = nullptr; - auto *address = G_NETWORK_ADDRESS - (g_network_address_parse (host_and_port.c_str (), default_port, - &error)); - if (error) - Glib::Error::throw_exception (error); + GError* error = nullptr; + auto* address = + G_NETWORK_ADDRESS(g_network_address_parse(host_and_port.c_str(), default_port, &error)); + if (error) + Glib::Error::throw_exception(error); - return Glib::wrap (address); + return Glib::wrap(address); } } // namespace Gio diff --git a/gio/src/networkmonitor.ccg b/gio/src/networkmonitor.ccg index 550a6ac3..1b940c54 100644 --- a/gio/src/networkmonitor.ccg +++ b/gio/src/networkmonitor.ccg @@ -19,20 +19,20 @@ #include <gio/gio.h> #include "slot_async.h" -namespace Gio { +namespace Gio +{ -void NetworkMonitor::can_reach_async(const Glib::RefPtr<SocketConnectable>& connectable, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable) +void +NetworkMonitor::can_reach_async(const Glib::RefPtr<SocketConnectable>& connectable, + const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. auto slot_copy = new SlotAsyncReady(slot); - g_network_monitor_can_reach_async(gobj(), - Glib::unwrap(connectable), - Glib::unwrap(cancellable), - &SignalProxy_async_callback, - slot_copy); + g_network_monitor_can_reach_async(gobj(), Glib::unwrap(connectable), Glib::unwrap(cancellable), + &SignalProxy_async_callback, slot_copy); } } // namespace Gio diff --git a/gio/src/notification.ccg b/gio/src/notification.ccg index 05783950..3697f101 100644 --- a/gio/src/notification.ccg +++ b/gio/src/notification.ccg @@ -21,8 +21,7 @@ namespace Gio { -Notification::Notification(const Glib::ustring& title) -: _CONSTRUCT() +Notification::Notification(const Glib::ustring& title) : _CONSTRUCT() { // The title is compulsory. Don't skip it, if it's empty. set_title(title); diff --git a/gio/src/outputstream.ccg b/gio/src/outputstream.ccg index caef1eba..2f471497 100644 --- a/gio/src/outputstream.ccg +++ b/gio/src/outputstream.ccg @@ -22,126 +22,100 @@ #include <glibmm/exceptionhandler.h> #include "slot_async.h" -namespace Gio { +namespace Gio +{ void -OutputStream::write_async(const void* buffer, gsize count, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, int io_priority) +OutputStream::write_async(const void* buffer, gsize count, const SlotAsyncReady& slot, + const Glib::RefPtr<Cancellable>& cancellable, int io_priority) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. auto slot_copy = new SlotAsyncReady(slot); - g_output_stream_write_async(gobj(), - buffer, - count, - io_priority, - Glib::unwrap(cancellable), - &SignalProxy_async_callback, - slot_copy); + g_output_stream_write_async(gobj(), buffer, count, io_priority, Glib::unwrap(cancellable), + &SignalProxy_async_callback, slot_copy); } void -OutputStream::write_async(const void* buffer, gsize count, const SlotAsyncReady& slot, int io_priority) +OutputStream::write_async( + const void* buffer, gsize count, const SlotAsyncReady& slot, int io_priority) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. auto slot_copy = new SlotAsyncReady(slot); - g_output_stream_write_async(gobj(), - buffer, - count, - io_priority, - nullptr, - &SignalProxy_async_callback, - slot_copy); + g_output_stream_write_async( + gobj(), buffer, count, io_priority, nullptr, &SignalProxy_async_callback, slot_copy); } - - void -OutputStream::write_all_async(const void* buffer, gsize count, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, int io_priority) +OutputStream::write_all_async(const void* buffer, gsize count, const SlotAsyncReady& slot, + const Glib::RefPtr<Cancellable>& cancellable, int io_priority) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. auto slot_copy = new SlotAsyncReady(slot); - g_output_stream_write_all_async(gobj(), - buffer, - count, - io_priority, - Glib::unwrap(cancellable), - &SignalProxy_async_callback, - slot_copy); + g_output_stream_write_all_async(gobj(), buffer, count, io_priority, Glib::unwrap(cancellable), + &SignalProxy_async_callback, slot_copy); } void -OutputStream::write_all_async(const void* buffer, gsize count, const SlotAsyncReady& slot, int io_priority) +OutputStream::write_all_async( + const void* buffer, gsize count, const SlotAsyncReady& slot, int io_priority) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. auto slot_copy = new SlotAsyncReady(slot); - g_output_stream_write_all_async(gobj(), - buffer, - count, - io_priority, - nullptr, - &SignalProxy_async_callback, - slot_copy); + g_output_stream_write_all_async( + gobj(), buffer, count, io_priority, nullptr, &SignalProxy_async_callback, slot_copy); } - void -OutputStream::splice_async(const Glib::RefPtr<InputStream>& source, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, OutputStreamSpliceFlags flags, int io_priority) +OutputStream::splice_async(const Glib::RefPtr<InputStream>& source, const SlotAsyncReady& slot, + const Glib::RefPtr<Cancellable>& cancellable, OutputStreamSpliceFlags flags, int io_priority) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. auto slot_copy = new SlotAsyncReady(slot); - g_output_stream_splice_async(gobj(), - Glib::unwrap(source), - static_cast<GOutputStreamSpliceFlags>(flags), - io_priority, - Glib::unwrap(cancellable), - &SignalProxy_async_callback, - slot_copy); + g_output_stream_splice_async(gobj(), Glib::unwrap(source), + static_cast<GOutputStreamSpliceFlags>(flags), io_priority, Glib::unwrap(cancellable), + &SignalProxy_async_callback, slot_copy); } void -OutputStream::splice_async(const Glib::RefPtr<InputStream>& source, const SlotAsyncReady& slot, OutputStreamSpliceFlags flags, int io_priority) +OutputStream::splice_async(const Glib::RefPtr<InputStream>& source, const SlotAsyncReady& slot, + OutputStreamSpliceFlags flags, int io_priority) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. auto slot_copy = new SlotAsyncReady(slot); - g_output_stream_splice_async(gobj(), - Glib::unwrap(source), - static_cast<GOutputStreamSpliceFlags>(flags), - io_priority, - nullptr, - &SignalProxy_async_callback, - slot_copy); + g_output_stream_splice_async(gobj(), Glib::unwrap(source), + static_cast<GOutputStreamSpliceFlags>(flags), io_priority, nullptr, &SignalProxy_async_callback, + slot_copy); } void -OutputStream::flush_async(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, int io_priority) +OutputStream::flush_async( + const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, int io_priority) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. auto slot_copy = new SlotAsyncReady(slot); - g_output_stream_flush_async(gobj(), - io_priority, - Glib::unwrap(cancellable), - &SignalProxy_async_callback, - slot_copy); + g_output_stream_flush_async( + gobj(), io_priority, Glib::unwrap(cancellable), &SignalProxy_async_callback, slot_copy); } void @@ -152,26 +126,20 @@ OutputStream::flush_async(const SlotAsyncReady& slot, int io_priority) // and deleted in the callback. auto slot_copy = new SlotAsyncReady(slot); - g_output_stream_flush_async(gobj(), - io_priority, - nullptr, - &SignalProxy_async_callback, - slot_copy); + g_output_stream_flush_async(gobj(), io_priority, nullptr, &SignalProxy_async_callback, slot_copy); } void -OutputStream::close_async(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, int io_priority) +OutputStream::close_async( + const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, int io_priority) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. auto slot_copy = new SlotAsyncReady(slot); - g_output_stream_close_async(gobj(), - io_priority, - Glib::unwrap(cancellable), - &SignalProxy_async_callback, - slot_copy); + g_output_stream_close_async( + gobj(), io_priority, Glib::unwrap(cancellable), &SignalProxy_async_callback, slot_copy); } void @@ -182,101 +150,103 @@ OutputStream::close_async(const SlotAsyncReady& slot, int io_priority) // and deleted in the callback. auto slot_copy = new SlotAsyncReady(slot); - g_output_stream_close_async(gobj(), - io_priority, - nullptr, - &SignalProxy_async_callback, - slot_copy); + g_output_stream_close_async(gobj(), io_priority, nullptr, &SignalProxy_async_callback, slot_copy); } -gssize OutputStream::write(const std::string& buffer, const Glib::RefPtr<Cancellable>& cancellable) +gssize +OutputStream::write(const std::string& buffer, const Glib::RefPtr<Cancellable>& cancellable) { GError* gerror = nullptr; - gssize retvalue = g_output_stream_write(gobj(), buffer.data(), buffer.size(), Glib::unwrap(cancellable), &(gerror)); - if(gerror) + gssize retvalue = g_output_stream_write( + gobj(), buffer.data(), buffer.size(), Glib::unwrap(cancellable), &(gerror)); + if (gerror) ::Glib::Error::throw_exception(gerror); return retvalue; } -gssize OutputStream::write(const std::string& buffer) +gssize +OutputStream::write(const std::string& buffer) { GError* gerror = nullptr; gssize retvalue = g_output_stream_write(gobj(), buffer.data(), buffer.size(), nullptr, &(gerror)); - if(gerror) + if (gerror) ::Glib::Error::throw_exception(gerror); return retvalue; } -bool OutputStream::write_all(const std::string& buffer, gsize& bytes_written, const Glib::RefPtr<Cancellable>& cancellable) +bool +OutputStream::write_all( + const std::string& buffer, gsize& bytes_written, const Glib::RefPtr<Cancellable>& cancellable) { GError* gerror = nullptr; - bool retvalue = g_output_stream_write_all(gobj(), buffer.data(), buffer.size(), &(bytes_written), Glib::unwrap(cancellable), &(gerror)); - if(gerror) + bool retvalue = g_output_stream_write_all( + gobj(), buffer.data(), buffer.size(), &(bytes_written), Glib::unwrap(cancellable), &(gerror)); + if (gerror) ::Glib::Error::throw_exception(gerror); return retvalue; } -bool OutputStream::write_all(const std::string& buffer, gsize& bytes_written) +bool +OutputStream::write_all(const std::string& buffer, gsize& bytes_written) { GError* gerror = nullptr; - bool retvalue = g_output_stream_write_all(gobj(), buffer.data(), buffer.size(), &(bytes_written), nullptr, &(gerror)); - if(gerror) + bool retvalue = g_output_stream_write_all( + gobj(), buffer.data(), buffer.size(), &(bytes_written), nullptr, &(gerror)); + if (gerror) ::Glib::Error::throw_exception(gerror); return retvalue; } - void -OutputStream::write_bytes_async(const Glib::RefPtr<const Glib::Bytes>& bytes, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, int io_priority) +OutputStream::write_bytes_async(const Glib::RefPtr<const Glib::Bytes>& bytes, + const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, int io_priority) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); - g_output_stream_write_bytes_async(gobj(), - const_cast<GBytes*>(Glib::unwrap(bytes)), - io_priority, - Glib::unwrap(cancellable), - &SignalProxy_async_callback, - slot_copy); + g_output_stream_write_bytes_async(gobj(), const_cast<GBytes*>(Glib::unwrap(bytes)), io_priority, + Glib::unwrap(cancellable), &SignalProxy_async_callback, slot_copy); } void -OutputStream::write_bytes_async(const Glib::RefPtr<const Glib::Bytes>& bytes, const SlotAsyncReady& slot, int io_priority) +OutputStream::write_bytes_async( + const Glib::RefPtr<const Glib::Bytes>& bytes, const SlotAsyncReady& slot, int io_priority) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); - g_output_stream_write_bytes_async(gobj(), - const_cast<GBytes*>(Glib::unwrap(bytes)), - io_priority, - nullptr, - &SignalProxy_async_callback, - slot_copy); + g_output_stream_write_bytes_async(gobj(), const_cast<GBytes*>(Glib::unwrap(bytes)), io_priority, + nullptr, &SignalProxy_async_callback, slot_copy); } -gssize OutputStream::splice(const Glib::RefPtr<InputStream>& source, const Glib::RefPtr<Cancellable>& cancellable, OutputStreamSpliceFlags flags) +gssize +OutputStream::splice(const Glib::RefPtr<InputStream>& source, + const Glib::RefPtr<Cancellable>& cancellable, OutputStreamSpliceFlags flags) { GError* gerror = nullptr; - gssize retvalue = g_output_stream_splice(gobj(), Glib::unwrap(source), ((GOutputStreamSpliceFlags)(flags)), Glib::unwrap(cancellable), &(gerror)); - if(gerror) + gssize retvalue = g_output_stream_splice(gobj(), Glib::unwrap(source), + ((GOutputStreamSpliceFlags)(flags)), Glib::unwrap(cancellable), &(gerror)); + if (gerror) ::Glib::Error::throw_exception(gerror); return retvalue; } -gssize OutputStream::splice(const Glib::RefPtr<InputStream>& source, OutputStreamSpliceFlags flags) +gssize +OutputStream::splice(const Glib::RefPtr<InputStream>& source, OutputStreamSpliceFlags flags) { GError* gerror = nullptr; - gssize retvalue = g_output_stream_splice(gobj(), Glib::unwrap(source), ((GOutputStreamSpliceFlags)(flags)), nullptr, &(gerror)); - if(gerror) + gssize retvalue = g_output_stream_splice( + gobj(), Glib::unwrap(source), ((GOutputStreamSpliceFlags)(flags)), nullptr, &(gerror)); + if (gerror) ::Glib::Error::throw_exception(gerror); return retvalue; diff --git a/gio/src/permission.ccg b/gio/src/permission.ccg index c3debd28..69574577 100644 --- a/gio/src/permission.ccg +++ b/gio/src/permission.ccg @@ -18,7 +18,6 @@ #include <gio/gio.h> #include "slot_async.h" - namespace Gio { } // namespace Gio diff --git a/gio/src/proxy.ccg b/gio/src/proxy.ccg index c47db49e..f744a772 100644 --- a/gio/src/proxy.ccg +++ b/gio/src/proxy.ccg @@ -26,34 +26,33 @@ namespace Gio { -void Proxy::connect_async(const Glib::RefPtr<IOStream>& connection, const Glib::RefPtr<const ProxyAddress>& proxy_address, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable) +void +Proxy::connect_async(const Glib::RefPtr<IOStream>& connection, + const Glib::RefPtr<const ProxyAddress>& proxy_address, const SlotAsyncReady& slot, + const Glib::RefPtr<Cancellable>& cancellable) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. auto slot_copy = new SlotAsyncReady(slot); - g_proxy_connect_async(gobj(), - Glib::unwrap(connection), - const_cast<GProxyAddress*>(Glib::unwrap(proxy_address)), - Glib::unwrap(cancellable), - &SignalProxy_async_callback, - slot_copy); + g_proxy_connect_async(gobj(), Glib::unwrap(connection), + const_cast<GProxyAddress*>(Glib::unwrap(proxy_address)), Glib::unwrap(cancellable), + &SignalProxy_async_callback, slot_copy); } -void Proxy::connect_async(const Glib::RefPtr<IOStream>& connection, const Glib::RefPtr<const ProxyAddress>& proxy_address, const SlotAsyncReady& slot) +void +Proxy::connect_async(const Glib::RefPtr<IOStream>& connection, + const Glib::RefPtr<const ProxyAddress>& proxy_address, const SlotAsyncReady& slot) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. auto slot_copy = new SlotAsyncReady(slot); - g_proxy_connect_async(gobj(), - Glib::unwrap(connection), - const_cast<GProxyAddress*>(Glib::unwrap(proxy_address)), - nullptr, - &SignalProxy_async_callback, + g_proxy_connect_async(gobj(), Glib::unwrap(connection), + const_cast<GProxyAddress*>(Glib::unwrap(proxy_address)), nullptr, &SignalProxy_async_callback, slot_copy); } -} //namespace Gio +} // namespace Gio diff --git a/gio/src/proxyaddress.ccg b/gio/src/proxyaddress.ccg index 96aed62c..ab1fdd7b 100644 --- a/gio/src/proxyaddress.ccg +++ b/gio/src/proxyaddress.ccg @@ -22,4 +22,4 @@ namespace Gio { -} //namespace Gio +} // namespace Gio diff --git a/gio/src/proxyresolver.ccg b/gio/src/proxyresolver.ccg index 1f67a9b8..f9303e35 100644 --- a/gio/src/proxyresolver.ccg +++ b/gio/src/proxyresolver.ccg @@ -27,43 +27,41 @@ namespace Gio { -std::vector<Glib::ustring> ProxyResolver::lookup(const Glib::ustring& uri) +std::vector<Glib::ustring> +ProxyResolver::lookup(const Glib::ustring& uri) { GError* gerror = nullptr; - auto retvalue = - Glib::ArrayHandler<Glib::ustring>::array_to_vector(g_proxy_resolver_lookup(gobj(), uri.c_str(), nullptr, &(gerror)), Glib::OWNERSHIP_DEEP); - if(gerror) + auto retvalue = Glib::ArrayHandler<Glib::ustring>::array_to_vector( + g_proxy_resolver_lookup(gobj(), uri.c_str(), nullptr, &(gerror)), Glib::OWNERSHIP_DEEP); + if (gerror) ::Glib::Error::throw_exception(gerror); return retvalue; } -void ProxyResolver::lookup_async(const Glib::ustring& uri, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable) +void +ProxyResolver::lookup_async(const Glib::ustring& uri, const SlotAsyncReady& slot, + const Glib::RefPtr<Cancellable>& cancellable) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. auto slot_copy = new SlotAsyncReady(slot); - g_proxy_resolver_lookup_async(gobj(), - uri.c_str(), - Glib::unwrap(cancellable), - &SignalProxy_async_callback, - slot_copy); + g_proxy_resolver_lookup_async( + gobj(), uri.c_str(), Glib::unwrap(cancellable), &SignalProxy_async_callback, slot_copy); } -void ProxyResolver::lookup_async(const Glib::ustring& uri, const SlotAsyncReady& slot) +void +ProxyResolver::lookup_async(const Glib::ustring& uri, const SlotAsyncReady& slot) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. auto slot_copy = new SlotAsyncReady(slot); - g_proxy_resolver_lookup_async(gobj(), - uri.c_str(), - nullptr, - &SignalProxy_async_callback, - slot_copy); + g_proxy_resolver_lookup_async( + gobj(), uri.c_str(), nullptr, &SignalProxy_async_callback, slot_copy); } -} //namespace Gio +} // namespace Gio diff --git a/gio/src/resolver.ccg b/gio/src/resolver.ccg index 60d329d8..093f6981 100644 --- a/gio/src/resolver.ccg +++ b/gio/src/resolver.ccg @@ -22,166 +22,127 @@ namespace Gio { -Glib::RefPtr<Resolver> Resolver::get_default() +Glib::RefPtr<Resolver> +Resolver::get_default() { - return Glib::wrap(g_resolver_get_default()); + return Glib::wrap(g_resolver_get_default()); } -void Resolver::set_default(const Glib::RefPtr<Resolver>& resolver) +void +Resolver::set_default(const Glib::RefPtr<Resolver>& resolver) { - g_resolver_set_default(Glib::unwrap(resolver)); + g_resolver_set_default(Glib::unwrap(resolver)); } void -Resolver::lookup_by_name_async(const Glib::ustring& hostname, - const SlotAsyncReady& slot, - const Glib::RefPtr<Cancellable>& cancellable) +Resolver::lookup_by_name_async(const Glib::ustring& hostname, const SlotAsyncReady& slot, + const Glib::RefPtr<Cancellable>& cancellable) { auto slot_copy = new SlotAsyncReady(slot); - g_resolver_lookup_by_name_async (gobj(), - hostname.c_str(), - Glib::unwrap(cancellable), - &SignalProxy_async_callback, - slot_copy); + g_resolver_lookup_by_name_async( + gobj(), hostname.c_str(), Glib::unwrap(cancellable), &SignalProxy_async_callback, slot_copy); } void -Resolver::lookup_by_name_async(const Glib::ustring& hostname, - const SlotAsyncReady& slot) +Resolver::lookup_by_name_async(const Glib::ustring& hostname, const SlotAsyncReady& slot) { auto slot_copy = new SlotAsyncReady(slot); - g_resolver_lookup_by_name_async (gobj(), - hostname.c_str(), - nullptr, - &SignalProxy_async_callback, - slot_copy); + g_resolver_lookup_by_name_async( + gobj(), hostname.c_str(), nullptr, &SignalProxy_async_callback, slot_copy); } void Resolver::lookup_by_address_async(const Glib::RefPtr<InetAddress>& address, - const SlotAsyncReady& slot, - const Glib::RefPtr<Cancellable>& cancellable) + const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable) { auto slot_copy = new SlotAsyncReady(slot); - g_resolver_lookup_by_address_async (gobj(), - Glib::unwrap(address), - Glib::unwrap(cancellable), - &SignalProxy_async_callback, - slot_copy); + g_resolver_lookup_by_address_async(gobj(), Glib::unwrap(address), Glib::unwrap(cancellable), + &SignalProxy_async_callback, slot_copy); } void -Resolver::lookup_by_address_async(const Glib::RefPtr<InetAddress>& address, - const SlotAsyncReady& slot) +Resolver::lookup_by_address_async( + const Glib::RefPtr<InetAddress>& address, const SlotAsyncReady& slot) { auto slot_copy = new SlotAsyncReady(slot); - g_resolver_lookup_by_address_async (gobj(), - Glib::unwrap(address), - nullptr, - &SignalProxy_async_callback, - slot_copy); + g_resolver_lookup_by_address_async( + gobj(), Glib::unwrap(address), nullptr, &SignalProxy_async_callback, slot_copy); } void -Resolver::lookup_service_async(const Glib::ustring& service, - const Glib::ustring& protocol, - const Glib::ustring& domain, - const SlotAsyncReady& slot, - const Glib::RefPtr<Cancellable>& cancellable) +Resolver::lookup_service_async(const Glib::ustring& service, const Glib::ustring& protocol, + const Glib::ustring& domain, const SlotAsyncReady& slot, + const Glib::RefPtr<Cancellable>& cancellable) { auto slot_copy = new SlotAsyncReady(slot); - g_resolver_lookup_service_async (gobj(), - service.c_str(), - protocol.c_str(), - domain.c_str(), - Glib::unwrap(cancellable), - &SignalProxy_async_callback, - slot_copy); + g_resolver_lookup_service_async(gobj(), service.c_str(), protocol.c_str(), domain.c_str(), + Glib::unwrap(cancellable), &SignalProxy_async_callback, slot_copy); } void -Resolver::lookup_service_async(const Glib::ustring& service, - const Glib::ustring& protocol, - const Glib::ustring& domain, - const SlotAsyncReady& slot) +Resolver::lookup_service_async(const Glib::ustring& service, const Glib::ustring& protocol, + const Glib::ustring& domain, const SlotAsyncReady& slot) { auto slot_copy = new SlotAsyncReady(slot); - g_resolver_lookup_service_async (gobj(), - service.c_str(), - protocol.c_str(), - domain.c_str(), - nullptr, - &SignalProxy_async_callback, - slot_copy); + g_resolver_lookup_service_async(gobj(), service.c_str(), protocol.c_str(), domain.c_str(), + nullptr, &SignalProxy_async_callback, slot_copy); } void -Resolver::lookup_records_async(const Glib::ustring& rrname, - ResolverRecordType record_type, - const SlotAsyncReady& slot, - const Glib::RefPtr<Cancellable>& cancellable) +Resolver::lookup_records_async(const Glib::ustring& rrname, ResolverRecordType record_type, + const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable) { auto slot_copy = new SlotAsyncReady(slot); - g_resolver_lookup_records_async(gobj(), - Glib::c_str_or_nullptr(rrname), - static_cast<GResolverRecordType>(record_type), - Glib::unwrap(cancellable), - &SignalProxy_async_callback, - slot_copy); + g_resolver_lookup_records_async(gobj(), Glib::c_str_or_nullptr(rrname), + static_cast<GResolverRecordType>(record_type), Glib::unwrap(cancellable), + &SignalProxy_async_callback, slot_copy); } void -Resolver::lookup_records_async(const Glib::ustring& rrname, - ResolverRecordType record_type, - const SlotAsyncReady& slot) +Resolver::lookup_records_async( + const Glib::ustring& rrname, ResolverRecordType record_type, const SlotAsyncReady& slot) { auto slot_copy = new SlotAsyncReady(slot); - g_resolver_lookup_records_async(gobj(), - Glib::c_str_or_nullptr(rrname), - static_cast<GResolverRecordType>(record_type), - nullptr, - &SignalProxy_async_callback, - slot_copy); + g_resolver_lookup_records_async(gobj(), Glib::c_str_or_nullptr(rrname), + static_cast<GResolverRecordType>(record_type), nullptr, &SignalProxy_async_callback, slot_copy); } std::string -hostname_to_ascii (const Glib::ustring& hostname) +hostname_to_ascii(const Glib::ustring& hostname) { - return Glib::convert_return_gchar_ptr_to_stdstring - (g_hostname_to_ascii (hostname.c_str ())); + return Glib::convert_return_gchar_ptr_to_stdstring(g_hostname_to_ascii(hostname.c_str())); } Glib::ustring -hostname_to_unicode (const Glib::ustring& hostname) +hostname_to_unicode(const Glib::ustring& hostname) { - return Glib::convert_return_gchar_ptr_to_ustring - (g_hostname_to_unicode (hostname.c_str ())); + return Glib::convert_return_gchar_ptr_to_ustring(g_hostname_to_unicode(hostname.c_str())); } bool -hostname_is_non_ascii (const Glib::ustring& hostname) +hostname_is_non_ascii(const Glib::ustring& hostname) { - return g_hostname_is_non_ascii (hostname.c_str ()); + return g_hostname_is_non_ascii(hostname.c_str()); } bool -hostname_is_ascii_encoded (const Glib::ustring& hostname) +hostname_is_ascii_encoded(const Glib::ustring& hostname) { - return g_hostname_is_ascii_encoded (hostname.c_str ()); + return g_hostname_is_ascii_encoded(hostname.c_str()); } bool -hostname_is_ip_address (const Glib::ustring& hostname) +hostname_is_ip_address(const Glib::ustring& hostname) { - return g_hostname_is_ip_address (hostname.c_str ()); + return g_hostname_is_ip_address(hostname.c_str()); } -} //namespace Gio +} // namespace Gio diff --git a/gio/src/resource.ccg b/gio/src/resource.ccg index f8401000..0c7a599b 100644 --- a/gio/src/resource.ccg +++ b/gio/src/resource.ccg @@ -20,8 +20,9 @@ namespace Gio { // Hand-coded because we want ResourceFlags& instead of guint32&. -void Resource::get_info(const std::string& path, gsize& size, - ResourceFlags& flags, ResourceLookupFlags lookup_flags) const +void +Resource::get_info(const std::string& path, gsize& size, ResourceFlags& flags, + ResourceLookupFlags lookup_flags) const { guint32 file_flags = 0; GError* gerror = nullptr; @@ -34,7 +35,8 @@ void Resource::get_info(const std::string& path, gsize& size, flags = static_cast<ResourceFlags>(file_flags); } -void Resource::get_file_exists(const std::string& path, ResourceLookupFlags lookup_flags) const +void +Resource::get_file_exists(const std::string& path, ResourceLookupFlags lookup_flags) const { GError* gerror = nullptr; g_resource_get_info(const_cast<GResource*>(gobj()), path.c_str(), @@ -43,42 +45,46 @@ void Resource::get_file_exists(const std::string& path, ResourceLookupFlags look ::Glib::Error::throw_exception(gerror); } -bool Resource::get_file_exists_nothrow(const std::string& path, ResourceLookupFlags lookup_flags) const +bool +Resource::get_file_exists_nothrow(const std::string& path, ResourceLookupFlags lookup_flags) const { return g_resource_get_info(const_cast<GResource*>(gobj()), path.c_str(), (GResourceLookupFlags)lookup_flags, nullptr, nullptr, nullptr); } // Hand-coded because we want ResourceFlags& instead of guint32&. -//static -void Resource::get_info_global(const std::string& path, gsize& size, - ResourceFlags& flags, ResourceLookupFlags lookup_flags) +// static +void +Resource::get_info_global( + const std::string& path, gsize& size, ResourceFlags& flags, ResourceLookupFlags lookup_flags) { guint32 file_flags = 0; GError* gerror = nullptr; // Ignore the gboolean return value from g_resources_get_info(). // gerror is set if and only if the return value is FALSE. - g_resources_get_info(path.c_str(), - (GResourceLookupFlags)lookup_flags, &size, &file_flags, &gerror); + g_resources_get_info( + path.c_str(), (GResourceLookupFlags)lookup_flags, &size, &file_flags, &gerror); if (gerror) ::Glib::Error::throw_exception(gerror); flags = static_cast<ResourceFlags>(file_flags); } -//static -void Resource::get_file_exists_global(const std::string& path, ResourceLookupFlags lookup_flags) +// static +void +Resource::get_file_exists_global(const std::string& path, ResourceLookupFlags lookup_flags) { GError* gerror = nullptr; - g_resources_get_info(path.c_str(), - (GResourceLookupFlags)lookup_flags, nullptr, nullptr, &gerror); + g_resources_get_info(path.c_str(), (GResourceLookupFlags)lookup_flags, nullptr, nullptr, &gerror); if (gerror) ::Glib::Error::throw_exception(gerror); } -//static -bool Resource::get_file_exists_global_nothrow(const std::string& path, ResourceLookupFlags lookup_flags) +// static +bool +Resource::get_file_exists_global_nothrow(const std::string& path, ResourceLookupFlags lookup_flags) { - return g_resources_get_info(path.c_str(), (GResourceLookupFlags)lookup_flags, nullptr, nullptr, nullptr); + return g_resources_get_info( + path.c_str(), (GResourceLookupFlags)lookup_flags, nullptr, nullptr, nullptr); } } // namespace Gio diff --git a/gio/src/seekable.ccg b/gio/src/seekable.ccg index 193bbeb8..43f4afea 100644 --- a/gio/src/seekable.ccg +++ b/gio/src/seekable.ccg @@ -23,4 +23,3 @@ namespace Gio { } // namespace Gio - diff --git a/gio/src/settings.ccg b/gio/src/settings.ccg index 98b6ccd4..3ec86919 100644 --- a/gio/src/settings.ccg +++ b/gio/src/settings.ccg @@ -22,54 +22,58 @@ namespace Gio { -void Settings::get_value(const Glib::ustring& key, Glib::VariantBase& value) const +void +Settings::get_value(const Glib::ustring& key, Glib::VariantBase& value) const { const auto g_value = g_settings_get_value(const_cast<GSettings*>(gobj()), key.c_str()); - if(!g_value) + if (!g_value) return; value.init(g_value, false /* don't take a reference */); } -bool Settings::get_user_value(const Glib::ustring& key, Glib::VariantBase& value) const +bool +Settings::get_user_value(const Glib::ustring& key, Glib::VariantBase& value) const { const auto g_value = g_settings_get_user_value(const_cast<GSettings*>(gobj()), key.c_str()); - if(!g_value) + if (!g_value) return false; value.init(g_value, false /* don't take a reference */); return true; } -void Settings::get_default_value(const Glib::ustring& key, Glib::VariantBase& value) const +void +Settings::get_default_value(const Glib::ustring& key, Glib::VariantBase& value) const { const auto g_value = g_settings_get_default_value(const_cast<GSettings*>(gobj()), key.c_str()); - if(!g_value) + if (!g_value) return; value.init(g_value, false /* don't take a reference */); } -void Settings::bind(const Glib::ustring& key, - const Glib::PropertyProxy_Base& property_proxy, - SettingsBindFlags flags) +void +Settings::bind( + const Glib::ustring& key, const Glib::PropertyProxy_Base& property_proxy, SettingsBindFlags flags) { - bind(key, property_proxy.get_object(), property_proxy.get_name(), flags); + bind(key, property_proxy.get_object(), property_proxy.get_name(), flags); } -void Settings::bind_writable(const Glib::ustring& key, - const Glib::PropertyProxy_Base& property_proxy, - bool inverted) +void +Settings::bind_writable( + const Glib::ustring& key, const Glib::PropertyProxy_Base& property_proxy, bool inverted) { - bind_writable(key, property_proxy.get_object(), property_proxy.get_name(), inverted); + bind_writable(key, property_proxy.get_object(), property_proxy.get_name(), inverted); } _DEPRECATE_IFDEF_START G_GNUC_BEGIN_IGNORE_DEPRECATIONS -std::vector<Glib::ustring> Settings::list_schemas() +std::vector<Glib::ustring> +Settings::list_schemas() { - return Glib::ArrayHandler<Glib::ustring>::array_to_vector(g_settings_list_schemas(), Glib::OWNERSHIP_NONE); + return Glib::ArrayHandler<Glib::ustring>::array_to_vector( + g_settings_list_schemas(), Glib::OWNERSHIP_NONE); } G_GNUC_END_IGNORE_DEPRECATIONS _DEPRECATE_IFDEF_END - } diff --git a/gio/src/settingsschema.ccg b/gio/src/settingsschema.ccg index a8ef5d43..27d1a1ee 100644 --- a/gio/src/settingsschema.ccg +++ b/gio/src/settingsschema.ccg @@ -20,4 +20,4 @@ namespace Gio { -} //namespace Gio +} // namespace Gio diff --git a/gio/src/settingsschemakey.ccg b/gio/src/settingsschemakey.ccg index a8ef5d43..27d1a1ee 100644 --- a/gio/src/settingsschemakey.ccg +++ b/gio/src/settingsschemakey.ccg @@ -20,4 +20,4 @@ namespace Gio { -} //namespace Gio +} // namespace Gio diff --git a/gio/src/settingsschemasource.ccg b/gio/src/settingsschemasource.ccg index a8ef5d43..27d1a1ee 100644 --- a/gio/src/settingsschemasource.ccg +++ b/gio/src/settingsschemasource.ccg @@ -20,4 +20,4 @@ namespace Gio { -} //namespace Gio +} // namespace Gio diff --git a/gio/src/simpleaction.ccg b/gio/src/simpleaction.ccg index 2b91ecf1..42b236e7 100644 --- a/gio/src/simpleaction.ccg +++ b/gio/src/simpleaction.ccg @@ -22,32 +22,36 @@ namespace Gio { -SimpleAction::SimpleAction(const Glib::ustring& name) -: - _CONSTRUCT("name", name.c_str()) -{} +SimpleAction::SimpleAction(const Glib::ustring& name) : _CONSTRUCT("name", name.c_str()) +{ +} SimpleAction::SimpleAction(const Glib::ustring& name, const Glib::VariantBase& state) -: - _CONSTRUCT("name", name.c_str(), "state", const_cast<GVariant*>((state).gobj())) -{} +: _CONSTRUCT("name", name.c_str(), "state", const_cast<GVariant*>((state).gobj())) +{ +} -Glib::RefPtr<SimpleAction> SimpleAction::create_bool(const Glib::ustring& name, bool state) +Glib::RefPtr<SimpleAction> +SimpleAction::create_bool(const Glib::ustring& name, bool state) { - //We must provide some initial state, as a way to specify the type of the state. + // We must provide some initial state, as a way to specify the type of the state. return create(name, Glib::Variant<bool>::create(state)); } - -Glib::RefPtr<SimpleAction> SimpleAction::create_radio_string(const Glib::ustring& name, const Glib::ustring& initial_state) +Glib::RefPtr<SimpleAction> +SimpleAction::create_radio_string(const Glib::ustring& name, const Glib::ustring& initial_state) { - //See https://developer.gnome.org/glib/stable/gvariant-format-strings.html#gvariant-format-strings-strings - return create(name, Glib::VARIANT_TYPE_STRING, Glib::Variant<Glib::ustring>::create(initial_state)); + // See + // https://developer.gnome.org/glib/stable/gvariant-format-strings.html#gvariant-format-strings-strings + return create( + name, Glib::VARIANT_TYPE_STRING, Glib::Variant<Glib::ustring>::create(initial_state)); } -Glib::RefPtr<SimpleAction> SimpleAction::create_radio_integer(const Glib::ustring& name, gint32 initial_state) +Glib::RefPtr<SimpleAction> +SimpleAction::create_radio_integer(const Glib::ustring& name, gint32 initial_state) { - //See https://developer.gnome.org/glib/stable/gvariant-format-strings.html#gvariant-format-strings-numeric-types + // See + // https://developer.gnome.org/glib/stable/gvariant-format-strings.html#gvariant-format-strings-numeric-types return create(name, Glib::VARIANT_TYPE_INT32, Glib::Variant<gint32>::create(initial_state)); } diff --git a/gio/src/simpleactiongroup.ccg b/gio/src/simpleactiongroup.ccg index cd3e297a..3a802518 100644 --- a/gio/src/simpleactiongroup.ccg +++ b/gio/src/simpleactiongroup.ccg @@ -21,4 +21,4 @@ namespace Gio { -}// namespace Gio +} // namespace Gio diff --git a/gio/src/simplepermission.ccg b/gio/src/simplepermission.ccg index c22ac8b2..e627cda1 100644 --- a/gio/src/simplepermission.ccg +++ b/gio/src/simplepermission.ccg @@ -17,7 +17,6 @@ #include <gio/gio.h> - namespace Gio { } // namespace Gio diff --git a/gio/src/socket.ccg b/gio/src/socket.ccg index a7e0ff69..6dfd71ee 100644 --- a/gio/src/socket.ccg +++ b/gio/src/socket.ccg @@ -27,86 +27,92 @@ namespace Gio { Socket::Socket(SocketFamily family, SocketType type, SocketProtocol protocol, - const Glib::RefPtr<Cancellable>& cancellable) -: - _CONSTRUCT("family", int(family), "type", int(type), "protocol", int(protocol)) + const Glib::RefPtr<Cancellable>& cancellable) +: _CONSTRUCT("family", int(family), "type", int(type), "protocol", int(protocol)) { init(cancellable); } -Socket::Socket(int fd, const Glib::RefPtr<Cancellable>& cancellable) -: - _CONSTRUCT("fd", fd) +Socket::Socket(int fd, const Glib::RefPtr<Cancellable>& cancellable) : _CONSTRUCT("fd", fd) { init(cancellable); } // static -Glib::RefPtr<Socket> Socket::create(SocketFamily family, SocketType type, SocketProtocol protocol, - const Glib::RefPtr<Cancellable>& cancellable) +Glib::RefPtr<Socket> +Socket::create(SocketFamily family, SocketType type, SocketProtocol protocol, + const Glib::RefPtr<Cancellable>& cancellable) { return Glib::RefPtr<Socket>(new Socket(family, type, protocol, cancellable)); } // static -Glib::RefPtr<Socket> Socket::create_from_fd(int fd, const Glib::RefPtr<Cancellable>& cancellable) +Glib::RefPtr<Socket> +Socket::create_from_fd(int fd, const Glib::RefPtr<Cancellable>& cancellable) { return Glib::RefPtr<Socket>(new Socket(fd, cancellable)); } -gssize Socket::receive_from(Glib::RefPtr<SocketAddress>& address, char* buffer, gsize size, const Glib::RefPtr<Cancellable>& cancellable) +gssize +Socket::receive_from(Glib::RefPtr<SocketAddress>& address, char* buffer, gsize size, + const Glib::RefPtr<Cancellable>& cancellable) { GError* gerror = nullptr; GSocketAddress* caddr = nullptr; - auto retvalue = g_socket_receive_from(gobj(), &caddr, buffer, size, const_cast<GCancellable*>(Glib::unwrap(cancellable)), &(gerror)); - if(gerror) + auto retvalue = g_socket_receive_from( + gobj(), &caddr, buffer, size, const_cast<GCancellable*>(Glib::unwrap(cancellable)), &(gerror)); + if (gerror) ::Glib::Error::throw_exception(gerror); if (caddr) - address = Glib::wrap (caddr); + address = Glib::wrap(caddr); return retvalue; } -gssize Socket::receive_from(Glib::RefPtr<SocketAddress>& address, char* buffer, gsize size) +gssize +Socket::receive_from(Glib::RefPtr<SocketAddress>& address, char* buffer, gsize size) { GError* gerror = nullptr; GSocketAddress* caddr = nullptr; auto retvalue = g_socket_receive_from(gobj(), &caddr, buffer, size, nullptr, &(gerror)); - if(gerror) + if (gerror) ::Glib::Error::throw_exception(gerror); if (caddr) - address = Glib::wrap (caddr); + address = Glib::wrap(caddr); return retvalue; } -gssize Socket::receive_with_blocking(gchar* buffer, gsize size, bool blocking, - const Glib::RefPtr<Cancellable>& cancellable) +gssize +Socket::receive_with_blocking( + gchar* buffer, gsize size, bool blocking, const Glib::RefPtr<Cancellable>& cancellable) { GError* gerror = nullptr; - const auto retvalue = g_socket_receive_with_blocking(gobj(), buffer, size, - blocking, Glib::unwrap(cancellable), &(gerror)); - if(gerror) + const auto retvalue = g_socket_receive_with_blocking( + gobj(), buffer, size, blocking, Glib::unwrap(cancellable), &(gerror)); + if (gerror) ::Glib::Error::throw_exception(gerror); return retvalue; } -gssize Socket::send_with_blocking(gchar* buffer, gsize size, bool blocking, - const Glib::RefPtr<Cancellable>& cancellable) +gssize +Socket::send_with_blocking( + gchar* buffer, gsize size, bool blocking, const Glib::RefPtr<Cancellable>& cancellable) { GError* gerror = nullptr; - const auto retvalue = g_socket_send_with_blocking(gobj(), buffer, size, - blocking, Glib::unwrap(cancellable), &(gerror)); - if(gerror) + const auto retvalue = g_socket_send_with_blocking( + gobj(), buffer, size, blocking, Glib::unwrap(cancellable), &(gerror)); + if (gerror) ::Glib::Error::throw_exception(gerror); return retvalue; } -Glib::RefPtr<SocketSource> Socket::create_source(Glib::IOCondition condition, const Glib::RefPtr<Cancellable>& cancellable) +Glib::RefPtr<SocketSource> +Socket::create_source(Glib::IOCondition condition, const Glib::RefPtr<Cancellable>& cancellable) { // The corresponding unreference() takes place in the dtor // of the Glib::RefPtr<Socket> object below. diff --git a/gio/src/socketaddressenumerator.ccg b/gio/src/socketaddressenumerator.ccg index d7aca9b6..405773f5 100644 --- a/gio/src/socketaddressenumerator.ccg +++ b/gio/src/socketaddressenumerator.ccg @@ -22,21 +22,20 @@ #include <giomm/socketaddress.h> #include "slot_async.h" -namespace Gio { +namespace Gio +{ - void - SocketAddressEnumerator::next_async(const Glib::RefPtr<Cancellable>& cancellable, - const SlotAsyncReady& slot) - { - // Create a copy of the slot. - // A pointer to it will be passed through the callback's data parameter - // and deleted in the callback. - auto slot_copy = new SlotAsyncReady(slot); +void +SocketAddressEnumerator::next_async( + const Glib::RefPtr<Cancellable>& cancellable, const SlotAsyncReady& slot) +{ + // Create a copy of the slot. + // A pointer to it will be passed through the callback's data parameter + // and deleted in the callback. + auto slot_copy = new SlotAsyncReady(slot); - g_socket_address_enumerator_next_async(gobj(), - Glib::unwrap(cancellable), - &SignalProxy_async_callback, - slot_copy); - } + g_socket_address_enumerator_next_async( + gobj(), Glib::unwrap(cancellable), &SignalProxy_async_callback, slot_copy); +} } // namespace Gio diff --git a/gio/src/socketclient.ccg b/gio/src/socketclient.ccg index e2793826..c3ec6f05 100644 --- a/gio/src/socketclient.ccg +++ b/gio/src/socketclient.ccg @@ -26,143 +26,106 @@ namespace Gio void SocketClient::connect_async(const Glib::RefPtr<SocketConnectable>& connectable, - const Glib::RefPtr<Cancellable>& cancellable, - const SlotAsyncReady& slot) + const Glib::RefPtr<Cancellable>& cancellable, const SlotAsyncReady& slot) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. auto slot_copy = new SlotAsyncReady(slot); - g_socket_client_connect_async (gobj(), - connectable->gobj (), - Glib::unwrap(cancellable), - &SignalProxy_async_callback, - slot_copy); + g_socket_client_connect_async( + gobj(), connectable->gobj(), Glib::unwrap(cancellable), &SignalProxy_async_callback, slot_copy); } void -SocketClient::connect_async(const Glib::RefPtr<SocketConnectable>& connectable, - const SlotAsyncReady& slot) +SocketClient::connect_async( + const Glib::RefPtr<SocketConnectable>& connectable, const SlotAsyncReady& slot) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. auto slot_copy = new SlotAsyncReady(slot); - g_socket_client_connect_async (gobj(), - connectable->gobj (), - nullptr, - &SignalProxy_async_callback, - slot_copy); + g_socket_client_connect_async( + gobj(), connectable->gobj(), nullptr, &SignalProxy_async_callback, slot_copy); } void -SocketClient::connect_to_host_async(const Glib::ustring& host_and_port, - guint16 default_port, - const Glib::RefPtr<Cancellable>& cancellable, - const SlotAsyncReady& slot) +SocketClient::connect_to_host_async(const Glib::ustring& host_and_port, guint16 default_port, + const Glib::RefPtr<Cancellable>& cancellable, const SlotAsyncReady& slot) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. auto slot_copy = new SlotAsyncReady(slot); - g_socket_client_connect_to_host_async (gobj(), - host_and_port.c_str (), - default_port, - Glib::unwrap(cancellable), - &SignalProxy_async_callback, - slot_copy); + g_socket_client_connect_to_host_async(gobj(), host_and_port.c_str(), default_port, + Glib::unwrap(cancellable), &SignalProxy_async_callback, slot_copy); } void -SocketClient::connect_to_host_async(const Glib::ustring& host_and_port, - guint16 default_port, - const SlotAsyncReady& slot) +SocketClient::connect_to_host_async( + const Glib::ustring& host_and_port, guint16 default_port, const SlotAsyncReady& slot) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. auto slot_copy = new SlotAsyncReady(slot); - g_socket_client_connect_to_host_async (gobj(), - host_and_port.c_str (), - default_port, - nullptr, - &SignalProxy_async_callback, - slot_copy); + g_socket_client_connect_to_host_async( + gobj(), host_and_port.c_str(), default_port, nullptr, &SignalProxy_async_callback, slot_copy); } void -SocketClient::connect_to_service_async(const Glib::ustring& domain, - const Glib::ustring& service, - const Glib::RefPtr<Cancellable>& cancellable, - const SlotAsyncReady& slot) +SocketClient::connect_to_service_async(const Glib::ustring& domain, const Glib::ustring& service, + const Glib::RefPtr<Cancellable>& cancellable, const SlotAsyncReady& slot) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. auto slot_copy = new SlotAsyncReady(slot); - g_socket_client_connect_to_service_async (gobj(), - domain.c_str (), - service.c_str (), - Glib::unwrap(cancellable), - &SignalProxy_async_callback, - slot_copy); + g_socket_client_connect_to_service_async(gobj(), domain.c_str(), service.c_str(), + Glib::unwrap(cancellable), &SignalProxy_async_callback, slot_copy); } void -SocketClient::connect_to_service_async(const Glib::ustring& domain, - const Glib::ustring& service, - const SlotAsyncReady& slot) +SocketClient::connect_to_service_async( + const Glib::ustring& domain, const Glib::ustring& service, const SlotAsyncReady& slot) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. auto slot_copy = new SlotAsyncReady(slot); - g_socket_client_connect_to_service_async (gobj(), - domain.c_str (), - service.c_str (), - nullptr, - &SignalProxy_async_callback, - slot_copy); + g_socket_client_connect_to_service_async( + gobj(), domain.c_str(), service.c_str(), nullptr, &SignalProxy_async_callback, slot_copy); } void SocketClient::connect_to_uri_async(const Glib::ustring& uri, guint16 default_port, - const Glib::RefPtr<Cancellable>& cancellable, - const SlotAsyncReady& slot) + const Glib::RefPtr<Cancellable>& cancellable, const SlotAsyncReady& slot) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. auto slot_copy = new SlotAsyncReady(slot); - g_socket_client_connect_to_uri_async (gobj(), - uri.c_str(), default_port, - Glib::unwrap(cancellable), - &SignalProxy_async_callback, - slot_copy); + g_socket_client_connect_to_uri_async(gobj(), uri.c_str(), default_port, Glib::unwrap(cancellable), + &SignalProxy_async_callback, slot_copy); } void -SocketClient::connect_to_uri_async(const Glib::ustring& uri, guint16 default_port, - const SlotAsyncReady& slot) +SocketClient::connect_to_uri_async( + const Glib::ustring& uri, guint16 default_port, const SlotAsyncReady& slot) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. auto slot_copy = new SlotAsyncReady(slot); - g_socket_client_connect_to_uri_async (gobj(), - uri.c_str(), default_port, - nullptr, - &SignalProxy_async_callback, - slot_copy); + g_socket_client_connect_to_uri_async( + gobj(), uri.c_str(), default_port, nullptr, &SignalProxy_async_callback, slot_copy); } - } // namespace Gio diff --git a/gio/src/socketconnectable.ccg b/gio/src/socketconnectable.ccg index 27f8f0c1..0f94c186 100644 --- a/gio/src/socketconnectable.ccg +++ b/gio/src/socketconnectable.ccg @@ -19,5 +19,6 @@ #include <gio/gio.h> -namespace Gio { +namespace Gio +{ } // namespace Gio diff --git a/gio/src/socketconnection.ccg b/gio/src/socketconnection.ccg index fcda9954..4c71d8f2 100644 --- a/gio/src/socketconnection.ccg +++ b/gio/src/socketconnection.ccg @@ -25,29 +25,22 @@ namespace Gio void SocketConnection::connect_async(const Glib::RefPtr<SocketAddress>& address, - const SlotAsyncReady& slot, - const Glib::RefPtr<Cancellable>& cancellable) + const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable) { auto slot_copy = new SlotAsyncReady(slot); - g_socket_connection_connect_async(gobj(), - Glib::unwrap(address), - Glib::unwrap(cancellable), - &SignalProxy_async_callback, - slot_copy); + g_socket_connection_connect_async(gobj(), Glib::unwrap(address), Glib::unwrap(cancellable), + &SignalProxy_async_callback, slot_copy); } void -SocketConnection::connect_async(const Glib::RefPtr<SocketAddress>& address, - const SlotAsyncReady& slot) +SocketConnection::connect_async( + const Glib::RefPtr<SocketAddress>& address, const SlotAsyncReady& slot) { auto slot_copy = new SlotAsyncReady(slot); - g_socket_connection_connect_async(gobj(), - Glib::unwrap(address), - nullptr, - &SignalProxy_async_callback, - slot_copy); + g_socket_connection_connect_async( + gobj(), Glib::unwrap(address), nullptr, &SignalProxy_async_callback, slot_copy); } } // namespace Gio diff --git a/gio/src/socketlistener.ccg b/gio/src/socketlistener.ccg index afcad2cd..08ba099e 100644 --- a/gio/src/socketlistener.ccg +++ b/gio/src/socketlistener.ccg @@ -23,312 +23,282 @@ namespace Gio { -bool SocketListener::add_socket(const Glib::RefPtr<Socket>& socket) +bool +SocketListener::add_socket(const Glib::RefPtr<Socket>& socket) { GError* gerror = nullptr; - const bool retval = g_socket_listener_add_socket(gobj(), - Glib::unwrap(socket), - nullptr, - &gerror); + const bool retval = g_socket_listener_add_socket(gobj(), Glib::unwrap(socket), nullptr, &gerror); - if(gerror) + if (gerror) ::Glib::Error::throw_exception(gerror); return retval; } - -bool SocketListener::add_address(const Glib::RefPtr<SocketAddress>& address, SocketType type, SocketProtocol protocol, const Glib::RefPtr<Glib::Object>& source_object, Glib::RefPtr<SocketAddress>& effective_address) +bool +SocketListener::add_address(const Glib::RefPtr<SocketAddress>& address, SocketType type, + SocketProtocol protocol, const Glib::RefPtr<Glib::Object>& source_object, + Glib::RefPtr<SocketAddress>& effective_address) { GError* gerror = nullptr; - GSocketAddress *retaddr = nullptr; - const bool retval = g_socket_listener_add_address (gobj(), - Glib::unwrap(address), - static_cast<GSocketType>(type), - static_cast<GSocketProtocol>(protocol), - Glib::unwrap(source_object), - &retaddr, - &gerror); - if(gerror) + GSocketAddress* retaddr = nullptr; + const bool retval = + g_socket_listener_add_address(gobj(), Glib::unwrap(address), static_cast<GSocketType>(type), + static_cast<GSocketProtocol>(protocol), Glib::unwrap(source_object), &retaddr, &gerror); + if (gerror) ::Glib::Error::throw_exception(gerror); - if(retaddr) + if (retaddr) effective_address = Glib::wrap(retaddr); return retval; } -bool SocketListener::add_address(const Glib::RefPtr<SocketAddress>& address, SocketType type, SocketProtocol protocol, Glib::RefPtr<SocketAddress>& effective_address) +bool +SocketListener::add_address(const Glib::RefPtr<SocketAddress>& address, SocketType type, + SocketProtocol protocol, Glib::RefPtr<SocketAddress>& effective_address) { GError* gerror = nullptr; - GSocketAddress *retaddr = nullptr; - const bool retval = g_socket_listener_add_address (gobj(), - Glib::unwrap(address), - static_cast<GSocketType>(type), - static_cast<GSocketProtocol>(protocol), - nullptr, - &retaddr, - &gerror); - if(gerror) + GSocketAddress* retaddr = nullptr; + const bool retval = + g_socket_listener_add_address(gobj(), Glib::unwrap(address), static_cast<GSocketType>(type), + static_cast<GSocketProtocol>(protocol), nullptr, &retaddr, &gerror); + if (gerror) ::Glib::Error::throw_exception(gerror); - if(retaddr) + if (retaddr) effective_address = Glib::wrap(retaddr); return retval; } - -bool SocketListener::add_inet_port(guint16 port) +bool +SocketListener::add_inet_port(guint16 port) { GError* gerror = nullptr; const bool retvalue = g_socket_listener_add_inet_port(gobj(), port, nullptr, &gerror); - if(gerror) + if (gerror) ::Glib::Error::throw_exception(gerror); return retvalue; } - -guint16 SocketListener::add_any_inet_port() +guint16 +SocketListener::add_any_inet_port() { GError* gerror = nullptr; const auto retvalue = g_socket_listener_add_any_inet_port(gobj(), nullptr, &gerror); - if(gerror) + if (gerror) ::Glib::Error::throw_exception(gerror); return retvalue; } - -Glib::RefPtr<Socket> SocketListener::accept_socket(Glib::RefPtr<Glib::Object>& source_object, const Glib::RefPtr<Cancellable>& cancellable) +Glib::RefPtr<Socket> +SocketListener::accept_socket( + Glib::RefPtr<Glib::Object>& source_object, const Glib::RefPtr<Cancellable>& cancellable) { GError* gerror = nullptr; - GObject *retobj = nullptr; - auto retvalue = g_socket_listener_accept_socket(gobj(), - &retobj, - Glib::unwrap(cancellable), - &gerror); - if(gerror) + GObject* retobj = nullptr; + auto retvalue = + g_socket_listener_accept_socket(gobj(), &retobj, Glib::unwrap(cancellable), &gerror); + if (gerror) ::Glib::Error::throw_exception(gerror); - if(retobj) + if (retobj) source_object = Glib::wrap(retobj); return Glib::wrap(retvalue); } -Glib::RefPtr<Socket> SocketListener::accept_socket(Glib::RefPtr<Glib::Object>& source_object) +Glib::RefPtr<Socket> +SocketListener::accept_socket(Glib::RefPtr<Glib::Object>& source_object) { GError* gerror = nullptr; - GObject *retobj = nullptr; - auto retvalue = g_socket_listener_accept_socket(gobj(), - &retobj, - nullptr, - &gerror); - if(gerror) + GObject* retobj = nullptr; + auto retvalue = g_socket_listener_accept_socket(gobj(), &retobj, nullptr, &gerror); + if (gerror) ::Glib::Error::throw_exception(gerror); - if(retobj) + if (retobj) source_object = Glib::wrap(retobj); return Glib::wrap(retvalue); } -Glib::RefPtr<Socket> SocketListener::accept_socket(const Glib::RefPtr<Cancellable>& cancellable) +Glib::RefPtr<Socket> +SocketListener::accept_socket(const Glib::RefPtr<Cancellable>& cancellable) { GError* gerror = nullptr; - auto retvalue = g_socket_listener_accept_socket(gobj(), - nullptr, - Glib::unwrap(cancellable), - &gerror); - if(gerror) + auto retvalue = + g_socket_listener_accept_socket(gobj(), nullptr, Glib::unwrap(cancellable), &gerror); + if (gerror) ::Glib::Error::throw_exception(gerror); return Glib::wrap(retvalue); } -Glib::RefPtr<Socket> SocketListener::accept_socket() +Glib::RefPtr<Socket> +SocketListener::accept_socket() { GError* gerror = nullptr; - auto retvalue = g_socket_listener_accept_socket(gobj(), - nullptr, - nullptr, - &gerror); - if(gerror) + auto retvalue = g_socket_listener_accept_socket(gobj(), nullptr, nullptr, &gerror); + if (gerror) ::Glib::Error::throw_exception(gerror); return Glib::wrap(retvalue); } - -void SocketListener::accept_socket_async(const Glib::RefPtr<Cancellable>& cancellable, const SlotAsyncReady& slot) +void +SocketListener::accept_socket_async( + const Glib::RefPtr<Cancellable>& cancellable, const SlotAsyncReady& slot) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. auto slot_copy = new SlotAsyncReady(slot); - g_socket_listener_accept_socket_async(gobj(), - Glib::unwrap(cancellable), - &SignalProxy_async_callback, - slot_copy); + g_socket_listener_accept_socket_async( + gobj(), Glib::unwrap(cancellable), &SignalProxy_async_callback, slot_copy); } -void SocketListener::accept_socket_async(const SlotAsyncReady& slot) +void +SocketListener::accept_socket_async(const SlotAsyncReady& slot) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. auto slot_copy = new SlotAsyncReady(slot); - g_socket_listener_accept_socket_async(gobj(), - nullptr, - &SignalProxy_async_callback, - slot_copy); + g_socket_listener_accept_socket_async(gobj(), nullptr, &SignalProxy_async_callback, slot_copy); } -Glib::RefPtr<Socket> SocketListener::accept_socket_finish(const Glib::RefPtr<AsyncResult>& result, Glib::RefPtr<Glib::Object>& source_object) +Glib::RefPtr<Socket> +SocketListener::accept_socket_finish( + const Glib::RefPtr<AsyncResult>& result, Glib::RefPtr<Glib::Object>& source_object) { GError* gerror = nullptr; - GObject *retobj = nullptr; - auto retvalue = g_socket_listener_accept_socket_finish(gobj(), - Glib::unwrap(result), - &retobj, - &gerror); - if(gerror) + GObject* retobj = nullptr; + auto retvalue = + g_socket_listener_accept_socket_finish(gobj(), Glib::unwrap(result), &retobj, &gerror); + if (gerror) ::Glib::Error::throw_exception(gerror); - if(retobj) + if (retobj) source_object = Glib::wrap(retobj); return Glib::wrap(retvalue); } -Glib::RefPtr<Socket> SocketListener::accept_socket_finish(const Glib::RefPtr<AsyncResult>& result) +Glib::RefPtr<Socket> +SocketListener::accept_socket_finish(const Glib::RefPtr<AsyncResult>& result) { GError* gerror = nullptr; - auto retvalue = g_socket_listener_accept_socket_finish(gobj(), - Glib::unwrap(result), - nullptr, - &gerror); - if(gerror) + auto retvalue = + g_socket_listener_accept_socket_finish(gobj(), Glib::unwrap(result), nullptr, &gerror); + if (gerror) ::Glib::Error::throw_exception(gerror); return Glib::wrap(retvalue); } - -Glib::RefPtr<SocketConnection> SocketListener::accept(Glib::RefPtr<Object>& source_object, const Glib::RefPtr<Cancellable>& cancellable) +Glib::RefPtr<SocketConnection> +SocketListener::accept( + Glib::RefPtr<Object>& source_object, const Glib::RefPtr<Cancellable>& cancellable) { GError* gerror = nullptr; - GObject *retobj = nullptr; - auto retvalue = g_socket_listener_accept(gobj(), - &retobj, - Glib::unwrap(cancellable), - &gerror); - if(gerror) + GObject* retobj = nullptr; + auto retvalue = g_socket_listener_accept(gobj(), &retobj, Glib::unwrap(cancellable), &gerror); + if (gerror) ::Glib::Error::throw_exception(gerror); - if(retobj) + if (retobj) source_object = Glib::wrap(retobj); return Glib::wrap(retvalue); } -Glib::RefPtr<SocketConnection> SocketListener::accept(Glib::RefPtr<Object>& source_object) +Glib::RefPtr<SocketConnection> +SocketListener::accept(Glib::RefPtr<Object>& source_object) { GError* gerror = nullptr; - GObject *retobj = nullptr; - auto retvalue = g_socket_listener_accept(gobj(), - &retobj, - nullptr, - &gerror); - if(gerror) + GObject* retobj = nullptr; + auto retvalue = g_socket_listener_accept(gobj(), &retobj, nullptr, &gerror); + if (gerror) ::Glib::Error::throw_exception(gerror); - if(retobj) + if (retobj) source_object = Glib::wrap(retobj); return Glib::wrap(retvalue); } -Glib::RefPtr<SocketConnection> SocketListener::accept(const Glib::RefPtr<Cancellable>& cancellable) +Glib::RefPtr<SocketConnection> +SocketListener::accept(const Glib::RefPtr<Cancellable>& cancellable) { GError* gerror = nullptr; - auto retvalue = g_socket_listener_accept(gobj(), - nullptr, - Glib::unwrap(cancellable), - &gerror); - if(gerror) + auto retvalue = g_socket_listener_accept(gobj(), nullptr, Glib::unwrap(cancellable), &gerror); + if (gerror) ::Glib::Error::throw_exception(gerror); return Glib::wrap(retvalue); } -Glib::RefPtr<SocketConnection> SocketListener::accept() +Glib::RefPtr<SocketConnection> +SocketListener::accept() { GError* gerror = nullptr; - auto retvalue = g_socket_listener_accept(gobj(), - nullptr, - nullptr, - &gerror); - if(gerror) + auto retvalue = g_socket_listener_accept(gobj(), nullptr, nullptr, &gerror); + if (gerror) ::Glib::Error::throw_exception(gerror); return Glib::wrap(retvalue); } - -void SocketListener::accept_async(const SlotAsyncReady& slot) +void +SocketListener::accept_async(const SlotAsyncReady& slot) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. auto slot_copy = new SlotAsyncReady(slot); - g_socket_listener_accept_async(gobj(), - nullptr, - &SignalProxy_async_callback, - slot_copy); + g_socket_listener_accept_async(gobj(), nullptr, &SignalProxy_async_callback, slot_copy); } -void SocketListener::accept_async(const Glib::RefPtr<Cancellable>& cancellable, const SlotAsyncReady& slot) +void +SocketListener::accept_async( + const Glib::RefPtr<Cancellable>& cancellable, const SlotAsyncReady& slot) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. auto slot_copy = new SlotAsyncReady(slot); - g_socket_listener_accept_async(gobj(), - Glib::unwrap(cancellable), - &SignalProxy_async_callback, - slot_copy); + g_socket_listener_accept_async( + gobj(), Glib::unwrap(cancellable), &SignalProxy_async_callback, slot_copy); } -Glib::RefPtr<SocketConnection> SocketListener::accept_finish(const Glib::RefPtr<AsyncResult>& result, Glib::RefPtr<Glib::Object>& source_object) +Glib::RefPtr<SocketConnection> +SocketListener::accept_finish( + const Glib::RefPtr<AsyncResult>& result, Glib::RefPtr<Glib::Object>& source_object) { GError* gerror = nullptr; - GObject *retobj = nullptr; - auto retvalue = g_socket_listener_accept_finish(gobj(), - Glib::unwrap(result), - &retobj, - &gerror); - if(gerror) + GObject* retobj = nullptr; + auto retvalue = g_socket_listener_accept_finish(gobj(), Glib::unwrap(result), &retobj, &gerror); + if (gerror) ::Glib::Error::throw_exception(gerror); - if(retobj) + if (retobj) source_object = Glib::wrap(retobj); return Glib::wrap(retvalue); } -Glib::RefPtr<SocketConnection> SocketListener::accept_finish(const Glib::RefPtr<AsyncResult>& result) +Glib::RefPtr<SocketConnection> +SocketListener::accept_finish(const Glib::RefPtr<AsyncResult>& result) { GError* gerror = nullptr; - auto retvalue = g_socket_listener_accept_finish(gobj(), - Glib::unwrap(result), - nullptr, - &gerror); - if(gerror) + auto retvalue = g_socket_listener_accept_finish(gobj(), Glib::unwrap(result), nullptr, &gerror); + if (gerror) ::Glib::Error::throw_exception(gerror); return Glib::wrap(retvalue); diff --git a/gio/src/srvtarget.ccg b/gio/src/srvtarget.ccg index 10c0e4ed..931000cb 100644 --- a/gio/src/srvtarget.ccg +++ b/gio/src/srvtarget.ccg @@ -23,4 +23,4 @@ namespace Gio { -} //namespace Gio +} // namespace Gio diff --git a/gio/src/themedicon.ccg b/gio/src/themedicon.ccg index af938ee9..e9a7f301 100644 --- a/gio/src/themedicon.ccg +++ b/gio/src/themedicon.ccg @@ -21,8 +21,8 @@ namespace Gio { ThemedIcon::ThemedIcon(const std::string& iconname, bool use_default_fallbacks) -: - _CONSTRUCT("name", iconname.c_str(), "use-default-fallbacks", gboolean(use_default_fallbacks)) -{} +: _CONSTRUCT("name", iconname.c_str(), "use-default-fallbacks", gboolean(use_default_fallbacks)) +{ +} -} //namespace Gio +} // namespace Gio diff --git a/gio/src/tlscertificate.ccg b/gio/src/tlscertificate.ccg index dd68cadb..448757fb 100644 --- a/gio/src/tlscertificate.ccg +++ b/gio/src/tlscertificate.ccg @@ -25,7 +25,7 @@ namespace Gio Glib::RefPtr<TlsCertificate> TlsCertificate::create_from_pem(const std::string& data, gssize length) { - return Glib::RefPtr<TlsCertificate>( new TlsCertificate(data, length) ); + return Glib::RefPtr<TlsCertificate>(new TlsCertificate(data, length)); } } // namesapce Gio diff --git a/gio/src/tlsclientconnection.ccg b/gio/src/tlsclientconnection.ccg index 30333643..e18f6c73 100644 --- a/gio/src/tlsclientconnection.ccg +++ b/gio/src/tlsclientconnection.ccg @@ -23,6 +23,7 @@ namespace Gio TlsClientConnection::TlsClientConnection(GTlsClientConnection* castitem) : TlsConnection(G_TLS_CONNECTION(castitem)) -{} +{ +} } // namespace Gio diff --git a/gio/src/tlsserverconnection.ccg b/gio/src/tlsserverconnection.ccg index c5d86a01..4f97609e 100644 --- a/gio/src/tlsserverconnection.ccg +++ b/gio/src/tlsserverconnection.ccg @@ -22,6 +22,7 @@ namespace Gio TlsServerConnection::TlsServerConnection(GTlsServerConnection* castitem) : TlsConnection(G_TLS_CONNECTION(castitem)) -{} +{ +} } // namespace Gio diff --git a/gio/src/unixconnection.ccg b/gio/src/unixconnection.ccg index 597dd8af..20a3cdeb 100644 --- a/gio/src/unixconnection.ccg +++ b/gio/src/unixconnection.ccg @@ -24,37 +24,33 @@ namespace Gio { -void UnixConnection::receive_credentials_async(const SlotAsyncReady& slot, - const Glib::RefPtr<Cancellable>& cancellable) +void +UnixConnection::receive_credentials_async( + const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable) { auto slot_copy = new SlotAsyncReady(slot); - g_unix_connection_receive_credentials_async(gobj(), - Glib::unwrap(cancellable), - &SignalProxy_async_callback, - slot_copy); + g_unix_connection_receive_credentials_async( + gobj(), Glib::unwrap(cancellable), &SignalProxy_async_callback, slot_copy); } -void UnixConnection::receive_credentials_async(const SlotAsyncReady& slot) +void +UnixConnection::receive_credentials_async(const SlotAsyncReady& slot) { auto slot_copy = new SlotAsyncReady(slot); - g_unix_connection_receive_credentials_async(gobj(), - nullptr, - &SignalProxy_async_callback, - slot_copy); + g_unix_connection_receive_credentials_async( + gobj(), nullptr, &SignalProxy_async_callback, slot_copy); } void -UnixConnection::send_credentials_async(const SlotAsyncReady& slot, - const Glib::RefPtr<Cancellable>& cancellable) +UnixConnection::send_credentials_async( + const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable) { auto slot_copy = new SlotAsyncReady(slot); - g_unix_connection_send_credentials_async(gobj(), - Glib::unwrap(cancellable), - &SignalProxy_async_callback, - slot_copy); + g_unix_connection_send_credentials_async( + gobj(), Glib::unwrap(cancellable), &SignalProxy_async_callback, slot_copy); } void @@ -63,10 +59,7 @@ UnixConnection::send_credentials_async(const SlotAsyncReady& slot) { auto slot_copy = new SlotAsyncReady(slot); - g_unix_connection_send_credentials_async(gobj(), - nullptr, - &SignalProxy_async_callback, - slot_copy); + g_unix_connection_send_credentials_async(gobj(), nullptr, &SignalProxy_async_callback, slot_copy); } } // namespace Gio diff --git a/gio/src/unixfdlist.ccg b/gio/src/unixfdlist.ccg index c4a65087..92aef941 100644 --- a/gio/src/unixfdlist.ccg +++ b/gio/src/unixfdlist.ccg @@ -22,8 +22,7 @@ namespace Gio { UnixFDList::UnixFDList(const Glib::ArrayHandle<int>& fds) -: - // Mark this class as non-derived to allow C++ vfuncs to be skipped. +: // Mark this class as non-derived to allow C++ vfuncs to be skipped. Glib::ObjectBase(nullptr), // g_unix_fd_list_new_from_array() must be called. // Its parameters don't correspond to properties. @@ -35,8 +34,7 @@ UnixFDList::UnixFDList(const Glib::ArrayHandle<int>& fds) } UnixFDList::UnixFDList(const Glib::ArrayHandle<int>& fds, int n_fds) -: - // Mark this class as non-derived to allow C++ vfuncs to be skipped. +: // Mark this class as non-derived to allow C++ vfuncs to be skipped. Glib::ObjectBase(nullptr), // g_unix_fd_list_new_from_array() must be called. // Its parameters don't correspond to properties. @@ -47,7 +45,8 @@ UnixFDList::UnixFDList(const Glib::ArrayHandle<int>& fds, int n_fds) { } -const Glib::ArrayHandle<int> UnixFDList::peek_fds() const +const Glib::ArrayHandle<int> +UnixFDList::peek_fds() const { int length = 0; const auto fds = g_unix_fd_list_peek_fds(const_cast<GUnixFDList*>(gobj()), &length); @@ -56,7 +55,8 @@ const Glib::ArrayHandle<int> UnixFDList::peek_fds() const return Glib::ArrayHandle<int>(fds, length, Glib::OWNERSHIP_NONE); } -Glib::ArrayHandle<int> UnixFDList::steal_fds() +Glib::ArrayHandle<int> +UnixFDList::steal_fds() { int length = 0; const auto fds = g_unix_fd_list_steal_fds(gobj(), &length); diff --git a/gio/src/unixfdmessage.ccg b/gio/src/unixfdmessage.ccg index 7849a208..9d1afc26 100644 --- a/gio/src/unixfdmessage.ccg +++ b/gio/src/unixfdmessage.ccg @@ -22,7 +22,8 @@ namespace Gio { -Glib::ArrayHandle<int> UnixFDMessage::steal_fds() +Glib::ArrayHandle<int> +UnixFDMessage::steal_fds() { int length = 0; const auto fds = g_unix_fd_message_steal_fds(gobj(), &length); diff --git a/gio/src/unixsocketaddress.ccg b/gio/src/unixsocketaddress.ccg index 3c2eb1c8..d163b03d 100644 --- a/gio/src/unixsocketaddress.ccg +++ b/gio/src/unixsocketaddress.ccg @@ -23,10 +23,10 @@ namespace Gio { Glib::RefPtr<UnixSocketAddress> -UnixSocketAddress::create(const std::string& path, UnixSocketAddressType type, - int path_len) +UnixSocketAddress::create(const std::string& path, UnixSocketAddressType type, int path_len) { - return Glib::wrap(reinterpret_cast<GUnixSocketAddress*>(g_unix_socket_address_new_with_type(path.c_str(), path_len, static_cast<GUnixSocketAddressType>(type)))); + return Glib::wrap(reinterpret_cast<GUnixSocketAddress*>(g_unix_socket_address_new_with_type( + path.c_str(), path_len, static_cast<GUnixSocketAddressType>(type)))); } -} //namespace Gio +} // namespace Gio diff --git a/gio/src/volume.ccg b/gio/src/volume.ccg index 00c17f6f..9d61a520 100644 --- a/gio/src/volume.ccg +++ b/gio/src/volume.ccg @@ -17,7 +17,6 @@ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ - #include <glibmm/error.h> #include <glibmm/exceptionhandler.h> #include <giomm/file.h> @@ -25,143 +24,127 @@ #include <gio/gio.h> #include "slot_async.h" -namespace Gio { +namespace Gio +{ void -Volume::mount(const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, MountMountFlags flags) +Volume::mount(const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsyncReady& slot, + const Glib::RefPtr<Cancellable>& cancellable, MountMountFlags flags) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. auto slot_copy = new SlotAsyncReady(slot); - g_volume_mount(gobj(), - static_cast<GMountMountFlags>(flags), - Glib::unwrap(mount_operation), - Glib::unwrap(cancellable), - &SignalProxy_async_callback, - slot_copy); - + g_volume_mount(gobj(), static_cast<GMountMountFlags>(flags), Glib::unwrap(mount_operation), + Glib::unwrap(cancellable), &SignalProxy_async_callback, slot_copy); } void -Volume::mount(const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsyncReady& slot, MountMountFlags flags) +Volume::mount(const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsyncReady& slot, + MountMountFlags flags) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. auto slot_copy = new SlotAsyncReady(slot); - g_volume_mount(gobj(), - static_cast<GMountMountFlags>(flags), - Glib::unwrap(mount_operation), - nullptr, // cancellable - &SignalProxy_async_callback, - slot_copy); + g_volume_mount(gobj(), static_cast<GMountMountFlags>(flags), Glib::unwrap(mount_operation), + nullptr, // cancellable + &SignalProxy_async_callback, slot_copy); } void Volume::mount(const Glib::RefPtr<MountOperation>& mount_operation, MountMountFlags flags) { - g_volume_mount(gobj(), - static_cast<GMountMountFlags>(flags), - Glib::unwrap(mount_operation), - nullptr, // cancellable - nullptr, - nullptr); + g_volume_mount(gobj(), static_cast<GMountMountFlags>(flags), Glib::unwrap(mount_operation), + nullptr, // cancellable + nullptr, nullptr); } void Volume::mount(MountMountFlags flags) { - g_volume_mount(gobj(), - static_cast<GMountMountFlags>(flags), - nullptr, - nullptr, // cancellable - nullptr, - nullptr); + g_volume_mount(gobj(), static_cast<GMountMountFlags>(flags), nullptr, + nullptr, // cancellable + nullptr, nullptr); } - -void Volume::eject(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, MountUnmountFlags flags) +void +Volume::eject( + const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, MountUnmountFlags flags) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. auto slot_copy = new SlotAsyncReady(slot); - g_volume_eject_with_operation(gobj(), - static_cast<GMountUnmountFlags>(flags), - nullptr, // mount_operation - Glib::unwrap(cancellable), - &SignalProxy_async_callback, - slot_copy); + g_volume_eject_with_operation(gobj(), static_cast<GMountUnmountFlags>(flags), + nullptr, // mount_operation + Glib::unwrap(cancellable), &SignalProxy_async_callback, slot_copy); } -void Volume::eject(const SlotAsyncReady& slot, MountUnmountFlags flags) +void +Volume::eject(const SlotAsyncReady& slot, MountUnmountFlags flags) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. auto slot_copy = new SlotAsyncReady(slot); - g_volume_eject_with_operation(gobj(), - static_cast<GMountUnmountFlags>(flags), - nullptr, // mount_operation - nullptr, // cancellable - &SignalProxy_async_callback, - slot_copy); + g_volume_eject_with_operation(gobj(), static_cast<GMountUnmountFlags>(flags), + nullptr, // mount_operation + nullptr, // cancellable + &SignalProxy_async_callback, slot_copy); } -void Volume::eject(MountUnmountFlags flags) +void +Volume::eject(MountUnmountFlags flags) { - g_volume_eject_with_operation(gobj(), - static_cast<GMountUnmountFlags>(flags), - nullptr, // mount_operation - nullptr, // cancellable - nullptr, // callback - nullptr); // data + g_volume_eject_with_operation(gobj(), static_cast<GMountUnmountFlags>(flags), + nullptr, // mount_operation + nullptr, // cancellable + nullptr, // callback + nullptr); // data } -void Volume::eject(const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, MountUnmountFlags flags) +void +Volume::eject(const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsyncReady& slot, + const Glib::RefPtr<Cancellable>& cancellable, MountUnmountFlags flags) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. auto slot_copy = new SlotAsyncReady(slot); - g_volume_eject_with_operation(gobj(), - static_cast<GMountUnmountFlags>(flags), - Glib::unwrap(mount_operation), - Glib::unwrap(cancellable), - &SignalProxy_async_callback, - slot_copy); + g_volume_eject_with_operation(gobj(), static_cast<GMountUnmountFlags>(flags), + Glib::unwrap(mount_operation), Glib::unwrap(cancellable), &SignalProxy_async_callback, + slot_copy); } -void Volume::eject(const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsyncReady& slot, MountUnmountFlags flags) +void +Volume::eject(const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsyncReady& slot, + MountUnmountFlags flags) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter // and deleted in the callback. auto slot_copy = new SlotAsyncReady(slot); - g_volume_eject_with_operation(gobj(), - static_cast<GMountUnmountFlags>(flags), - Glib::unwrap(mount_operation), - nullptr, // cancellable - &SignalProxy_async_callback, - slot_copy); + g_volume_eject_with_operation(gobj(), static_cast<GMountUnmountFlags>(flags), + Glib::unwrap(mount_operation), + nullptr, // cancellable + &SignalProxy_async_callback, slot_copy); } -void Volume::eject(const Glib::RefPtr<MountOperation>& mount_operation, MountUnmountFlags flags) +void +Volume::eject(const Glib::RefPtr<MountOperation>& mount_operation, MountUnmountFlags flags) { - g_volume_eject_with_operation(gobj(), - static_cast<GMountUnmountFlags>(flags), - Glib::unwrap(mount_operation), - nullptr, // cancellable - nullptr, // callback - nullptr); // data + g_volume_eject_with_operation(gobj(), static_cast<GMountUnmountFlags>(flags), + Glib::unwrap(mount_operation), + nullptr, // cancellable + nullptr, // callback + nullptr); // data } } // namespace Gio - diff --git a/gio/src/volumemonitor.ccg b/gio/src/volumemonitor.ccg index ef4ee3f5..48ac82ab 100644 --- a/gio/src/volumemonitor.ccg +++ b/gio/src/volumemonitor.ccg @@ -20,7 +20,7 @@ #include <gio/gio.h> #include <glibmm/exceptionhandler.h> -namespace Gio { - +namespace Gio +{ } // namespace Gio |