summaryrefslogtreecommitdiff
path: root/glib
diff options
context:
space:
mode:
authorMurray Cumming <murrayc@murrayc.com>2016-03-31 12:52:18 +0200
committerMurray Cumming <murrayc@murrayc.com>2016-11-14 10:43:21 +0100
commit0ca323351606b0fa2f8519155a3edd0cc6a51805 (patch)
treeaa6c49839339fba57c32a8be1382751cfff8802a /glib
parentde11e59c1f275556e73e4747e8ba75763dac9045 (diff)
downloadglibmm-0ca323351606b0fa2f8519155a3edd0cc6a51805.tar.gz
sigc3: .hg/.ccg files: Use sigc::slot<R(Args...)> syntax.
Diffstat (limited to 'glib')
-rw-r--r--glib/src/balancedtree.hg10
-rw-r--r--glib/src/binding.hg28
-rw-r--r--glib/src/bytearray.hg2
-rw-r--r--glib/src/nodetree.hg16
-rw-r--r--glib/src/optioncontext.hg2
-rw-r--r--glib/src/optiongroup.hg6
-rw-r--r--glib/src/spawn.hg2
-rw-r--r--glib/src/thread.ccg10
-rw-r--r--glib/src/thread.hg8
-rw-r--r--glib/src/threads.ccg8
-rw-r--r--glib/src/threads.hg6
-rw-r--r--glib/src/valuearray.hg2
12 files changed, 50 insertions, 50 deletions
diff --git a/glib/src/balancedtree.hg b/glib/src/balancedtree.hg
index 47073204..5444046a 100644
--- a/glib/src/balancedtree.hg
+++ b/glib/src/balancedtree.hg
@@ -57,8 +57,8 @@ class BalancedTree
{
_CLASS_GENERIC(BalancedTree, GTree)
public:
- using TraverseFunc = sigc::slot<bool, const K&, const V&>;
- using CompareFunc = sigc::slot<int, const K&, const K&>;
+ using TraverseFunc = sigc::slot<bool(const K&, const V&)>;
+ using CompareFunc = sigc::slot<int(const K&, const K&)>;
protected:
BalancedTree() :
@@ -235,8 +235,8 @@ public:
*/
V* search(const CompareFunc &search_func, const K& key)
{
- sigc::slot<int, const K&, const CompareFunc&, const K&> real_slot = sigc::ptr_fun(on_compare_key);
- sigc::slot<int, const K&> bound_slot = sigc::bind(real_slot, search_func, key);
+ sigc::slot<int(const K&, const CompareFunc&, const K&)> real_slot = sigc::ptr_fun(on_compare_key);
+ sigc::slot<int(const K&)> bound_slot = sigc::bind(real_slot, search_func, key);
gpointer value = g_tree_search(gobj(), c_callback_search, reinterpret_cast<gconstpointer>(&bound_slot));
return reinterpret_cast<V*>(value);
@@ -278,7 +278,7 @@ private:
/// Wrapper for invoking GCompareFunc.
static gint c_callback_search(gconstpointer a, gconstpointer b)
{
- const sigc::slot<int, const K&>* slot = reinterpret_cast<const sigc::slot<int, const K&> *>(b);
+ const auto slot = reinterpret_cast<const sigc::slot<int(const K&)> *>(b);
return (*slot)(*reinterpret_cast<const K*>(a));
}
diff --git a/glib/src/binding.hg b/glib/src/binding.hg
index b30cba18..cb53709e 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.
*/
- using SlotTransform = sigc::slot<bool, const GValue*, GValue*>;
+ 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.
@@ -183,7 +183,7 @@ public:
* stored in a Glib::Value<T_target> object.
* @tparam T_functor_to Type of functor that translates from the source to the target.
* Must be convertible to<br>
- * sigc::slot<bool, const T_source&, T_target&>.
+ * sigc::slot<bool(const T_source&, T_target&)>.
*
* @see bind_property_value()
*
@@ -196,7 +196,7 @@ public:
BindingFlags flags,
const T_functor_to& transform_to)
{
- sigc::slot<bool, const T_source&, T_target&> slot_transform_to = transform_to;
+ sigc::slot<bool(const T_source&, T_target&)> slot_transform_to = transform_to;
return bind_property_value(source_property, target_property, flags,
slot_transform_to.empty() ? SlotTransform() : TransformProp<T_source, T_target>(slot_transform_to));
@@ -219,7 +219,7 @@ public:
* stored in a Glib::Value<T_target> object.
* @tparam T_functor_to Type of functor that translates from the source to the target.
* Must be convertible to<br>
- * sigc::slot<bool, const T_source&, T_target&>.
+ * sigc::slot<bool(const T_source&, T_target&)>.
*
* @see bind_property_value()
*
@@ -232,7 +232,7 @@ public:
BindingFlags flags,
const T_functor_to& transform_to)
{
- sigc::slot<bool, const T_source&, T_target&> slot_transform_to = transform_to;
+ sigc::slot<bool(const T_source&, T_target&)> slot_transform_to = transform_to;
return bind_property_value(source_property, target_property, flags,
slot_transform_to.empty() ? SlotTransform() : TransformProp<T_source, T_target>(slot_transform_to));
@@ -255,7 +255,7 @@ public:
* stored in a Glib::Value<T_target> object.
* @tparam T_functor_to Type of functor that translates from the source to the target.
* Must be convertible to<br>
- * sigc::slot<bool, const T_source&, T_target&>.
+ * sigc::slot<bool(const T_source&, T_target&)>.
*
* @see bind_property_value()
*
@@ -268,7 +268,7 @@ public:
BindingFlags flags,
const T_functor_to& transform_to)
{
- sigc::slot<bool, const T_source&, T_target&> slot_transform_to = transform_to;
+ sigc::slot<bool(const T_source&, T_target&)> slot_transform_to = transform_to;
return bind_property_value(source_property, target_property, flags,
slot_transform_to.empty() ? SlotTransform() : TransformProp<T_source, T_target>(slot_transform_to));
@@ -291,7 +291,7 @@ public:
* stored in a Glib::Value<T_target> object.
* @tparam T_functor_to Type of functor that translates from the source to the target.
* Must be convertible to<br>
- * sigc::slot<bool, const T_source&, T_target&>.
+ * sigc::slot<bool(const T_source&, T_target&)>.
*
* @see bind_property_value()
*
@@ -304,7 +304,7 @@ public:
BindingFlags flags,
const T_functor_to& transform_to)
{
- sigc::slot<bool, const T_source&, T_target&> slot_transform_to = transform_to;
+ sigc::slot<bool(const T_source&, T_target&)> slot_transform_to = transform_to;
return bind_property_value(source_property, target_property, flags,
slot_transform_to.empty() ? SlotTransform() : TransformProp<T_source, T_target>(slot_transform_to));
@@ -329,10 +329,10 @@ public:
* stored in a Glib::Value<T_target> object.
* @tparam T_functor_to Type of functor that translates from the source to the target.
* Must be convertible to<br>
- * sigc::slot<bool, const T_source&, T_target&>.
+ * sigc::slot<bool(const T_source&, T_target&)>.
* @tparam T_functor_from Type of functor that translates from the target to the source.
* Must be convertible to<br>
- * sigc::slot<bool, const T_target&, T_source&>.
+ * sigc::slot<bool(const T_target&, T_source&)>.
*
* @see bind_property_value()
*
@@ -346,8 +346,8 @@ public:
const T_functor_to& transform_to,
const T_functor_from& transform_from)
{
- sigc::slot<bool, const T_source&, T_target&> slot_transform_to = transform_to;
- sigc::slot<bool, const T_target&, T_source&> slot_transform_from = transform_from;
+ sigc::slot<bool(const T_source&, T_target&)> slot_transform_to = transform_to;
+ sigc::slot<bool(const T_target&, T_source&)> slot_transform_from = transform_from;
return bind_property_value(source_property, target_property, flags,
slot_transform_to.empty() ? SlotTransform() : TransformProp<T_source, T_target>(slot_transform_to),
@@ -395,7 +395,7 @@ private:
{
public:
using result_type = bool;
- using SlotTypedTransform = sigc::slot<bool, const T_from&, T_to&>;
+ using SlotTypedTransform = sigc::slot<bool(const T_from&, T_to&)>;
TransformProp(const SlotTypedTransform& slot) : typed_transform(slot) {}
diff --git a/glib/src/bytearray.hg b/glib/src/bytearray.hg
index 30051975..1e657b5c 100644
--- a/glib/src/bytearray.hg
+++ b/glib/src/bytearray.hg
@@ -58,7 +58,7 @@ public:
* int compare(const guint8* first, const guint8* second);
* </code>
*/
- using SlotCompare = sigc::slot<int, const guint8*, const guint8*>;
+ using SlotCompare = sigc::slot<int(const guint8*, const guint8*)>;
_WRAP_METHOD(static Glib::RefPtr<ByteArray> create(), g_byte_array_new)
diff --git a/glib/src/nodetree.hg b/glib/src/nodetree.hg
index 75b63c04..bcec2dde 100644
--- a/glib/src/nodetree.hg
+++ b/glib/src/nodetree.hg
@@ -69,8 +69,8 @@ class NodeTree
{
_CLASS_GENERIC(NodeTree, GNode)
public:
- using TraverseFunc = sigc::slot<bool, NodeTree<T>&>;
- using ForeachFunc = sigc::slot<void, NodeTree<T>&>;
+ using TraverseFunc = sigc::slot<bool(NodeTree<T>&)>;
+ using ForeachFunc = sigc::slot<void(NodeTree<T>&)>;
private:
static NodeTree<T>* wrap(GNode* node)
@@ -337,10 +337,10 @@ public:
*/
NodeTree<T>* find_child(const T& the_data, TraverseFlags flags = TRAVERSE_ALL)
{
- sigc::slot<void, GNode*, const T&, GNode**> real_slot = sigc::ptr_fun(on_compare_child);
+ sigc::slot<void(GNode*, const T&, GNode**)> real_slot = sigc::ptr_fun(on_compare_child);
GNode* child = nullptr;
- using type_foreach_gnode_slot = sigc::slot<void, GNode*>;
+ 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));
@@ -371,10 +371,10 @@ public:
NodeTree<T>* find(const T& the_data, TraverseType order = TRAVERSE_IN_ORDER, TraverseFlags flags = TRAVERSE_ALL)
{
//We use a sigc::slot for the C callback, so we can bind some extra data.
- sigc::slot<gboolean, GNode*, const T&, GNode**> real_slot = sigc::ptr_fun(on_compare_node);
+ sigc::slot<gboolean(GNode*, const T&, GNode**)> real_slot = sigc::ptr_fun(on_compare_node);
GNode* child = nullptr;
- using type_traverse_gnode_slot = sigc::slot<gboolean, GNode*>;
+ 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));
@@ -732,7 +732,7 @@ private:
}
}
- /// Wrapper for invoking a sigc::slot<void,GNode*> (Internal use).
+ /// Wrapper for invoking a sigc::slot<void(GNode*)> (Internal use).
static void c_callback_foreach_compare_child(GNode* node, gpointer data)
{
const ForeachFunc* slot = reinterpret_cast<const ForeachFunc*>(data);
@@ -750,7 +750,7 @@ private:
return FALSE;
}
- /// Wrapper for invoking a sigc::slot<gboolean,GNode*> (Internal use).
+ /// Wrapper for invoking a sigc::slot<gboolean(GNode*)> (Internal use).
static gboolean c_callback_traverse_compare_node(GNode* node, gpointer data)
{
const TraverseFunc* slot = reinterpret_cast<const TraverseFunc*>(data);
diff --git a/glib/src/optioncontext.hg b/glib/src/optioncontext.hg
index 04fe81d5..0f86e6e1 100644
--- a/glib/src/optioncontext.hg
+++ b/glib/src/optioncontext.hg
@@ -200,7 +200,7 @@ public:
* This function is used to translate user-visible strings, for --help output.
* The function takes an untranslated string and returns a translated string
*/
- using SlotTranslate = sigc::slot<Glib::ustring, const Glib::ustring&>;
+ using SlotTranslate = sigc::slot<Glib::ustring(const Glib::ustring&)>;
/**
* Sets the function which is used to translate user-visible
diff --git a/glib/src/optiongroup.hg b/glib/src/optiongroup.hg
index e89f27cf..6db4e9e4 100644
--- a/glib/src/optiongroup.hg
+++ b/glib/src/optiongroup.hg
@@ -49,17 +49,17 @@ class OptionGroup
public:
/** For example Glib::ustring on_translate(const Glib::ustring& original);.
*/
- using SlotTranslate = sigc::slot<Glib::ustring, const Glib::ustring&>;
+ using SlotTranslate = sigc::slot<Glib::ustring(const Glib::ustring&)>;
/** For example bool on_option_arg_string(const Glib::ustring& option_name,
* const Glib::ustring& value, bool has_value);.
*/
- using SlotOptionArgString = sigc::slot<bool, const Glib::ustring&, const Glib::ustring&, bool>;
+ using SlotOptionArgString = sigc::slot<bool(const Glib::ustring&, const Glib::ustring&, bool)>;
/** For example bool on_option_arg_filename(const Glib::ustring& option_name,
* const std::string& value, bool has_value);.
*/
- using SlotOptionArgFilename = sigc::slot<bool, const Glib::ustring&, const std::string&, bool>;
+ using SlotOptionArgFilename = sigc::slot<bool(const Glib::ustring&, const std::string&, bool)>;
OptionGroup(const Glib::ustring& name, const Glib::ustring& description, const Glib::ustring& help_description = Glib::ustring());
diff --git a/glib/src/spawn.hg b/glib/src/spawn.hg
index 09490482..bd34ad5d 100644
--- a/glib/src/spawn.hg
+++ b/glib/src/spawn.hg
@@ -42,7 +42,7 @@ _WRAP_GERROR(SpawnError, GSpawnError, G_SPAWN_ERROR, NO_GTYPE, s#^2BIG$#TOOBIG#)
/** For instance,<br>
* void on_child_setup();
*/
-using SlotSpawnChildSetup = sigc::slot<void>;
+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.ccg b/glib/src/thread.ccg
index 3d6d7955..7965ab99 100644
--- a/glib/src/thread.ccg
+++ b/glib/src/thread.ccg
@@ -31,7 +31,7 @@ call_thread_entry_slot(void* data)
try
{
// Recreate the specific slot, and drop the reference obtained by create().
- (*static_cast<sigc::slot<void>*>(slot))();
+ (*static_cast<sigc::slot<void()>*>(slot))();
}
catch (Glib::Thread::Exit&)
{
@@ -69,10 +69,10 @@ thread_init_impl()
// static
Thread*
-Thread::create(const sigc::slot<void>& slot, bool /* joinable */)
+Thread::create(const sigc::slot<void()>& slot, bool /* joinable */)
{
// Make a copy of slot on the heap
- const auto slot_copy = new sigc::slot<void>(slot);
+ const auto slot_copy = new sigc::slot<void()>(slot);
GError* error = nullptr;
@@ -94,11 +94,11 @@ Thread::create(const sigc::slot<void>& slot, bool /* joinable */)
// static
Thread*
-Thread::create(const sigc::slot<void>& slot, unsigned long stack_size, bool joinable, bool bound,
+Thread::create(const sigc::slot<void()>& slot, unsigned long stack_size, bool joinable, bool bound,
ThreadPriority priority)
{
// Make a copy of slot on the heap
- const auto slot_copy = new sigc::slot<void>(slot);
+ const auto slot_copy = new sigc::slot<void()>(slot);
GError* error = nullptr;
diff --git a/glib/src/thread.hg b/glib/src/thread.hg
index 57b940f2..045ce2b6 100644
--- a/glib/src/thread.hg
+++ b/glib/src/thread.hg
@@ -184,7 +184,7 @@ public:
* @return The new Thread* on success.
* @throw Glib::ThreadError
*/
- static Thread* create(const sigc::slot<void>& slot, bool joinable = true);
+ static Thread* create(const sigc::slot<void()>& slot, bool joinable = true);
/** Returns the Thread* corresponding to the calling thread.
* @return The current thread.
@@ -228,9 +228,9 @@ public:
* here as a default.
*
* @note Only use the extended
- * create(const sigc::slot<void>&, unsigned long, bool, bool, ThreadPriority)
+ * create(const sigc::slot<void()>&, unsigned long, bool, bool, ThreadPriority)
* function, when you really can't use the simple
- * create(const sigc::slot<void>&, bool)
+ * create(const sigc::slot<void()>&, bool)
* instead. The latter overload does not take @a stack_size, @a bound and
* @a priority as arguments, as they should only be used for cases, where
* it is inevitable.
@@ -246,7 +246,7 @@ public:
* @deprecated Use the simpler create() method instead, because all Threads
* are now joinable, and bounds and priority parameters now have no effect.
*/
- static Thread* create(const sigc::slot<void>& slot, unsigned long stack_size,
+ static Thread* create(const sigc::slot<void()>& slot, unsigned long stack_size,
bool joinable, bool bound, ThreadPriority priority);
/** Returns whether the thread is joinable.
diff --git a/glib/src/threads.ccg b/glib/src/threads.ccg
index 274b5a1e..8b66493c 100644
--- a/glib/src/threads.ccg
+++ b/glib/src/threads.ccg
@@ -45,7 +45,7 @@ call_thread_entry_slot(void* data)
try
{
// Recreate the specific slot.
- (*static_cast<sigc::slot<void>*>(slot))();
+ (*static_cast<sigc::slot<void()>*>(slot))();
}
catch (Glib::Threads::Thread::Exit&)
{
@@ -75,10 +75,10 @@ namespace Threads
// static
Thread*
-Thread::create(const sigc::slot<void>& slot, const std::string& name)
+Thread::create(const sigc::slot<void()>& slot, const std::string& name)
{
// Make a copy of slot on the heap.
- const auto slot_copy = new sigc::slot<void>(slot);
+ const auto slot_copy = new sigc::slot<void()>(slot);
GError* error = nullptr;
auto thread = g_thread_try_new(
@@ -98,7 +98,7 @@ Thread::create(const sigc::slot<void>& slot, const std::string& name)
// static
Thread*
-Thread::create(const sigc::slot<void>& slot)
+Thread::create(const sigc::slot<void()>& slot)
{
return create(slot, std::string());
}
diff --git a/glib/src/threads.hg b/glib/src/threads.hg
index 6340f45f..afd8877f 100644
--- a/glib/src/threads.hg
+++ b/glib/src/threads.hg
@@ -98,7 +98,7 @@ public:
class Exit;
//See http://bugzilla.gnome.org/show_bug.cgi?id=512348 about the sigc::trackable issue.
- // TODO: At the next ABI break, consider changing const sigc::slot<void>& slot
+ // TODO: At the next ABI break, consider changing const sigc::slot<void()>& slot
// to const std::function<void()>& func, if it can be assumed that all supported
// compilers understand the C++11 template class std::function<>.
/** Creates a new thread.
@@ -117,7 +117,7 @@ public:
* @return The new Thread* on success.
* @throw Glib::Threads::ThreadError
*/
- static Thread* create(const sigc::slot<void>& slot);
+ static Thread* create(const sigc::slot<void()>& slot);
// TODO: At next ABI break, remove the single parameter create
// method and default name to std::string()
@@ -145,7 +145,7 @@ public:
*
* @newin{2,36}
*/
- static Thread* create(const sigc::slot<void>& slot, const std::string& name);
+ static Thread* create(const sigc::slot<void()>& slot, const std::string& name);
/** Returns the Thread* corresponding to the calling thread.
* @return The current thread.
diff --git a/glib/src/valuearray.hg b/glib/src/valuearray.hg
index c1b56385..06d4e705 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.
*/
- using SlotCompare = sigc::slot<int, const Glib::ValueBase&, const Glib::ValueBase&>;
+ using SlotCompare = sigc::slot<int(const Glib::ValueBase&, const Glib::ValueBase&)>;
/** Default constructor. Constructs a new array with no pre-allocation.
*/