diff options
author | Murray Cumming <murrayc@murrayc.com> | 2016-03-31 11:09:44 +0200 |
---|---|---|
committer | Murray Cumming <murrayc@murrayc.com> | 2016-03-31 11:39:07 +0200 |
commit | fb9f840e18edaa54f6c51762b2b9aa67f6fcd85b (patch) | |
tree | a02950c0aba9e5d00d2e425975957a45bfcb6ef6 | |
parent | 9a72522d16457319c7bd9829b23127a770454edd (diff) | |
download | glibmm-fb9f840e18edaa54f6c51762b2b9aa67f6fcd85b.tar.gz |
C++11: .hg/.ccg files: Replace typedefs with using.
41 files changed, 122 insertions, 122 deletions
diff --git a/gio/src/action.hg b/gio/src/action.hg index 8788da31..5f5e8647 100644 --- a/gio/src/action.hg +++ b/gio/src/action.hg @@ -240,7 +240,7 @@ void Action::get_state(T_Value& value) const { value = T_Value(); //Make sure that it is initialized. - typedef Glib::Variant<T_Value> type_glib_variant; + using type_glib_variant = Glib::Variant<T_Value>; g_return_if_fail( g_variant_type_equal(g_action_get_state_type(const_cast<GAction*>(gobj())), type_glib_variant::variant_type().gobj())); @@ -255,7 +255,7 @@ void Action::get_state_hint(T_Value& value) const { value = T_Value(); //Make sure that it is initialized. - typedef Glib::Variant<T_Value> type_glib_variant; + using type_glib_variant = Glib::Variant<T_Value>; const auto variantBase = get_state_hint_variant(); @@ -276,7 +276,7 @@ void Action::parse_detailed_name(const Glib::ustring& detailed_name, Glib::ustri action_name.clear(); //Make sure the output arguments are initialized. target_value = T_Value(); - typedef Glib::Variant<T_Value> type_glib_variant; + using type_glib_variant = Glib::Variant<T_Value>; Glib::VariantBase target_value_variantBase; parse_detailed_name_variant(detailed_name, action_name, target_value_variantBase); @@ -300,7 +300,7 @@ void Action::parse_detailed_name(const Glib::ustring& detailed_name, Glib::ustri template <typename T_Value> Glib::ustring Action::print_detailed_name(const T_Value& target_value) { - typedef Glib::Variant<T_Value> type_glib_variant; + using type_glib_variant = Glib::Variant<T_Value>; g_return_val_if_fail( g_variant_type_equal(g_action_get_parameter_type(const_cast<GAction*>(gobj())), type_glib_variant::variant_type().gobj()), @@ -311,7 +311,7 @@ Glib::ustring Action::print_detailed_name(const T_Value& target_value) template <typename T_Value> void Action::change_state(const T_Value& value) { - typedef Glib::Variant<T_Value> type_glib_variant; + using type_glib_variant = Glib::Variant<T_Value>; g_return_if_fail( g_variant_type_equal(g_action_get_state_type(const_cast<GAction*>(gobj())), type_glib_variant::variant_type().gobj())); @@ -328,7 +328,7 @@ void Action::change_state(const Glib::Variant<T_Value>& value) template <typename T_Value> void Action::activate(const T_Value& parameter) { - typedef Glib::Variant<T_Value> type_glib_variant; + using type_glib_variant = Glib::Variant<T_Value>; g_return_if_fail( g_variant_type_equal(g_action_get_parameter_type(const_cast<GAction*>(gobj())), type_glib_variant::variant_type().gobj())); diff --git a/gio/src/actiongroup.hg b/gio/src/actiongroup.hg index 3e423681..d8f9c10a 100644 --- a/gio/src/actiongroup.hg +++ b/gio/src/actiongroup.hg @@ -166,7 +166,7 @@ void ActionGroup::get_action_state(const Glib::ustring& action_name, T_Value& va { value = T_Value(); //Make sure that it is initialized. - typedef Glib::Variant<T_Value> type_glib_variant; + using type_glib_variant = Glib::Variant<T_Value>; g_return_if_fail( g_variant_type_equal(g_action_group_get_action_state_type(const_cast<GActionGroup*>(gobj()), action_name.c_str()), type_glib_variant::variant_type().gobj())); @@ -183,7 +183,7 @@ void ActionGroup::get_action_state_hint(const Glib::ustring& action_name, T_Valu { value = T_Value(); //Make sure that it is initialized. - typedef Glib::Variant<T_Value> type_glib_variant; + using type_glib_variant = Glib::Variant<T_Value>; const auto variantBase = get_action_state_hint_variant(action_name); diff --git a/gio/src/actionmap.hg b/gio/src/actionmap.hg index 6f32fdb6..e401fc82 100644 --- a/gio/src/actionmap.hg +++ b/gio/src/actionmap.hg @@ -88,7 +88,7 @@ public: * For instance, * void on_slot_activated(); */ - typedef sigc::slot<void> ActivateSlot; + using ActivateSlot = sigc::slot<void>; /** A convenience method for creating a SimpleAction instance * and adding it to the ActionMap. diff --git a/gio/src/application.ccg b/gio/src/application.ccg index 7b80eed1..7b53edf2 100644 --- a/gio/src/application.ccg +++ b/gio/src/application.ccg @@ -57,7 +57,7 @@ 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; + using SlotType = sigc::slot<void, const Gio::Application::type_vec_files&, const Glib::ustring&>; Gio::Application::type_vec_files vec_files(n_files); for (int i = 0; i < n_files; ++i) @@ -92,7 +92,7 @@ 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; + using SlotType = sigc::slot<void, const Application::type_vec_files&, const Glib::ustring&>; Application::type_vec_files vec_files(n_files); for (int i = 0; i < n_files; i++) @@ -186,7 +186,7 @@ private: OptionArgCallbackData& operator=(const OptionArgCallbackData&); }; -typedef std::map<Glib::ustring, OptionArgCallbackData*> OptionArgCallbackDataMap; +using OptionArgCallbackDataMap = std::map<Glib::ustring, OptionArgCallbackData*>; OptionArgCallbackDataMap option_arg_callback_data; // Gio::Application instances may be used in different threads. diff --git a/gio/src/application.hg b/gio/src/application.hg index a72ba68e..05455164 100644 --- a/gio/src/application.hg +++ b/gio/src/application.hg @@ -295,7 +295,7 @@ public: _WRAP_METHOD(void release(), g_application_release) _WRAP_METHOD(void activate(), g_application_activate) - typedef std::vector< Glib::RefPtr<File> > type_vec_files; + using type_vec_files = std::vector< Glib::RefPtr<File> >; /* Opens the given files. * diff --git a/gio/src/asyncinitable.ccg b/gio/src/asyncinitable.ccg index 79960709..e91c9846 100644 --- a/gio/src/asyncinitable.ccg +++ b/gio/src/asyncinitable.ccg @@ -149,7 +149,7 @@ AsyncInitable_Class::init_finish_vfunc_callback( if (base && base->init_finish) return (*base->init_finish)(self, res, error); - typedef gboolean RType; + using RType = gboolean; return RType(); } bool @@ -174,7 +174,7 @@ Gio::AsyncInitable::init_finish_vfunc(const Glib::RefPtr<AsyncResult>& res) return result; } - typedef bool RType; + using RType = bool; return RType(); } diff --git a/gio/src/cancellable.hg b/gio/src/cancellable.hg index 886dc272..47196c09 100644 --- a/gio/src/cancellable.hg +++ b/gio/src/cancellable.hg @@ -37,7 +37,7 @@ protected: _CTOR_DEFAULT public: - typedef sigc::slot<void> SlotCancelledCallback; + using SlotCancelledCallback = sigc::slot<void>; _WRAP_CREATE() diff --git a/gio/src/dbusauthobserver.ccg b/gio/src/dbusauthobserver.ccg index 7ca00c72..8c30743b 100644 --- a/gio/src/dbusauthobserver.ccg +++ b/gio/src/dbusauthobserver.ccg @@ -22,8 +22,8 @@ #include <giomm/credentials.h> // To help the generated code: -typedef Gio::Credentials Credentials; -typedef Gio::IOStream IOStream; +using Credentials = Gio::Credentials; +using IOStream = Gio::IOStream; namespace Gio { diff --git a/gio/src/dbusconnection.hg b/gio/src/dbusconnection.hg index ff226fd1..6b0e5587 100644 --- a/gio/src/dbusconnection.hg +++ b/gio/src/dbusconnection.hg @@ -173,9 +173,9 @@ public: * Glib::ustring& signal_name, const Glib::VariantContainerBase& parameters);. * @endcode */ - typedef sigc::slot<void, const Glib::RefPtr<Connection>&, + using SlotSignal = sigc::slot<void, const Glib::RefPtr<Connection>&, const Glib::ustring&, const Glib::ustring&, const Glib::ustring&, - const Glib::ustring&, const Glib::VariantContainerBase&> SlotSignal; + const Glib::ustring&, const Glib::VariantContainerBase&>; /** Signature for slot used in add_filter(). * For example, @@ -191,9 +191,9 @@ public: * drop a message can simply return <tt>0</tt>. And filter function may * modify a message by copying it and return the copy. */ - typedef sigc::slot<Glib::RefPtr<Message>, + using SlotMessageFilter = sigc::slot<Glib::RefPtr<Message>, const Glib::RefPtr<Connection>&, - const Glib::RefPtr<Message>&, bool> SlotMessageFilter; + const Glib::RefPtr<Message>&, bool>; /** Asynchronously connects to the message bus specified by @a bus_type. * diff --git a/gio/src/dbusinterfacevtable.hg b/gio/src/dbusinterfacevtable.hg index 87aeee04..caf181a7 100644 --- a/gio/src/dbusinterfacevtable.hg +++ b/gio/src/dbusinterfacevtable.hg @@ -62,7 +62,7 @@ public: * Glib::RefPtr<Gio::DBus::MethodInvocation>& invocation); * @endcode */ - typedef sigc::slot< + using SlotInterfaceMethodCall = sigc::slot< void, const Glib::RefPtr<Connection>&, const Glib::ustring&, @@ -71,7 +71,7 @@ public: const Glib::ustring&, const Glib::VariantContainerBase&, const Glib::RefPtr<MethodInvocation>& - > SlotInterfaceMethodCall; + >; /** The type for a slot which handles getting a property for a D-Bus * interface. @@ -84,7 +84,7 @@ public: * @endcode * @throw Glib::Error. */ - typedef sigc::slot< + using SlotInterfaceGetProperty = sigc::slot< void, Glib::VariantBase&, const Glib::RefPtr<Connection>&, @@ -92,7 +92,7 @@ public: const Glib::ustring&, const Glib::ustring&, const Glib::ustring& - > SlotInterfaceGetProperty; + >; /** The type for a slot which handles setting a property for a D-Bus * interface. @@ -105,7 +105,7 @@ public: * @endcode * @throw Glib::Error. */ - typedef sigc::slot< + using SlotInterfaceSetProperty = sigc::slot< bool, const Glib::RefPtr<Connection>&, const Glib::ustring&, @@ -113,7 +113,7 @@ public: const Glib::ustring&, const Glib::ustring&, const Glib::VariantBase& - > SlotInterfaceSetProperty; + >; /** Constructs a new InterfaceVTable using the specified slots. * @param slot_method_call The slot for handling incoming method calls. diff --git a/gio/src/dbusmessage.ccg b/gio/src/dbusmessage.ccg index fb2cd8aa..751fbfd6 100644 --- a/gio/src/dbusmessage.ccg +++ b/gio/src/dbusmessage.ccg @@ -30,7 +30,7 @@ namespace Gio namespace DBus { -typedef Message::ByteOrder ByteOrder; +using ByteOrder = Message::ByteOrder; void Message::get_body(Glib::VariantBase& value) const diff --git a/gio/src/dbusownname.hg b/gio/src/dbusownname.hg index 6613b704..8690d104 100644 --- a/gio/src/dbusownname.hg +++ b/gio/src/dbusownname.hg @@ -35,21 +35,21 @@ _WRAP_ENUM(BusNameOwnerFlags, GBusNameOwnerFlags, s#^DBUS_##) * @newin{2,28} * @ingroup DBus */ -typedef sigc::slot<void, const Glib::RefPtr<Gio::DBus::Connection>&, Glib::ustring> SlotBusAcquired; +using SlotBusAcquired = sigc::slot<void, const Glib::RefPtr<Gio::DBus::Connection>&, Glib::ustring>; /** For example, * void on_name_acquired(const Glib::RefPtr<Gio::DBus::Connection>& connection, * const Glib::ustring& name); * @ingroup DBus */ -typedef sigc::slot<void, const Glib::RefPtr<Gio::DBus::Connection>&, Glib::ustring> SlotNameAcquired; +using SlotNameAcquired = sigc::slot<void, const Glib::RefPtr<Gio::DBus::Connection>&, Glib::ustring>; /** For example, * void on_name_lost(const Glib::RefPtr<Gio::DBus::Connection>& connection, * const Glib::ustring& name); * @ingroup DBus */ -typedef sigc::slot<void, const Glib::RefPtr<Gio::DBus::Connection>&, Glib::ustring> SlotNameLost; +using SlotNameLost = sigc::slot<void, const Glib::RefPtr<Gio::DBus::Connection>&, Glib::ustring>; //TODO: See https://bugzilla.gnome.org/show_bug.cgi?id=646427 about the apparent uselessness of SlotNameAcquired. //TODO: Add example from C API in class docs. diff --git a/gio/src/dbusproxy.ccg b/gio/src/dbusproxy.ccg index a8185739..b13f92f0 100644 --- a/gio/src/dbusproxy.ccg +++ b/gio/src/dbusproxy.ccg @@ -31,7 +31,7 @@ namespace DBus { // Help the generate code: -typedef Proxy::MapChangedProperties MapChangedProperties; +using MapChangedProperties = Proxy::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, diff --git a/gio/src/dbusproxy.hg b/gio/src/dbusproxy.hg index 0f79156d..c015e778 100644 --- a/gio/src/dbusproxy.hg +++ b/gio/src/dbusproxy.hg @@ -401,7 +401,7 @@ public: _WRAP_PROPERTY("g-name-owner", Glib::ustring) _WRAP_PROPERTY("g-object-path", Glib::ustring) - typedef std::map<Glib::ustring, Glib::VariantBase> MapChangedProperties; + using MapChangedProperties = std::map<Glib::ustring, Glib::VariantBase>; // TODO: Should the signal names match the C API names (ie. the C API names // are g_signal_name while these are just signal_name). diff --git a/gio/src/dbussubtreevtable.hg b/gio/src/dbussubtreevtable.hg index b5e921be..ead80eea 100644 --- a/gio/src/dbussubtreevtable.hg +++ b/gio/src/dbussubtreevtable.hg @@ -66,12 +66,12 @@ public: * sender, const Glib::ustring& object_path); * @endcode */ - typedef sigc::slot< + using SlotSubtreeEnumerate = sigc::slot< std::vector<Glib::ustring>, const Glib::RefPtr<Connection>&, const Glib::ustring&, const Glib::ustring& - > SlotSubtreeEnumerate; + >; /** The type for a slot which handles introspecting a child node. * @@ -93,13 +93,13 @@ public: * object_path, const Glib::ustring& node); * @endcode */ - typedef sigc::slot< + using SlotSubtreeIntrospect = sigc::slot< std::vector< Glib::RefPtr<Gio::DBus::InterfaceInfo> >, const Glib::RefPtr<Connection>&, const Glib::ustring&, const Glib::ustring&, const Glib::ustring& - > SlotSubtreeIntrospect; + >; /** The type for a slot which handles dispatching a remote call on a child * node. @@ -115,14 +115,14 @@ public: * interface_name, const Glib::ustring& node); * @endcode */ - typedef sigc::slot< + using SlotSubtreeDispatch = sigc::slot< const InterfaceVTable*, const Glib::RefPtr<Connection>&, const Glib::ustring&, const Glib::ustring&, const Glib::ustring&, const Glib::ustring& - > SlotSubtreeDispatch; + >; /** Constructs a new SubtreeVTable using specified slots. * @param slot_enumerate The slot for handling incoming method calls. diff --git a/gio/src/dbuswatchname.hg b/gio/src/dbuswatchname.hg index ef555b7f..dd697ce0 100644 --- a/gio/src/dbuswatchname.hg +++ b/gio/src/dbuswatchname.hg @@ -34,14 +34,14 @@ _WRAP_ENUM(BusNameWatcherFlags, GBusNameWatcherFlags, s#^DBUS_##, NO_GTYPE) * const Glib::ustring& name, const Glib::ustring& name_owner); * @ingroup DBus */ -typedef sigc::slot<void, const Glib::RefPtr<Gio::DBus::Connection>&, Glib::ustring, const Glib::ustring&> SlotNameAppeared; +using SlotNameAppeared = sigc::slot<void, const Glib::RefPtr<Gio::DBus::Connection>&, Glib::ustring, const Glib::ustring&>; /** For example, * void on_name_vanished(const Glib::RefPtr<Gio::DBus::Connection>& connection, * const Glib::ustring& name); * @ingroup DBus */ -typedef sigc::slot<void, const Glib::RefPtr<Gio::DBus::Connection>&, Glib::ustring> SlotNameVanished; +using SlotNameVanished = sigc::slot<void, const Glib::RefPtr<Gio::DBus::Connection>&, Glib::ustring>; //TODO: Add example from C API in class docs? /** Starts watching @a name on the bus specified by @a bus_type and calls diff --git a/gio/src/drive.hg b/gio/src/drive.hg index 30ab250f..59c5fffa 100644 --- a/gio/src/drive.hg +++ b/gio/src/drive.hg @@ -189,9 +189,9 @@ namespace Container_Helpers template <> struct TypeTraits< Glib::RefPtr<Gio::Drive> > { - typedef Glib::RefPtr<Gio::Drive> CppType; - typedef GDrive* CType; - typedef GDrive* CTypeNonConst; + using CppType = Glib::RefPtr<Gio::Drive>; + using CType = GDrive*; + using CTypeNonConst = GDrive*; static CType to_c_type (const CppType& item) { return Glib::unwrap (item); } diff --git a/gio/src/file.ccg b/gio/src/file.ccg index b9b8771c..9190f435 100644 --- a/gio/src/file.ccg +++ b/gio/src/file.ccg @@ -25,9 +25,9 @@ namespace { -typedef std::pair<Gio::File::SlotFileProgress*, Gio::SlotAsyncReady*> CopySlots; -typedef std::pair<Gio::File::SlotFileMeasureProgress*, Gio::SlotAsyncReady*> MeasureSlots; -typedef std::pair<Gio::File::SlotReadMore*, Gio::SlotAsyncReady*> LoadPartialSlots; +using CopySlots = std::pair<Gio::File::SlotFileProgress*, Gio::SlotAsyncReady*>; +using MeasureSlots = std::pair<Gio::File::SlotFileMeasureProgress*, Gio::SlotAsyncReady*>; +using LoadPartialSlots = std::pair<Gio::File::SlotReadMore*, Gio::SlotAsyncReady*>; static void SignalProxy_file_progress_callback( diff --git a/gio/src/file.hg b/gio/src/file.hg index da1ba6a9..859cf252 100644 --- a/gio/src/file.hg +++ b/gio/src/file.hg @@ -2455,9 +2455,9 @@ namespace Container_Helpers template <> struct TypeTraits< Glib::RefPtr<Gio::File> > { - typedef Glib::RefPtr<Gio::File> CppType; - typedef GFile* CType; - typedef GFile* CTypeNonConst; + using CppType = Glib::RefPtr<Gio::File>; + using CType = GFile*; + using CTypeNonConst = GFile*; static CType to_c_type (const CppType& item) { return Glib::unwrap (item); } diff --git a/gio/src/memoryinputstream.hg b/gio/src/memoryinputstream.hg index 9ac5f9a1..0fc03f4a 100644 --- a/gio/src/memoryinputstream.hg +++ b/gio/src/memoryinputstream.hg @@ -76,7 +76,7 @@ _DEPRECATE_IFDEF_END * * @newin{2,40} */ - typedef sigc::slot<void, void*> SlotDestroyData; + using SlotDestroyData = sigc::slot<void, void*>; /** Appends to data that can be read from the input stream. * diff --git a/gio/src/mount.hg b/gio/src/mount.hg index 07ae84e8..2e91bea3 100644 --- a/gio/src/mount.hg +++ b/gio/src/mount.hg @@ -256,9 +256,9 @@ namespace Container_Helpers template <> struct TypeTraits< Glib::RefPtr<Gio::Mount> > { - typedef Glib::RefPtr<Gio::Mount> CppType; - typedef GMount* CType; - typedef GMount* CTypeNonConst; + using CppType = Glib::RefPtr<Gio::Mount>; + using CType = GMount*; + using CTypeNonConst = GMount*; static CType to_c_type (const CppType& item) { return Glib::unwrap (item); } diff --git a/gio/src/notification.hg b/gio/src/notification.hg index 02ff5e8f..df9a7ee3 100644 --- a/gio/src/notification.hg +++ b/gio/src/notification.hg @@ -120,7 +120,7 @@ public: template <typename T_Value> void Notification::add_button(const Glib::ustring& label, const Glib::ustring& action, const T_Value& target) { - typedef Glib::Variant<T_Value> type_glib_variant; + using type_glib_variant = Glib::Variant<T_Value>; add_button_variant(label, action, type_glib_variant::create(target)); } @@ -128,7 +128,7 @@ void Notification::add_button(const Glib::ustring& label, const Glib::ustring& a template <typename T_Value> void Notification::set_default_action(const Glib::ustring& action, const T_Value& target) { - typedef Glib::Variant<T_Value> type_glib_variant; + using type_glib_variant = Glib::Variant<T_Value>; set_default_action_variant(action, type_glib_variant::create(target)); } diff --git a/gio/src/simpleaction.hg b/gio/src/simpleaction.hg index 253b46f8..9a328198 100644 --- a/gio/src/simpleaction.hg +++ b/gio/src/simpleaction.hg @@ -23,7 +23,7 @@ _PINCLUDE(glibmm/private/object_p.h) #ifndef DOXYGEN_SHOULD_SKIP_THIS typedef struct _GSimpleAction GSimpleAction; -typedef GObjectClass GSimpleActionClass; +using GSimpleActionClass = GObjectClass; #endif /* DOXYGEN_SHOULD_SKIP_THIS */ namespace Gio diff --git a/gio/src/srvtarget.hg b/gio/src/srvtarget.hg index 87008922..edaf02fd 100644 --- a/gio/src/srvtarget.hg +++ b/gio/src/srvtarget.hg @@ -63,9 +63,9 @@ public: struct SrvTargetListTraits { - typedef Gio::SrvTarget CppType; - typedef const GSrvTarget* CType; - typedef GSrvTarget* CTypeNonConst; + using CppType = Gio::SrvTarget; + using CType = const GSrvTarget*; + using CTypeNonConst = GSrvTarget*; static CType to_c_type(const CppType& item) { return item.gobj(); } static CType to_c_type(CType ptr) { return ptr; } @@ -75,7 +75,7 @@ struct SrvTargetListTraits #endif // DOXYGEN_SHOULD_SKIP_THIS -typedef Glib::ListHandle<Gio::SrvTarget, SrvTargetListTraits> ListHandle_SrvTarget; +using ListHandle_SrvTarget = Glib::ListHandle<Gio::SrvTarget, SrvTargetListTraits>; } // namespace Gio diff --git a/gio/src/volume.hg b/gio/src/volume.hg index 6d54bd82..47ffa57b 100644 --- a/gio/src/volume.hg +++ b/gio/src/volume.hg @@ -201,9 +201,9 @@ namespace Container_Helpers template <> struct TypeTraits< Glib::RefPtr<Gio::Volume> > { - typedef Glib::RefPtr<Gio::Volume> CppType; - typedef GVolume* CType; - typedef GVolume* CTypeNonConst; + using CppType = Glib::RefPtr<Gio::Volume>; + using CType = GVolume*; + using CTypeNonConst = GVolume*; static CType to_c_type (const CppType& item) { return Glib::unwrap (item); } diff --git a/glib/src/balancedtree.hg b/glib/src/balancedtree.hg index f9190e55..47073204 100644 --- a/glib/src/balancedtree.hg +++ b/glib/src/balancedtree.hg @@ -57,8 +57,8 @@ class BalancedTree { _CLASS_GENERIC(BalancedTree, GTree) public: - typedef sigc::slot<bool, const K&, const V&> TraverseFunc; - typedef sigc::slot<int, const K&, const K&> CompareFunc; + using TraverseFunc = sigc::slot<bool, const K&, const V&>; + using CompareFunc = sigc::slot<int, const K&, const K&>; protected: BalancedTree() : diff --git a/glib/src/binding.hg b/glib/src/binding.hg index bc8cc369..b30cba18 100644 --- a/glib/src/binding.hg +++ b/glib/src/binding.hg @@ -106,7 +106,7 @@ public: * * @return <tt>true</tt> if the transformation was successful, and <tt>false</tt> otherwise. */ - typedef sigc::slot<bool, const GValue*, GValue*> SlotTransform; + using SlotTransform = sigc::slot<bool, const GValue*, GValue*>; /** Creates a binding between @a source_property and @a target_property, * allowing you to set the transformation functions to be used by the binding. @@ -394,8 +394,8 @@ private: class TransformProp : public sigc::functor_base { public: - typedef bool result_type; - typedef sigc::slot<bool, const T_from&, T_to&> SlotTypedTransform; + using result_type = bool; + using SlotTypedTransform = sigc::slot<bool, const T_from&, T_to&>; TransformProp(const SlotTypedTransform& slot) : typed_transform(slot) {} diff --git a/glib/src/date.hg b/glib/src/date.hg index 5a307e61..228272a8 100644 --- a/glib/src/date.hg +++ b/glib/src/date.hg @@ -34,8 +34,8 @@ namespace Glib class Date { public: - typedef guint8 Day; - typedef guint16 Year; + using Day = guint8 ; + using Year = guint16; _WRAP_ENUM(Month, GDateMonth, s#^DATE_##, NO_GTYPE, get_type_func=) _WRAP_ENUM(Weekday, GDateWeekday, s#^DATE_##, NO_GTYPE) diff --git a/glib/src/datetime.hg b/glib/src/datetime.hg index 82bcd56f..023cca31 100644 --- a/glib/src/datetime.hg +++ b/glib/src/datetime.hg @@ -35,7 +35,7 @@ class TimeZone; /** A value representing an interval of time, in microseconds. As GTimeSpan, * its underlying type is gint64. */ -typedef GTimeSpan TimeSpan; +using TimeSpan = GTimeSpan; /** DateTime - A structure representing Date and Time. * DateTime is a structure that combines a Gregorian date and time into a diff --git a/glib/src/fileutils.hg b/glib/src/fileutils.hg index 4320c420..b8792b60 100644 --- a/glib/src/fileutils.hg +++ b/glib/src/fileutils.hg @@ -257,8 +257,8 @@ private: class Dir { public: - typedef DirIterator iterator; - typedef DirIterator const_iterator; + using iterator = DirIterator; + using const_iterator = DirIterator; /** Opens a directory for reading. The names of the files in the * directory can then be retrieved using read_name(). diff --git a/glib/src/markup.hg b/glib/src/markup.hg index 14c4163b..1075f690 100644 --- a/glib/src/markup.hg +++ b/glib/src/markup.hg @@ -97,7 +97,7 @@ namespace Markup class ParseContext; /** @ingroup Markup */ -typedef Glib::MarkupError Error; +using Error = Glib::MarkupError; /** Escapes text so that the markup parser will parse it verbatim. @@ -132,8 +132,8 @@ _WRAP_ENUM(ParseFlags, GMarkupParseFlags, NO_GTYPE, s#^MARKUP_##) class AttributeKeyLess { public: - typedef Glib::ustring first_argument_type; - typedef Glib::ustring second_argument_type; + using first_argument_type = Glib::ustring; + using second_argument_type = Glib::ustring; typedef bool result_type; bool operator()(const Glib::ustring& lhs, const Glib::ustring& rhs) const; diff --git a/glib/src/nodetree.hg b/glib/src/nodetree.hg index ec6a5456..75b63c04 100644 --- a/glib/src/nodetree.hg +++ b/glib/src/nodetree.hg @@ -69,8 +69,8 @@ class NodeTree { _CLASS_GENERIC(NodeTree, GNode) public: - typedef sigc::slot<bool, NodeTree<T>&> TraverseFunc; - typedef sigc::slot<void, NodeTree<T>&> ForeachFunc; + using TraverseFunc = sigc::slot<bool, NodeTree<T>&>; + using ForeachFunc = sigc::slot<void, NodeTree<T>&>; private: static NodeTree<T>* wrap(GNode* node) @@ -340,7 +340,7 @@ public: sigc::slot<void, GNode*, const T&, GNode**> real_slot = sigc::ptr_fun(on_compare_child); GNode* child = nullptr; - typedef sigc::slot<void, GNode*> type_foreach_gnode_slot; + using type_foreach_gnode_slot = sigc::slot<void, GNode*>; type_foreach_gnode_slot bound_slot = sigc::bind(real_slot, the_data, &child); g_node_children_foreach(gobj(), (GTraverseFlags)flags, c_callback_foreach_compare_child, reinterpret_cast<gpointer>(&bound_slot)); @@ -374,7 +374,7 @@ public: sigc::slot<gboolean, GNode*, const T&, GNode**> real_slot = sigc::ptr_fun(on_compare_node); GNode* child = nullptr; - typedef sigc::slot<gboolean, GNode*> type_traverse_gnode_slot; + using type_traverse_gnode_slot = sigc::slot<gboolean, GNode*>; type_traverse_gnode_slot bound_slot = sigc::bind(real_slot, the_data, &child); g_node_traverse(const_cast<GNode*>(gobj()), (GTraverseType)order, (GTraverseFlags)flags, -1, c_callback_traverse_compare_node, reinterpret_cast<gpointer>(&bound_slot)); diff --git a/glib/src/optiongroup.hg b/glib/src/optiongroup.hg index 5cfe0e5e..b4e08464 100644 --- a/glib/src/optiongroup.hg +++ b/glib/src/optiongroup.hg @@ -85,8 +85,8 @@ public: _IGNORE(g_option_group_add_entries) - typedef std::vector<Glib::ustring> vecustrings; - typedef std::vector<std::string> vecstrings; + using vecustrings = std::vector<Glib::ustring>; + using vecstrings = std::vector<std::string>; /** Add a boolean option @a entry. * The @arg parameter will be set to the option's extra argument diff --git a/glib/src/spawn.hg b/glib/src/spawn.hg index 830ad9eb..09490482 100644 --- a/glib/src/spawn.hg +++ b/glib/src/spawn.hg @@ -26,7 +26,7 @@ _DEFS(glibmm,glib) namespace Glib { -typedef GPid Pid; +using Pid = GPid; _WRAP_ENUM(SpawnFlags, GSpawnFlags, NO_GTYPE) @@ -42,7 +42,7 @@ _WRAP_GERROR(SpawnError, GSpawnError, G_SPAWN_ERROR, NO_GTYPE, s#^2BIG$#TOOBIG#) /** For instance,<br> * void on_child_setup(); */ -typedef sigc::slot<void> SlotSpawnChildSetup; +using SlotSpawnChildSetup = sigc::slot<void>; /** Executes a child program asynchronously (your program will not * block waiting for the child to exit). The child program is diff --git a/glib/src/thread.hg b/glib/src/thread.hg index 24df5de3..57b940f2 100644 --- a/glib/src/thread.hg +++ b/glib/src/thread.hg @@ -719,7 +719,7 @@ private: template <class T> struct StaticPrivate { - typedef void (*DestroyNotifyFunc) (void*); + using DestroyNotifyFunc = void (*) (void*); static void delete_ptr(void* data); @@ -746,7 +746,7 @@ public: Private(const Private<T>&) = delete; Private<T>& operator=(const Private<T>&) = delete; - typedef void (*DestructorFunc) (void*); + using DestructorFunc = void (*) (void*); static void delete_ptr(void* data); diff --git a/glib/src/threads.hg b/glib/src/threads.hg index 51decfc6..6340f45f 100644 --- a/glib/src/threads.hg +++ b/glib/src/threads.hg @@ -596,7 +596,7 @@ public: Private(const Private<T>&) = delete; Private<T>& operator=(const Private<T>&) = delete; - typedef void (*DestructorFunc) (void*); + using DestructorFunc = void (*) (void*); /** Deletes static_cast<T*>(data) */ diff --git a/glib/src/valuearray.hg b/glib/src/valuearray.hg index 518123f6..c1b56385 100644 --- a/glib/src/valuearray.hg +++ b/glib/src/valuearray.hg @@ -55,7 +55,7 @@ public: * The compare function should return -1 if v1 < v2, 0 if v1 == v2, and 1 if * v1 > v2. */ - typedef sigc::slot<int, const Glib::ValueBase&, const Glib::ValueBase&> SlotCompare; + using SlotCompare = sigc::slot<int, const Glib::ValueBase&, const Glib::ValueBase&>; /** Default constructor. Constructs a new array with no pre-allocation. */ diff --git a/glib/src/variant.ccg b/glib/src/variant.ccg index 3093dfa2..bde8b4b7 100644 --- a/glib/src/variant.ccg +++ b/glib/src/variant.ccg @@ -154,7 +154,7 @@ VariantContainerBase::VariantContainerBase(GVariant* castitem, bool take_a_refer VariantContainerBase VariantContainerBase::create_tuple(const std::vector<VariantBase>& children) { - typedef GVariant* var_ptr; + using var_ptr = GVariant*; var_ptr* const var_array = new var_ptr[children.size()]; for (std::vector<VariantBase>::size_type i = 0; i < children.size(); i++) @@ -417,7 +417,7 @@ Variant<std::string>::get() const /*--------------------Variant< std::vector<Glib::ustring> >---------------------*/ -typedef std::vector<Glib::ustring> type_vec_ustring; +using type_vec_ustring = std::vector<Glib::ustring>; Variant<type_vec_ustring>::Variant() : VariantContainerBase() { @@ -501,7 +501,7 @@ Variant<type_vec_ustring>::get_iter() const /*--------------------Variant< std::vector<std::string> >---------------------*/ -typedef std::vector<std::string> type_vec_string; +using type_vec_string = std::vector<std::string>; Variant<type_vec_string>::Variant() : VariantContainerBase() { diff --git a/glib/src/variant.hg b/glib/src/variant.hg index c73fc8ed..c90fa550 100644 --- a/glib/src/variant.hg +++ b/glib/src/variant.hg @@ -98,7 +98,7 @@ public: /** This typedef is just to make it more obvious that * our operator const void* should be used like operator bool(). */ - typedef const void* BoolExpr; + using BoolExpr = const void*; /** Test whether the Variant has an underlying instance. * @@ -285,8 +285,8 @@ class VariantStringBase : public VariantBase _CLASS_GENERIC(VariantStringBase, GVariant) public: - typedef GVariant* CType; - typedef VariantStringBase CppType; + using CType = GVariant*; + using CppType = VariantStringBase; /// Default constructor. VariantStringBase(); @@ -340,8 +340,8 @@ class VariantContainerBase : public VariantBase _CLASS_GENERIC(VariantContainerBase, GVariant) public: - typedef GVariant* CType; - typedef VariantContainerBase CppType; + using CType = GVariant*; + using CppType = VariantContainerBase; /// Default constructor. VariantContainerBase(); @@ -430,7 +430,7 @@ template<class T> class Variant : public VariantBase { public: - typedef T CppType; + using CppType = T; }; /****************** Specializations ***********************************/ @@ -446,9 +446,9 @@ class Variant<VariantBase> : public VariantContainerBase _CLASS_GENERIC(Variant<VariantBase>, GVariant) public: - typedef GVariant* CType; - typedef VariantBase CppType; - typedef Variant<VariantBase> CppContainerType; + using CType = GVariant*; + using CppType = VariantBase; + using CppContainerType = Variant<VariantBase>; /// Default constructor. Variant<VariantBase>(); @@ -492,9 +492,9 @@ template<class T> class Variant< Variant<T> > : public VariantContainerBase { public: - typedef GVariant* CType; - typedef Variant<T> CppType; - typedef Variant<CppType> CppContainerType; + using CType = GVariant*; + using CppType = Variant<T>; + using CppContainerType = Variant<CppType>; /// Default constructor. Variant< Variant<T> >(); @@ -539,8 +539,8 @@ class Variant<Glib::ustring> : public VariantStringBase // Trick gmmproc into thinking this is derived from GVariant to wrap some methods. _CLASS_GENERIC(Variant<Glib::ustring>, GVariant) public: - typedef char* CType; - typedef Glib::ustring CppType; + using CType = char*; + using CppType = Glib::ustring; /// Default constructor. Variant<Glib::ustring>(); @@ -592,8 +592,8 @@ class Variant<std::string> : public VariantStringBase // Trick gmmproc into thinking this is derived from GVariant to wrap some methods. _CLASS_GENERIC(Variant<std::string>, GVariant) public: - typedef char* CType; - typedef std::string CppType; + using CType = char* ; + using CppType = std::string; /// Default constructor. Variant<std::string>(); @@ -638,8 +638,8 @@ template<class K, class V> class Variant< std::pair<K, V> > : public VariantContainerBase { public: - typedef std::pair<K, V> CppType; - typedef Variant<CppType> CppContainerType; + using CppType = std::pair<K, V>; + using CppContainerType = Variant<CppType>; /// Default constructor. Variant< std::pair<K, V> >() @@ -687,8 +687,8 @@ template<class T> class Variant< std::vector<T> > : public VariantContainerBase { public: - typedef T CppType; - typedef std::vector<T> CppContainerType; + using CppType = T ; + using CppContainerType = std::vector<T>; /// Default constructor. Variant< std::vector<T> >() @@ -756,8 +756,8 @@ template<> class Variant< std::vector<Glib::ustring> > : public VariantContainerBase { public: - typedef Glib::ustring CppType; - typedef std::vector<Glib::ustring> CppContainerType; + using CppType = Glib::ustring ; + using CppContainerType = std::vector<Glib::ustring>; /// Default constructor. Variant< std::vector<Glib::ustring> >(); @@ -820,8 +820,8 @@ template<> class Variant< std::vector<std::string> > : public VariantContainerBase { public: - typedef std::string CppType; - typedef std::vector<std::string> CppContainerType; + using CppType = std::string ; + using CppContainerType = std::vector<std::string>; /// Default constructor. Variant< std::vector<std::string> >(); @@ -896,8 +896,8 @@ template<class K, class V> class Variant< std::map<K, V> >: public VariantContainerBase { public: - typedef std::pair<K, V> CppType; - typedef std::map<K, V> CppContainerType; + using CppType = std::pair<K, V>; + using CppContainerType = std::map<K, V>; /// Default constructor. Variant< std::map<K, V> >() diff --git a/glib/src/variantdict.hg b/glib/src/variantdict.hg index 7b668691..296f1e2d 100644 --- a/glib/src/variantdict.hg +++ b/glib/src/variantdict.hg @@ -102,7 +102,7 @@ public: template <typename T_Value> void VariantDict::insert_value(const Glib::ustring& key, const T_Value& value) { - typedef Glib::Variant<T_Value> type_glib_variant; + using type_glib_variant = Glib::Variant<T_Value>; //TODO: Can we do any check like this here, before glib does? //g_return_val_if_fail( @@ -116,7 +116,7 @@ bool VariantDict::lookup_value(const Glib::ustring& key, T_Value& value) const { value = T_Value(); //Make sure that it is initialized. - typedef Glib::Variant<T_Value> type_glib_variant; + using type_glib_variant = Glib::Variant<T_Value>; //TODO: Can we do any check like this here, before glib does? //g_variant_type_equal(g_action_group_get_action_state_type(const_cast<GActionGroup*>(gobj()), action_name.c_str()), type_glib_variant::variant_type().gobj())); diff --git a/glib/src/varianttype.ccg b/glib/src/varianttype.ccg index 4f43b569..8274c931 100644 --- a/glib/src/varianttype.ccg +++ b/glib/src/varianttype.ccg @@ -54,7 +54,7 @@ VariantType::operator=(const GVariantType* castitem) VariantType VariantType::create_tuple(const std::vector<VariantType>& items) { - typedef GVariantType* var_ptr; + using var_ptr = GVariantType*; const auto var_array = new var_ptr[items.size()]; for (std::vector<VariantType>::size_type i = 0; i < items.size(); i++) |