From 0ca323351606b0fa2f8519155a3edd0cc6a51805 Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Thu, 31 Mar 2016 12:52:18 +0200 Subject: sigc3: .hg/.ccg files: Use sigc::slot syntax. --- glib/src/balancedtree.hg | 10 +++++----- glib/src/binding.hg | 28 ++++++++++++++-------------- glib/src/bytearray.hg | 2 +- glib/src/nodetree.hg | 16 ++++++++-------- glib/src/optioncontext.hg | 2 +- glib/src/optiongroup.hg | 6 +++--- glib/src/spawn.hg | 2 +- glib/src/thread.ccg | 10 +++++----- glib/src/thread.hg | 8 ++++---- glib/src/threads.ccg | 8 ++++---- glib/src/threads.hg | 6 +++--- glib/src/valuearray.hg | 2 +- 12 files changed, 50 insertions(+), 50 deletions(-) (limited to 'glib') 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; - using CompareFunc = sigc::slot; + using TraverseFunc = sigc::slot; + using CompareFunc = sigc::slot; protected: BalancedTree() : @@ -235,8 +235,8 @@ public: */ V* search(const CompareFunc &search_func, const K& key) { - sigc::slot real_slot = sigc::ptr_fun(on_compare_key); - sigc::slot bound_slot = sigc::bind(real_slot, search_func, key); + sigc::slot real_slot = sigc::ptr_fun(on_compare_key); + sigc::slot bound_slot = sigc::bind(real_slot, search_func, key); gpointer value = g_tree_search(gobj(), c_callback_search, reinterpret_cast(&bound_slot)); return reinterpret_cast(value); @@ -278,7 +278,7 @@ private: /// Wrapper for invoking GCompareFunc. static gint c_callback_search(gconstpointer a, gconstpointer b) { - const sigc::slot* slot = reinterpret_cast *>(b); + const auto slot = reinterpret_cast *>(b); return (*slot)(*reinterpret_cast(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 true if the transformation was successful, and false otherwise. */ - using SlotTransform = sigc::slot; + using SlotTransform = sigc::slot; /** 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 object. * @tparam T_functor_to Type of functor that translates from the source to the target. * Must be convertible to
- * sigc::slot. + * sigc::slot. * * @see bind_property_value() * @@ -196,7 +196,7 @@ public: BindingFlags flags, const T_functor_to& transform_to) { - sigc::slot slot_transform_to = transform_to; + sigc::slot slot_transform_to = transform_to; return bind_property_value(source_property, target_property, flags, slot_transform_to.empty() ? SlotTransform() : TransformProp(slot_transform_to)); @@ -219,7 +219,7 @@ public: * stored in a Glib::Value object. * @tparam T_functor_to Type of functor that translates from the source to the target. * Must be convertible to
- * sigc::slot. + * sigc::slot. * * @see bind_property_value() * @@ -232,7 +232,7 @@ public: BindingFlags flags, const T_functor_to& transform_to) { - sigc::slot slot_transform_to = transform_to; + sigc::slot slot_transform_to = transform_to; return bind_property_value(source_property, target_property, flags, slot_transform_to.empty() ? SlotTransform() : TransformProp(slot_transform_to)); @@ -255,7 +255,7 @@ public: * stored in a Glib::Value object. * @tparam T_functor_to Type of functor that translates from the source to the target. * Must be convertible to
- * sigc::slot. + * sigc::slot. * * @see bind_property_value() * @@ -268,7 +268,7 @@ public: BindingFlags flags, const T_functor_to& transform_to) { - sigc::slot slot_transform_to = transform_to; + sigc::slot slot_transform_to = transform_to; return bind_property_value(source_property, target_property, flags, slot_transform_to.empty() ? SlotTransform() : TransformProp(slot_transform_to)); @@ -291,7 +291,7 @@ public: * stored in a Glib::Value object. * @tparam T_functor_to Type of functor that translates from the source to the target. * Must be convertible to
- * sigc::slot. + * sigc::slot. * * @see bind_property_value() * @@ -304,7 +304,7 @@ public: BindingFlags flags, const T_functor_to& transform_to) { - sigc::slot slot_transform_to = transform_to; + sigc::slot slot_transform_to = transform_to; return bind_property_value(source_property, target_property, flags, slot_transform_to.empty() ? SlotTransform() : TransformProp(slot_transform_to)); @@ -329,10 +329,10 @@ public: * stored in a Glib::Value object. * @tparam T_functor_to Type of functor that translates from the source to the target. * Must be convertible to
- * sigc::slot. + * sigc::slot. * @tparam T_functor_from Type of functor that translates from the target to the source. * Must be convertible to
- * sigc::slot. + * sigc::slot. * * @see bind_property_value() * @@ -346,8 +346,8 @@ public: const T_functor_to& transform_to, const T_functor_from& transform_from) { - sigc::slot slot_transform_to = transform_to; - sigc::slot slot_transform_from = transform_from; + sigc::slot slot_transform_to = transform_to; + sigc::slot slot_transform_from = transform_from; return bind_property_value(source_property, target_property, flags, slot_transform_to.empty() ? SlotTransform() : TransformProp(slot_transform_to), @@ -395,7 +395,7 @@ private: { public: using result_type = bool; - using SlotTypedTransform = sigc::slot; + using SlotTypedTransform = sigc::slot; 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); * */ - using SlotCompare = sigc::slot; + using SlotCompare = sigc::slot; _WRAP_METHOD(static Glib::RefPtr 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&>; - using ForeachFunc = sigc::slot&>; + using TraverseFunc = sigc::slot&)>; + using ForeachFunc = sigc::slot&)>; private: static NodeTree* wrap(GNode* node) @@ -337,10 +337,10 @@ public: */ NodeTree* find_child(const T& the_data, TraverseFlags flags = TRAVERSE_ALL) { - sigc::slot real_slot = sigc::ptr_fun(on_compare_child); + sigc::slot real_slot = sigc::ptr_fun(on_compare_child); GNode* child = nullptr; - using type_foreach_gnode_slot = sigc::slot; + using type_foreach_gnode_slot = sigc::slot; 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(&bound_slot)); @@ -371,10 +371,10 @@ public: NodeTree* 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 real_slot = sigc::ptr_fun(on_compare_node); + sigc::slot real_slot = sigc::ptr_fun(on_compare_node); GNode* child = nullptr; - using type_traverse_gnode_slot = sigc::slot; + using type_traverse_gnode_slot = sigc::slot; type_traverse_gnode_slot bound_slot = sigc::bind(real_slot, the_data, &child); g_node_traverse(const_cast(gobj()), (GTraverseType)order, (GTraverseFlags)flags, -1, c_callback_traverse_compare_node, reinterpret_cast(&bound_slot)); @@ -732,7 +732,7 @@ private: } } - /// Wrapper for invoking a sigc::slot (Internal use). + /// Wrapper for invoking a sigc::slot (Internal use). static void c_callback_foreach_compare_child(GNode* node, gpointer data) { const ForeachFunc* slot = reinterpret_cast(data); @@ -750,7 +750,7 @@ private: return FALSE; } - /// Wrapper for invoking a sigc::slot (Internal use). + /// Wrapper for invoking a sigc::slot (Internal use). static gboolean c_callback_traverse_compare_node(GNode* node, gpointer data) { const TraverseFunc* slot = reinterpret_cast(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; + using SlotTranslate = sigc::slot; /** * 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; + using SlotTranslate = sigc::slot; /** For example bool on_option_arg_string(const Glib::ustring& option_name, * const Glib::ustring& value, bool has_value);. */ - using SlotOptionArgString = sigc::slot; + using SlotOptionArgString = sigc::slot; /** For example bool on_option_arg_filename(const Glib::ustring& option_name, * const std::string& value, bool has_value);. */ - using SlotOptionArgFilename = sigc::slot; + using SlotOptionArgFilename = sigc::slot; 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,
* void on_child_setup(); */ -using SlotSpawnChildSetup = sigc::slot; +using SlotSpawnChildSetup = sigc::slot; /** 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*>(slot))(); + (*static_cast*>(slot))(); } catch (Glib::Thread::Exit&) { @@ -69,10 +69,10 @@ thread_init_impl() // static Thread* -Thread::create(const sigc::slot& slot, bool /* joinable */) +Thread::create(const sigc::slot& slot, bool /* joinable */) { // Make a copy of slot on the heap - const auto slot_copy = new sigc::slot(slot); + const auto slot_copy = new sigc::slot(slot); GError* error = nullptr; @@ -94,11 +94,11 @@ Thread::create(const sigc::slot& slot, bool /* joinable */) // static Thread* -Thread::create(const sigc::slot& slot, unsigned long stack_size, bool joinable, bool bound, +Thread::create(const sigc::slot& 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(slot); + const auto slot_copy = new sigc::slot(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& slot, bool joinable = true); + static Thread* create(const sigc::slot& 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&, unsigned long, bool, bool, ThreadPriority) + * create(const sigc::slot&, unsigned long, bool, bool, ThreadPriority) * function, when you really can't use the simple - * create(const sigc::slot&, bool) + * create(const sigc::slot&, 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& slot, unsigned long stack_size, + static Thread* create(const sigc::slot& 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*>(slot))(); + (*static_cast*>(slot))(); } catch (Glib::Threads::Thread::Exit&) { @@ -75,10 +75,10 @@ namespace Threads // static Thread* -Thread::create(const sigc::slot& slot, const std::string& name) +Thread::create(const sigc::slot& slot, const std::string& name) { // Make a copy of slot on the heap. - const auto slot_copy = new sigc::slot(slot); + const auto slot_copy = new sigc::slot(slot); GError* error = nullptr; auto thread = g_thread_try_new( @@ -98,7 +98,7 @@ Thread::create(const sigc::slot& slot, const std::string& name) // static Thread* -Thread::create(const sigc::slot& slot) +Thread::create(const sigc::slot& 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& slot + // TODO: At the next ABI break, consider changing const sigc::slot& slot // to const std::function& 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& slot); + static Thread* create(const sigc::slot& 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& slot, const std::string& name); + static Thread* create(const sigc::slot& 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; + using SlotCompare = sigc::slot; /** Default constructor. Constructs a new array with no pre-allocation. */ -- cgit v1.2.1