+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:
[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
+])
## 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])
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
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:
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,
{
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()));
{
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();
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);
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()),
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()));
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()));
{
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()));
{
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);
* 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.
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)
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++)
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.
_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.
*
if (base && base->init_finish)
return (*base->init_finish)(self, res, error);
- typedef gboolean RType;
+ using RType = gboolean;
return RType();
}
bool
return result;
}
- typedef bool RType;
+ using RType = bool;
return RType();
}
_CTOR_DEFAULT
public:
- typedef sigc::slot<void> SlotCancelledCallback;
+ using SlotCancelledCallback = sigc::slot<void>;
_WRAP_CREATE()
#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
{
* 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,
* 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.
*
* Glib::RefPtr<Gio::DBus::MethodInvocation>& invocation);
* @endcode
*/
- typedef sigc::slot<
+ using SlotInterfaceMethodCall = sigc::slot<
void,
const Glib::RefPtr<Connection>&,
const Glib::ustring&,
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.
* @endcode
* @throw Glib::Error.
*/
- typedef sigc::slot<
+ using SlotInterfaceGetProperty = sigc::slot<
void,
Glib::VariantBase&,
const Glib::RefPtr<Connection>&,
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.
* @endcode
* @throw Glib::Error.
*/
- typedef sigc::slot<
+ using SlotInterfaceSetProperty = sigc::slot<
bool,
const Glib::RefPtr<Connection>&,
const Glib::ustring&,
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.
namespace DBus
{
-typedef Message::ByteOrder ByteOrder;
+using ByteOrder = Message::ByteOrder;
void
Message::get_body(Glib::VariantBase& value) const
* @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.
{
// 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,
_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).
* 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.
*
* 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.
* 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.
* 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
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); }
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(
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); }
*
* @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.
*
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); }
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));
}
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));
}
#ifndef DOXYGEN_SHOULD_SKIP_THIS
typedef struct _GSimpleAction GSimpleAction;
-typedef GObjectClass GSimpleActionClass;
+using GSimpleActionClass = GObjectClass;
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
namespace Gio
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; }
#endif // DOXYGEN_SHOULD_SKIP_THIS
-typedef Glib::ListHandle<Gio::SrvTarget, SrvTargetListTraits> ListHandle_SrvTarget;
+using ListHandle_SrvTarget = Glib::ListHandle<Gio::SrvTarget, SrvTargetListTraits>;
} // namespace Gio
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); }
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;
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(); }
template <class Cont>
struct BoolArraySourceTraits
{
- typedef gboolean CType;
+ using CType = gboolean;
static std::size_t get_size(const Cont& cont) { return cont.size(); }
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)
{
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); }
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);
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);
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);
*
* @ingroup ContHandles
*/
-typedef ArrayHandle<Glib::ustring> StringArrayHandle;
+using StringArrayHandle = ArrayHandle<Glib::ustring>;
/***************************************************************************/
/* Inline implementation */
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
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
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; }
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; }
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; }
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; }
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; }
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(); }
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(); }
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; }
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()); }
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)
{
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 >
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) {}
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) {}
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_;
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); }
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); }
* 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>
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_;
/**** 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_(),
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
{
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);
{
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
}
}
namespace
{
-typedef std::map<GQuark, Glib::Error::ThrowFunc> ThrowFuncTable;
+using ThrowFuncTable = std::map<GQuark, Glib::Error::ThrowFunc>;
static ThrowFuncTable* throw_func_table = nullptr;
void propagate(GError** dest);
- typedef void (*ThrowFunc)(GError*);
+ using ThrowFunc = void(*)(GError*);
static void register_init();
static void register_cleanup();
* 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)
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);
// 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();
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;
{
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.
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);
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);
class MainContext
{
public:
- typedef Glib::MainContext CppObjectType;
- typedef GMainContext BaseObjectType;
+ using CppObjectType = Glib::MainContext;
+ using BaseObjectType = GMainContext;
// noncopyable
MainContext(const MainContext& other) = delete;
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(
class Source
{
public:
- typedef Glib::Source CppObjectType;
- typedef GSource BaseObjectType;
+ using CppObjectType = Glib::Source;
+ using BaseObjectType = GSource;
// noncopyable
Source(const Source&) = delete;
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);
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);
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(
#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 */
{
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
// 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
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; }
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; }
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(); }
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(); }
#ifndef DOXYGEN_SHOULD_SKIP_THIS
extern "C" {
-typedef struct _GObject GObject;
+using GObject = struct _GObject;
}
#endif
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.
*/
extern "C" {
-typedef struct _GPatternSpec GPatternSpec;
+using GPatternSpec = struct _GPatternSpec;
}
#include <glibmm/ustring.h>
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;
};
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);
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.
class PropertyProxy : public PropertyProxy_Base
{
public:
- typedef T PropertyType;
+ using PropertyType = T;
PropertyProxy(ObjectBase* obj, const char* name) : PropertyProxy_Base(obj, name) {}
class PropertyProxy_WriteOnly : public PropertyProxy_Base
{
public:
- typedef T PropertyType;
+ using PropertyType = T;
PropertyProxy_WriteOnly(ObjectBase* obj, const char* name) : PropertyProxy_Base(obj, name) {}
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)
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}
*/
#include <glib.h>
extern "C" {
-typedef struct _GRand GRand;
+using GRand = struct _GRand;
}
namespace Glib
* 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
/**
* @deprecated Use a std::vector instead.
*/
-typedef Glib::ArrayHandle<Glib::ustring> SArray;
+using SArray = Glib::ArrayHandle<Glib::ustring>;
}
#endif // GLIBMM_DISABLE_DEPRECATED
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) {}
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)
#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
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);
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);
#include <sigc++/sigc++.h>
extern "C" {
-typedef struct _GThreadPool GThreadPool;
+using GThreadPool = struct _GThreadPool;
}
namespace Glib
*/
extern "C" {
-typedef struct _GTimer GTimer;
+using GTimer = struct _GTimer;
}
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 */
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);
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
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_;
class ValueBase_Enum : public ValueBase
{
public:
- typedef gint CType;
+ using CType = gint;
static GType value_type() G_GNUC_CONST;
#ifndef DOXYGEN_SHOULD_SKIP_THIS
class ValueBase_Flags : public ValueBase
{
public:
- typedef guint CType;
+ using CType = guint;
static GType value_type() G_GNUC_CONST;
#ifndef DOXYGEN_SHOULD_SKIP_THIS
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
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(); }
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(); }
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(); }
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(); }
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(); }
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()); }
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()); }
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;
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;
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);
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);
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);
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);
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:
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:
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:
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(
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>>
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);
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);
template <typename Tr>
GListKeeper<Tr>::~GListKeeper() noexcept
{
- typedef typename Tr::CTypeNonConst CTypeNonConst;
+ using CTypeNonConst = typename Tr::CTypeNonConst;
if (glist_ && ownership_ != Glib::OWNERSHIP_NONE)
{
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)
// 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;
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.
{
_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() :
*
* @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.
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) {}
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)
/** 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
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().
class ParseContext;
/** @ingroup Markup */
-typedef Glib::MarkupError Error;
+using Error = Glib::MarkupError;
/** Escapes text so that the markup parser will parse it verbatim.
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;
{
_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)
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));
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));
_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
namespace Glib
{
-typedef GPid Pid;
+using Pid = GPid;
_WRAP_ENUM(SpawnFlags, GSpawnFlags, NO_GTYPE)
/** 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
template <class T>
struct StaticPrivate
{
- typedef void (*DestroyNotifyFunc) (void*);
+ using DestroyNotifyFunc = void (*) (void*);
static void delete_ptr(void* data);
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);
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)
*/
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;
* 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.
*/
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++)
/*--------------------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()
{
/*--------------------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()
{
/** 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.
*
_CLASS_GENERIC(VariantStringBase, GVariant)
public:
- typedef GVariant* CType;
- typedef VariantStringBase CppType;
+ using CType = GVariant*;
+ using CppType = VariantStringBase;
/// Default constructor.
VariantStringBase();
_CLASS_GENERIC(VariantContainerBase, GVariant)
public:
- typedef GVariant* CType;
- typedef VariantContainerBase CppType;
+ using CType = GVariant*;
+ using CppType = VariantContainerBase;
/// Default constructor.
VariantContainerBase();
class Variant : public VariantBase
{
public:
- typedef T CppType;
+ using CppType = T;
};
/****************** Specializations ***********************************/
_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>();
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> >();
// 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>();
// 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>();
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> >()
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> >()
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> >();
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> >();
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> >()
class Variant<$1> : public VariantBase
{
public:
- typedef $2 CType;
+ using CType = $2;
/// Default constructor.
Variant<$1>()
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(
{
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()));
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++)
#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)
class TestInterface_Class : public Glib::Interface_Class
{
public:
- typedef TestInterface BaseClassType;
+ using BaseClassType = TestInterface;
friend class TestInterface;
class TestInterface : public Glib::Interface
{
protected:
- typedef TestInterface_Class CppClassType;
+ using CppClassType = TestInterface_Class;
TestInterface() : Glib::Interface(derived_interface_class_.init()) {}
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)
{
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.
#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)
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));
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));
// Dict:
- typedef std::pair<Glib::ustring, Glib::ustring> TypeDictEntry;
+ using TypeDictEntry = std::pair<Glib::ustring, Glib::ustring>;
TypeDictEntry dict_entry("A key", "A value");
ostr << std::endl;
- typedef std::map<unsigned, Glib::ustring> TypeDict;
+ using TypeDict = std::map<unsigned, Glib::ustring>;
TypeDict orig_dict;
}
// 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;
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 };
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()
}
// 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;
/** 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.
_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.
_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;
_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:
#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;
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__;
#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;
_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
_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
{
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__;
#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
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.
}
ifelse($2,void,,`dnl else
- typedef $2 RType;
+ using RType = $2;
return RType`'();
')dnl
}
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.
}
}
- typedef $2 RType;
+ using RType = $2;
return RType`'();
}
')dnl endif
ifelse($4,void,,`return ')(*base->$2)`'($6);
ifelse($4,void,,`dnl
- typedef $4 RType;
+ using RType = $4;
return RType`'();
')dnl
}
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
}
ifelse($4,void,,`dnl
ifelse(`$15', `',`dnl
- typedef $4 RType;
+ using RType = $4;
return RType`'();
',`dnl
return _CONVERT($3,$4,`$15');
}
ifelse(`$14', `',`dnl
- typedef $3 RType;
+ using RType = $3;
return RType`'();
',`dnl
return $14;