Imported Upstream version 2.48.1 upstream/2.48.1
authorDongHun Kwak <dh0128.kwak@samsung.com>
Mon, 7 Sep 2020 07:11:43 +0000 (00:11 -0700)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Mon, 7 Sep 2020 07:11:43 +0000 (00:11 -0700)
99 files changed:
NEWS
build/cxx.m4
configure.ac
examples/thread/dispatcher2.cc
gio/giomm/socketsource.h
gio/src/action.hg
gio/src/actiongroup.hg
gio/src/actionmap.hg
gio/src/application.ccg
gio/src/application.hg
gio/src/asyncinitable.ccg
gio/src/cancellable.hg
gio/src/dbusauthobserver.ccg
gio/src/dbusconnection.hg
gio/src/dbusinterfacevtable.hg
gio/src/dbusmessage.ccg
gio/src/dbusownname.hg
gio/src/dbusproxy.ccg
gio/src/dbusproxy.hg
gio/src/dbussubtreevtable.hg
gio/src/dbuswatchname.hg
gio/src/drive.hg
gio/src/file.ccg
gio/src/file.hg
gio/src/memoryinputstream.hg
gio/src/mount.hg
gio/src/notification.hg
gio/src/simpleaction.hg
gio/src/srvtarget.hg
gio/src/volume.hg
glib/glibmm/arrayhandle.h
glib/glibmm/class.h
glib/glibmm/containerhandle_shared.h
glib/glibmm/containers.h
glib/glibmm/dispatcher.cc
glib/glibmm/error.cc
glib/glibmm/error.h
glib/glibmm/exceptionhandler.cc
glib/glibmm/helperlist.h
glib/glibmm/interface.h
glib/glibmm/listhandle.h
glib/glibmm/main.h
glib/glibmm/object.h
glib/glibmm/objectbase.h
glib/glibmm/pattern.h
glib/glibmm/private/interface_p.h
glib/glibmm/private/object_p.h
glib/glibmm/property.h
glib/glibmm/propertyproxy.h
glib/glibmm/propertyproxy_base.h
glib/glibmm/random.h
glib/glibmm/refptr.h
glib/glibmm/sarray.h
glib/glibmm/signalproxy.h
glib/glibmm/signalproxy_connectionnode.h
glib/glibmm/slisthandle.h
glib/glibmm/threadpool.h
glib/glibmm/timer.h
glib/glibmm/ustring.h
glib/glibmm/value.h
glib/glibmm/value_custom.h
glib/glibmm/vectorutils.h
glib/glibmm/wrap.cc
glib/glibmm/wrap.h
glib/src/balancedtree.hg
glib/src/binding.hg
glib/src/date.hg
glib/src/datetime.hg
glib/src/fileutils.hg
glib/src/markup.hg
glib/src/nodetree.hg
glib/src/optiongroup.hg
glib/src/spawn.hg
glib/src/thread.hg
glib/src/threads.hg
glib/src/value_basictypes.h.m4
glib/src/valuearray.hg
glib/src/variant.ccg
glib/src/variant.hg
glib/src/variant_basictypes.h.m4
glib/src/variantdict.hg
glib/src/varianttype.ccg
tests/glibmm_btree/main.cc
tests/glibmm_interface_move/main.cc
tests/glibmm_nodetree/main.cc
tests/glibmm_null_containerhandle/main.cc
tests/glibmm_null_vectorutils/main.cc
tests/glibmm_variant/main.cc
tools/extra_defs_gen/generate_extra_defs.h
tools/m4/class_boxedtype.m4
tools/m4/class_boxedtype_static.m4
tools/m4/class_generic.m4
tools/m4/class_gobject.m4
tools/m4/class_interface.m4
tools/m4/class_opaque_copyable.m4
tools/m4/class_opaque_refcounted.m4
tools/m4/class_shared.m4
tools/m4/signal.m4
tools/m4/vfunc.m4

diff --git a/NEWS b/NEWS
index 7639ae1..73fdf0c 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,15 @@
+2.48.1:
+
+Build:
+* MacOS X: Add alternative #ifdefed code when thread_local
+  is not supported by the compiler.
+  (Tom Schoonjans) Bug #759791
+* Replace most typedefs with the C++11 using keyword.
+
+2.48.0:
+
+* No major changes compared to 2.47.92.
+
 2.47.92:
 
 * Adapt to libsigc++-2.0 2.8:
index 22d2435..58e4f85 100644 (file)
@@ -236,3 +236,24 @@ AS_VAR_IF([glibmm_cv_cxx_can_use_namespaces_inside_externc], ['yes'],
           [AC_DEFINE([GLIBMM_CAN_USE_NAMESPACES_INSIDE_EXTERNC], [1],
                      [Define if the compiler honors namespaces inside extern "C" blocks.])])[]dnl
 ])
+
+## GLIBMM_CXX_CAN_USE_THREAD_LOCAL
+##
+## Check for thread_local support
+##
+AC_DEFUN([GLIBMM_CXX_CAN_USE_THREAD_LOCAL],
+[dnl
+AC_CACHE_CHECK(
+  [whether the thread_local keyword is supported],
+  [glibmm_cv_cxx_can_use_thread_local],
+  [AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+[[
+thread_local int i=0;
+]], [])],
+    [glibmm_cv_cxx_can_use_thread_local=yes],
+    [glibmm_cv_cxx_can_use_thread_local=no])])
+
+AS_VAR_IF([glibmm_cv_cxx_can_use_thread_local], ['yes'],
+          [AC_DEFINE([GLIBMM_CAN_USE_THREAD_LOCAL], [1],
+                     [Define if the thread_local keyword is supported.])])[]dnl
+])
index 52a001e..7245404 100644 (file)
@@ -15,7 +15,7 @@
 ## You should have received a copy of the GNU Lesser General Public License
 ## along with this library.  If not, see <http://www.gnu.org/licenses/>.
 
-AC_INIT([glibmm], [2.48.0],
+AC_INIT([glibmm], [2.48.1],
         [http://bugzilla.gnome.org/enter_bug.cgi?product=glibmm],
         [glibmm], [http://www.gtkmm.org/])
 AC_PREREQ([2.59])
@@ -104,6 +104,7 @@ GLIBMM_CXX_CAN_USE_DYNAMIC_CAST_IN_UNUSED_TEMPLATE_WITHOUT_DEFINITION
 GLIBMM_CXX_CAN_ASSIGN_NON_EXTERN_C_FUNCTIONS_TO_EXTERN_C_CALLBACKS
 GLIBMM_CXX_CAN_USE_NAMESPACES_INSIDE_EXTERNC
 GLIBMM_CXX_ALLOWS_STATIC_INLINE_NPOS
+GLIBMM_CXX_CAN_USE_THREAD_LOCAL
 GLIBMM_C_STD_TIME_T_IS_NOT_INT32
 
 MM_ARG_ENABLE_DOCUMENTATION
index 2891293..dbe176c 100644 (file)
@@ -41,7 +41,7 @@ public:
   void signal_finished_emit();
   void print() const;
 
-  typedef sigc::signal<void> type_signal_end;
+  using type_signal_end = sigc::signal<void>;
   static type_signal_end& signal_end();
 
 private:
index 2096816..c1345c6 100644 (file)
@@ -100,7 +100,7 @@ SignalSocket signal_socket(
 class SocketSource : public Glib::IOSource
 {
 public:
-  typedef Gio::SocketSource CppObjectType;
+  using CppObjectType = Gio::SocketSource;
 
   static Glib::RefPtr<SocketSource> create(const Glib::RefPtr<Socket>& socket,
     Glib::IOCondition condition,
index 8788da3..5f5e864 100644 (file)
@@ -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()));
index 3e42368..d8f9c10 100644 (file)
@@ -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);
 
index 6f32fdb..e401fc8 100644 (file)
@@ -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.
index 7b80eed..7b53edf 100644 (file)
@@ -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.
index a72ba68..0545516 100644 (file)
@@ -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.
    *
index 7996070..e91c984 100644 (file)
@@ -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();
 }
 
index 886dc27..47196c0 100644 (file)
@@ -37,7 +37,7 @@ protected:
   _CTOR_DEFAULT
 
 public:
-  typedef sigc::slot<void> SlotCancelledCallback;
+  using SlotCancelledCallback = sigc::slot<void>;
 
   _WRAP_CREATE()
 
index 7ca00c7..8c30743 100644 (file)
@@ -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
 {
index ff226fd..6b0e558 100644 (file)
@@ -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.
    *
index 87aeee0..caf181a 100644 (file)
@@ -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.
index fb2cd8a..751fbfd 100644 (file)
@@ -30,7 +30,7 @@ namespace Gio
 namespace DBus
 {
 
-typedef Message::ByteOrder ByteOrder;
+using ByteOrder = Message::ByteOrder;
 
 void
 Message::get_body(Glib::VariantBase& value) const
index 6613b70..8690d10 100644 (file)
@@ -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.
index a818573..b13f92f 100644 (file)
@@ -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,
index 0f79156..c015e77 100644 (file)
@@ -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).
index b5e921b..ead80ee 100644 (file)
@@ -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.
index ef555b7..dd697ce 100644 (file)
@@ -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
index 30ab250..59c5fff 100644 (file)
@@ -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); }
index b9b8771..9190f43 100644 (file)
@@ -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(
index da1ba6a..859cf25 100644 (file)
@@ -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); }
index 9ac5f9a..0fc03f4 100644 (file)
@@ -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.
    *
index 07ae84e..2e91bea 100644 (file)
@@ -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); }
index 02ff5e8..df9a7ee 100644 (file)
@@ -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));
 }
index 253b46f..9a32819 100644 (file)
@@ -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
index 8700892..edaf02f 100644 (file)
@@ -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
 
index 6d54bd8..47ffa57 100644 (file)
@@ -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); }
index 19454cb..02ec243 100644 (file)
@@ -51,7 +51,7 @@ template <class For, class Tr>
 typename Tr::CType*
 create_array(For pbegin, std::size_t size, Tr)
 {
-  typedef typename Tr::CType CType;
+  using CType = typename Tr::CType;
 
   CType* const array = static_cast<CType*>(g_malloc((size + 1) * sizeof(CType)));
   CType* const array_end = array + size;
@@ -90,7 +90,7 @@ create_bool_array(For pbegin, std::size_t size)
 template <class Tr, class Cont>
 struct ArraySourceTraits
 {
-  typedef typename Tr::CType CType;
+  using CType = typename Tr::CType;
 
   static std::size_t get_size(const Cont& cont) { return cont.size(); }
 
@@ -106,7 +106,7 @@ struct ArraySourceTraits
 template <class Cont>
 struct BoolArraySourceTraits
 {
-  typedef gboolean CType;
+  using CType = gboolean;
 
   static std::size_t get_size(const Cont& cont) { return cont.size(); }
 
@@ -123,7 +123,7 @@ struct BoolArraySourceTraits
 template <class Tr, class Cont>
 struct ArraySourceTraits<Tr, Cont*>
 {
-  typedef typename Tr::CType CType;
+  using CType = typename Tr::CType;
 
   static std::size_t get_size(const CType* array)
   {
@@ -148,7 +148,7 @@ struct ArraySourceTraits<Tr, const Cont*> : ArraySourceTraits<Tr, Cont*>
 template <class Tr, class Cont, std::size_t N>
 struct ArraySourceTraits<Tr, Cont[N]>
 {
-  typedef typename Tr::CType CType;
+  using CType = typename Tr::CType;
 
   static std::size_t get_size(const CType*) { return (N - 1); }
 
@@ -171,14 +171,14 @@ template <class Tr>
 class ArrayHandleIterator
 {
 public:
-  typedef typename Tr::CppType CppType;
-  typedef typename Tr::CType CType;
+  using CppType = typename Tr::CppType;
+  using CType = typename Tr::CType;
 
-  typedef std::random_access_iterator_tag iterator_category;
-  typedef CppType value_type;
-  typedef std::ptrdiff_t difference_type;
-  typedef value_type reference;
-  typedef void pointer;
+  using iterator_category = std::random_access_iterator_tag;
+  using value_type = CppType;
+  using difference_type = std::ptrdiff_t;
+  using reference = value_type;
+  using pointer = void;
 
   explicit inline ArrayHandleIterator(const CType* pos);
 
@@ -231,15 +231,15 @@ template <class T, class Tr = Glib::Container_Helpers::TypeTraits<T>>
 class ArrayHandle
 {
 public:
-  typedef typename Tr::CppType CppType;
-  typedef typename Tr::CType CType;
+  using CppType = typename Tr::CppType;
+  using CType = typename Tr::CType;
 
-  typedef CppType value_type;
-  typedef std::size_t size_type;
-  typedef std::ptrdiff_t difference_type;
+  using value_type = CppType;
+  using size_type = std::size_t;
+  using difference_type = std::ptrdiff_t;
 
-  typedef Glib::Container_Helpers::ArrayHandleIterator<Tr> const_iterator;
-  typedef Glib::Container_Helpers::ArrayHandleIterator<Tr> iterator;
+  using const_iterator = Glib::Container_Helpers::ArrayHandleIterator<Tr>;
+  using iterator = Glib::Container_Helpers::ArrayHandleIterator<Tr>;
 
   template <class Cont>
   inline ArrayHandle(const Cont& container);
@@ -286,18 +286,18 @@ template <>
 class ArrayHandle<bool, Container_Helpers::TypeTraits<bool>>
 {
 public:
-  typedef ArrayHandle<bool, Container_Helpers::TypeTraits<bool>> Me;
-  typedef Container_Helpers::TypeTraits<bool> Tr;
+  using Me = ArrayHandle<bool, Container_Helpers::TypeTraits<bool>>;
+  using Tr = Container_Helpers::TypeTraits<bool>;
 
-  typedef Tr::CppType CppType;
-  typedef Tr::CType CType;
+  using CppType = Tr::CppType;
+  using CType = Tr::CType;
 
-  typedef CppType value_type;
-  typedef std::size_t size_type;
-  typedef std::ptrdiff_t difference_type;
+  using value_type = CppType;
+  using size_type = std::size_t;
+  using difference_type = std::ptrdiff_t;
 
-  typedef Glib::Container_Helpers::ArrayHandleIterator<Tr> const_iterator;
-  typedef Glib::Container_Helpers::ArrayHandleIterator<Tr> iterator;
+  using const_iterator = Glib::Container_Helpers::ArrayHandleIterator<Tr>;
+  using iterator = Glib::Container_Helpers::ArrayHandleIterator<Tr>;
 
   template <class Cont>
   inline ArrayHandle(const Cont& container);
@@ -383,7 +383,7 @@ private:
  *
  * @ingroup ContHandles
  */
-typedef ArrayHandle<Glib::ustring> StringArrayHandle;
+using StringArrayHandle = ArrayHandle<Glib::ustring>;
 
 /***************************************************************************/
 /*  Inline implementation                                                  */
index 691c1bf..bc5a06a 100644 (file)
@@ -67,7 +67,7 @@ public:
   GType clone_custom_type(const char* custom_type_name) const;
 
   /// The type that holds pointers to the interfaces of custom types.
-  typedef std::vector<const Interface_Class*> interface_class_vector_type;
+  using interface_class_vector_type = std::vector<const Interface_Class*>;
 
   /** Register a static custom GType, derived from the parent of this class's type.
    * The parent type of the registered custom type is the same C class as the parent
@@ -103,7 +103,7 @@ private:
 public:
 #ifndef DOXYGEN_SHOULD_SKIP_THIS
   // The type that holds the values of the interface properties of custom types.
-  typedef std::vector<GValue*> iface_properties_type;
+  using iface_properties_type = std::vector<GValue*>;
   // The quark used for storing/getting the interface properties of custom types.
   static GQuark iface_properties_quark;
 #endif
index 7084e9b..dffce99 100644 (file)
@@ -107,9 +107,9 @@ namespace Container_Helpers
 template <class T>
 struct TypeTraits
 {
-  typedef T CppType;
-  typedef T CType;
-  typedef T CTypeNonConst;
+  using CppType = T;
+  using CType = T;
+  using CTypeNonConst = T;
 
   static CType to_c_type(const CppType& item) { return item; }
   static CppType to_cpp_type(const CType& item) { return item; }
@@ -128,9 +128,9 @@ struct TypeTraits
 template <class T>
 struct TypeTraits<T*>
 {
-  typedef T* CppType;
-  typedef typename T::BaseObjectType* CType;
-  typedef typename T::BaseObjectType* CTypeNonConst;
+  using CppType = T*;
+  using CType = typename T::BaseObjectType*;
+  using CTypeNonConst = typename T::BaseObjectType*;
 
   static CType to_c_type(CppType ptr) { return Glib::unwrap(ptr); }
   static CType to_c_type(CType ptr) { return ptr; }
@@ -160,9 +160,9 @@ struct TypeTraits<T*>
 template <class T>
 struct TypeTraits<const T*>
 {
-  typedef const T* CppType;
-  typedef const typename T::BaseObjectType* CType;
-  typedef typename T::BaseObjectType* CTypeNonConst;
+  using CppType = const T*;
+  using CType = const typename T::BaseObjectType*;
+  using CTypeNonConst = typename T::BaseObjectType*;
 
   static CType to_c_type(CppType ptr) { return Glib::unwrap(ptr); }
   static CType to_c_type(CType ptr) { return ptr; }
@@ -191,9 +191,9 @@ struct TypeTraits<const T*>
 template <class T>
 struct TypeTraits<Glib::RefPtr<T>>
 {
-  typedef Glib::RefPtr<T> CppType;
-  typedef typename T::BaseObjectType* CType;
-  typedef typename T::BaseObjectType* CTypeNonConst;
+  using CppType = Glib::RefPtr<T>;
+  using CType = typename T::BaseObjectType*;
+  using CTypeNonConst = typename T::BaseObjectType*;
 
   static CType to_c_type(const CppType& ptr) { return Glib::unwrap(ptr); }
   static CType to_c_type(CType ptr) { return ptr; }
@@ -227,9 +227,9 @@ struct TypeTraits<Glib::RefPtr<T>>
 template <class T>
 struct TypeTraits<Glib::RefPtr<const T>>
 {
-  typedef Glib::RefPtr<const T> CppType;
-  typedef const typename T::BaseObjectType* CType;
-  typedef typename T::BaseObjectType* CTypeNonConst;
+  using CppType = Glib::RefPtr<const T>;
+  using CType = const typename T::BaseObjectType*;
+  using CTypeNonConst = typename T::BaseObjectType*;
 
   static CType to_c_type(const CppType& ptr) { return Glib::unwrap(ptr); }
   static CType to_c_type(CType ptr) { return ptr; }
@@ -267,9 +267,9 @@ struct TypeTraits<Glib::RefPtr<const T>>
 template <>
 struct TypeTraits<Glib::ustring>
 {
-  typedef Glib::ustring CppType;
-  typedef const char* CType;
-  typedef char* CTypeNonConst;
+  using CppType = Glib::ustring;
+  using CType = const char*;
+  using CTypeNonConst = char*;
 
   static CType to_c_type(const Glib::ustring& str) { return str.c_str(); }
   static CType to_c_type(const std::string& str) { return str.c_str(); }
@@ -289,9 +289,9 @@ struct TypeTraits<Glib::ustring>
 template <>
 struct TypeTraits<std::string>
 {
-  typedef std::string CppType;
-  typedef const char* CType;
-  typedef char* CTypeNonConst;
+  using CppType = std::string;
+  using CType = const char*;
+  using CTypeNonConst = char*;
 
   static CType to_c_type(const std::string& str) { return str.c_str(); }
   static CType to_c_type(const Glib::ustring& str) { return str.c_str(); }
@@ -308,9 +308,9 @@ struct TypeTraits<std::string>
 template <>
 struct TypeTraits<bool>
 {
-  typedef bool CppType;
-  typedef gboolean CType;
-  typedef gboolean CTypeNonConst;
+  using CppType = bool;
+  using CType = gboolean;
+  using CTypeNonConst = gboolean;
 
   static CType to_c_type(CppType item) { return static_cast<CType>(item); }
   static CType to_c_type(CType item) { return item; }
@@ -324,9 +324,9 @@ struct TypeTraits<bool>
 template <>
 struct TypeTraits<Glib::VariantBase>
 {
-  typedef Glib::VariantBase CppType;
-  typedef GVariant* CType;
-  typedef GVariant* CTypeNonConst;
+  using CppType = Glib::VariantBase;
+  using CType = GVariant*;
+  using CTypeNonConst = GVariant*;
 
   static CType to_c_type(const Glib::VariantBase& v) { return const_cast<CTypeNonConst>(v.gobj()); }
 
@@ -343,9 +343,9 @@ struct TypeTraits<Glib::VariantBase>
 template <>
 struct TypeTraits<Glib::VariantContainerBase>
 {
-  typedef Glib::VariantContainerBase CppType;
-  typedef GVariant* CType;
-  typedef GVariant* CTypeNonConst;
+  using CppType = Glib::VariantContainerBase;
+  using CType = GVariant*;
+  using CTypeNonConst = GVariant*;
 
   static CType to_c_type(const Glib::VariantContainerBase& v)
   {
index 46b87d0..2382b3c 100644 (file)
@@ -50,9 +50,9 @@ template <class T>
 class List_Iterator_Base
 {
 public:
-  typedef T value_type;
-  typedef T* pointer;
-  typedef T& reference;
+  using value_type = T;
+  using pointer = T*;
+  using reference = T&;
 };
 
 /// For instance, List_Iterator< Gtk::Widget >
@@ -60,17 +60,17 @@ template <class T>
 class List_Iterator : public List_Iterator_Base<T>
 {
 public:
-  typedef std::bidirectional_iterator_tag iterator_category;
-  typedef std::size_t size_type;
-  typedef std::ptrdiff_t difference_type;
+  using iterator_category = std::bidirectional_iterator_tag;
+  using size_type = std::size_t;
+  using difference_type = std::ptrdiff_t;
 
-  typedef typename List_Iterator_Base<T>::pointer pointer;
-  typedef typename List_Iterator_Base<T>::reference reference;
+  using pointer = typename List_Iterator_Base<T>::pointer;
+  using reference = typename List_Iterator_Base<T>::reference;
 
   GList* const* head_;
   GList* node_;
 
-  typedef List_Iterator<T> Self;
+  using Self = List_Iterator<T>;
 
   List_Iterator(GList* const& head, GList* node) : head_(&head), node_(node) {}
 
@@ -124,15 +124,15 @@ template <class T>
 class SList_Iterator : public List_Iterator_Base<T>
 {
 public:
-  typedef std::forward_iterator_tag iterator_category;
-  typedef std::size_t size_type;
-  typedef std::ptrdiff_t difference_type;
+  using iterator_category = std::forward_iterator_tag;
+  using size_type = std::size_t;
+  using difference_type = std::ptrdiff_t;
 
-  typedef typename List_Iterator_Base<T>::pointer pointer;
-  typedef typename List_Iterator_Base<T>::reference reference;
+  using pointer = typename List_Iterator_Base<T>::pointer;
+  using reference = typename List_Iterator_Base<T>::reference;
 
   GSList* node_;
-  typedef SList_Iterator<T> Self;
+  using Self = SList_Iterator<T>;
 
   SList_Iterator(GSList* node) : node_(node) {}
 
@@ -171,14 +171,14 @@ template <class T_Impl, class T_IFace>
 class List_Cpp_Iterator : public List_Iterator_Base<T_IFace>
 {
 public:
-  typedef std::bidirectional_iterator_tag iterator_category;
-  typedef std::size_t size_type;
-  typedef std::ptrdiff_t difference_type;
+  using iterator_category = std::bidirectional_iterator_tag;
+  using size_type = std::size_t;
+  using difference_type = std::ptrdiff_t;
 
-  typedef typename List_Iterator_Base<T_IFace>::pointer pointer;
-  typedef typename List_Iterator_Base<T_IFace>::reference reference;
+  using pointer = typename List_Iterator_Base<T_IFace>::pointer;
+  using reference = typename List_Iterator_Base<T_IFace>::reference;
 
-  typedef List_Cpp_Iterator<T_Impl, T_IFace> Self;
+  using Self = List_Cpp_Iterator<T_Impl, T_IFace>;
 
   GList** head_;
   GList* node_;
@@ -254,15 +254,15 @@ template <class T_Base>
 class List_ReverseIterator : private T_Base
 {
 public:
-  typedef typename T_Base::iterator_category iterator_category;
-  typedef typename T_Base::size_type size_type;
-  typedef typename T_Base::difference_type difference_type;
+  using iterator_category = typename T_Base::iterator_category;
+  using size_type = typename T_Base::size_type;
+  using difference_type = typename T_Base::difference_type;
 
-  typedef typename T_Base::value_type value_type;
-  typedef typename T_Base::pointer pointer;
-  typedef typename T_Base::reference reference;
+  using value_type = typename T_Base::value_type;
+  using pointer = typename T_Base::pointer;
+  using reference = typename T_Base::reference;
 
-  typedef List_ReverseIterator<T_Base> Self;
+  using Self = List_ReverseIterator<T_Base>;
 
   bool operator==(const Self& src) const { return T_Base::operator==(src); }
   bool operator!=(const Self& src) const { return T_Base::operator!=(src); }
@@ -306,15 +306,15 @@ template <class T_Base>
 class List_ConstIterator : public T_Base
 {
 public:
-  typedef typename T_Base::iterator_category iterator_category;
-  typedef typename T_Base::size_type size_type;
-  typedef typename T_Base::difference_type difference_type;
+  using iterator_category = typename T_Base::iterator_category;
+  using size_type = typename T_Base::size_type;
+  using difference_type = typename T_Base::difference_type;
 
-  typedef const typename T_Base::value_type value_type;
-  typedef const typename T_Base::pointer pointer;
-  typedef const typename T_Base::reference reference;
+  using value_type = const typename T_Base::value_type;
+  using pointer = const typename T_Base::pointer;
+  using reference = const typename T_Base::reference;
 
-  typedef List_ConstIterator<T_Base> Self;
+  using Self = List_ConstIterator<T_Base>;
 
   bool operator==(const Self& src) const { return T_Base::operator==(src); }
   bool operator!=(const Self& src) const { return T_Base::operator!=(src); }
index 8525fbe..e21914a 100644 (file)
  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
+#ifndef GLIBMM_CAN_USE_THREAD_LOCAL
+#include <glibmm/threads.h>
+#endif
+
 #include <glibmm/dispatcher.h>
 #include <glibmm/exceptionhandler.h>
 #include <glibmm/fileutils.h>
@@ -143,7 +147,11 @@ protected:
   explicit DispatchNotifier(const Glib::RefPtr<MainContext>& context);
 
 private:
+#ifdef GLIBMM_CAN_USE_THREAD_LOCAL
   static thread_local DispatchNotifier* thread_specific_instance_;
+#else
+  static Glib::Threads::Private<DispatchNotifier> thread_specific_instance_;
+#endif
 
   std::set<const Dispatcher*> deleted_dispatchers_;
 
@@ -166,7 +174,12 @@ private:
 /**** Glib::DispatchNotifier ***********************************************/
 
 // static
+
+#ifdef GLIBMM_CAN_USE_THREAD_LOCAL
 thread_local DispatchNotifier* DispatchNotifier::thread_specific_instance_ = nullptr;
+#else
+Glib::Threads::Private<DispatchNotifier> DispatchNotifier::thread_specific_instance_;
+#endif
 
 DispatchNotifier::DispatchNotifier(const Glib::RefPtr<MainContext>& context)
 : deleted_dispatchers_(),
@@ -269,12 +282,20 @@ DispatchNotifier*
 DispatchNotifier::reference_instance(
   const Glib::RefPtr<MainContext>& context, const Dispatcher* dispatcher)
 {
+#ifdef GLIBMM_CAN_USE_THREAD_LOCAL
   DispatchNotifier* instance = thread_specific_instance_;
+#else
+  DispatchNotifier* instance = thread_specific_instance_.get();
+#endif
 
   if (!instance)
   {
     instance = new DispatchNotifier(context);
+#ifdef GLIBMM_CAN_USE_THREAD_LOCAL
     thread_specific_instance_ = instance;
+#else
+    thread_specific_instance_.replace(instance);
+#endif
   }
   else
   {
@@ -302,7 +323,11 @@ DispatchNotifier::reference_instance(
 void
 DispatchNotifier::unreference_instance(DispatchNotifier* notifier, const Dispatcher* dispatcher)
 {
+#ifdef GLIBMM_CAN_USE_THREAD_LOCAL
   DispatchNotifier* const instance = thread_specific_instance_;
+#else
+  DispatchNotifier* const instance = thread_specific_instance_.get();
+#endif
 
   // Yes, the notifier argument is only used to check for sanity.
   g_return_if_fail(instance == notifier);
@@ -319,8 +344,12 @@ DispatchNotifier::unreference_instance(DispatchNotifier* notifier, const Dispatc
   {
     g_return_if_fail(instance->ref_count_ == 0); // could be < 0 if messed up
 
+#ifdef GLIBMM_CAN_USE_THREAD_LOCAL
     delete thread_specific_instance_;
     thread_specific_instance_ = nullptr;
+#else
+    thread_specific_instance_.replace(nullptr);
+#endif
   }
 }
 
index 34ea87a..0906336 100644 (file)
@@ -27,7 +27,7 @@
 namespace
 {
 
-typedef std::map<GQuark, Glib::Error::ThrowFunc> ThrowFuncTable;
+using ThrowFuncTable = std::map<GQuark, Glib::Error::ThrowFunc>;
 
 static ThrowFuncTable* throw_func_table = nullptr;
 
index 941dc9d..eb61b4e 100644 (file)
@@ -51,7 +51,7 @@ public:
 
   void propagate(GError** dest);
 
-  typedef void (*ThrowFunc)(GError*);
+  using ThrowFunc = void(*)(GError*);
 
   static void register_init();
   static void register_cleanup();
index c12e199..31ddb39 100644 (file)
@@ -19,6 +19,9 @@
  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
+#ifndef GLIBMM_CAN_USE_THREAD_LOCAL
+#include <glibmm/threads.h>
+#endif
 #include <glibmmconfig.h>
 #include <glibmm/error.h>
 #include <glibmm/exceptionhandler.h>
 namespace
 {
 
-typedef sigc::signal<void> HandlerList;
+using HandlerList = sigc::signal<void>;
 
 // Each thread has its own list of exception handlers
 // to avoid thread synchronization problems.
+#ifdef GLIBMM_CAN_USE_THREAD_LOCAL
 static thread_local HandlerList* thread_specific_handler_list = nullptr;
+#else
+static Glib::Threads::Private<HandlerList> thread_specific_handler_list;
+#endif
 
 static void
 glibmm_exception_warning(const GError* error)
@@ -85,12 +92,20 @@ namespace Glib
 sigc::connection
 add_exception_handler(const sigc::slot<void>& slot)
 {
+#ifdef GLIBMM_CAN_USE_THREAD_LOCAL
   HandlerList* handler_list = thread_specific_handler_list;
+#else
+  HandlerList* handler_list = thread_specific_handler_list.get();
+#endif
 
   if (!handler_list)
   {
     handler_list = new HandlerList();
+#ifdef GLIBMM_CAN_USE_THREAD_LOCAL
     thread_specific_handler_list = handler_list;
+#else
+    thread_specific_handler_list.set(handler_list);
+#endif
   }
 
   handler_list->slots().push_front(slot);
@@ -114,7 +129,11 @@ exception_handlers_invoke() noexcept
   // handled.  If there are no more handlers in the list and the exception
   // is still unhandled, call glibmm_unexpected_exception().
 
+#ifdef GLIBMM_CAN_USE_THREAD_LOCAL
   if (HandlerList* const handler_list = thread_specific_handler_list)
+#else
+  if(HandlerList *const handler_list = thread_specific_handler_list.get())
+#endif
   {
     HandlerList::iterator pslot = handler_list->slots().begin();
 
index 41f1074..ac0c2a5 100644 (file)
@@ -51,19 +51,19 @@ public:
 
   virtual ~HelperList() noexcept {}
 
-  typedef T_Child value_type;
-  typedef value_type& reference;
-  typedef const value_type& const_reference;
+  using value_type = T_Child;
+  using reference = value_type&;
+  using const_reference = const value_type&;
 
-  typedef T_Iterator iterator;
-  typedef List_ConstIterator<iterator> const_iterator;
-  typedef List_ReverseIterator<iterator> reverse_iterator;
-  typedef List_ConstIterator<reverse_iterator> const_reverse_iterator;
+  using iterator = T_Iterator;
+  using const_iterator = List_ConstIterator<iterator>;
+  using reverse_iterator = List_ReverseIterator<iterator>;
+  using const_reverse_iterator = List_ConstIterator<reverse_iterator>;
 
-  typedef T_CppElement element_type;
+  using element_type = T_CppElement;
 
-  typedef std::size_t difference_type; // TODO Why not std::ptrdiff_t?
-  typedef std::size_t size_type;
+  using difference_type = std::size_t; // TODO Why not std::ptrdiff_t?
+  using size_type = std::size_t;
 
   // These are implemented differently for each Helper List.
   virtual iterator erase(iterator) = 0;
index c737639..0b27914 100644 (file)
@@ -35,9 +35,9 @@ class GLIBMM_API Interface : virtual public Glib::ObjectBase
 {
 public:
 #ifndef DOXYGEN_SHOULD_SKIP_THIS
-  typedef Interface CppObjectType;
-  typedef Interface_Class CppClassType;
-  typedef GTypeInterface BaseClassType;
+  using CppObjectType = Interface;
+  using CppClassType = Interface_Class;
+  using BaseClassType = GTypeInterface;
 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
 
   /** A Default constructor.
index 92f9bec..985f978 100644 (file)
@@ -131,14 +131,14 @@ template <class Tr>
 class ListHandleIterator
 {
 public:
-  typedef typename Tr::CppType CppType;
-  typedef typename Tr::CType CType;
+  using CppType = typename Tr::CppType;
+  using CType = typename Tr::CType;
 
-  typedef std::forward_iterator_tag iterator_category;
-  typedef CppType value_type;
-  typedef std::ptrdiff_t difference_type;
-  typedef value_type reference;
-  typedef void pointer;
+  using iterator_category = std::forward_iterator_tag;
+  using value_type = CppType;
+  using difference_type = std::ptrdiff_t;
+  using reference = value_type;
+  using pointer = void;
 
   explicit inline ListHandleIterator(const GList* node);
 
@@ -169,15 +169,15 @@ template <class T, class Tr = Glib::Container_Helpers::TypeTraits<T>>
 class ListHandle
 {
 public:
-  typedef typename Tr::CppType CppType;
-  typedef typename Tr::CType CType;
+  using CppType = typename Tr::CppType;
+  using CType = typename Tr::CType;
 
-  typedef CppType value_type;
-  typedef std::size_t size_type;
-  typedef std::ptrdiff_t difference_type;
+  using value_type = CppType;
+  using size_type = std::size_t;
+  using difference_type = std::ptrdiff_t;
 
-  typedef Glib::Container_Helpers::ListHandleIterator<Tr> const_iterator;
-  typedef Glib::Container_Helpers::ListHandleIterator<Tr> iterator;
+  using const_iterator = Glib::Container_Helpers::ListHandleIterator<Tr>;
+  using iterator = Glib::Container_Helpers::ListHandleIterator<Tr>;
 
   template <class Cont>
   inline ListHandle(const Cont& container);
index 5bfacbe..f60cc8f 100644 (file)
@@ -400,8 +400,8 @@ SignalChildWatch signal_child_watch();
 class MainContext
 {
 public:
-  typedef Glib::MainContext CppObjectType;
-  typedef GMainContext BaseObjectType;
+  using CppObjectType = Glib::MainContext;
+  using BaseObjectType = GMainContext;
 
   // noncopyable
   MainContext(const MainContext& other) = delete;
@@ -624,8 +624,8 @@ Glib::RefPtr<MainContext> wrap(GMainContext* gobject, bool take_copy = false);
 class MainLoop
 {
 public:
-  typedef Glib::MainLoop CppObjectType;
-  typedef GMainLoop BaseObjectType;
+  using CppObjectType = Glib::MainLoop;
+  using BaseObjectType = GMainLoop;
 
   static Glib::RefPtr<MainLoop> create(bool is_running = false);
   static Glib::RefPtr<MainLoop> create(
@@ -682,8 +682,8 @@ Glib::RefPtr<MainLoop> wrap(GMainLoop* gobject, bool take_copy = false);
 class Source
 {
 public:
-  typedef Glib::Source CppObjectType;
-  typedef GSource BaseObjectType;
+  using CppObjectType = Glib::Source;
+  using BaseObjectType = GSource;
 
   // noncopyable
   Source(const Source&) = delete;
@@ -845,7 +845,7 @@ public:
 class TimeoutSource : public Glib::Source
 {
 public:
-  typedef Glib::TimeoutSource CppObjectType;
+  using CppObjectType = Glib::TimeoutSource;
 
   static Glib::RefPtr<TimeoutSource> create(unsigned int interval);
   sigc::connection connect(const sigc::slot<bool>& slot);
@@ -868,7 +868,7 @@ private:
 class IdleSource : public Glib::Source
 {
 public:
-  typedef Glib::IdleSource CppObjectType;
+  using CppObjectType = Glib::IdleSource;
 
   static Glib::RefPtr<IdleSource> create();
   sigc::connection connect(const sigc::slot<bool>& slot);
@@ -885,7 +885,7 @@ protected:
 class IOSource : public Glib::Source
 {
 public:
-  typedef Glib::IOSource CppObjectType;
+  using CppObjectType = Glib::IOSource;
 
   static Glib::RefPtr<IOSource> create(int fd, IOCondition condition);
   static Glib::RefPtr<IOSource> create(
index 522f84a..3ff39b0 100644 (file)
@@ -38,8 +38,8 @@
 
 #ifndef DOXYGEN_SHOULD_SKIP_THIS
 extern "C" {
-typedef struct _GObject GObject;
-typedef struct _GObjectClass GObjectClass;
+using GObject = struct _GObject;
+using GObjectClass = struct _GObjectClass;
 }
 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
 
@@ -95,10 +95,10 @@ class GLIBMM_API Object : virtual public ObjectBase
 {
 public:
 #ifndef DOXYGEN_SHOULD_SKIP_THIS
-  typedef Object CppObjectType;
-  typedef Object_Class CppClassType;
-  typedef GObject BaseObjectType;
-  typedef GObjectClass BaseClassType;
+  using CppObjectType = Object;
+  using CppClassType = Object_Class;
+  using BaseObjectType = GObject;
+  using BaseClassType = GObjectClass;
 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
 
   // noncopyable
@@ -129,7 +129,7 @@ public:
   // TODO: Use slots instead:
   void* get_data(const QueryQuark& key);
   void set_data(const Quark& key, void* data);
-  typedef void (*DestroyNotify)(gpointer data);
+  using DestroyNotify = void (*)(gpointer data);
   void set_data(const Quark& key, void* data, DestroyNotify notify);
   void remove_data(const QueryQuark& quark);
   // same as remove without notifying
@@ -171,9 +171,9 @@ namespace Container_Helpers
 template <class T>
 struct TypeTraits<Glib::RefPtr<T>>
 {
-  typedef Glib::RefPtr<T> CppType;
-  typedef typename T::BaseObjectType* CType;
-  typedef typename T::BaseObjectType* CTypeNonConst;
+  using CppType = Glib::RefPtr<T>;
+  using CType = typename T::BaseObjectType*;
+  using CTypeNonConst = typename T::BaseObjectType*;
 
   static CType to_c_type(const CppType& ptr) { return Glib::unwrap(ptr); }
   static CType to_c_type(CType ptr) { return ptr; }
@@ -207,9 +207,9 @@ struct TypeTraits<Glib::RefPtr<T>>
 template <class T>
 struct TypeTraits<Glib::RefPtr<const T>>
 {
-  typedef Glib::RefPtr<const T> CppType;
-  typedef const typename T::BaseObjectType* CType;
-  typedef typename T::BaseObjectType* CTypeNonConst;
+  using CppType = Glib::RefPtr<const T>;
+  using CType = const typename T::BaseObjectType*;
+  using CTypeNonConst = typename T::BaseObjectType*;
 
   static CType to_c_type(const CppType& ptr) { return Glib::unwrap(ptr); }
   static CType to_c_type(CType ptr) { return ptr; }
@@ -252,8 +252,8 @@ template <class T>
 class Value<Glib::RefPtr<T>> : public ValueBase_Object
 {
 public:
-  typedef Glib::RefPtr<T> CppType;
-  typedef typename T::BaseObjectType* CType;
+  using CppType = Glib::RefPtr<T>;
+  using CType = typename T::BaseObjectType*;
 
   static GType value_type() { return T::get_base_type(); }
 
@@ -271,8 +271,8 @@ template <class T>
 class Value<Glib::RefPtr<const T>> : public ValueBase_Object
 {
 public:
-  typedef Glib::RefPtr<const T> CppType;
-  typedef typename T::BaseObjectType* CType;
+  using CppType = Glib::RefPtr<const T>;
+  using CType = typename T::BaseObjectType*;
 
   static GType value_type() { return T::get_base_type(); }
 
index 7d34bea..cf6a4a0 100644 (file)
@@ -34,7 +34,7 @@
 
 #ifndef DOXYGEN_SHOULD_SKIP_THIS
 extern "C" {
-typedef struct _GObject GObject;
+using GObject = struct _GObject;
 }
 #endif
 
@@ -229,7 +229,7 @@ protected:
     Class::interface_class_vector_type custom_interface_classes;
   };
 
-  typedef std::map<const ObjectBase*, ExtraObjectBaseData> extra_object_base_data_type;
+  using extra_object_base_data_type = std::map<const ObjectBase*, ExtraObjectBaseData>;
   static extra_object_base_data_type extra_object_base_data;
   // ObjectBase instances may be used in different threads.
   // Accesses to extra_object_base_data must be thread-safe.
index d588f08..fddec5c 100644 (file)
@@ -24,7 +24,7 @@
  */
 
 extern "C" {
-typedef struct _GPatternSpec GPatternSpec;
+using GPatternSpec = struct _GPatternSpec;
 }
 
 #include <glibmm/ustring.h>
index 3596315..a116e0e 100644 (file)
@@ -11,8 +11,8 @@ namespace Glib
 class Interface_Class : public Glib::Class
 {
 public:
-  typedef Interface CppObjectType;
-  typedef GTypeInterface BaseClassType;
+  using CppObjectType = Interface;
+  using BaseClassType = GTypeInterface;
 
   void add_interface(GType instance_type) const;
 };
index bcac44d..98ee09b 100644 (file)
@@ -11,9 +11,9 @@ namespace Glib
 class Object_Class : public Glib::Class
 {
 public:
-  typedef Object CppObjectType;
-  typedef GObject BaseObjectType;
-  typedef GObjectClass BaseClassType;
+  using CppObjectType = Object;
+  using BaseObjectType = GObject;
+  using BaseClassType = GObjectClass;
 
   static void class_init_function(void* g_class, void* class_data);
 
index 3242bbd..1076989 100644 (file)
@@ -171,8 +171,8 @@ template <class T>
 class Property : public PropertyBase
 {
 public:
-  typedef T PropertyType;
-  typedef Glib::Value<T> ValueType;
+  using PropertyType = T;
+  using ValueType = Glib::Value<T>;
 
   /**  Constructs a property of the @a object with the specified @a name.
    * For each instance of the object, the same property must be constructed with the same name.
index 1d47b3c..bc27409 100644 (file)
@@ -44,7 +44,7 @@ template <class T>
 class PropertyProxy : public PropertyProxy_Base
 {
 public:
-  typedef T PropertyType;
+  using PropertyType = T;
 
   PropertyProxy(ObjectBase* obj, const char* name) : PropertyProxy_Base(obj, name) {}
 
@@ -78,7 +78,7 @@ template <class T>
 class PropertyProxy_WriteOnly : public PropertyProxy_Base
 {
 public:
-  typedef T PropertyType;
+  using PropertyType = T;
 
   PropertyProxy_WriteOnly(ObjectBase* obj, const char* name) : PropertyProxy_Base(obj, name) {}
 
@@ -105,7 +105,7 @@ template <class T>
 class PropertyProxy_ReadOnly : public PropertyProxy_Base
 {
 public:
-  typedef T PropertyType;
+  using PropertyType = T;
 
   // obj is const, because this should be returned by const accessors.
   PropertyProxy_ReadOnly(const ObjectBase* obj, const char* name)
index e8d6290..fdfb237 100644 (file)
@@ -39,7 +39,7 @@ public:
   SignalProxyProperty(Glib::ObjectBase* obj, const gchar* property_name);
   ~SignalProxyProperty() noexcept;
 
-  typedef sigc::slot<void> SlotType;
+  using SlotType = sigc::slot<void>;
   sigc::connection connect(const SlotType& slot);
   /** @newin{2,48}
    */
index d39660f..d934044 100644 (file)
@@ -26,7 +26,7 @@
 #include <glib.h>
 
 extern "C" {
-typedef struct _GRand GRand;
+using GRand = struct _GRand;
 }
 
 namespace Glib
index c9acef2..4d8a9c6 100644 (file)
@@ -60,7 +60,7 @@ private:
    * T:dont_allow_use_in_glib_refptr_ is a public type, else it's true.
    * Example:
    * @code
-   * typedef int dont_allow_use_in_glib_refptr_;
+   * using dont_allow_use_in_glib_refptr_ = int;
    * @endcode
    */
   class is_allowed_type
index 31f139b..95e2f08 100644 (file)
@@ -32,7 +32,7 @@ namespace Glib
 /**
  * @deprecated Use a std::vector instead.
  */
-typedef Glib::ArrayHandle<Glib::ustring> SArray;
+using SArray = Glib::ArrayHandle<Glib::ustring>;
 }
 
 #endif // GLIBMM_DISABLE_DEPRECATED
index 7237be0..458e6b1 100644 (file)
@@ -153,8 +153,8 @@ template <class R, class... T>
 class SignalProxy : public SignalProxyNormal
 {
 public:
-  typedef sigc::slot<R, T...> SlotType;
-  typedef sigc::slot<void, T...> VoidSlotType;
+  using SlotType = sigc::slot<R, T...>;
+  using VoidSlotType = sigc::slot<void, T...>;
 
   SignalProxy(ObjectBase* obj, const SignalProxyInfo* info) : SignalProxyNormal(obj, info) {}
 
@@ -303,8 +303,8 @@ template <class R, class... T>
 class SignalProxyDetailedAnyType : public SignalProxyDetailed
 {
 public:
-  typedef sigc::slot<R, T...> SlotType;
-  typedef sigc::slot<void, T...> VoidSlotType;
+  using SlotType = sigc::slot<R, T...>;
+  using VoidSlotType = sigc::slot<void, T...>;
 
   SignalProxyDetailedAnyType(
     ObjectBase* obj, const SignalProxyInfo* info, const Glib::ustring& detail_name)
index 1b226ed..88e98ee 100644 (file)
@@ -24,8 +24,8 @@
 #include <glib.h>
 
 #ifndef DOXYGEN_SHOULD_SKIP_THIS
-typedef struct _GObject GObject;
-typedef struct _GClosure GClosure;
+using GObject = struct _GObject;
+using GClosure = struct _GClosure;
 #endif // DOXYGEN_SHOULD_SKIP_THIS
 
 namespace Glib
index a952562..7bf1a9d 100644 (file)
@@ -131,14 +131,14 @@ template <class Tr>
 class SListHandleIterator
 {
 public:
-  typedef typename Tr::CppType CppType;
-  typedef typename Tr::CType CType;
+  using CppType = typename Tr::CppType;
+  using CType = typename Tr::CType;
 
-  typedef std::forward_iterator_tag iterator_category;
-  typedef CppType value_type;
-  typedef std::ptrdiff_t difference_type;
-  typedef value_type reference;
-  typedef void pointer;
+  using iterator_category = std::forward_iterator_tag;
+  using value_type = CppType;
+  using difference_type = std::ptrdiff_t;
+  using reference = value_type;
+  using pointer = void;
 
   explicit inline SListHandleIterator(const GSList* node);
 
@@ -168,15 +168,15 @@ template <class T, class Tr = Glib::Container_Helpers::TypeTraits<T>>
 class SListHandle
 {
 public:
-  typedef typename Tr::CppType CppType;
-  typedef typename Tr::CType CType;
+  using CppType = typename Tr::CppType;
+  using CType = typename Tr::CType;
 
-  typedef CppType value_type;
-  typedef std::size_t size_type;
-  typedef std::ptrdiff_t difference_type;
+  using value_type = CppType;
+  using size_type = std::size_t;
+  using difference_type = std::ptrdiff_t;
 
-  typedef Glib::Container_Helpers::SListHandleIterator<Tr> const_iterator;
-  typedef Glib::Container_Helpers::SListHandleIterator<Tr> iterator;
+  using const_iterator = Glib::Container_Helpers::SListHandleIterator<Tr>;
+  using iterator = Glib::Container_Helpers::SListHandleIterator<Tr>;
 
   template <class Cont>
   inline SListHandle(const Cont& container);
index 6bf4aec..f75f34d 100644 (file)
@@ -25,7 +25,7 @@
 #include <sigc++/sigc++.h>
 
 extern "C" {
-typedef struct _GThreadPool GThreadPool;
+using GThreadPool = struct _GThreadPool;
 }
 
 namespace Glib
index c99c602..2559ffa 100644 (file)
@@ -24,7 +24,7 @@
  */
 
 extern "C" {
-typedef struct _GTimer GTimer;
+using GTimer = struct _GTimer;
 }
 
 namespace Glib
index a207611..cf2ac0d 100644 (file)
@@ -39,31 +39,31 @@ namespace Glib
 template <class T>
 struct IteratorTraits
 {
-  typedef typename T::iterator_category iterator_category;
-  typedef typename T::value_type value_type;
-  typedef typename T::difference_type difference_type;
-  typedef typename T::pointer pointer;
-  typedef typename T::reference reference;
+  using iterator_category = typename T::iterator_category;
+  using value_type = typename T::value_type;
+  using difference_type = typename T::difference_type;
+  using pointer = typename T::pointer;
+  using reference = typename T::reference;
 };
 
 template <class T>
 struct IteratorTraits<T*>
 {
-  typedef std::random_access_iterator_tag iterator_category;
-  typedef T value_type;
-  typedef std::ptrdiff_t difference_type;
-  typedef T* pointer;
-  typedef T& reference;
+  using iterator_category = std::random_access_iterator_tag;
+  using value_type = T;
+  using difference_type = std::ptrdiff_t;
+  using pointer = T*;
+  using reference = T&;
 };
 
 template <class T>
 struct IteratorTraits<const T*>
 {
-  typedef std::random_access_iterator_tag iterator_category;
-  typedef T value_type;
-  typedef std::ptrdiff_t difference_type;
-  typedef const T* pointer;
-  typedef const T& reference;
+  using iterator_category = std::random_access_iterator_tag;
+  using value_type = T;
+  using difference_type = std::ptrdiff_t;
+  using pointer = const T*;
+  using reference = const T&;
 };
 
 #endif /* GLIBMM_HAVE_STD_ITERATOR_TRAITS */
@@ -99,11 +99,11 @@ template <class T>
 class ustring_Iterator
 {
 public:
-  typedef std::bidirectional_iterator_tag iterator_category;
-  typedef gunichar value_type;
-  typedef std::string::difference_type difference_type;
-  typedef value_type reference;
-  typedef void pointer;
+  using iterator_category = std::bidirectional_iterator_tag;
+  using value_type = gunichar;
+  using difference_type = std::string::difference_type;
+  using reference = value_type;
+  using pointer = void;
 
   inline ustring_Iterator();
   inline ustring_Iterator(const ustring_Iterator<std::string::iterator>& other);
@@ -214,20 +214,20 @@ gunichar get_unichar_from_std_iterator(std::string::const_iterator pos) G_GNUC_P
 class ustring
 {
 public:
-  typedef std::string::size_type size_type;
-  typedef std::string::difference_type difference_type;
+  using size_type = std::string::size_type;
+  using difference_type = std::string::difference_type;
 
-  typedef gunichar value_type;
-  typedef gunichar& reference;
-  typedef const gunichar& const_reference;
+  using value_type = gunichar;
+  using reference = gunichar&;
+  using const_reference = const gunichar&;
 
-  typedef ustring_Iterator<std::string::iterator> iterator;
-  typedef ustring_Iterator<std::string::const_iterator> const_iterator;
+  using iterator = ustring_Iterator<std::string::iterator>;
+  using const_iterator = ustring_Iterator<std::string::const_iterator>;
 
 #ifndef GLIBMM_HAVE_SUN_REVERSE_ITERATOR
 
-  typedef std::reverse_iterator<iterator> reverse_iterator;
-  typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+  using reverse_iterator = std::reverse_iterator<iterator>;
+  using const_reverse_iterator = std::reverse_iterator<const_iterator>;
 
 #else
 
@@ -863,9 +863,9 @@ public:
 
 private:
 #ifdef GLIBMM_HAVE_WIDE_STREAM
-  typedef std::wostringstream StreamType;
+  using StreamType = std::wostringstream;
 #else
-  typedef std::ostringstream StreamType;
+  using StreamType = std::ostringstream;
 #endif
   StreamType stream_;
 
index 3a51628..c7f61af 100644 (file)
@@ -134,7 +134,7 @@ protected:
 class ValueBase_Enum : public ValueBase
 {
 public:
-  typedef gint CType;
+  using CType = gint;
   static GType value_type() G_GNUC_CONST;
 
 #ifndef DOXYGEN_SHOULD_SKIP_THIS
@@ -152,7 +152,7 @@ protected:
 class ValueBase_Flags : public ValueBase
 {
 public:
-  typedef guint CType;
+  using CType = guint;
   static GType value_type() G_GNUC_CONST;
 
 #ifndef DOXYGEN_SHOULD_SKIP_THIS
@@ -170,7 +170,7 @@ protected:
 class ValueBase_String : public ValueBase
 {
 public:
-  typedef const gchar* CType;
+  using CType = const gchar*;
   static GType value_type() G_GNUC_CONST;
 
 #ifndef DOXYGEN_SHOULD_SKIP_THIS
@@ -200,8 +200,8 @@ template <class T>
 class Value_Boxed : public ValueBase_Boxed
 {
 public:
-  typedef T CppType;
-  typedef typename T::BaseObjectType* CType;
+  using CppType = T;
+  using CType = typename T::BaseObjectType*;
 
   static GType value_type() { return T::get_type(); }
 
@@ -219,8 +219,8 @@ template <class T>
 class Value<Glib::RefPtr<T>> : public ValueBase_Object
 {
 public:
-  typedef Glib::RefPtr<T> CppType;
-  typedef typename T::BaseObjectType* CType;
+  using CppType = Glib::RefPtr<T>;
+  using CType = typename T::BaseObjectType*;
 
   static GType value_type() { return T::get_base_type(); }
 
@@ -238,8 +238,8 @@ template <class T>
 class Value<Glib::RefPtr<const T>> : public ValueBase_Object
 {
 public:
-  typedef Glib::RefPtr<const T> CppType;
-  typedef typename T::BaseObjectType* CType;
+  using CppType = Glib::RefPtr<const T>;
+  using CType = typename T::BaseObjectType*;
 
   static GType value_type() { return T::get_base_type(); }
 
@@ -268,7 +268,7 @@ template <>
 class Value<std::string> : public ValueBase_String
 {
 public:
-  typedef std::string CppType;
+  using CppType = std::string;
 
   void set(const std::string& data);
   std::string get() const { return get_cstring(); }
@@ -281,7 +281,7 @@ template <>
 class Value<Glib::ustring> : public ValueBase_String
 {
 public:
-  typedef Glib::ustring CppType;
+  using CppType = Glib::ustring;
 
   void set(const Glib::ustring& data);
   Glib::ustring get() const { return get_cstring(); }
@@ -294,7 +294,7 @@ template <class T>
 class Value_Enum : public ValueBase_Enum
 {
 public:
-  typedef T CppType;
+  using CppType = T;
 
   void set(CppType data) { set_enum(data); }
   CppType get() const { return CppType(get_enum()); }
@@ -307,7 +307,7 @@ template <class T>
 class Value_Flags : public ValueBase_Flags
 {
 public:
-  typedef T CppType;
+  using CppType = T;
 
   void set(CppType data) { set_flags(data); }
   CppType get() const { return CppType(get_flags()); }
index f94bf1b..d3ebfee 100644 (file)
@@ -61,8 +61,8 @@ template <class T, class PtrT>
 class Value_Pointer : public ValueBase_Object
 {
 public:
-  typedef PtrT CppType;
-  typedef void* CType;
+  using CppType = PtrT;
+  using CType = void*;
 
   static inline GType value_type() G_GNUC_CONST;
 
@@ -100,8 +100,8 @@ template <class T>
 class Value : public ValueBase_Boxed
 {
 public:
-  typedef T CppType;
-  typedef T* CType;
+  using CppType = T;
+  using CType = T*;
 
   static GType value_type() G_GNUC_CONST;
 
index 40231db..6ea434a 100644 (file)
@@ -93,7 +93,7 @@ template <class Tr>
 typename Tr::CType*
 create_array(typename std::vector<typename Tr::CppType>::const_iterator pbegin, std::size_t size)
 {
-  typedef typename Tr::CType CType;
+  using CType = typename Tr::CType;
 
   CType* const array(static_cast<CType*>(g_malloc((size + 1) * sizeof(CType))));
   CType* const array_end(array + size);
@@ -160,14 +160,14 @@ template <class Tr>
 class ArrayIterator
 {
 public:
-  typedef typename Tr::CppType CppType;
-  typedef typename Tr::CType CType;
+  using CppType = typename Tr::CppType;
+  using CType = typename Tr::CType;
 
-  typedef std::random_access_iterator_tag iterator_category;
-  typedef CppType value_type;
-  typedef std::ptrdiff_t difference_type;
-  typedef value_type reference;
-  typedef void pointer;
+  using iterator_category = std::random_access_iterator_tag;
+  using value_type = CppType;
+  using difference_type = std::ptrdiff_t;
+  using reference = value_type;
+  using pointer = void;
 
   explicit inline ArrayIterator(const CType* pos);
 
@@ -201,14 +201,14 @@ template <class Tr>
 class ListIterator
 {
 public:
-  typedef typename Tr::CppType CppType;
-  typedef typename Tr::CType CType;
+  using CppType = typename Tr::CppType;
+  using CType = typename Tr::CType;
 
-  typedef std::forward_iterator_tag iterator_category;
-  typedef CppType value_type;
-  typedef std::ptrdiff_t difference_type;
-  typedef value_type reference;
-  typedef void pointer;
+  using iterator_category = std::forward_iterator_tag;
+  using value_type = CppType;
+  using difference_type = std::ptrdiff_t;
+  using reference = value_type;
+  using pointer = void;
 
   explicit inline ListIterator(const GList* node);
 
@@ -227,14 +227,14 @@ template <class Tr>
 class SListIterator
 {
 public:
-  typedef typename Tr::CppType CppType;
-  typedef typename Tr::CType CType;
+  using CppType = typename Tr::CppType;
+  using CType = typename Tr::CType;
 
-  typedef std::forward_iterator_tag iterator_category;
-  typedef CppType value_type;
-  typedef std::ptrdiff_t difference_type;
-  typedef value_type reference;
-  typedef void pointer;
+  using iterator_category = std::forward_iterator_tag;
+  using value_type = CppType;
+  using difference_type = std::ptrdiff_t;
+  using reference = value_type;
+  using pointer = void;
 
   explicit inline SListIterator(const GSList* node);
 
@@ -275,8 +275,8 @@ template <typename Tr>
 class ArrayKeeper
 {
 public:
-  typedef typename Tr::CppType CppType;
-  typedef typename Tr::CType CType;
+  using CppType = typename Tr::CppType;
+  using CType = typename Tr::CType;
 
   /** Constructs an ArrayKeeper holding @a array of size @a array_size.
    * @a ownership tells what should be destroyed with keeper destruction:
@@ -335,8 +335,8 @@ template <typename Tr>
 class GListKeeper
 {
 public:
-  typedef typename Tr::CppType CppType;
-  typedef typename Tr::CType CType;
+  using CppType = typename Tr::CppType;
+  using CType = typename Tr::CType;
 
   /** Constructs an GListKeeper holding @a glist.
    * @a ownership tells what should be destroyed with keeper destruction:
@@ -392,8 +392,8 @@ template <typename Tr>
 class GSListKeeper
 {
 public:
-  typedef typename Tr::CppType CppType;
-  typedef typename Tr::CType CType;
+  using CppType = typename Tr::CppType;
+  using CType = typename Tr::CType;
 
   /** Constructs an GSListKeeper holding @a gslist.
    * @a ownership tells what should be destroyed with keeper destruction:
@@ -467,11 +467,11 @@ template <typename T, typename Tr = Glib::Container_Helpers::TypeTraits<T>>
 class ArrayHandler
 {
 public:
-  typedef typename Tr::CType CType;
-  typedef T CppType;
-  typedef std::vector<CppType> VectorType;
-  typedef typename Glib::Container_Helpers::ArrayKeeper<Tr> ArrayKeeperType;
-  typedef typename Glib::Container_Helpers::ArrayIterator<Tr> ArrayIteratorType;
+  using CType = typename Tr::CType;
+  using CppType = T;
+  using VectorType = std::vector<CppType>;
+  using ArrayKeeperType = typename Glib::Container_Helpers::ArrayKeeper<Tr>;
+  using ArrayIteratorType = typename Glib::Container_Helpers::ArrayIterator<Tr>;
 
   // maybe think about using C++0x move constructors?
   static VectorType array_to_vector(
@@ -484,9 +484,9 @@ template <>
 class ArrayHandler<bool>
 {
 public:
-  typedef gboolean CType;
-  typedef bool CppType;
-  typedef std::vector<bool> VectorType;
+  using CType = gboolean;
+  using CppType = bool;
+  using VectorType = std::vector<bool>;
   typedef Glib::Container_Helpers::ArrayKeeper<Glib::Container_Helpers::TypeTraits<bool>>
     ArrayKeeperType;
   typedef Glib::Container_Helpers::ArrayIterator<Glib::Container_Helpers::TypeTraits<bool>>
@@ -530,11 +530,11 @@ template <typename T, typename Tr = Glib::Container_Helpers::TypeTraits<T>>
 class ListHandler
 {
 public:
-  typedef typename Tr::CType CType;
-  typedef T CppType;
-  typedef std::vector<CppType> VectorType;
-  typedef typename Glib::Container_Helpers::GListKeeper<Tr> GListKeeperType;
-  typedef typename Glib::Container_Helpers::ListIterator<Tr> ListIteratorType;
+  using CType = typename Tr::CType;
+  using CppType = T;
+  using VectorType = std::vector<CppType>;
+  using GListKeeperType = typename Glib::Container_Helpers::GListKeeper<Tr>;
+  using ListIteratorType = typename Glib::Container_Helpers::ListIterator<Tr>;
 
   // maybe think about using C++0x move constructors?
   static VectorType list_to_vector(GList* glist, Glib::OwnershipType ownership);
@@ -571,11 +571,11 @@ template <typename T, typename Tr = Glib::Container_Helpers::TypeTraits<T>>
 class SListHandler
 {
 public:
-  typedef typename Tr::CType CType;
-  typedef T CppType;
-  typedef std::vector<CppType> VectorType;
-  typedef typename Glib::Container_Helpers::GSListKeeper<Tr> GSListKeeperType;
-  typedef typename Glib::Container_Helpers::SListIterator<Tr> SListIteratorType;
+  using CType = typename Tr::CType;
+  using CppType = T;
+  using VectorType = std::vector<CppType>;
+  using GSListKeeperType = typename Glib::Container_Helpers::GSListKeeper<Tr>;
+  using SListIteratorType = typename Glib::Container_Helpers::SListIterator<Tr>;
 
   // maybe think about using C++0x move constructors?
   static VectorType slist_to_vector(GSList* gslist, Glib::OwnershipType ownership);
@@ -847,7 +847,7 @@ inline GListKeeper<Tr>::GListKeeper(const GListKeeper& keeper)
 template <typename Tr>
 GListKeeper<Tr>::~GListKeeper() noexcept
 {
-  typedef typename Tr::CTypeNonConst CTypeNonConst;
+  using CTypeNonConst = typename Tr::CTypeNonConst;
 
   if (glist_ && ownership_ != Glib::OWNERSHIP_NONE)
   {
@@ -888,7 +888,7 @@ inline GSListKeeper<Tr>::GSListKeeper(const GSListKeeper& keeper)
 template <typename Tr>
 GSListKeeper<Tr>::~GSListKeeper() noexcept
 {
-  typedef typename Tr::CTypeNonConst CTypeNonConst;
+  using CTypeNonConst = typename Tr::CTypeNonConst;
   if (gslist_ && ownership_ != Glib::OWNERSHIP_NONE)
   {
     if (ownership_ != Glib::OWNERSHIP_SHALLOW)
index 67861d6..f30fea9 100644 (file)
@@ -36,7 +36,7 @@ namespace
 // on any platform.  Nevertheless, indexing a vector costs almost nothing
 // compared to a map lookup.
 
-typedef std::vector<Glib::WrapNewFunction> WrapFuncTable;
+using WrapFuncTable = std::vector<Glib::WrapNewFunction>;
 
 static WrapFuncTable* wrap_func_table = nullptr;
 
index 36dff85..eec39bb 100644 (file)
@@ -31,7 +31,7 @@ class ObjectBase;
 class Object;
 
 // Type of the per-class wrap_new() functions.
-typedef Glib::ObjectBase* (*WrapNewFunction)(GObject*);
+using WrapNewFunction = Glib::ObjectBase*(*)(GObject*);
 
 // Setup and free the structures used by wrap_register().
 // Both functions might be called more than once.
index f9190e5..4707320 100644 (file)
@@ -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() :
index bc8cc36..b30cba1 100644 (file)
@@ -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) {}
 
index 5a307e6..228272a 100644 (file)
@@ -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)
index 82bcd56..023cca3 100644 (file)
@@ -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
index 4320c42..b8792b6 100644 (file)
@@ -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().
index 14c4163..1075f69 100644 (file)
@@ -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;
index ec6a545..75b63c0 100644 (file)
@@ -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));
index 5cfe0e5..b4e0846 100644 (file)
@@ -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
index 830ad9e..0949048 100644 (file)
@@ -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
index 24df5de..57b940f 100644 (file)
@@ -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);
 
index 51decfc..6340f45 100644 (file)
@@ -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)
    */
index f9648c0..06320cf 100644 (file)
@@ -33,8 +33,8 @@ template <>
 class Value<$1> : public ValueBase
 {
 public:
-  typedef $1 CppType;
-  typedef g$2 CType;
+  using CppType = $1;
+  using CType = g$2;
 
   static GType value_type() G_GNUC_CONST;
 
index 518123f..c1b5638 100644 (file)
@@ -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.
    */
index 3093dfa..bde8b4b 100644 (file)
@@ -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()
 {
index c73fc8e..c90fa55 100644 (file)
@@ -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> >()
index a6b6ec0..959a8e5 100644 (file)
@@ -43,7 +43,7 @@ template <>
 class Variant<$1> : public VariantBase
 {
 public:
-  typedef $2 CType;
+  using CType = $2;
 
   /// Default constructor.
   Variant<$1>()
index 7b66869..296f1e2 100644 (file)
@@ -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()));
index 4f43b56..8274c93 100644 (file)
@@ -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++)
index 647542b..dbe0f85 100644 (file)
@@ -1,7 +1,7 @@
 #include <glibmm.h>
 
-typedef Glib::ustring type_key_value;
-typedef type_key_value* type_p_key_value;
+using type_key_value = Glib::ustring;
+using type_p_key_value = type_key_value*;
 
 static int
 my_search(const type_key_value& key_a, const type_key_value& key_b)
index 99dbd58..c097cbb 100644 (file)
@@ -80,7 +80,7 @@ class TestInterface;
 class TestInterface_Class : public Glib::Interface_Class
 {
 public:
-  typedef TestInterface BaseClassType;
+  using BaseClassType = TestInterface;
 
   friend class TestInterface;
 
@@ -107,7 +107,7 @@ public:
 class TestInterface : public Glib::Interface
 {
 protected:
-  typedef TestInterface_Class CppClassType;
+  using CppClassType = TestInterface_Class;
 
   TestInterface() : Glib::Interface(derived_interface_class_.init()) {}
 
@@ -147,8 +147,8 @@ private:
 class DerivedObject_Class : public Glib::Class
 {
 public:
-  typedef GObjectClass BaseClassType;
-  typedef Glib::Object_Class CppClassParent;
+  using BaseClassType = GObjectClass;
+  using CppClassParent = Glib::Object_Class;
 
   static void class_init_function(void* g_class, void* class_data)
   {
@@ -183,7 +183,7 @@ TestInterface::CppClassType TestInterface::derived_interface_class_; // initiali
 class DerivedObject : public Glib::Object, public TestInterface
 {
 public:
-  typedef DerivedObject_Class CppClassType;
+  using CppClassType = DerivedObject_Class;
 
   // A real application would never make the constructor public.
   // It would instead have a protected constructor and a public create() method.
index fffdafa..0554c48 100644 (file)
@@ -1,7 +1,7 @@
 #include <glibmm.h>
 #include <iostream>
 
-typedef Glib::NodeTree<const std::string> type_nodetree_string;
+using type_nodetree_string = Glib::NodeTree<const std::string>;
 
 static bool
 node_build_string(type_nodetree_string& node, std::string& string)
index 3353370..80d8350 100644 (file)
@@ -26,7 +26,7 @@ int
 main()
 {
   Gio::init();
-  typedef Glib::RefPtr<Gio::Credentials> CrePtr;
+  using CrePtr = Glib::RefPtr<Gio::Credentials>;
 
   std::vector<CrePtr> v1(Glib::ArrayHandle<CrePtr>(nullptr, Glib::OWNERSHIP_DEEP));
   std::vector<CrePtr> v2(Glib::ArrayHandle<CrePtr>(nullptr, 5, Glib::OWNERSHIP_DEEP));
index a686ade..b658b39 100644 (file)
@@ -24,7 +24,7 @@ int
 main()
 {
   Gio::init();
-  typedef Glib::RefPtr<Gio::Credentials> CrePtr;
+  using CrePtr = Glib::RefPtr<Gio::Credentials>;
 
   std::vector<CrePtr> v1(
     Glib::ArrayHandler<CrePtr>::array_to_vector(nullptr, Glib::OWNERSHIP_DEEP));
index e5877a8..8ac5d50 100644 (file)
@@ -52,7 +52,7 @@ main(int, char**)
 
   // Dict:
 
-  typedef std::pair<Glib::ustring, Glib::ustring> TypeDictEntry;
+  using TypeDictEntry = std::pair<Glib::ustring, Glib::ustring>;
 
   TypeDictEntry dict_entry("A key", "A value");
 
@@ -68,7 +68,7 @@ main(int, char**)
 
   ostr << std::endl;
 
-  typedef std::map<unsigned, Glib::ustring> TypeDict;
+  using TypeDict = std::map<unsigned, Glib::ustring>;
 
   TypeDict orig_dict;
 
@@ -112,7 +112,7 @@ main(int, char**)
   }
 
   // std::vector< std::map< Glib::ustring, Glib::Variant<int> > >
-  typedef std::map<Glib::ustring, Glib::Variant<int>> ComplexDictType;
+  using ComplexDictType = std::map<Glib::ustring, Glib::Variant<int>>;
 
   ComplexDictType complex_dict1;
   ComplexDictType complex_dict2;
@@ -132,7 +132,7 @@ main(int, char**)
     complex_dict2.insert(std::pair<Glib::ustring, Glib::Variant<int>>("Map 2 " + s, v));
   }
 
-  typedef std::vector<std::map<Glib::ustring, Glib::Variant<int>>> ComplexVecType;
+  using ComplexVecType = std::vector<std::map<Glib::ustring, Glib::Variant<int>>>;
 
   ComplexVecType complex_vector = { complex_dict1, complex_dict2 };
 
@@ -275,7 +275,7 @@ test_dynamic_cast_composite_types()
 
   try
   {
-    typedef std::map<Glib::ustring, std::vector<std::string>> composite_type;
+    using composite_type = std::map<Glib::ustring, std::vector<std::string>>;
     auto derived = Glib::VariantBase::cast_dynamic<Glib::Variant<composite_type>>(cppdict);
 
     ostr << "Cast composite type (get_type_string()=" << derived.get_type_string()
@@ -352,8 +352,8 @@ test_dynamic_cast()
   }
 
   // A variant of type a{sv}
-  typedef std::map<Glib::ustring, Glib::VariantBase> type_map_sv;
-  typedef Glib::Variant<type_map_sv> type_dict_sv;
+  using type_map_sv = std::map<Glib::ustring, Glib::VariantBase>;
+  using type_dict_sv = Glib::Variant<type_map_sv>;
   g_assert((type_dict_sv::variant_type().get_string()) == "a{sv}");
 
   type_dict_sv var_map;
index dc95262..9d960e3 100644 (file)
@@ -26,7 +26,7 @@
 /** Function pointer type for functions that determine if a GType is a pointer
  * type.
  */
-typedef bool (*GTypeIsAPointerFunc)(GType gtype);
+using GTypeIsAPointerFunc = bool(*)(GType gtype);
 
 /** Default extra defs utility function to determine if a GType is a pointer
  * type.
index 32b42ad..ed8a481 100644 (file)
@@ -202,8 +202,8 @@ dnl
 _IMPORT(SECTION_CLASS1)
 public:
 #ifndef DOXYGEN_SHOULD_SKIP_THIS
-  typedef __CPPNAME__ CppObjectType;
-  typedef __CNAME__ BaseObjectType;
+  using CppObjectType = __CPPNAME__;
+  using BaseObjectType = __CNAME__;
 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
 
   /** Get the GType for this class, for use with the underlying GObject type system.
index 9624257..926ac49 100644 (file)
@@ -168,8 +168,8 @@ dnl
 _IMPORT(SECTION_CLASS1)
 public:
 #ifndef DOXYGEN_SHOULD_SKIP_THIS
-  typedef __CPPNAME__ CppObjectType;
-  typedef __CNAME__ BaseObjectType;
+  using CppObjectType = __CPPNAME__;
+  using BaseObjectType = __CNAME__;
 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
 
   __CPPNAME__`'(const __CPPNAME__& other) noexcept;
index 590e81b..6395946 100644 (file)
@@ -44,8 +44,8 @@ dnl
 _IMPORT(SECTION_CLASS1)
 public:
 #ifndef DOXYGEN_SHOULD_SKIP_THIS
-  typedef __CPPNAME__ CppObjectType;
-  typedef __CNAME__ BaseObjectType;
+  using CppObjectType = __CPPNAME__;
+  using BaseObjectType = __CNAME__;
 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
 
 private:
index 77943ef..dd9c173 100644 (file)
@@ -249,10 +249,10 @@ _IMPORT(SECTION_CLASS1)
 #ifndef DOXYGEN_SHOULD_SKIP_THIS
 
 public:
-  typedef __CPPNAME__ CppObjectType;
-  typedef __CPPNAME__`'_Class CppClassType;
-  typedef __CNAME__ BaseObjectType;
-  typedef __REAL_CNAME__`'Class BaseClassType;
+  using CppObjectType = __CPPNAME__;
+  using CppClassType = __CPPNAME__`'_Class;
+  using BaseObjectType = __CNAME__;
+  using BaseClassType = __REAL_CNAME__`'Class;
 
   // noncopyable
   __CPPNAME__`'(const __CPPNAME__&) = delete;
index e3c3230..0116045 100644 (file)
@@ -45,10 +45,10 @@ define(`_PH_CLASS_DECLARATION_INTERFACE',`dnl
 class __CPPNAME__`'_Class : public __CPPPARENT__`'_Class
 {
 public:
-  typedef __CPPNAME__ CppObjectType;
-  typedef __CNAME__ BaseObjectType;
-  typedef __CCLASS__ BaseClassType;
-  typedef __CPPPARENT__`'_Class CppClassParent;
+  using CppObjectType = __CPPNAME__;
+  using BaseObjectType = __CNAME__;
+  using BaseClassType = __CCLASS__;
+  using CppClassParent = __CPPPARENT__`'_Class;
 
   friend class __CPPNAME__;
 
@@ -239,10 +239,10 @@ _IMPORT(SECTION_CLASS1)
 #ifndef DOXYGEN_SHOULD_SKIP_THIS
 
 public:
-  typedef __CPPNAME__ CppObjectType;
-  typedef __CPPNAME__`'_Class CppClassType;
-  typedef __CNAME__ BaseObjectType;
-  typedef __CCLASS__ BaseClassType;
+  using CppObjectType = __CPPNAME__;
+  using CppClassType = __CPPNAME__`'_Class;
+  using BaseObjectType = __CNAME__;
+  using BaseClassType = __CCLASS__;
 
   // noncopyable
   __CPPNAME__`'(const __CPPNAME__&) = delete;
index 4fdab1e..0e17919 100644 (file)
@@ -193,8 +193,8 @@ dnl
 _IMPORT(SECTION_CLASS1)
 public:
 #ifndef DOXYGEN_SHOULD_SKIP_THIS
-  typedef __CPPNAME__ CppObjectType;
-  typedef __CNAME__ BaseObjectType;
+  using CppObjectType = __CPPNAME__;
+  using BaseObjectType = __CNAME__;
 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
 
 ifdef(`__BOOL_CUSTOM_DEFAULT_CTOR__',`dnl
index e33cf52..e8d645b 100644 (file)
@@ -137,8 +137,8 @@ dnl
 _IMPORT(SECTION_CLASS1)
 public:
 #ifndef DOXYGEN_SHOULD_SKIP_THIS
-  typedef __CPPNAME__ CppObjectType;
-  typedef __CNAME__ BaseObjectType;
+  using CppObjectType = __CPPNAME__;
+  using BaseObjectType = __CNAME__;
 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
 
 ifelse(__OPAQUE_FUNC_NEW,NONE,`dnl
index 7a3e0fb..6880412 100644 (file)
@@ -105,14 +105,14 @@ class __CPPNAME__`'_Class : public Glib::Class
 {
 public:
 #ifndef DOXYGEN_SHOULD_SKIP_THIS
-  typedef __CPPNAME__ CppObjectType;
-  typedef __REAL_CNAME__ BaseObjectType;
+  using CppObjectType = __CPPNAME__;
+  using BaseObjectType = __REAL_CNAME__;
 ifdef(`__BOOL_DO_NOT_DERIVE_GTYPE__',`dnl
-  typedef __CPPPARENT__`'_Class CppClassParent;
+  using CppClassParent = __CPPPARENT__`'_Class;
 ',`dnl
-  typedef __REAL_CNAME__`'Class BaseClassType;
-  typedef __CPPPARENT__`'_Class CppClassParent;
-  typedef __REAL_CPARENT__`'Class BaseClassParent;
+  using BaseClassType = __REAL_CNAME__`'Class;
+  using CppClassParent = __CPPPARENT__`'_Class;
+  using BaseClassParent = __REAL_CPARENT__`'Class;
 ')dnl
 
   friend class __CPPNAME__;
@@ -286,8 +286,8 @@ define(`_STRUCT_PROTOTYPE',`dnl
 #ifndef DOXYGEN_SHOULD_SKIP_THIS
 ifdef(`__BOOL_STRUCT_NOT_HIDDEN__',`dnl
 ',`dnl
-typedef struct _`'__CNAME__ __CNAME__;
-typedef struct _`'__CNAME__`'Class __CNAME__`'Class;
+using __CNAME__ = struct _`'__CNAME__;
+using __CNAME__`'Class = struct _`'__CNAME__`'Class;
 ')dnl
 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
 undefine(`__BOOL_STRUCT_NOT_HIDDEN__')dnl
index f62e316..5b680f4 100644 (file)
@@ -65,7 +65,7 @@ ifelse($8,`1',,`dnl Do not generate the implementation if it should be custom:
 static $2 __CPPNAME__`'_signal_$4_callback`'(__CNAME__`'* self, _COMMA_SUFFIX($3)`'void* data)
 {
   using namespace __NAMESPACE__;
-  typedef sigc::slot< $5`'_COMMA_PREFIX($6) > SlotType;
+  using SlotType = sigc::slot< $5`'_COMMA_PREFIX($6) >;
 
   auto obj = dynamic_cast<__CPPNAME__*>(Glib::ObjectBase::_get_current_wrapper((GObject*) self));
   // Do not try to call a signal on a disassociated wrapper.
@@ -98,7 +98,7 @@ ifelse($12, `', `dnl
   }
 ifelse($2,void,,`dnl else
 
-  typedef $2 RType;
+  using RType = $2;
   return RType`'();
 ')dnl
 }
@@ -107,7 +107,7 @@ ifelse($2,void,,`dnl else
 static $2 __CPPNAME__`'_signal_$4_notify_callback`'(__CNAME__`'* self, _COMMA_SUFFIX($3)`' void* data)
 {
   using namespace __NAMESPACE__;
-  typedef sigc::slot< void`'_COMMA_PREFIX($6) > SlotType;
+  using SlotType = sigc::slot< void`'_COMMA_PREFIX($6) >;
 
   auto obj = dynamic_cast<__CPPNAME__*>(Glib::ObjectBase::_get_current_wrapper((GObject*) self));
   // Do not try to call a signal on a disassociated wrapper.
@@ -135,7 +135,7 @@ ifelse($12, `', `dnl
     }
   }
 
-  typedef $2 RType;
+  using RType = $2;
   return RType`'();
 }
 ')dnl endif
@@ -292,7 +292,7 @@ dnl    g_assert(base != nullptr);
     ifelse($4,void,,`return ')(*base->$2)`'($6);
 ifelse($4,void,,`dnl
 
-  typedef $4 RType;
+  using RType = $4;
   return RType`'();
 ')dnl
 }
@@ -343,7 +343,7 @@ ifelse($8,refreturn,`dnl Assume Glib::wrap() is correct if refreturn is requeste
     return _CONVERT($4,$3,`(*base->$2)`'(ifelse(`$7',1,const_cast<__CNAME__*>(gobj()),gobj())`'_COMMA_PREFIX($6))');
 ')dnl
 
-  typedef $3 RType;
+  using RType = $3;
   return RType`'();
 ')dnl
 }
index 7819d3e..5b6f114 100644 (file)
@@ -141,7 +141,7 @@ dnl  g_assert(base != nullptr);
 ifelse($4,void,,`dnl
 
 ifelse(`$15', `',`dnl
-  typedef $4 RType;
+  using RType = $4;
   return RType`'();
 ',`dnl
   return _CONVERT($3,$4,`$15');
@@ -202,7 +202,7 @@ ifelse($10,errthrow,`dnl
   }
 
 ifelse(`$14', `',`dnl
-  typedef $3 RType;
+  using RType = $3;
   return RType`'();
 ',`dnl
   return $14;