summaryrefslogtreecommitdiff
path: root/glib
diff options
context:
space:
mode:
authorMurray Cumming <murrayc@murrayc.com>2016-03-31 11:09:44 +0200
committerMurray Cumming <murrayc@murrayc.com>2016-03-31 11:39:07 +0200
commitfb9f840e18edaa54f6c51762b2b9aa67f6fcd85b (patch)
treea02950c0aba9e5d00d2e425975957a45bfcb6ef6 /glib
parent9a72522d16457319c7bd9829b23127a770454edd (diff)
downloadglibmm-fb9f840e18edaa54f6c51762b2b9aa67f6fcd85b.tar.gz
C++11: .hg/.ccg files: Replace typedefs with using.
Diffstat (limited to 'glib')
-rw-r--r--glib/src/balancedtree.hg4
-rw-r--r--glib/src/binding.hg6
-rw-r--r--glib/src/date.hg4
-rw-r--r--glib/src/datetime.hg2
-rw-r--r--glib/src/fileutils.hg4
-rw-r--r--glib/src/markup.hg6
-rw-r--r--glib/src/nodetree.hg8
-rw-r--r--glib/src/optiongroup.hg4
-rw-r--r--glib/src/spawn.hg4
-rw-r--r--glib/src/thread.hg4
-rw-r--r--glib/src/threads.hg2
-rw-r--r--glib/src/valuearray.hg2
-rw-r--r--glib/src/variant.ccg6
-rw-r--r--glib/src/variant.hg52
-rw-r--r--glib/src/variantdict.hg4
-rw-r--r--glib/src/varianttype.ccg2
16 files changed, 57 insertions, 57 deletions
diff --git a/glib/src/balancedtree.hg b/glib/src/balancedtree.hg
index f9190e55..47073204 100644
--- a/glib/src/balancedtree.hg
+++ b/glib/src/balancedtree.hg
@@ -57,8 +57,8 @@ class BalancedTree
{
_CLASS_GENERIC(BalancedTree, GTree)
public:
- typedef sigc::slot<bool, const K&, const V&> TraverseFunc;
- typedef sigc::slot<int, const K&, const K&> CompareFunc;
+ using TraverseFunc = sigc::slot<bool, const K&, const V&>;
+ using CompareFunc = sigc::slot<int, const K&, const K&>;
protected:
BalancedTree() :
diff --git a/glib/src/binding.hg b/glib/src/binding.hg
index bc8cc369..b30cba18 100644
--- a/glib/src/binding.hg
+++ b/glib/src/binding.hg
@@ -106,7 +106,7 @@ public:
*
* @return <tt>true</tt> if the transformation was successful, and <tt>false</tt> otherwise.
*/
- typedef sigc::slot<bool, const GValue*, GValue*> SlotTransform;
+ using SlotTransform = sigc::slot<bool, const GValue*, GValue*>;
/** Creates a binding between @a source_property and @a target_property,
* allowing you to set the transformation functions to be used by the binding.
@@ -394,8 +394,8 @@ private:
class TransformProp : public sigc::functor_base
{
public:
- typedef bool result_type;
- typedef sigc::slot<bool, const T_from&, T_to&> SlotTypedTransform;
+ using result_type = bool;
+ using SlotTypedTransform = sigc::slot<bool, const T_from&, T_to&>;
TransformProp(const SlotTypedTransform& slot) : typed_transform(slot) {}
diff --git a/glib/src/date.hg b/glib/src/date.hg
index 5a307e61..228272a8 100644
--- a/glib/src/date.hg
+++ b/glib/src/date.hg
@@ -34,8 +34,8 @@ namespace Glib
class Date
{
public:
- typedef guint8 Day;
- typedef guint16 Year;
+ using Day = guint8 ;
+ using Year = guint16;
_WRAP_ENUM(Month, GDateMonth, s#^DATE_##, NO_GTYPE, get_type_func=)
_WRAP_ENUM(Weekday, GDateWeekday, s#^DATE_##, NO_GTYPE)
diff --git a/glib/src/datetime.hg b/glib/src/datetime.hg
index 82bcd56f..023cca31 100644
--- a/glib/src/datetime.hg
+++ b/glib/src/datetime.hg
@@ -35,7 +35,7 @@ class TimeZone;
/** A value representing an interval of time, in microseconds. As GTimeSpan,
* its underlying type is gint64.
*/
-typedef GTimeSpan TimeSpan;
+using TimeSpan = GTimeSpan;
/** DateTime - A structure representing Date and Time.
* DateTime is a structure that combines a Gregorian date and time into a
diff --git a/glib/src/fileutils.hg b/glib/src/fileutils.hg
index 4320c420..b8792b60 100644
--- a/glib/src/fileutils.hg
+++ b/glib/src/fileutils.hg
@@ -257,8 +257,8 @@ private:
class Dir
{
public:
- typedef DirIterator iterator;
- typedef DirIterator const_iterator;
+ using iterator = DirIterator;
+ using const_iterator = DirIterator;
/** Opens a directory for reading. The names of the files in the
* directory can then be retrieved using read_name().
diff --git a/glib/src/markup.hg b/glib/src/markup.hg
index 14c4163b..1075f690 100644
--- a/glib/src/markup.hg
+++ b/glib/src/markup.hg
@@ -97,7 +97,7 @@ namespace Markup
class ParseContext;
/** @ingroup Markup */
-typedef Glib::MarkupError Error;
+using Error = Glib::MarkupError;
/** Escapes text so that the markup parser will parse it verbatim.
@@ -132,8 +132,8 @@ _WRAP_ENUM(ParseFlags, GMarkupParseFlags, NO_GTYPE, s#^MARKUP_##)
class AttributeKeyLess
{
public:
- typedef Glib::ustring first_argument_type;
- typedef Glib::ustring second_argument_type;
+ using first_argument_type = Glib::ustring;
+ using second_argument_type = Glib::ustring;
typedef bool result_type;
bool operator()(const Glib::ustring& lhs, const Glib::ustring& rhs) const;
diff --git a/glib/src/nodetree.hg b/glib/src/nodetree.hg
index ec6a5456..75b63c04 100644
--- a/glib/src/nodetree.hg
+++ b/glib/src/nodetree.hg
@@ -69,8 +69,8 @@ class NodeTree
{
_CLASS_GENERIC(NodeTree, GNode)
public:
- typedef sigc::slot<bool, NodeTree<T>&> TraverseFunc;
- typedef sigc::slot<void, NodeTree<T>&> ForeachFunc;
+ using TraverseFunc = sigc::slot<bool, NodeTree<T>&>;
+ using ForeachFunc = sigc::slot<void, NodeTree<T>&>;
private:
static NodeTree<T>* wrap(GNode* node)
@@ -340,7 +340,7 @@ public:
sigc::slot<void, GNode*, const T&, GNode**> real_slot = sigc::ptr_fun(on_compare_child);
GNode* child = nullptr;
- typedef sigc::slot<void, GNode*> type_foreach_gnode_slot;
+ using type_foreach_gnode_slot = sigc::slot<void, GNode*>;
type_foreach_gnode_slot bound_slot = sigc::bind(real_slot, the_data, &child);
g_node_children_foreach(gobj(), (GTraverseFlags)flags, c_callback_foreach_compare_child, reinterpret_cast<gpointer>(&bound_slot));
@@ -374,7 +374,7 @@ public:
sigc::slot<gboolean, GNode*, const T&, GNode**> real_slot = sigc::ptr_fun(on_compare_node);
GNode* child = nullptr;
- typedef sigc::slot<gboolean, GNode*> type_traverse_gnode_slot;
+ using type_traverse_gnode_slot = sigc::slot<gboolean, GNode*>;
type_traverse_gnode_slot bound_slot = sigc::bind(real_slot, the_data, &child);
g_node_traverse(const_cast<GNode*>(gobj()), (GTraverseType)order, (GTraverseFlags)flags, -1, c_callback_traverse_compare_node, reinterpret_cast<gpointer>(&bound_slot));
diff --git a/glib/src/optiongroup.hg b/glib/src/optiongroup.hg
index 5cfe0e5e..b4e08464 100644
--- a/glib/src/optiongroup.hg
+++ b/glib/src/optiongroup.hg
@@ -85,8 +85,8 @@ public:
_IGNORE(g_option_group_add_entries)
- typedef std::vector<Glib::ustring> vecustrings;
- typedef std::vector<std::string> vecstrings;
+ using vecustrings = std::vector<Glib::ustring>;
+ using vecstrings = std::vector<std::string>;
/** Add a boolean option @a entry.
* The @arg parameter will be set to the option's extra argument
diff --git a/glib/src/spawn.hg b/glib/src/spawn.hg
index 830ad9eb..09490482 100644
--- a/glib/src/spawn.hg
+++ b/glib/src/spawn.hg
@@ -26,7 +26,7 @@ _DEFS(glibmm,glib)
namespace Glib
{
-typedef GPid Pid;
+using Pid = GPid;
_WRAP_ENUM(SpawnFlags, GSpawnFlags, NO_GTYPE)
@@ -42,7 +42,7 @@ _WRAP_GERROR(SpawnError, GSpawnError, G_SPAWN_ERROR, NO_GTYPE, s#^2BIG$#TOOBIG#)
/** For instance,<br>
* void on_child_setup();
*/
-typedef sigc::slot<void> SlotSpawnChildSetup;
+using SlotSpawnChildSetup = sigc::slot<void>;
/** Executes a child program asynchronously (your program will not
* block waiting for the child to exit). The child program is
diff --git a/glib/src/thread.hg b/glib/src/thread.hg
index 24df5de3..57b940f2 100644
--- a/glib/src/thread.hg
+++ b/glib/src/thread.hg
@@ -719,7 +719,7 @@ private:
template <class T>
struct StaticPrivate
{
- typedef void (*DestroyNotifyFunc) (void*);
+ using DestroyNotifyFunc = void (*) (void*);
static void delete_ptr(void* data);
@@ -746,7 +746,7 @@ public:
Private(const Private<T>&) = delete;
Private<T>& operator=(const Private<T>&) = delete;
- typedef void (*DestructorFunc) (void*);
+ using DestructorFunc = void (*) (void*);
static void delete_ptr(void* data);
diff --git a/glib/src/threads.hg b/glib/src/threads.hg
index 51decfc6..6340f45f 100644
--- a/glib/src/threads.hg
+++ b/glib/src/threads.hg
@@ -596,7 +596,7 @@ public:
Private(const Private<T>&) = delete;
Private<T>& operator=(const Private<T>&) = delete;
- typedef void (*DestructorFunc) (void*);
+ using DestructorFunc = void (*) (void*);
/** Deletes static_cast<T*>(data)
*/
diff --git a/glib/src/valuearray.hg b/glib/src/valuearray.hg
index 518123f6..c1b56385 100644
--- a/glib/src/valuearray.hg
+++ b/glib/src/valuearray.hg
@@ -55,7 +55,7 @@ public:
* The compare function should return -1 if v1 < v2, 0 if v1 == v2, and 1 if
* v1 > v2.
*/
- typedef sigc::slot<int, const Glib::ValueBase&, const Glib::ValueBase&> SlotCompare;
+ using SlotCompare = sigc::slot<int, const Glib::ValueBase&, const Glib::ValueBase&>;
/** Default constructor. Constructs a new array with no pre-allocation.
*/
diff --git a/glib/src/variant.ccg b/glib/src/variant.ccg
index 3093dfa2..bde8b4b7 100644
--- a/glib/src/variant.ccg
+++ b/glib/src/variant.ccg
@@ -154,7 +154,7 @@ VariantContainerBase::VariantContainerBase(GVariant* castitem, bool take_a_refer
VariantContainerBase
VariantContainerBase::create_tuple(const std::vector<VariantBase>& children)
{
- typedef GVariant* var_ptr;
+ using var_ptr = GVariant*;
var_ptr* const var_array = new var_ptr[children.size()];
for (std::vector<VariantBase>::size_type i = 0; i < children.size(); i++)
@@ -417,7 +417,7 @@ Variant<std::string>::get() const
/*--------------------Variant< std::vector<Glib::ustring> >---------------------*/
-typedef std::vector<Glib::ustring> type_vec_ustring;
+using type_vec_ustring = std::vector<Glib::ustring>;
Variant<type_vec_ustring>::Variant() : VariantContainerBase()
{
@@ -501,7 +501,7 @@ Variant<type_vec_ustring>::get_iter() const
/*--------------------Variant< std::vector<std::string> >---------------------*/
-typedef std::vector<std::string> type_vec_string;
+using type_vec_string = std::vector<std::string>;
Variant<type_vec_string>::Variant() : VariantContainerBase()
{
diff --git a/glib/src/variant.hg b/glib/src/variant.hg
index c73fc8ed..c90fa550 100644
--- a/glib/src/variant.hg
+++ b/glib/src/variant.hg
@@ -98,7 +98,7 @@ public:
/** This typedef is just to make it more obvious that
* our operator const void* should be used like operator bool().
*/
- typedef const void* BoolExpr;
+ using BoolExpr = const void*;
/** Test whether the Variant has an underlying instance.
*
@@ -285,8 +285,8 @@ class VariantStringBase : public VariantBase
_CLASS_GENERIC(VariantStringBase, GVariant)
public:
- typedef GVariant* CType;
- typedef VariantStringBase CppType;
+ using CType = GVariant*;
+ using CppType = VariantStringBase;
/// Default constructor.
VariantStringBase();
@@ -340,8 +340,8 @@ class VariantContainerBase : public VariantBase
_CLASS_GENERIC(VariantContainerBase, GVariant)
public:
- typedef GVariant* CType;
- typedef VariantContainerBase CppType;
+ using CType = GVariant*;
+ using CppType = VariantContainerBase;
/// Default constructor.
VariantContainerBase();
@@ -430,7 +430,7 @@ template<class T>
class Variant : public VariantBase
{
public:
- typedef T CppType;
+ using CppType = T;
};
/****************** Specializations ***********************************/
@@ -446,9 +446,9 @@ class Variant<VariantBase> : public VariantContainerBase
_CLASS_GENERIC(Variant<VariantBase>, GVariant)
public:
- typedef GVariant* CType;
- typedef VariantBase CppType;
- typedef Variant<VariantBase> CppContainerType;
+ using CType = GVariant*;
+ using CppType = VariantBase;
+ using CppContainerType = Variant<VariantBase>;
/// Default constructor.
Variant<VariantBase>();
@@ -492,9 +492,9 @@ template<class T>
class Variant< Variant<T> > : public VariantContainerBase
{
public:
- typedef GVariant* CType;
- typedef Variant<T> CppType;
- typedef Variant<CppType> CppContainerType;
+ using CType = GVariant*;
+ using CppType = Variant<T>;
+ using CppContainerType = Variant<CppType>;
/// Default constructor.
Variant< Variant<T> >();
@@ -539,8 +539,8 @@ class Variant<Glib::ustring> : public VariantStringBase
// Trick gmmproc into thinking this is derived from GVariant to wrap some methods.
_CLASS_GENERIC(Variant<Glib::ustring>, GVariant)
public:
- typedef char* CType;
- typedef Glib::ustring CppType;
+ using CType = char*;
+ using CppType = Glib::ustring;
/// Default constructor.
Variant<Glib::ustring>();
@@ -592,8 +592,8 @@ class Variant<std::string> : public VariantStringBase
// Trick gmmproc into thinking this is derived from GVariant to wrap some methods.
_CLASS_GENERIC(Variant<std::string>, GVariant)
public:
- typedef char* CType;
- typedef std::string CppType;
+ using CType = char* ;
+ using CppType = std::string;
/// Default constructor.
Variant<std::string>();
@@ -638,8 +638,8 @@ template<class K, class V>
class Variant< std::pair<K, V> > : public VariantContainerBase
{
public:
- typedef std::pair<K, V> CppType;
- typedef Variant<CppType> CppContainerType;
+ using CppType = std::pair<K, V>;
+ using CppContainerType = Variant<CppType>;
/// Default constructor.
Variant< std::pair<K, V> >()
@@ -687,8 +687,8 @@ template<class T>
class Variant< std::vector<T> > : public VariantContainerBase
{
public:
- typedef T CppType;
- typedef std::vector<T> CppContainerType;
+ using CppType = T ;
+ using CppContainerType = std::vector<T>;
/// Default constructor.
Variant< std::vector<T> >()
@@ -756,8 +756,8 @@ template<>
class Variant< std::vector<Glib::ustring> > : public VariantContainerBase
{
public:
- typedef Glib::ustring CppType;
- typedef std::vector<Glib::ustring> CppContainerType;
+ using CppType = Glib::ustring ;
+ using CppContainerType = std::vector<Glib::ustring>;
/// Default constructor.
Variant< std::vector<Glib::ustring> >();
@@ -820,8 +820,8 @@ template<>
class Variant< std::vector<std::string> > : public VariantContainerBase
{
public:
- typedef std::string CppType;
- typedef std::vector<std::string> CppContainerType;
+ using CppType = std::string ;
+ using CppContainerType = std::vector<std::string>;
/// Default constructor.
Variant< std::vector<std::string> >();
@@ -896,8 +896,8 @@ template<class K, class V>
class Variant< std::map<K, V> >: public VariantContainerBase
{
public:
- typedef std::pair<K, V> CppType;
- typedef std::map<K, V> CppContainerType;
+ using CppType = std::pair<K, V>;
+ using CppContainerType = std::map<K, V>;
/// Default constructor.
Variant< std::map<K, V> >()
diff --git a/glib/src/variantdict.hg b/glib/src/variantdict.hg
index 7b668691..296f1e2d 100644
--- a/glib/src/variantdict.hg
+++ b/glib/src/variantdict.hg
@@ -102,7 +102,7 @@ public:
template <typename T_Value>
void VariantDict::insert_value(const Glib::ustring& key, const T_Value& value)
{
- typedef Glib::Variant<T_Value> type_glib_variant;
+ using type_glib_variant = Glib::Variant<T_Value>;
//TODO: Can we do any check like this here, before glib does?
//g_return_val_if_fail(
@@ -116,7 +116,7 @@ bool VariantDict::lookup_value(const Glib::ustring& key, T_Value& value) const
{
value = T_Value(); //Make sure that it is initialized.
- typedef Glib::Variant<T_Value> type_glib_variant;
+ using type_glib_variant = Glib::Variant<T_Value>;
//TODO: Can we do any check like this here, before glib does?
//g_variant_type_equal(g_action_group_get_action_state_type(const_cast<GActionGroup*>(gobj()), action_name.c_str()), type_glib_variant::variant_type().gobj()));
diff --git a/glib/src/varianttype.ccg b/glib/src/varianttype.ccg
index 4f43b569..8274c931 100644
--- a/glib/src/varianttype.ccg
+++ b/glib/src/varianttype.ccg
@@ -54,7 +54,7 @@ VariantType::operator=(const GVariantType* castitem)
VariantType
VariantType::create_tuple(const std::vector<VariantType>& items)
{
- typedef GVariantType* var_ptr;
+ using var_ptr = GVariantType*;
const auto var_array = new var_ptr[items.size()];
for (std::vector<VariantType>::size_type i = 0; i < items.size(); i++)