From 7d85510b1011a50347a44349d48ccb797c432763 Mon Sep 17 00:00:00 2001 From: Slava Andrejev Date: Wed, 26 May 2021 04:29:09 -0700 Subject: [PATCH 001/112] Allow slots with rvalue reference parameters In code based on Glibmm it's quite common to convert a Glib C structure to a Glib::Object's descendant before passing it as a parameter to a slot. If the slot is not supposed to modify the object, then everything is fine, we can declare the parameter as a const reference and the temporary object will be accurately dealt with by the compiler. However, if the Glib based object is getting modified, the only way to pass it to the slot is to declare it a Glib::RefPtr shared pointer. This creates a lot of unnecessary churn of memory allocations for a simple deal of calling a signal. However, C++ has a specific mean for this particular semantic of passing a temporary object: rvalue reference. For example, somewhere inside Gtkmm might be a declaration: _WRAP_SIGNAL(void sun_rose(const Glib::RefPtr &new_sun), "sun-rose") Instead its more semantically correct to write: _WRAP_SIGNAL(void sun_rose(Gtk::Sun &&new_sun), "sun-rose") And later somewhere in your code: world->signal_sun_rose().connect([&](auto &&new_sun) { new_sun.shine(); }); This commit makes a couple of simple modifications that allow declaring signals and slots with rvalue reference parameter. --- sigc++/functors/slot.h | 5 ++-- sigc++/signal.h | 10 +++++--- sigc++/type_traits.h | 7 +++++ tests/memleakcheck.sh | 4 +-- tests/meson.build | 1 + tests/test_rvalue_ref.cc | 55 ++++++++++++++++++++++++++++++++++++++++ 6 files changed, 75 insertions(+), 7 deletions(-) create mode 100644 tests/test_rvalue_ref.cc diff --git a/sigc++/functors/slot.h b/sigc++/functors/slot.h index 971de652..8e9e01a7 100644 --- a/sigc++/functors/slot.h +++ b/sigc++/functors/slot.h @@ -151,7 +151,8 @@ struct slot_call static T_return call_it(slot_rep* rep, type_trait_take_t... a_) { auto typed_rep = static_cast*>(rep); - return (*typed_rep->functor_).template operator()...>(a_...); + return (*typed_rep->functor_).template operator()...>( + std::forward>(a_)...); } /** Forms a function pointer from call_it(). @@ -220,7 +221,7 @@ class slot : public slot_base { return std::invoke(sigc::internal::function_pointer_cast(slot_base::rep_->call_), slot_base::rep_, - a...); + std::forward>(a)...); } return T_return(); diff --git a/sigc++/signal.h b/sigc++/signal.h index 69ca4d08..336bd5fd 100644 --- a/sigc++/signal.h +++ b/sigc++/signal.h @@ -363,7 +363,9 @@ struct signal_emit if (slot.empty() || slot.blocked()) continue; - (sigc::internal::function_pointer_cast(slot.rep_->call_))(slot.rep_, a...); + (sigc::internal::function_pointer_cast(slot.rep_->call_))( + slot.rep_, + std::forward>(a)...); } } }; @@ -450,11 +452,13 @@ class signal_with_accumulator : public signal_base decltype(auto) emit(type_trait_take_t... a) const { using emitter_type = internal::signal_emit; - return emitter_type::emit(impl_, a...); + return emitter_type::emit(impl_, std::forward>(a)...); } /** Triggers the emission of the signal (see emit()). */ - decltype(auto) operator()(type_trait_take_t... a) const { return emit(a...); } + decltype(auto) operator()(type_trait_take_t... a) const { + return emit(std::forward>(a)...); + } /** Creates a functor that calls emit() on this signal. * @code diff --git a/sigc++/type_traits.h b/sigc++/type_traits.h index 1af84e14..82690eb6 100644 --- a/sigc++/type_traits.h +++ b/sigc++/type_traits.h @@ -52,6 +52,13 @@ struct type_trait using take = const T_type&; }; +template +struct type_trait +{ + using pass = T_type&&; + using take = T_type&&; +}; + template<> struct type_trait { diff --git a/tests/memleakcheck.sh b/tests/memleakcheck.sh index 4c8f4cd9..38fbd586 100755 --- a/tests/memleakcheck.sh +++ b/tests/memleakcheck.sh @@ -9,8 +9,8 @@ for testprog in test_accum_iter test_accumulated test_bind test_bind_as_slot \ test_copy_invalid_slot test_cpp11_lambda test_custom test_disconnect \ test_disconnect_during_emit test_exception_catch test_hide \ test_limit_reference test_member_method_trait test_mem_fun test_ptr_fun \ - test_retype test_retype_return test_signal test_signal_move test_size \ - test_slot test_slot_disconnect test_slot_move test_trackable \ + test_retype test_retype_return test_rvalue_ref test_signal test_signal_move \ + test_size test_slot test_slot_disconnect test_slot_move test_trackable \ test_trackable_move test_track_obj test_tuple_cdr test_tuple_end \ test_tuple_for_each test_tuple_start test_tuple_transform_each \ test_visit_each test_visit_each_trackable test_weak_raw_ptr diff --git a/tests/meson.build b/tests/meson.build index 27ecda00..5b6b0c71 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -28,6 +28,7 @@ test_programs = [ [[], 'test_ptr_fun', ['test_ptr_fun.cc', 'testutilities.cc']], [[], 'test_retype', ['test_retype.cc', 'testutilities.cc']], [[], 'test_retype_return', ['test_retype_return.cc', 'testutilities.cc']], + [[], 'test_rvalue_ref', ['test_rvalue_ref.cc', 'testutilities.cc']], [[], 'test_signal', ['test_signal.cc', 'testutilities.cc']], [[], 'test_signal_move', ['test_signal_move.cc', 'testutilities.cc']], [[], 'test_size', ['test_size.cc', 'testutilities.cc']], diff --git a/tests/test_rvalue_ref.cc b/tests/test_rvalue_ref.cc new file mode 100644 index 00000000..b35ace17 --- /dev/null +++ b/tests/test_rvalue_ref.cc @@ -0,0 +1,55 @@ +#include "testutilities.h" +#include +#include + +struct MoveableStruct {}; + +namespace +{ +TestUtilities* util = nullptr; +std::ostringstream result_stream; + +struct foo +{ + void operator()(MoveableStruct &&x) + { + result_stream << "foo(MoveableStruct&&)"; + } +}; + +} // end anonymous namespace + +void +test_signal() +{ + sigc::signal signal; + foo f; + signal.connect(f); + MoveableStruct x; + signal(std::move(x)); + util->check_result(result_stream, "foo(MoveableStruct&&)"); +} + +void +test_slot() +{ + sigc::slot slot; + foo f; + slot = f; + MoveableStruct x; + slot(std::move(x)); + util->check_result(result_stream, "foo(MoveableStruct&&)"); +} + +int +main(int argc, char* argv[]) +{ + util = TestUtilities::get_instance(); + if (!util->check_command_args(argc, argv)) + return util->get_result_and_delete_instance() ? EXIT_SUCCESS : EXIT_FAILURE; + + test_signal(); + test_slot(); + + return util->get_result_and_delete_instance() ? EXIT_SUCCESS : EXIT_FAILURE; +} // end main() From 01652fdbc9f6fc2e72b217c9de8c89c93f95ba7c Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Wed, 2 Jun 2021 22:13:48 +0200 Subject: [PATCH 002/112] test_rvalue_ref: Small fixes * tests/.gitignore: * tests/CMakeLists.txt: * tests/Makefile.am: Add test_rvalue_ref. * tests/test_rvalue_ref.cc: Avoid [-Werror=unused-parameter] when building with warnings=fatal. Some files have also been reformated with clang-format in order to make the CI tests happy. Reformated with clang-format 12, but CI uses clang-format 10. --- sigc++/functors/slot.h | 5 +++-- sigc++/signal.h | 6 +++--- tests/.gitignore | 1 + tests/CMakeLists.txt | 1 + tests/Makefile.am | 2 ++ tests/test_bind.cc | 2 +- tests/test_cpp11_lambda.cc | 14 +++++++------- tests/test_member_method_trait.cc | 4 ++-- tests/test_rvalue_ref.cc | 13 ++++++------- tests/test_signal.cc | 10 ++++++---- tests/test_track_obj.cc | 4 ++-- 11 files changed, 34 insertions(+), 28 deletions(-) diff --git a/sigc++/functors/slot.h b/sigc++/functors/slot.h index 8e9e01a7..e368e864 100644 --- a/sigc++/functors/slot.h +++ b/sigc++/functors/slot.h @@ -151,8 +151,9 @@ struct slot_call static T_return call_it(slot_rep* rep, type_trait_take_t... a_) { auto typed_rep = static_cast*>(rep); - return (*typed_rep->functor_).template operator()...>( - std::forward>(a_)...); + return (*typed_rep->functor_) + .template operator()...>( + std::forward>(a_)...); } /** Forms a function pointer from call_it(). diff --git a/sigc++/signal.h b/sigc++/signal.h index 336bd5fd..c1b0f339 100644 --- a/sigc++/signal.h +++ b/sigc++/signal.h @@ -364,8 +364,7 @@ struct signal_emit continue; (sigc::internal::function_pointer_cast(slot.rep_->call_))( - slot.rep_, - std::forward>(a)...); + slot.rep_, std::forward>(a)...); } } }; @@ -456,7 +455,8 @@ class signal_with_accumulator : public signal_base } /** Triggers the emission of the signal (see emit()). */ - decltype(auto) operator()(type_trait_take_t... a) const { + decltype(auto) operator()(type_trait_take_t... a) const + { return emit(std::forward>(a)...); } diff --git a/tests/.gitignore b/tests/.gitignore index 276abe2f..0a788ab4 100644 --- a/tests/.gitignore +++ b/tests/.gitignore @@ -24,6 +24,7 @@ /test_ptr_fun /test_retype /test_retype_return +/test_rvalue_ref /test_signal /test_signal_move /test_size diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 36e728b1..9485b45f 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -39,6 +39,7 @@ set (TEST_SOURCE_FILES test_ptr_fun.cc test_retype.cc test_retype_return.cc + test_rvalue_ref.cc test_signal.cc test_signal_move.cc test_size.cc diff --git a/tests/Makefile.am b/tests/Makefile.am index 735d76b1..b05f7b47 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -46,6 +46,7 @@ check_PROGRAMS = \ test_ptr_fun \ test_retype \ test_retype_return \ + test_rvalue_ref \ test_signal \ test_signal_move \ test_size \ @@ -90,6 +91,7 @@ test_mem_fun_SOURCES = test_mem_fun.cc $(sigc_test_util) test_ptr_fun_SOURCES = test_ptr_fun.cc $(sigc_test_util) test_retype_SOURCES = test_retype.cc $(sigc_test_util) test_retype_return_SOURCES = test_retype_return.cc $(sigc_test_util) +test_rvalue_ref_SOURCES = test_rvalue_ref.cc $(sigc_test_util) test_signal_SOURCES = test_signal.cc $(sigc_test_util) test_signal_move_SOURCES = test_signal_move.cc $(sigc_test_util) test_size_SOURCES = test_size.cc $(sigc_test_util) diff --git a/tests/test_bind.cc b/tests/test_bind.cc index fa8537b0..0cd192ca 100644 --- a/tests/test_bind.cc +++ b/tests/test_bind.cc @@ -70,7 +70,7 @@ struct book : public sigc::trackable book& operator=(book&&) = delete; std::string& get_name() { return name_; } - operator std::string &() { return get_name(); } + operator std::string&() { return get_name(); } private: std::string name_; diff --git a/tests/test_cpp11_lambda.cc b/tests/test_cpp11_lambda.cc index a8e90b2e..ed125361 100644 --- a/tests/test_cpp11_lambda.cc +++ b/tests/test_cpp11_lambda.cc @@ -88,7 +88,7 @@ egon(std::string& str) struct book : public sigc::trackable { explicit book(const std::string& name) : name_(name) {} - operator std::string &() { return name_; } + operator std::string&() { return name_; } std::string name_; }; @@ -184,8 +184,8 @@ main(int argc, char* argv[]) // See https://bugzilla.gnome.org/show_bug.cgi?id=669128 // std::cout << "((++_1)*2)(ref(a)): " << ((++_1)*2)(std::ref(a)); // std::cout << "; a: " << a << std::endl; - result_stream << ([](std::reference_wrapper x) -> int { return ++x * 2; }( - std::ref(a_outer))); + result_stream << ([](std::reference_wrapper x) -> int + { return ++x * 2; }(std::ref(a_outer))); result_stream << " " << a_outer; util->check_result(result_stream, "4 2"); result_stream << ([](int& x) -> int { return ++x * 2; }(a_outer)); @@ -200,8 +200,8 @@ main(int argc, char* argv[]) // std::cout << "((--(*(&_1)))*2)(ref(a)): " << ((--(*(&_1)))*2)(std::ref(a)); // std::cout << "; a: " << a << std::endl; - result_stream << ([](std::reference_wrapper x) -> int { return --(*(&x)) * 2; }( - std::ref(a_outer))); + result_stream << ([](std::reference_wrapper x) -> int + { return --(*(&x)) * 2; }(std::ref(a_outer))); result_stream << " " << a_outer; util->check_result(result_stream, "6 3"); result_stream << ([](int& x) -> int { return --(*(&x)) * 2; }(a_outer)); @@ -234,8 +234,8 @@ main(int argc, char* argv[]) // std::cout << "(var(c) = (var(a) = _1, var(b) = _2))(2,3): " // << (sigc::var(c) = (sigc::var(a) = _1, sigc::var(b) = _2))(2,3); // std::cout << "; a: " << a << "; b: " << b << "; c: " << c << std::endl; - result_stream << ([&a_outer, &b_outer, &c_outer]( - int x, int y) -> int { return c_outer = (a_outer = x, b_outer = y); }(2, 3)); + result_stream << ([&a_outer, &b_outer, &c_outer](int x, int y) -> int + { return c_outer = (a_outer = x, b_outer = y); }(2, 3)); result_stream << " " << a_outer << " " << b_outer << " " << c_outer; util->check_result(result_stream, "3 2 3 3"); diff --git a/tests/test_member_method_trait.cc b/tests/test_member_method_trait.cc index 376d6855..bc5c4502 100644 --- a/tests/test_member_method_trait.cc +++ b/tests/test_member_method_trait.cc @@ -60,8 +60,8 @@ test_member_method_is_volatile() sigc::internal::member_method_is_volatile::value, "member_method_is_const failed to identify a volatile member method."); - static_assert(sigc::internal::member_method_is_volatile::value, + static_assert(sigc::internal::member_method_is_volatile< + decltype(&Something::some_const_volatile_func)>::value, "member_method_is_const failed to identify a volatile member method."); } diff --git a/tests/test_rvalue_ref.cc b/tests/test_rvalue_ref.cc index b35ace17..54b04f34 100644 --- a/tests/test_rvalue_ref.cc +++ b/tests/test_rvalue_ref.cc @@ -2,7 +2,9 @@ #include #include -struct MoveableStruct {}; +struct MoveableStruct +{ +}; namespace { @@ -11,10 +13,7 @@ std::ostringstream result_stream; struct foo { - void operator()(MoveableStruct &&x) - { - result_stream << "foo(MoveableStruct&&)"; - } + void operator()(MoveableStruct&& /* x */) { result_stream << "foo(MoveableStruct&&)"; } }; } // end anonymous namespace @@ -22,7 +21,7 @@ struct foo void test_signal() { - sigc::signal signal; + sigc::signal signal; foo f; signal.connect(f); MoveableStruct x; @@ -33,7 +32,7 @@ test_signal() void test_slot() { - sigc::slot slot; + sigc::slot slot; foo f; slot = f; MoveableStruct x; diff --git a/tests/test_signal.cc b/tests/test_signal.cc index b5fdaf25..d050558b 100644 --- a/tests/test_signal.cc +++ b/tests/test_signal.cc @@ -117,10 +117,12 @@ test_clear_called_in_signal_handler() { sigc::signal sig; sig.connect([]() { result_stream << ", slot 1, "; }); - sig.connect([&sig]() { - sig.clear(); - result_stream << "slot 2, "; - }); + sig.connect( + [&sig]() + { + sig.clear(); + result_stream << "slot 2, "; + }); sig.connect([]() { result_stream << "slot 3, "; }); result_stream << sig.size(); sig.emit(); diff --git a/tests/test_track_obj.cc b/tests/test_track_obj.cc index cf18b7bb..aefdb078 100644 --- a/tests/test_track_obj.cc +++ b/tests/test_track_obj.cc @@ -40,8 +40,8 @@ std::ostringstream result_stream; struct book : public sigc::trackable { explicit book(const std::string& name) : name_(name) {} - operator std::string &() { return name_; } - operator const std::string &() const { return name_; } + operator std::string&() { return name_; } + operator const std::string&() const { return name_; } std::string name_; }; From 070095a6addddea72b04cebe7479698082ac1419 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Wed, 2 Jun 2021 22:28:47 +0200 Subject: [PATCH 003/112] Revert "test_rvalue_ref: Small fixes" This reverts commit 01652fdbc9f6fc2e72b217c9de8c89c93f95ba7c. --- sigc++/functors/slot.h | 5 ++--- sigc++/signal.h | 6 +++--- tests/.gitignore | 1 - tests/CMakeLists.txt | 1 - tests/Makefile.am | 2 -- tests/test_bind.cc | 2 +- tests/test_cpp11_lambda.cc | 14 +++++++------- tests/test_member_method_trait.cc | 4 ++-- tests/test_rvalue_ref.cc | 13 +++++++------ tests/test_signal.cc | 10 ++++------ tests/test_track_obj.cc | 4 ++-- 11 files changed, 28 insertions(+), 34 deletions(-) diff --git a/sigc++/functors/slot.h b/sigc++/functors/slot.h index e368e864..8e9e01a7 100644 --- a/sigc++/functors/slot.h +++ b/sigc++/functors/slot.h @@ -151,9 +151,8 @@ struct slot_call static T_return call_it(slot_rep* rep, type_trait_take_t... a_) { auto typed_rep = static_cast*>(rep); - return (*typed_rep->functor_) - .template operator()...>( - std::forward>(a_)...); + return (*typed_rep->functor_).template operator()...>( + std::forward>(a_)...); } /** Forms a function pointer from call_it(). diff --git a/sigc++/signal.h b/sigc++/signal.h index c1b0f339..336bd5fd 100644 --- a/sigc++/signal.h +++ b/sigc++/signal.h @@ -364,7 +364,8 @@ struct signal_emit continue; (sigc::internal::function_pointer_cast(slot.rep_->call_))( - slot.rep_, std::forward>(a)...); + slot.rep_, + std::forward>(a)...); } } }; @@ -455,8 +456,7 @@ class signal_with_accumulator : public signal_base } /** Triggers the emission of the signal (see emit()). */ - decltype(auto) operator()(type_trait_take_t... a) const - { + decltype(auto) operator()(type_trait_take_t... a) const { return emit(std::forward>(a)...); } diff --git a/tests/.gitignore b/tests/.gitignore index 0a788ab4..276abe2f 100644 --- a/tests/.gitignore +++ b/tests/.gitignore @@ -24,7 +24,6 @@ /test_ptr_fun /test_retype /test_retype_return -/test_rvalue_ref /test_signal /test_signal_move /test_size diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 9485b45f..36e728b1 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -39,7 +39,6 @@ set (TEST_SOURCE_FILES test_ptr_fun.cc test_retype.cc test_retype_return.cc - test_rvalue_ref.cc test_signal.cc test_signal_move.cc test_size.cc diff --git a/tests/Makefile.am b/tests/Makefile.am index b05f7b47..735d76b1 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -46,7 +46,6 @@ check_PROGRAMS = \ test_ptr_fun \ test_retype \ test_retype_return \ - test_rvalue_ref \ test_signal \ test_signal_move \ test_size \ @@ -91,7 +90,6 @@ test_mem_fun_SOURCES = test_mem_fun.cc $(sigc_test_util) test_ptr_fun_SOURCES = test_ptr_fun.cc $(sigc_test_util) test_retype_SOURCES = test_retype.cc $(sigc_test_util) test_retype_return_SOURCES = test_retype_return.cc $(sigc_test_util) -test_rvalue_ref_SOURCES = test_rvalue_ref.cc $(sigc_test_util) test_signal_SOURCES = test_signal.cc $(sigc_test_util) test_signal_move_SOURCES = test_signal_move.cc $(sigc_test_util) test_size_SOURCES = test_size.cc $(sigc_test_util) diff --git a/tests/test_bind.cc b/tests/test_bind.cc index 0cd192ca..fa8537b0 100644 --- a/tests/test_bind.cc +++ b/tests/test_bind.cc @@ -70,7 +70,7 @@ struct book : public sigc::trackable book& operator=(book&&) = delete; std::string& get_name() { return name_; } - operator std::string&() { return get_name(); } + operator std::string &() { return get_name(); } private: std::string name_; diff --git a/tests/test_cpp11_lambda.cc b/tests/test_cpp11_lambda.cc index ed125361..a8e90b2e 100644 --- a/tests/test_cpp11_lambda.cc +++ b/tests/test_cpp11_lambda.cc @@ -88,7 +88,7 @@ egon(std::string& str) struct book : public sigc::trackable { explicit book(const std::string& name) : name_(name) {} - operator std::string&() { return name_; } + operator std::string &() { return name_; } std::string name_; }; @@ -184,8 +184,8 @@ main(int argc, char* argv[]) // See https://bugzilla.gnome.org/show_bug.cgi?id=669128 // std::cout << "((++_1)*2)(ref(a)): " << ((++_1)*2)(std::ref(a)); // std::cout << "; a: " << a << std::endl; - result_stream << ([](std::reference_wrapper x) -> int - { return ++x * 2; }(std::ref(a_outer))); + result_stream << ([](std::reference_wrapper x) -> int { return ++x * 2; }( + std::ref(a_outer))); result_stream << " " << a_outer; util->check_result(result_stream, "4 2"); result_stream << ([](int& x) -> int { return ++x * 2; }(a_outer)); @@ -200,8 +200,8 @@ main(int argc, char* argv[]) // std::cout << "((--(*(&_1)))*2)(ref(a)): " << ((--(*(&_1)))*2)(std::ref(a)); // std::cout << "; a: " << a << std::endl; - result_stream << ([](std::reference_wrapper x) -> int - { return --(*(&x)) * 2; }(std::ref(a_outer))); + result_stream << ([](std::reference_wrapper x) -> int { return --(*(&x)) * 2; }( + std::ref(a_outer))); result_stream << " " << a_outer; util->check_result(result_stream, "6 3"); result_stream << ([](int& x) -> int { return --(*(&x)) * 2; }(a_outer)); @@ -234,8 +234,8 @@ main(int argc, char* argv[]) // std::cout << "(var(c) = (var(a) = _1, var(b) = _2))(2,3): " // << (sigc::var(c) = (sigc::var(a) = _1, sigc::var(b) = _2))(2,3); // std::cout << "; a: " << a << "; b: " << b << "; c: " << c << std::endl; - result_stream << ([&a_outer, &b_outer, &c_outer](int x, int y) -> int - { return c_outer = (a_outer = x, b_outer = y); }(2, 3)); + result_stream << ([&a_outer, &b_outer, &c_outer]( + int x, int y) -> int { return c_outer = (a_outer = x, b_outer = y); }(2, 3)); result_stream << " " << a_outer << " " << b_outer << " " << c_outer; util->check_result(result_stream, "3 2 3 3"); diff --git a/tests/test_member_method_trait.cc b/tests/test_member_method_trait.cc index bc5c4502..376d6855 100644 --- a/tests/test_member_method_trait.cc +++ b/tests/test_member_method_trait.cc @@ -60,8 +60,8 @@ test_member_method_is_volatile() sigc::internal::member_method_is_volatile::value, "member_method_is_const failed to identify a volatile member method."); - static_assert(sigc::internal::member_method_is_volatile< - decltype(&Something::some_const_volatile_func)>::value, + static_assert(sigc::internal::member_method_is_volatile::value, "member_method_is_const failed to identify a volatile member method."); } diff --git a/tests/test_rvalue_ref.cc b/tests/test_rvalue_ref.cc index 54b04f34..b35ace17 100644 --- a/tests/test_rvalue_ref.cc +++ b/tests/test_rvalue_ref.cc @@ -2,9 +2,7 @@ #include #include -struct MoveableStruct -{ -}; +struct MoveableStruct {}; namespace { @@ -13,7 +11,10 @@ std::ostringstream result_stream; struct foo { - void operator()(MoveableStruct&& /* x */) { result_stream << "foo(MoveableStruct&&)"; } + void operator()(MoveableStruct &&x) + { + result_stream << "foo(MoveableStruct&&)"; + } }; } // end anonymous namespace @@ -21,7 +22,7 @@ struct foo void test_signal() { - sigc::signal signal; + sigc::signal signal; foo f; signal.connect(f); MoveableStruct x; @@ -32,7 +33,7 @@ test_signal() void test_slot() { - sigc::slot slot; + sigc::slot slot; foo f; slot = f; MoveableStruct x; diff --git a/tests/test_signal.cc b/tests/test_signal.cc index d050558b..b5fdaf25 100644 --- a/tests/test_signal.cc +++ b/tests/test_signal.cc @@ -117,12 +117,10 @@ test_clear_called_in_signal_handler() { sigc::signal sig; sig.connect([]() { result_stream << ", slot 1, "; }); - sig.connect( - [&sig]() - { - sig.clear(); - result_stream << "slot 2, "; - }); + sig.connect([&sig]() { + sig.clear(); + result_stream << "slot 2, "; + }); sig.connect([]() { result_stream << "slot 3, "; }); result_stream << sig.size(); sig.emit(); diff --git a/tests/test_track_obj.cc b/tests/test_track_obj.cc index aefdb078..cf18b7bb 100644 --- a/tests/test_track_obj.cc +++ b/tests/test_track_obj.cc @@ -40,8 +40,8 @@ std::ostringstream result_stream; struct book : public sigc::trackable { explicit book(const std::string& name) : name_(name) {} - operator std::string&() { return name_; } - operator const std::string&() const { return name_; } + operator std::string &() { return name_; } + operator const std::string &() const { return name_; } std::string name_; }; From 317ab48ceb0a416c56c41b091a3769ccf2880ba8 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Wed, 2 Jun 2021 22:36:35 +0200 Subject: [PATCH 004/112] test_rvalue_ref: Small fixes * tests/.gitignore: * tests/CMakeLists.txt: * tests/Makefile.am: Add test_rvalue_ref. * tests/test_rvalue_ref.cc: Avoid [-Werror=unused-parameter] when building with warnings=fatal. Some files have been reformated with clang-format in order to make the CI tests happy. Reformated with clang-format 12, but CI uses clang-format 10. --- sigc++/functors/slot.h | 5 +++-- sigc++/signal.h | 6 +++--- tests/.gitignore | 1 + tests/CMakeLists.txt | 1 + tests/Makefile.am | 2 ++ tests/test_rvalue_ref.cc | 13 ++++++------- 6 files changed, 16 insertions(+), 12 deletions(-) diff --git a/sigc++/functors/slot.h b/sigc++/functors/slot.h index 8e9e01a7..e368e864 100644 --- a/sigc++/functors/slot.h +++ b/sigc++/functors/slot.h @@ -151,8 +151,9 @@ struct slot_call static T_return call_it(slot_rep* rep, type_trait_take_t... a_) { auto typed_rep = static_cast*>(rep); - return (*typed_rep->functor_).template operator()...>( - std::forward>(a_)...); + return (*typed_rep->functor_) + .template operator()...>( + std::forward>(a_)...); } /** Forms a function pointer from call_it(). diff --git a/sigc++/signal.h b/sigc++/signal.h index 336bd5fd..c1b0f339 100644 --- a/sigc++/signal.h +++ b/sigc++/signal.h @@ -364,8 +364,7 @@ struct signal_emit continue; (sigc::internal::function_pointer_cast(slot.rep_->call_))( - slot.rep_, - std::forward>(a)...); + slot.rep_, std::forward>(a)...); } } }; @@ -456,7 +455,8 @@ class signal_with_accumulator : public signal_base } /** Triggers the emission of the signal (see emit()). */ - decltype(auto) operator()(type_trait_take_t... a) const { + decltype(auto) operator()(type_trait_take_t... a) const + { return emit(std::forward>(a)...); } diff --git a/tests/.gitignore b/tests/.gitignore index 276abe2f..0a788ab4 100644 --- a/tests/.gitignore +++ b/tests/.gitignore @@ -24,6 +24,7 @@ /test_ptr_fun /test_retype /test_retype_return +/test_rvalue_ref /test_signal /test_signal_move /test_size diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 36e728b1..9485b45f 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -39,6 +39,7 @@ set (TEST_SOURCE_FILES test_ptr_fun.cc test_retype.cc test_retype_return.cc + test_rvalue_ref.cc test_signal.cc test_signal_move.cc test_size.cc diff --git a/tests/Makefile.am b/tests/Makefile.am index 735d76b1..b05f7b47 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -46,6 +46,7 @@ check_PROGRAMS = \ test_ptr_fun \ test_retype \ test_retype_return \ + test_rvalue_ref \ test_signal \ test_signal_move \ test_size \ @@ -90,6 +91,7 @@ test_mem_fun_SOURCES = test_mem_fun.cc $(sigc_test_util) test_ptr_fun_SOURCES = test_ptr_fun.cc $(sigc_test_util) test_retype_SOURCES = test_retype.cc $(sigc_test_util) test_retype_return_SOURCES = test_retype_return.cc $(sigc_test_util) +test_rvalue_ref_SOURCES = test_rvalue_ref.cc $(sigc_test_util) test_signal_SOURCES = test_signal.cc $(sigc_test_util) test_signal_move_SOURCES = test_signal_move.cc $(sigc_test_util) test_size_SOURCES = test_size.cc $(sigc_test_util) diff --git a/tests/test_rvalue_ref.cc b/tests/test_rvalue_ref.cc index b35ace17..54b04f34 100644 --- a/tests/test_rvalue_ref.cc +++ b/tests/test_rvalue_ref.cc @@ -2,7 +2,9 @@ #include #include -struct MoveableStruct {}; +struct MoveableStruct +{ +}; namespace { @@ -11,10 +13,7 @@ std::ostringstream result_stream; struct foo { - void operator()(MoveableStruct &&x) - { - result_stream << "foo(MoveableStruct&&)"; - } + void operator()(MoveableStruct&& /* x */) { result_stream << "foo(MoveableStruct&&)"; } }; } // end anonymous namespace @@ -22,7 +21,7 @@ struct foo void test_signal() { - sigc::signal signal; + sigc::signal signal; foo f; signal.connect(f); MoveableStruct x; @@ -33,7 +32,7 @@ test_signal() void test_slot() { - sigc::slot slot; + sigc::slot slot; foo f; slot = f; MoveableStruct x; From 24a3a077ab4a49cb7cb57e386669fceb918e0df3 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Sun, 4 Jul 2021 17:20:00 +0200 Subject: [PATCH 005/112] docs/docs/manual/libsigc_manual.xml: Add id on elements --- docs/docs/manual/libsigc_manual.xml | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/docs/docs/manual/libsigc_manual.xml b/docs/docs/manual/libsigc_manual.xml index 9a181e3b..f78b8f71 100644 --- a/docs/docs/manual/libsigc_manual.xml +++ b/docs/docs/manual/libsigc_manual.xml @@ -16,10 +16,10 @@ - + Introduction - + Motivation There are many situations in which it is desirable to decouple code that @@ -72,10 +72,10 @@ register_click_handler(okbutton, clicked, somedata); - + Connecting your code to signals - + A simple example So to get some experience, lets look at a simple example... @@ -140,7 +140,7 @@ int main() - + Using a member function Suppose you found a more sophisticated alien alerter class on the web, @@ -189,7 +189,7 @@ int main() offers. - + Signals with parameters Functions taking no parameters and returning void are quite useful, @@ -255,7 +255,7 @@ int main() Easy. - + Disconnecting If you decide you no longer want your code to be called whenever a signal is @@ -267,10 +267,10 @@ int main() - + Writing your own signals - + Quick recap If all you want to do is use gtkmm, and connect your functionality to its signals, you can probably stop reading here. @@ -318,7 +318,7 @@ void AlienDetector::run() - + What about return values? If you only ever have one slot connected to a signal, or if you only care about the return value of the last registered one, it's quite straightforward: @@ -332,10 +332,10 @@ a_return_value = somesignal.emit(); - + Advanced topics - + Rebinding Suppose you already have a function that you want to be called when a signal is emitted, but it takes the wrong argument types. For example, lets try @@ -401,7 +401,7 @@ myaliendetector.signal_detected.connect( sigc::hide<std::string>( sigc::pt sigc::hide_return effectively makes the return type void. - + Retyping A similar topic is retyping. Perhaps you have a signal that takes an int, but you want to connect a function that takes a double. @@ -424,7 +424,7 @@ asignal.connect( sigc::retype( sigc::ptr_fun(&dostuff) ) ); - + Reference See the reference documentation online From 976271c2315f825772a96ffe0008825e955fe14f Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Sun, 4 Jul 2021 17:20:57 +0200 Subject: [PATCH 006/112] docs/docs/manual: Add some formatting when html files are generated making it slightly more similar to gtkmm-documentation and libxml++. In Autotools builds, don't distribute the empty manual/README file. --- docs/docs/doc-manual.am | 15 +++++++++++++-- tools/tutorial-custom-cmd.py | 11 ++++++++++- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/docs/docs/doc-manual.am b/docs/docs/doc-manual.am index 8650987f..a7e64a4d 100644 --- a/docs/docs/doc-manual.am +++ b/docs/docs/doc-manual.am @@ -20,11 +20,22 @@ DOCBOOK_STYLESHEET ?= http://docbook.sourceforge.net/release/xsl/current/html/ch html_tutorialdir = $(libdocdir)/tutorial/html dist_html_tutorial_DATA = $(sort manual/html/index.html $(call vpath_listall,manual/html/*.html)) -dist_noinst_DATA += manual/README manual/libsigc_manual.xml +dist_noinst_DATA += manual/libsigc_manual.xml DISTCLEANFILES += $(addprefix manual/libsigc_manual.,dvi pdf ps) MAINTAINERCLEANFILES += manual/html/* +# Set the use.id.as.filename param so that we don't use the chapter / section +# number as the filename, otherwise the url will change every time anything is +# re-ordered or inserted in the documentation +xslt_params = $(strip \ + --param toc.section.depth 1 \ + --stringparam chunker.output.indent 'yes' \ + --stringparam chunker.output.encoding 'UTF-8' \ + --stringparam toc.list.type 'ul' \ + --stringparam use.id.as.filename '1' \ + ) + manual_srcfile = $(srcdir)/manual/libsigc_manual.xml # Make sure that the documentation will always have been generated before @@ -34,7 +45,7 @@ reference/html/%: | manual/html/index.html manual/html/index.html: $(manual_srcfile) -$(AM_V_at)rm -f manual/html/* $(AM_V_at)$(MKDIR_P) manual/html - $(AM_V_GEN)xsltproc -o manual/html/ --catalogs '$(DOCBOOK_STYLESHEET)' $(manual_srcfile) + $(AM_V_GEN)xsltproc $(xslt_params) -o manual/html/ --catalogs '$(DOCBOOK_STYLESHEET)' $(manual_srcfile) manual/libsigc_manual.dvi: $(manual_srcfile) $(AM_V_GEN)db2dvi -o manual $(manual_srcfile) diff --git a/tools/tutorial-custom-cmd.py b/tools/tutorial-custom-cmd.py index a99521ae..f0a8a184 100755 --- a/tools/tutorial-custom-cmd.py +++ b/tools/tutorial-custom-cmd.py @@ -20,8 +20,17 @@ def html(): input_xml_file = sys.argv[2] output_html_dir = sys.argv[3] + # Set the use.id.as.filename param so that we don't use the chapter / section + # number as the filename, otherwise the url will change every time anything is + # re-ordered or inserted in the documentation. # For a list of available parameters, see http://docbook.sourceforge.net/release/xsl/current/doc/html/ - xslt_params = [] + xslt_params = [ + '--param', 'toc.section.depth', '1', + '--stringparam', 'chunker.output.indent', 'yes', + '--stringparam', 'chunker.output.encoding', 'UTF-8', + '--stringparam', 'toc.list.type', 'ul', + '--stringparam', 'use.id.as.filename', '1', + ] xslt_stylesheet = 'http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl' From 1c49000db5b70b10c43af25c334a7f3006ea768d Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Sun, 4 Jul 2021 17:21:22 +0200 Subject: [PATCH 007/112] docs: Remove some obsolete files Remove docs/docs/manual/README, docs/docs/reference/README and docs/Makefile. --- docs/Makefile | 7 ------- docs/docs/manual/README | 0 docs/docs/reference/README | 6 ------ 3 files changed, 13 deletions(-) delete mode 100644 docs/Makefile delete mode 100644 docs/docs/manual/README delete mode 100644 docs/docs/reference/README diff --git a/docs/Makefile b/docs/Makefile deleted file mode 100644 index 0841efa7..00000000 --- a/docs/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -web_path = /home/groups/l/li/libsigc/htdocs/ - -post-html: - rsync -avz --rsh ssh --cvs-exclude * $$USER,libsigc@web.sourceforge.net:$(web_path) - -#post-html: -# scp $$SSH_OPT -r *.shtml *.css fragments images $$USER@shell.sourceforge.net:$(web_path) diff --git a/docs/docs/manual/README b/docs/docs/manual/README deleted file mode 100644 index e69de29b..00000000 diff --git a/docs/docs/reference/README b/docs/docs/reference/README deleted file mode 100644 index ce164350..00000000 --- a/docs/docs/reference/README +++ /dev/null @@ -1,6 +0,0 @@ -You need to have doxygen installed. - -make targets: - -all: builds the reference documentation -post-html: uploads it to the sourceforge site. \ No newline at end of file From 58bd5a17206d54e5bcdf55a5b857391ef27725d4 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Tue, 17 Aug 2021 15:49:28 +0200 Subject: [PATCH 008/112] meson.build: Check if Perl is required for building documentation New versions of mm-common use the Python scripts doc_postprocess.py and doc_install.py instead of the Perl scripts doc-postprocess.pl and doc-install.pl when documentation is built. --- meson.build | 12 +++++++++++- untracked/README | 4 ++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/meson.build b/meson.build index 27d422a7..281e9018 100644 --- a/meson.build +++ b/meson.build @@ -120,7 +120,6 @@ if maintainer_mode and not mm_common_get.found() mm_common_get = find_program('mm-common-get', required: true) endif -perl = find_program('perl', required: build_documentation) doxygen = find_program('doxygen', required: build_documentation) dot = find_program('dot', required: build_documentation) # Used by Doxygen xsltproc = find_program('xsltproc', required: build_documentation) @@ -148,6 +147,17 @@ sys.exit(os.path.isfile("@0@")) endif endif +# Check if perl is required and available. +# Done now, when the doc_reference script is available. +doc_perl_prop = run_command( + python3, doc_reference, 'get_script_property', + '', # MMDOCTOOLDIR is not used + 'requires_perl') +if not (doc_perl_prop.returncode() == 0 and doc_perl_prop.stdout() == 'false') + # Perl is required, if documentation shall be built. + perl = find_program('perl', required: build_documentation) +endif + # Set compiler warnings. warning_flags = [] if warning_level == 'min' diff --git a/untracked/README b/untracked/README index 31a12d42..dfefb62b 100644 --- a/untracked/README +++ b/untracked/README @@ -15,8 +15,8 @@ or the tarball is created with Meson. 1. Files copied by mm-common-get -------------------------------- -untracked/docs/docs/doc-install.pl - doc-postprocess.pl +untracked/docs/docs/doc_install.py or doc-install.pl + doc_postprocess.py or doc-postprocess.pl doxygen-extra.css tagfile-to-devhelp2.xsl untracked/build_scripts/dist-build-scripts.py From 722a82bc18cb48ad82c68a406649459a948fb5d1 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Sun, 22 Aug 2021 19:03:43 +0200 Subject: [PATCH 009/112] Require meson >= 0.54.0 --- .github/workflows/meson-clang-10.yml | 9 +++++---- .github/workflows/meson-gcc-9.yml | 9 +++++---- docs/docs/reference/meson.build | 14 +++----------- meson.build | 8 ++------ 4 files changed, 15 insertions(+), 25 deletions(-) diff --git a/.github/workflows/meson-clang-10.yml b/.github/workflows/meson-clang-10.yml index af19f313..31274d5e 100644 --- a/.github/workflows/meson-clang-10.yml +++ b/.github/workflows/meson-clang-10.yml @@ -14,13 +14,14 @@ jobs: # Prevent blocking apt install on a question during configuring of tzdata. export ENV DEBIAN_FRONTEND=noninteractive sudo apt update - sudo apt install mm-common clang-10 meson ninja-build python3-setuptools --yes + sudo apt install mm-common clang-10 ninja-build python3-setuptools python3-pip --yes + # Ubuntu 20.04 contains meson 0.53.2, but libsigc++ requires meson >= 0.54.0. + # Install it with pip3 instead of apt. + sudo pip3 install "meson>=0.54.0" export CXX=clang++-10 meson -Dwarnings=fatal _build cd _build - # Meson from 0.54.0 understands "meson compile". - # Ubuntu 20.04 uses meson 0.53.2. - ninja + meson compile - name: Test run: | cd _build diff --git a/.github/workflows/meson-gcc-9.yml b/.github/workflows/meson-gcc-9.yml index f472d97e..29518a9b 100644 --- a/.github/workflows/meson-gcc-9.yml +++ b/.github/workflows/meson-gcc-9.yml @@ -14,13 +14,14 @@ jobs: # Prevent blocking apt install on a question during configuring of tzdata. export ENV DEBIAN_FRONTEND=noninteractive sudo apt update - sudo apt install mm-common g++-9 meson ninja-build python3-setuptools --yes + sudo apt install mm-common g++-9 ninja-build python3-setuptools python3-pip --yes + # Ubuntu 20.04 contains meson 0.53.2, but libsigc++ requires meson >= 0.54.0. + # Install it with pip3 instead of apt. + sudo pip3 install "meson>=0.54.0" export CXX=g++-9 meson -Dwarnings=fatal _build cd _build - # Meson from 0.54.0 understands "meson compile". - # Ubuntu 20.04 uses meson 0.53.2. - ninja + meson compile - name: Test run: | cd _build diff --git a/docs/docs/reference/meson.build b/docs/docs/reference/meson.build index 33aac275..397e975f 100644 --- a/docs/docs/reference/meson.build +++ b/docs/docs/reference/meson.build @@ -18,17 +18,7 @@ docinstall_flags = [] foreach module : tag_file_modules depmod = dependency(module, required: false) if depmod.found() - if meson.version().version_compare('>=0.54.0') - doxytagfile = depmod.get_variable(pkgconfig: 'doxytagfile', internal: 'doxytagfile', default_value: '') - htmlrefpub = depmod.get_variable(pkgconfig: 'htmlrefpub', internal: 'htmlrefpub', default_value: '') - htmlrefdir = depmod.get_variable(pkgconfig: 'htmlrefdir', internal: 'htmlrefdir', default_value: '') - else - # TODO: Remove the possibility to build with meson.version() < 0.54.0 - # when >= 0.54.0 is available in GitHub's CI (continuous integration). - doxytagfile = depmod.get_variable(pkgconfig: 'doxytagfile', default_value: '') - htmlrefpub = depmod.get_variable(pkgconfig: 'htmlrefpub', default_value: '') - htmlrefdir = depmod.get_variable(pkgconfig: 'htmlrefdir', default_value: '') - endif + doxytagfile = depmod.get_variable(pkgconfig: 'doxytagfile', internal: 'doxytagfile', default_value: '') if doxytagfile != '' if depmod.type_name() == 'internal' # Subprojects must build their tag files before doxygen is called. @@ -38,6 +28,8 @@ foreach module : tag_file_modules doxygen_tag_targets += subproject(module).get_variable('global_tag_file_target') endif endif + htmlrefpub = depmod.get_variable(pkgconfig: 'htmlrefpub', internal: 'htmlrefpub', default_value: '') + htmlrefdir = depmod.get_variable(pkgconfig: 'htmlrefdir', internal: 'htmlrefdir', default_value: '') if htmlrefpub == '' htmlrefpub = htmlrefdir elif htmlrefdir == '' diff --git a/meson.build b/meson.build index 281e9018..343ccd29 100644 --- a/meson.build +++ b/meson.build @@ -7,12 +7,9 @@ project('libsigc++', 'cpp', 'cpp_std=c++17', 'warning_level=0', ], - meson_version: '>= 0.51.0', # required for dep.get_variable() + meson_version: '>= 0.54.0', # required for meson.override_dependency() + # and dep.get_variable(internal:) ) -#TODO: Require meson_version: '>= 0.54.0' when it's available -# in GitHub's CI (continuous integration). -# meson_version() >= 0.54.0 is necessary if sigc++ is a subproject, -# or if mm-common is a subproject of sigc++. sigcxx_api_version = '3.0' sigcxx_pcname = 'sigc++-' + sigcxx_api_version @@ -148,7 +145,6 @@ sys.exit(os.path.isfile("@0@")) endif # Check if perl is required and available. -# Done now, when the doc_reference script is available. doc_perl_prop = run_command( python3, doc_reference, 'get_script_property', '', # MMDOCTOOLDIR is not used From 89a5513e1169730ae13d826026b5ce8e86b917f8 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Sun, 19 Sep 2021 15:54:27 +0200 Subject: [PATCH 010/112] docs/docs/manual: Upgrade from DocBook 4.1 to DocBook 5.0 --- docs/docs/manual/libsigc_manual.xml | 114 +++++++++++++++------------- docs/docs/manual/meson.build | 13 ++-- meson.build | 4 +- tools/tutorial-custom-cmd.py | 63 +++++++++------ 4 files changed, 106 insertions(+), 88 deletions(-) diff --git a/docs/docs/manual/libsigc_manual.xml b/docs/docs/manual/libsigc_manual.xml index f78b8f71..2fed5ae6 100644 --- a/docs/docs/manual/libsigc_manual.xml +++ b/docs/docs/manual/libsigc_manual.xml @@ -1,26 +1,26 @@ - - - - - - libsigc++ - - Ainsley - Pereira - - + + + + + libsigc++ + + Ainsley + Pereira + + September 2002 September 2002. Updated January 2004 and March 2016 by Murray Cumming + + libsigc++ is a C++ template library implementing typesafe callbacks. This is an intro to libsigc++. + + - - libsigc++ is a C++ template library implementing typesafe callbacks. This is an intro to libsigc++. - - - - -Introduction + +Introduction - -Motivation +
+Motivation There are many situations in which it is desirable to decouple code that detects an event, and the code that deals with it. This is especially common in @@ -69,14 +69,15 @@ register_click_handler(okbutton, clicked, somedata); For the other side of the fence, libsigc++ provides signals, to which the client can attach slots. When the signal is emitted, all the connected slots are called. - +
- -Connecting your code to signals + +Connecting your code to signals + +
+A simple example - -A simple example So to get some experience, lets look at a simple example... Lets say you and I are writing an application which informs the user when @@ -138,10 +139,10 @@ int main() ./example1 (Try not to panic when the aliens land!) - +
- -Using a member function +
+Using a member function Suppose you found a more sophisticated alien alerter class on the web, such as this: @@ -187,10 +188,10 @@ int main() With a lambda expression you would lose the automatic disconnection that the combination of sigc::trackable and sigc::mem_fun() offers. - +
- -Signals with parameters +
+Signals with parameters Functions taking no parameters and returning void are quite useful, especially when they're members of classes that can store unlimited amounts of @@ -253,10 +254,10 @@ int main() Easy. - +
- -Disconnecting +
+Disconnecting If you decide you no longer want your code to be called whenever a signal is emitted, you must remember the return value of connect(), which we've been @@ -264,14 +265,15 @@ int main() connect() returns a sigc::connection object, which has a disconnect() member method. This does just what you think it does. - +
- -Writing your own signals + +Writing your own signals + +
+Quick recap - -Quick recap If all you want to do is use gtkmm, and connect your functionality to its signals, you can probably stop reading here. @@ -316,10 +318,11 @@ void AlienDetector::run() // they landed in the carpark after all. } - +
+ +
+What about return values? - -What about return values? If you only ever have one slot connected to a signal, or if you only care about the return value of the last registered one, it's quite straightforward: @@ -329,14 +332,15 @@ int a_return_value; a_return_value = somesignal.emit(); - +
- -Advanced topics + +Advanced topics + +
+Rebinding - -Rebinding Suppose you already have a function that you want to be called when a signal is emitted, but it takes the wrong argument types. For example, lets try to attach the warn_people(std::string) function to the detected signal @@ -399,10 +403,11 @@ myaliendetector.signal_detected.connect( sigc::hide<std::string>( sigc::pt hide the first argument of 3, for example, only the last). sigc::hide_return effectively makes the return type void. - +
+ +
+Retyping - -Retyping A similar topic is retyping. Perhaps you have a signal that takes an int, but you want to connect a function that takes a double. @@ -421,11 +426,12 @@ asignal.connect( sigc::retype( sigc::ptr_fun(&dostuff) ) ); If you only want to change the return type, you can use sigc::retype_return(). retype_return() needs one template argument, the new return type. - +
- -Reference - See the reference documentation online + +Reference + + See the reference documentation online
diff --git a/docs/docs/manual/meson.build b/docs/docs/manual/meson.build index 59e67e4b..e3e95318 100644 --- a/docs/docs/manual/meson.build +++ b/docs/docs/manual/meson.build @@ -1,21 +1,18 @@ # docs/docs/manual # input: install_datadir, sigcxx_pcname, tutorial_custom_cmd, python3, -# build_documentation, book_name, can_add_dist_script +# build_documentation, book_name, can_add_dist_script, xsltproc # output: can_parse_and_validate, build_pdf_by_default, can_build_pdf, # install_tutorialdir -# xsltproc is required by tutorial_custom_cmd html. -xsltproc = find_program('xsltproc', required: build_documentation) xmllint = find_program('xmllint', required: false) - can_parse_and_validate = xmllint.found() validate = get_option('validation') ? 'true' : 'false' dblatex = find_program('dblatex', required: false) -can_build_pdf = dblatex.found() or (xmllint.found() and \ - find_program('docbook2pdf', required: false).found()) +can_build_pdf = dblatex.found() or (xsltproc.found() and \ + find_program('fop', required: false).found()) build_pdf_by_default = get_option('build-pdf') # Installation directories are relative to {prefix}. @@ -63,13 +60,13 @@ endif if can_build_pdf # Create a PDF file of the DocBook. - # Prefer dblatex, if both dblatex and docbook2pdf are available. + # Prefer dblatex, if both dblatex and fop are available. custom_target('manual_pdf', input: sigc_manual_xml, output: sigc_manual_pdf, command: [ python3, tutorial_custom_cmd, - dblatex.found() ? 'dblatex' : 'docbook2pdf', + dblatex.found() ? 'dblatex' : 'fop', '@INPUT@', '@OUTPUT@' ], diff --git a/meson.build b/meson.build index 343ccd29..cf93d487 100644 --- a/meson.build +++ b/meson.build @@ -294,11 +294,9 @@ endif build_pdf = build_pdf_by_default and can_build_pdf explain_pdf = '' if build_pdf_by_default and not build_pdf - explain_pdf = ' (requires dblatex or (xmllint and docbook2pdf))' + explain_pdf = ' (requires dblatex or (xsltproc and fop))' endif - - summary = [ '', '------', diff --git a/tools/tutorial-custom-cmd.py b/tools/tutorial-custom-cmd.py index f0a8a184..50b6a5b9 100755 --- a/tools/tutorial-custom-cmd.py +++ b/tools/tutorial-custom-cmd.py @@ -8,7 +8,6 @@ import os import sys import subprocess -from pathlib import Path import shutil subcommand = sys.argv[1] @@ -29,7 +28,7 @@ def html(): '--stringparam', 'chunker.output.indent', 'yes', '--stringparam', 'chunker.output.encoding', 'UTF-8', '--stringparam', 'toc.list.type', 'ul', - '--stringparam', 'use.id.as.filename', '1', + '--param', 'use.id.as.filename', '1', ] xslt_stylesheet = 'http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl' @@ -56,6 +55,8 @@ def html(): return result.returncode def xmllint(): + from pathlib import Path + # argv[2] argv[3] argv[4] # @@ -63,6 +64,8 @@ def xmllint(): input_xml_file = sys.argv[3] stamp_file_path = sys.argv[4] + relax_ng_schema = 'http://docbook.org/xml/5.0/rng/docbook.rng' + cmd = [ 'xmllint', '--noout', @@ -70,7 +73,7 @@ def xmllint(): '--xinclude', ] if validate == 'true': - cmd += ['--postvalid'] + cmd += ['--relaxng', relax_ng_schema] cmd += [input_xml_file] result = subprocess.run(cmd) if result.returncode: @@ -79,6 +82,9 @@ def xmllint(): Path(stamp_file_path).touch(exist_ok=True) return 0 +# dblatex and xsltproc+fop generate a PDF file. +# docbook2pdf can generate PDF files from DocBook4 files, but not from DocBook5 files. +# xsltproc+xmlroff (version 0.6.3) does not seem to work acceptably. def dblatex(): # argv[2] argv[3] # @@ -89,40 +95,51 @@ def dblatex(): # For a list of available parameters, see http://dblatex.sourceforge.net/doc/manual/ dblatex_params = [ - '-P', 'toc.section.depth=2', + '-P', 'toc.section.depth=1', '-P', 'paper.type=a4paper', + '-P', 'doc.collab.show=1', + '-P', 'latex.output.revhistory=0', ] cmd = [ 'dblatex', ] + dblatex_params + [ '-o', output_pdf_file, - '--pdf', input_xml_file, + '--pdf', + input_xml_file, ] return subprocess.run(cmd).returncode -def docbook2pdf(): +def fop(): # argv[2] argv[3] # - # Create a PDF file, using docbook2pdf. + # Create a PDF file, using fop. input_xml_file = sys.argv[2] output_pdf_file = sys.argv[3] - output_dir = os.path.dirname(output_pdf_file) - if not output_dir: - output_dir = '.' - output_basename = os.path.basename(output_pdf_file) - if output_basename.endswith('.pdf'): - output_basename = output_basename[:-4] - xml_file = os.path.join(output_dir, output_basename + '.xml') + fo_file = os.path.splitext(output_pdf_file)[0] + '.fo' + + # For a list of available parameters, see http://docbook.sourceforge.net/release/xsl/current/doc/fo/ + # For a list of available paper types, see the description of the page.width.portrait parameter. + xslt_params = [ + '--param', 'toc.section.depth', '1', + '--stringparam', 'fop1.extensions', '1', + '--stringparam', 'page.orientation', 'portrait', + '--stringparam', 'paper.type', 'A4', + ] + + xslt_stylesheet = 'http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xsl' - # We need to produce an XML file with all of the XIncludes done. + # Generate a .fo (formatting object) file. + # fop can take an xslt stylesheet parameter, but it can only read local files. + # xsltproc is necessary if you want to read the stylesheet from the internet. cmd = [ - 'xmllint', + 'xsltproc', + ] + xslt_params + [ + '-o', fo_file, '--xinclude', - '--postvalid', - '--output', xml_file, + xslt_stylesheet, input_xml_file, ] result = subprocess.run(cmd) @@ -130,9 +147,9 @@ def docbook2pdf(): return result.returncode cmd = [ - 'docbook2pdf', - '--output', output_dir, - xml_file, + 'fop', + '-fo', fo_file, + '-pdf', output_pdf_file, ] return subprocess.run(cmd).returncode @@ -177,8 +194,8 @@ def dist_doc(): sys.exit(xmllint()) if subcommand == 'dblatex': sys.exit(dblatex()) -if subcommand == 'docbook2pdf': - sys.exit(docbook2pdf()) +if subcommand == 'fop': + sys.exit(fop()) if subcommand == 'dist_doc': sys.exit(dist_doc()) print(sys.argv[0], ': illegal subcommand,', subcommand) From f993cc89285662dc9d59b4aa1aa66929fca9f7fa Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Fri, 24 Sep 2021 18:50:34 +0200 Subject: [PATCH 011/112] CI, Meson build: Install packages for validating XML file libxml2-utils and docbook5-xml are necessary in order to validate the XML file in docs/docs/manual/. --- .github/workflows/meson-clang-10.yml | 2 +- .github/workflows/meson-gcc-9.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/meson-clang-10.yml b/.github/workflows/meson-clang-10.yml index 31274d5e..00935798 100644 --- a/.github/workflows/meson-clang-10.yml +++ b/.github/workflows/meson-clang-10.yml @@ -14,7 +14,7 @@ jobs: # Prevent blocking apt install on a question during configuring of tzdata. export ENV DEBIAN_FRONTEND=noninteractive sudo apt update - sudo apt install mm-common clang-10 ninja-build python3-setuptools python3-pip --yes + sudo apt install libxml2-utils docbook5-xml mm-common clang-10 ninja-build python3-setuptools python3-pip --yes # Ubuntu 20.04 contains meson 0.53.2, but libsigc++ requires meson >= 0.54.0. # Install it with pip3 instead of apt. sudo pip3 install "meson>=0.54.0" diff --git a/.github/workflows/meson-gcc-9.yml b/.github/workflows/meson-gcc-9.yml index 29518a9b..51f9b4c3 100644 --- a/.github/workflows/meson-gcc-9.yml +++ b/.github/workflows/meson-gcc-9.yml @@ -14,7 +14,7 @@ jobs: # Prevent blocking apt install on a question during configuring of tzdata. export ENV DEBIAN_FRONTEND=noninteractive sudo apt update - sudo apt install mm-common g++-9 ninja-build python3-setuptools python3-pip --yes + sudo apt install libxml2-utils docbook5-xml mm-common g++-9 ninja-build python3-setuptools python3-pip --yes # Ubuntu 20.04 contains meson 0.53.2, but libsigc++ requires meson >= 0.54.0. # Install it with pip3 instead of apt. sudo pip3 install "meson>=0.54.0" From 298163aa2328c561e9cfb35768f6a18b5b74b929 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Mon, 27 Sep 2021 09:36:00 +0200 Subject: [PATCH 012/112] docs/docs/manual, Meson config: Check if xmllint can be used --- Makefile.am | 1 + docs/docs/manual/can_use_xmllint.xml | 15 +++++++++++++++ docs/docs/manual/meson.build | 18 ++++++++++++++++++ meson.build | 2 +- tools/tutorial-custom-cmd.py | 12 +++++++++++- 5 files changed, 46 insertions(+), 2 deletions(-) create mode 100644 docs/docs/manual/can_use_xmllint.xml diff --git a/Makefile.am b/Makefile.am index e10fd1bd..53620339 100644 --- a/Makefile.am +++ b/Makefile.am @@ -50,6 +50,7 @@ EXTRA_DIST = \ meson_options.txt \ sigc++config.h.meson \ MSVC_NMake/meson.build \ + docs/docs/manual/can_use_xmllint.xml \ docs/docs/manual/meson.build \ docs/docs/reference/meson.build \ examples/meson.build \ diff --git a/docs/docs/manual/can_use_xmllint.xml b/docs/docs/manual/can_use_xmllint.xml new file mode 100644 index 00000000..8ff1b0d4 --- /dev/null +++ b/docs/docs/manual/can_use_xmllint.xml @@ -0,0 +1,15 @@ + + + +xmllint test + + +Introduction + + This is a short DocBook V5.0 document. It can be used for testing if the installed + version of xmllint or a similar program can validate a DocBook V5.0 document. + + + + diff --git a/docs/docs/manual/meson.build b/docs/docs/manual/meson.build index e3e95318..e6321314 100644 --- a/docs/docs/manual/meson.build +++ b/docs/docs/manual/meson.build @@ -24,6 +24,24 @@ if not build_documentation subdir_done() endif +# Check if xmllint can be used. +if xmllint.found() + can_parse_and_validate = run_command( + python3, tutorial_custom_cmd, 'xmllint', + validate, + meson.current_source_dir() / 'can_use_xmllint.xml', + meson.current_build_dir() / 'can_use_xmllint.stamp', + ).returncode() == 0 + if not can_parse_and_validate + # The DocBook V5.0 package is called docbook5-xml in Ubuntu, + # docbook5-schemas in Fedora. It may have other names in other distros. + warning('Can\'t validate XML file.\n' + + 'xmllint does not support Relax NG schemas and DocBook V5.0.\n' + + 'DocBook V5.0 support may require docbook5-xml, docbook5-schemas or a similar package.' + ) + endif +endif + doc_dist_dir = 'untracked' / 'docs' / 'docs' / 'manual' # Relative to MESON_DIST_ROOT sigc_manual_xml = 'libsigc_manual.xml' diff --git a/meson.build b/meson.build index cf93d487..2e309331 100644 --- a/meson.build +++ b/meson.build @@ -288,7 +288,7 @@ endif validate = get_option('validation') and can_parse_and_validate explain_val = '' if get_option('validation') and not validate - explain_val = ' (requires xmllint)' + explain_val = ' (requires xmllint with Relax NG and DocBook V5.0 support)' endif build_pdf = build_pdf_by_default and can_build_pdf diff --git a/tools/tutorial-custom-cmd.py b/tools/tutorial-custom-cmd.py index 50b6a5b9..c1029680 100755 --- a/tools/tutorial-custom-cmd.py +++ b/tools/tutorial-custom-cmd.py @@ -65,6 +65,13 @@ def xmllint(): stamp_file_path = sys.argv[4] relax_ng_schema = 'http://docbook.org/xml/5.0/rng/docbook.rng' + # schematron_schema = 'http://docbook.org/xml/5.0/sch/docbook.sch' + + # Validation against the Schematron schema does not work on Ubuntu 21.04: + # file:///usr/share/xml/docbook/schema/schematron/5.0/docbook.sch:6: element rule: + # Schemas parser error : Failed to compile context expression db:firstterm[@linkend] + # ..... + # Schematron schema http://docbook.org/xml/5.0/sch/docbook.sch failed to compile cmd = [ 'xmllint', @@ -73,7 +80,10 @@ def xmllint(): '--xinclude', ] if validate == 'true': - cmd += ['--relaxng', relax_ng_schema] + cmd += [ + '--relaxng', relax_ng_schema, + #'--schematron', schematron_schema, + ] cmd += [input_xml_file] result = subprocess.run(cmd) if result.returncode: From 4e5dac4ce38935fc3438b0cd066c6417e5905f6c Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Tue, 9 Nov 2021 14:02:14 +0800 Subject: [PATCH 013/112] NMake Makefiles: Support building with VS2022 Make the VS2019 builds distinct from VS2022 builds. --- MSVC_NMake/detectenv-msvc.mak | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/MSVC_NMake/detectenv-msvc.mak b/MSVC_NMake/detectenv-msvc.mak index d05ee5f3..6f7e56f3 100644 --- a/MSVC_NMake/detectenv-msvc.mak +++ b/MSVC_NMake/detectenv-msvc.mak @@ -98,9 +98,12 @@ PDBVER = 14 !if $(VCVERSION) > 1909 && $(VCVERSION) < 1920 VSVER_SUFFIX = 1 VSVER = 15 -!elseif $(VCVERSION) > 1919 && $(VCVERSION) < 2000 +!elseif $(VCVERSION) > 1919 && $(VCVERSION) < 1930 VSVER_SUFFIX = 2 VSVER = 16 +!elseif $(VCVERSION) > 1929 && $(VCVERSION) < 2000 +VSVER_SUFFIX = 3 +VSVER = 17 !else VSVER = $(PDBVER) !endif From af16bf0d15782345ce41323706a3dcc6c06ce253 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Sun, 19 Dec 2021 10:17:50 +0100 Subject: [PATCH 014/112] CMakeLists.txt: Update sigc++ version to 3.0.7 Should have been done when configure.ac and meson.build were updated. --- CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2e7f383a..1863d8ee 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,9 +16,9 @@ cmake_minimum_required (VERSION 3.2) -set (SIGCXX_MAJOR_VERSION 2) -set (SIGCXX_MINOR_VERSION 99) -set (SIGCXX_MICRO_VERSION 1) +set (SIGCXX_MAJOR_VERSION 3) +set (SIGCXX_MINOR_VERSION 0) +set (SIGCXX_MICRO_VERSION 7) set (SIGCXX_API_VERSION 3.0) set (PACKAGE_VERSION ${SIGCXX_MAJOR_VERSION}.${SIGCXX_MINOR_VERSION}.${SIGCXX_MICRO_VERSION}) From a4883790100b0da6f777ec154a525389f776a3c7 Mon Sep 17 00:00:00 2001 From: Slava Andrejev Date: Sun, 19 Dec 2021 22:25:46 -0800 Subject: [PATCH 015/112] Add missing perfect forwarding in bound_mem_functor::operator() This is a missed addition to the commit that allowed rvalue references in slot parameters. --- sigc++/functors/mem_fun.h | 4 +++- tests/test_rvalue_ref.cc | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/sigc++/functors/mem_fun.h b/sigc++/functors/mem_fun.h index 65563a30..e3327fb2 100644 --- a/sigc++/functors/mem_fun.h +++ b/sigc++/functors/mem_fun.h @@ -149,7 +149,9 @@ class bound_mem_functor : mem_functor */ decltype(auto) operator()(type_trait_take_t... a) const { - return std::invoke(this->func_ptr_, obj_.invoke(), a...); + return std::invoke( + this->func_ptr_, obj_.invoke(), + std::forward>(a)...); } // protected: diff --git a/tests/test_rvalue_ref.cc b/tests/test_rvalue_ref.cc index 54b04f34..ec81d39e 100644 --- a/tests/test_rvalue_ref.cc +++ b/tests/test_rvalue_ref.cc @@ -16,6 +16,12 @@ struct foo void operator()(MoveableStruct&& /* x */) { result_stream << "foo(MoveableStruct&&)"; } }; +struct A +{ + void foo(MoveableStruct &&) { result_stream << "A::foo(MoveableStruct&&)"; } +}; + + } // end anonymous namespace void @@ -40,6 +46,17 @@ test_slot() util->check_result(result_stream, "foo(MoveableStruct&&)"); } +void +test_mem_fun() +{ + sigc::slot slot; + A a; + slot = sigc::mem_fun(a, &A::foo); + MoveableStruct x; + slot(std::move(x)); + util->check_result(result_stream, "A::foo(MoveableStruct&&)"); +} + int main(int argc, char* argv[]) { @@ -49,6 +66,7 @@ main(int argc, char* argv[]) test_signal(); test_slot(); + test_mem_fun(); return util->get_result_and_delete_instance() ? EXIT_SUCCESS : EXIT_FAILURE; } // end main() From cc857baa5aac41f5731e92d2da276826481a4631 Mon Sep 17 00:00:00 2001 From: Slava Andrejev Date: Wed, 22 Dec 2021 21:19:45 -0800 Subject: [PATCH 016/112] Add missing perfect forwarding in mem_functor and pointer_functor This is a missed addition to the commit that allowed rvalue references in slot parameters. --- sigc++/functors/mem_fun.h | 2 +- sigc++/functors/ptr_fun.h | 4 +++- tests/test_rvalue_ref.cc | 26 ++++++++++++++++++++++++++ 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/sigc++/functors/mem_fun.h b/sigc++/functors/mem_fun.h index e3327fb2..1b74c3d4 100644 --- a/sigc++/functors/mem_fun.h +++ b/sigc++/functors/mem_fun.h @@ -113,7 +113,7 @@ class mem_functor */ decltype(auto) operator()(obj_type_with_modifier& obj, type_trait_take_t... a) const { - return std::invoke(func_ptr_, obj, a...); + return std::invoke(func_ptr_, obj, std::forward>(a)...); } protected: diff --git a/sigc++/functors/ptr_fun.h b/sigc++/functors/ptr_fun.h index 288ac871..c1dc8b75 100644 --- a/sigc++/functors/ptr_fun.h +++ b/sigc++/functors/ptr_fun.h @@ -92,7 +92,9 @@ class pointer_functor * @param a Arguments to be passed on to the function. * @return The return value of the function invocation. */ - T_return operator()(type_trait_take_t... a) const { return std::invoke(func_ptr_, a...); } + T_return operator()(type_trait_take_t... a) const { + return std::invoke(func_ptr_, std::forward>(a)...); + } }; /** Creates a functor of type sigc::pointer_functor which wraps an existing non-member function. diff --git a/tests/test_rvalue_ref.cc b/tests/test_rvalue_ref.cc index ec81d39e..4e1666b4 100644 --- a/tests/test_rvalue_ref.cc +++ b/tests/test_rvalue_ref.cc @@ -21,6 +21,9 @@ struct A void foo(MoveableStruct &&) { result_stream << "A::foo(MoveableStruct&&)"; } }; +void boo(MoveableStruct &&) { + result_stream << "boo(MoveableStruct&&)"; +} } // end anonymous namespace @@ -48,6 +51,17 @@ test_slot() void test_mem_fun() +{ + sigc::slot slot; + A a; + slot = sigc::mem_fun(&A::foo); + MoveableStruct x; + slot(a, std::move(x)); + util->check_result(result_stream, "A::foo(MoveableStruct&&)"); +} + +void +test_bound_mem_fun() { sigc::slot slot; A a; @@ -57,6 +71,16 @@ test_mem_fun() util->check_result(result_stream, "A::foo(MoveableStruct&&)"); } +void +test_ptr_fun() +{ + sigc::slot slot; + slot = sigc::ptr_fun(&boo); + MoveableStruct x; + slot(std::move(x)); + util->check_result(result_stream, "boo(MoveableStruct&&)"); +} + int main(int argc, char* argv[]) { @@ -66,7 +90,9 @@ main(int argc, char* argv[]) test_signal(); test_slot(); + test_bound_mem_fun(); test_mem_fun(); + test_ptr_fun(); return util->get_result_and_delete_instance() ? EXIT_SUCCESS : EXIT_FAILURE; } // end main() From 783ad8239c03fbb44b3ed2c28282a43f849adafa Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Thu, 23 Dec 2021 12:51:38 +0100 Subject: [PATCH 017/112] Format source code to suit clang-format * sigc++/functors/mem_fun.h: * sigc++/functors/ptr_fun.h: * tests/test_rvalue_ref.cc: Reformated with clang-format 13, but CI uses clang-format 10. Also add #include where std::forward was added. Doesn't seem to be necessary with g++ or clang++. Mostly a precaution. --- sigc++/functors/mem_fun.h | 10 ++++++---- sigc++/functors/ptr_fun.h | 7 +++++-- tests/test_rvalue_ref.cc | 8 +++++--- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/sigc++/functors/mem_fun.h b/sigc++/functors/mem_fun.h index 1b74c3d4..1ebccbb9 100644 --- a/sigc++/functors/mem_fun.h +++ b/sigc++/functors/mem_fun.h @@ -22,6 +22,7 @@ #include #include #include +#include // implementation notes: // - we do not use bind here, because it would introduce @@ -150,8 +151,7 @@ class bound_mem_functor : mem_functor decltype(auto) operator()(type_trait_take_t... a) const { return std::invoke( - this->func_ptr_, obj_.invoke(), - std::forward>(a)...); + this->func_ptr_, obj_.invoke(), std::forward>(a)...); } // protected: @@ -187,7 +187,8 @@ struct visitor> * @ingroup mem_fun */ template -inline decltype(auto) mem_fun(T_return (T_obj::*func)(T_arg...)) +inline decltype(auto) +mem_fun(T_return (T_obj::*func)(T_arg...)) { return mem_functor(func); } @@ -212,7 +213,8 @@ mem_fun(T_return (T_obj::*func)(T_arg...) const) * @ingroup mem_fun */ template -inline decltype(auto) mem_fun(T_return (T_obj::*func)(T_arg...) volatile) +inline decltype(auto) +mem_fun(T_return (T_obj::*func)(T_arg...) volatile) { return mem_functor(func); } diff --git a/sigc++/functors/ptr_fun.h b/sigc++/functors/ptr_fun.h index c1dc8b75..b80ccab8 100644 --- a/sigc++/functors/ptr_fun.h +++ b/sigc++/functors/ptr_fun.h @@ -20,6 +20,7 @@ #define SIGC_FUNCTORS_PTR_FUN_H #include #include +#include namespace sigc { @@ -92,7 +93,8 @@ class pointer_functor * @param a Arguments to be passed on to the function. * @return The return value of the function invocation. */ - T_return operator()(type_trait_take_t... a) const { + T_return operator()(type_trait_take_t... a) const + { return std::invoke(func_ptr_, std::forward>(a)...); } }; @@ -104,7 +106,8 @@ class pointer_functor * @ingroup ptr_fun */ template -inline decltype(auto) ptr_fun(T_return (*func)(T_args...)) +inline decltype(auto) +ptr_fun(T_return (*func)(T_args...)) { return pointer_functor(func); } diff --git a/tests/test_rvalue_ref.cc b/tests/test_rvalue_ref.cc index 4e1666b4..344a8563 100644 --- a/tests/test_rvalue_ref.cc +++ b/tests/test_rvalue_ref.cc @@ -18,10 +18,12 @@ struct foo struct A { - void foo(MoveableStruct &&) { result_stream << "A::foo(MoveableStruct&&)"; } + void foo(MoveableStruct&&) { result_stream << "A::foo(MoveableStruct&&)"; } }; -void boo(MoveableStruct &&) { +void +boo(MoveableStruct&&) +{ result_stream << "boo(MoveableStruct&&)"; } @@ -52,7 +54,7 @@ test_slot() void test_mem_fun() { - sigc::slot slot; + sigc::slot slot; A a; slot = sigc::mem_fun(&A::foo); MoveableStruct x; From a6d0d6fac285c755a8e66061028b80de7c369ab0 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Thu, 23 Dec 2021 13:14:16 +0100 Subject: [PATCH 018/112] Second attempt to suit clang-format 10 Irritating that different versions of clang-format don't agree on what's an acceptable format, and that clang-format 10 is not easily installable on Ubuntu 21.10. --- sigc++/functors/mem_fun.h | 6 ++---- sigc++/functors/ptr_fun.h | 3 +-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/sigc++/functors/mem_fun.h b/sigc++/functors/mem_fun.h index 1ebccbb9..07aee0bc 100644 --- a/sigc++/functors/mem_fun.h +++ b/sigc++/functors/mem_fun.h @@ -187,8 +187,7 @@ struct visitor> * @ingroup mem_fun */ template -inline decltype(auto) -mem_fun(T_return (T_obj::*func)(T_arg...)) +inline decltype(auto) mem_fun(T_return (T_obj::*func)(T_arg...)) { return mem_functor(func); } @@ -213,8 +212,7 @@ mem_fun(T_return (T_obj::*func)(T_arg...) const) * @ingroup mem_fun */ template -inline decltype(auto) -mem_fun(T_return (T_obj::*func)(T_arg...) volatile) +inline decltype(auto) mem_fun(T_return (T_obj::*func)(T_arg...) volatile) { return mem_functor(func); } diff --git a/sigc++/functors/ptr_fun.h b/sigc++/functors/ptr_fun.h index b80ccab8..b188317b 100644 --- a/sigc++/functors/ptr_fun.h +++ b/sigc++/functors/ptr_fun.h @@ -106,8 +106,7 @@ class pointer_functor * @ingroup ptr_fun */ template -inline decltype(auto) -ptr_fun(T_return (*func)(T_args...)) +inline decltype(auto) ptr_fun(T_return (*func)(T_args...)) { return pointer_functor(func); } From 54fddab074fd39f74ebe329798a861b9a54bf31d Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Sun, 26 Dec 2021 18:26:44 +0100 Subject: [PATCH 019/112] CI: Use clang-format-12 and call clang-format directly without using autogen.sh + make. --- .github/workflows/clang-format-check.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/clang-format-check.yml b/.github/workflows/clang-format-check.yml index 8f59c403..fd6fb3a6 100644 --- a/.github/workflows/clang-format-check.yml +++ b/.github/workflows/clang-format-check.yml @@ -14,7 +14,5 @@ jobs: # Prevent blocking the install on a question during configuring of tzdata. export ENV DEBIAN_FRONTEND=noninteractive sudo apt update - sudo apt install build-essential mm-common clang-format-10 --yes - sudo ln -sf /usr/bin/clang-format-10 /usr/bin/clang-format - ./autogen.sh --enable-warnings=fatal - make check-format + sudo apt install clang-format-12 --yes + clang-format-12 --dry-run --Werror `find . -name "*.h" -or -name "*.cc"` From 7b08f329b6616835e3b6b05ebf473a75892acfda Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Sun, 26 Dec 2021 18:27:07 +0100 Subject: [PATCH 020/112] Reformat to suit clang-format-12 --- tests/test_bind.cc | 2 +- tests/test_cpp11_lambda.cc | 14 +++++++------- tests/test_member_method_trait.cc | 4 ++-- tests/test_signal.cc | 10 ++++++---- tests/test_track_obj.cc | 4 ++-- 5 files changed, 18 insertions(+), 16 deletions(-) diff --git a/tests/test_bind.cc b/tests/test_bind.cc index fa8537b0..0cd192ca 100644 --- a/tests/test_bind.cc +++ b/tests/test_bind.cc @@ -70,7 +70,7 @@ struct book : public sigc::trackable book& operator=(book&&) = delete; std::string& get_name() { return name_; } - operator std::string &() { return get_name(); } + operator std::string&() { return get_name(); } private: std::string name_; diff --git a/tests/test_cpp11_lambda.cc b/tests/test_cpp11_lambda.cc index a8e90b2e..ed125361 100644 --- a/tests/test_cpp11_lambda.cc +++ b/tests/test_cpp11_lambda.cc @@ -88,7 +88,7 @@ egon(std::string& str) struct book : public sigc::trackable { explicit book(const std::string& name) : name_(name) {} - operator std::string &() { return name_; } + operator std::string&() { return name_; } std::string name_; }; @@ -184,8 +184,8 @@ main(int argc, char* argv[]) // See https://bugzilla.gnome.org/show_bug.cgi?id=669128 // std::cout << "((++_1)*2)(ref(a)): " << ((++_1)*2)(std::ref(a)); // std::cout << "; a: " << a << std::endl; - result_stream << ([](std::reference_wrapper x) -> int { return ++x * 2; }( - std::ref(a_outer))); + result_stream << ([](std::reference_wrapper x) -> int + { return ++x * 2; }(std::ref(a_outer))); result_stream << " " << a_outer; util->check_result(result_stream, "4 2"); result_stream << ([](int& x) -> int { return ++x * 2; }(a_outer)); @@ -200,8 +200,8 @@ main(int argc, char* argv[]) // std::cout << "((--(*(&_1)))*2)(ref(a)): " << ((--(*(&_1)))*2)(std::ref(a)); // std::cout << "; a: " << a << std::endl; - result_stream << ([](std::reference_wrapper x) -> int { return --(*(&x)) * 2; }( - std::ref(a_outer))); + result_stream << ([](std::reference_wrapper x) -> int + { return --(*(&x)) * 2; }(std::ref(a_outer))); result_stream << " " << a_outer; util->check_result(result_stream, "6 3"); result_stream << ([](int& x) -> int { return --(*(&x)) * 2; }(a_outer)); @@ -234,8 +234,8 @@ main(int argc, char* argv[]) // std::cout << "(var(c) = (var(a) = _1, var(b) = _2))(2,3): " // << (sigc::var(c) = (sigc::var(a) = _1, sigc::var(b) = _2))(2,3); // std::cout << "; a: " << a << "; b: " << b << "; c: " << c << std::endl; - result_stream << ([&a_outer, &b_outer, &c_outer]( - int x, int y) -> int { return c_outer = (a_outer = x, b_outer = y); }(2, 3)); + result_stream << ([&a_outer, &b_outer, &c_outer](int x, int y) -> int + { return c_outer = (a_outer = x, b_outer = y); }(2, 3)); result_stream << " " << a_outer << " " << b_outer << " " << c_outer; util->check_result(result_stream, "3 2 3 3"); diff --git a/tests/test_member_method_trait.cc b/tests/test_member_method_trait.cc index 376d6855..bc5c4502 100644 --- a/tests/test_member_method_trait.cc +++ b/tests/test_member_method_trait.cc @@ -60,8 +60,8 @@ test_member_method_is_volatile() sigc::internal::member_method_is_volatile::value, "member_method_is_const failed to identify a volatile member method."); - static_assert(sigc::internal::member_method_is_volatile::value, + static_assert(sigc::internal::member_method_is_volatile< + decltype(&Something::some_const_volatile_func)>::value, "member_method_is_const failed to identify a volatile member method."); } diff --git a/tests/test_signal.cc b/tests/test_signal.cc index b5fdaf25..d050558b 100644 --- a/tests/test_signal.cc +++ b/tests/test_signal.cc @@ -117,10 +117,12 @@ test_clear_called_in_signal_handler() { sigc::signal sig; sig.connect([]() { result_stream << ", slot 1, "; }); - sig.connect([&sig]() { - sig.clear(); - result_stream << "slot 2, "; - }); + sig.connect( + [&sig]() + { + sig.clear(); + result_stream << "slot 2, "; + }); sig.connect([]() { result_stream << "slot 3, "; }); result_stream << sig.size(); sig.emit(); diff --git a/tests/test_track_obj.cc b/tests/test_track_obj.cc index cf18b7bb..aefdb078 100644 --- a/tests/test_track_obj.cc +++ b/tests/test_track_obj.cc @@ -40,8 +40,8 @@ std::ostringstream result_stream; struct book : public sigc::trackable { explicit book(const std::string& name) : name_(name) {} - operator std::string &() { return name_; } - operator const std::string &() const { return name_; } + operator std::string&() { return name_; } + operator const std::string&() const { return name_; } std::string name_; }; From 46ed1289e98d562ae85fc3a60a246ea2ef5e9e9d Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Sun, 26 Dec 2021 18:27:32 +0100 Subject: [PATCH 021/112] ptr_fun(), mem_fun() docs: Remove left-overs from sigc++-2.0 Some documentation of template parameters described sigc++-2.0 rather than sigc++-3.0. --- sigc++/functors/mem_fun.h | 19 ++++++++----------- sigc++/functors/ptr_fun.h | 10 +++++----- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/sigc++/functors/mem_fun.h b/sigc++/functors/mem_fun.h index 07aee0bc..44e80e9e 100644 --- a/sigc++/functors/mem_fun.h +++ b/sigc++/functors/mem_fun.h @@ -33,20 +33,16 @@ namespace sigc { /** @defgroup mem_fun mem_fun() - * mem_fun() Creates a functor from a pointer to a method. + * %mem_fun() creates a functor from a pointer to a method. * - * Optionally, a reference or pointer to an object can be bound to the functor. + * Optionally, a reference to an object can be bound to the functor. * * @note If the object type inherits from sigc::trackable, and the - * functor returned from mem_fun() is assigned to a sigc::slot, the functor + * functor returned from %mem_fun() is assigned to a sigc::slot, the functor * will be automatically cleared when the object goes out of scope. Invoking * that slot will then have no effect and will not try to use the destroyed * instance. * - * If the member function pointer is to an overloaded type, you must specify - * the types using template arguments starting with the first argument. - * It is not necessary to supply the return type. - * * @par Example: * @code * struct foo : public sigc::trackable @@ -59,7 +55,7 @@ namespace sigc * auto f = sigc::mem_fun(my_foo, &foo::bar); // Usually not what you want. * @endcode * - * For const methods mem_fun() takes a const reference or pointer to an object. + * For const methods %mem_fun() takes a const reference or pointer to an object. * * @par Example: * @code @@ -71,18 +67,19 @@ namespace sigc * sigc::slot sl = sigc::mem_fun(my_foo, &foo::bar); * @endcode * - * Use mem_fun#() if there is an ambiguity as to the number of arguments. + * If the member function pointer is to an overloaded type, you must specify + * the types using template arguments. * * @par Example: * @code * struct foo : public sigc::trackable * { - * void bar(int) {} + * void bar(int) {} // choose this one * void bar(float) {} * void bar(int, int) {} * }; * foo my_foo; - * sigc::slot sl = sigc::mem_fun1(my_foo, &foo::bar); + * sigc::slot sl = sigc::mem_fun1(my_foo, &foo::bar); * @endcode * * @ingroup sigcfunctors diff --git a/sigc++/functors/ptr_fun.h b/sigc++/functors/ptr_fun.h index b188317b..1c6e2653 100644 --- a/sigc++/functors/ptr_fun.h +++ b/sigc++/functors/ptr_fun.h @@ -26,10 +26,7 @@ namespace sigc { /** @defgroup ptr_fun ptr_fun() - * ptr_fun() creates a functor from a pointer to a function. - * If the function pointer is to an overloaded type, you must specify - * the types using template arguments starting with the first argument. - * It is not necessary to supply the return type. + * %ptr_fun() creates a functor from a pointer to a function. * * @par Example: * @code @@ -37,6 +34,9 @@ namespace sigc * sigc::slot sl = sigc::ptr_fun(&foo); * @endcode * + * If the function pointer is to an overloaded type, you must specify + * the types using template arguments. + * * @par Example: * @code * void foo(int) {} // choose this one @@ -45,7 +45,7 @@ namespace sigc * sigc::slot sl = sigc::ptr_fun(&foo); * @endcode * - * ptr_fun() can also be used to convert a pointer to a static member + * %ptr_fun() can also be used to convert a pointer to a static member * function to a functor, like so: * * @par Example: From d256006bab41a0c30b6955df8f35efaecd64ef26 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Wed, 29 Dec 2021 15:17:12 +0100 Subject: [PATCH 022/112] docs: Fix links to sigc::slot and sigc::signal Doxygen creates links to sigc::slot and sigc::signal only if template parameters are included in the documentation. sigc::slot, sigc::signal. --- sigc++/adaptors/bind.h | 2 +- sigc++/adaptors/compose.h | 2 +- sigc++/adaptors/exception_catch.h | 2 +- sigc++/adaptors/hide.h | 2 +- sigc++/adaptors/retype.h | 10 ++++++---- sigc++/functors/mem_fun.h | 3 ++- sigc++/functors/slot_base.h | 15 ++++++++------- sigc++/signal.h | 4 ++-- sigc++/signal_base.h | 31 ++++++++++++++++++------------- 9 files changed, 40 insertions(+), 31 deletions(-) diff --git a/sigc++/adaptors/bind.h b/sigc++/adaptors/bind.h index 1d89ba0c..1d48383e 100644 --- a/sigc++/adaptors/bind.h +++ b/sigc++/adaptors/bind.h @@ -54,7 +54,7 @@ namespace sigc * @endcode * * The functor sigc::bind() returns can be passed into - * sigc::signal::connect() directly. + * @ref sigc::signal_with_accumulator::connect() "sigc::signal::connect()" directly. * * @par Example: * @code diff --git a/sigc++/adaptors/compose.h b/sigc++/adaptors/compose.h index 3fadcebe..10f948ca 100644 --- a/sigc++/adaptors/compose.h +++ b/sigc++/adaptors/compose.h @@ -39,7 +39,7 @@ namespace sigc * @endcode * * The functor sigc::compose() returns can be passed directly into - * sigc::signal::connect(). + * @ref sigc::signal_with_accumulator::connect() "sigc::signal::connect()". * * @par Example: * @code diff --git a/sigc++/adaptors/exception_catch.h b/sigc++/adaptors/exception_catch.h index a7ccf9aa..f1dae2eb 100644 --- a/sigc++/adaptors/exception_catch.h +++ b/sigc++/adaptors/exception_catch.h @@ -62,7 +62,7 @@ namespace sigc * @endcode * * The functor sigc::exception_catch() returns can be directly passed into - * sigc::signal::connect(). + * @ref sigc::signal_with_accumulator::connect() "sigc::signal::connect()". * * @par Example: * @code diff --git a/sigc++/adaptors/hide.h b/sigc++/adaptors/hide.h index ac8a1a0c..46bc5d33 100644 --- a/sigc++/adaptors/hide.h +++ b/sigc++/adaptors/hide.h @@ -51,7 +51,7 @@ namespace sigc * @endcode * * The functor sigc::hide() returns can be directly passed into - * sigc::signal::connect(). + * @ref sigc::signal_with_accumulator::connect() "sigc::signal::connect()". * * @par Example: * @code diff --git a/sigc++/adaptors/retype.h b/sigc++/adaptors/retype.h index 948fe5cf..ce2adcd1 100644 --- a/sigc++/adaptors/retype.h +++ b/sigc++/adaptors/retype.h @@ -28,7 +28,8 @@ namespace sigc { /** @defgroup retype retype(), retype_return() - * sigc::retype() alters a sigc::pointer_functor, a sigc::mem_functor or a sigc::slot + * sigc::retype() alters a sigc::pointer_functor, a sigc::mem_functor or + * a @ref sigc::slot "sigc::slot" * in that it makes C-style casts to the functor's parameter types * of all parameters passed through operator()(). * @@ -40,7 +41,7 @@ namespace sigc * @endcode * * The functor that sigc::retype() returns can be passed directly into - * sigc::signal::connect(). + * @ref sigc::signal_with_accumulator::connect() "sigc::signal::connect()". * * @par Example: * @code @@ -49,8 +50,9 @@ namespace sigc * some_signal.connect(sigc::retype(sigc::ptr_fun(&foo))); * @endcode * - * This adaptor builds an exception in that it only works on sig::pointer_functor, - * sigc::mem_functor and sigc::slot because it needs sophisticated information about + * This adaptor builds an exception in that it only works on sigc::pointer_functor, + * sigc::mem_functor and @ref sigc::slot "sigc::slot" + * because it needs sophisticated information about * the parameter types that cannot be deduced from arbitrary functor types. * * sigc::retype_return() alters the return type of an arbitrary functor. diff --git a/sigc++/functors/mem_fun.h b/sigc++/functors/mem_fun.h index 44e80e9e..20717529 100644 --- a/sigc++/functors/mem_fun.h +++ b/sigc++/functors/mem_fun.h @@ -38,7 +38,8 @@ namespace sigc * Optionally, a reference to an object can be bound to the functor. * * @note If the object type inherits from sigc::trackable, and the - * functor returned from %mem_fun() is assigned to a sigc::slot, the functor + * functor returned from %mem_fun() is assigned to + * a @ref sigc::slot "sigc::slot", the functor * will be automatically cleared when the object goes out of scope. Invoking * that slot will then have no effect and will not try to use the destroyed * instance. diff --git a/sigc++/functors/slot_base.h b/sigc++/functors/slot_base.h index 1f7589c3..bf7959a0 100644 --- a/sigc++/functors/slot_base.h +++ b/sigc++/functors/slot_base.h @@ -181,7 +181,8 @@ struct SIGC_API slot_do_unbind * * @section slots-creating Creating Slots * - * Use the sigc::mem_fun() or sigc::ptr_fun() template functions to get a sigc::slot, like so: + * Use the sigc::mem_fun() or sigc::ptr_fun() template functions to get + * a @ref sigc::slot "sigc::slot", like so: * @code * sigc::slot sl = sigc::mem_fun(someobj, &SomeClass::somemethod); * @endcode @@ -215,9 +216,9 @@ struct SIGC_API slot_do_unbind * auto sl = sigc::mem_fun(someobj, &SomeClass::somemethod); // Not a slot! * @endcode * - * If you don't explicitly use a sigc::slot then the slot could call a method - * on an instance after it has been destroyed even if the method is in a class - * that derives from sigc::trackable. + * If you don't explicitly use a @ref sigc::slot "sigc::slot" + * then the slot could call a method on an instance after it has been destroyed + * even if the method is in a class that derives from sigc::trackable. * * @section slots-with-lambdas C++ Lambdas * @@ -241,14 +242,14 @@ struct SIGC_API slot_do_unbind */ /** Base type for slots. - * slot_base integrates most of the interface of the derived - * sigc::slot templates. slots + * %slot_base integrates most of the interface of the derived + * @ref sigc::slot "sigc::slot" template. Slots * can be connected to signals, be disconnected at some later point * (disconnect()) and temporarily be blocked (block(), unblock()). * The validity of a slot can be tested with empty(). * * The internal representation of a sigc::internal::slot_rep derived - * type is built from slot_base's derivations. set_parent() is used to + * type is built from %slot_base's derivations. set_parent() is used to * register a notification callback that is executed when the slot gets * invalid. add_destroy_notify_callback() is used by connection objects * to add a notification callback that is executed on destruction. diff --git a/sigc++/signal.h b/sigc++/signal.h index c1b0f339..b8e0f26f 100644 --- a/sigc++/signal.h +++ b/sigc++/signal.h @@ -543,8 +543,8 @@ class signal : public signal_with_accumulator "sigc::signal" but the additional + * template parameter @e T_accumulator defines the accumulator type that should be used. * * An accumulator is a functor that uses a pair of special iterators * to step through a list of slots and calculate a return value diff --git a/sigc++/signal_base.h b/sigc++/signal_base.h index 647ee024..3027c69f 100644 --- a/sigc++/signal_base.h +++ b/sigc++/signal_base.h @@ -219,8 +219,8 @@ struct SIGC_API signal_impl_holder } /* namespace internal */ /** @defgroup signal Signals - * Use sigc::signal::connect() with sigc::mem_fun() and sigc::ptr_fun() to connect a method or - * function with a signal. + * Use @ref sigc::signal_with_accumulator::connect() "sigc::signal::connect()" + * with sigc::mem_fun() and sigc::ptr_fun() to connect a method or function with a signal. * * @code * signal_clicked.connect( sigc::mem_fun(*this, &MyWindow::on_clicked) ); @@ -232,8 +232,9 @@ struct SIGC_API signal_impl_holder * If the type of your object inherits from sigc::trackable the method is disconnected * automatically when your object is destroyed. * - * When signals are copied they share the underlying information, - * so you can have a protected/private sigc::signal member and a public accessor method. + * When signals are copied they share the underlying information, so you can have + * a protected/private @ref sigc::signal "sigc::signal" + * member and a public accessor method. * A sigc::signal is a kind of reference-counting pointer. It's similar to * std::shared_ptr<>, although sigc::signal is restricted to holding a pointer to * a sigc::internal::signal_impl object that contains the implementation of the signal. @@ -259,21 +260,25 @@ struct SIGC_API signal_impl_holder * if the given functor or closure cannot be invoked with the * parameter list of the signal to connect to. * - * Almost any functor with the correct signature can be converted to a sigc::slot - * and connected to a signal. See @ref slot "Slots" and sigc::signal::connect(). + * Almost any functor with the correct signature can be converted to + * a @ref sigc::slot "sigc::slot" + * and connected to a signal. See @ref slot "Slots" and + * @ref sigc::signal_with_accumulator::connect() "sigc::signal::connect()". */ -/** Base class for the sigc::signal# templates. - * signal_base integrates most of the interface of the derived sigc::signal# - * templates. The implementation, however, resides in sigc::internal::signal_impl. - * A sigc::internal::signal_impl object is dynamically allocated from signal_base +/** Base class for the @ref sigc::signal "sigc::signal" template. + * %signal_base integrates most of the interface of the derived + * @ref sigc::signal "sigc::signal" template. + * The implementation, however, resides in sigc::internal::signal_impl. + * A sigc::internal::signal_impl object is dynamically allocated from %signal_base * when first connecting a slot to the signal. This ensures that empty signals * don't waste memory. * - * sigc::internal::signal_impl is reference-counted. When a sigc::signal# object + * sigc::internal::signal_impl is reference-counted. + * When a @ref sigc::signal "sigc::signal" object * is copied, the reference count of its sigc::internal::signal_impl object is - * incremented. Both sigc::signal# objects then refer to the same - * sigc::internal::signal_impl object. + * incremented. Both @ref sigc::signal "sigc::signal" objects + * then refer to the same sigc::internal::signal_impl object. * * @ingroup signal */ From 8e4f638a1bd3a904fe04123355d4d763ce00f122 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Sun, 9 Jan 2022 09:41:11 +0100 Subject: [PATCH 023/112] CI: Install docbook-xsl where documentation is built If docbook-xsl is installed, the xsltproc command reads stylesheets from local files instead of from http://docbook.sourceforge.net. Faster and safer. Reading from docbook.sourceforge.net sometimes fails. Remove test with g++-7. --- .github/workflows/autotools-clang-10.yml | 2 +- .github/workflows/autotools-clang-8.yml | 2 +- .github/workflows/autotools-clang-9.yml | 2 +- .github/workflows/autotools-gcc-10.yml | 2 +- .github/workflows/autotools-gcc-7.yml | 25 ------------------------ .github/workflows/autotools-gcc-8.yml | 2 +- .github/workflows/autotools-gcc-9.yml | 2 +- .github/workflows/meson-clang-10.yml | 2 +- .github/workflows/meson-gcc-9.yml | 2 +- 9 files changed, 8 insertions(+), 33 deletions(-) delete mode 100644 .github/workflows/autotools-gcc-7.yml diff --git a/.github/workflows/autotools-clang-10.yml b/.github/workflows/autotools-clang-10.yml index a398b3ae..9d6263a7 100644 --- a/.github/workflows/autotools-clang-10.yml +++ b/.github/workflows/autotools-clang-10.yml @@ -14,7 +14,7 @@ jobs: # Prevent blocking apt install on a question during configuring of tzdata. export ENV DEBIAN_FRONTEND=noninteractive sudo apt update - sudo apt install mm-common clang-10 make --yes + sudo apt install mm-common clang-10 make docbook-xsl --yes export CC=clang-10 CXX=clang++-10 ./autogen.sh --enable-warnings=fatal make diff --git a/.github/workflows/autotools-clang-8.yml b/.github/workflows/autotools-clang-8.yml index 78914b5f..908e2f83 100644 --- a/.github/workflows/autotools-clang-8.yml +++ b/.github/workflows/autotools-clang-8.yml @@ -12,7 +12,7 @@ jobs: - name: Build run: | sudo apt update - sudo apt install mm-common clang-8 + sudo apt install mm-common clang-8 docbook-xsl export CXX=clang++-8 ./autogen.sh --enable-warnings=fatal make diff --git a/.github/workflows/autotools-clang-9.yml b/.github/workflows/autotools-clang-9.yml index b9b2f5c5..9a0dae77 100644 --- a/.github/workflows/autotools-clang-9.yml +++ b/.github/workflows/autotools-clang-9.yml @@ -14,7 +14,7 @@ jobs: # Prevent blocking apt install on a question during configuring of tzdata. export ENV DEBIAN_FRONTEND=noninteractive sudo apt update - sudo apt install mm-common clang-9 make --yes + sudo apt install mm-common clang-9 make docbook-xsl --yes export CC=clang-9 CXX=clang++-9 ./autogen.sh --enable-warnings=fatal make diff --git a/.github/workflows/autotools-gcc-10.yml b/.github/workflows/autotools-gcc-10.yml index 2082f4fb..1f601b0b 100644 --- a/.github/workflows/autotools-gcc-10.yml +++ b/.github/workflows/autotools-gcc-10.yml @@ -12,7 +12,7 @@ jobs: - name: Build run: | sudo apt update - sudo apt install mm-common g++-10 + sudo apt install mm-common g++-10 docbook-xsl export CXX=g++-10 ./autogen.sh --enable-warnings=fatal make diff --git a/.github/workflows/autotools-gcc-7.yml b/.github/workflows/autotools-gcc-7.yml deleted file mode 100644 index 826efa7f..00000000 --- a/.github/workflows/autotools-gcc-7.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: "CI: autotools: gcc 7" - -on: [push] - -jobs: - build: - - runs-on: ubuntu-18.04 - - steps: - - uses: actions/checkout@v1 - - name: Build - run: | - sudo apt update - sudo apt install mm-common g++-7 - export CXX=g++-7 - ./autogen.sh --enable-warnings=fatal - make - - name: Test - run: make check - - name: Distcheck - run: | - # distcheck runs configure again so we need to specify CXX again. - export CXX=g++-7 - make distcheck diff --git a/.github/workflows/autotools-gcc-8.yml b/.github/workflows/autotools-gcc-8.yml index e9aa877d..22c32d43 100644 --- a/.github/workflows/autotools-gcc-8.yml +++ b/.github/workflows/autotools-gcc-8.yml @@ -12,7 +12,7 @@ jobs: - name: Build run: | sudo apt update - sudo apt install mm-common g++-8 + sudo apt install mm-common g++-8 docbook-xsl export CXX=g++-8 ./autogen.sh --enable-warnings=fatal make diff --git a/.github/workflows/autotools-gcc-9.yml b/.github/workflows/autotools-gcc-9.yml index 0b2d9b19..2ef20b49 100644 --- a/.github/workflows/autotools-gcc-9.yml +++ b/.github/workflows/autotools-gcc-9.yml @@ -12,7 +12,7 @@ jobs: - name: Build run: | sudo apt update - sudo apt install mm-common g++-9 + sudo apt install mm-common g++-9 docbook-xsl export CXX=g++-9 ./autogen.sh --enable-warnings=fatal make diff --git a/.github/workflows/meson-clang-10.yml b/.github/workflows/meson-clang-10.yml index 00935798..fda48daa 100644 --- a/.github/workflows/meson-clang-10.yml +++ b/.github/workflows/meson-clang-10.yml @@ -14,7 +14,7 @@ jobs: # Prevent blocking apt install on a question during configuring of tzdata. export ENV DEBIAN_FRONTEND=noninteractive sudo apt update - sudo apt install libxml2-utils docbook5-xml mm-common clang-10 ninja-build python3-setuptools python3-pip --yes + sudo apt install libxml2-utils docbook5-xml docbook-xsl mm-common clang-10 ninja-build python3-setuptools python3-pip --yes # Ubuntu 20.04 contains meson 0.53.2, but libsigc++ requires meson >= 0.54.0. # Install it with pip3 instead of apt. sudo pip3 install "meson>=0.54.0" diff --git a/.github/workflows/meson-gcc-9.yml b/.github/workflows/meson-gcc-9.yml index 51f9b4c3..0543b321 100644 --- a/.github/workflows/meson-gcc-9.yml +++ b/.github/workflows/meson-gcc-9.yml @@ -14,7 +14,7 @@ jobs: # Prevent blocking apt install on a question during configuring of tzdata. export ENV DEBIAN_FRONTEND=noninteractive sudo apt update - sudo apt install libxml2-utils docbook5-xml mm-common g++-9 ninja-build python3-setuptools python3-pip --yes + sudo apt install libxml2-utils docbook5-xml docbook-xsl mm-common g++-9 ninja-build python3-setuptools python3-pip --yes # Ubuntu 20.04 contains meson 0.53.2, but libsigc++ requires meson >= 0.54.0. # Install it with pip3 instead of apt. sudo pip3 install "meson>=0.54.0" From dfec5af275d08edbfe4379b53e397577bf19f55a Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Mon, 31 Jan 2022 09:36:45 +0100 Subject: [PATCH 024/112] tools/tutorial-custom-cmd.py: Add comment about used stylesheet --- tools/tutorial-custom-cmd.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/tutorial-custom-cmd.py b/tools/tutorial-custom-cmd.py index c1029680..8b4b094e 100755 --- a/tools/tutorial-custom-cmd.py +++ b/tools/tutorial-custom-cmd.py @@ -31,6 +31,9 @@ def html(): '--param', 'use.id.as.filename', '1', ] + # The recommended stylesheet for DocBook V5.0 is .../xsl-ns/... + # It's not used here because the docbook-xsl-ns package is not available + # when building with gnome-build-meta. xslt_stylesheet = 'http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl' # Remove old files and create the destination directory. From afac37ad1dab41202ceecfe50315d0074e372f21 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Fri, 11 Feb 2022 16:06:04 +0100 Subject: [PATCH 025/112] docs/docs/reference/Doxyfile.in: Remove obsolete entry --- docs/docs/reference/Doxyfile.in | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/docs/reference/Doxyfile.in b/docs/docs/reference/Doxyfile.in index a8ed00e1..c4cefda9 100644 --- a/docs/docs/reference/Doxyfile.in +++ b/docs/docs/reference/Doxyfile.in @@ -147,7 +147,6 @@ CLANG_OPTIONS = # Configuration options related to the alphabetical class index #--------------------------------------------------------------------------- ALPHABETICAL_INDEX = YES -COLS_IN_ALPHA_INDEX = 1 IGNORE_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the HTML output From c9b2b53059a2fc23eb939e98a59c61c2414ec3f8 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Fri, 11 Feb 2022 16:07:35 +0100 Subject: [PATCH 026/112] meson.build: Specify 'check' option in run_command() The default value will be changed in future Meson releases. Don't use deprecated python3.path() and execute(..., gui_app: ...). --- .github/workflows/meson-clang-10.yml | 4 ++-- .github/workflows/meson-gcc-9.yml | 4 ++-- MSVC_NMake/meson.build | 2 +- docs/docs/manual/meson.build | 3 ++- docs/docs/reference/meson.build | 4 ++-- examples/meson.build | 1 - meson.build | 20 ++++++++++++-------- tests/meson.build | 2 -- 8 files changed, 21 insertions(+), 19 deletions(-) diff --git a/.github/workflows/meson-clang-10.yml b/.github/workflows/meson-clang-10.yml index fda48daa..13f611b7 100644 --- a/.github/workflows/meson-clang-10.yml +++ b/.github/workflows/meson-clang-10.yml @@ -15,9 +15,9 @@ jobs: export ENV DEBIAN_FRONTEND=noninteractive sudo apt update sudo apt install libxml2-utils docbook5-xml docbook-xsl mm-common clang-10 ninja-build python3-setuptools python3-pip --yes - # Ubuntu 20.04 contains meson 0.53.2, but libsigc++ requires meson >= 0.54.0. + # Ubuntu 20.04 contains meson 0.53.2, but libsigc++ requires meson >= 0.55.0. # Install it with pip3 instead of apt. - sudo pip3 install "meson>=0.54.0" + sudo pip3 install "meson>=0.55.0" export CXX=clang++-10 meson -Dwarnings=fatal _build cd _build diff --git a/.github/workflows/meson-gcc-9.yml b/.github/workflows/meson-gcc-9.yml index 0543b321..96b160f7 100644 --- a/.github/workflows/meson-gcc-9.yml +++ b/.github/workflows/meson-gcc-9.yml @@ -15,9 +15,9 @@ jobs: export ENV DEBIAN_FRONTEND=noninteractive sudo apt update sudo apt install libxml2-utils docbook5-xml docbook-xsl mm-common g++-9 ninja-build python3-setuptools python3-pip --yes - # Ubuntu 20.04 contains meson 0.53.2, but libsigc++ requires meson >= 0.54.0. + # Ubuntu 20.04 contains meson 0.53.2, but libsigc++ requires meson >= 0.55.0. # Install it with pip3 instead of apt. - sudo pip3 install "meson>=0.54.0" + sudo pip3 install "meson>=0.55.0" export CXX=g++-9 meson -Dwarnings=fatal _build cd _build diff --git a/MSVC_NMake/meson.build b/MSVC_NMake/meson.build index f9ddc357..09078b37 100644 --- a/MSVC_NMake/meson.build +++ b/MSVC_NMake/meson.build @@ -23,7 +23,7 @@ handle_built_files = project_source_root / 'tools' / 'handle-built-files.py' if can_add_dist_script # Distribute built files. meson.add_dist_script( - python3.path(), handle_built_files, 'dist_gen_msvc_files', + python3, handle_built_files, 'dist_gen_msvc_files', meson.current_build_dir(), untracked_msvc_nmake, project_build_root / 'sigc++config.h', diff --git a/docs/docs/manual/meson.build b/docs/docs/manual/meson.build index e6321314..8c721c8e 100644 --- a/docs/docs/manual/meson.build +++ b/docs/docs/manual/meson.build @@ -31,6 +31,7 @@ if xmllint.found() validate, meson.current_source_dir() / 'can_use_xmllint.xml', meson.current_build_dir() / 'can_use_xmllint.stamp', + check: false, ).returncode() == 0 if not can_parse_and_validate # The DocBook V5.0 package is called docbook5-xml in Ubuntu, @@ -95,7 +96,7 @@ endif if can_add_dist_script # Distribute built files. meson.add_dist_script( - python3.path(), tutorial_custom_cmd, 'dist_doc', + python3, tutorial_custom_cmd, 'dist_doc', doc_dist_dir, meson.current_build_dir(), meson.current_source_dir() / sigc_manual_xml, diff --git a/docs/docs/reference/meson.build b/docs/docs/reference/meson.build index 397e975f..e0c0c4b6 100644 --- a/docs/docs/reference/meson.build +++ b/docs/docs/reference/meson.build @@ -120,7 +120,7 @@ devhelp_file = custom_target('devhelp', # Install Devhelp file and html files. meson.add_install_script( - python3.path(), doc_reference, 'install_doc', + python3, doc_reference, 'install_doc', doctool_dir, devhelp_file.full_path(), install_devhelpdir, @@ -131,7 +131,7 @@ meson.add_install_script( if can_add_dist_script # Distribute built files and files copied by mm-common-get. meson.add_dist_script( - python3.path(), doc_reference, 'dist_doc', + python3, doc_reference, 'dist_doc', doctool_dir, doctool_dist_dir, meson.current_build_dir(), diff --git a/examples/meson.build b/examples/meson.build index 3779f72d..c55bfdd8 100644 --- a/examples/meson.build +++ b/examples/meson.build @@ -23,7 +23,6 @@ foreach ex : examples cpp_args: '-DSIGCXX_DISABLE_DEPRECATED', dependencies: sigcxx_own_dep, implicit_include_directories: false, - gui_app: false, build_by_default: build_examples ) endforeach diff --git a/meson.build b/meson.build index 2e309331..bc2e1d8e 100644 --- a/meson.build +++ b/meson.build @@ -7,8 +7,8 @@ project('libsigc++', 'cpp', 'cpp_std=c++17', 'warning_level=0', ], - meson_version: '>= 0.54.0', # required for meson.override_dependency() - # and dep.get_variable(internal:) + meson_version: '>= 0.55.0', # required for meson.add_dist_script(python3, ...) + # and meson.add_install_script(python3, ...) ) sigcxx_api_version = '3.0' @@ -56,7 +56,7 @@ import os import sys sys.exit(os.path.isdir("@0@") or os.path.isfile("@0@")) '''.format(project_source_root / '.git') -is_git_build = run_command(python3, '-c', cmd_py).returncode() != 0 +is_git_build = run_command(python3, '-c', cmd_py, check: false).returncode() != 0 # Are we testing a dist tarball while it's being built? # There ought to be a better way. https://github.com/mesonbuild/meson/issues/6866 @@ -130,14 +130,16 @@ tutorial_custom_cmd = project_source_root / 'tools' / 'tutorial-custom-cmd.py' if maintainer_mode # Copy files to untracked/build_scripts and untracked/docs/docs. run_command(mm_common_get, '--force', script_dir, - project_source_root / 'untracked' / 'docs' / 'docs') + project_source_root / 'untracked' / 'docs' / 'docs', + check: true, + ) else cmd_py = ''' import os import sys sys.exit(os.path.isfile("@0@")) '''.format(doc_reference) - file_exists = run_command(python3, '-c', cmd_py).returncode() != 0 + file_exists = run_command(python3, '-c', cmd_py, check: false).returncode() != 0 if not file_exists warning('Missing files in untracked/. ' + \ 'Enable maintainer-mode if you want to build documentation or create a dist tarball.') @@ -148,7 +150,9 @@ endif doc_perl_prop = run_command( python3, doc_reference, 'get_script_property', '', # MMDOCTOOLDIR is not used - 'requires_perl') + 'requires_perl', + check: false, +) if not (doc_perl_prop.returncode() == 0 and doc_perl_prop.stdout() == 'false') # Perl is required, if documentation shall be built. perl = find_program('perl', required: build_documentation) @@ -243,13 +247,13 @@ subdir('docs/docs/manual') if can_add_dist_script # Add a ChangeLog file to the distribution directory. meson.add_dist_script( - python3.path(), dist_changelog, + python3, dist_changelog, project_source_root, ) # Add build scripts to the distribution directory, and delete .gitignore # files and an empty $MESON_PROJECT_DIST_ROOT/build/ directory. meson.add_dist_script( - python3.path(), dist_build_scripts, + python3, dist_build_scripts, project_source_root, 'untracked' / 'build_scripts', ) diff --git a/tests/meson.build b/tests/meson.build index 5b6b0c71..87605a45 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -67,7 +67,6 @@ foreach ex : test_programs exe_file = executable(ex_name, ex_sources, dependencies: sigcxx_own_dep, implicit_include_directories: false, - gui_app: false, build_by_default: true ) @@ -89,7 +88,6 @@ if can_benchmark exe_file = executable(ex_name, ex_sources, dependencies: [sigcxx_own_dep, benchmark_dep], implicit_include_directories: false, - gui_app: false, build_by_default: do_benchmark ) From baab13fd40d90dc0a33241a4bd517f985479a0c5 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Fri, 11 Feb 2022 16:10:36 +0100 Subject: [PATCH 027/112] 3.2.0 --- CMakeLists.txt | 4 ++-- NEWS | 20 ++++++++++++++++++++ configure.ac | 2 +- meson.build | 2 +- 4 files changed, 24 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1863d8ee..e1b28fea 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,8 +17,8 @@ cmake_minimum_required (VERSION 3.2) set (SIGCXX_MAJOR_VERSION 3) -set (SIGCXX_MINOR_VERSION 0) -set (SIGCXX_MICRO_VERSION 7) +set (SIGCXX_MINOR_VERSION 2) +set (SIGCXX_MICRO_VERSION 0) set (SIGCXX_API_VERSION 3.0) set (PACKAGE_VERSION ${SIGCXX_MAJOR_VERSION}.${SIGCXX_MINOR_VERSION}.${SIGCXX_MICRO_VERSION}) diff --git a/NEWS b/NEWS index 2f3d8cb5..3cf92d69 100755 --- a/NEWS +++ b/NEWS @@ -1,3 +1,23 @@ +3.2.0 (stable) + +* Allow slots with rvalue reference parameters + (Slava Andrejev) Pull requests #74, #77 + +Build: +* Meson build: Perl is not required by new versions of mm-common + (Kjell Ahlstedt) +* NMake Makefiles: Support building with VS2022 + (Chun-wei Fan) + +Documentation: +* Upgrade the manual from DocBook 4.1 to DocBook 5.0 + (Kjell Ahlstedt) +* ptr_fun(), mem_fun() docs: Remove left-overs from sigc++-2.0 + (Kjell Ahlstedt) +* Fix links to sigc::slot and sigc::signal + (Kjell Ahlstedt) + + 3.0.7 (stable) Meson build: diff --git a/configure.ac b/configure.ac index 4817a6fc..1307c2f9 100644 --- a/configure.ac +++ b/configure.ac @@ -15,7 +15,7 @@ ## You should have received a copy of the GNU Lesser General Public License ## along with this library. If not, see . -AC_INIT([libsigc++], [3.0.7], +AC_INIT([libsigc++], [3.2.0], [https://github.com/libsigcplusplus/libsigcplusplus/issues/], [libsigc++], [https://libsigcplusplus.github.io/libsigcplusplus/]) AC_PREREQ([2.59]) diff --git a/meson.build b/meson.build index bc2e1d8e..ca49138e 100644 --- a/meson.build +++ b/meson.build @@ -1,7 +1,7 @@ # This file is part of libsigc++. project('libsigc++', 'cpp', - version: '3.0.7', + version: '3.2.0', license: 'LGPLv2.1+', default_options: [ 'cpp_std=c++17', From 6fb6f9dfc2858e3681aadbd178d13b38da043246 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Wed, 20 Apr 2022 14:54:30 +0200 Subject: [PATCH 028/112] Add track_object(), deprecate track_obj() track_object() checks that the listed objects derive from sigc::trackable. Fixes #78 --- sigc++/adaptors/track_obj.h | 45 +++++++++++++++++---- tests/test_track_obj.cc | 80 ++++++++++++++++++++++--------------- 2 files changed, 85 insertions(+), 40 deletions(-) diff --git a/sigc++/adaptors/track_obj.h b/sigc++/adaptors/track_obj.h index 6f208f35..7f895b29 100644 --- a/sigc++/adaptors/track_obj.h +++ b/sigc++/adaptors/track_obj.h @@ -23,19 +23,24 @@ #include #include #include +#include +#include +#include namespace sigc { -/** @defgroup track_obj track_obj() - * sigc::track_obj() tracks trackable objects, referenced from a functor. +/** @defgroup track_obj track_obj(), track_object() + * sigc::track_object() tracks trackable objects, referenced from a functor. * It can be useful when you assign a C++11 lambda expression or a std::function<> * to a slot, or connect it to a signal, and the lambda expression or std::function<> * contains references to sigc::trackable derived objects. * - * The functor returned by sigc::track_obj() is formally an adaptor, but it does + * The functor returned by sigc::track_object() is formally an adaptor, but it does * not alter the signature, return type or behaviour of the supplied functor. * + * track_obj() is a deprecated alternative to track_object(). + * * @par Example: * @code * struct bar : public sigc::trackable {}; @@ -45,18 +50,18 @@ namespace sigc * bar some_bar; * some_signal.connect([&some_bar](){ foo(some_bar); }); * // NOT disconnected automatically when some_bar goes out of scope - * some_signal.connect(sigc::track_obj([&some_bar](){ foo(some_bar); }, some_bar); + * some_signal.connect(sigc::track_object([&some_bar](){ foo(some_bar); }, some_bar); * // disconnected automatically when some_bar goes out of scope * } * @endcode * - * @newin{2,4} - * * @ingroup adaptors */ -/** track_obj_functor wraps a functor and stores a reference to a trackable object. - * Use the convenience function track_obj() to create an instance of track_obj_functor. +/** %track_obj_functor wraps a functor and stores a reference to a trackable object. + * Use the convenience function track_object() to create an instance of %track_obj_functor. + * + * track_obj() is a deprecated alternative to track_object(). * * @tparam T_functor The type of functor to wrap. * @tparam T_obj The types of the trackable objects. @@ -124,12 +129,14 @@ struct visitor> }; #endif // DOXYGEN_SHOULD_SKIP_THIS +#ifndef SIGCXX_DISABLE_DEPRECATED /** Creates an adaptor of type sigc::track_obj_functor which wraps a functor. * @param func Functor that shall be wrapped. * @param obj Trackable objects. * @return Adaptor that executes func() on invocation. * * @newin{2,4} + * @deprecated Use sigc::track_object() instead. * * @ingroup track_obj */ @@ -139,6 +146,28 @@ track_obj(const T_functor& func, const T_obj&... obj) { return track_obj_functor(func, obj...); } +#endif // SIGCXX_DISABLE_DEPRECATED + +/** Creates an adaptor of type sigc::track_obj_functor which wraps a functor. + * @param func Functor that shall be wrapped. + * @param obj1 Trackable object, derived directly or indirectly from sigc::trackable. + * @param objs Zero or more trackable objects, derived directly or indirectly from sigc::trackable. + * @return Adaptor that executes func() on invocation. + * + * @newin{3,4} + * + * @ingroup track_obj + */ +template +inline decltype(auto) +track_object(const T_functor& func, const T_obj1& obj1, const T_objs&... objs) +{ + static_assert(std::min({std::is_base_of::value, + std::is_base_of::value...}), + "Each trackable object must be derived from sigc::trackable."); + + return track_obj_functor(func, obj1, objs...); +} } /* namespace sigc */ diff --git a/tests/test_track_obj.cc b/tests/test_track_obj.cc index aefdb078..54b44309 100644 --- a/tests/test_track_obj.cc +++ b/tests/test_track_obj.cc @@ -17,10 +17,10 @@ */ // The purpose of this test case is threefold. -// - Test sigc::track_obj(). +// - Test sigc::track_obj() and sigc::track_object(). // - Show that a slot with a C++11 lambda expression can be automatically // disconnected when an object derived from sigc::trackable is deleted, -// provided sigc::track_obj() is used. +// provided sigc::track_obj() or sigc::track_object() is used. // It shows that C++11 lambda expressions can replace the libsigc++ lambda // expressions, which have been removed. // See https://bugzilla.gnome.org/show_bug.cgi?id=672555 @@ -115,32 +115,38 @@ main(int argc, char* argv[]) return util->get_result_and_delete_instance() ? EXIT_SUCCESS : EXIT_FAILURE; sigc::slot sl1; + sigc::slot sl2; { bar_group4 bar4; sl1 = sigc::track_obj(Functor1(bar4), bar4); - result_stream << sl1(-2); - util->check_result(result_stream, "negative"); + sl2 = sigc::track_object(Functor1(bar4), bar4); + result_stream << sl1(-2) << ", " << sl2(2); + util->check_result(result_stream, "negative, positive"); - } // auto-disconnect sl1 + } // auto-disconnect sl1 and sl2 - result_stream << sl1(-2); - util->check_result(result_stream, ""); + result_stream << sl1(-2) << ", " << sl2(2); + util->check_result(result_stream, ", "); // Allocate on the heap. valgrind can then find erroneous memory accesses. // (There should be none, of course.) - auto psl2 = new sigc::slot; + auto psl3 = new sigc::slot; + auto psl4 = new sigc::slot; auto pbar4 = new bar_group4; auto pbook4 = new book("A Book"); - *psl2 = sigc::track_obj(Functor2(*pbar4, *pbook4), *pbar4, *pbook4); - result_stream << (*psl2)(0, "Book title: "); - util->check_result(result_stream, "zero, Book title: A Book"); + *psl3 = sigc::track_obj(Functor2(*pbar4, *pbook4), *pbar4, *pbook4); + *psl4 = sigc::track_object(Functor2(*pbar4, *pbook4), *pbar4, *pbook4); + result_stream << (*psl3)(0, "Book title: ") << ", " << (*psl4)(1, "Title: "); + util->check_result(result_stream, "zero, Book title: A Book, positive, Title: A Book"); - delete pbook4; // auto-disconnect *psl2 + delete pbook4; // auto-disconnect *psl3 and *psl4 pbook4 = nullptr; - result_stream << (*psl2)(0, "Book title: "); - util->check_result(result_stream, ""); - delete psl2; - psl2 = nullptr; + result_stream << (*psl3)(0, "Book title: ") << ", " << (*psl4)(1, "Title: "); + util->check_result(result_stream, ", "); + delete psl3; + psl3 = nullptr; + delete psl4; + psl4 = nullptr; delete pbar4; pbar4 = nullptr; @@ -149,38 +155,47 @@ main(int argc, char* argv[]) // auto-disconnect // If you want to auto-disconnect a slot with a C++11 lambda expression // that contains references to sigc::trackable-derived objects, you must use - // sigc::track_obj(). - sigc::slot sl10; + // sigc::track_obj() or sigc::track_object(). + sigc::slot sl11; + sigc::slot sl12; { book guest_book("karl"); - // sl1 = [&guest_book](std::ostringstream& stream){ stream << guest_book << "\n"; }; // no - // auto-disconnect - sl10 = sigc::track_obj( + // no auto-disconnect + // sl1 = [&guest_book](std::ostringstream& stream){ stream << guest_book << "\n"; }; + sl11 = sigc::track_obj( + [&guest_book](std::ostringstream& stream) { stream << guest_book; }, guest_book); + sl12 = sigc::track_object( [&guest_book](std::ostringstream& stream) { stream << guest_book; }, guest_book); - sl10(result_stream); - util->check_result(result_stream, "karl"); + sl11(result_stream); + sl12(result_stream); + util->check_result(result_stream, "karlkarl"); - } // auto-disconnect sl10 + } // auto-disconnect sl11 and sl12 - sl10(result_stream); + sl11(result_stream); + sl12(result_stream); util->check_result(result_stream, ""); // auto-disconnect - sigc::slot sl20; + sigc::slot sl21; + sigc::slot sl22; { book guest_book("karl"); // sl2 = [&guest_book] () { egon(guest_book); }; // no auto-disconnect // sl2 = std::bind(&egon, std::ref(guest_book)); // does not compile (gcc 4.6.3) - sl20 = sigc::track_obj([&guest_book]() { egon(guest_book); }, guest_book); - sl20(); - util->check_result(result_stream, "egon(string 'karl')"); + sl21 = sigc::track_obj([&guest_book]() { egon(guest_book); }, guest_book); + sl22 = sigc::track_obj([&guest_book]() { egon(guest_book); }, guest_book); + sl21(); + sl22(); + util->check_result(result_stream, "egon(string 'karl')egon(string 'egon was here')"); result_stream << static_cast(guest_book); util->check_result(result_stream, "egon was here"); - } // auto-disconnect sl20 + } // auto-disconnect sl21 and sl22 - sl20(); + sl21(); + sl22(); util->check_result(result_stream, ""); // Code example in the documentation sigc++/adaptors/track_obj.h. @@ -194,8 +209,9 @@ main(int argc, char* argv[]) // some_signal.connect(sigc::bind(&foo_group4, std::ref(some_bar))); // auto-disconnects, // but we prefer C++11 lambda some_signal.connect(sigc::track_obj([&some_bar]() { foo_group4(some_bar); }, some_bar)); + some_signal.connect(sigc::track_object([&some_bar]() { foo_group4(some_bar); }, some_bar)); some_signal.emit(); - util->check_result(result_stream, "foo_group4(bar_group4&)"); + util->check_result(result_stream, "foo_group4(bar_group4&)foo_group4(bar_group4&)"); } // auto-disconnect the lambda expression From ef8435a8c8694283bbf905b8e53a83bf2144b751 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Wed, 20 Apr 2022 15:54:19 +0200 Subject: [PATCH 029/112] Format source code to suit clang-format-12 Format sigc++/adaptors/track_obj.h. --- sigc++/adaptors/track_obj.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sigc++/adaptors/track_obj.h b/sigc++/adaptors/track_obj.h index 7f895b29..80cb3ff1 100644 --- a/sigc++/adaptors/track_obj.h +++ b/sigc++/adaptors/track_obj.h @@ -162,8 +162,8 @@ template inline decltype(auto) track_object(const T_functor& func, const T_obj1& obj1, const T_objs&... objs) { - static_assert(std::min({std::is_base_of::value, - std::is_base_of::value...}), + static_assert(std::min({ std::is_base_of::value, + std::is_base_of::value... }), "Each trackable object must be derived from sigc::trackable."); return track_obj_functor(func, obj1, objs...); From 4b829ece84c6dbaa4d89bf4fe6feebd4236b31d1 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Wed, 27 Apr 2022 18:10:48 +0200 Subject: [PATCH 030/112] Fix some comments --- sigc++/adaptors/hide.h | 5 ++--- sigc++/functors/slot.h | 7 ++++++- sigc++/signal.h | 2 +- sigc++/tuple-utils/tuple_end.h | 2 +- sigc++/tuple-utils/tuple_start.h | 4 ++-- 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/sigc++/adaptors/hide.h b/sigc++/adaptors/hide.h index 46bc5d33..d8e95797 100644 --- a/sigc++/adaptors/hide.h +++ b/sigc++/adaptors/hide.h @@ -64,8 +64,8 @@ namespace sigc * @par Example: * @code * // multiple argument hiding ... - * sigc::hide(sigc::hide(&foo))(1,2,3,4); // adds two dummy parameters at the back and calls - foo(1,2) + * // adds two dummy parameters at the back and calls foo(1,2) + * sigc::hide(sigc::hide(&foo))(1,2,3,4); * @endcode * sigc::hide_return() alters an arbitrary functor by @@ -79,7 +79,6 @@ namespace sigc * * The following template arguments are used: * - @e I_location Zero-based position of the dummy parameter (@p -1 for the last parameter). - * - @e T_type Type of the dummy parameter. * - @e T_functor Type of the functor to wrap. * * @ingroup hide diff --git a/sigc++/functors/slot.h b/sigc++/functors/slot.h index e368e864..3f4b5108 100644 --- a/sigc++/functors/slot.h +++ b/sigc++/functors/slot.h @@ -24,7 +24,6 @@ #include #include #include - #include namespace sigc @@ -230,6 +229,12 @@ class slot : public slot_base inline slot() = default; + // If you're tempted to add + // template, int> = 0> + // to the constructor, see https://github.com/libsigcplusplus/libsigcplusplus/issues/79 + // It doesn't work well when sigc::slot is combined with sigc::hide(). + /** Constructs a slot from an arbitrary functor. * @param func The desired functor the new slot should be assigned to. */ diff --git a/sigc++/signal.h b/sigc++/signal.h index b8e0f26f..8f7dadcb 100644 --- a/sigc++/signal.h +++ b/sigc++/signal.h @@ -469,7 +469,7 @@ class signal_with_accumulator : public signal_base */ decltype(auto) make_slot() const { - // TODO: Instead use std::result_of<> on the static emitter_type::emit() + // TODO: Instead use std::invoke_result<> on the static emitter_type::emit() using result_type = typename internal::member_method_result::type; return bound_mem_functor...) diff --git a/sigc++/tuple-utils/tuple_end.h b/sigc++/tuple-utils/tuple_end.h index 966a6c87..e32d56b9 100644 --- a/sigc++/tuple-utils/tuple_end.h +++ b/sigc++/tuple-utils/tuple_end.h @@ -58,7 +58,7 @@ tuple_end(T&& t) { // We use std::decay_t<> because tuple_size is not defined for references. constexpr auto size = std::tuple_size>::value; - static_assert(len <= size, "The tuple size must be less than or equal to the length."); + static_assert(len <= size, "The tuple size must be greater than or equal to the length."); if constexpr (len == 0) { diff --git a/sigc++/tuple-utils/tuple_start.h b/sigc++/tuple-utils/tuple_start.h index 6c83030d..c75fda91 100644 --- a/sigc++/tuple-utils/tuple_start.h +++ b/sigc++/tuple-utils/tuple_start.h @@ -59,7 +59,7 @@ struct tuple_start_impl> { constexpr auto size = std::tuple_size>::value; constexpr auto len = sizeof...(I); - static_assert(len <= size, "The tuple size must be less than or equal to the length."); + static_assert(len <= size, "The tuple size must be greater than or equal to the length."); using start = typename tuple_type_start, len>::type; return start(std::get(std::forward(t))...); @@ -77,7 +77,7 @@ tuple_start(T&& t) { // We use std::decay_t<> because tuple_size is not defined for references. constexpr auto size = std::tuple_size>::value; - static_assert(len <= size, "The tuple size must be less than or equal to the length."); + static_assert(len <= size, "The tuple size must be greater than or equal to the length."); return detail::tuple_start_impl>::tuple_start( std::forward(t)); From 6952dddbcbab0daa61803b3d4b9b0719f326efba Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Wed, 27 Apr 2022 18:11:08 +0200 Subject: [PATCH 031/112] examples/member_method: Make on_print() non-virtual so it can be compiled with the -Wnon-virtual-dtor compiler option. --- examples/member_method.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/member_method.cc b/examples/member_method.cc index ab825258..5fc5b2cf 100644 --- a/examples/member_method.cc +++ b/examples/member_method.cc @@ -15,7 +15,7 @@ class Something : public sigc::trackable Something(); protected: - virtual void on_print(int a); + void on_print(int a); using type_signal_print = sigc::signal; type_signal_print signal_print; @@ -35,7 +35,7 @@ Something::Something() void Something::on_print(int a) { - std::cout << "on_print recieved: " << a << std::endl; + std::cout << "on_print received: " << a << std::endl; } int From f523c0cc076fe960b3f13112b3ea5359dd7e0e90 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Tue, 17 May 2022 10:45:28 +0200 Subject: [PATCH 032/112] meson.build: Avoid configuration warnings --- meson.build | 42 ++++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/meson.build b/meson.build index ca49138e..376c9bd9 100644 --- a/meson.build +++ b/meson.build @@ -5,7 +5,7 @@ project('libsigc++', 'cpp', license: 'LGPLv2.1+', default_options: [ 'cpp_std=c++17', - 'warning_level=0', + 'warning_level=1', ], meson_version: '>= 0.55.0', # required for meson.add_dist_script(python3, ...) # and meson.add_install_script(python3, ...) @@ -70,10 +70,12 @@ maintainer_mode = maintainer_mode_opt == 'true' or \ if is_dist_check message('Looks like a tarball is being tested. ' + \ 'Option "dist-warnings" is used instead of "warnings".') - warning_level = get_option('dist-warnings') + cpp_warnings = get_option('dist-warnings') else - warning_level = get_option('warnings') + cpp_warnings = get_option('warnings') endif +warning_level = get_option('warning_level').to_int() +werror = get_option('werror') build_deprecated_api = get_option('build-deprecated-api') build_documentation_opt = get_option('build-documentation') build_documentation = build_documentation_opt == 'true' or \ @@ -159,25 +161,24 @@ if not (doc_perl_prop.returncode() == 0 and doc_perl_prop.stdout() == 'false') endif # Set compiler warnings. +# Meson warns if any of the /W1, /W2, /W3, /W4, /Wall, -Wall, -Wextra, -Werror +# compiler options are added with add_project_arguments(). +# Avoid such warnings, when possible. +# See _warn_about_builtin_args() in meson/mesonbuild/interpreter/interpreter.py. warning_flags = [] -if warning_level == 'min' - if is_msvc - warning_flags = ['/W3'] - else - warning_flags = ['-Wall'] +if cpp_warnings == 'min' + if warning_level == 0 + warning_flags = is_msvc ? ['/W2'] : ['-Wall'] + endif +elif cpp_warnings == 'max' or cpp_warnings == 'fatal' + if warning_level < 3 + warning_flags = is_msvc ? ['/W4'] : ['-pedantic', '-Wall', '-Wextra'] endif -elif warning_level == 'max' or warning_level == 'fatal' - if is_msvc - warning_flags = ['/W4'] - else - warning_flags = '-pedantic -Wall -Wextra -Wsuggest-override -Wshadow -Wzero-as-null-pointer-constant -Wformat-security'.split() + if not is_msvc + warning_flags += '-Wsuggest-override -Wshadow -Wzero-as-null-pointer-constant -Wformat-security'.split() endif - if warning_level == 'fatal' - if is_msvc - warning_flags += ['/WX'] - else - warning_flags += ['-Werror'] - endif + if cpp_warnings == 'fatal' and not werror + warning_flags += is_msvc ? ['/WX'] : ['-Werror'] endif endif @@ -307,7 +308,8 @@ summary = [ meson.project_name() + ' ' + meson.project_version(), '', ' Maintainer mode: @0@@1@'.format(maintainer_mode_opt, real_maintainer_mode), - ' Compiler warnings: @0@'.format(warning_level), + ' Compiler warnings: @0@ (warning_level: @1@, werror: @2@)'. \ + format(cpp_warnings, warning_level, werror), ' Build deprecated API: @0@'.format(build_deprecated_api), 'Build HTML documentation: @0@@1@'.format(build_documentation_opt, real_build_documentation), ' XML validation: @0@@1@'.format(validate, explain_val), From 196625df045cf7202da1b57acb39ee8b5a16a982 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Tue, 17 May 2022 10:47:10 +0200 Subject: [PATCH 033/112] CI: Remove some tests with autotools Remove the tests with autotools build and clang 8, clang 9, gcc 8 and gcc 9. Test meson build with gcc 10 instead of gcc 9. --- .github/workflows/autotools-clang-8.yml | 25 ----------------- .github/workflows/autotools-clang-9.yml | 27 ------------------- .github/workflows/autotools-gcc-8.yml | 25 ----------------- .github/workflows/autotools-gcc-9.yml | 25 ----------------- .github/workflows/meson-clang-10.yml | 4 +-- .../{meson-gcc-9.yml => meson-gcc-10.yml} | 10 +++---- 6 files changed, 7 insertions(+), 109 deletions(-) delete mode 100644 .github/workflows/autotools-clang-8.yml delete mode 100644 .github/workflows/autotools-clang-9.yml delete mode 100644 .github/workflows/autotools-gcc-8.yml delete mode 100644 .github/workflows/autotools-gcc-9.yml rename .github/workflows/{meson-gcc-9.yml => meson-gcc-10.yml} (79%) diff --git a/.github/workflows/autotools-clang-8.yml b/.github/workflows/autotools-clang-8.yml deleted file mode 100644 index 908e2f83..00000000 --- a/.github/workflows/autotools-clang-8.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: "CI: autotools: clang 8" - -on: [push] - -jobs: - build: - - runs-on: ubuntu-18.04 - - steps: - - uses: actions/checkout@v1 - - name: Build - run: | - sudo apt update - sudo apt install mm-common clang-8 docbook-xsl - export CXX=clang++-8 - ./autogen.sh --enable-warnings=fatal - make - - name: Test - run: make check - - name: Distcheck - run: | - # distcheck runs configure again so we need to specify CXX again. - export CXX=clang++-8 - make distcheck diff --git a/.github/workflows/autotools-clang-9.yml b/.github/workflows/autotools-clang-9.yml deleted file mode 100644 index 9a0dae77..00000000 --- a/.github/workflows/autotools-clang-9.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: "CI: autotools: clang 9" - -on: [push] - -jobs: - build: - - runs-on: ubuntu-20.04 - - steps: - - uses: actions/checkout@v1 - - name: Build - run: | - # Prevent blocking apt install on a question during configuring of tzdata. - export ENV DEBIAN_FRONTEND=noninteractive - sudo apt update - sudo apt install mm-common clang-9 make docbook-xsl --yes - export CC=clang-9 CXX=clang++-9 - ./autogen.sh --enable-warnings=fatal - make - - name: Test - run: make check - - name: Distcheck - run: | - # distcheck runs configure again so we need to specify CC and CXX again. - export CC=clang-9 CXX=clang++-9 - make distcheck diff --git a/.github/workflows/autotools-gcc-8.yml b/.github/workflows/autotools-gcc-8.yml deleted file mode 100644 index 22c32d43..00000000 --- a/.github/workflows/autotools-gcc-8.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: "CI: autotools: gcc 8" - -on: [push] - -jobs: - build: - - runs-on: ubuntu-18.04 - - steps: - - uses: actions/checkout@v1 - - name: Build - run: | - sudo apt update - sudo apt install mm-common g++-8 docbook-xsl - export CXX=g++-8 - ./autogen.sh --enable-warnings=fatal - make - - name: Test - run: make check - - name: Distcheck - run: | - # distcheck runs configure again so we need to specify CXX again. - export CXX=g++-8 - make distcheck diff --git a/.github/workflows/autotools-gcc-9.yml b/.github/workflows/autotools-gcc-9.yml deleted file mode 100644 index 2ef20b49..00000000 --- a/.github/workflows/autotools-gcc-9.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: "CI: autotools: gcc 9" - -on: [push] - -jobs: - build: - - runs-on: ubuntu-20.04 - - steps: - - uses: actions/checkout@v1 - - name: Build - run: | - sudo apt update - sudo apt install mm-common g++-9 docbook-xsl - export CXX=g++-9 - ./autogen.sh --enable-warnings=fatal - make - - name: Test - run: make check - - name: Distcheck - run: | - # distcheck runs configure again so we need to specify CXX again. - export CXX=g++-9 - make distcheck diff --git a/.github/workflows/meson-clang-10.yml b/.github/workflows/meson-clang-10.yml index 13f611b7..adab1966 100644 --- a/.github/workflows/meson-clang-10.yml +++ b/.github/workflows/meson-clang-10.yml @@ -1,4 +1,4 @@ -name: "CI: meson: clang 10" +name: "meson: clang 10" on: [push] @@ -19,7 +19,7 @@ jobs: # Install it with pip3 instead of apt. sudo pip3 install "meson>=0.55.0" export CXX=clang++-10 - meson -Dwarnings=fatal _build + meson -Dwarnings=fatal -Dwarning_level=3 -Dwerror=true _build cd _build meson compile - name: Test diff --git a/.github/workflows/meson-gcc-9.yml b/.github/workflows/meson-gcc-10.yml similarity index 79% rename from .github/workflows/meson-gcc-9.yml rename to .github/workflows/meson-gcc-10.yml index 96b160f7..46cc6b51 100644 --- a/.github/workflows/meson-gcc-9.yml +++ b/.github/workflows/meson-gcc-10.yml @@ -1,4 +1,4 @@ -name: "CI: meson: gcc 9" +name: "meson: gcc 10" on: [push] @@ -14,12 +14,12 @@ jobs: # Prevent blocking apt install on a question during configuring of tzdata. export ENV DEBIAN_FRONTEND=noninteractive sudo apt update - sudo apt install libxml2-utils docbook5-xml docbook-xsl mm-common g++-9 ninja-build python3-setuptools python3-pip --yes + sudo apt install libxml2-utils docbook5-xml docbook-xsl mm-common g++-10 ninja-build python3-setuptools python3-pip --yes # Ubuntu 20.04 contains meson 0.53.2, but libsigc++ requires meson >= 0.55.0. # Install it with pip3 instead of apt. sudo pip3 install "meson>=0.55.0" - export CXX=g++-9 - meson -Dwarnings=fatal _build + export CXX=g++-10 + meson -Dwarnings=fatal -Dwarning_level=3 -Dwerror=true _build cd _build meson compile - name: Test @@ -30,6 +30,6 @@ jobs: run: | sudo apt install git --yes # dist runs setup again so we need to specify CXX again. - export CXX=g++-9 + export CXX=g++-10 cd _build meson dist From 5d8423cd2b05dc3d952abbe790d259699cbbaecf Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Thu, 19 May 2022 14:05:23 +0200 Subject: [PATCH 034/112] signal::make_slot() docs: Note that signal does not derive from trackable and therefore the made slot must be manually disconnected if the signal is deleted. See #80 --- sigc++/signal.h | 6 ++++++ sigc++/signal_base.h | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/sigc++/signal.h b/sigc++/signal.h index 8f7dadcb..9d6143c4 100644 --- a/sigc++/signal.h +++ b/sigc++/signal.h @@ -461,6 +461,12 @@ class signal_with_accumulator : public signal_base } /** Creates a functor that calls emit() on this signal. + * + * @note %sigc::signal does not derive from sigc::trackable in sigc++3. + * If you connect the returned functor (calling %emit() on signal1) to + * another signal (signal2) and then delete signal1, you must manually + * disconnect signal1 from signal2 before you delete signal1. + * * @code * sigc::mem_fun(mysignal, &sigc::signal_with_accumulator::emit) * @endcode diff --git a/sigc++/signal_base.h b/sigc++/signal_base.h index 3027c69f..aa27bc21 100644 --- a/sigc++/signal_base.h +++ b/sigc++/signal_base.h @@ -266,6 +266,11 @@ struct SIGC_API signal_impl_holder * @ref sigc::signal_with_accumulator::connect() "sigc::signal::connect()". */ +//TODO: When we can break ABI, let signal_base derive from trackable again. +// It does in sigc++2. Otherwise the slot returned from signal::make_slot() +// is not automatically disconnected when the signal is deleted. +// https://github.com/libsigcplusplus/libsigcplusplus/issues/80 + /** Base class for the @ref sigc::signal "sigc::signal" template. * %signal_base integrates most of the interface of the derived * @ref sigc::signal "sigc::signal" template. From 5ba2da6db90d20c0b75349b7cfb65391b51c180f Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Thu, 19 May 2022 14:46:03 +0200 Subject: [PATCH 035/112] Format source code to suit clang-format-12 Format sigc++/signal_base.h. --- sigc++/signal_base.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sigc++/signal_base.h b/sigc++/signal_base.h index aa27bc21..83917820 100644 --- a/sigc++/signal_base.h +++ b/sigc++/signal_base.h @@ -266,7 +266,7 @@ struct SIGC_API signal_impl_holder * @ref sigc::signal_with_accumulator::connect() "sigc::signal::connect()". */ -//TODO: When we can break ABI, let signal_base derive from trackable again. +// TODO: When we can break ABI, let signal_base derive from trackable again. // It does in sigc++2. Otherwise the slot returned from signal::make_slot() // is not automatically disconnected when the signal is deleted. // https://github.com/libsigcplusplus/libsigcplusplus/issues/80 From 10599993cc751a383feeacac61b4d1b2e3c50e79 Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Mon, 23 May 2022 18:56:50 +0800 Subject: [PATCH 036/112] Meson: Compensate for the lack of msvc_recommended_pragmas.h libsigc++ does not depend on GLib, so msvc_recommended_pragmas.h may not be available. If it isn't, disable warning C4244 to compensate for it. --- meson.build | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 376c9bd9..ed21e130 100644 --- a/meson.build +++ b/meson.build @@ -188,7 +188,16 @@ add_project_arguments(warning_flags, language: 'cpp') # MSVC: Ignore warnings that aren't really harmful, but make those # that should not be overlooked stand out. if is_msvc - foreach wd : ['/FImsvc_recommended_pragmas.h', '/EHsc', '/wd4267', '/utf-8'] + # Turn off harmless warnings but make potentially dangerous ones glaring, + # distributed with GLib, if available + use_recommended_pragmas = cpp_compiler.get_supported_arguments('/FImsvc_recommended_pragmas.h') + if use_recommended_pragmas.length() > 0 + add_project_arguments(use_recommended_pragmas, language: 'cpp') + else + disabled_warning = cpp_compiler.get_supported_arguments(['/wd4244']) + add_project_arguments(disabled_warning, language: 'cpp') + endif + foreach wd : ['/EHsc', '/wd4267'] disabled_warning = cpp_compiler.get_supported_arguments(wd) add_project_arguments(disabled_warning, language: 'cpp') endforeach From 8668c3f8e7e09a52d4f6b0c3a389799b2a98a904 Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Mon, 23 May 2022 19:02:03 +0800 Subject: [PATCH 037/112] Meson/MSVC: Re-organize warnings-related compiler flags Add a short description for each of the warnings-related compiler flags that we are using. Also, only apply '/wd4267' for 64-bit builds, since it is a warning that should only be related to 64-bit builds. --- meson.build | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/meson.build b/meson.build index ed21e130..bd1b7713 100644 --- a/meson.build +++ b/meson.build @@ -188,19 +188,28 @@ add_project_arguments(warning_flags, language: 'cpp') # MSVC: Ignore warnings that aren't really harmful, but make those # that should not be overlooked stand out. if is_msvc + disable_warnings_list = [ + '/EHsc', # avoid warnings caused by exception handling model used + ] + # Turn off harmless warnings but make potentially dangerous ones glaring, # distributed with GLib, if available use_recommended_pragmas = cpp_compiler.get_supported_arguments('/FImsvc_recommended_pragmas.h') if use_recommended_pragmas.length() > 0 add_project_arguments(use_recommended_pragmas, language: 'cpp') else - disabled_warning = cpp_compiler.get_supported_arguments(['/wd4244']) - add_project_arguments(disabled_warning, language: 'cpp') + disable_warnings_list += '/wd4244' # 'conversion' conversion from + # 'type1' to 'type2', possible loss of data + endif + + if host_machine.cpu_family() == 'x86_64' or host_machine.cpu_family() == 'aarch64' + # 'var' : conversion from 'size_t' to 'type', possible loss of data (applies on 64-bit builds) + disable_warnings_list += '/wd4267' endif - foreach wd : ['/EHsc', '/wd4267'] - disabled_warning = cpp_compiler.get_supported_arguments(wd) - add_project_arguments(disabled_warning, language: 'cpp') - endforeach + add_project_arguments( + cpp_compiler.get_supported_arguments(disable_warnings_list), + language: 'cpp' + ) endif # Configure files From 8fb78907ccf3c4425d23ba1555f365f22d376685 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Mon, 30 May 2022 16:14:55 +0200 Subject: [PATCH 038/112] signal_with_accumulator derives from trackable A slot made with signal_with_accumulator::make_slot() is then automatically disconnected when the signal is deleted, as in sigc++2. Fixes #80 --- sigc++/signal.h | 32 ++++++++++++++++++++++---------- sigc++/signal_base.h | 7 ++++--- tests/test_signal.cc | 12 ++++++++++++ 3 files changed, 38 insertions(+), 13 deletions(-) diff --git a/sigc++/signal.h b/sigc++/signal.h index 9d6143c4..4a17e06f 100644 --- a/sigc++/signal.h +++ b/sigc++/signal.h @@ -371,8 +371,14 @@ struct signal_emit } /* namespace internal */ +// TODO: When we can break ABI, let signal_base instead of signal_with_accumulator +// derive from trackable, as in sigc++2. One of them must derive from trackable. +// Otherwise the slot returned from signal_with_accumulator::make_slot() is not +// automatically disconnected when the signal is deleted. +// https://github.com/libsigcplusplus/libsigcplusplus/issues/80 + /** Signal declaration. - * signal_with_accumulator can be used to connect() slots that are invoked + * %signal_with_accumulator can be used to connect() slots that are invoked * during subsequent calls to emit(). Any functor or slot * can be passed into connect(). It is converted into a slot * implicitly. @@ -396,7 +402,9 @@ struct signal_emit * @ingroup signal */ template -class signal_with_accumulator : public signal_base +class signal_with_accumulator +: public signal_base +, public trackable { public: using slot_type = slot; @@ -461,11 +469,6 @@ class signal_with_accumulator : public signal_base } /** Creates a functor that calls emit() on this signal. - * - * @note %sigc::signal does not derive from sigc::trackable in sigc++3. - * If you connect the returned functor (calling %emit() on signal1) to - * another signal (signal2) and then delete signal1, you must manually - * disconnect signal1 from signal2 before you delete signal1. * * @code * sigc::mem_fun(mysignal, &sigc::signal_with_accumulator::emit) @@ -485,19 +488,28 @@ class signal_with_accumulator : public signal_base signal_with_accumulator() = default; - signal_with_accumulator(const signal_with_accumulator& src) : signal_base(src) {} + signal_with_accumulator(const signal_with_accumulator& src) : signal_base(src), trackable(src) {} - signal_with_accumulator(signal_with_accumulator&& src) : signal_base(std::move(src)) {} + signal_with_accumulator(signal_with_accumulator&& src) + : signal_base(std::move(src)), trackable(std::move(src)) + { + } signal_with_accumulator& operator=(const signal_with_accumulator& src) { signal_base::operator=(src); + // Don't call trackable::operator=(src). + // It calls notify_callbacks(). This signal is not destroyed. return *this; } signal_with_accumulator& operator=(signal_with_accumulator&& src) { signal_base::operator=(std::move(src)); + if (src.impl_ != impl_) + src.notify_callbacks(); + // Don't call trackable::operator=(std::move(src)). + // It calls notify_callbacks(). This signal is not destroyed. return *this; } }; @@ -531,7 +543,7 @@ class signal_with_accumulator : public signal_base * @par Example: * @code * void foo(int) {} - * sigc::signal sig; + * sigc::signal sig; * sig.connect(sigc::ptr_fun(&foo)); * sig.emit(19); * @endcode diff --git a/sigc++/signal_base.h b/sigc++/signal_base.h index 83917820..a6da7d33 100644 --- a/sigc++/signal_base.h +++ b/sigc++/signal_base.h @@ -266,9 +266,10 @@ struct SIGC_API signal_impl_holder * @ref sigc::signal_with_accumulator::connect() "sigc::signal::connect()". */ -// TODO: When we can break ABI, let signal_base derive from trackable again. -// It does in sigc++2. Otherwise the slot returned from signal::make_slot() -// is not automatically disconnected when the signal is deleted. +// TODO: When we can break ABI, let signal_base instead of signal_with_accumulator +// derive from trackable, as in sigc++2. One of them must derive from trackable. +// Otherwise the slot returned from signal_with_accumulator::make_slot() is not +// automatically disconnected when the signal is deleted. // https://github.com/libsigcplusplus/libsigcplusplus/issues/80 /** Base class for the @ref sigc::signal "sigc::signal" template. diff --git a/tests/test_signal.cc b/tests/test_signal.cc index d050558b..34a8c7d6 100644 --- a/tests/test_signal.cc +++ b/tests/test_signal.cc @@ -5,6 +5,7 @@ #include "testutilities.h" #include #include +#include namespace { @@ -110,6 +111,17 @@ test_make_slot() sig2.connect(sig.make_slot()); sig2(3); util->check_result(result_stream, "foo(int 3) bar(float 3) foo(int 3) "); + + // Delete a signal that has been connected to sig2. + sig2.clear(); + sig2.connect(sigc::ptr_fun(&bar)); + auto sig3 = std::make_unique>(); + sig3->connect(sigc::ptr_fun(&foo)); + sig2.connect(sig3->make_slot()); + sig2(2); + sig3.reset(); + sig2(42); + util->check_result(result_stream, "bar(float 2) foo(int 2) bar(float 42) "); } void From d6271316157b6478aca068b6f972da7e839fe90a Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Mon, 30 May 2022 18:38:28 +0200 Subject: [PATCH 039/112] test_limit_reference.cc: Don't use auto where a slot is required The return values of sigc::bind() and sigc::bind_return() shall be converted to sigc::slot, otherwise automatic disconnection does not work. Fixes #44 --- tests/test_limit_reference.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/test_limit_reference.cc b/tests/test_limit_reference.cc index 8d1340d6..a115d6dc 100644 --- a/tests/test_limit_reference.cc +++ b/tests/test_limit_reference.cc @@ -14,6 +14,8 @@ class Base : virtual public sigc::trackable public: Base() {} + Base(const Base& src) = default; + Base& operator=(const Base& src) = default; Base(Base&& src) = delete; Base& operator=(Base&& src) = delete; }; @@ -47,11 +49,11 @@ main(int argc, char* argv[]) handler(); util->check_result(result_stream, "method()"); - auto param = sigc::bind(sigc::slot(), std::ref(*instance)); + sigc::slot param = sigc::bind(sigc::slot(), std::ref(*instance)); param(); util->check_result(result_stream, ""); - auto ret = sigc::bind_return(sigc::slot(), std::ref(*instance)); + sigc::slot ret = sigc::bind_return(sigc::slot(), std::ref(*instance)); ret(); util->check_result(result_stream, ""); From c07d75d47dd0374e437c8ba6f4c4816d4b7f89e1 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Tue, 31 May 2022 15:30:15 +0200 Subject: [PATCH 040/112] Revert "signal_with_accumulator derives from trackable" This reverts commit 8fb78907ccf3c4425d23ba1555f365f22d376685. It's not safe. See #80 --- sigc++/signal.h | 32 ++++++++++---------------------- sigc++/signal_base.h | 7 +++---- tests/test_signal.cc | 12 ------------ 3 files changed, 13 insertions(+), 38 deletions(-) diff --git a/sigc++/signal.h b/sigc++/signal.h index 4a17e06f..9d6143c4 100644 --- a/sigc++/signal.h +++ b/sigc++/signal.h @@ -371,14 +371,8 @@ struct signal_emit } /* namespace internal */ -// TODO: When we can break ABI, let signal_base instead of signal_with_accumulator -// derive from trackable, as in sigc++2. One of them must derive from trackable. -// Otherwise the slot returned from signal_with_accumulator::make_slot() is not -// automatically disconnected when the signal is deleted. -// https://github.com/libsigcplusplus/libsigcplusplus/issues/80 - /** Signal declaration. - * %signal_with_accumulator can be used to connect() slots that are invoked + * signal_with_accumulator can be used to connect() slots that are invoked * during subsequent calls to emit(). Any functor or slot * can be passed into connect(). It is converted into a slot * implicitly. @@ -402,9 +396,7 @@ struct signal_emit * @ingroup signal */ template -class signal_with_accumulator -: public signal_base -, public trackable +class signal_with_accumulator : public signal_base { public: using slot_type = slot; @@ -469,6 +461,11 @@ class signal_with_accumulator } /** Creates a functor that calls emit() on this signal. + * + * @note %sigc::signal does not derive from sigc::trackable in sigc++3. + * If you connect the returned functor (calling %emit() on signal1) to + * another signal (signal2) and then delete signal1, you must manually + * disconnect signal1 from signal2 before you delete signal1. * * @code * sigc::mem_fun(mysignal, &sigc::signal_with_accumulator::emit) @@ -488,28 +485,19 @@ class signal_with_accumulator signal_with_accumulator() = default; - signal_with_accumulator(const signal_with_accumulator& src) : signal_base(src), trackable(src) {} + signal_with_accumulator(const signal_with_accumulator& src) : signal_base(src) {} - signal_with_accumulator(signal_with_accumulator&& src) - : signal_base(std::move(src)), trackable(std::move(src)) - { - } + signal_with_accumulator(signal_with_accumulator&& src) : signal_base(std::move(src)) {} signal_with_accumulator& operator=(const signal_with_accumulator& src) { signal_base::operator=(src); - // Don't call trackable::operator=(src). - // It calls notify_callbacks(). This signal is not destroyed. return *this; } signal_with_accumulator& operator=(signal_with_accumulator&& src) { signal_base::operator=(std::move(src)); - if (src.impl_ != impl_) - src.notify_callbacks(); - // Don't call trackable::operator=(std::move(src)). - // It calls notify_callbacks(). This signal is not destroyed. return *this; } }; @@ -543,7 +531,7 @@ class signal_with_accumulator * @par Example: * @code * void foo(int) {} - * sigc::signal sig; + * sigc::signal sig; * sig.connect(sigc::ptr_fun(&foo)); * sig.emit(19); * @endcode diff --git a/sigc++/signal_base.h b/sigc++/signal_base.h index a6da7d33..83917820 100644 --- a/sigc++/signal_base.h +++ b/sigc++/signal_base.h @@ -266,10 +266,9 @@ struct SIGC_API signal_impl_holder * @ref sigc::signal_with_accumulator::connect() "sigc::signal::connect()". */ -// TODO: When we can break ABI, let signal_base instead of signal_with_accumulator -// derive from trackable, as in sigc++2. One of them must derive from trackable. -// Otherwise the slot returned from signal_with_accumulator::make_slot() is not -// automatically disconnected when the signal is deleted. +// TODO: When we can break ABI, let signal_base derive from trackable again. +// It does in sigc++2. Otherwise the slot returned from signal::make_slot() +// is not automatically disconnected when the signal is deleted. // https://github.com/libsigcplusplus/libsigcplusplus/issues/80 /** Base class for the @ref sigc::signal "sigc::signal" template. diff --git a/tests/test_signal.cc b/tests/test_signal.cc index 34a8c7d6..d050558b 100644 --- a/tests/test_signal.cc +++ b/tests/test_signal.cc @@ -5,7 +5,6 @@ #include "testutilities.h" #include #include -#include namespace { @@ -111,17 +110,6 @@ test_make_slot() sig2.connect(sig.make_slot()); sig2(3); util->check_result(result_stream, "foo(int 3) bar(float 3) foo(int 3) "); - - // Delete a signal that has been connected to sig2. - sig2.clear(); - sig2.connect(sigc::ptr_fun(&bar)); - auto sig3 = std::make_unique>(); - sig3->connect(sigc::ptr_fun(&foo)); - sig2.connect(sig3->make_slot()); - sig2(2); - sig3.reset(); - sig2(42); - util->check_result(result_stream, "bar(float 2) foo(int 2) bar(float 42) "); } void From 560f800e45329ad55b1f5b0a05a80ad63164da48 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Tue, 31 May 2022 16:57:50 +0200 Subject: [PATCH 041/112] Add trackable_signal_with_accumulator and trackable_signal trackable_signal_with_accumulator derives from trackable. A slot made with trackable_signal_with_accumulator::make_slot() is automatically disconnected when the signal is deleted, as in sigc++2. Fixes #80 --- sigc++/signal.h | 291 +++++++++++++++++++++++++++++++++++++- sigc++/signal_base.h | 5 +- tests/test_accumulated.cc | 6 +- tests/test_signal.cc | 18 ++- 4 files changed, 308 insertions(+), 12 deletions(-) diff --git a/sigc++/signal.h b/sigc++/signal.h index 9d6143c4..8cddf103 100644 --- a/sigc++/signal.h +++ b/sigc++/signal.h @@ -372,7 +372,7 @@ struct signal_emit } /* namespace internal */ /** Signal declaration. - * signal_with_accumulator can be used to connect() slots that are invoked + * %signal_with_accumulator can be used to connect() slots that are invoked * during subsequent calls to emit(). Any functor or slot * can be passed into connect(). It is converted into a slot * implicitly. @@ -462,10 +462,11 @@ class signal_with_accumulator : public signal_base /** Creates a functor that calls emit() on this signal. * - * @note %sigc::signal does not derive from sigc::trackable in sigc++3. - * If you connect the returned functor (calling %emit() on signal1) to - * another signal (signal2) and then delete signal1, you must manually + * @note %sigc::signal does not derive from sigc::trackable. + * If you connect the returned functor that calls %emit() on signal1, + * to another signal (signal2) and then delete signal1, you must manually * disconnect signal1 from signal2 before you delete signal1. + * Alternatively, make a slot of a sigc::trackable_signal. * * @code * sigc::mem_fun(mysignal, &sigc::signal_with_accumulator::emit) @@ -517,7 +518,8 @@ class signal_with_accumulator : public signal_base * * The template arguments determine the function signature of * the emit() function: - * - @e T_return The desired return type of the emit() function. * - @e T_arg Argument types used in + * - @e T_return The desired return type of the emit() function. + * - @e T_arg Argument types used in * the definition of emit(). * * For instance, to declare a signal whose connected slot returns void and takes @@ -531,7 +533,7 @@ class signal_with_accumulator : public signal_base * @par Example: * @code * void foo(int) {} - * sigc::signal sig; + * sigc::signal sig; * sig.connect(sigc::ptr_fun(&foo)); * sig.emit(19); * @endcode @@ -625,6 +627,283 @@ class signal : public signal_with_accumulator +class trackable_signal_with_accumulator +: public signal_base +, public trackable +{ +public: + using slot_type = slot; + + /** Add a slot to the list of slots. + * Any functor or slot may be passed into connect(). + * It will be converted into a slot implicitly. + * The returned connection may be stored for disconnection + * of the slot at some later point. It stays valid until + * the slot is disconnected from the signal. + * std::function<> and C++11 lambda expressions are functors. + * These are examples of functors that can be connected to a signal. + * + * %std::bind() creates a functor, but this functor typically has an + * %operator()() which is a variadic template. + * Our functor_trait can't deduce the result type + * of such a functor. If you first assign the return value of %std::bind() + * to a std::function, you can connect the std::function to a signal. + * + * @param slot_ The slot to add to the list of slots. + * @return A connection. + */ + connection connect(const slot_type& slot_) + { + auto iter = signal_base::connect(slot_); + auto& slot_base = *iter; + return connection(slot_base); + } + + /** Add a slot to the list of slots. + * @see connect(const slot_type& slot_). + */ + connection connect(slot_type&& slot_) + { + auto iter = signal_base::connect(std::move(slot_)); + auto& slot_base = *iter; + return connection(slot_base); + } + + /** Triggers the emission of the signal. + * During signal emission all slots that have been connected + * to the signal are invoked unless they are manually set into + * a blocking state. The parameters are passed on to the slots. + * If @e T_accumulated is not @p void, an accumulator of this type + * is used to process the return values of the slot invocations. + * Otherwise, the return value of the last slot invoked is returned. + * @param a Arguments to be passed on to the slots. + * @return The accumulated return values of the slot invocations. + */ + decltype(auto) emit(type_trait_take_t... a) const + { + using emitter_type = internal::signal_emit; + return emitter_type::emit(impl_, std::forward>(a)...); + } + + /** Triggers the emission of the signal (see emit()). */ + decltype(auto) operator()(type_trait_take_t... a) const + { + return emit(std::forward>(a)...); + } + + /** Creates a functor that calls emit() on this signal. + * + * @code + * sigc::mem_fun(mysignal, &sigc::trackable_signal_with_accumulator::emit) + * @endcode + * yields the same result. + * @return A functor that calls emit() on this signal. + */ + decltype(auto) make_slot() const + { + // TODO: Instead use std::invoke_result<> on the static emitter_type::emit() + using result_type = typename internal::member_method_result< + decltype(&trackable_signal_with_accumulator::emit)>::type; + return bound_mem_functor...) const, + type_trait_take_t...>(*this, &trackable_signal_with_accumulator::emit); + } + + trackable_signal_with_accumulator() = default; + + trackable_signal_with_accumulator(const trackable_signal_with_accumulator& src) + : signal_base(src), trackable(src) + { + } + + trackable_signal_with_accumulator(trackable_signal_with_accumulator&& src) + : signal_base(std::move(src)), trackable(std::move(src)) + { + } + + trackable_signal_with_accumulator& operator=(const trackable_signal_with_accumulator& src) + { + signal_base::operator=(src); + // Don't call trackable::operator=(src). + // It calls notify_callbacks(). This signal is not destroyed. + return *this; + } + + trackable_signal_with_accumulator& operator=(trackable_signal_with_accumulator&& src) + { + signal_base::operator=(std::move(src)); + if (src.impl_ != impl_) + src.notify_callbacks(); + // Don't call trackable::operator=(std::move(src)). + // It calls notify_callbacks(). This signal is not destroyed. + return *this; + } +}; + +/** %trackable_signal can be used to connect() slots that are invoked + * during subsequent calls to emit(). Any functor or slot + * can be passed into connect(). It is converted into a slot + * implicitly. + * + * If you want to connect one signal to another, use make_slot() + * to retrieve a functor that emits the signal when invoked. + * + * Be careful if you directly pass one signal into the connect() + * method of another: a shallow copy of the signal is made and + * the signal's slots are not disconnected until both the signal + * and its clone are destroyed, which is probably not what you want! + * + * The template arguments determine the function signature of + * the emit() function: + * - @e T_return The desired return type of the emit() function. + * - @e T_arg Argument types used in + * the definition of emit(). + * + * For instance, to declare a %trackable_signal whose connected slot returns void and takes + * two parameters of bool and int: + * @code + * sigc::trackable_signal some_signal; + * @endcode + * + * To specify an accumulator type the nested class trackable_signal::accumulated can be used. + * + * @par Example: + * @code + * void foo(int) {} + * sigc::trackable_signal sig; + * sig.connect(sigc::ptr_fun(&foo)); + * sig.emit(19); + * @endcode + * + * @newin{3,4} + * + * @ingroup signal + */ +#ifndef DOXYGEN_SHOULD_SKIP_THIS +template +class trackable_signal; +#endif // DOXYGEN_SHOULD_SKIP_THIS + +template +class trackable_signal +: public trackable_signal_with_accumulator +{ +public: + using accumulator_type = void; + + /** Like @ref sigc::trackable_signal "sigc::trackable_signal" + * but the additional template parameter @e T_accumulator defines the accumulator + * type that should be used. + * + * An accumulator is a functor that uses a pair of special iterators + * to step through a list of slots and calculate a return value + * from the results of the slot invocations. The iterators' operator*() + * executes the slot. The return value is buffered, so that in an expression + * like @code a = (*i) * (*i); @endcode the slot is executed only once. + * + * @par Example 1: + * This accumulator calculates the arithmetic mean value: + * @code + * struct arithmetic_mean_accumulator + * { + * template + * double operator()(T_iterator first, T_iterator last) const + * { + * double value_ = 0; + * int n_ = 0; + * for (; first != last; ++first, ++n_) + * value_ += *first; + * return value_ / n_; + * } + * }; + * @endcode + * + * @par Example 2: + * This accumulator stops signal emission when a slot returns zero: + * @code + * struct interruptable_accumulator + * { + * template + * bool operator()(T_iterator first, T_iterator last) const + * { + * for (; first != last; ++first, ++n_) + * if (!*first) return false; + * return true; + * } + * }; + * @endcode + * + * @newin{3,4} + * + * @ingroup signal + */ + template + class accumulated : public trackable_signal_with_accumulator + { + public: + accumulated() = default; + accumulated(const accumulated& src) + : trackable_signal_with_accumulator(src) + { + } + }; + + trackable_signal() = default; + + trackable_signal(const trackable_signal& src) + : trackable_signal_with_accumulator(src) + { + } + + trackable_signal(trackable_signal&& src) + : trackable_signal_with_accumulator(std::move(src)) + { + } + + trackable_signal& operator=(const trackable_signal& src) + { + trackable_signal_with_accumulator::operator=(src); + return *this; + } + + trackable_signal& operator=(trackable_signal&& src) + { + trackable_signal_with_accumulator::operator=( + std::move(src)); + return *this; + } +}; + } /* namespace sigc */ #endif /* SIGC_SIGNAL_H */ diff --git a/sigc++/signal_base.h b/sigc++/signal_base.h index 83917820..d21e4b3b 100644 --- a/sigc++/signal_base.h +++ b/sigc++/signal_base.h @@ -266,9 +266,10 @@ struct SIGC_API signal_impl_holder * @ref sigc::signal_with_accumulator::connect() "sigc::signal::connect()". */ -// TODO: When we can break ABI, let signal_base derive from trackable again. -// It does in sigc++2. Otherwise the slot returned from signal::make_slot() +// TODO: When we can break ABI, let signal_base derive from trackable again, +// as in sigc++2. Otherwise the slot returned from signal::make_slot() // is not automatically disconnected when the signal is deleted. +// And delete trackable_signal_with_accumulator and trackable_signal. // https://github.com/libsigcplusplus/libsigcplusplus/issues/80 /** Base class for the @ref sigc::signal "sigc::signal" template. diff --git a/tests/test_accumulated.cc b/tests/test_accumulated.cc index f010b1cd..39122b50 100644 --- a/tests/test_accumulated.cc +++ b/tests/test_accumulated.cc @@ -79,10 +79,11 @@ test_empty_signal() util->check_result(result_stream, "Vector result (empty slot list): empty"); } +template void test_mean() { - sigc::signal::accumulated sig; + typename T_signal::accumulated sig; A a; sig.connect(sigc::ptr_fun(&foo)); @@ -137,7 +138,8 @@ main(int argc, char* argv[]) return util->get_result_and_delete_instance() ? EXIT_SUCCESS : EXIT_FAILURE; test_empty_signal(); - test_mean(); + test_mean>(); + test_mean>(); test_vector_accumulator(); return util->get_result_and_delete_instance() ? EXIT_SUCCESS : EXIT_FAILURE; diff --git a/tests/test_signal.cc b/tests/test_signal.cc index d050558b..ff197a4d 100644 --- a/tests/test_signal.cc +++ b/tests/test_signal.cc @@ -5,6 +5,7 @@ #include "testutilities.h" #include #include +#include namespace { @@ -62,11 +63,12 @@ bar(float i) return 1; } +template void test_auto_disconnection() { // signal - sigc::signal sig; + T_signal sig; // connect some slots before emitting & test auto-disconnection { @@ -110,6 +112,17 @@ test_make_slot() sig2.connect(sig.make_slot()); sig2(3); util->check_result(result_stream, "foo(int 3) bar(float 3) foo(int 3) "); + + // Delete a trackable_signal that has been connected to sig2. + sig2.clear(); + sig2.connect(sigc::ptr_fun(&bar)); + auto sig3 = std::make_unique>(); + sig3->connect(sigc::ptr_fun(&foo)); + sig2.connect(sig3->make_slot()); + sig2(2); + sig3.reset(); + sig2(42); + util->check_result(result_stream, "bar(float 2) foo(int 2) bar(float 42) "); } void @@ -158,7 +171,8 @@ main(int argc, char* argv[]) test_empty_signal(); test_simple(); - test_auto_disconnection(); + test_auto_disconnection>(); + test_auto_disconnection>(); test_reference(); test_make_slot(); test_clear_called_in_signal_handler(); From 12cab9493107f8c65da1bccc1a4b3961b51c6fe3 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Tue, 31 May 2022 17:24:51 +0200 Subject: [PATCH 042/112] test_accumulated.cc: clang++ requires another 'template' --- tests/test_accumulated.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_accumulated.cc b/tests/test_accumulated.cc index 39122b50..7fa81cc9 100644 --- a/tests/test_accumulated.cc +++ b/tests/test_accumulated.cc @@ -83,7 +83,7 @@ template void test_mean() { - typename T_signal::accumulated sig; + typename T_signal::template accumulated sig; A a; sig.connect(sigc::ptr_fun(&foo)); From 83422a7a5d60cbc7a575146e7fd99f4446df9426 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Wed, 20 Jul 2022 21:53:12 +0200 Subject: [PATCH 043/112] Update README.md --- README.md | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index ecbb21f3..5ffed357 100644 --- a/README.md +++ b/README.md @@ -7,8 +7,11 @@ allows you to define signals and to connect those signals to any callback function, either global or a member function, regardless of whether it is static or virtual. -libsigc++ is used by gtkmm to wrap the GTK+ signal system. It does not -depend on GTK+ or gtkmm. +libsigc++ is used by gtkmm to wrap the GTK signal system. It does not +depend on GTK or gtkmm. + +sigc++-2.0 and sigc++-3.0 are different parallel-installable ABIs. +This file describes sigc++-3.0. See the [libsigc++ web site](https://libsigcplusplus.github.io/libsigcplusplus/) @@ -31,7 +34,8 @@ packages. ## Building from a release tarball -Building from the [libsigc++ release tarball](https://github.com/libsigcplusplus/libsigcplusplus/releases) is easier than building from git. +Building from the [libsigc++ release tarball](https://github.com/libsigcplusplus/libsigcplusplus/releases) +is easier than building from git. It's easiest to build with Meson, if the tarball was made with Meson, and to build with Autotools, if the tarball was made with Autotools. @@ -50,10 +54,10 @@ For instance: ```sh # If the tarball was made with Autotools, and you want to rebuild the reference # documentation, you must enable maintainer-mode: -$ meson --prefix=/usr/local --libdir=lib -Dmaintainer-mode=true your_builddir . +$ meson --prefix=/some_directory --libdir=lib -Dmaintainer-mode=true your_builddir . # If the tarball was made with Meson, or you don't want to rebuild the docs: -$ meson --prefix=/usr/local --libdir=lib your_builddir . +$ meson --prefix=/some_directory --libdir=lib your_builddir . # then: $ cd your_builddir @@ -68,10 +72,10 @@ $ ninja test For instance: ```sh # If the tarball was made with Autotools: -$ ./configure --prefix=/usr/local +$ ./configure --prefix=/some_directory # If the tarball was made with Meson, you must enable maintainer-mode: -$ ./autogen.sh --prefix=/usr/local +$ ./autogen.sh --prefix=/some_directory # then: $ make @@ -85,8 +89,9 @@ $ make check Building from git can be difficult so you should prefer building from a release tarball unless you need to work on the libsigc++ code itself. -jhbuild can be a good help. See the [jhbuild repo](https://gitlab.gnome.org/GNOME/jhbuild) -and the [jhbuild wiki](https://wiki.gnome.org/Projects/Jhbuild). +jhbuild can be a good help. See the [jhbuild repo](https://gitlab.gnome.org/GNOME/jhbuild), +the [jhbuild wiki](https://wiki.gnome.org/Projects/Jhbuild) and +the [jhbuild manual](https://gnome.pages.gitlab.gnome.org/jhbuild). ### Building from git with Meson @@ -100,7 +105,7 @@ Don't call the builddir 'build'. There is a directory called 'build' with files used by Autotools. ```sh -$ meson --prefix=/usr/local --libdir=lib your_builddir . +$ meson --prefix=/some_directory --libdir=lib your_builddir . $ cd your_builddir $ ninja $ ninja install @@ -116,7 +121,7 @@ You must have Autotools properly installed (autoconf, automake, etc) and you will also need [mm-common](https://gitlab.gnome.org/GNOME/mm-common/). ```sh -$ ./autogen.sh --prefix=/usr/local +$ ./autogen.sh --prefix=/some_directory $ make $ make install # You can build the examples and tests, and run the tests, like so: From 10dd1c73b2bb86dcafb55c411707ebe2d68bf4df Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Mon, 15 Aug 2022 16:20:30 +0200 Subject: [PATCH 044/112] Fix build with -Dbuild-deprecated-api=false Fixes #82 --- examples/meson.build | 2 +- meson.build | 2 +- tests/test_cpp11_lambda.cc | 12 ++++++------ tests/test_track_obj.cc | 29 ++++++++++++++++++++++++++++- 4 files changed, 36 insertions(+), 9 deletions(-) diff --git a/examples/meson.build b/examples/meson.build index c55bfdd8..3c575aec 100644 --- a/examples/meson.build +++ b/examples/meson.build @@ -20,7 +20,7 @@ foreach ex : examples endforeach exe_file = executable(ex_name, ex_sources, - cpp_args: '-DSIGCXX_DISABLE_DEPRECATED', + cpp_args: '-DSIGCXX_DISABLE_DEPRECATED=1', dependencies: sigcxx_own_dep, implicit_include_directories: false, build_by_default: build_examples diff --git a/meson.build b/meson.build index bd1b7713..c1b0c906 100644 --- a/meson.build +++ b/meson.build @@ -225,7 +225,7 @@ pkg_conf_data.set('PACKAGE_VERSION', meson.project_version()) pkg_conf_data.set('SIGCXX_API_VERSION', sigcxx_api_version) if not build_deprecated_api - pkg_conf_data.set('SIGCXX_DISABLE_DEPRECATED', true) + pkg_conf_data.set('SIGCXX_DISABLE_DEPRECATED', 1) endif pkg_conf_data.set('SIGCXX_MAJOR_VERSION', sigcxx_major_version) pkg_conf_data.set('SIGCXX_MINOR_VERSION', sigcxx_minor_version) diff --git a/tests/test_cpp11_lambda.cc b/tests/test_cpp11_lambda.cc index ed125361..40534e25 100644 --- a/tests/test_cpp11_lambda.cc +++ b/tests/test_cpp11_lambda.cc @@ -32,7 +32,7 @@ // The only real disadvantage of the C++11 lambda expressions is that a slot that // contains an object derived from sigc::trackable is not automatically disconnected // when the object is deleted, if a reference to the object is stored in a C++11 -// lambda expression, connected to the slot. But if you use sigc::track_obj(), +// lambda expression, connected to the slot. But if you use sigc::track_object(), // the slot is automatically disconnected. Thus, the disadvantage is insignificant. // // To test the C++11 lambda expressions with gcc 4.6.3 (and probably some later @@ -270,14 +270,14 @@ main(int argc, char* argv[]) // Here's an area where the libsigc++ lambda expressions are advantageous. // If you want to auto-disconnect a slot with a C++11 lambda expression // that contains references to sigc::trackable-derived objects, you must use - // sigc::track_obj(). + // sigc::track_object(). sigc::slot sl1; { book guest_book("karl"); // sl1 = (sigc::var(std::cout) << std::ref(guest_book) << sigc::var("\n")); // sl1 = [&guest_book](std::ostringstream& stream){ stream << guest_book << "\n"; }; // no // auto-disconnect - sl1 = sigc::track_obj( + sl1 = sigc::track_object( [&guest_book](std::ostringstream& stream) { stream << guest_book << "\n"; }, guest_book); sl1(result_stream); util->check_result(result_stream, "karl\n"); @@ -332,7 +332,7 @@ main(int argc, char* argv[]) // sl2 = sigc::group(&egon, std::ref(guest_book)); // sl2 = [&guest_book] () { egon(guest_book); }; // no auto-disconnect // sl2 = std::bind(&egon, std::ref(guest_book)); // does not compile (gcc 4.6.3) - sl2 = sigc::track_obj([&guest_book]() { egon(guest_book); }, guest_book); + sl2 = sigc::track_object([&guest_book]() { egon(guest_book); }, guest_book); sl2(); util->check_result(result_stream, "egon(string 'karl')"); @@ -352,7 +352,7 @@ main(int argc, char* argv[]) // sl2 = std::bind(&egon, std::ref(guest_book)); // does not compile (gcc 4.6.3) auto fn2 = std::bind(&egon, std::ref(guest_book)); // sl2 = fn2; // no auto-disconnect - sl2 = sigc::track_obj(fn2, guest_book); + sl2 = sigc::track_object(fn2, guest_book); sl2(); util->check_result(result_stream, "egon(string 'charlie')"); @@ -502,7 +502,7 @@ main(int argc, char* argv[]) // some_signal.connect([&some_bar](){ foo_group4(some_bar); }); // no auto-disconnect // some_signal.connect(sigc::bind(&foo_group4, std::ref(some_bar))); // auto-disconnects, but // we prefer C++11 lambda - some_signal.connect(sigc::track_obj([&some_bar]() { foo_group4(some_bar); }, some_bar)); + some_signal.connect(sigc::track_object([&some_bar]() { foo_group4(some_bar); }, some_bar)); some_signal.emit(); util->check_result(result_stream, "foo_group4(bar_group4&)"); } diff --git a/tests/test_track_obj.cc b/tests/test_track_obj.cc index 54b44309..5d919534 100644 --- a/tests/test_track_obj.cc +++ b/tests/test_track_obj.cc @@ -28,6 +28,12 @@ // // If test_track_obj writes nothing and the return code is 0, the test has passed. +// sigc::track_obj() is deprecated, but let's keep the test if possible. +// If libsigc++ is configured with -Dbuild-deprecated-api=false +// (--disable-deprecated-api), SIGCXX_DISABLE_DEPRECATED is defined in +// sigc++config.h. An undef at the start of this file has no effect. +#undef SIGCXX_DISABLE_DEPRECATED + #include "testutilities.h" #include #include @@ -118,7 +124,11 @@ main(int argc, char* argv[]) sigc::slot sl2; { bar_group4 bar4; +#ifndef SIGCXX_DISABLE_DEPRECATED sl1 = sigc::track_obj(Functor1(bar4), bar4); +#else + sl1 = sigc::track_object(Functor1(bar4), bar4); +#endif sl2 = sigc::track_object(Functor1(bar4), bar4); result_stream << sl1(-2) << ", " << sl2(2); util->check_result(result_stream, "negative, positive"); @@ -134,7 +144,11 @@ main(int argc, char* argv[]) auto psl4 = new sigc::slot; auto pbar4 = new bar_group4; auto pbook4 = new book("A Book"); +#ifndef SIGCXX_DISABLE_DEPRECATED *psl3 = sigc::track_obj(Functor2(*pbar4, *pbook4), *pbar4, *pbook4); +#else + *psl3 = sigc::track_object(Functor2(*pbar4, *pbook4), *pbar4, *pbook4); +#endif *psl4 = sigc::track_object(Functor2(*pbar4, *pbook4), *pbar4, *pbook4); result_stream << (*psl3)(0, "Book title: ") << ", " << (*psl4)(1, "Title: "); util->check_result(result_stream, "zero, Book title: A Book, positive, Title: A Book"); @@ -162,8 +176,13 @@ main(int argc, char* argv[]) book guest_book("karl"); // no auto-disconnect // sl1 = [&guest_book](std::ostringstream& stream){ stream << guest_book << "\n"; }; +#ifndef SIGCXX_DISABLE_DEPRECATED sl11 = sigc::track_obj( [&guest_book](std::ostringstream& stream) { stream << guest_book; }, guest_book); +#else + sl11 = sigc::track_object( + [&guest_book](std::ostringstream& stream) { stream << guest_book; }, guest_book); +#endif sl12 = sigc::track_object( [&guest_book](std::ostringstream& stream) { stream << guest_book; }, guest_book); sl11(result_stream); @@ -183,8 +202,12 @@ main(int argc, char* argv[]) book guest_book("karl"); // sl2 = [&guest_book] () { egon(guest_book); }; // no auto-disconnect // sl2 = std::bind(&egon, std::ref(guest_book)); // does not compile (gcc 4.6.3) +#ifndef SIGCXX_DISABLE_DEPRECATED sl21 = sigc::track_obj([&guest_book]() { egon(guest_book); }, guest_book); - sl22 = sigc::track_obj([&guest_book]() { egon(guest_book); }, guest_book); +#else + sl21 = sigc::track_object([&guest_book]() { egon(guest_book); }, guest_book); +#endif + sl22 = sigc::track_object([&guest_book]() { egon(guest_book); }, guest_book); sl21(); sl22(); util->check_result(result_stream, "egon(string 'karl')egon(string 'egon was here')"); @@ -208,7 +231,11 @@ main(int argc, char* argv[]) // some_signal.connect([&some_bar](){ foo_group4(some_bar); }); // no auto-disconnect // some_signal.connect(sigc::bind(&foo_group4, std::ref(some_bar))); // auto-disconnects, // but we prefer C++11 lambda +#ifndef SIGCXX_DISABLE_DEPRECATED some_signal.connect(sigc::track_obj([&some_bar]() { foo_group4(some_bar); }, some_bar)); +#else + some_signal.connect(sigc::track_object([&some_bar]() { foo_group4(some_bar); }, some_bar)); +#endif some_signal.connect(sigc::track_object([&some_bar]() { foo_group4(some_bar); }, some_bar)); some_signal.emit(); util->check_result(result_stream, "foo_group4(bar_group4&)foo_group4(bar_group4&)"); From 6cd3c1b54973f2055187404ffabb36200253e9a6 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Tue, 27 Sep 2022 09:44:27 +0200 Subject: [PATCH 045/112] meson.build: Detect if we build from a git subtree See https://gitlab.gnome.org/GNOME/gtkmm/-/merge_requests/72 (William Roy) --- meson.build | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/meson.build b/meson.build index c1b0c906..ee588f30 100644 --- a/meson.build +++ b/meson.build @@ -50,13 +50,15 @@ if not python_version.version_compare(python_version_req) endif # Do we build from a git repository? -# Suppose we do if and only if a '.git' directory or file exists. +# Suppose we do if and only if the meson.build file is tracked by git. cmd_py = ''' -import os -import sys -sys.exit(os.path.isdir("@0@") or os.path.isfile("@0@")) -'''.format(project_source_root / '.git') -is_git_build = run_command(python3, '-c', cmd_py, check: false).returncode() != 0 +import shutil, subprocess, sys +if not shutil.which('git'): + sys.exit(1) +cmd = [ 'git', 'ls-files', '--error-unmatch', 'meson.build' ] +sys.exit(subprocess.run(cmd, cwd="@0@", stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL).returncode) +'''.format(project_source_root) +is_git_build = run_command(python3, '-c', cmd_py, check: false).returncode() == 0 # Are we testing a dist tarball while it's being built? # There ought to be a better way. https://github.com/mesonbuild/meson/issues/6866 From b8260dd2a97a1775d5b7c23e080d2f0f32ed5fa4 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Tue, 25 Oct 2022 15:41:25 +0200 Subject: [PATCH 046/112] docs/devel.md: Change libsigc-list to Discourse The libsigc-list will soon be closed for new contributions. --- docs/devel.md | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/docs/devel.md b/docs/devel.md index a049314f..060b8403 100644 --- a/docs/devel.md +++ b/docs/devel.md @@ -2,18 +2,20 @@ layout: default title: Development --- -## Mailing List +## Discussion -There is a mailing list, [libsigc-list@gnome.org](http://mail.gnome.org/mailman/listinfo/libsigc-list) for libsigc++. -To subscribe, use the web [page](http://mail.gnome.org/mailman/listinfo/libsigc-list). +You can discuss libsigc++ questions on GNOME's [Discourse](https://discourse.gnome.org) +instance, under the [Platform/Language bindings](https://discourse.gnome.org/c/platform/language-bindings) +category with a _cplusplus_ tag. -Members can post directly, but all other traffic is moderated. -There is an archive of messages, -[here](http://mail.gnome.org/archives/libsigc-list/). +There is an old mailing list, which is now closed for new posts. +There is an archive of messages [here](http://mail.gnome.org/archives/libsigc-list/). +Please do not email the developers directly. ## Contributing -Please report bugs as GitHub [issues](https://github.com/libsigcplusplus/libsigcplusplus/issues), or provide improvements as GitHub [pull requests](https://github.com/libsigcplusplus/libsigcplusplus/pulls). +Please report bugs as GitHub [issues](https://github.com/libsigcplusplus/libsigcplusplus/issues), +or provide improvements as GitHub [pull requests](https://github.com/libsigcplusplus/libsigcplusplus/pulls). ## Git From 9f1748e5fe6264e1da11fa334f6b73a7039b66f5 Mon Sep 17 00:00:00 2001 From: wael <40663@proton.me> Date: Fri, 4 Nov 2022 08:23:43 +0300 Subject: [PATCH 047/112] meson: simplify lookup of python command --- meson.build | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/meson.build b/meson.build index ee588f30..2fede19d 100644 --- a/meson.build +++ b/meson.build @@ -41,13 +41,7 @@ project_build_root = meson.current_build_dir() cpp_compiler = meson.get_compiler('cpp') is_msvc = cpp_compiler.get_id() == 'msvc' -python3 = import('python').find_installation() - -python_version = python3.language_version() -python_version_req = '>= 3.5' -if not python_version.version_compare(python_version_req) - error('Requires Python @0@, found @1@.'.format(python_version_req, python_version)) -endif +python3 = find_program('python3', version: '>=3.5') # Do we build from a git repository? # Suppose we do if and only if the meson.build file is tracked by git. From dc2f2f4e6daea26a8901cf86ebb0d4cd0b3b726e Mon Sep 17 00:00:00 2001 From: Fabrice Fontaine Date: Sat, 5 Nov 2022 15:04:36 +0100 Subject: [PATCH 048/112] add build_tests option Allow the user to disable build of test programs Signed-off-by: Fabrice Fontaine --- meson.build | 6 +++++- meson_options.txt | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 2fede19d..70be03be 100644 --- a/meson.build +++ b/meson.build @@ -77,6 +77,7 @@ build_documentation_opt = get_option('build-documentation') build_documentation = build_documentation_opt == 'true' or \ (build_documentation_opt == 'if-maintainer-mode' and maintainer_mode) build_examples = get_option('build-examples') +build_tests = get_option('build-tests') do_benchmark = get_option('benchmark') # Installation directories are relative to {prefix}. @@ -255,7 +256,9 @@ can_add_dist_script = not meson.is_subproject() or meson.version().version_compa subdir('MSVC_NMake') subdir('sigc++') subdir('examples') -subdir('tests') +if build_tests + subdir('tests') +endif subdir('docs/docs/reference') subdir('docs/docs/manual') @@ -329,6 +332,7 @@ summary = [ ' XML validation: @0@@1@'.format(validate, explain_val), ' Build PDF: @0@@1@'.format(build_pdf, explain_pdf), ' Build example programs: @0@'.format(build_examples), + ' Build test programs: @0@'.format(build_tests), ' Benchmark: @0@'.format(do_benchmark), 'Directories:', ' prefix: @0@'.format(install_prefix), diff --git a/meson_options.txt b/meson_options.txt index 138e302b..eea909a9 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -14,5 +14,7 @@ option('build-pdf', type: 'boolean', value: false, description: 'Build tutorial PDF file') option('build-examples', type: 'boolean', value: true, description: 'Build example programs') +option('build-tests', type: 'boolean', value: true, + description: 'Build test programs') option('benchmark', type: 'boolean', value: false, description: 'Build and test benchmark program') From 5711e2bc736d9a06fd19b838732568911baab6f1 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Mon, 7 Nov 2022 13:20:13 +0100 Subject: [PATCH 049/112] Meson build: Always call subdir('tests') Make the build_tests check more like the check in cairomm and libxml++. Then it's possible to combine build-tests=false with benchmark=true. See PR#84 --- meson.build | 4 +--- tests/meson.build | 9 ++++++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/meson.build b/meson.build index 70be03be..629e86e6 100644 --- a/meson.build +++ b/meson.build @@ -256,9 +256,7 @@ can_add_dist_script = not meson.is_subproject() or meson.version().version_compa subdir('MSVC_NMake') subdir('sigc++') subdir('examples') -if build_tests - subdir('tests') -endif +subdir('tests') subdir('docs/docs/reference') subdir('docs/docs/manual') diff --git a/tests/meson.build b/tests/meson.build index 87605a45..e0f57d72 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -1,6 +1,6 @@ # tests -# input: sigcxx_own_dep, do_benchmark, can_benchmark, benchmark_dep +# input: sigcxx_own_dep, build_tests, do_benchmark, can_benchmark, benchmark_dep benchmark_timeout = 100 @@ -67,10 +67,13 @@ foreach ex : test_programs exe_file = executable(ex_name, ex_sources, dependencies: sigcxx_own_dep, implicit_include_directories: false, - build_by_default: true + build_by_default: build_tests, ) - test(ex_name, exe_file) + # If exe_file is a test program, it is built by default unconditionally. + if build_tests + test(ex_name, exe_file) + endif endforeach if can_benchmark From ee0589cf5a5e4c2e95fc9302a8a193e4c3f43a2a Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Sun, 18 Dec 2022 18:31:00 +0100 Subject: [PATCH 050/112] CI: Add publish-docs.yml --- .github/workflows/publish-docs.yml | 76 ++++++++++++++++++++++++++++++ docs/_config.yml | 2 +- docs/doc.md | 17 ++++++- 3 files changed, 92 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/publish-docs.yml diff --git a/.github/workflows/publish-docs.yml b/.github/workflows/publish-docs.yml new file mode 100644 index 00000000..35434f8d --- /dev/null +++ b/.github/workflows/publish-docs.yml @@ -0,0 +1,76 @@ +# Sample workflow for building and deploying a Jekyll site to GitHub Pages + +# Copied from https://github.com/libsigcplusplus/libsigcplusplus/actions/new +# and changed. Actions -> New workflow -> Pages -> GitHub Pages Jekyll + +name: Deploy Jekyll with GitHub Pages dependencies preinstalled + +# 2022-12-17: ubuntu-latest = ubuntu-22.04 +on: + # Runs on pushes targeting the default branch + push: + branches: ["master"] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow one concurrent deployment +concurrency: + group: "pages" + cancel-in-progress: true + +jobs: + # Build job + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Build + run: | + # Prevent blocking apt install on a question during configuring of tzdata. + export ENV DEBIAN_FRONTEND=noninteractive + sudo apt update + sudo apt install libxml2-utils docbook5-xml docbook-xsl mm-common g++ meson ninja-build python3-setuptools python3-pip --yes + meson -Dbuild-documentation=true -Dbuild-examples=false -Dbuild-tests=false _build + meson compile -C _build + - name: Collect Documentation + # Collect all documentation to be published. + run: | + mkdir _publish _publish/_layouts _publish/pix _publish/manual _publish/reference + # Copy files from the git repository. + cp docs/_config.yml docs/*.md docs/style.css _publish + cp docs/_layouts/*.html _publish/_layouts + cp docs/pix/logo.gif _publish/pix + # Move generated documentation. + mv _build/docs/docs/manual/html _publish/manual + mv _build/docs/docs/reference/html _publish/reference + - name: Setup Pages + uses: actions/configure-pages@v2 + - name: Build with Jekyll + uses: actions/jekyll-build-pages@v1 + with: + source: ./_publish + destination: ./_site + - name: Upload artifact + uses: actions/upload-pages-artifact@v1 + + # Deployment job + # Publish documentation at https://libsigcplusplus.github.io/libsigcplusplus/ + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v1 + diff --git a/docs/_config.yml b/docs/_config.yml index 966d1ac0..e59301ab 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -1 +1 @@ -name: libsigc++ +title: libsigc++ diff --git a/docs/doc.md b/docs/doc.md index eb8dfb51..7d5e6ede 100644 --- a/docs/doc.md +++ b/docs/doc.md @@ -3,8 +3,21 @@ layout: default title: Documentation --- -We have both [tutorial-style](http://developer.gnome.org/libsigc++-tutorial/stable/) -and [reference](http://developer.gnome.org/libsigc++/stable/) documentation. +## libsigc++-2.0 + +We have [tutorial-style](https://developer-old.gnome.org/libsigc++-tutorial/2.10/) +and [reference](https://developer-old.gnome.org/libsigc++/2.10/) documentation. + +This documentation is frozen on the web. It does not document the latest release. +If you want newer documentation, you can download a tarball from +[GitHub releases](https://github.com/libsigcplusplus/libsigcplusplus/releases/) +or the [GNOME download site](https://download.gnome.org/sources/libsigc++/), +extract it, and view the documentation at *untracked/docs/*. + +## libsigc++-3.0 + +The latest [tutorial-style](manual/html/index.html) and [reference](reference/html/index.html) +documentation is available on the web. ## Glossary of terms From d8d7c8c2e4065485208431815aba6bf22f4f2e9c Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Fri, 23 Dec 2022 11:16:17 +0100 Subject: [PATCH 051/112] meson.build: Don't distribute the .github directory --- meson.build | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/meson.build b/meson.build index 629e86e6..01c1f2e9 100644 --- a/meson.build +++ b/meson.build @@ -266,12 +266,17 @@ if can_add_dist_script python3, dist_changelog, project_source_root, ) + # Don't distribute these files and directories. + dont_distribute = [ + '.github', + ] # Add build scripts to the distribution directory, and delete .gitignore # files and an empty $MESON_PROJECT_DIST_ROOT/build/ directory. meson.add_dist_script( python3, dist_build_scripts, project_source_root, 'untracked' / 'build_scripts', + dont_distribute, ) endif From e88e319aa50df010320dd15e7c802f92752dc8dc Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Fri, 23 Dec 2022 11:17:22 +0100 Subject: [PATCH 052/112] 3.4.0 --- CMakeLists.txt | 2 +- NEWS | 33 +++++++++++++++++++++++++++++++++ configure.ac | 2 +- meson.build | 2 +- 4 files changed, 36 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e1b28fea..21513771 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,7 +17,7 @@ cmake_minimum_required (VERSION 3.2) set (SIGCXX_MAJOR_VERSION 3) -set (SIGCXX_MINOR_VERSION 2) +set (SIGCXX_MINOR_VERSION 4) set (SIGCXX_MICRO_VERSION 0) set (SIGCXX_API_VERSION 3.0) diff --git a/NEWS b/NEWS index 3cf92d69..19a16c32 100755 --- a/NEWS +++ b/NEWS @@ -1,3 +1,36 @@ +3.4.0 (stable) + +* Add track_object(), deprecate track_obj() + (Kjell Ahlstedt) Issue #78 (LordVolumeForm) +* Add trackable_signal_with_accumulator and trackable_signal + (Kjell Ahlstedt) Issue #80 (H2NCH2COOH) + +Examples, tests: +* examples/member_method: Make on_print() non-virtual +* test_accumulated.cc: clang++ requires another 'template' + (Kjell Ahlstedt) +* test_limit_reference.cc: Don't use auto where a slot is required + (Kjell Ahlstedt) Issue #44 (Murray Cumming) + +Documentation: +* signal::make_slot(): Note that signal does not derive from trackable + (Kjell Ahlstedt) Issue #80 (H2NCH2COOH) + +Build: +* Meson: Avoid configuration warnings + (Kjell Ahlstedt) +* Meson, MSVC: Compensate for the lack of msvc_recommended_pragmas.h + (Chun-wei Fan) +* Fix build with -Dbuild-deprecated-api=false + (Kjell Ahlstedt) Issue #82 (bbhtt) +* Meson: Detect if we build from a git subtree + (William Roy) Merge request gtkmm!72 +* Meson: Simplify lookup of python command + (wael444) Pull request #83 +* Meson: Add build_tests option + (Fabrice Fontaine) Pull request #84 + + 3.2.0 (stable) * Allow slots with rvalue reference parameters diff --git a/configure.ac b/configure.ac index 1307c2f9..2256657a 100644 --- a/configure.ac +++ b/configure.ac @@ -15,7 +15,7 @@ ## You should have received a copy of the GNU Lesser General Public License ## along with this library. If not, see . -AC_INIT([libsigc++], [3.2.0], +AC_INIT([libsigc++], [3.4.0], [https://github.com/libsigcplusplus/libsigcplusplus/issues/], [libsigc++], [https://libsigcplusplus.github.io/libsigcplusplus/]) AC_PREREQ([2.59]) diff --git a/meson.build b/meson.build index 01c1f2e9..c677697e 100644 --- a/meson.build +++ b/meson.build @@ -1,7 +1,7 @@ # This file is part of libsigc++. project('libsigc++', 'cpp', - version: '3.2.0', + version: '3.4.0', license: 'LGPLv2.1+', default_options: [ 'cpp_std=c++17', From b863edbe85b839ec14f468af4aebe5d6e51af380 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Wed, 4 Jan 2023 10:53:56 +0100 Subject: [PATCH 053/112] Meson build: Don't copy files with configure_file() It's deprecated from Meson 0.64. The replacement, fs.copyfile(), is not useful here. It only copies from the source directory to the build directory. --- MSVC_NMake/meson.build | 8 ++++---- meson.build | 5 +++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/MSVC_NMake/meson.build b/MSVC_NMake/meson.build index 09078b37..f11412a0 100644 --- a/MSVC_NMake/meson.build +++ b/MSVC_NMake/meson.build @@ -1,6 +1,6 @@ # MSVC_NMake -# Input: pkg_conf_data, sigcxxconfig_h, project_build_root, python3, +# Input: pkg_conf_data, sigcxxconfig_h_meson, project_build_root, python3, # can_add_dist_script # Output: sigc_rc @@ -10,11 +10,11 @@ sigc_rc = configure_file( configuration: pkg_conf_data, ) -# Copy the generated configuration header into the MSVC project directory. +# Make a copy of the generated configuration header in the MSVC project directory. configure_file( - input: sigcxxconfig_h, + input: sigcxxconfig_h_meson, output: 'sigc++config.h', - copy: true, + configuration: pkg_conf_data, ) untracked_msvc_nmake = 'untracked' / 'MSVC_NMake' diff --git a/meson.build b/meson.build index c677697e..82920bf5 100644 --- a/meson.build +++ b/meson.build @@ -241,9 +241,10 @@ configure_file( configuration: pkg_conf_data, ) +sigcxxconfig_h_meson = files('sigc++config.h.meson') install_includeconfigdir = install_libdir / sigcxx_pcname / 'include' -sigcxxconfig_h = configure_file( - input: 'sigc++config.h.meson', +configure_file( + input: sigcxxconfig_h_meson, output: 'sigc++config.h', configuration: pkg_conf_data, install_dir: install_includeconfigdir, From 91441e49653721053c50e3dfadb591de8592cd93 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Wed, 4 Jan 2023 10:56:31 +0100 Subject: [PATCH 054/112] meson.build: Fix the evaluation of is_git_build on Windows See gtkmm#131 --- meson.build | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/meson.build b/meson.build index 82920bf5..9f7627d2 100644 --- a/meson.build +++ b/meson.build @@ -47,12 +47,17 @@ python3 = find_program('python3', version: '>=3.5') # Suppose we do if and only if the meson.build file is tracked by git. cmd_py = ''' import shutil, subprocess, sys -if not shutil.which('git'): +git_exe = shutil.which('git') +if not git_exe: sys.exit(1) -cmd = [ 'git', 'ls-files', '--error-unmatch', 'meson.build' ] -sys.exit(subprocess.run(cmd, cwd="@0@", stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL).returncode) -'''.format(project_source_root) -is_git_build = run_command(python3, '-c', cmd_py, check: false).returncode() == 0 +cmd = [ git_exe, 'ls-files', '--error-unmatch', 'meson.build' ] +sys.exit(subprocess.run(cmd, cwd=sys.argv[1], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL).returncode) +''' +is_git_build = run_command( + python3, '-c', cmd_py, + project_source_root, + check: false, +).returncode() == 0 # Are we testing a dist tarball while it's being built? # There ought to be a better way. https://github.com/mesonbuild/meson/issues/6866 From 9fc3416a95abca28cb992e4607232a3287e847a1 Mon Sep 17 00:00:00 2001 From: Francesco Emanuele D'Agostino Date: Sun, 15 Jan 2023 00:46:51 +0100 Subject: [PATCH 055/112] introducing protection to prevent multiple target declaration for uninstall. --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 21513771..5741400b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -65,6 +65,7 @@ set (top_srcdir .) configure_file (sigc++.pc.in sigc++-${SIGCXX_API_VERSION}.pc @ONLY) configure_file (sigc++-uninstalled.pc.in sigc++-${SIGCXX_API_VERSION}-uninstalled.pc @ONLY) +if (NOT TARGET uninstall) configure_file( "${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" @@ -72,7 +73,7 @@ configure_file( add_custom_target(uninstall COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake) - +endif() install (FILES "${CMAKE_CURRENT_BINARY_DIR}/sigc++config.h" From 550e91d6c565deb5bf144f8d82f5dbdbeb75f412 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Mon, 3 Apr 2023 11:17:59 +0200 Subject: [PATCH 056/112] meson.build: Simplify if-file-exists test --- meson.build | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/meson.build b/meson.build index 9f7627d2..e4630fe6 100644 --- a/meson.build +++ b/meson.build @@ -137,17 +137,9 @@ if maintainer_mode project_source_root / 'untracked' / 'docs' / 'docs', check: true, ) -else - cmd_py = ''' -import os -import sys -sys.exit(os.path.isfile("@0@")) -'''.format(doc_reference) - file_exists = run_command(python3, '-c', cmd_py, check: false).returncode() != 0 - if not file_exists - warning('Missing files in untracked/. ' + \ - 'Enable maintainer-mode if you want to build documentation or create a dist tarball.') - endif +elif not import('fs').is_file(doc_reference) + warning('Missing files in untracked/.\n ' + \ + 'Enable maintainer-mode if you want to build documentation or create a dist tarball.') endif # Check if perl is required and available. From 2ef3e5269f44c4664a90ec04f3c2c0a7382800c1 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Mon, 3 Apr 2023 11:18:19 +0200 Subject: [PATCH 057/112] README.md, CI: meson -> meson setup --- .github/workflows/meson-clang-10.yml | 2 +- .github/workflows/meson-gcc-10.yml | 2 +- .github/workflows/publish-docs.yml | 2 +- README.md | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/meson-clang-10.yml b/.github/workflows/meson-clang-10.yml index adab1966..092c00ef 100644 --- a/.github/workflows/meson-clang-10.yml +++ b/.github/workflows/meson-clang-10.yml @@ -19,7 +19,7 @@ jobs: # Install it with pip3 instead of apt. sudo pip3 install "meson>=0.55.0" export CXX=clang++-10 - meson -Dwarnings=fatal -Dwarning_level=3 -Dwerror=true _build + meson setup -Dwarnings=fatal -Dwarning_level=3 -Dwerror=true _build cd _build meson compile - name: Test diff --git a/.github/workflows/meson-gcc-10.yml b/.github/workflows/meson-gcc-10.yml index 46cc6b51..d358d7fc 100644 --- a/.github/workflows/meson-gcc-10.yml +++ b/.github/workflows/meson-gcc-10.yml @@ -19,7 +19,7 @@ jobs: # Install it with pip3 instead of apt. sudo pip3 install "meson>=0.55.0" export CXX=g++-10 - meson -Dwarnings=fatal -Dwarning_level=3 -Dwerror=true _build + meson setup -Dwarnings=fatal -Dwarning_level=3 -Dwerror=true _build cd _build meson compile - name: Test diff --git a/.github/workflows/publish-docs.yml b/.github/workflows/publish-docs.yml index 35434f8d..95b0a6fa 100644 --- a/.github/workflows/publish-docs.yml +++ b/.github/workflows/publish-docs.yml @@ -38,7 +38,7 @@ jobs: export ENV DEBIAN_FRONTEND=noninteractive sudo apt update sudo apt install libxml2-utils docbook5-xml docbook-xsl mm-common g++ meson ninja-build python3-setuptools python3-pip --yes - meson -Dbuild-documentation=true -Dbuild-examples=false -Dbuild-tests=false _build + meson setup -Dbuild-documentation=true -Dbuild-examples=false -Dbuild-tests=false _build meson compile -C _build - name: Collect Documentation # Collect all documentation to be published. diff --git a/README.md b/README.md index 5ffed357..dfc32e9e 100644 --- a/README.md +++ b/README.md @@ -54,10 +54,10 @@ For instance: ```sh # If the tarball was made with Autotools, and you want to rebuild the reference # documentation, you must enable maintainer-mode: -$ meson --prefix=/some_directory --libdir=lib -Dmaintainer-mode=true your_builddir . +$ meson setup --prefix=/some_directory --libdir=lib -Dmaintainer-mode=true your_builddir . # If the tarball was made with Meson, or you don't want to rebuild the docs: -$ meson --prefix=/some_directory --libdir=lib your_builddir . +$ meson setup --prefix=/some_directory --libdir=lib your_builddir . # then: $ cd your_builddir @@ -105,7 +105,7 @@ Don't call the builddir 'build'. There is a directory called 'build' with files used by Autotools. ```sh -$ meson --prefix=/some_directory --libdir=lib your_builddir . +$ meson setup --prefix=/some_directory --libdir=lib your_builddir . $ cd your_builddir $ ninja $ ninja install From e82dc27ae6c42301695be5a2b2df10e4f544a1f4 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Wed, 31 May 2023 18:35:45 +0200 Subject: [PATCH 058/112] sigc++.pc.in: Update htmlrefpub --- sigc++.pc.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sigc++.pc.in b/sigc++.pc.in index 05de3158..16a5514e 100644 --- a/sigc++.pc.in +++ b/sigc++.pc.in @@ -8,7 +8,7 @@ includedir=@includedir@ docdir=${datarootdir}/doc/libsigc++-@SIGCXX_API_VERSION@ doxytagfile=${docdir}/reference/libsigc++-@SIGCXX_API_VERSION@.tag htmlrefdir=${docdir}/reference/html -htmlrefpub=http://library.gnome.org/devel/libsigc++/unstable/ +htmlrefpub=https://libsigcplusplus.github.io/libsigcplusplus/reference/html/ Name: libsigc++ Description: Typesafe signal and callback system for C++ From 0e3724cd94ccd5da7c13c8169ce561bf02062d11 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Wed, 31 May 2023 18:36:39 +0200 Subject: [PATCH 059/112] Doxyfile.in: Remove obsolete entries --- docs/docs/reference/Doxyfile.in | 4 ---- 1 file changed, 4 deletions(-) diff --git a/docs/docs/reference/Doxyfile.in b/docs/docs/reference/Doxyfile.in index c4cefda9..0ffb9eba 100644 --- a/docs/docs/reference/Doxyfile.in +++ b/docs/docs/reference/Doxyfile.in @@ -224,7 +224,6 @@ PDF_HYPERLINKS = YES USE_PDFLATEX = YES LATEX_BATCHMODE = NO LATEX_HIDE_INDICES = NO -LATEX_SOURCE_CODE = NO LATEX_BIB_STYLE = plain LATEX_TIMESTAMP = NO #--------------------------------------------------------------------------- @@ -236,7 +235,6 @@ COMPACT_RTF = NO RTF_HYPERLINKS = NO RTF_STYLESHEET_FILE = RTF_EXTENSIONS_FILE = -RTF_SOURCE_CODE = NO #--------------------------------------------------------------------------- # Configuration options related to the man page output #--------------------------------------------------------------------------- @@ -256,7 +254,6 @@ XML_PROGRAMLISTING = NO #--------------------------------------------------------------------------- GENERATE_DOCBOOK = NO DOCBOOK_OUTPUT = docbook -DOCBOOK_PROGRAMLISTING = NO #--------------------------------------------------------------------------- # Configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- @@ -297,7 +294,6 @@ EXTERNAL_PAGES = YES #--------------------------------------------------------------------------- # Configuration options related to the dot tool #--------------------------------------------------------------------------- -CLASS_DIAGRAMS = YES DIA_PATH = HIDE_UNDOC_RELATIONS = NO HAVE_DOT = YES From bc91a4f36ccece12c5e52e54f38e54f75b423c34 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Wed, 31 May 2023 18:36:58 +0200 Subject: [PATCH 060/112] connection: Improve the class documentation Fixes #88 --- sigc++/connection.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sigc++/connection.h b/sigc++/connection.h index 4b4926e4..0e733760 100644 --- a/sigc++/connection.h +++ b/sigc++/connection.h @@ -25,7 +25,14 @@ namespace sigc { -/** This may be used to disconnect the referred slot at any time (disconnect()). +/** Convenience class for safe disconnection. + * + * This may be used to disconnect the referred slot at any time (disconnect()). + * @ref sigc::signal_with_accumulator::connect() "sigc::signal::connect()" + * returns a %sigc::connection. + * @code + * sigc::connection conn = sig.connect(sigc::mem_fun(a, &A::foo)); + * @endcode * If the slot has already been destroyed, disconnect() does nothing. empty() or * operator bool() can be used to test whether the connection is * still active. The connection can be blocked (block(), unblock()). From b0312f2397536c48f1f015aa1e7ee6f014206c48 Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Mon, 26 Jun 2023 15:20:53 +0800 Subject: [PATCH 061/112] meson: Disallow default_library == 'both' on Visual Studio We need different defines/cflags for building static and shared builds of libsigc++, so we can't really support default_library = 'both' for libsigc++ without much retinkering. So, just disallow such builds at least for now. Also, save up whether we are attempting a static build in the Visual Studio build. --- meson.build | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/meson.build b/meson.build index e4630fe6..3190d6eb 100644 --- a/meson.build +++ b/meson.build @@ -43,6 +43,18 @@ cpp_compiler = meson.get_compiler('cpp') is_msvc = cpp_compiler.get_id() == 'msvc' python3 = find_program('python3', version: '>=3.5') +# MSVC: We currently do not support shared and static builds at the, +# same time, since we need different defines/cflags for proper +# linking. +if is_msvc + if get_option('default_library') == 'both' + error('-Ddefault_library=both is currently not supported for Visual Studio') + endif + is_msvc_static = get_option('default_library') == 'static' +else + is_msvc_static = false +endif + # Do we build from a git repository? # Suppose we do if and only if the meson.build file is tracked by git. cmd_py = ''' From a23cdc45176979bc1f4dda2e09c72ad2d619e476 Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Mon, 26 Jun 2023 15:22:10 +0800 Subject: [PATCH 062/112] build: Drop _WINDLL from sigc++config.h.[in|meson|cmake] ...and add a new check macro LIBSIGCXX_STATIC, to use the appropriate macros to build and link against libsigc++. Drop this from the build files as well. --- MSVC_NMake/config-msvc.mak | 2 +- sigc++/meson.build | 2 +- sigc++config.h.cmake | 6 ++++-- sigc++config.h.in | 4 +++- sigc++config.h.meson | 4 +++- 5 files changed, 12 insertions(+), 6 deletions(-) diff --git a/MSVC_NMake/config-msvc.mak b/MSVC_NMake/config-msvc.mak index 86ee18b5..a8c5280a 100644 --- a/MSVC_NMake/config-msvc.mak +++ b/MSVC_NMake/config-msvc.mak @@ -14,7 +14,7 @@ DEBUG_SUFFIX = -d DEBUG_SUFFIX = !endif -LIBSIGCPP_DEFINES = /DSIGC_BUILD /D_WINDLL +LIBSIGCPP_DEFINES = /DSIGC_BUILD SIGCPP_BASE_CFLAGS = /I.. /I. /I..\untracked\MSVC_NMake /std:c++17 /EHsc $(CFLAGS) diff --git a/sigc++/meson.build b/sigc++/meson.build index 9d9561f7..3b3cfeb8 100644 --- a/sigc++/meson.build +++ b/sigc++/meson.build @@ -74,7 +74,7 @@ extra_sigc_objects = [] # Make sure we are exporting the symbols from the DLL if is_msvc - extra_sigc_cppflags += ['-DSIGC_BUILD', '-D_WINDLL'] + extra_sigc_cppflags += ['-DSIGC_BUILD'] endif # Build the .rc file for Windows builds and link to it diff --git a/sigc++config.h.cmake b/sigc++config.h.cmake index 74d348a0..2c7e943a 100644 --- a/sigc++config.h.cmake +++ b/sigc++config.h.cmake @@ -16,7 +16,9 @@ # if defined(_MSC_VER) # define SIGC_MSC 1 # define SIGC_WIN32 1 -# define SIGC_DLL 1 +# ifndef LIBSIGCXX_STATIC +# define SIGC_DLL 1 +# endif # elif defined(__CYGWIN__) # define SIGC_CONFIGURE 1 # elif defined(__MINGW32__) @@ -54,7 +56,7 @@ #endif /* !SIGC_MSC */ #ifdef SIGC_DLL -# if defined(SIGC_BUILD) && defined(_WINDLL) +# ifdef SIGC_BUILD # define SIGC_API __declspec(dllexport) # elif !defined(SIGC_BUILD) # define SIGC_API __declspec(dllimport) diff --git a/sigc++config.h.in b/sigc++config.h.in index a82a86b9..573bc36c 100644 --- a/sigc++config.h.in +++ b/sigc++config.h.in @@ -16,7 +16,9 @@ #if defined(_MSC_VER) #define SIGC_MSC 1 #define SIGC_WIN32 1 +#ifndef LIBSIGCXX_STATIC #define SIGC_DLL 1 +#endif #elif defined(__CYGWIN__) #define SIGC_CONFIGURE 1 #elif defined(__MINGW32__) @@ -54,7 +56,7 @@ #endif /* !SIGC_MSC */ #ifdef SIGC_DLL -#if defined(SIGC_BUILD) && defined(_WINDLL) +#ifdef SIGC_BUILD #define SIGC_API __declspec(dllexport) #elif !defined(SIGC_BUILD) #define SIGC_API __declspec(dllimport) diff --git a/sigc++config.h.meson b/sigc++config.h.meson index 47cbd80d..3027b26e 100644 --- a/sigc++config.h.meson +++ b/sigc++config.h.meson @@ -19,7 +19,9 @@ #if defined(_MSC_VER) #define SIGC_MSC 1 #define SIGC_WIN32 1 +#ifndef LIBSIGCXX_STATIC #define SIGC_DLL 1 +#endif #elif defined(__CYGWIN__) #define SIGC_CONFIGURE 1 #elif defined(__MINGW32__) @@ -57,7 +59,7 @@ #endif /* !SIGC_MSC */ #ifdef SIGC_DLL -#if defined(SIGC_BUILD) && defined(_WINDLL) +#ifdef SIGC_BUILD #define SIGC_API __declspec(dllexport) #elif !defined(SIGC_BUILD) #define SIGC_API __declspec(dllimport) From 41b7d33007b53098aec388a6b6bc5a896b1d7c76 Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Mon, 26 Jun 2023 11:25:42 +0800 Subject: [PATCH 063/112] build: Actually support MSVC static builds Apply -DLIBSIGCXX_STATIC as appropriate when we request a static build to be done for the Meson and NMake builds, and skip building the version .rc file if a static build is requested. For the NMake builds, separate the build artifacts from the static and shared builds. The CMake builds are not updated here as it always assumes a shared build, nor are the autotools builds since it is not used for Visual Studio builds at all. --- MSVC_NMake/build-rules-msvc.mak | 39 +++++++++++++++++++------------- MSVC_NMake/config-msvc.mak | 19 ++++++++++++++++ MSVC_NMake/create-lists-msvc.mak | 37 +++++++++++++++++++++++++----- MSVC_NMake/info-msvc.mak | 8 ++++++- meson.build | 3 +++ sigc++/meson.build | 6 +++-- 6 files changed, 87 insertions(+), 25 deletions(-) diff --git a/MSVC_NMake/build-rules-msvc.mak b/MSVC_NMake/build-rules-msvc.mak index fe5a587a..74e51d9d 100644 --- a/MSVC_NMake/build-rules-msvc.mak +++ b/MSVC_NMake/build-rules-msvc.mak @@ -13,25 +13,25 @@ # $(CC)|$(CXX) $(cflags) /Fo$(destdir) /c @<< # $< # << -{..\sigc++\}.cc{vs$(VSVER)\$(CFG)\$(PLAT)\sigc\}.obj: +{..\sigc++\}.cc{vs$(VSVER)\$(CFG)\$(PLAT)\$(LIBSIGC_INTDIR)\}.obj: @if not exist .\sigc++config.h if not exist ..\untracked\MSVC_NMake\sigc++config.h $(MAKE) /f Makefile.vc CFG=$(CFG) sigc++config.h @if not exist $(@D)\ md $(@D) $(CXX) $(LIBSIGCPP_CFLAGS) /Fo$(@D)\ /Fd$(@D)\ /c @<< $< << -{..\sigc++\functors\}.cc{vs$(VSVER)\$(CFG)\$(PLAT)\sigc\}.obj: +{..\sigc++\functors\}.cc{vs$(VSVER)\$(CFG)\$(PLAT)\$(LIBSIGC_INTDIR)\}.obj: @if not exist .\sigc++config.h if not exist ..\untracked\MSVC_NMake\sigc++config.h $(MAKE) /f Makefile.vc CFG=$(CFG) sigc++config.h @if not exist $(@D)\ md $(@D) $(CXX) $(LIBSIGCPP_CFLAGS) /Fo$(@D)\ /Fd$(@D)\ /c @<< $< << -{.}.rc{vs$(VSVER)\$(CFG)\$(PLAT)\sigc\}.res: +{.}.rc{vs$(VSVER)\$(CFG)\$(PLAT)\$(LIBSIGC_INTDIR)\}.res: @if not exist $(@D)\ md $(@D) rc /fo$@ $< -{..\untracked\MSVC_NMake\}.rc{vs$(VSVER)\$(CFG)\$(PLAT)\sigc\}.res: +{..\untracked\MSVC_NMake\}.rc{vs$(VSVER)\$(CFG)\$(PLAT)\$(LIBSIGC_INTDIR)\}.res: @if not exist $(@D)\ md $(@D) rc /fo$@ $< @@ -42,13 +42,20 @@ $< # $(dependent_objects) # << # @-if exist $@.manifest mt /manifest $@.manifest /outputresource:$@;2 +!ifdef STATIC +$(LIBSIGC_LIB): $(libsigc_OBJS) + lib $(ARFLAGS) -out:$@ @<< +$(libsigc_OBJS) +<< +!else $(LIBSIGC_LIB): $(LIBSIGC_DLL) -$(LIBSIGC_DLL): $(sigc_dll_OBJS) +$(LIBSIGC_DLL): $(libsigc_OBJS) link /DLL $(LDFLAGS) /implib:$(LIBSIGC_LIB) -out:$@ @<< -$(sigc_dll_OBJS) +$(libsigc_OBJS) << @-if exist $@.manifest mt /manifest $@.manifest /outputresource:$@;2 +!endif # Rules for linking Executables # Format is as follows (the mt command is needed for MSVC 2005/2008 builds): @@ -65,13 +72,13 @@ clean: @-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\*.ilk @-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\*.exp @-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\*.lib - @-if exist vs$(VSVER)\$(CFG)\$(PLAT)\sigc-tests del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\sigc-tests\*.obj - @-if exist vs$(VSVER)\$(CFG)\$(PLAT)\sigc-tests del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\sigc-tests\*.pdb - @-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\sigc-examples\*.obj - @-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\sigc-examples\*.pdb - @-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\sigc\*.res - @-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\sigc\*.obj - @-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\sigc\*.pdb - @-if exist vs$(VSVER)\$(CFG)\$(PLAT)\sigc-tests rd vs$(VSVER)\$(CFG)\$(PLAT)\sigc-tests - @-rd vs$(VSVER)\$(CFG)\$(PLAT)\sigc-examples - @-rd vs$(VSVER)\$(CFG)\$(PLAT)\sigc + @-if exist vs$(VSVER)\$(CFG)\$(PLAT)\$(SIGC_TESTS_INTDIR) del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\$(SIGC_TESTS_INTDIR)\*.obj + @-if exist vs$(VSVER)\$(CFG)\$(PLAT)\$(SIGC_TESTS_INTDIR) del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\$(SIGC_TESTS_INTDIR)\*.pdb + @-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\$(SIGC_EX_INTDIR)\*.obj + @-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\$(SIGC_EX_INTDIR)\*.pdb + @-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\$(LIBSIGC_INTDIR)\*.res + @-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\$(LIBSIGC_INTDIR)\*.obj + @-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\$(LIBSIGC_INTDIR)\*.pdb + @-if exist vs$(VSVER)\$(CFG)\$(PLAT)\$(SIGC_TESTS_INTDIR) rd vs$(VSVER)\$(CFG)\$(PLAT)\$(SIGC_TESTS_INTDIR) + @-rd vs$(VSVER)\$(CFG)\$(PLAT)\$(SIGC_EX_INTDIR) + @-rd vs$(VSVER)\$(CFG)\$(PLAT)\$(LIBSIGC_INTDIR) diff --git a/MSVC_NMake/config-msvc.mak b/MSVC_NMake/config-msvc.mak index a8c5280a..52c72a00 100644 --- a/MSVC_NMake/config-msvc.mak +++ b/MSVC_NMake/config-msvc.mak @@ -8,6 +8,16 @@ BASE_INCLUDES = /I$(PREFIX)\include LIBSIGC_MAJOR_VERSION = 3 LIBSIGC_MINOR_VERSION = 0 +!ifdef STATIC +LIBSIGC_INTDIR = sigc-static +SIGC_EX_INTDIR = sigc-examples-static +SIGC_TESTS_INTDIR = sigc-tests-static +!else +LIBSIGC_INTDIR = sigc +SIGC_EX_INTDIR = sigc-examples +SIGC_TESTS_INTDIR = sigc-tests +!endif + !if "$(CFG)" == "debug" || "$(CFG)" == "Debug" DEBUG_SUFFIX = -d !else @@ -18,6 +28,11 @@ LIBSIGCPP_DEFINES = /DSIGC_BUILD SIGCPP_BASE_CFLAGS = /I.. /I. /I..\untracked\MSVC_NMake /std:c++17 /EHsc $(CFLAGS) +# Define LIBSIGCXX_STATIC everywhere for static builds +!ifdef STATIC +SIGCPP_BASE_CFLAGS = $(SIGCPP_BASE_CFLAGS) /DLIBSIGCXX_STATIC +!endif + LIBSIGC_INT_SOURCES = $(sigc_sources_cc:/=\) LIBSIGC_INT_HDRS = $(sigc_public_h:/=\) @@ -35,8 +50,12 @@ LIBSIGC_LIBNAME = sigc-vc$(VSVER_LIB)$(DEBUG_SUFFIX)-$(LIBSIGC_MAJOR_VERSION)_$( LIBSIGC_DLLNAME = $(LIBSIGC_LIBNAME) !endif +!ifdef STATIC +LIBSIGC_LIB = vs$(VSVER)\$(CFG)\$(PLAT)\$(LIBSIGC_LIBNAME)-static.lib +!else LIBSIGC_DLL = vs$(VSVER)\$(CFG)\$(PLAT)\$(LIBSIGC_DLLNAME).dll LIBSIGC_LIB = vs$(VSVER)\$(CFG)\$(PLAT)\$(LIBSIGC_LIBNAME).lib +!endif # If your Boost libraries are built as DLLs, use BOOST_DLL=1 in your NMake command line !ifdef BOOST_DLL diff --git a/MSVC_NMake/create-lists-msvc.mak b/MSVC_NMake/create-lists-msvc.mak index 2691d886..0689c894 100644 --- a/MSVC_NMake/create-lists-msvc.mak +++ b/MSVC_NMake/create-lists-msvc.mak @@ -35,18 +35,40 @@ NULL= # For libsigc++ -!if [call create-lists.bat header sigc.mak sigc_dll_OBJS] +!if [call create-lists.bat header sigc.mak libsigc_OBJS] !endif -!if [for %c in ($(sigc_sources_cc)) do @if "%~xc" == ".cc" @call create-lists.bat file sigc.mak vs^$(VSVER)\^$(CFG)\^$(PLAT)\sigc\%~nc.obj] +!if [for %c in ($(sigc_sources_cc)) do @if "%~xc" == ".cc" @call create-lists.bat file sigc.mak vs^$(VSVER)\^$(CFG)\^$(PLAT)\$(LIBSIGC_INTDIR)\%~nc.obj] !endif -!if [@call create-lists.bat file sigc.mak vs^$(VSVER)\^$(CFG)\^$(PLAT)\sigc\sigc.res] +# No point linking in version resource for static builds +!ifndef STATIC +!if [@call create-lists.bat file sigc.mak vs^$(VSVER)\^$(CFG)\^$(PLAT)\$(LIBSIGC_INTDIR)\sigc.res] +!endif !endif !if [call create-lists.bat footer sigc.mak] !endif +!ifdef STATIC +# start of static executables +!if [for %d in (examples tests) do @call create-lists.bat header sigc.mak libsigc_%d & @(for %s in (..\%d\*.cc) do @if not "%~ns" == "testutilities" if not "%~ns" == "benchmark" call create-lists.bat file sigc.mak vs$(VSVER)\$(CFG)\$(PLAT)\%~ns-static.exe) & @call create-lists.bat footer sigc.mak] +!endif + +!if [call create-lists.bat header sigc.mak libsigc_benchmark & @for %s in (..\tests\benchmark.cc) do @(call create-lists.bat file sigc.mak vs$(VSVER)\$(CFG)\$(PLAT)\%~ns-static.exe) & @call create-lists.bat footer sigc.mak] +!endif + +!if [for %d in (examples tests) do @for %s in (..\%d\*.cc) do @if not "%~ns" == "benchmark" echo vs^$(VSVER)\^$(CFG)\^$(PLAT)\sigc-%d-static\%~ns.obj: %s>>sigc.mak & @echo. @if not exist ^$(@D)\ md ^$(@D)>>sigc.mak & @echo. ^$(CXX) ^$(SIGCPP_CFLAGS) /Fo^$(@D)\ /Fd^$(@D)\ ^$** /c>>sigc.mak & @echo.>>sigc.mak] +!endif + +!if [for %s in (..\examples\*.cc) do @echo vs^$(VSVER)\^$(CFG)\^$(PLAT)\%~ns-static.exe: ^$(LIBSIGC_LIB) vs^$(VSVER)\^$(CFG)\^$(PLAT)\$(SIGC_EX_INTDIR)\%~ns.obj>>sigc.mak & @echo. link ^$(LDFLAGS) ^$** /out:^$@>>sigc.mak & @echo.>>sigc.mak] +!endif + +!if [for %s in (..\tests\*.cc) do @if not "%~ns" == "testutilities" echo vs^$(VSVER)\^$(CFG)\^$(PLAT)\%~ns-static.exe: ^$(LIBSIGC_LIB) vs^$(VSVER)\^$(CFG)\^$(PLAT)\$(SIGC_TESTS_INTDIR)\%~ns.obj vs^$(VSVER)\^$(CFG)\^$(PLAT)\$(SIGC_TESTS_INTDIR)\testutilities.obj>>sigc.mak & @echo. link ^$(LDFLAGS) ^$** /out:^$@>>sigc.mak & @echo.>>sigc.mak] +!endif +# end of static executables +!else +# start of shared executables !if [for %d in (examples tests) do @call create-lists.bat header sigc.mak libsigc_%d & @(for %s in (..\%d\*.cc) do @if not "%~ns" == "testutilities" if not "%~ns" == "benchmark" call create-lists.bat file sigc.mak vs$(VSVER)\$(CFG)\$(PLAT)\%~ns.exe) & @call create-lists.bat footer sigc.mak] !endif @@ -56,13 +78,16 @@ NULL= !if [for %d in (examples tests) do @for %s in (..\%d\*.cc) do @if not "%~ns" == "benchmark" echo vs^$(VSVER)\^$(CFG)\^$(PLAT)\sigc-%d\%~ns.obj: %s>>sigc.mak & @echo. @if not exist ^$(@D)\ md ^$(@D)>>sigc.mak & @echo. ^$(CXX) ^$(SIGCPP_CFLAGS) /Fo^$(@D)\ /Fd^$(@D)\ ^$** /c>>sigc.mak & @echo.>>sigc.mak] !endif -!if [for %s in (..\tests\benchmark.cc) do @echo vs^$(VSVER)\^$(CFG)\^$(PLAT)\sigc-tests\%~ns.obj: %s>>sigc.mak & @echo. @if not exist ^$(@D)\ md ^$(@D)>>sigc.mak & @echo. ^$(CXX) ^$(SIGCPP_BENCHMARK_CFLAGS) /Fo^$(@D)\ /Fd^$(@D)\ ^$** /c>>sigc.mak & @echo.>>sigc.mak] +!if [for %s in (..\examples\*.cc) do @echo vs^$(VSVER)\^$(CFG)\^$(PLAT)\%~ns.exe: ^$(LIBSIGC_LIB) vs^$(VSVER)\^$(CFG)\^$(PLAT)\$(SIGC_EX_INTDIR)\%~ns.obj>>sigc.mak & @echo. link ^$(LDFLAGS) ^$** /out:^$@>>sigc.mak & @echo.>>sigc.mak] +!endif + +!if [for %s in (..\tests\*.cc) do @if not "%~ns" == "testutilities" echo vs^$(VSVER)\^$(CFG)\^$(PLAT)\%~ns.exe: ^$(LIBSIGC_LIB) vs^$(VSVER)\^$(CFG)\^$(PLAT)\$(SIGC_TESTS_INTDIR)\%~ns.obj vs^$(VSVER)\^$(CFG)\^$(PLAT)\$(SIGC_TESTS_INTDIR)\testutilities.obj>>sigc.mak & @echo. link ^$(LDFLAGS) ^$** /out:^$@>>sigc.mak & @echo.>>sigc.mak] !endif -!if [for %s in (..\examples\*.cc) do @echo vs^$(VSVER)\^$(CFG)\^$(PLAT)\%~ns.exe: ^$(LIBSIGC_LIB) vs^$(VSVER)\^$(CFG)\^$(PLAT)\sigc-examples\%~ns.obj>>sigc.mak & @echo. link ^$(LDFLAGS) ^$** /out:^$@>>sigc.mak & @echo.>>sigc.mak] +# end of shared executables !endif -!if [for %s in (..\tests\*.cc) do @if not "%~ns" == "testutilities" echo vs^$(VSVER)\^$(CFG)\^$(PLAT)\%~ns.exe: ^$(LIBSIGC_LIB) vs^$(VSVER)\^$(CFG)\^$(PLAT)\sigc-tests\%~ns.obj vs^$(VSVER)\^$(CFG)\^$(PLAT)\sigc-tests\testutilities.obj>>sigc.mak & @echo. link ^$(LDFLAGS) ^$** /out:^$@>>sigc.mak & @echo.>>sigc.mak] +!if [for %s in (..\tests\benchmark.cc) do @echo vs^$(VSVER)\^$(CFG)\^$(PLAT)\$(SIGC_TESTS_INTDIR)\%~ns.obj: %s>>sigc.mak & @echo. @if not exist ^$(@D)\ md ^$(@D)>>sigc.mak & @echo. ^$(CXX) ^$(SIGCPP_BENCHMARK_CFLAGS) /Fo^$(@D)\ /Fd^$(@D)\ ^$** /c>>sigc.mak & @echo.>>sigc.mak] !endif !include sigc.mak diff --git a/MSVC_NMake/info-msvc.mak b/MSVC_NMake/info-msvc.mak index 30d1dba9..76b2341e 100644 --- a/MSVC_NMake/info-msvc.mak +++ b/MSVC_NMake/info-msvc.mak @@ -6,13 +6,15 @@ all-build-info: @echo Build info @echo --------- @echo Build Type: $(CFG) + @if not "$(STATIC)" == "" echo Library Build Type: static + @if "$(STATIC)" == "" echo Library Build Type: DLL help: @echo. @echo ============================== @echo Building libsigc++ Using NMake @echo ============================== - @echo nmake /f Makefile.vc CFG=[release^|debug] ^ + @echo nmake /f Makefile.vc CFG=[release^|debug] ^ ^ @echo. @echo Where: @echo ------ @@ -24,6 +26,10 @@ help: @echo where ^$(short_vs_ver) is 15 for VS 2017 and so on; and @echo ^$(platform) is Win32 for 32-bit builds and x64 for x64 builds. @echo. + @echo STATIC: Optional, enable to build static libsigc++. Define + @echo LIBSIGCXX_STATIC in the compiler flags to use the static build of + @echo libsigc++. + @echo. @echo ====== @echo A 'clean' target is supported to remove all generated files, intermediate @echo object files and binaries for the specified configuration. diff --git a/meson.build b/meson.build index 3190d6eb..4777ed5e 100644 --- a/meson.build +++ b/meson.build @@ -216,6 +216,9 @@ if is_msvc cpp_compiler.get_supported_arguments(disable_warnings_list), language: 'cpp' ) + if is_msvc_static + add_project_arguments(['-DLIBSIGCXX_STATIC'], language: 'cpp') + endif endif # Configure files diff --git a/sigc++/meson.build b/sigc++/meson.build index 3b3cfeb8..d9c1231d 100644 --- a/sigc++/meson.build +++ b/sigc++/meson.build @@ -80,8 +80,10 @@ endif # Build the .rc file for Windows builds and link to it if host_machine.system() == 'windows' windows = import('windows') - sigc_res = windows.compile_resources(sigc_rc) - extra_sigc_objects += sigc_res + if get_option('default_library') == 'shared' + sigc_res = windows.compile_resources(sigc_rc) + extra_sigc_objects += sigc_res + endif endif extra_include_dirs = ['..'] From b94f8396c154dcc2e3de1950c8873002f9b651ac Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Mon, 26 Jun 2023 11:56:39 +0800 Subject: [PATCH 064/112] NMake Makefiles: Accomodate static builds during "install" Copy the built DLL and PDB only if building a shared build, and copy the appropriate .lib file according to the build type. --- MSVC_NMake/install.mak | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/MSVC_NMake/install.mak b/MSVC_NMake/install.mak index f9f07e28..72b4402a 100644 --- a/MSVC_NMake/install.mak +++ b/MSVC_NMake/install.mak @@ -7,9 +7,9 @@ install: all @if not exist $(PREFIX)\include\sigc++-$(LIBSIGC_MAJOR_VERSION).$(LIBSIGC_MINOR_VERSION)\sigc++\adaptors\ @md $(PREFIX)\include\sigc++-$(LIBSIGC_MAJOR_VERSION).$(LIBSIGC_MINOR_VERSION)\sigc++\adaptors @if not exist $(PREFIX)\include\sigc++-$(LIBSIGC_MAJOR_VERSION).$(LIBSIGC_MINOR_VERSION)\sigc++\functors\ @md $(PREFIX)\include\sigc++-$(LIBSIGC_MAJOR_VERSION).$(LIBSIGC_MINOR_VERSION)\sigc++\functors @if not exist $(PREFIX)\include\sigc++-$(LIBSIGC_MAJOR_VERSION).$(LIBSIGC_MINOR_VERSION)\sigc++\tuple-utils\ @md $(PREFIX)\include\sigc++-$(LIBSIGC_MAJOR_VERSION).$(LIBSIGC_MINOR_VERSION)\sigc++\tuple-utils - @copy /b vs$(VSVER)\$(CFG)\$(PLAT)\$(LIBSIGC_LIBNAME).dll $(PREFIX)\bin - @copy /b vs$(VSVER)\$(CFG)\$(PLAT)\$(LIBSIGC_LIBNAME).pdb $(PREFIX)\bin - @copy /b vs$(VSVER)\$(CFG)\$(PLAT)\$(LIBSIGC_LIBNAME).lib $(PREFIX)\lib + @if "$(STATIC)" == "" copy /b $(LIBSIGC_DLL) $(PREFIX)\bin + @if "$(STATIC)" == "" copy /b $(LIBSIGC_DLL:.dll=.pdb) $(PREFIX)\bin + @copy /b $(LIBSIGC_LIB) $(PREFIX)\lib @copy "..\sigc++\sigc++.h" "$(PREFIX)\include\sigc++-$(LIBSIGC_MAJOR_VERSION).$(LIBSIGC_MINOR_VERSION)\sigc++\" @for %h in ($(LIBSIGC_INT_HDRS)) do @copy "..\sigc++\%h" "$(PREFIX)\include\sigc++-$(LIBSIGC_MAJOR_VERSION).$(LIBSIGC_MINOR_VERSION)\sigc++\%h" @if exist sigc++config.h copy "sigc++config.h" "$(PREFIX)\lib\sigc++-$(LIBSIGC_MAJOR_VERSION).$(LIBSIGC_MINOR_VERSION)\include\" From a9d8305a29724a2c596a823e46ecc0fe904d62db Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Mon, 26 Jun 2023 12:22:27 +0800 Subject: [PATCH 065/112] sigc++.pc.in: Set -DLIBSIGCXX_STATIC in cxxflags as needed Update the Meson build files to put in -DLIBSIGCXX_STATIC when we are building a static build of libsigc++. For the CMake and autotools build, this is not used. --- CMakeLists.txt | 1 + configure.ac | 2 ++ meson.build | 4 +++- sigc++.pc.in | 2 +- 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5741400b..c4b291c1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,6 +23,7 @@ set (SIGCXX_MICRO_VERSION 0) set (SIGCXX_API_VERSION 3.0) set (PACKAGE_VERSION ${SIGCXX_MAJOR_VERSION}.${SIGCXX_MINOR_VERSION}.${SIGCXX_MICRO_VERSION}) set (LIBSIGCPP_SOVERSION 0) +set (MSVC_STATIC_CXXFLAG "") option (SIGCXX_DISABLE_DEPRECATED "Disable deprecated" OFF) diff --git a/configure.ac b/configure.ac index 2256657a..52237da4 100644 --- a/configure.ac +++ b/configure.ac @@ -73,6 +73,8 @@ AS_IF([test "x$enable_benchmark" = xyes],[ AX_BOOST_TIMER ]) +AC_SUBST(MSVC_STATIC_CXXFLAG, '') + AC_CONFIG_FILES([Makefile ${SIGCXX_MODULE_NAME}.pc:sigc++.pc.in ${SIGCXX_MODULE_NAME}-uninstalled.pc:sigc++-uninstalled.pc.in diff --git a/meson.build b/meson.build index 4777ed5e..4c975d44 100644 --- a/meson.build +++ b/meson.build @@ -193,6 +193,7 @@ add_project_arguments(warning_flags, language: 'cpp') # MSVC: Ignore warnings that aren't really harmful, but make those # that should not be overlooked stand out. +static_cxxflag = '-DLIBSIGCXX_STATIC' if is_msvc disable_warnings_list = [ '/EHsc', # avoid warnings caused by exception handling model used @@ -217,7 +218,7 @@ if is_msvc language: 'cpp' ) if is_msvc_static - add_project_arguments(['-DLIBSIGCXX_STATIC'], language: 'cpp') + add_project_arguments(static_cxxflag, language: 'cpp') endif endif @@ -239,6 +240,7 @@ endif pkg_conf_data.set('SIGCXX_MAJOR_VERSION', sigcxx_major_version) pkg_conf_data.set('SIGCXX_MINOR_VERSION', sigcxx_minor_version) pkg_conf_data.set('SIGCXX_MICRO_VERSION', sigcxx_micro_version) +pkg_conf_data.set('MSVC_STATIC_CXXFLAG', is_msvc_static ? static_cxxflag : '') configure_file( input: 'sigc++.pc.in', diff --git a/sigc++.pc.in b/sigc++.pc.in index 16a5514e..e162f2fc 100644 --- a/sigc++.pc.in +++ b/sigc++.pc.in @@ -15,4 +15,4 @@ Description: Typesafe signal and callback system for C++ Version: @PACKAGE_VERSION@ URL: https://libsigcplusplus.github.io/libsigcplusplus/ Libs: -L${libdir} -lsigc-@SIGCXX_API_VERSION@ -Cflags: -I${includedir}/sigc++-@SIGCXX_API_VERSION@ -I${libdir}/sigc++-@SIGCXX_API_VERSION@/include +Cflags: -I${includedir}/sigc++-@SIGCXX_API_VERSION@ -I${libdir}/sigc++-@SIGCXX_API_VERSION@/include @MSVC_STATIC_CXXFLAG@ From 9e7517a0c47c6e659cfd26384bcdb2a4311a6e12 Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Mon, 26 Jun 2023 12:26:48 +0800 Subject: [PATCH 066/112] MSVC_NMake/README.txt: Mention about static builds --- MSVC_NMake/README.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/MSVC_NMake/README.txt b/MSVC_NMake/README.txt index d3ba16ff..54383350 100644 --- a/MSVC_NMake/README.txt +++ b/MSVC_NMake/README.txt @@ -45,6 +45,10 @@ PREFIX: Optional. Base directory of where the third-party headers, libraries $(X) is the short version of the Visual Studio used, as follows: 2017: 15 +STATIC: Optional. Set if building libsigc++ as a static library. Note that + for building items that use this static build, /DLIBSIGCXX_STATIC + must be passed into the compiler flags. + USE_COMPAT_LIBS: Build the sigc++ DLL and .lib with the filename 'sigc-vc150(d)-3_0' for all builds. This is for compatibility reasons, if re-building dependent code is not From d83dcfcf507356cc81dcb3e831d26b693b9c5397 Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Mon, 26 Jun 2023 12:26:48 +0800 Subject: [PATCH 067/112] Visual Studio builds: Convert build docs to MarkDown Convert the README.txt to MarkDown format so that it is easier on the eye in terms of formatting, and update some of the info: * ARM64 is actually supported * Move the part on static builds as appropriate * Some other minor tweaks --- MSVC_NMake/MSVC-Builds.md | 65 +++++++++++++++++++++++++++++++++++++++ MSVC_NMake/README.txt | 63 ------------------------------------- MSVC_NMake/filelist.am | 2 +- README.md | 2 +- 4 files changed, 67 insertions(+), 65 deletions(-) create mode 100644 MSVC_NMake/MSVC-Builds.md delete mode 100644 MSVC_NMake/README.txt diff --git a/MSVC_NMake/MSVC-Builds.md b/MSVC_NMake/MSVC-Builds.md new file mode 100644 index 00000000..4271176b --- /dev/null +++ b/MSVC_NMake/MSVC-Builds.md @@ -0,0 +1,65 @@ +Instructions for building libsigc++ on Visual Studio += + +Building libsigc++ on Windows is now supported using Visual Studio +versions 2017 or later in both 32-bit and 64-bit (x64 and ARM64) flavors, +via NMake Makefiles. Due to `C++17` usage, Visual Studio 2015 or +earlier is not supported, and any use of the headers installed with +this package will require the use of the `/std:c++17` compiler flag. + +libsigc++ itself has no external dependencies, but building the +benchmark test program will require an installation of the Boost +C++ libraries. + +Building with NMake +- +The following describes what items are built with the following +targets: + +* `all`, `examples`: (or no target specified): The libsigc++ DLL and the example programs. +* `tests`: The libsigc++ DLL and the test programs. +* `benchmark`: The libsigc++ DLL and the benchmark program, the Boost C++ headers should be found in one of the paths that are in`%INCLUDE%`. + +Building directly from a GIT checkout is now supported, provided that a `PERL` +installation is present (pass the `PERL` interpreter executable in your NMake +command line by using `nmake /f Makefile.vc ... PERL=` by using +the `prep-git-build` target. + +The following are instructions for performing such a build. A `clean` target is +provided-it is recommended that one cleans the build and redo the build if any +configuration option changed. An `install` target is also provided to copy the built +items in their appropriate +locations under `$(PREFIX)`, which is described below. + +Invoke the build by issuing the command: +`nmake /f Makefile.vc CFG=[release|debug] [PREFIX=...] ` +where: + +* `CFG`: Required. Choose from a `release` or `debug` build. Note that + all builds generate a `.pdb` file for each `.dll` and `.exe` built. + +* `PREFIX`: Optional. Base directory of where the third-party headers, libraries +and needed tools can be found, i.e. headers in `$(PREFIX)\include`, +libraries in `$(PREFIX)\lib` and tools and DLLs in `$(PREFIX)\bin`. If not +specified, `$(PREFIX)` is set as `$(srcroot)\..\vs$(X)\$(platform)`, where +`$(platform)` is `win32` for 32-bit builds or `x64` for 64-bit (Intel/AMD) +builds or `arm64` for 64-bit (ARM) builds, and `$(X)` is the short version of the +Visual Studio used, as follows: + * 2017: `15` + * 2019: `16` + * 2022: `17` + +* `USE_COMPAT_LIBS`: Build the libsigc++ DLL and .lib with the filename +`sigc-vc150(d)-3_0` for all builds. This is for compatibility reasons, +if re-building dependent code is not convenient, for instance + +* Options, set by `
@@ -431,7 +437,6 @@ asignal.connect( sigc::retype( sigc::ptr_fun(&dostuff) ) ); Reference - See the reference documentation online From 720bfb6ff8c27d51040b37ef75e7fe0e8977228b Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Thu, 7 Sep 2023 10:41:15 +0200 Subject: [PATCH 083/112] signal: Add connect_first() Add connect_first(const slot_base&) and connect_first(slot_base&&) in internal::signal_impl, signal_base, signal_with_accumulator and trackable_signal_with_accumulator. Replace some calls to connect() by connect_first() in test_signal and test_scoped_connection. Fixes #81 --- sigc++/adaptors/bind.h | 5 +- sigc++/adaptors/compose.h | 5 +- sigc++/adaptors/exception_catch.h | 5 +- sigc++/adaptors/hide.h | 5 +- sigc++/adaptors/retype.h | 3 +- sigc++/connection.h | 5 +- sigc++/scoped_connection.h | 5 +- sigc++/signal.h | 115 +++++++++++++++++++++++++----- sigc++/signal_base.cc | 24 +++++++ sigc++/signal_base.h | 45 ++++++++++-- tests/test_scoped_connection.cc | 8 +-- tests/test_signal.cc | 14 ++-- 12 files changed, 193 insertions(+), 46 deletions(-) diff --git a/sigc++/adaptors/bind.h b/sigc++/adaptors/bind.h index 1d48383e..70fb095d 100644 --- a/sigc++/adaptors/bind.h +++ b/sigc++/adaptors/bind.h @@ -53,8 +53,9 @@ namespace sigc * sigc::bind(&foo,1,2,3)(); //fixes all three arguments and calls foo(1,2,3) * @endcode * - * The functor sigc::bind() returns can be passed into - * @ref sigc::signal_with_accumulator::connect() "sigc::signal::connect()" directly. + * The functor that sigc::bind() returns can be passed directly into + * @ref sigc::signal_with_accumulator::connect() "sigc::signal::connect()" or + * @ref sigc::signal_with_accumulator::connect_first() "sigc::signal::connect_first()". * * @par Example: * @code diff --git a/sigc++/adaptors/compose.h b/sigc++/adaptors/compose.h index 10f948ca..ce5d221f 100644 --- a/sigc++/adaptors/compose.h +++ b/sigc++/adaptors/compose.h @@ -38,8 +38,9 @@ namespace sigc * square_root(9)) * @endcode * - * The functor sigc::compose() returns can be passed directly into - * @ref sigc::signal_with_accumulator::connect() "sigc::signal::connect()". + * The functor that sigc::compose() returns can be passed directly into + * @ref sigc::signal_with_accumulator::connect() "sigc::signal::connect()" or + * @ref sigc::signal_with_accumulator::connect_first() "sigc::signal::connect_first()". * * @par Example: * @code diff --git a/sigc++/adaptors/exception_catch.h b/sigc++/adaptors/exception_catch.h index f1dae2eb..26771421 100644 --- a/sigc++/adaptors/exception_catch.h +++ b/sigc++/adaptors/exception_catch.h @@ -61,8 +61,9 @@ namespace sigc * sigc::exception_catch(&foo, my_catch())(); * @endcode * - * The functor sigc::exception_catch() returns can be directly passed into - * @ref sigc::signal_with_accumulator::connect() "sigc::signal::connect()". + * The functor that sigc::exception_catch() returns can be passed directly into + * @ref sigc::signal_with_accumulator::connect() "sigc::signal::connect()" or + * @ref sigc::signal_with_accumulator::connect_first() "sigc::signal::connect_first()". * * @par Example: * @code diff --git a/sigc++/adaptors/hide.h b/sigc++/adaptors/hide.h index d8e95797..a8e0b968 100644 --- a/sigc++/adaptors/hide.h +++ b/sigc++/adaptors/hide.h @@ -50,8 +50,9 @@ namespace sigc * sigc::hide<2>(&foo)(1,2,3); // adds a dummy parameter at the back and calls foo(1,2) * @endcode * - * The functor sigc::hide() returns can be directly passed into - * @ref sigc::signal_with_accumulator::connect() "sigc::signal::connect()". + * The functor that sigc::hide() returns can be passed directly into + * @ref sigc::signal_with_accumulator::connect() "sigc::signal::connect()" or + * @ref sigc::signal_with_accumulator::connect_first() "sigc::signal::connect_first()". * * @par Example: * @code diff --git a/sigc++/adaptors/retype.h b/sigc++/adaptors/retype.h index ce2adcd1..fd8fd327 100644 --- a/sigc++/adaptors/retype.h +++ b/sigc++/adaptors/retype.h @@ -41,7 +41,8 @@ namespace sigc * @endcode * * The functor that sigc::retype() returns can be passed directly into - * @ref sigc::signal_with_accumulator::connect() "sigc::signal::connect()". + * @ref sigc::signal_with_accumulator::connect() "sigc::signal::connect()" or + * @ref sigc::signal_with_accumulator::connect_first() "sigc::signal::connect_first()". * * @par Example: * @code diff --git a/sigc++/connection.h b/sigc++/connection.h index fabf1236..3fd25085 100644 --- a/sigc++/connection.h +++ b/sigc++/connection.h @@ -30,8 +30,9 @@ namespace sigc /** Convenience class for safe disconnection. * * This may be used to disconnect the referred slot at any time (disconnect()). - * @ref sigc::signal_with_accumulator::connect() "sigc::signal::connect()" - * returns a %sigc::connection. + * @ref sigc::signal_with_accumulator::connect() "sigc::signal::connect()" and + * @ref sigc::signal_with_accumulator::connect_first() "sigc::signal::connect_first()" + * return a %sigc::connection. * * @code * sigc::connection conn = sig.connect(sigc::mem_fun(a, &A::foo)); diff --git a/sigc++/scoped_connection.h b/sigc++/scoped_connection.h index 298a9c21..fe9012d0 100644 --- a/sigc++/scoped_connection.h +++ b/sigc++/scoped_connection.h @@ -34,8 +34,9 @@ namespace sigc * * You will use sigc::scoped_connection by constructing it from a ‘normal’, * unscoped @ref sigc::connection, such as those returned by - * @ref sigc::signal_with_accumulator::connect() "sigc::signal::connect()", thus - * ‘wrapping’ the connection in a scoped_connection, adding auto-disconnection. + * @ref sigc::signal_with_accumulator::connect() "sigc::signal::connect()" and + * @ref sigc::signal_with_accumulator::connect_first() "sigc::signal::connect_first()", + * thus ‘wrapping’ the connection in a scoped_connection, adding auto-disconnection. * It can also be assigned from an unscoped connection, in which case, if there * was a previous slot referred to by the scoped connection, it is disconnected. * diff --git a/sigc++/signal.h b/sigc++/signal.h index 8cddf103..2075bc3d 100644 --- a/sigc++/signal.h +++ b/sigc++/signal.h @@ -374,14 +374,14 @@ struct signal_emit /** Signal declaration. * %signal_with_accumulator can be used to connect() slots that are invoked * during subsequent calls to emit(). Any functor or slot - * can be passed into connect(). It is converted into a slot + * can be passed into connect() or connect_first(). It is converted into a slot * implicitly. * * If you want to connect one signal to another, use make_slot() * to retrieve a functor that emits the signal when invoked. * - * Be careful if you directly pass one signal into the connect() - * method of another: a shallow copy of the signal is made and + * Be careful if you directly pass one signal into the connect() or + * connect_first() method of another: a shallow copy of the signal is made and * the signal's slots are not disconnected until both the signal * and its clone are destroyed, which is probably not what you want! * @@ -401,8 +401,8 @@ class signal_with_accumulator : public signal_base public: using slot_type = slot; - /** Add a slot to the list of slots. - * Any functor or slot may be passed into connect(). + /** Add a slot at the end of the list of slots. + * Any functor or slot may be passed into %connect(). * It will be converted into a slot implicitly. * The returned connection may be stored for disconnection * of the slot at some later point. It stays valid until @@ -426,7 +426,7 @@ class signal_with_accumulator : public signal_base return connection(slot_base); } - /** Add a slot to the list of slots. + /** Add a slot at the end of the list of slots. * @see connect(const slot_type& slot_). * * @newin{2,8} @@ -438,6 +438,45 @@ class signal_with_accumulator : public signal_base return connection(slot_base); } + /** Add a slot at the beginning of the list of slots. + * Any functor or slot may be passed into %connect_first(). + * It will be converted into a slot implicitly. + * The returned connection may be stored for disconnection + * of the slot at some later point. It stays valid until + * the slot is disconnected from the signal. + * std::function<> and C++11 lambda expressions are functors. + * These are examples of functors that can be connected to a signal. + * + * %std::bind() creates a functor, but this functor typically has an + * %operator()() which is a variadic template. + * Our functor_trait can't deduce the result type + * of such a functor. If you first assign the return value of %std::bind() + * to a std::function, you can connect the std::function to a signal. + * + * @param slot_ The slot to add to the list of slots. + * @return A connection. + * + * @newin{3,6} + */ + connection connect_first(const slot_type& slot_) + { + auto iter = signal_base::connect_first(slot_); + auto& slot_base = *iter; + return connection(slot_base); + } + + /** Add a slot at the beginning of the list of slots. + * @see connect_first(const slot_type& slot_). + * + * @newin{3,6} + */ + connection connect_first(slot_type&& slot_) + { + auto iter = signal_base::connect_first(std::move(slot_)); + auto& slot_base = *iter; + return connection(slot_base); + } + /** Triggers the emission of the signal. * During signal emission all slots that have been connected * to the signal are invoked unless they are manually set into @@ -505,14 +544,14 @@ class signal_with_accumulator : public signal_base /** signal can be used to connect() slots that are invoked * during subsequent calls to emit(). Any functor or slot - * can be passed into connect(). It is converted into a slot + * can be passed into connect() or connect_first(). It is converted into a slot * implicitly. * * If you want to connect one signal to another, use make_slot() * to retrieve a functor that emits the signal when invoked. * - * Be careful if you directly pass one signal into the connect() - * method of another: a shallow copy of the signal is made and + * Be careful if you directly pass one signal into the connect() or + * connect_first() method of another: a shallow copy of the signal is made and * the signal's slots are not disconnected until both the signal * and its clone are destroyed, which is probably not what you want! * @@ -634,13 +673,14 @@ class signal : public signal_with_accumulator; - /** Add a slot to the list of slots. - * Any functor or slot may be passed into connect(). + /** Add a slot at the end of the list of slots. + * Any functor or slot may be passed into %connect(). * It will be converted into a slot implicitly. * The returned connection may be stored for disconnection * of the slot at some later point. It stays valid until @@ -689,7 +729,7 @@ class trackable_signal_with_accumulator return connection(slot_base); } - /** Add a slot to the list of slots. + /** Add a slot at the end of the list of slots. * @see connect(const slot_type& slot_). */ connection connect(slot_type&& slot_) @@ -699,6 +739,45 @@ class trackable_signal_with_accumulator return connection(slot_base); } + /** Add a slot at the beginning of the list of slots. + * Any functor or slot may be passed into %connect_first(). + * It will be converted into a slot implicitly. + * The returned connection may be stored for disconnection + * of the slot at some later point. It stays valid until + * the slot is disconnected from the signal. + * std::function<> and C++11 lambda expressions are functors. + * These are examples of functors that can be connected to a signal. + * + * %std::bind() creates a functor, but this functor typically has an + * %operator()() which is a variadic template. + * Our functor_trait can't deduce the result type + * of such a functor. If you first assign the return value of %std::bind() + * to a std::function, you can connect the std::function to a signal. + * + * @param slot_ The slot to add to the list of slots. + * @return A connection. + * + * @newin{3,6} + */ + connection connect_first(const slot_type& slot_) + { + auto iter = signal_base::connect_first(slot_); + auto& slot_base = *iter; + return connection(slot_base); + } + + /** Add a slot at the beginning of the list of slots. + * @see connect_first(const slot_type& slot_). + * + * @newin{3,6} + */ + connection connect_first(slot_type&& slot_) + { + auto iter = signal_base::connect_first(std::move(slot_)); + auto& slot_base = *iter; + return connection(slot_base); + } + /** Triggers the emission of the signal. * During signal emission all slots that have been connected * to the signal are invoked unless they are manually set into @@ -772,14 +851,14 @@ class trackable_signal_with_accumulator /** %trackable_signal can be used to connect() slots that are invoked * during subsequent calls to emit(). Any functor or slot - * can be passed into connect(). It is converted into a slot + * can be passed into connect() or connect_first(). It is converted into a slot * implicitly. * * If you want to connect one signal to another, use make_slot() * to retrieve a functor that emits the signal when invoked. * - * Be careful if you directly pass one signal into the connect() - * method of another: a shallow copy of the signal is made and + * Be careful if you directly pass one signal into the connect() or + * connect_first() method of another: a shallow copy of the signal is made and * the signal's slots are not disconnected until both the signal * and its clone are destroyed, which is probably not what you want! * diff --git a/sigc++/signal_base.cc b/sigc++/signal_base.cc index c92a0913..f88bc483 100644 --- a/sigc++/signal_base.cc +++ b/sigc++/signal_base.cc @@ -128,6 +128,18 @@ signal_impl::connect(slot_base&& slot_) return insert(slots_.end(), std::move(slot_)); } +signal_impl::iterator_type +signal_impl::connect_first(const slot_base& slot_) +{ + return insert(slots_.begin(), slot_); +} + +signal_impl::iterator_type +signal_impl::connect_first(slot_base&& slot_) +{ + return insert(slots_.begin(), std::move(slot_)); +} + void signal_impl::add_notification_to_iter(const signal_impl::iterator_type& iter) { @@ -260,6 +272,18 @@ signal_base::connect(slot_base&& slot_) return impl()->connect(std::move(slot_)); } +signal_base::iterator_type +signal_base::connect_first(const slot_base& slot_) +{ + return impl()->connect_first(slot_); +} + +signal_base::iterator_type +signal_base::connect_first(slot_base&& slot_) +{ + return impl()->connect_first(std::move(slot_)); +} + signal_base::iterator_type signal_base::insert(iterator_type i, const slot_base& slot_) { diff --git a/sigc++/signal_base.h b/sigc++/signal_base.h index d21e4b3b..5a46a271 100644 --- a/sigc++/signal_base.h +++ b/sigc++/signal_base.h @@ -109,13 +109,13 @@ struct SIGC_API signal_impl : public std::enable_shared_from_this */ void block(bool should_block = true) noexcept; - /** Adds a slot at the bottom of the list of slots. + /** Adds a slot at the end of the list of slots. * @param slot_ The slot to add to the list of slots. * @return An iterator pointing to the new slot in the list. */ iterator_type connect(const slot_base& slot_); - /** Adds a slot at the bottom of the list of slots. + /** Adds a slot at the end of the list of slots. * @param slot_ The slot to add to the list of slots. * @return An iterator pointing to the new slot in the list. * @@ -123,6 +123,22 @@ struct SIGC_API signal_impl : public std::enable_shared_from_this */ iterator_type connect(slot_base&& slot_); + /** Adds a slot at the beginning of the list of slots. + * @param slot_ The slot to add to the list of slots. + * @return An iterator pointing to the new slot in the list. + * + * @newin{3,6} + */ + iterator_type connect_first(const slot_base& slot_); + + /** Adds a slot at the beginning of the list of slots. + * @param slot_ The slot to add to the list of slots. + * @return An iterator pointing to the new slot in the list. + * + * @newin{3,6} + */ + iterator_type connect_first(slot_base&& slot_); + /** Adds a slot at the given position into the list of slots. * @param i An iterator indicating the position where @p slot_ should be inserted. * @param slot_ The slot to add to the list of slots. @@ -220,6 +236,7 @@ struct SIGC_API signal_impl_holder /** @defgroup signal Signals * Use @ref sigc::signal_with_accumulator::connect() "sigc::signal::connect()" + * or @ref sigc::signal_with_accumulator::connect_first() "sigc::signal::connect_first()" * with sigc::mem_fun() and sigc::ptr_fun() to connect a method or function with a signal. * * @code @@ -347,7 +364,7 @@ struct SIGC_API signal_base using iterator_type = internal::signal_impl::iterator_type; /** Adds a slot at the end of the list of slots. - * With connect(), slots can also be added during signal emission. + * With %connect(), slots can also be added during signal emission. * In this case, they won't be executed until the next emission occurs. * @param slot_ The slot to add to the list of slots. * @return An iterator pointing to the new slot in the list. @@ -355,7 +372,7 @@ struct SIGC_API signal_base iterator_type connect(const slot_base& slot_); /** Adds a slot at the end of the list of slots. - * With connect(), slots can also be added during signal emission. + * With %connect(), slots can also be added during signal emission. * In this case, they won't be executed until the next emission occurs. * @param slot_ The slot to add to the list of slots. * @return An iterator pointing to the new slot in the list. @@ -364,6 +381,26 @@ struct SIGC_API signal_base */ iterator_type connect(slot_base&& slot_); + /** Adds a slot at the beginning of the list of slots. + * With %connect_first(), slots can also be added during signal emission. + * In this case, they won't be executed until the next emission occurs. + * @param slot_ The slot to add to the list of slots. + * @return An iterator pointing to the new slot in the list. + * + * @newin{3,6} + */ + iterator_type connect_first(const slot_base& slot_); + + /** Adds a slot at the beginning of the list of slots. + * With %connect_fist(), slots can also be added during signal emission. + * In this case, they won't be executed until the next emission occurs. + * @param slot_ The slot to add to the list of slots. + * @return An iterator pointing to the new slot in the list. + * + * @newin{3,6} + */ + iterator_type connect_first(slot_base&& slot_); + /** Adds a slot at the given position into the list of slots. * Note that this function does not work during signal emission! * @param i An iterator indicating the position where @e slot_ should be inserted. diff --git a/tests/test_scoped_connection.cc b/tests/test_scoped_connection.cc index c85ebc30..520197fc 100644 --- a/tests/test_scoped_connection.cc +++ b/tests/test_scoped_connection.cc @@ -67,12 +67,12 @@ main(int argc, char* argv[]) { A a; sig.connect(sigc::mem_fun(a, &A::foo)); - confoo = sig.connect(&foo); conbar = sig.connect(&bar); + confoo = sig.connect_first(&foo); result_stream << "sig is connected to (size=" << sig.size() << "): "; sig(1); util->check_result( - result_stream, "sig is connected to (size=3): A::foo(1) foo(1) bar(1) "); + result_stream, "sig is connected to (size=3): foo(1) A::foo(1) bar(1) "); } // normal connections are still connected. mem_fun disconnected via trackable. result_stream << "sig is connected to (size=" << sig.size() << "): "; @@ -83,11 +83,11 @@ main(int argc, char* argv[]) A a; sig.connect(sigc::mem_fun(a, &A::foo)); sigc::scoped_connection sconfoo = sig.connect(&foo); - sigc::scoped_connection sconbar = sig.connect(&bar); + sigc::scoped_connection sconbar = sig.connect_first(&bar); result_stream << "sig is connected to (size=" << sig.size() << "): "; sig(3); util->check_result( - result_stream, "sig is connected to (size=5): foo(3) bar(3) A::foo(3) foo(3) bar(3) "); + result_stream, "sig is connected to (size=5): bar(3) foo(3) bar(3) A::foo(3) foo(3) "); } // scoped connections are now disconnected. result_stream << "sig is connected to (size=" << sig.size() << "): "; diff --git a/tests/test_signal.cc b/tests/test_signal.cc index ff197a4d..a7650dd8 100644 --- a/tests/test_signal.cc +++ b/tests/test_signal.cc @@ -50,7 +50,7 @@ void test_simple() { sigc::signal sig; - sig.connect(sigc::ptr_fun(&foo)); + sig.connect([](int i) { return foo(i); }); sig(1); util->check_result(result_stream, "foo(int 1) "); @@ -74,17 +74,17 @@ test_auto_disconnection() { A a; sig.connect(sigc::ptr_fun(&foo)); - sig.connect(sigc::mem_fun(a, &A::foo)); - sig.connect(sigc::ptr_fun(&bar)); + sig.connect_first(sigc::mem_fun(a, &A::foo)); + sig.connect_first(sigc::ptr_fun(&bar)); sig(1); result_stream << sig.size(); - util->check_result(result_stream, "foo(int 1) A::foo(int 1) bar(float 1) 3"); + util->check_result(result_stream, "bar(float 1) A::foo(int 1) foo(int 1) 3"); } // a dies => auto-disconnect sig(2); result_stream << sig.size(); - util->check_result(result_stream, "foo(int 2) bar(float 2) 2"); + util->check_result(result_stream, "bar(float 2) foo(int 2) 2"); } void @@ -106,12 +106,12 @@ test_make_slot() // test make_slot() sigc::signal sig; sig.connect(sigc::ptr_fun(&foo)); - sig.connect(sigc::ptr_fun(&bar)); + sig.connect_first([](float i) { return bar(i); }); sig.connect(sigc::ptr_fun(&foo)); sigc::signal sig2; sig2.connect(sig.make_slot()); sig2(3); - util->check_result(result_stream, "foo(int 3) bar(float 3) foo(int 3) "); + util->check_result(result_stream, "bar(float 3) foo(int 3) foo(int 3) "); // Delete a trackable_signal that has been connected to sig2. sig2.clear(); From eb7db8ef3b5cba44ec4b46d158ec03e2aa3c537a Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Sun, 1 Oct 2023 10:26:50 +0200 Subject: [PATCH 084/112] 3.6.0 --- NEWS | 37 +++++++++++++++++++++++++++++++++++++ configure.ac | 2 +- meson.build | 2 +- 3 files changed, 39 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 19a16c32..435a7b47 100755 --- a/NEWS +++ b/NEWS @@ -1,3 +1,40 @@ +3.6.0 (stable) + +* sigc++config.h.*: Update and clean up a bit for Visual Studio + (Chun-wei Fan) Pull request #95 +* scoped_connection: New wrapper to auto-disconnect a slot + Issue #87, pull request #97 (Daniel Boles) +* signal: Add connect_first() + (Kjell Ahlstedt) Issue #81 (LordVolumeForm) + +Documentation: +* connection: Improve the class documentation + (Kjell Ahlstedt) Issue #88 (Daniel Boles) +* Improve Visual Studio build documentation + (Chun-wei Fan) Pull request #93 +* Remove AUTHORS and add general information to README.md + (Kjell Ahlstedt) Issue gtkmm#140 +* manual: Add paragraph about new scoped_connection + Pull request #99 (Daniel Boles) + +Tests: +* Add test_scoped_connection + Pull request #97 (Daniel Boles) + +Build: +* Meson: Don't copy files with configure_file() + (Kjell Ahlstedt) +* Meson: Fix the evaluation of is_git_build on Windows + (Kjell Ahlstedt) Issue gtkmm#131 (William Roy) +* CMake: Prevent multiple target declaration for uninstall + (Francesco Emanuele D'Agostino) Pull request #85 +* Visual Studio: Support static builds + Issue #90 (Swat-SomeBug) + (Chun-wei Fan) Pull request #91 +* Meson: Don't require the 'dot' command to build the documentation + (Kjell Ahlstedt) Issue #98 + + 3.4.0 (stable) * Add track_object(), deprecate track_obj() diff --git a/configure.ac b/configure.ac index 557a4ad6..1fa3d547 100644 --- a/configure.ac +++ b/configure.ac @@ -15,7 +15,7 @@ ## You should have received a copy of the GNU Lesser General Public License ## along with this library. If not, see . -AC_INIT([libsigc++], [3.4.0], +AC_INIT([libsigc++], [3.6.0], [https://github.com/libsigcplusplus/libsigcplusplus/issues/], [libsigc++], [https://libsigcplusplus.github.io/libsigcplusplus/]) AC_PREREQ([2.59]) diff --git a/meson.build b/meson.build index 52334f0f..4547fc8c 100644 --- a/meson.build +++ b/meson.build @@ -1,7 +1,7 @@ # This file is part of libsigc++. project('libsigc++', 'cpp', - version: '3.4.0', + version: '3.6.0', license: 'LGPLv2.1+', default_options: [ 'cpp_std=c++17', From e62bf47f1743a85c980519eeff91ab76a3725c70 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Mon, 11 Dec 2023 11:18:59 +0100 Subject: [PATCH 085/112] meson.build: Don't fail if warning_level=everything --- meson.build | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 4547fc8c..6e312df5 100644 --- a/meson.build +++ b/meson.build @@ -87,7 +87,12 @@ if is_dist_check else cpp_warnings = get_option('warnings') endif -warning_level = get_option('warning_level').to_int() +if get_option('warning_level') in ['0','1','2','3','4','5'] + warning_level = get_option('warning_level').to_int() +else + # For instance get_option('warning_level') == 'everything' + warning_level = 99 +endif werror = get_option('werror') build_deprecated_api = get_option('build-deprecated-api') build_documentation_opt = get_option('build-documentation') From 0e79f1ab17590da8b1eb93fddf941e3a9e813d31 Mon Sep 17 00:00:00 2001 From: Daniel Boles Date: Thu, 23 Nov 2023 22:14:35 +0000 Subject: [PATCH 086/112] slot|signal: static_assert not using R,T... syntax This can lead to clearer errors by explaining the user's error, not just saying they used an incomplete type (why is it incomplete?). I don't use only static_assert(false) because that's ill-formed before C++23, AFAIK, & even if it's OK in some cases I don't grok which... so hope this works https://github.com/libsigcplusplus/libsigcplusplus/issues/86 --- sigc++/functors/slot.h | 4 +++- sigc++/signal.h | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/sigc++/functors/slot.h b/sigc++/functors/slot.h index 3f4b5108..fc7f2af3 100644 --- a/sigc++/functors/slot.h +++ b/sigc++/functors/slot.h @@ -194,7 +194,9 @@ struct slot_call */ #ifndef DOXYGEN_SHOULD_SKIP_THIS template -class slot; +class slot final { + static_assert(sizeof...(T_arg) < 0, "The slot syntax has been removed. Use the slot syntax."); +}; #endif // DOXYGEN_SHOULD_SKIP_THIS template diff --git a/sigc++/signal.h b/sigc++/signal.h index 2075bc3d..675c1a0b 100644 --- a/sigc++/signal.h +++ b/sigc++/signal.h @@ -581,7 +581,9 @@ class signal_with_accumulator : public signal_base */ #ifndef DOXYGEN_SHOULD_SKIP_THIS template -class signal; +class signal final { + static_assert(sizeof...(T_arg) < 0, "The signal syntax has been removed. Use the signal syntax."); +}; #endif // DOXYGEN_SHOULD_SKIP_THIS template From 6d38d0178d07394e98c77bf9fa0a88cc2bab610f Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Tue, 26 Dec 2023 10:28:39 +0100 Subject: [PATCH 087/112] README.md: Add info about building the documentation Fixes #101 --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index fe9a88cb..bb60b64e 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,21 @@ supplier of your operating system, such as your Linux distribution. For instance, Ubuntu Linux, Debian Linux and Fedora Linux have official libsigc++ packages. +## Building the documentation + +The reference documentaion is built with Doxygen. + +The manual is a DocBook 5.0 document. These packages are recommended when building +the manual (can have other names in other distros): + - docbook5-xml (Ubuntu and Debian) or docbook5-schemas (Fedora) + - docbook-xsl (Ubuntu and Debian) or docbook-style-xsl (Fedora) + +It may be possible to build without these packages, but it will be slow and error prone. +The `xmllint` command is told to read files from http://docbook.org. +The `xsltproc` command is told to read files from http://docbook.sourceforge.net. +The commands first search for local copies of those files. If local copies exist +and are installed at expected locations, the commands make no network accesses. + ## Building from a release tarball Building from a release tarball is easier than building from git. From 5073536fd166f3e75ab0386dfde6451e762cb1f8 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Sun, 14 Jan 2024 10:07:46 +0100 Subject: [PATCH 088/112] Meson build: Add the build-manual option --- docs/docs/manual/meson.build | 10 ++++++---- meson.build | 22 ++++++++++++++++++---- meson_options.txt | 6 ++++-- 3 files changed, 28 insertions(+), 10 deletions(-) diff --git a/docs/docs/manual/meson.build b/docs/docs/manual/meson.build index 8c721c8e..415375f5 100644 --- a/docs/docs/manual/meson.build +++ b/docs/docs/manual/meson.build @@ -3,11 +3,13 @@ # input: install_datadir, sigcxx_pcname, tutorial_custom_cmd, python3, # build_documentation, book_name, can_add_dist_script, xsltproc # output: can_parse_and_validate, build_pdf_by_default, can_build_pdf, -# install_tutorialdir +# install_tutorialdir, build_manual_opt, build_manual + +build_manual_opt = get_option('build-manual') +build_manual = build_manual_opt and build_documentation xmllint = find_program('xmllint', required: false) can_parse_and_validate = xmllint.found() - validate = get_option('validation') ? 'true' : 'false' dblatex = find_program('dblatex', required: false) @@ -18,8 +20,8 @@ build_pdf_by_default = get_option('build-pdf') # Installation directories are relative to {prefix}. install_tutorialdir = install_datadir / 'doc' / book_name / 'tutorial' -if not build_documentation - # Documentation shall not be built or installed. +if not build_manual + # The manual shall not be built or installed. # Return to the calling meson.build file. subdir_done() endif diff --git a/meson.build b/meson.build index 6e312df5..91cb11f8 100644 --- a/meson.build +++ b/meson.build @@ -335,16 +335,29 @@ if build_documentation_opt == 'if-maintainer-mode' real_build_documentation = ' (@0@)'.format(build_documentation) endif -validate = get_option('validation') and can_parse_and_validate +explain_man = '' +if build_manual_opt and not build_manual + explain_man = ' (requires that documentation is built)' +endif + +validate = get_option('validation') and can_parse_and_validate and build_manual explain_val = '' if get_option('validation') and not validate - explain_val = ' (requires xmllint with Relax NG and DocBook V5.0 support)' + if not build_manual + explain_val = ' (requires that the tutorial is built)' + else + explain_val = ' (requires xmllint with Relax NG and DocBook V5.0 support)' + endif endif -build_pdf = build_pdf_by_default and can_build_pdf +build_pdf = build_pdf_by_default and can_build_pdf and build_manual explain_pdf = '' if build_pdf_by_default and not build_pdf - explain_pdf = ' (requires dblatex or (xsltproc and fop))' + if not build_manual + explain_pdf = ' (requires that the tutorial is built)' + else + explain_pdf = ' (requires dblatex or (xsltproc and fop))' + endif endif summary = [ @@ -357,6 +370,7 @@ summary = [ format(cpp_warnings, warning_level, werror), ' Build deprecated API: @0@'.format(build_deprecated_api), 'Build HTML documentation: @0@@1@'.format(build_documentation_opt, real_build_documentation), + ' Build tutorial: @0@@1@'.format(build_manual, explain_man), ' XML validation: @0@@1@'.format(validate, explain_val), ' Build PDF: @0@@1@'.format(build_pdf, explain_pdf), ' Build example programs: @0@'.format(build_examples), diff --git a/meson_options.txt b/meson_options.txt index eea909a9..0255a923 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -8,10 +8,12 @@ option('build-deprecated-api', type: 'boolean', value: true, description: 'Build deprecated API and include it in the library') option('build-documentation', type: 'combo', choices: ['false', 'if-maintainer-mode', 'true'], value: 'if-maintainer-mode', description: 'Build and install the documentation') +option('build-manual', type: 'boolean', value: true, + description: 'Build tutorial HTML files, if documentation is built') option('validation', type: 'boolean', value: true, - description: 'Validate the tutorial XML file') + description: 'Validate the tutorial XML file, if tutorial HTML files are built') option('build-pdf', type: 'boolean', value: false, - description: 'Build tutorial PDF file') + description: 'Build tutorial PDF file, if tutorial HTML files are built') option('build-examples', type: 'boolean', value: true, description: 'Build example programs') option('build-tests', type: 'boolean', value: true, From dc0e374210e05b10f7c862c9ded5a93ff05a668a Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Sun, 14 Jan 2024 10:20:34 +0100 Subject: [PATCH 089/112] meson.build: Update htmlrefpub --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 91cb11f8..537ac84b 100644 --- a/meson.build +++ b/meson.build @@ -308,7 +308,7 @@ endif if meson.is_subproject() pkgconfig_vars = { 'htmlrefdir': install_prefix / install_docdir / 'reference' / 'html', - 'htmlrefpub': 'http://library.gnome.org/devel/libsigc++/unstable/' + 'htmlrefpub': 'https://libsigcplusplus.github.io/libsigcplusplus/reference/html/' } if build_documentation pkgconfig_vars += {'doxytagfile': tag_file.full_path()} From e98e13199ab7fd669126e3534d3e6744e87c1bad Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Mon, 15 Jan 2024 12:42:13 +0100 Subject: [PATCH 090/112] CI: Build reference documentation with meson-msvc --- .github/workflows/meson-msvc.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/meson-msvc.yml b/.github/workflows/meson-msvc.yml index 968fd825..a9aef1a1 100644 --- a/.github/workflows/meson-msvc.yml +++ b/.github/workflows/meson-msvc.yml @@ -9,6 +9,7 @@ jobs: steps: - uses: actions/checkout@v3 + - uses: ssciwr/doxygen-install@v1 - uses: actions/setup-python@v4 with: python-version: '3.x' @@ -21,12 +22,11 @@ jobs: - name: Configure # Don't use warning_level or werror. They are applied also to subprojects. - # 2023-07-28: Why is the documentation not built? # With the latest fixes in mm-common and libsigc++ it's possible # to build the reference documentation, but it's error-prone to build # the manual. AFAIK there are no easily installable docbook5-xml and # docbook-xsl packages for Windows. - run: meson setup -Dwarnings=fatal -Dmaintainer-mode=false -Dbuild-documentation=false _build + run: meson setup -Dwarnings=fatal -Dbuild-manual=false -Dmm-common:use-network=true _build - name: Compile run: meson compile -C _build From dae8f5839e447b93b13a3b00ff2ddc279b47411e Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Mon, 25 Mar 2024 11:13:29 +0100 Subject: [PATCH 091/112] scoped_connection: Remove [[nodiscard]] Can cause unwarranted warnings from some compilers, or compiler versions. Fixes #102 --- sigc++/scoped_connection.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sigc++/scoped_connection.h b/sigc++/scoped_connection.h index fe9012d0..0f36e1a3 100644 --- a/sigc++/scoped_connection.h +++ b/sigc++/scoped_connection.h @@ -83,14 +83,14 @@ namespace sigc struct SIGC_API scoped_connection final { /** Constructs an empty scoped connection object. */ - [[nodiscard]] scoped_connection() noexcept = default; + scoped_connection() noexcept = default; /** Constructs a scoped connection object from an unscoped connection object. * The source connection still refers to the slot and can manually disconnect. * @param c The connection object to make a copy from, whose slot weʼll * automatically disconnect when the scoped_connection object is destroyed. */ - [[nodiscard]] scoped_connection(connection c) noexcept; + scoped_connection(connection c) noexcept; /** Overrides this scoped connection object copying an unscoped connection. * The current slot, if any, will be disconnect()ed before being replaced. @@ -127,17 +127,17 @@ struct SIGC_API scoped_connection final /** Returns whether the connection is still active. * @return @p false if the connection is still active. */ - [[nodiscard]] bool empty() const noexcept; + bool empty() const noexcept; /** Returns whether the connection is still active. * @return @p true if the connection is still active. */ - [[nodiscard]] bool connected() const noexcept; + bool connected() const noexcept; /** Returns whether the connection is blocked. * @return @p true if the connection is blocked. */ - [[nodiscard]] bool blocked() const noexcept; + bool blocked() const noexcept; /** Sets or unsets the blocking state of this connection. * See slot_base::block() for details. @@ -157,13 +157,13 @@ struct SIGC_API scoped_connection final /** Returns whether the connection is still active. * @return @p true if the connection is still active. */ - [[nodiscard]] explicit operator bool() const noexcept; + explicit operator bool() const noexcept; /** Releases the connection from a scoped connection object. * The scoped connection will no longer refer to / disconnect the slot. * @return An unscoped connection object referring to the same slot. */ - [[nodiscard]] connection release() noexcept; + connection release() noexcept; private: sigc::connection conn_; From 18e6a6ff0f68e929e22e301a5692aaac8f9c3f54 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Tue, 21 May 2024 15:50:13 +0200 Subject: [PATCH 092/112] docs/doc.md: Don't link to developer-old.gnome.org That web site has been removed. --- docs/doc.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/docs/doc.md b/docs/doc.md index 7d5e6ede..aaf3cc10 100644 --- a/docs/doc.md +++ b/docs/doc.md @@ -5,11 +5,7 @@ title: Documentation ## libsigc++-2.0 -We have [tutorial-style](https://developer-old.gnome.org/libsigc++-tutorial/2.10/) -and [reference](https://developer-old.gnome.org/libsigc++/2.10/) documentation. - -This documentation is frozen on the web. It does not document the latest release. -If you want newer documentation, you can download a tarball from +The documentation is not available online. You can download a tarball from [GitHub releases](https://github.com/libsigcplusplus/libsigcplusplus/releases/) or the [GNOME download site](https://download.gnome.org/sources/libsigc++/), extract it, and view the documentation at *untracked/docs/*. From f45fde5723778b6f942a605ce3ea76d28e3dd55b Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Wed, 3 Jul 2024 16:06:58 +0200 Subject: [PATCH 093/112] docs/docs/reference/Doxyfile.in: Remove obsolete entries --- docs/docs/reference/Doxyfile.in | 6 ------ 1 file changed, 6 deletions(-) diff --git a/docs/docs/reference/Doxyfile.in b/docs/docs/reference/Doxyfile.in index 56ae8461..1f1c4a52 100644 --- a/docs/docs/reference/Doxyfile.in +++ b/docs/docs/reference/Doxyfile.in @@ -162,7 +162,6 @@ HTML_EXTRA_FILES = HTML_COLORSTYLE_HUE = 220 HTML_COLORSTYLE_SAT = 100 HTML_COLORSTYLE_GAMMA = 80 -HTML_TIMESTAMP = YES HTML_DYNAMIC_SECTIONS = NO HTML_INDEX_NUM_ENTRIES = 100 GENERATE_DOCSET = NO @@ -193,7 +192,6 @@ ENUM_VALUES_PER_LINE = 1 TREEVIEW_WIDTH = 250 EXT_LINKS_IN_WINDOW = NO FORMULA_FONTSIZE = 10 -FORMULA_TRANSPARENT = YES USE_MATHJAX = NO MATHJAX_FORMAT = HTML-CSS MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest @@ -225,7 +223,6 @@ USE_PDFLATEX = YES LATEX_BATCHMODE = NO LATEX_HIDE_INDICES = NO LATEX_BIB_STYLE = plain -LATEX_TIMESTAMP = NO #--------------------------------------------------------------------------- # Configuration options related to the RTF output #--------------------------------------------------------------------------- @@ -298,8 +295,6 @@ DIA_PATH = HIDE_UNDOC_RELATIONS = NO HAVE_DOT = @DOXYGEN_HAVE_DOT@ DOT_NUM_THREADS = 0 -DOT_FONTNAME = Sans -DOT_FONTSIZE = 10 DOT_FONTPATH = CLASS_GRAPH = YES COLLABORATION_GRAPH = NO @@ -323,7 +318,6 @@ PLANTUML_JAR_PATH = PLANTUML_INCLUDE_PATH = DOT_GRAPH_MAX_NODES = 50 MAX_DOT_GRAPH_DEPTH = 0 -DOT_TRANSPARENT = NO DOT_MULTI_TARGETS = YES GENERATE_LEGEND = YES DOT_CLEANUP = YES From 354f8d28a9e7bd044cb7480e685a89df8a717340 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Wed, 3 Jul 2024 16:07:23 +0200 Subject: [PATCH 094/112] Don't link to removed parts of gnome.org Don't link to library.gnome.org or developer.gnome.org. Require python3 >= 3.7. That's what Meson requires. --- meson.build | 2 +- sigc++-uninstalled.pc.in | 2 +- sigc++/sigc++.h | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/meson.build b/meson.build index 537ac84b..01b3c954 100644 --- a/meson.build +++ b/meson.build @@ -41,7 +41,7 @@ project_build_root = meson.current_build_dir() cpp_compiler = meson.get_compiler('cpp') is_msvc = cpp_compiler.get_id() == 'msvc' -python3 = find_program('python3', version: '>=3.5') +python3 = find_program('python3', version: '>=3.7') # MSVC: We currently do not support shared and static builds at the, # same time, since we need different defines/cflags for proper diff --git a/sigc++-uninstalled.pc.in b/sigc++-uninstalled.pc.in index 9e912961..89b2c26c 100644 --- a/sigc++-uninstalled.pc.in +++ b/sigc++-uninstalled.pc.in @@ -1,5 +1,5 @@ doxytagfile=${pc_top_builddir}/docs/reference/libsigc++-@SIGCXX_API_VERSION@.tag -htmlrefpub=http://library.gnome.org/devel/libsigc++/unstable/ +htmlrefpub=https://libsigcplusplus.github.io/libsigcplusplus/reference/html/ Name: libsigc++ Description: Typesafe signal and callback system for C++, not installed diff --git a/sigc++/sigc++.h b/sigc++/sigc++.h index 1387f314..45a4fa91 100644 --- a/sigc++/sigc++.h +++ b/sigc++/sigc++.h @@ -34,10 +34,10 @@ * @ref slot "Slots" and @ref adaptors "Adaptors". * * See also the - * libsigc++ tutorial, + * libsigc++ tutorial, * the libsigc++ website, and - * the Signals - * appendix of the Programming with gtkmm book. + * the + * Signals appendix of the Programming with gtkmm book. * * @section features Features * From b9ffaef1464a7c6ec7496c542b5f032c525d068d Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Fri, 19 Jul 2024 15:51:16 +0200 Subject: [PATCH 095/112] Meson build: Use Meson's pkgconfig module instead of using the *.pc.in templates. Require meson >= 0.62. Remove the can_add_dist_script variable. It's unnecessary when the meson version >= 0.58. Simplify the calls to dependency().get_variable(). --- MSVC_NMake/meson.build | 21 +++++------ docs/docs/manual/meson.build | 20 +++++------ docs/docs/reference/meson.build | 29 +++++++-------- meson.build | 64 ++++++++++----------------------- sigc++/meson.build | 32 ++++++++++++++++- 5 files changed, 81 insertions(+), 85 deletions(-) diff --git a/MSVC_NMake/meson.build b/MSVC_NMake/meson.build index f11412a0..2aba5ec0 100644 --- a/MSVC_NMake/meson.build +++ b/MSVC_NMake/meson.build @@ -1,7 +1,6 @@ # MSVC_NMake -# Input: pkg_conf_data, sigcxxconfig_h_meson, project_build_root, python3, -# can_add_dist_script +# Input: pkg_conf_data, sigcxxconfig_h_meson, project_build_root, python3 # Output: sigc_rc sigc_rc = configure_file( @@ -20,13 +19,11 @@ configure_file( untracked_msvc_nmake = 'untracked' / 'MSVC_NMake' handle_built_files = project_source_root / 'tools' / 'handle-built-files.py' -if can_add_dist_script - # Distribute built files. - meson.add_dist_script( - python3, handle_built_files, 'dist_gen_msvc_files', - meson.current_build_dir(), - untracked_msvc_nmake, - project_build_root / 'sigc++config.h', - meson.current_build_dir() / 'sigc.rc', - ) -endif +# Distribute built files. +meson.add_dist_script( + python3, handle_built_files, 'dist_gen_msvc_files', + meson.current_build_dir(), + untracked_msvc_nmake, + project_build_root / 'sigc++config.h', + meson.current_build_dir() / 'sigc.rc', +) diff --git a/docs/docs/manual/meson.build b/docs/docs/manual/meson.build index 415375f5..8cd8b27f 100644 --- a/docs/docs/manual/meson.build +++ b/docs/docs/manual/meson.build @@ -1,7 +1,7 @@ # docs/docs/manual # input: install_datadir, sigcxx_pcname, tutorial_custom_cmd, python3, -# build_documentation, book_name, can_add_dist_script, xsltproc +# build_documentation, book_name, xsltproc # output: can_parse_and_validate, build_pdf_by_default, can_build_pdf, # install_tutorialdir, build_manual_opt, build_manual @@ -95,13 +95,11 @@ if can_build_pdf ) endif -if can_add_dist_script - # Distribute built files. - meson.add_dist_script( - python3, tutorial_custom_cmd, 'dist_doc', - doc_dist_dir, - meson.current_build_dir(), - meson.current_source_dir() / sigc_manual_xml, - meson.current_build_dir() / sigc_manual_pdf, - ) -endif +# Distribute built files. +meson.add_dist_script( + python3, tutorial_custom_cmd, 'dist_doc', + doc_dist_dir, + meson.current_build_dir(), + meson.current_source_dir() / sigc_manual_xml, + meson.current_build_dir() / sigc_manual_pdf, +) diff --git a/docs/docs/reference/meson.build b/docs/docs/reference/meson.build index 5f2e901f..0fa0d930 100644 --- a/docs/docs/reference/meson.build +++ b/docs/docs/reference/meson.build @@ -2,8 +2,7 @@ # Input: project_build_root, project_source_root, sigcxx_pcname, # sigcxx_api_version, build_documentation, source_h_files, -# hg_ccg_basenames, install_datadir, python3, doc_reference, -# can_add_dist_script, dot +# hg_ccg_basenames, install_datadir, python3, doc_reference, dot # Output: install_docdir, install_devhelpdir, book_name, # if build_documentation: tag_file @@ -18,7 +17,7 @@ docinstall_flags = [] foreach module : tag_file_modules depmod = dependency(module, required: false) if depmod.found() - doxytagfile = depmod.get_variable(pkgconfig: 'doxytagfile', internal: 'doxytagfile', default_value: '') + doxytagfile = depmod.get_variable('doxytagfile', default_value: '') if doxytagfile != '' if depmod.type_name() == 'internal' # Subprojects must build their tag files before doxygen is called. @@ -28,8 +27,8 @@ foreach module : tag_file_modules doxygen_tag_targets += subproject(module).get_variable('global_tag_file_target') endif endif - htmlrefpub = depmod.get_variable(pkgconfig: 'htmlrefpub', internal: 'htmlrefpub', default_value: '') - htmlrefdir = depmod.get_variable(pkgconfig: 'htmlrefdir', internal: 'htmlrefdir', default_value: '') + htmlrefpub = depmod.get_variable('htmlrefpub', default_value: '') + htmlrefdir = depmod.get_variable('htmlrefdir', default_value: '') if htmlrefpub == '' htmlrefpub = htmlrefdir elif htmlrefdir == '' @@ -129,14 +128,12 @@ meson.add_install_script( docinstall_flags ) -if can_add_dist_script - # Distribute built files and files copied by mm-common-get. - meson.add_dist_script( - python3, doc_reference, 'dist_doc', - doctool_dir, - doctool_dist_dir, - meson.current_build_dir(), - tag_file.full_path(), - devhelp_file.full_path(), - ) -endif +# Distribute built files and files copied by mm-common-get. +meson.add_dist_script( + python3, doc_reference, 'dist_doc', + doctool_dir, + doctool_dist_dir, + meson.current_build_dir(), + tag_file.full_path(), + devhelp_file.full_path(), +) diff --git a/meson.build b/meson.build index 01b3c954..8b9888d7 100644 --- a/meson.build +++ b/meson.build @@ -7,8 +7,7 @@ project('libsigc++', 'cpp', 'cpp_std=c++17', 'warning_level=1', ], - meson_version: '>= 0.55.0', # required for meson.add_dist_script(python3, ...) - # and meson.add_install_script(python3, ...) + meson_version: '>= 0.62.0', # required for variables in pkgconfig.generate() ) sigcxx_api_version = '3.0' @@ -204,6 +203,7 @@ add_project_arguments(warning_flags, language: 'cpp') # MSVC: Ignore warnings that aren't really harmful, but make those # that should not be overlooked stand out. static_cxxflag = '-DLIBSIGCXX_STATIC' +msvc_static_cxxflag = is_msvc_static ? static_cxxflag : '' if is_msvc disable_warnings_list = [ '/EHsc', # avoid warnings caused by exception handling model used @@ -234,13 +234,6 @@ endif # Configure files pkg_conf_data = configuration_data() -pkg_conf_data.set('prefix', install_prefix) -pkg_conf_data.set('exec_prefix', '${prefix}') -pkg_conf_data.set('libdir', '${exec_prefix}' / install_libdir) -pkg_conf_data.set('datarootdir', '${prefix}' / install_datadir) -pkg_conf_data.set('datadir', '${datarootdir}') -pkg_conf_data.set('includedir', '${prefix}' / install_includedir) -pkg_conf_data.set('top_srcdir', project_source_root) pkg_conf_data.set('PACKAGE_VERSION', meson.project_version()) pkg_conf_data.set('SIGCXX_API_VERSION', sigcxx_api_version) @@ -250,20 +243,6 @@ endif pkg_conf_data.set('SIGCXX_MAJOR_VERSION', sigcxx_major_version) pkg_conf_data.set('SIGCXX_MINOR_VERSION', sigcxx_minor_version) pkg_conf_data.set('SIGCXX_MICRO_VERSION', sigcxx_micro_version) -pkg_conf_data.set('MSVC_STATIC_CXXFLAG', is_msvc_static ? static_cxxflag : '') - -configure_file( - input: 'sigc++.pc.in', - output: sigcxx_pcname + '.pc', - configuration: pkg_conf_data, - install_dir: install_pkgconfigdir, -) - -configure_file( - input: 'sigc++-uninstalled.pc.in', - output: sigcxx_pcname + '-uninstalled.pc', - configuration: pkg_conf_data, -) sigcxxconfig_h_meson = files('sigc++config.h.meson') install_includeconfigdir = install_libdir / sigcxx_pcname / 'include' @@ -274,9 +253,6 @@ configure_file( install_dir: install_includeconfigdir, ) -# add_dist_script() is not allowed in a subproject if meson.version() < 0.58.0. -can_add_dist_script = not meson.is_subproject() or meson.version().version_compare('>= 0.58.0') - #subdir('cmake') subdir('MSVC_NMake') subdir('sigc++') @@ -285,25 +261,23 @@ subdir('tests') subdir('docs/docs/reference') subdir('docs/docs/manual') -if can_add_dist_script - # Add a ChangeLog file to the distribution directory. - meson.add_dist_script( - python3, dist_changelog, - project_source_root, - ) - # Don't distribute these files and directories. - dont_distribute = [ - '.github', - ] - # Add build scripts to the distribution directory, and delete .gitignore - # files and an empty $MESON_PROJECT_DIST_ROOT/build/ directory. - meson.add_dist_script( - python3, dist_build_scripts, - project_source_root, - 'untracked' / 'build_scripts', - dont_distribute, - ) -endif +# Add a ChangeLog file to the distribution directory. +meson.add_dist_script( + python3, dist_changelog, + project_source_root, +) +# Don't distribute these files and directories. +dont_distribute = [ + '.github', +] +# Add build scripts to the distribution directory, and delete .gitignore +# files and an empty $MESON_PROJECT_DIST_ROOT/build/ directory. +meson.add_dist_script( + python3, dist_build_scripts, + project_source_root, + 'untracked' / 'build_scripts', + dont_distribute, +) if meson.is_subproject() pkgconfig_vars = { diff --git a/sigc++/meson.build b/sigc++/meson.build index c645f074..9df37930 100644 --- a/sigc++/meson.build +++ b/sigc++/meson.build @@ -1,7 +1,7 @@ # sigc++ # Input: sigcxx_build_dep, sigcxx_pcname, sigcxx_libversion, sigcxx_api_version, -# darwin_versions, install_includedir, sig_rc +# darwin_versions, install_includedir, sig_rc, msvc_static_cxxflag # Output: source_h_files, sigcxx_own_dep # There are no built source files in libsigc++-3.0. @@ -101,6 +101,36 @@ sigcxx_library = library('sigc-' + sigcxx_api_version, install: true, ) +# Generate .pc files, used by pkg-config. +pkg_config = import('pkgconfig') +pc_common_variables = [ + 'doxytagfile=${docdir}/reference/lib' + sigcxx_pcname + '.tag', + 'htmlrefdir=${docdir}/reference/html', + 'htmlrefpub=https://libsigcplusplus.github.io/libsigcplusplus/reference/html', +] +pc_variables = [ + 'exec_prefix=${prefix}', + 'datarootdir=${datadir}', + 'docdir=${datadir}/doc/lib' + sigcxx_pcname, +] + pc_common_variables +pc_uninstalled_variables = [ + 'docdir=${prefix}/docs/docs', +] + pc_common_variables + +pkg_config.generate(sigcxx_library, + filebase: sigcxx_pcname, + variables: pc_variables, + uninstalled_variables: pc_uninstalled_variables, + name: meson.project_name(), + description: 'Typesafe signal and callback system for C++', + url: 'https://libsigcplusplus.github.io/libsigcplusplus/', + subdirs: [sigcxx_pcname], + extra_cflags: [ + '-I${libdir}/' + sigcxx_pcname + '/include', + msvc_static_cxxflag, + ], +) + # This is used when building example programs and test programs. # It's also a part of sigcxx_dep, when libsigc++ is a subproject. sigcxx_own_dep = declare_dependency( From 058200d9c6d379556fd9b99643990f4cf56b4490 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Fri, 19 Jul 2024 16:01:26 +0200 Subject: [PATCH 096/112] CI: Install meson >= 0.62 * .github/workflows/meson-clang.yml: * .github/workflows/meson-gcc.yml: * .github/workflows/publish-docs.yml: Install meson with pip instead of apt. --- .github/workflows/meson-clang.yml | 7 ++++++- .github/workflows/meson-gcc.yml | 7 ++++++- .github/workflows/publish-docs.yml | 8 ++++++-- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/.github/workflows/meson-clang.yml b/.github/workflows/meson-clang.yml index bea7be4d..660a7010 100644 --- a/.github/workflows/meson-clang.yml +++ b/.github/workflows/meson-clang.yml @@ -1,3 +1,5 @@ +# 2024-07-19: ubuntu-latest = ubuntu-22.04 +# See https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories name: "Meson: clang" on: [push] @@ -14,7 +16,10 @@ jobs: # Prevent blocking apt install on a question during configuring of tzdata. export ENV DEBIAN_FRONTEND=noninteractive sudo apt update - sudo apt install libxml2-utils docbook5-xml docbook-xsl mm-common clang meson ninja-build python3-setuptools --yes + sudo apt install libxml2-utils docbook5-xml docbook-xsl mm-common clang ninja-build python3-setuptools python3-pip --yes + # Ubuntu 22.04 contains meson 0.61.2, but libsigc++ requires meson >= 0.62.0. + # Install it with pip instead of apt. + sudo pip install "meson>=0.62.0" export CXX=clang++ meson setup -Dwarnings=fatal -Dwarning_level=3 -Dwerror=true _build cd _build diff --git a/.github/workflows/meson-gcc.yml b/.github/workflows/meson-gcc.yml index 336f7f71..fe2ba8ae 100644 --- a/.github/workflows/meson-gcc.yml +++ b/.github/workflows/meson-gcc.yml @@ -1,3 +1,5 @@ +# 2024-07-19: ubuntu-latest = ubuntu-22.04 +# See https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories name: "Meson: gcc" on: [push] @@ -14,7 +16,10 @@ jobs: # Prevent blocking apt install on a question during configuring of tzdata. export ENV DEBIAN_FRONTEND=noninteractive sudo apt update - sudo apt install libxml2-utils docbook5-xml docbook-xsl mm-common g++ meson ninja-build python3-setuptools --yes + sudo apt install libxml2-utils docbook5-xml docbook-xsl mm-common g++ ninja-build python3-setuptools python3-pip --yes + # Ubuntu 22.04 contains meson 0.61.2, but libsigc++ requires meson >= 0.62.0. + # Install it with pip instead of apt. + sudo pip install "meson>=0.62.0" export CXX=g++ meson setup -Dwarnings=fatal -Dwarning_level=3 -Dwerror=true _build cd _build diff --git a/.github/workflows/publish-docs.yml b/.github/workflows/publish-docs.yml index 92976f23..3410e2bd 100644 --- a/.github/workflows/publish-docs.yml +++ b/.github/workflows/publish-docs.yml @@ -5,7 +5,8 @@ name: Publish docs -# 2023-07-28: ubuntu-latest = ubuntu-22.04 +# 2024-07-19: ubuntu-latest = ubuntu-22.04 +# See https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories on: # Runs on pushes targeting the default branch push: @@ -37,7 +38,10 @@ jobs: # Prevent blocking apt install on a question during configuring of tzdata. export ENV DEBIAN_FRONTEND=noninteractive sudo apt update - sudo apt install libxml2-utils docbook5-xml docbook-xsl mm-common g++ meson ninja-build python3-setuptools python3-pip --yes + sudo apt install libxml2-utils docbook5-xml docbook-xsl mm-common g++ ninja-build python3-setuptools python3-pip --yes + # Ubuntu 22.04 contains meson 0.61.2, but libsigc++ requires meson >= 0.62.0. + # Install it with pip instead of apt. + sudo pip install "meson>=0.62.0" meson setup -Dbuild-documentation=true -Dbuild-examples=false -Dbuild-tests=false _build meson compile -C _build - name: Collect Documentation From d818694855a1ec94668f3ae835d497597f970dad Mon Sep 17 00:00:00 2001 From: Julia DeMille <8127111+judemille@users.noreply.github.com> Date: Sat, 31 Aug 2024 15:06:31 -0500 Subject: [PATCH 097/112] Meson: Detect cl-like compilers This fixes DLL linkage with clang-cl or intel-cl. --- meson.build | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 8b9888d7..3b5ba7fc 100644 --- a/meson.build +++ b/meson.build @@ -39,7 +39,8 @@ project_source_root = meson.current_source_dir() project_build_root = meson.current_build_dir() cpp_compiler = meson.get_compiler('cpp') -is_msvc = cpp_compiler.get_id() == 'msvc' +cpp_compiler_id = cpp_compiler.get_id() +is_msvc = cpp_compiler_id == 'msvc' or cpp_compiler_id.endswith('-cl') python3 = find_program('python3', version: '>=3.7') # MSVC: We currently do not support shared and static builds at the, From 81815763fb61d0482bec2c4f5e0f78f3ffb039b4 Mon Sep 17 00:00:00 2001 From: Julia DeMille <8127111+judemille@users.noreply.github.com> Date: Sat, 31 Aug 2024 15:12:13 -0500 Subject: [PATCH 098/112] fix: don't check MSVC version for non-MSVC cl --- meson.build | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 3b5ba7fc..395a0e3a 100644 --- a/meson.build +++ b/meson.build @@ -41,6 +41,7 @@ project_build_root = meson.current_build_dir() cpp_compiler = meson.get_compiler('cpp') cpp_compiler_id = cpp_compiler.get_id() is_msvc = cpp_compiler_id == 'msvc' or cpp_compiler_id.endswith('-cl') +is_cl_impersonator = is_msvc and cpp_compiler_id != 'msvc' python3 = find_program('python3', version: '>=3.7') # MSVC: We currently do not support shared and static builds at the, @@ -119,7 +120,7 @@ benchmark_dep = dependency('boost', modules: ['system', 'timer'], version: '>=1.20.0', required: do_benchmark) can_benchmark = benchmark_dep.found() -if is_msvc +if is_msvc and not is_cl_impersonator # We must have Visual Studio 2017 15.7 or later... assert(cpp_compiler.version().split('.')[0].to_int() >= 19 and \ cpp_compiler.version().split('.')[1].to_int() >= 15, From b154e8467342726f98cf43e467c744acce73af0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20H=C3=A9rilier?= Date: Tue, 20 Aug 2024 19:11:55 +0200 Subject: [PATCH 099/112] signal_connect: Add helper functions to ease connecting functions or methods to signals Those helper functions have 2 main usages: * avoid writing template parameters in case of method or function overloading; * wrap use of sigc::mem_fun or sigc::ptr_fun when possible. unsupported cases: * lambda functions; * std::function (or alike); * volatile functions; * const? volatile methods; * binding with sigc::bind. --- sigc++/filelist.am | 1 + sigc++/meson.build | 1 + sigc++/sigc++.h | 1 + sigc++/signal_base.h | 16 ++++ sigc++/signal_connect.h | 91 ++++++++++++++++++++++ tests/CMakeLists.txt | 1 + tests/Makefile.am | 2 + tests/meson.build | 1 + tests/test_signal_connect.cc | 144 +++++++++++++++++++++++++++++++++++ 9 files changed, 258 insertions(+) create mode 100644 sigc++/signal_connect.h create mode 100644 tests/test_signal_connect.cc diff --git a/sigc++/filelist.am b/sigc++/filelist.am index 36ed59cf..ea9155fb 100644 --- a/sigc++/filelist.am +++ b/sigc++/filelist.am @@ -27,6 +27,7 @@ sigc_public_h = \ scoped_connection.h \ signal.h \ signal_base.h \ + signal_connect.h \ slot.h \ trackable.h \ tuple-utils/tuple_cdr.h \ diff --git a/sigc++/meson.build b/sigc++/meson.build index 9df37930..9e36e7e9 100644 --- a/sigc++/meson.build +++ b/sigc++/meson.build @@ -25,6 +25,7 @@ sigc_h_files = [ 'scoped_connection.h', 'signal.h', 'signal_base.h', + 'signal_connect.h', 'slot.h', 'trackable.h', 'type_traits.h', diff --git a/sigc++/sigc++.h b/sigc++/sigc++.h index 45a4fa91..85bee7d2 100644 --- a/sigc++/sigc++.h +++ b/sigc++/sigc++.h @@ -119,6 +119,7 @@ #include #include #include +#include #include #include diff --git a/sigc++/signal_base.h b/sigc++/signal_base.h index 5a46a271..9b56defd 100644 --- a/sigc++/signal_base.h +++ b/sigc++/signal_base.h @@ -281,6 +281,22 @@ struct SIGC_API signal_impl_holder * a @ref sigc::slot "sigc::slot" * and connected to a signal. See @ref slot "Slots" and * @ref sigc::signal_with_accumulator::connect() "sigc::signal::connect()". + * + * Use @ref sigc::signal_connect() to connect a method or function to a signal + * without having to explicitly write the required template parameters in case + * of method or function overloading. + * + * @code + * sigc::signal sig; + * void fun(int); + * void fun(double); + * sig.connect(sigc::ptr_fun(fun)); + * // or more simply: + * sigc::signal_connect(sig, fun); + * @endcode + * + * It can also be used as a replacement for calling signal::connect() with a + * sigc::mem_fun() or a sigc::ptr_fun(). */ // TODO: When we can break ABI, let signal_base derive from trackable again, diff --git a/sigc++/signal_connect.h b/sigc++/signal_connect.h new file mode 100644 index 00000000..139f7f96 --- /dev/null +++ b/sigc++/signal_connect.h @@ -0,0 +1,91 @@ +/* + * Copyright 2024, The libsigc++ Development Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#ifndef SIGC_SIGNAL_CONNECT_H +#define SIGC_SIGNAL_CONNECT_H + +#include +#include +#include + +namespace sigc +{ + +/** Connect a function to a signal + * @param signal The signal to connect to. + * @param fun The function that should be wrapped. + * @return A connection. + * + * @ingroup signal + */ +template +inline connection +signal_connect(signal& signal, T_return (*fun)(T_arg...)) +{ + return signal.connect(ptr_fun(fun)); +} + +/** Connect a non-const method to a signal + * @param signal The signal to connect to. + * @param obj Reference to object instance the functor should operate on. + * @param fun Pointer to method that should be wrapped. + * @return A connection. + * + * @ingroup signal + */ +template +inline connection +signal_connect(signal& signal, /**/ T_obj& obj, T_return (T_obj::*fun)(T_arg...)) +{ + return signal.connect(mem_fun(obj, fun)); +} + +/** Connect a const method to a signal + * @param signal The signal to connect to. + * @param obj Reference to object instance the functor should operate on. + * @param fun Pointer to method that should be wrapped. + * @return A connection. + * + * @ingroup signal + */ +#if SIGC_MSC +/* MSVC needs to distinguish object's class and method's class (using the + * template parameter T_obj2) to avoid raising error C2672 (no matching + * overloaded function found) when signal_connect(...) is called with a + * const object. + */ +template +inline connection +signal_connect(signal& signal, /*const*/ T_obj& obj, T_return (T_obj2::*fun)(T_arg...) const) +{ + return signal.connect(mem_fun(obj, fun)); +} +#else +template +inline connection +signal_connect(signal& signal, /*const*/ T_obj& obj, T_return (T_obj::*fun)(T_arg...) const) +{ + return signal.connect(mem_fun(obj, fun)); +} +#endif + +} /* namespace sigc */ + +#endif /* SIGC_SIGNAL_CONNECT_H */ + diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index f1e50f7c..8fcc942e 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -42,6 +42,7 @@ set (TEST_SOURCE_FILES test_rvalue_ref.cc test_scoped_connection.cc test_signal.cc + test_signal_connect.cc test_signal_move.cc test_size.cc test_slot.cc diff --git a/tests/Makefile.am b/tests/Makefile.am index 6a939e29..c34f0020 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -49,6 +49,7 @@ check_PROGRAMS = \ test_rvalue_ref \ test_scoped_connection \ test_signal \ + test_signal_connect \ test_signal_move \ test_size \ test_slot \ @@ -95,6 +96,7 @@ test_retype_return_SOURCES = test_retype_return.cc $(sigc_test_util) test_rvalue_ref_SOURCES = test_rvalue_ref.cc $(sigc_test_util) test_scoped_connection_SOURCES = test_scoped_connection.cc $(sigc_test_util) test_signal_SOURCES = test_signal.cc $(sigc_test_util) +test_signal_connect_SOURCES = test_signal_connect.cc $(sigc_test_util) test_signal_move_SOURCES = test_signal_move.cc $(sigc_test_util) test_size_SOURCES = test_size.cc $(sigc_test_util) test_slot_SOURCES = test_slot.cc $(sigc_test_util) diff --git a/tests/meson.build b/tests/meson.build index a9c65fdf..3274574c 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -31,6 +31,7 @@ test_programs = [ [[], 'test_rvalue_ref', ['test_rvalue_ref.cc', 'testutilities.cc']], [[], 'test_scoped_connection', ['test_scoped_connection.cc', 'testutilities.cc']], [[], 'test_signal', ['test_signal.cc', 'testutilities.cc']], + [[], 'test_signal_connect', ['test_signal_connect.cc', 'testutilities.cc']], [[], 'test_signal_move', ['test_signal_move.cc', 'testutilities.cc']], [[], 'test_size', ['test_size.cc', 'testutilities.cc']], [[], 'test_slot', ['test_slot.cc', 'testutilities.cc']], diff --git a/tests/test_signal_connect.cc b/tests/test_signal_connect.cc new file mode 100644 index 00000000..19e3c0a2 --- /dev/null +++ b/tests/test_signal_connect.cc @@ -0,0 +1,144 @@ +/* Copyright 2024, The libsigc++ Development Team + * Assigned to public domain. Use as you wish without restriction. + */ + +#include "testutilities.h" +#include +#include + +namespace +{ + +TestUtilities* util = nullptr; +std::ostringstream result_stream; + +void +fun(int i) +{ + result_stream << "fun(int " << i << ")"; +} + +[[maybe_unused]] +void +fun(double d) +{ + result_stream << "fun(double " << d << ")"; +} + +struct foo : public sigc::trackable +{ + void fun_nonconst(int i) + { + result_stream << "foo::fun_nonconst(int " << i << ")"; + } + + void fun_nonconst(double d) + { + result_stream << "foo::fun_nonconst(double " << d << ")"; + } + + void fun_const(int i) const + { + result_stream << "foo::fun_const(int " << i << ")"; + } + + void fun_const(double d) const + { + result_stream << "foo::fun_const(double " << d << ")"; + } +}; + +struct bar : public sigc::trackable +{ + void fun_nonconst(int i, int j) + { + result_stream << "bar::fun_nonconst(int " << i << ", int " << j << ")"; + } + + void fun_nonconst(int i, double j) + { + result_stream << "bar::fun_nonconst(int " << i << ", double " << j << ")"; + } + + void fun_const(int i, int j) const + { + result_stream << "bar::fun_const(int " << i << ", int " << j << ")"; + } + + void fun_const(int i, double j) const + { + result_stream << "bar::fun_const(int " << i << ", double " << j << ")"; + } +}; + +void +test_signal_connect_fun() +{ + sigc::signal signal; + + sigc::signal_connect(signal, &fun); + + signal.emit(42); + util->check_result(result_stream, "fun(int 42)"); +} + +void +test_signal_connect_method_nonconst() +{ + sigc::signal signal; + foo f; + + sigc::signal_connect(signal, f, &foo::fun_nonconst); + + signal.emit(42); + util->check_result(result_stream, "foo::fun_nonconst(int 42)"); +} + +void +test_signal_connect_method_const() +{ + sigc::signal signal; + foo f; + + sigc::signal_connect(signal, f, &foo::fun_const); + + signal.emit(42); + util->check_result(result_stream, "foo::fun_const(int 42)"); +} + +void +test_signal_connect_method_const_with_const_object() +{ + sigc::signal signal; + const foo f; + + sigc::signal_connect(signal, f, &foo::fun_const); + + signal.emit(42); + util->check_result(result_stream, "foo::fun_const(int 42)"); +} + +void +test_signal_connect_method() +{ + test_signal_connect_method_nonconst(); + test_signal_connect_method_const(); + test_signal_connect_method_const_with_const_object(); +} + +} // end anonymous namespace + +int +main(int argc, char* argv[]) +{ + util = TestUtilities::get_instance(); + + if (!util->check_command_args(argc, argv)) + return util->get_result_and_delete_instance() ? EXIT_SUCCESS : EXIT_FAILURE; + + test_signal_connect_fun(); + + test_signal_connect_method(); + + return util->get_result_and_delete_instance() ? EXIT_SUCCESS : EXIT_FAILURE; +} From 77194f181816dc23691b68cde6fba851ed95eefe Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Tue, 3 Sep 2024 15:13:07 +0200 Subject: [PATCH 100/112] signal_connect(): Add @newin --- sigc++/signal_connect.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sigc++/signal_connect.h b/sigc++/signal_connect.h index 139f7f96..d0aacb05 100644 --- a/sigc++/signal_connect.h +++ b/sigc++/signal_connect.h @@ -32,6 +32,7 @@ namespace sigc * @param fun The function that should be wrapped. * @return A connection. * + * @newin{3,8} * @ingroup signal */ template @@ -47,6 +48,7 @@ signal_connect(signal& signal, T_return (*fun)(T_arg...)) * @param fun Pointer to method that should be wrapped. * @return A connection. * + * @newin{3,8} * @ingroup signal */ template @@ -62,9 +64,10 @@ signal_connect(signal& signal, /**/ T_obj& obj, T_return (T_ * @param fun Pointer to method that should be wrapped. * @return A connection. * + * @newin{3,8} * @ingroup signal */ -#if SIGC_MSC +#ifdef SIGC_MSC /* MSVC needs to distinguish object's class and method's class (using the * template parameter T_obj2) to avoid raising error C2672 (no matching * overloaded function found) when signal_connect(...) is called with a @@ -88,4 +91,3 @@ signal_connect(signal& signal, /*const*/ T_obj& obj, T_retur } /* namespace sigc */ #endif /* SIGC_SIGNAL_CONNECT_H */ - From f36ec36c18caae3d07aadc76729d4bf9aff0dedc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20H=C3=A9rilier?= Date: Wed, 4 Sep 2024 11:20:26 +0200 Subject: [PATCH 101/112] signal_connect: Simplify ambiguity removal when compiling with MSVC commented "const" in sigc::mem_fun prototypes' are meaningless. Using a "const T_obj" as argument type when the method is const void any conflict. remove useless struct in test program. --- sigc++/signal_connect.h | 20 +++----------------- tests/test_signal_connect.cc | 23 ----------------------- 2 files changed, 3 insertions(+), 40 deletions(-) diff --git a/sigc++/signal_connect.h b/sigc++/signal_connect.h index d0aacb05..9bfdb0af 100644 --- a/sigc++/signal_connect.h +++ b/sigc++/signal_connect.h @@ -53,7 +53,7 @@ signal_connect(signal& signal, T_return (*fun)(T_arg...)) */ template inline connection -signal_connect(signal& signal, /**/ T_obj& obj, T_return (T_obj::*fun)(T_arg...)) +signal_connect(signal& signal, T_obj& obj, T_return (T_obj::*fun)(T_arg...)) { return signal.connect(mem_fun(obj, fun)); } @@ -67,26 +67,12 @@ signal_connect(signal& signal, /**/ T_obj& obj, T_return (T_ * @newin{3,8} * @ingroup signal */ -#ifdef SIGC_MSC -/* MSVC needs to distinguish object's class and method's class (using the - * template parameter T_obj2) to avoid raising error C2672 (no matching - * overloaded function found) when signal_connect(...) is called with a - * const object. - */ -template -inline connection -signal_connect(signal& signal, /*const*/ T_obj& obj, T_return (T_obj2::*fun)(T_arg...) const) -{ - return signal.connect(mem_fun(obj, fun)); -} -#else template inline connection -signal_connect(signal& signal, /*const*/ T_obj& obj, T_return (T_obj::*fun)(T_arg...) const) +signal_connect(signal& signal, const T_obj& obj, T_return (T_obj::*fun)(T_arg...) const) { - return signal.connect(mem_fun(obj, fun)); + return signal.connect(mem_fun(obj, fun)); } -#endif } /* namespace sigc */ diff --git a/tests/test_signal_connect.cc b/tests/test_signal_connect.cc index 19e3c0a2..ef4e1045 100644 --- a/tests/test_signal_connect.cc +++ b/tests/test_signal_connect.cc @@ -48,29 +48,6 @@ struct foo : public sigc::trackable } }; -struct bar : public sigc::trackable -{ - void fun_nonconst(int i, int j) - { - result_stream << "bar::fun_nonconst(int " << i << ", int " << j << ")"; - } - - void fun_nonconst(int i, double j) - { - result_stream << "bar::fun_nonconst(int " << i << ", double " << j << ")"; - } - - void fun_const(int i, int j) const - { - result_stream << "bar::fun_const(int " << i << ", int " << j << ")"; - } - - void fun_const(int i, double j) const - { - result_stream << "bar::fun_const(int " << i << ", double " << j << ")"; - } -}; - void test_signal_connect_fun() { From d55040f08e4616d2c85fe4c4793a715e2d42d8fb Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Thu, 12 Dec 2024 15:21:34 +0100 Subject: [PATCH 102/112] CI: Update publish-docs.yml Use actions/upload-pages-artifact@v3 instead of v1, to avoid a soon deprecated version of upload-artifact. --- .github/workflows/publish-docs.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/publish-docs.yml b/.github/workflows/publish-docs.yml index 3410e2bd..71a6ffb8 100644 --- a/.github/workflows/publish-docs.yml +++ b/.github/workflows/publish-docs.yml @@ -5,7 +5,7 @@ name: Publish docs -# 2024-07-19: ubuntu-latest = ubuntu-22.04 +# 2024-12-12: ubuntu-latest = ubuntu-22.04 # See https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories on: # Runs on pushes targeting the default branch @@ -21,10 +21,11 @@ permissions: pages: write id-token: write -# Allow one concurrent deployment +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. concurrency: group: "pages" - cancel-in-progress: true + cancel-in-progress: false jobs: # Build job @@ -32,7 +33,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Build run: | # Prevent blocking apt install on a question during configuring of tzdata. @@ -56,14 +57,14 @@ jobs: mv _build/docs/docs/manual/html _publish/manual mv _build/docs/docs/reference/html _publish/reference - name: Setup Pages - uses: actions/configure-pages@v2 + uses: actions/configure-pages@v5 - name: Build with Jekyll uses: actions/jekyll-build-pages@v1 with: source: ./_publish destination: ./_site - name: Upload artifact - uses: actions/upload-pages-artifact@v1 + uses: actions/upload-pages-artifact@v3 # Deployment job # Publish documentation at https://libsigcplusplus.github.io/libsigcplusplus/ @@ -76,5 +77,5 @@ jobs: steps: - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v1 + uses: actions/deploy-pages@v4 From 1f00c95fbc587322c6425f490adc8a5a3c9aa12b Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Wed, 5 Feb 2025 10:38:49 +0100 Subject: [PATCH 103/112] docs/docs/reference/Doxyfile.in: Remove unsupported entries --- docs/docs/reference/Doxyfile.in | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/docs/reference/Doxyfile.in b/docs/docs/reference/Doxyfile.in index 1f1c4a52..f00ce53f 100644 --- a/docs/docs/reference/Doxyfile.in +++ b/docs/docs/reference/Doxyfile.in @@ -141,8 +141,6 @@ REFERENCES_LINK_SOURCE = YES SOURCE_TOOLTIPS = YES USE_HTAGS = NO VERBATIM_HEADERS = NO -CLANG_ASSISTED_PARSING = NO -CLANG_OPTIONS = #--------------------------------------------------------------------------- # Configuration options related to the alphabetical class index #--------------------------------------------------------------------------- From 8e33aa7148bbce7e42140620b2bebf3334b51f08 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Wed, 5 Feb 2025 10:39:09 +0100 Subject: [PATCH 104/112] CI: Publish the generated libsigc++-3.0.tag file --- .github/workflows/publish-docs.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/publish-docs.yml b/.github/workflows/publish-docs.yml index 71a6ffb8..6d450fe4 100644 --- a/.github/workflows/publish-docs.yml +++ b/.github/workflows/publish-docs.yml @@ -5,7 +5,7 @@ name: Publish docs -# 2024-12-12: ubuntu-latest = ubuntu-22.04 +# 2025-02-05: ubuntu-latest = ubuntu-24.04 # See https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories on: # Runs on pushes targeting the default branch @@ -39,10 +39,7 @@ jobs: # Prevent blocking apt install on a question during configuring of tzdata. export ENV DEBIAN_FRONTEND=noninteractive sudo apt update - sudo apt install libxml2-utils docbook5-xml docbook-xsl mm-common g++ ninja-build python3-setuptools python3-pip --yes - # Ubuntu 22.04 contains meson 0.61.2, but libsigc++ requires meson >= 0.62.0. - # Install it with pip instead of apt. - sudo pip install "meson>=0.62.0" + sudo apt install libxml2-utils docbook5-xml docbook-xsl mm-common g++ meson ninja-build python3-setuptools python3-pip --yes meson setup -Dbuild-documentation=true -Dbuild-examples=false -Dbuild-tests=false _build meson compile -C _build - name: Collect Documentation @@ -56,6 +53,7 @@ jobs: # Move generated documentation. mv _build/docs/docs/manual/html _publish/manual mv _build/docs/docs/reference/html _publish/reference + mv _build/docs/docs/reference/*.tag _publish/reference/html - name: Setup Pages uses: actions/configure-pages@v5 - name: Build with Jekyll From 4e68e1753b42be120d5a64a9b7cc0fc110f86428 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Wed, 12 Feb 2025 16:29:10 +0100 Subject: [PATCH 105/112] Meson build: Add install_tag keyword argument --- docs/docs/manual/meson.build | 3 ++- docs/docs/reference/meson.build | 4 +++- examples/meson.build | 3 ++- meson.build | 9 +++++---- tests/meson.build | 4 +++- 5 files changed, 15 insertions(+), 8 deletions(-) diff --git a/docs/docs/manual/meson.build b/docs/docs/manual/meson.build index 8cd8b27f..7cd56ec0 100644 --- a/docs/docs/manual/meson.build +++ b/docs/docs/manual/meson.build @@ -61,7 +61,8 @@ custom_target('manual_html', ], build_by_default: true, install: true, - install_dir: install_tutorialdir + install_dir: install_tutorialdir, + install_tag: 'doc', ) if can_parse_and_validate diff --git a/docs/docs/reference/meson.build b/docs/docs/reference/meson.build index 0fa0d930..fcf0c74e 100644 --- a/docs/docs/reference/meson.build +++ b/docs/docs/reference/meson.build @@ -102,6 +102,7 @@ tag_file = custom_target('html_and_tag', build_by_default: build_documentation, install: true, install_dir: install_reference_docdir, + install_tag: 'doc', ) devhelp_file = custom_target('devhelp', @@ -125,7 +126,8 @@ meson.add_install_script( devhelp_file.full_path(), install_devhelpdir, install_reference_docdir / 'html', - docinstall_flags + docinstall_flags, + install_tag: 'doc', ) # Distribute built files and files copied by mm-common-get. diff --git a/examples/meson.build b/examples/meson.build index 3c575aec..0ddf68ef 100644 --- a/examples/meson.build +++ b/examples/meson.build @@ -23,6 +23,7 @@ foreach ex : examples cpp_args: '-DSIGCXX_DISABLE_DEPRECATED=1', dependencies: sigcxx_own_dep, implicit_include_directories: false, - build_by_default: build_examples + build_by_default: build_examples, + install: false, ) endforeach diff --git a/meson.build b/meson.build index 395a0e3a..ed9848ef 100644 --- a/meson.build +++ b/meson.build @@ -33,10 +33,9 @@ sigcxx_libversion = '@0@.@1@.@2@'.format( libtool_soversion[1]) darwin_versions = [libtool_soversion[0] + 1, '@0@.@1@'.format(libtool_soversion[0] + 1, libtool_soversion[1])] -# Use these instead of meson.source_root() and meson.build_root() in subdirectories. -# source_root() and build_root() are not useful, if this is a subproject. -project_source_root = meson.current_source_dir() -project_build_root = meson.current_build_dir() +# Source and build root directories of the current (sub)project. +project_source_root = meson.project_source_root() +project_build_root = meson.project_build_root() cpp_compiler = meson.get_compiler('cpp') cpp_compiler_id = cpp_compiler.get_id() @@ -252,7 +251,9 @@ configure_file( input: sigcxxconfig_h_meson, output: 'sigc++config.h', configuration: pkg_conf_data, + install: true, install_dir: install_includeconfigdir, + install_tag: 'devel', ) #subdir('cmake') diff --git a/tests/meson.build b/tests/meson.build index 3274574c..4b627e94 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -70,6 +70,7 @@ foreach ex : test_programs dependencies: sigcxx_own_dep, implicit_include_directories: false, build_by_default: build_tests, + install: false, ) # If exe_file is a test program, it is built by default unconditionally. @@ -93,7 +94,8 @@ if can_benchmark exe_file = executable(ex_name, ex_sources, dependencies: [sigcxx_own_dep, benchmark_dep], implicit_include_directories: false, - build_by_default: do_benchmark + build_by_default: do_benchmark, + install: false, ) if do_benchmark From 19610f027cc718e4f0db7a15608cfb8e508e6e66 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Sat, 5 Apr 2025 08:27:03 +0200 Subject: [PATCH 106/112] Remove obsolete FSF (Free Software Foundation) address See https://github.com/libxmlplusplus/libxmlplusplus/pull/72 --- CMakeLists.txt | 3 +-- cmake/Makefile.am | 3 +-- examples/CMakeLists.txt | 3 +-- sigc++/.gitignore | 0 sigc++/CMakeLists.txt | 3 +-- sigc++/adaptors/adaptor_base.h | 6 ++---- sigc++/adaptors/adaptor_trait.h | 6 ++---- sigc++/adaptors/adaptors.h | 4 +--- sigc++/adaptors/adapts.h | 6 ++---- sigc++/adaptors/bind.h | 6 ++---- sigc++/adaptors/bind_return.h | 6 ++---- sigc++/adaptors/bound_argument.h | 6 ++---- sigc++/adaptors/compose.h | 6 ++---- sigc++/adaptors/exception_catch.h | 6 ++---- sigc++/adaptors/hide.h | 6 ++---- sigc++/adaptors/retype.h | 6 ++---- sigc++/adaptors/retype_return.h | 6 ++---- sigc++/adaptors/track_obj.h | 6 ++---- sigc++/adaptors/tuple_visitor_visit_each.h | 6 ++---- sigc++/bind.h | 7 ++----- sigc++/bind_return.h | 7 ++----- sigc++/connection.cc | 7 ++----- sigc++/connection.h | 7 ++----- sigc++/functors/functor_trait.h | 6 ++---- sigc++/functors/functors.h | 4 +--- sigc++/functors/mem_fun.h | 6 ++---- sigc++/functors/ptr_fun.h | 6 ++---- sigc++/functors/slot.h | 6 ++---- sigc++/functors/slot_base.cc | 7 ++----- sigc++/functors/slot_base.h | 7 ++----- sigc++/limit_reference.h | 6 ++---- sigc++/member_method_trait.h | 7 ++----- sigc++/reference_wrapper.h | 7 ++----- sigc++/retype_return.h | 7 ++----- sigc++/scoped_connection.cc | 7 ++----- sigc++/scoped_connection.h | 7 ++----- sigc++/sigc++.h | 7 ++----- sigc++/signal.h | 7 ++----- sigc++/signal_base.cc | 6 ++---- sigc++/signal_base.h | 6 ++---- sigc++/signal_connect.h | 7 ++----- sigc++/trackable.cc | 7 ++----- sigc++/trackable.h | 7 ++----- sigc++/tuple-utils/tuple_cdr.h | 3 +-- sigc++/tuple-utils/tuple_end.h | 3 +-- sigc++/tuple-utils/tuple_for_each.h | 3 +-- sigc++/tuple-utils/tuple_start.h | 3 +-- sigc++/tuple-utils/tuple_transform_each.h | 3 +-- sigc++/type_traits.h | 7 ++----- sigc++/visit_each.h | 6 ++---- sigc++/weak_raw_ptr.h | 7 ++----- tests/CMakeLists.txt | 3 +-- tests/test_bind_refptr.cc | 3 +-- 53 files changed, 91 insertions(+), 202 deletions(-) delete mode 100644 sigc++/.gitignore diff --git a/CMakeLists.txt b/CMakeLists.txt index c4b291c1..a1432d85 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,8 +11,7 @@ # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# License along with this library; if not, see . cmake_minimum_required (VERSION 3.2) diff --git a/cmake/Makefile.am b/cmake/Makefile.am index 7cf90215..08a48e75 100644 --- a/cmake/Makefile.am +++ b/cmake/Makefile.am @@ -11,7 +11,6 @@ ## Lesser General Public License for more details. ## ## You should have received a copy of the GNU Lesser General Public -## License along with this library; if not, write to the Free Software -## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +## License along with this library; if not, see . dist_noinst_DATA = sigc++-3Config.cmake.in diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index a983090b..82659938 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -11,8 +11,7 @@ # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# License along with this library; if not, see . function (add_sigcpp_example EXAMPLE_SOURCE_FILE) get_filename_component (example_name ${EXAMPLE_SOURCE_FILE} NAME_WE) diff --git a/sigc++/.gitignore b/sigc++/.gitignore deleted file mode 100644 index e69de29b..00000000 diff --git a/sigc++/CMakeLists.txt b/sigc++/CMakeLists.txt index dd2d339e..d6945b2f 100644 --- a/sigc++/CMakeLists.txt +++ b/sigc++/CMakeLists.txt @@ -11,8 +11,7 @@ # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# License along with this library; if not, see . set (SOURCE_FILES connection.cc diff --git a/sigc++/adaptors/adaptor_base.h b/sigc++/adaptors/adaptor_base.h index ec870841..4d8fa24d 100644 --- a/sigc++/adaptors/adaptor_base.h +++ b/sigc++/adaptors/adaptor_base.h @@ -1,5 +1,4 @@ -/* - * Copyright 2003 - 2016, The libsigc++ Development Team +/* Copyright 2003 - 2016, The libsigc++ Development Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -12,8 +11,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * License along with this library; if not, see . */ #ifndef SIGC_ADAPTORS_DEDUCE_RESULT_TYPE_H diff --git a/sigc++/adaptors/adaptor_trait.h b/sigc++/adaptors/adaptor_trait.h index 34ef4010..fbf8f6a0 100644 --- a/sigc++/adaptors/adaptor_trait.h +++ b/sigc++/adaptors/adaptor_trait.h @@ -1,5 +1,4 @@ -/* - * Copyright 2003 - 2016, The libsigc++ Development Team +/* Copyright 2003 - 2016, The libsigc++ Development Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -12,8 +11,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * License along with this library; if not, see . */ #ifndef SIGC_ADAPTORS_ADAPTOR_TRAIT_H diff --git a/sigc++/adaptors/adaptors.h b/sigc++/adaptors/adaptors.h index ac536858..81403913 100644 --- a/sigc++/adaptors/adaptors.h +++ b/sigc++/adaptors/adaptors.h @@ -11,9 +11,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * + * License along with this library; if not, see . */ #ifndef SIGC_ADAPTOR_HPP #define SIGC_ADAPTOR_HPP diff --git a/sigc++/adaptors/adapts.h b/sigc++/adaptors/adapts.h index 08ae0025..50dd31c9 100644 --- a/sigc++/adaptors/adapts.h +++ b/sigc++/adaptors/adapts.h @@ -1,5 +1,4 @@ -/* - * Copyright 2003 - 2016, The libsigc++ Development Team +/* Copyright 2003 - 2016, The libsigc++ Development Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -12,8 +11,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * License along with this library; if not, see . */ #ifndef SIGC_ADAPTORS_ADAPTS_H diff --git a/sigc++/adaptors/bind.h b/sigc++/adaptors/bind.h index 70fb095d..66af8ff9 100644 --- a/sigc++/adaptors/bind.h +++ b/sigc++/adaptors/bind.h @@ -1,5 +1,4 @@ -/* - * Copyright 2003 - 2016, The libsigc++ Development Team +/* Copyright 2003 - 2016, The libsigc++ Development Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -12,8 +11,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * License along with this library; if not, see . */ #ifndef SIGC_ADAPTORS_BIND_H diff --git a/sigc++/adaptors/bind_return.h b/sigc++/adaptors/bind_return.h index b02f9367..5c8a3348 100644 --- a/sigc++/adaptors/bind_return.h +++ b/sigc++/adaptors/bind_return.h @@ -1,5 +1,4 @@ -/* - * Copyright 2003 - 2016, The libsigc++ Development Team +/* Copyright 2003 - 2016, The libsigc++ Development Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -12,8 +11,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * License along with this library; if not, see . */ #ifndef SIGC_ADAPTORS_BIND_RETURN_H diff --git a/sigc++/adaptors/bound_argument.h b/sigc++/adaptors/bound_argument.h index c9899dfd..a389b91e 100644 --- a/sigc++/adaptors/bound_argument.h +++ b/sigc++/adaptors/bound_argument.h @@ -1,5 +1,4 @@ -/* - * Copyright 2005 - 2016, The libsigc++ Development Team +/* Copyright 2005 - 2016, The libsigc++ Development Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -12,8 +11,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * License along with this library; if not, see . */ #ifndef SIGC_BOUND_ARGUMENT_H diff --git a/sigc++/adaptors/compose.h b/sigc++/adaptors/compose.h index ce5d221f..b472d6a7 100644 --- a/sigc++/adaptors/compose.h +++ b/sigc++/adaptors/compose.h @@ -1,5 +1,4 @@ -/* - * Copyright 2003 - 2016, The libsigc++ Development Team +/* Copyright 2003 - 2016, The libsigc++ Development Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -12,8 +11,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * License along with this library; if not, see . */ #ifndef SIGC_ADAPTORS_COMPOSE_H diff --git a/sigc++/adaptors/exception_catch.h b/sigc++/adaptors/exception_catch.h index 26771421..b2528b6a 100644 --- a/sigc++/adaptors/exception_catch.h +++ b/sigc++/adaptors/exception_catch.h @@ -1,5 +1,4 @@ -/* - * Copyright 2003 - 2016, The libsigc++ Development Team +/* Copyright 2003 - 2016, The libsigc++ Development Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -12,8 +11,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * License along with this library; if not, see . */ #ifndef SIGC_ADAPTORS_EXCEPTION_CATCH_H diff --git a/sigc++/adaptors/hide.h b/sigc++/adaptors/hide.h index a8e0b968..2dbdb4ae 100644 --- a/sigc++/adaptors/hide.h +++ b/sigc++/adaptors/hide.h @@ -1,5 +1,4 @@ -/* - * Copyright 2003 - 2016, The libsigc++ Development Team +/* Copyright 2003 - 2016, The libsigc++ Development Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -12,8 +11,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * License along with this library; if not, see . */ #ifndef SIGC_ADAPTORS_HIDE_H diff --git a/sigc++/adaptors/retype.h b/sigc++/adaptors/retype.h index fd8fd327..14e2e3ea 100644 --- a/sigc++/adaptors/retype.h +++ b/sigc++/adaptors/retype.h @@ -1,5 +1,4 @@ -/* - * Copyright 2003 - 2016, The libsigc++ Development Team +/* Copyright 2003 - 2016, The libsigc++ Development Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -12,8 +11,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * License along with this library; if not, see . */ #ifndef SIGC_ADAPTORS_RETYPE_H diff --git a/sigc++/adaptors/retype_return.h b/sigc++/adaptors/retype_return.h index e3911b8b..bb7159db 100644 --- a/sigc++/adaptors/retype_return.h +++ b/sigc++/adaptors/retype_return.h @@ -1,5 +1,4 @@ -/* - * Copyright 2003 - 2016, The libsigc++ Development Team +/* Copyright 2003 - 2016, The libsigc++ Development Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -12,8 +11,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * License along with this library; if not, see . */ #ifndef SIGC_ADAPTORS_RETYPE_RETURN_H diff --git a/sigc++/adaptors/track_obj.h b/sigc++/adaptors/track_obj.h index 80cb3ff1..60890cca 100644 --- a/sigc++/adaptors/track_obj.h +++ b/sigc++/adaptors/track_obj.h @@ -1,5 +1,4 @@ -/* - * Copyright 2013 - 2016, The libsigc++ Development Team +/* Copyright 2013 - 2016, The libsigc++ Development Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -12,8 +11,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * License along with this library; if not, see . */ #ifndef SIGC_ADAPTORS_TRACK_OBJ_H diff --git a/sigc++/adaptors/tuple_visitor_visit_each.h b/sigc++/adaptors/tuple_visitor_visit_each.h index 60f977e6..864b232e 100644 --- a/sigc++/adaptors/tuple_visitor_visit_each.h +++ b/sigc++/adaptors/tuple_visitor_visit_each.h @@ -1,5 +1,4 @@ -/* - * Copyright 2015 - 2016, The libsigc++ Development Team +/* Copyright 2015 - 2016, The libsigc++ Development Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -12,8 +11,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * License along with this library; if not, see . */ #ifndef SIGC_TUPLE_VISITOR_VISIT_EACH_H diff --git a/sigc++/bind.h b/sigc++/bind.h index 1f035cc1..989a4906 100644 --- a/sigc++/bind.h +++ b/sigc++/bind.h @@ -1,5 +1,4 @@ -/* - * Copyright 2002 - 2016, The libsigc++ Development Team +/* Copyright 2002 - 2016, The libsigc++ Development Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -12,9 +11,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * + * License along with this library; if not, see . */ #ifndef SIGC_BIND_HPP #define SIGC_BIND_HPP diff --git a/sigc++/bind_return.h b/sigc++/bind_return.h index 44af9420..82bd3cbf 100644 --- a/sigc++/bind_return.h +++ b/sigc++/bind_return.h @@ -1,5 +1,4 @@ -/* - * Copyright 2002 - 2016, The libsigc++ Development Team +/* Copyright 2002 - 2016, The libsigc++ Development Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -12,9 +11,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * + * License along with this library; if not, see . */ #ifndef SIGC_BIND_RETURN_HPP #define SIGC_BIND_RETURN_HPP diff --git a/sigc++/connection.cc b/sigc++/connection.cc index 0f9318d7..e7c7f2be 100644 --- a/sigc++/connection.cc +++ b/sigc++/connection.cc @@ -1,5 +1,4 @@ -/* - * Copyright 2002 - 2016, The libsigc++ Development Team +/* Copyright 2002 - 2016, The libsigc++ Development Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -12,9 +11,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * + * License along with this library; if not, see . */ #include diff --git a/sigc++/connection.h b/sigc++/connection.h index 3fd25085..9d6f1ee7 100644 --- a/sigc++/connection.h +++ b/sigc++/connection.h @@ -1,5 +1,4 @@ -/* - * Copyright 2002 - 2016, The libsigc++ Development Team +/* Copyright 2002 - 2016, The libsigc++ Development Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -12,9 +11,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * + * License along with this library; if not, see . */ #ifndef SIGC_CONNECTION_HPP diff --git a/sigc++/functors/functor_trait.h b/sigc++/functors/functor_trait.h index 61e5c687..e83b36b9 100644 --- a/sigc++/functors/functor_trait.h +++ b/sigc++/functors/functor_trait.h @@ -1,5 +1,4 @@ -/* - * Copyright 2003 - 2016, The libsigc++ Development Team +/* Copyright 2003 - 2016, The libsigc++ Development Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -12,8 +11,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * License along with this library; if not, see . */ #ifndef SIGC_FUNCTORS_FUNCTOR_TRAIT_H diff --git a/sigc++/functors/functors.h b/sigc++/functors/functors.h index 37e3c597..6f08b0a4 100644 --- a/sigc++/functors/functors.h +++ b/sigc++/functors/functors.h @@ -11,9 +11,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * + * License along with this library; if not, see . */ #ifndef SIGC_FUNCTOR_HPP #define SIGC_FUNCTOR_HPP diff --git a/sigc++/functors/mem_fun.h b/sigc++/functors/mem_fun.h index 20717529..cdab86e7 100644 --- a/sigc++/functors/mem_fun.h +++ b/sigc++/functors/mem_fun.h @@ -1,5 +1,4 @@ -/* - * Copyright 2003 - 2016, The libsigc++ Development Team +/* Copyright 2003 - 2016, The libsigc++ Development Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -12,8 +11,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * License along with this library; if not, see . */ #ifndef SIGC_FUNCTORS_MEM_FUN_H diff --git a/sigc++/functors/ptr_fun.h b/sigc++/functors/ptr_fun.h index 1c6e2653..d94ed1d7 100644 --- a/sigc++/functors/ptr_fun.h +++ b/sigc++/functors/ptr_fun.h @@ -1,5 +1,4 @@ -/* - * Copyright 2003 - 2016, The libsigc++ Development Team +/* Copyright 2003 - 2016, The libsigc++ Development Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -12,8 +11,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * License along with this library; if not, see . */ #ifndef SIGC_FUNCTORS_PTR_FUN_H diff --git a/sigc++/functors/slot.h b/sigc++/functors/slot.h index fc7f2af3..ec7f2998 100644 --- a/sigc++/functors/slot.h +++ b/sigc++/functors/slot.h @@ -1,5 +1,4 @@ -/* - * Copyright 2003 - 2016, The libsigc++ Development Team +/* Copyright 2003 - 2016, The libsigc++ Development Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -12,8 +11,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * License along with this library; if not, see . */ #ifndef SIGC_FUNCTORS_SLOT_H diff --git a/sigc++/functors/slot_base.cc b/sigc++/functors/slot_base.cc index b3419c96..afd17940 100644 --- a/sigc++/functors/slot_base.cc +++ b/sigc++/functors/slot_base.cc @@ -1,5 +1,4 @@ -/* - * Copyright 2003 - 2016, The libsigc++ Development Team +/* Copyright 2003 - 2016, The libsigc++ Development Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -12,9 +11,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * + * License along with this library; if not, see . */ #include diff --git a/sigc++/functors/slot_base.h b/sigc++/functors/slot_base.h index bf7959a0..55b62ee2 100644 --- a/sigc++/functors/slot_base.h +++ b/sigc++/functors/slot_base.h @@ -1,5 +1,4 @@ -/* - * Copyright 2003 - 2016, The libsigc++ Development Team +/* Copyright 2003 - 2016, The libsigc++ Development Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -12,9 +11,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * + * License along with this library; if not, see . */ #ifndef SIGC_SLOT_BASE_HPP #define SIGC_SLOT_BASE_HPP diff --git a/sigc++/limit_reference.h b/sigc++/limit_reference.h index f578cc33..f55330d8 100644 --- a/sigc++/limit_reference.h +++ b/sigc++/limit_reference.h @@ -1,5 +1,4 @@ -/* - * Copyright 2005 - 2016, The libsigc++ Development Team +/* Copyright 2005 - 2016, The libsigc++ Development Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -12,8 +11,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * License along with this library; if not, see . */ #ifndef SIGC_LIMIT_REFERENCE_H diff --git a/sigc++/member_method_trait.h b/sigc++/member_method_trait.h index 344785e1..9d9b2a07 100644 --- a/sigc++/member_method_trait.h +++ b/sigc++/member_method_trait.h @@ -1,5 +1,4 @@ -/* - * Copyright 2002 - 2016, The libsigc++ Development Team +/* Copyright 2002 - 2016, The libsigc++ Development Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -12,9 +11,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * + * License along with this library; if not, see . */ #ifndef SIGC_MEMBER_METHOD_TRAITS_H #define SIGC_MEMBER_METHOD_TRAITS_H diff --git a/sigc++/reference_wrapper.h b/sigc++/reference_wrapper.h index f5f12ebf..df256a6f 100644 --- a/sigc++/reference_wrapper.h +++ b/sigc++/reference_wrapper.h @@ -1,5 +1,4 @@ -/* - * Copyright 2002 - 2016, The libsigc++ Development Team +/* Copyright 2002 - 2016, The libsigc++ Development Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -12,9 +11,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * + * License along with this library; if not, see . */ #ifndef SIGC_REFERENCE_WRAPPER_H #define SIGC_REFERENCE_WRAPPER_H diff --git a/sigc++/retype_return.h b/sigc++/retype_return.h index f85e7f86..8264c713 100644 --- a/sigc++/retype_return.h +++ b/sigc++/retype_return.h @@ -1,5 +1,4 @@ -/* - * Copyright 2002 - 2016, The libsigc++ Development Team +/* Copyright 2002 - 2016, The libsigc++ Development Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -12,9 +11,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * + * License along with this library; if not, see . */ #ifndef SIGC_RETYPE_RETURN_HPP #define SIGC_RETYPE_RETURN_HPP diff --git a/sigc++/scoped_connection.cc b/sigc++/scoped_connection.cc index 96ae1e5c..1eae69f0 100644 --- a/sigc++/scoped_connection.cc +++ b/sigc++/scoped_connection.cc @@ -1,5 +1,4 @@ -/* - * Copyright 2023, The libsigc++ Development Team +/* Copyright 2023, The libsigc++ Development Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -12,9 +11,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * + * License along with this library; if not, see . */ #include diff --git a/sigc++/scoped_connection.h b/sigc++/scoped_connection.h index 0f36e1a3..3b297f91 100644 --- a/sigc++/scoped_connection.h +++ b/sigc++/scoped_connection.h @@ -1,5 +1,4 @@ -/* - * Copyright 2023, The libsigc++ Development Team +/* Copyright 2023, The libsigc++ Development Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -12,9 +11,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * + * License along with this library; if not, see . */ #ifndef SIGC_SCOPED_CONNECTION_HPP diff --git a/sigc++/sigc++.h b/sigc++/sigc++.h index 85bee7d2..0bef5489 100644 --- a/sigc++/sigc++.h +++ b/sigc++/sigc++.h @@ -1,5 +1,4 @@ -/* - * Copyright 2003 - 2016, The libsigc++ Development Team +/* Copyright 2003 - 2016, The libsigc++ Development Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -12,9 +11,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * + * License along with this library; if not, see . */ #ifndef SIGCXX_SIGCXX_H diff --git a/sigc++/signal.h b/sigc++/signal.h index 675c1a0b..d521abc9 100644 --- a/sigc++/signal.h +++ b/sigc++/signal.h @@ -1,5 +1,4 @@ -/* - * Copyright 2002 - 2016, The libsigc++ Development Team +/* Copyright 2002 - 2016, The libsigc++ Development Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -12,9 +11,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * + * License along with this library; if not, see . */ #ifndef SIGC_SIGNAL_H diff --git a/sigc++/signal_base.cc b/sigc++/signal_base.cc index f88bc483..617bb774 100644 --- a/sigc++/signal_base.cc +++ b/sigc++/signal_base.cc @@ -1,5 +1,4 @@ -/* - * Copyright 2003 - 2016, The libsigc++ Development Team +/* Copyright 2003 - 2016, The libsigc++ Development Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -12,8 +11,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * License along with this library; if not, see . */ #include #include // std::unique_ptr diff --git a/sigc++/signal_base.h b/sigc++/signal_base.h index 9b56defd..8da25508 100644 --- a/sigc++/signal_base.h +++ b/sigc++/signal_base.h @@ -1,5 +1,4 @@ -/* - * Copyright 2002 - 2016, The libsigc++ Development Team +/* Copyright 2002 - 2016, The libsigc++ Development Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -12,8 +11,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * License along with this library; if not, see . */ #ifndef SIGC_SIGNAL_BASE_H diff --git a/sigc++/signal_connect.h b/sigc++/signal_connect.h index 9bfdb0af..c00516f3 100644 --- a/sigc++/signal_connect.h +++ b/sigc++/signal_connect.h @@ -1,5 +1,4 @@ -/* - * Copyright 2024, The libsigc++ Development Team +/* Copyright 2024, The libsigc++ Development Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -12,9 +11,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * + * License along with this library; if not, see . */ #ifndef SIGC_SIGNAL_CONNECT_H diff --git a/sigc++/trackable.cc b/sigc++/trackable.cc index c4cc8227..e4e3da51 100644 --- a/sigc++/trackable.cc +++ b/sigc++/trackable.cc @@ -1,5 +1,4 @@ -/* - * Copyright 2002 - 2016, The libsigc++ Development Team +/* Copyright 2002 - 2016, The libsigc++ Development Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -12,9 +11,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * + * License along with this library; if not, see . */ #include diff --git a/sigc++/trackable.h b/sigc++/trackable.h index d26ba611..c985f68a 100644 --- a/sigc++/trackable.h +++ b/sigc++/trackable.h @@ -1,5 +1,4 @@ -/* - * Copyright 2002 - 2016, The libsigc++ Development Team +/* Copyright 2002 - 2016, The libsigc++ Development Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -12,9 +11,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * + * License along with this library; if not, see . */ #ifndef SIGC_TRACKABLE_HPP #define SIGC_TRACKABLE_HPP diff --git a/sigc++/tuple-utils/tuple_cdr.h b/sigc++/tuple-utils/tuple_cdr.h index a4c9e592..6cc41e58 100644 --- a/sigc++/tuple-utils/tuple_cdr.h +++ b/sigc++/tuple-utils/tuple_cdr.h @@ -11,8 +11,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * License along with this library; if not, see . */ #ifndef SIGC_TUPLE_UTILS_TUPLE_CDR_H diff --git a/sigc++/tuple-utils/tuple_end.h b/sigc++/tuple-utils/tuple_end.h index e32d56b9..7fa2e132 100644 --- a/sigc++/tuple-utils/tuple_end.h +++ b/sigc++/tuple-utils/tuple_end.h @@ -11,8 +11,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * License along with this library; if not, see . */ #ifndef SIGC_TUPLE_UTILS_TUPLE_END_H diff --git a/sigc++/tuple-utils/tuple_for_each.h b/sigc++/tuple-utils/tuple_for_each.h index 7b7fb24a..97ffd901 100644 --- a/sigc++/tuple-utils/tuple_for_each.h +++ b/sigc++/tuple-utils/tuple_for_each.h @@ -11,8 +11,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * License along with this library; if not, see . */ #ifndef SIGC_TUPLE_UTILS_TUPLE_FOR_EACH_H diff --git a/sigc++/tuple-utils/tuple_start.h b/sigc++/tuple-utils/tuple_start.h index c75fda91..3df08588 100644 --- a/sigc++/tuple-utils/tuple_start.h +++ b/sigc++/tuple-utils/tuple_start.h @@ -11,8 +11,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * License along with this library; if not, see . */ #ifndef SIGC_TUPLE_UTILS_TUPLE_START_H diff --git a/sigc++/tuple-utils/tuple_transform_each.h b/sigc++/tuple-utils/tuple_transform_each.h index 570e59b3..a4064fa6 100644 --- a/sigc++/tuple-utils/tuple_transform_each.h +++ b/sigc++/tuple-utils/tuple_transform_each.h @@ -11,8 +11,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * License along with this library; if not, see . */ #ifndef SIGC_TUPLE_UTILS_TUPLE_TRANSFORM_EACH_H diff --git a/sigc++/type_traits.h b/sigc++/type_traits.h index 82690eb6..cf6d1eb1 100644 --- a/sigc++/type_traits.h +++ b/sigc++/type_traits.h @@ -1,5 +1,4 @@ -/* - * Copyright 2002 - 2016, The libsigc++ Development Team +/* Copyright 2002 - 2016, The libsigc++ Development Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -12,9 +11,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * + * License along with this library; if not, see . */ #ifndef SIGC_TYPE_TRAIT_H #define SIGC_TYPE_TRAIT_H diff --git a/sigc++/visit_each.h b/sigc++/visit_each.h index 39ee4089..69140566 100644 --- a/sigc++/visit_each.h +++ b/sigc++/visit_each.h @@ -1,5 +1,4 @@ -/* - * Copyright 2002 - 2016, The libsigc++ Development Team +/* Copyright 2002 - 2016, The libsigc++ Development Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -12,8 +11,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * License along with this library; if not, see . */ #ifndef SIGC_VISIT_EACH_HPP #define SIGC_VISIT_EACH_HPP diff --git a/sigc++/weak_raw_ptr.h b/sigc++/weak_raw_ptr.h index c065242c..1830066a 100644 --- a/sigc++/weak_raw_ptr.h +++ b/sigc++/weak_raw_ptr.h @@ -1,5 +1,4 @@ -/* - * Copyright 2016, The libsigc++ Development Team +/* Copyright 2016, The libsigc++ Development Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -12,9 +11,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * + * License along with this library; if not, see . */ #ifndef SIGC_WEAK_RAW_PTR_HPP diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 8fcc942e..4fcbc59c 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -11,8 +11,7 @@ # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# License along with this library; if not, see . enable_testing () diff --git a/tests/test_bind_refptr.cc b/tests/test_bind_refptr.cc index 3d24e31b..dd75c4f9 100644 --- a/tests/test_bind_refptr.cc +++ b/tests/test_bind_refptr.cc @@ -11,8 +11,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * License along with this library; if not, see . */ // Bug 564005 - Valgrind errors and crash on exit with Gtk::UIManager From 690cbefd2806cc2b15a35123c1056667215899a4 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Mon, 21 Apr 2025 16:39:19 +0200 Subject: [PATCH 107/112] Remove ChangeLog.pre-2-3-1 --- ChangeLog.pre-2-3-1 | 2759 ------------------------------------------- 1 file changed, 2759 deletions(-) delete mode 100644 ChangeLog.pre-2-3-1 diff --git a/ChangeLog.pre-2-3-1 b/ChangeLog.pre-2-3-1 deleted file mode 100644 index 5cdd5f48..00000000 --- a/ChangeLog.pre-2-3-1 +++ /dev/null @@ -1,2759 +0,0 @@ -2.3.1: - -2012-10-18 Murray Cumming - - Update the Doxyfile.in syntax. - - * docs/reference/Doxyfile.in: By running doxygen -u - on it. - -2012-10-17 Kjell Ahlstedt - - Add some missing newin{}. - - * docs/reference/Doxyfile.in: Add ALIASES newin. - * sigc++/functors/macros/functor_trait.h.m4: Add newin{2,2,11} to - SIGC_FUNCTORS_DEDUCE_RESULT_TYPE_WITH_DECLTYPE. - * sigc++/signal_base.h: Add newin{2,4} to signal_impl::blocked(), block() and - signal_base::blocked(), block(), unblock(). Bug #153780. - -2012-10-12 Kjell Ahlstedt - - signal_base: Add blocked(), block(), unblock(). - - * sigc++/signal_base.[h|cc]: Add signal_impl::blocked(), block() and - signal_base::blocked(), block(), unblock(). Bug #153780. - -2.2.11: - -2012-09-20 Andris Pavenis - - Fix comma operator in lambda expressions. - - * sigc++/adaptors/lambda/macros/operator.h.m4: Add lambda_action<> - specialization for comma operator (operator,()). - * tests/test_cpp11_lambda.cc: - * tests/test_lambda.cc: Add a test case for the comma operator. Bug #342911. - -2012-09-19 Kjell Ahlstedt - - Add SIGC_FUNCTORS_DEDUCE_RESULT_TYPE_WITH_DECLTYPE. - - * sigc++/adaptors/lambda/macros/base.h.m4: - * sigc++/adaptors/lambda/macros/group.h.m4: - * sigc++/functors/macros/functor_trait.h.m4: - * tests/test_cpp11_lambda.cc: Replace the preprocessor macro - SIGC_FUNCTORS_DEDUCE_RESULT_TYPE_WITH(C_keyword) with - SIGC_FUNCTORS_DEDUCE_RESULT_TYPE_WITH_DECLTYPE. Bug #672555. - -2012-09-10 Kjell Ahlstedt - - Use std::size_t and std::ptrdiff_t. - - * sigc++/macros/signal.h.m4: Use std::size_t and std::ptrdiff_t instead - of ::size_t and ::ptrdiff_t. Only the std versions are required to be - declared in . - * sigc++/signal_base.h: Use std::size_t instead of ::size_t. (I did not change - MSVC++-only code in this file and other files.) - -2012-09-07 Kjell Ahlstedt - - Fix 'make check' with gcc 4.7. - - * sigc++/adaptors/lambda/macros/base.h.m4: Define sigc::unwrap_lambda_value() - before it's used in sigc::lambda::operator[]() and operator=(). - * sigc++/adaptors/lambda/macros/group.h.m4: Fix the C++11 examples in the - documentation as in test_cpp11_lambda.cc. - * tests/test_cpp11_lambda.cc: Only variables with automatic storage duration - shall be captured in C++11 lambda expressions. - -2012-08-28 Kjell Ahlstedt - - Update .gitignore and tests/.gitignore - - * .gitignore: Add *~ (gedit's backup files). - * tests/.gitignore: Add missing executable test files. - -2012-08-28 Kjell Ahlstedt - - Add SIGC_FUNCTORS_DEDUCE_RESULT_TYPE_WITH for C++11 lambda expressions. - - * sigc++/functors/macros/functor_trait.h.m4: Add the preprocessor macro - SIGC_FUNCTORS_DEDUCE_RESULT_TYPE_WITH(C_keyword), which makes it possible to - assign C++11 lambda expressions with any return type to slots. - Thanks to Chow Loong Jin, who posted similar code on libsigc-list. - * sigc++/adaptors/lambda/macros/base.h.m4: - * sigc++/adaptors/lambda/macros/group.h.m4: Add information on C++11 lambda - expressions to the documentation of lambda expressions and sigc::group(). - * tests/Makefile.am: Add test_cpp11_lambda.cc. - * tests/test_cpp11_lambda.cc: New test case, showing that most uses of - libsigc++'s lambda expressions can be replaced by standard C++11 lambda - expressions. Bug #672555. - -2012-03-19 Kjell Ahlstedt - - Enable test_lambda in 'make check'. - - * tests/Makefile.am: Enable test_lambda in 'make check'. - * tests/test_lambda.cc: Comment out the tests with sigc::ref() in lambda - functions' parameter lists. See Bug #669128. - -2.2.10: - -2011-07-21 Thomas Rydzynski - - Mention visit_each() in the documentation of sigc::adapts. - - * sigc++/adaptors/macros/adaptor_trait.h.m4: Mention that a user-supplied - adaptor must be accompanied by a specialization of template function - visit_each(). Correct some minor errors in the example of a user-supplied - adaptor. Bug #486373. - -2011-07-19 Kjell Ahlstedt - - Add a test case for the previous commit. - - * tests/Makefile.am: - * tests/test_bind_refptr.cc: A version of this test is also in glibmm. - Note that this includes a copy/paste of RefPtr. - See Bug #564005#14 (Alexander Shaduri) - -2011-07-14 Kjell Ahlstedt - - slot_rep: Avoid access to deleted object in notify(). - - * sigc++/functors/slot_base.cc: slot_rep::notify() calls disconnect() before - destroy(). If disconnect() has deleted the slot_rep object, destroy() is not - called. Bug #564005. - -2.2.9: - -2011-02-22 Kjell Ahlstedt - - trackable: Avoid calling the same callback function twice - - * sigc++/trackable.cc: Invalidate a callback function entry in - trackable_callback_list::remove_callback() when the list is being cleared. - Bug 589202. - -2011-02-04 Kalev Lember - - Fix the build with GCC 4.6 - - * sigc++/signal_base.h: Include for size_t. - -2010-10-12 David King - - Documentation changes - - * *.h.m4: Minor changes to documentation to fix up code example - formatting, by removing the additional two spaces of indentation. - Additionally, fix some spelling and grammar mistakes and typos. - -2010-09-27 Armin Burgmeier - - * MSVC_Net2005/libsigc++2.sln: - * MSVC_Net2005/libsigc++2.vcproj: - * MSVC_Net2005/tests/test_accumulated/test_accumulated.vcproj: - * MSVC_Net2005/tests/test_bind/test_bind.vcproj: - * MSVC_Net2005/tests/test_bind_return/test_bind_return.vcproj: - * MSVC_Net2005/tests/test_compose/test_compose.vcproj: - * MSVC_Net2005/tests/test_deduce_result_type/test_deduce_result_type.vcproj: - * MSVC_Net2005/tests/test_disconnect/test_disconnect.vcproj: - * MSVC_Net2005/tests/test_disconnect_during_emit/test_disconnect_during_emit.vcproj: - * MSVC_Net2005/tests/test_exception_catch/test_exception_catch.vcproj: - * MSVC_Net2005/tests/test_functor_trait/test_functor_trait.vcproj: - * MSVC_Net2005/tests/test_hide/test_hide.vcproj: - * MSVC_Net2005/tests/test_mem_fun/test_mem_fun.vcproj: - * MSVC_Net2005/tests/test_ptr_fun/test_ptr_fun.vcproj: - * MSVC_Net2005/tests/test_retype/test_retype.vcproj: - * MSVC_Net2005/tests/test_retype_return/test_retype_return.vcproj: - * MSVC_Net2005/tests/test_signal/test_signal.vcproj: - * MSVC_Net2005/tests/test_size/test_size.vcproj: - * MSVC_Net2005/tests/test_slot/test_slot.vcproj: - * MSVC_Net2005/tests/test_trackable/test_trackable.vcproj: - * MSVC_Net2008/libsigc++2.sln: - * MSVC_Net2008/libsigc++2.vcproj: - * MSVC_Net2008/tests/test_accumulated/test_accumulated.vcproj: - * MSVC_Net2008/tests/test_bind/test_bind.vcproj: - * MSVC_Net2008/tests/test_bind_return/test_bind_return.vcproj: - * MSVC_Net2008/tests/test_compose/test_compose.vcproj: - * MSVC_Net2008/tests/test_deduce_result_type/test_deduce_result_type.vcproj: - * MSVC_Net2008/tests/test_disconnect/test_disconnect.vcproj: - * MSVC_Net2008/tests/test_disconnect_during_emit/test_disconnect_during_emit.vcproj: - * MSVC_Net2008/tests/test_exception_catch/test_exception_catch.vcproj: - * MSVC_Net2008/tests/test_functor_trait/test_functor_trait.vcproj: - * MSVC_Net2008/tests/test_hide/test_hide.vcproj: - * MSVC_Net2008/tests/test_mem_fun/test_mem_fun.vcproj: - * MSVC_Net2008/tests/test_ptr_fun/test_ptr_fun.vcproj: - * MSVC_Net2008/tests/test_retype/test_retype.vcproj: - * MSVC_Net2008/tests/test_retype_return/test_retype_return.vcproj: - * MSVC_Net2008/tests/test_signal/test_signal.vcproj: - * MSVC_Net2008/tests/test_size/test_size.vcproj: - * MSVC_Net2008/tests/test_slot/test_slot.vcproj: - * MSVC_Net2008/tests/test_trackable/test_trackable.vcproj: - * MSVC_Net2010/libsigc++2.vcxproj: - * MSVC_Net2010/tests/test_accumulated/test_accumulated.vcxproj: - * MSVC_Net2010/tests/test_bind/test_bind.vcxproj: - * MSVC_Net2010/tests/test_bind_return/test_bind_return.vcxproj: - * MSVC_Net2010/tests/test_compose/test_compose.vcxproj: - * MSVC_Net2010/tests/test_deduce_result_type/test_deduce_result_type.vcxproj: - * MSVC_Net2010/tests/test_disconnect/test_disconnect.vcxproj: - * MSVC_Net2010/tests/test_disconnect_during_emit/test_disconnect_during_emit.vcxproj: - * MSVC_Net2010/tests/test_exception_catch/test_exception_catch.vcxproj: - * MSVC_Net2010/tests/test_functor_trait/test_functor_trait.vcxproj: - * MSVC_Net2010/tests/test_hide/test_hide.vcxproj: - * MSVC_Net2010/tests/test_mem_fun/test_mem_fun.vcxproj: - * MSVC_Net2010/tests/test_ptr_fun/test_ptr_fun.vcxproj: - * MSVC_Net2010/tests/test_retype/test_retype.vcxproj: - * MSVC_Net2010/tests/test_retype_return/test_retype_return.vcxproj: - * MSVC_Net2010/tests/test_signal/test_signal.vcxproj: - * MSVC_Net2010/tests/test_size/test_size.vcxproj: - * MSVC_Net2010/tests/test_slot/test_slot.vcxproj: - * MSVC_Net2010/tests/test_trackable/test_trackable.vcxproj: Add 64 - bit support to MSVC project files. - -2010-09-27 Armin Burgmeier - - * MSVC_Net2005/libsigc++2.sln: - * MSVC_Net2005/tests/test_accumulated/test_accumulated.vcproj: - * MSVC_Net2008/libsigc++2.sln: - * MSVC_Net2008/tests/test_accumulated/test_accumulated.vcproj: Add - test_accumulated to the MSVC projects. - -2010-09-19 Armin Burgmeier - - * MSVC_Net2010/filelist.am: - * MSVC_Net2010/libsigc++2.sln: - * MSVC_Net2010/libsigc++2.vcxproj: - * MSVC_Net2010/libsigc++2.vcxproj.filters: - * MSVC_Net2010/sigc.rc.in: - * MSVC_Net2010/tests/test_accumulated/test_accumulated.vcxproj: - * MSVC_Net2010/tests/test_accumulated/test_accumulated.vcxproj.filters: - * MSVC_Net2010/tests/test_bind/test_bind.vcxproj: - * MSVC_Net2010/tests/test_bind/test_bind.vcxproj.filters: - * MSVC_Net2010/tests/test_bind_return/test_bind_return.vcxproj: - * MSVC_Net2010/tests/test_bind_return/test_bind_return.vcxproj.filters: - * MSVC_Net2010/tests/test_compose/test_compose.vcxproj: - * MSVC_Net2010/tests/test_compose/test_compose.vcxproj.filters: - * MSVC_Net2010/tests/test_deduce_result_type/test_deduce_result_type.vcxproj: - * MSVC_Net2010/tests/test_deduce_result_type/test_deduce_result_type.vcxproj.filters: - * MSVC_Net2010/tests/test_disconnect/test_disconnect.vcxproj: - * MSVC_Net2010/tests/test_disconnect/test_disconnect.vcxproj.filters: - * MSVC_Net2010/tests/test_disconnect_during_emit/test_disconnect_during_emit.vcxproj: - * MSVC_Net2010/tests/test_disconnect_during_emit/test_disconnect_during_emit.vcxproj.filters: - * MSVC_Net2010/tests/test_exception_catch/test_exception_catch.vcxproj: - * MSVC_Net2010/tests/test_exception_catch/test_exception_catch.vcxproj.filters: - * MSVC_Net2010/tests/test_functor_trait/test_functor_trait.vcxproj: - * MSVC_Net2010/tests/test_functor_trait/test_functor_trait.vcxproj.filters: - * MSVC_Net2010/tests/test_hide/test_hide.vcxproj: - * MSVC_Net2010/tests/test_hide/test_hide.vcxproj.filters: - * MSVC_Net2010/tests/test_mem_fun/test_mem_fun.vcxproj: - * MSVC_Net2010/tests/test_mem_fun/test_mem_fun.vcxproj.filters: - * MSVC_Net2010/tests/test_ptr_fun/test_ptr_fun.vcxproj: - * MSVC_Net2010/tests/test_ptr_fun/test_ptr_fun.vcxproj.filters: - * MSVC_Net2010/tests/test_retype/test_retype.vcxproj: - * MSVC_Net2010/tests/test_retype/test_retype.vcxproj.filters: - * MSVC_Net2010/tests/test_retype_return/test_retype_return.vcxproj: - * MSVC_Net2010/tests/test_retype_return/test_retype_return.vcxproj.filters: - * MSVC_Net2010/tests/test_signal/test_signal.vcxproj: - * MSVC_Net2010/tests/test_signal/test_signal.vcxproj.filters: - * MSVC_Net2010/tests/test_size/test_size.vcxproj: - * MSVC_Net2010/tests/test_size/test_size.vcxproj.filters: - * MSVC_Net2010/tests/test_slot/test_slot.vcxproj: - * MSVC_Net2010/tests/test_slot/test_slot.vcxproj.filters: - * MSVC_Net2010/tests/test_trackable/test_trackable.vcxproj: - * MSVC_Net2010/tests/test_trackable/test_trackable.vcxproj.filters: - - * Makefile.am: - * configure.ac: Added project files for Visual Studio 2010. - -2010-06-05 David King - - Small website updates - - * docs/index.html: Remove broken namespace links. - * docs/website/doc.shtml: Link to library.gnome.org tutorial and API - reference. - -2.2.8: - -2010-06-04 Murray Cumming - - Manual: Add an id="index" attribute in case that helps library.gnome.org. - - * docs/manual/libsigc_manual.xml: Add it to the tag. - -2.2.7: - -2010-05-04 Murray Cumming - - Documentation improvements. - - * docs/manual/libsigc_manual.xml: Remove Marshallers section because - it is apparently outdated and there is no example code to test it. - This fixes bug #417924 (Michael Ekstrand) - * sigc++/sigc++.h: Main page text: Rearranged slightly. - -2010-04-27 David King - - Improvements to main page documentation - - * sigc++/sigc++.h: Minor improvements. - -2010-04-23 David King - - Add main page to Doxygen documentation - - * docs/Makefile.am: Parse sigc++/sigc++.h for documentation. - * sigc++/sigc++.h: Add main page to Doxygen documentation. - -2010-04-23 David King - - Fix the functors Doxygen group in the m4 files - - * sigc++/functors/macros/functor_trait.h.m4: - * sigc++/functors/macros/mem_fun.h.m4: - * sigc++/functors/macros/ptr_fun.h.m4: Rename functors to - sigcfunctors. - -2.2.6: - -2010-04-16 Murray Cumming - - Docs: Fix the functors group and the link from the overview. - - * docs/website/doc.shtml: Revert this to point to the overview page at - docs/indeex.html, which I have manually uploaded to the website, until - we add this overview to the doxygen-generated documentation itself. - * sigc++/functors/slot_base.h: - * sigc++/visit_each.h: Rename the functors doxygen group to sigcfunctors, - because doxygen seems to confuse it with the one in libstdc++. - * docs/index.html: Update the links. - -2010-04-16 Murray Cumming - - Website: Fix the Makefile so upload works with sourceforge again. - -2010-04-06 Murray Cumming - - Website: Update the reference API link. - - * docs/website/doc.shtml: Update the reference API link to use - library.gnome.org. We should make sure that the tutorial docbook is there - too. - * docs/website/devel.shtml: Remove CVS-specific instructions, quickly - mentioning the git module instead. - However, the Makefile must be updated to cope with sourceforge's changes. - I was not able to upload this yet. - -2.2.5: - -2010-01-05 Daniel Elstner - - Use non-blurry font for dot graph labels - - * docs/reference/Doxyfile.in (SHOW_INCLUDE_FILES): Enable. - (SHOW_USED_FILES): Disable. - (DOT_FONTNAME): Change from FreeSans to Sans, as the hinting for the - former appears to be rather bad. - (TEMPLATE_RELATIONS): Disable to reduce noise. - -2009-12-29 Krzysztof Kosiński - - Accumulators: Allow return types that are different to the signal's. - - * sigc++/macros/signal.h.m4: signal_emit*: Correct the slot_iterator_buf_type - and slot_reverse_iterator_buf_type typedefs to allow accumulators with - return types that are different to the signal's return type. - * tests/Makefile.am: Reenable test_accumulated, so we can test the fix. - It should be manually disabled if building on AIX (if the AIX problem cannot - be fixed properly). - * tests/test_accumulated.cc: Add an accumulator with a return type that is - different to the signal's return type. In this case it's a vector listing - all results. - Bug #586436. - -2009-12-27 Daniel Elstner - - Disable collaboration graphs in documentation - - * docs/reference/Doxyfile.in (CLASS_DIAGRAMS): Enable. Contrary to - what the Doxygen documentation says, no dot class inheritance graphs - will be generated if both CLASS_DIAGRAMS and COLLABORATION_GRAPH are - set to NO. - (COLLABORATION_GRAPH), (GROUP_GRAPHS): Turn off additional graphs to - reduce the noise. - -2009-10-26 Armin Burgmeier - - * sigc++config.h: Move the first five definitions to the !SIGC_MSC - ifdef block, so MSVC does not see them and only uses the definitions - from the SIGC_MSC block. This fixes the build with MSVC. - -2009-09-19 Daniel Elstner - - Support Automake silent rules - - * configure.ac: Call the AM_SILENT_RULES macro if it is defined. - * docs/doc-manual.am, sigc++/Makefile.am: Prefix the commands of - custom rules with $(AM_V_GEN) or $(AM_V_at) in order to support - the silent rules feature of Automake. - -2009-09-17 Michael Hasselmann - - Documentation cleanup: sigc::hide() always only hides one signal argument - - * sigc++/adaptors/macros/hide.h.m4: The documentation stated that sigc::hide() - could discard multiple signal arguments when in fact the whole API only allows - control over one (dummy) signal argument at a time. The "multiple argument - hiding" example lives in it own section now to make it clearer you have to nest - sigc::hide() for that. - -2009-09-13 Daniel Elstner - - Enable verbose output of autoreconf - - * autogen.sh: Pass --verbose option to autoreconf. - -2.2.4.2: - -2009-09-02 Daniel Elstner - - Bump version to 2.2.4.2 and update NEWS - - * configure.ac (AC_INIT): Increment version number to 2.2.4.2. - (MM_PREREQ): Require mm-common 0.7.2. - * NEWS: Write news entry for libsigc++ 2.2.4.2. - -2009-09-02 Daniel Elstner - - Document namespace sigc briefly - - * sigc++/signal_base.h (sigc): Prepend documentation comment to - provide a brief description of namespace sigc, so that Doxygen - will recognize the namespace as documented. - -2009-08-31 Daniel Elstner - - Update Doxygen configuration for Doxygen 1.6.1 - - * docs/reference/Doxyfile.in: Update configuration template using - Doxygen 1.6.1. - (SORT_MEMBERS_CTORS_1ST): Enable. - -2009-08-31 Daniel Elstner - - Protect space after comma in M4 output - - * sigc++/macros/template.macros.m4 (_LOOP_SEP): Triple-quote the - list separator in this hairy construct, since the macro definition - itself is not quoted at all and the space after the comma got lost - in the output. This, in turn, produced overlong lines in the HTML - reference documentation. - -2.2.4.1: - -2009-08-28 Daniel Elstner - - Update news entry for libsigc++ 2.2.4.1 release - - * NEWS: Update top entry for release 2.2.4.1 of libsigc++. - (2.2.4): Correct spelling of Frédéric Péters' name. - -2009-08-27 Daniel Elstner - - Use shared mm-common Doxygen style sheet - - * configure.ac (MM_PREREQ): Require mm-common 0.7. - * docs/Makefile.am (dist_noinst_DATA): List doxygen.css. - * docs/reference/Doxyfile.in (HTML_STYLESHEET): Assign path - to the shared doxygen.css provided by mm-common. - -2009-08-27 Daniel Elstner - - Remove header and footer HTML fragments - - * docs/reference/libsigc_{header,footer}.html_fragment: Delete - files. These custom fragments were an unnecessary maintenance - hassle. Also, the files were out of date with respect to the - encoding and CSS classes used by Doxygen. - * docs/reference/Doxyfile.in (HTML_HEADER), (HTML_FOOTER): Set - to the empty string. - (PROJECT_NAME): Substitute @PACKAGE_NAME@. - (PROJECT_NUMBER): Substitute @PACKAGE_VERSION@. It does look - nicer in the generated HTML pages, and is probably also less - confusing. - (SORT_GROUP_NAMES): Enable for predictability. - -2009-08-26 Daniel Elstner - - Bump version to 2.2.4.1 and update NEWS - - * configure.ac (AC_INIT): Increment version number to 2.2.4.1. - * NEWS: Write news entry for libsigc++ 2.2.4.1. - -2009-08-26 Daniel Elstner - - Reenable hierarchy graphs for each class - - * docs/reference/Doxyfile.in (COLLABORATION_GRAPH): Set option - to YES to enable the per-class inheritance graphs. - -2009-08-25 Daniel Elstner - - Have Automake check NEWS and use bzip2 - - * configure.ac (AM_INIT_AUTOMAKE): Add options check-news and - dist-bzip2. - -2009-08-25 Daniel Elstner - - Update NEWS for libsigc++ 2.2.4 release - -2009-08-25 Daniel Elstner - - Bump version to 2.2.4 and require mm-common 0.6.1 - - * configure.ac (AC_INIT): Increase version number to 2.2.4. - (MM_PREREQ): Require mm-common 0.6.1 for the updated default - location of the reference documentation. - -2009-08-25 Daniel Elstner - - Change documentation host to library.gnome.org - - * README, docs/manual/libsigc_manual.xml: Adjust links to the - reference documentation in the text. - * docs/Makefile.am (pubdocbase), (htmlrefpub): Remove override - and use the updated mm-common default values. - * sigc++{,-uninstalled}.pc.in (htmlrefpub): Adjust link. - -2009-08-24 Daniel Elstner - - Add id="content" element to documentation index - - * docs/reference/libsigc_header.html_fragment: Start
element - with attribute id="content" to match the other C++ binding modules. - * docs/reference/libsigc_footer.html_fragment: Close
element. - -2009-08-20 Daniel Elstner - - Use new version component substitutions - - * MSVC_Net200[58]/sigc.rc.in: Replace the no longer defined - @FP_*_VERSION@ substitutions by the new @SIGCXX_*_VERSION@ - substitutions for the version number components. These are - defined by MM_INIT_MODULE() from mm-common. - -2009-08-20 Daniel Elstner - - Substitute API version in filenames dynamically - - * sigc++.pc.in: Rename file from sigc++-2.0.pc.in. - * sigc++-uninstalled.pc.in: Rename file from - sigc++-2.0-uninstalled.pc.in. - * MSVC_Net200[58]/sigc.rc.in: Rename files from sigc-2.0.rc.in - and use @SIGCXX_API_VERSION@ substitution for the API version. - Also replace @VERSION@ with @PACKAGE_VERSION@. - * MSVC_Net200[58]/libsigc++2.{sln,vcproj}: Remove version from - the project name and filenames. - * MSVC_Net200[58]/filelist.am: Remove version from filenames. - * configure.ac (AC_CONFIG_FILES): Insert ${SIGCXX_MODULE_NAME} - into output filenames and remove the version from the input - filenames. - * Makefile.am: Use $(SIGCXX_MODULE_NAME) in pkg-config file - names instead of hard-coding the API version. - * sigc++/Makefile.am (lib_LTLIBRARIES): Instead of hard-coding - the libtool archive name, substitute @SIGCXX_API_VERSION@ into - it, as well as into the derived variable names. - -2009-08-17 Daniel Elstner - - Set libtool version information - - * sigc++/Makefile.am (libsigc_2_0_la_LDFLAGS): Add libtool option - -version-info 0:0:0 to specify the version information explicitly. - -2009-08-16 Daniel Elstner - - Remove unused parameter names for correctness - - * tests/test_copy_invalid_slot.cc, tests/test_custom.cc, - tests/test_deduce_result_type.cc, tests/test_functor_trait.cc, - tests/test_limit_reference.cc: Remove the names of unused function - parameters from the prototype, in order to get libsigc++ to build - with fatal compiler warnings. - -2009-08-16 Daniel Elstner - - Rename scripts/ to build/ for consistency - - * build/: Rename directory from scripts/ for consistency with most - of the other modules that switched to the new build infrastructure. - * Makefile.am (ACLOCAL_AMFLAGS): Adjust M4 include directory. - * README: Adjust a reference to scripts/ in the text. - * configure.ac (AC_CONFIG_AUX_DIR): Copy auxiliary files to build/. - (AC_CONFIG_MACRO_DIR): Place Autoconf M4 files into build/. - * docs/Makefile.am: Include $(top_srcdir)/build/doc-reference.am. - -2009-08-16 Daniel Elstner - - Update for latest mm-common 0.4 - - * configure.ac (MM_PREREQ): Require mm-common 0.4. - (MM_INIT_MODULE): Omit now optional version number argument. - (MM_CONFIG_DOCTOOL_DIR): Copy the documentation utilities into docs/ - instead of scripts/. - * Makefile.am (dist_noinst_DATA): Remove documentation utilities. - * sigc++-2.0.pc.in (htmlrefpub): Append trailing slash. - * sigc++-2.0-uninstalled.pc.in (htmlrefpub): ditto, - * docs/Makefile.am (htmlrefpub): ditto. - (doc_input): Perform a VPATH search for each input file, to correctly - handle the case of rebuilding the documentation of a tarball release - which includes the generated sources. - (dist_noinst_DATA): List documentation utilities. - -2009-08-11 Daniel Elstner - - Do not recurse into MSVC subdirectories - - * MSVC_Net200[58]/filelist.am: New Automake include files, defining - the lists of files to ship from the MSVC project directories. - * MSVC_Net200[58]/Makefile.am: Delete recursive Makefile.am files. - * Makefile.am: Include MSVC_Net200[58]/filelist.am. - (dist_noinst_DATA): Distribute MSVC project files. - (SUBDIRS): Do not recurse into the MSVC_Net200[58] subdirectories. - * configure.ac (AC_CONFIG_FILES): Remove the output files - MSVC_Net200[58]/Makefile.am from the list. - (AC_CONFIG_COMMANDS): Copy sigc++config.h into the MSVC project - directories at the end of config.status. - -2009-08-11 Daniel Elstner - - Remove now superfluous doctool overrides - - * docs/Makefile.am: Remove overrides for the documentation - utilities, since MM_CONFIG_DOCTOOL_DIR() already takes care - of setting MMDOCTOOLDIR to the local directory. - * sigc++-2.0.pc.in (datadir): Substitute value, just in case. - -2009-08-10 Daniel Elstner - - Have mm-common-prepare install the doc utils - - * configure.ac: Call MM_CONFIG_DOCTOOL_DIR([scripts]) to set - up the destination directory for mm-common-prepare to copy - the documentation utilities to. - * scripts/doc-install.pl: Delete file. - * scripts/doc-postprocess.pl: ditto, - * scripts/tagfile-to-devhelp2.xsl: ditto. - -2009-08-09 Daniel Elstner - - Refresh doc-install and doc-postprocess copies - - * scripts/doc-install.pl, scripts/doc-postprocess.pl: Copy - latest versions from the mm-common module. - * docs/Makefile.am (doc_install), (doc_postprocess): Include - $(PERL) interpreter command in front of the script name. - -2009-08-08 Daniel Elstner - - Disable extraction of undocumented identifiers - - * docs/reference/Doxyfile.in (EXTRACT_ALL): Change setting to - NO, and adapt a number of related options accordingly. The - result is a net loss of about 300 generated .html files. The - roughly 450 files which remain now are still an insanely high - number, though. - (PREDEFINED): Predefine the Autoconf configuration defines to - nudge Doxygen towards documenting the canonical code paths. - -2009-08-07 Daniel Elstner - - Use #error explicitly instead of broken code - - * sigc++config.h.in: Do use the #error preprocessor directive, - instead of an errornous piece of code. This code does not need - the same level of obfuscation as an Autoconf feature test. - -2009-08-07 Daniel Elstner - - Change bug report URL to point to Bugzilla - - * configure.ac (AC_INIT): Change the bug-report argument to the - URL for filing a new libsigc++ bug on bugzilla.gnome.org. Also - name the website URL as fifth argument. It will simply be ignored - if the installed Autoconf does not support this new feature. - -2009-08-07 Daniel Elstner - - Do not enable -pedantic mode by default - - * configure.ac (MM_ARG_ENABLE_WARNINGS): Remove -pedantic from the - list of compiler flags to use at warning level "min" (the default). - -2009-08-07 Daniel Elstner - - Correct M4 forbidden tokens pattern - - * configure.ac (m4_pattern_forbid): Take into account that the - pattern is applied to tokens, not lines. Also catch unexpanded - calls to underscore-prefixed private macros. - -2009-08-06 Daniel Elstner - - Transition to new mm-common build infrastructure - - * autogen.sh: Replace with a minimal script that simply executes - mm-common-prepare, autoreconf and configure. - * configure.ac: Get rid of an enormous amount of old cruft. Use - macros from the new mm-common module to set up Doxygen for building - the documentation. Add option to enable more compiler warnings. - * sigc++-2.0-uninstalled.pc.in: New pkg-config data file to allow - linking to an uninstalled libsigc++. - * sigc++-2.0.pc.in: Modernize. Provide the location of the - installed reference documentation and the Doxygen tag file. - * sigc++config.h.in: Modernize and update for new build - infrastructure. - * Makefile.am, */Makefile.am: Modernize and adapt to the new C++ - binding build infrastructure in the mm-common module. - * sigc++/filelist.am: New Automake include file. Defines lists - of C++ and M4 source files. - * docs/Makefile.am: Rewrite using doc-reference.am from the - mm-common module. - * docs/doc-manual.am: New Automake include file for building the - libsigc++ Docbook manual. - * docs/images/Makefile.am: Remove file. - * docs/manual/Makefile.am: ditto, - * docs/reference/Makefile.am: ditto. - * docs/Makefile_web.am_fragment: Remove for now, to be taken care - of later. - * docs/reference/Doxyfile.in: Modernize and adapt to new build - infrastructure. - * docs/reference/beautify_docs.pl: Remove and use the more recent - scripts/doc-postprocess.pl instead. - * libsigc++-2.0.spec.in: Remove, to be resurrected only if someone - complains. - * scripts/Makefile.am: Remove file. Distribute the files from the - toplevel Makefile.am instead. - * scripts/cxx_std.m4: Add missing third argument to AC_DEFINE(). - * scripts/doc-install.pl: New file, copied from mm-common. - * scripts/doc-postprocess.pl: ditto, - * scripts/tagfile-to-devhelp2.xsl: ditto. - -2008-11-13 Murray Cumming - - * docs/website/stable.shtml: Correct the download link so it shows all - versions, not just 2.0. - -2.2.3: - -2008-10-08 Armin Burgmeier - - * MSVN_Net2005/libsigc++2.vcproj: Changed output name to match the new - naming convention. - - * MSVC_Net2008/: Added MSVC 2008 project files. These are basically - the same as for MSVC 2005, but converted to MSVC 2008 projects. - - * configure.ac: - * Makefile.am: Added the new files to the build. - -2008-08-08 Armin Burgmeier - - * MSVC_Net2005/libsigc++2.sln: Enable the disconnect_during_emit test - by default. - - * MSVC_Net2005/libsigc++2.vcproj: Renamed the generated debug database - file to sigc-2.0d.pdb (the default), to stay consistent with the *mm - wrapper libraries. - -2008-08-08 Armin Burgmeier - - * MSVC_Net2005/: Moved from MSVC_Net2003. - - * MSVC_Net2005/libsigc++2.sln: - * MSVC_Net2005/libsigc++2.vcproj: - * MSVC_Net2005/tests/*/*.vcproj: Converted the Visual Studio 2003 - project files to 2005 ones. - - * MSVC_Net2005/Makefile.am: - * Makefile.am: - * configure.ac: Adapted build files accordingly. - -2008-04-06 Cedric Gustin - - * MSVC_Net2003/sigc-2.0.rc.in: Removed ATL/MFC header files - dependency as afxres.h is not part of the Microsoft Platform - SDK provided with Visual C++ Express 2008. - Bug #503933. - -2.2.2: - -2008-03-10 Deng Xiyue - - * sigc++/macros/signal.h.m4: - * tests/test_accum_iter.cc: Add ifdefs around uses of - reverse_iterator to really fix the build with recent - versions of Sun CC. - Bug #302098. - -2.2.0: - -2008-01-01 Ryan Hill - - * tests/test_copy_invalid_slot.cc: Include the cstdlib - and cstring headers to fix the build with the gcc 4.3 - pre-release. Bug #454882. - -2007-08-31 Murray Cumming - - * tests/test_copy_invalid_slot.cc: Added some includes to - fix the build in some environments, such as when using Sun CC. - Thanks to Vladimir Marek in bug #469872. - -2.1.1: - -2007-08-14 Murray Cumming - - * sigc++/Makefile.am: - * sigc++/compatibility.h: Removed this header. - * sigc++/bind.h: - * sigc++/bind_return.h: - * sigc++/connection.h: - * sigc++/macros/class_slot.h.m4: - * sigc++/macros/hide.h.m4: - * sigc++/macros/method_slot.h.m4: - * sigc++/macros/object_slot.h.m4: - * sigc++/macros/retype.h.m4: - * sigc++/macros/signal.h.m4: - * sigc++/macros/slot.h.m4: - * sigc++/object.h: - * sigc++/retype_return.h: Removed deprecated - compatibility API, to probably fix the build with - some compilers, such as some versions of the Sun Forte C++ - CC compiler. Some of these headers are now mostly empty and - should be removed later. - This API has been deprecated April 2004, and - is not widely used, so it seems safe to do this now. - - * tests/Makefile.am: - * tests/test_compatibility.cc: Removed this test. - -2007-07-28 Michael Elkstrand - - * sigc++/macros/signal.h.m4: slot_iterator_buf, - slot_reverse_iterator_buf: Added typedefs for - value_type, reference, and pointer, so that these - iterators are more like standard C++ iterators, so they can - be used with standard C++ algorithms. - * tests/Makefile.am: - * tests/test_accum_iter.cc: Added a test for this. - Bug #417926. - -2006-11-14 Daniel Elstner - - * autogen.sh: Wholly replace this script with a critter from one - of my personal projects, with slight modifications. This one does - some sophisticated stuff like probing version numbers of available - automake and aclocal executables, in order to choose the right one - accordingly. All this is necessary to make the build system work - robustly in custom environments such as Maemo where automake-1.9 - doesn't come preinstalled. - -2006-06-20 Murray Cumming - - * sigc++/adaptors/macros/bind.h.m4: - * sigc++/adaptors/macros/retype.h.m4: - * sigc++/functors/macros/functor_trait.h.m4: - * sigc++/functors/macros/slot.h.m4: - * sigc++/macros/retype.h.m4: - * sigc++/macros/signal.h.m4: Revert the previous changes, because none is - used in the exported symbol names from gtkmm, so this would break the ABI - of gtkmm. - -2006-05-26 Régis Duchesne - - * sigc++/adaptors/macros/bind.h.m4: - * sigc++/adaptors/macros/retype.h.m4: - * sigc++/functors/macros/functor_trait.h.m4: - * sigc++/functors/macros/slot.h.m4: - * sigc++/macros/retype.h.m4: - * sigc++/macros/signal.h.m4: - Renamed 'nil' to 'none' to allow an Objective-C++ compiler to compile - the library header files. - -2005-12-21 Murray Cumming - - * sigc++/macros/signal.h.m4: Make remaining - reverse_iterator_buf operator--() methods - return by reference, like the operator++() methods. - Bug #304402 from John Profic. - -2005-12-20 Murray Cumming - - * sigc++/macros/signal.h.m4: Make all operator--() methods - return by reference, like the operator++() methods. - Bug #304402 from John Profic. - -2005-12-14 John Profic - - * sigc++/macros/signal.h.m4: Fix compilation problem in - the last patch. - -2005-12-14 John Profic - - * sigc++/macros/signal.h.m4: Added emit_reverse(). - -This is the HEAD branch, for API/ABI-compatible API additions. -See also the libsigc-2-0 branch. - -2005-12-01 Murray Cumming - - * sigc++/functors/slot_base.cc: - slot_base::disconnect(): Set call_ to 0, - to invalidate the slot, even if parent_ is 0. - I think parent_ is, for instance, a signal, but - disconnect should still work on a slot that is not - connected to a signal, because a slot can be invoked - directly. - Fixes bug #311057 from James Lin. - -2005-12-01 Murray Cumming - - * tests/Makefile.am: - * tests/test_slot_disconnect.cc: Added test - case from bug #311057. - -2005-11-16 Philipp Berndt - - * sigc++/adaptors/macros/exception_catch.h.m4: Make member - exception_catch_functor::catcher_ - public so that it can be accessed by visit_each() - (bug fixed for generalization on 2004-11-06) - -2.0.16: - -2005-08-01 Neal E. Coombes - - * sigc++/signal_base.h: Updated the documentation for temp_slot_list - as requested in bug #303896. - -2005-08-01 Murray Cumming - - * sigc++/adaptors/hide.h.m4: Added missing - ) in call to sun_forte_workaround(), fixing - build on SUN Forte 5.5. Bug #312020. - -2005-08-19 Bruno Martinez - - * sigc++/type_traits.h: Renamed - ::sigc::is_base_and_derived::internal to - ::sigc::is_base_and_derived::internal_class - in order to avoid conflict with - namespace internal. - -2005-07-13 Murray Cumming - - * docs/manual/libsigc_manual.xml: Correct mentions of - 1.2 stuff instead of 2.0. Patch in bug #310213 from - pebble.org.uk. - -2005-07-13 Murray Cumming - - * docs/manual/libsigc_manual.xml: Fixed typo - found by Antonio Coralles. - -2005-07-09 Murray Cumming - - * sigc++/macros/signal.h.m4: Did the same (see - last commit) for slot_const_iterator and - slot_iterator_buf. - -2005-07-09 Murray Cumming - - * sigc++/macros/signal.h.m4: slot_iterator: - operator--() now returns value, not reference, like - operator++() already did. This caused crashes when - using --no-inline with g++. Bug #308651 by - Michael Andres. - -2.0.15: - -2005-07-04 Philip Langdale - - * sigc++/adaptors/macros/compose.h.m4: Add a setter typedef to - compose*_functor and use it instead of the (incorrect) getter - typedef in the compose* specialization of visit_each<>(). - This corrects the lifetime management of slots created with - compose(). Bug #308433. - -2005-06-13 Marek Rouchal - - * tests/test_deduce_result_type.cc: Specify int return type - for main(), to be more ISO C++ compliant. Bug #307478. - -2005-06-11 Andris Pavenis - - * sigc++/adaptors/lambda/macros/base.h.m4: - * sigc++/adaptors/lambda/macros/select.h.m4 - * sigc++/adaptors/macros/hide.h.m4: Specify only a type (not a - parameter name) for unused member function parameters - -2005-06-12 Paul Pogonyshev - - * configure.ac: - * scripts/cxx.m4: - * sigc++config.h.in: Add test for whether the compiler allows - referencing to member functions of the class/structure being - declared from a definition of a static member variable. - Supposedly a generic solution for GCC 3.2 compilation problems. - - * sigc++/type_traits.h: Define SIGC_WRAP_IS_BASE_CLASS_ based on - results of the above test. - (struct is_base_and_derived): Wrap up is_base_class_() functions - in an internal class if SIGC_WRAP_IS_BASE_CLASS_ is defined. - -2005-06-10 Murray Cumming - - * sigc++/adaptors/macros/bind.h.m4: - * sigc++/functors/macros/slot.h.m4: - * sigc++/macros/signal.h.m4: Use CALL_SIZE instead of - hard-coded 7s and 6s. - -2.0.14: - -2005-06-10 Murray Cumming - - * sigc++/visit_each.h: Make the - limit_derived_target::with_type inner class an outer class, - to satisfy the SUN CC 5.7 compiler, though I think it is a - compiler bug. Bug #302098 has the test case. - -2.0.13: - -2005-06-07 Murray Cumming - - * tests/test_compatibility.cc: Specify the actual class when - using test_int(), instead of the derived class, to fix the build - on SUN Forte CC 5.5. Patch from Friedemann Kleint in - Bug #305647 - -2005-06-07 Murray Cumming - - * sigc++/macros/signal.h.m4: signal_emit::emit(): Use scope to - ensure a certain order of destruction of the member variables, to - avoid a leak on MSVC++. Patch by Andreas Ames in Bug #306249. - -2005-06-07 Murray Cumming - - * sigc++/macros/signal.h.m4: Added comments about commenting-out - SIGC_TYPEDEF_REDEFINE_ALLOWED when using SUN Forte CC 5.7, - because I can not seem to create a test for it. - -2005-06-07 Murray Cumming - - * configure.ac: - * scripts/cxx_std.m4: - * sigc++/macros/signal.h.m4: - * sigc++config.h.in: Added check for - the non-standard SUN Forte reverse_iterator<>, - and used it. This is based on the same stuff in - gtkmm. - -2005-06-07 Murray Cumming - - * sigc++/visit_each.h: limit_derived_target(): Just some whitespace - changes. - -2005-05-16 Neal E. Coombes - - * sigc++/signal_base.h: Modified temp_slot_list to be a temporary view - into a slot list. Instead of emptying the original it now simply tacks - a placeholder to the end of the original. It then uses this as it's - 'end' iterator. This should allow for conscious recursiveness, as well - as inserting a slot to any position in the slot list during emittion. - See bug #303896. - -2005-06-04 Friedemann Kleint - - * sigc++/macros/limit_reference.h.m4: - visit_each() template specializations: - Mention the bool I_derives_trackable - template type, to fix the build on Solaris - Forte 5.5. - -2.0.12: - -2005-05-06 Régis Duchesne - - * sigc++/macros/limit_reference.h.m4 (added): - * sigc++/Makefile.am: - New class that just stores a reference, and makes sure that if the - reference derives from trackable, then the trackable reference will be - used instead of the derived reference in visit_each(). - * sigc++/functors/macros/mem_fun.h.m4: Better fix for bug #169225 by - Régis Duchesne and Christian Hammond, based on the new limit_reference - class. - * sigc++/adaptors/bound_argument.h (added): New class (built upon the - new limit_reference class) that handles all 3 kinds of bound arguments: - by value, by reference, and by constant reference. References are - unwrapped in the bound_argument's constructor. - * sigc++/adaptors/macros/bind.h.m4: Fix for bug #302327 by Régis - Duchesne. Bound arguments now need to know whether they are passed by - reference or not. So bind() now builds bind_functor instances using - 'reference_wrapper' types, instead of 'Foo &' types. The - bind_functor code is modified to compensate. - * sigc++/adaptors/macros/bind_return.h.m4: Similar fix for a similar - bug (unfiled) with bound return arguments. - * sigc++/reference_wrapper.h: - * sigc++/type_traits.h: - The reference_wrapper class is only used in bound_argument.h. Put - correct but unused code under #if 0. - * sigc++/adaptors/lambda/base.h: This file needs reference_wrapper.h, - but was incorrectly relying on type_traits.h to include it. - * tests/Makefile.am: - * tests/test_virtualbase_delete.cc (deleted): - * tests/test_virtualbase_delete_ref_param.cc (deleted): - * tests/test_limit_reference.cc (added): - Replaced test_virtualbase_delete*.cc with a simpler - test_limit_reference.cc which checks for all 3 aspects of the same bug - in one file. - * tests/test_bind_ref.cc: Slots must use 'Foo &' types. We were lucky - this broken usage worked before this change. The change in - type_traits.h made this bug obvious, by preventing the code to compile. - * tests/test_bind_return.cc: After my change, bind() and bind_return() - must use 'reference_wrapper' types. - * tests/test_custom.cc: Made this test a no-op (so it does not perturb - 'make check' on released versions of the library) and made it a - template ready to be modified by hackers. - -2005-05-01 Murray Cumming - - * sigc++/functors/slot_base.cc: - slot_base::slot_base(src): If the source - slot_base has a null rep->call_, meaning that the - slot is invalid, just return a default-constructed - slot, to prevent the crash shown in - tests/tests_copy_invalid_slot.cc. Bug #302515 by - Régis Duchesne. - -2005-05-01 Murray Cumming - - * sigc++/functors/macros/mem_fun.h.m4: bound_*<>: - Add a new is_base_and_derived - parameter to the template and thereby provide a - specialization for T_Obj types that derive from - sigc::trackable. This prevents a crash when casting - from the derived type to sigc::trackable after the - derived destructor has run. This cast can sometimes - fail when using multiple inheritance, at least with - g++. Bug #169225 by Régis Duchesne and Christian - Hammond. - * sigc++/type_traits.h: Add documenation for - the internal is_base_and_derived<> template, which - allows us to specialize other templates for certain - template types. - -2005-04-28 Murray Cumming - - * sigc++/type_traits.h: Added comments for users of - g++ 3.2. - -2005-04-28 Murray Cumming - - * tests/Makefile.am: - * tests/test_virtualbase_delete.cc: Added - simplified test case from bug #169225. We have a patch - to make this succeed but I am not ready to commit it - just yet. - -2005-04-27 Murray Cumming - - * tests/Makefile.am: - * tests/test_custom.cc: - Added a place to put extra test code, so I don't have - to keep installing my crazy libsigc++ versions. - -2005-04-27 Murray Cumming - - * sigc++/visit_each.h: Revert back to the non-explicit - template call, because we can not specify the - template specialization so easily, because the - specializations have different numbers of types. - * tests/Makefile/am: - * tests/test_bind_ref.cc: Add a simple test only for - sigc::ref disconnection. - -2005-04-26 Murray Cumming - - * sigc++/visit_each.h: Use the explicit template - specialization, needed for Tru64 and AIX compilers. - This causes a crash in some uses of sigc::ref() - (when using g++ 3.3.4 or 3.3.5 , but not with 3.4) but - seems to fix a crash in some uses of multiple inheritance - (bug #169225). - * tests/test_bind.cc: Comment out the crashing (not with - g++ 3.4) use of sigc::ref() with an explanatory comment. - -2.0.11: - -2005-03-09 Cedric Gustin - - * Makefile.am: Moved MSVC_Net2003 directory to SUBDIRS. - * MSVC_Net2003/Makefile.am: Added blank.cpp to EXTRA_DIST. - * MSVC_Net2003/libsigc++2_msvcNet2003.sln: Removed - test_accumulated and test_lambda projects as the tests are - disabled in the standard, configure-based build. - * MSVC_Net2003/MSVC_Net2003/libsigc++2_msvcNet2003.vcproj: - Generate a PDB file in the Debug target. - -2005-03-05 Murray Cumming - - * docs/website/stable.html: Mention actual supported compilers. - * docs/website/docs.html: Removed broken examples links. Change - reference link to the reference overview page. - -2005-02-23 Murray Cumming - - * sigc++/functors/slot_base.h: Make slot_base::operator=() public, to - fix the build with SUN Forte C++ 5.5 and Tru64. - -2.0.10: - -2005-02-20 Murray Cumming - - * tests/test_slot.cc, test_disconnect.cc: #included to avoid - an unresolved symbol error with the Tru64 compiler. Solution found by - Tim Mooney in bug #161503. - -2005-02-20 Martin Schulze - - * sigc++/signal_base.h: Add some documentation. - -2005-02-20 Martin Schulze - - * sigc++/signal_base.cc: Reset deferred_ flag to false in - signal_impl::sweep() (Neal E. Coombes). Partly fixes bug #167714. - -2005-02-11 Martin Schulze - - * docs/manual/Makefile.am: Set the correct group in post-html. - -2005-02-11 Murray Cumming - - * docs/website/doc.shtml: Fix typo in url for reference docs. Found by - James Lin. - -2005-02-06 Murray Cumming - - * sigc++/signal_base.h: temp_slot_list::begin(), end(): Actually - return the iterators. - -2005-02-03 Neal E. Coombes - - * sigc++/signal_base.h: Add temp_slot_list struct to facilitate - allowing new connections to a signal during an emittion without - affecting that emittion. - * sigc++/macros/signal.h.m4: Use the new struct temp_slot_list to - prevent connections made during an emittion from being called in the - same emittion (which has the potential of causing things like - infinite loops). This guarantees an emittion will be finite, as well - as maintaining any order of emittion guarantees that may have already - been in place. - -2.0.9: - -2005-02-02 Murray Cumming - - * sigc++/visit_each.h: visit_each_type(): Reverted the change, so that - we do not specify the template types ot visit_each<>(), because it - crashes on g++ 3.3.4 (but not g++ 3.4.2). Added a comment telling users - of AIX (and maybe IRIX MipsPro and Tru64) to use the alternative version - if they have compilation problems. - -2005-02-01 Murray Cumming - - * sigc++/adapators/macros/base.h.m4: Add sigc::var<>() documentation, - from Roger Ferrer Ibáñez in bug #149483. - -2005-02-01 Murray Cumming - - * sigc++/adaptors/macros/compose.h.m4: In the template specializations - of visit_each(): As before, specify the specific other template - specializations of visit_each that we use. Needed by AIX. - * tests/Makefile.am: Reenabled most tests, because AIX can now - build them. - -2005-02-01 Murray Cumming - - * sigc++/visit_each.h: visit_each_type(): Specify the specific - template specialization of visit_each<>() to use. The AIX compiler, - and possibly the Tru64 compiler, need this extra hint. - -2005-02-01 Murray Cumming - - * bind.h.m4: Define bind_functor::operator() inline because the AIX - compiler/linker sometimes fails to find it when it is defined - outside of the class. - -2.0.8: - -2005-01-30 Murray Cumming - - * sigc++/type_traits.h: is_base_and_derived: Added - avoid_gcc3_warning_(), to avoid an incorrect warning when using - g++ 3.3.5 - -2005-01-28 Liza Klerck - - * sigc++/functors/macros/mem_fun.h.m4: Add a sigc:: namespace - prefix to the nested use of visit_each(), to avoid ambiguity when - using 2 versions of the libsigc++ API inside different namespace. - -2005-01-27 Murray Cumming - - * sigc++/adaptors/macros/adaptor_trait.h.m4: Add a sigc:: namespace - prefix to the nested use of visit_each(), to avoid ambiguity when - using 2 versions of the libsigc++ API inside different namespace, - which is not very advisable anyway. Bug #165222 from - liza at trdlnk.com. - -2.0.7: - -2005-01-24 Cedric Gustin - - * sigc++config.h.in : Moved the SIGC_USING_STD macro definition - out of the SIGC_CONFIGURE section. We also need it for MSVC. - * MSVC_Net2003/.cvsignore : Added .def and .aps files - * MSVC_Net2003/Makefile.am: Rewrote rule for local copy of - sigc++config.h (required for 'make distcheck'). - * MSVC_Net2003/libsigc++2_msvcNet2003.sln: Added test_retype and - test_disconnect_during_emit tests. - * MSVC_Net2003/tests/test_disconnect_during_emit/*, - MSVC_Net2003/tests/test_retype/*: Initial commit. - -2005-01-21 Murray Cumming - - * tests/: Disabled the test_accumulator, test_bind, and test_compose - tests, and part of test_mem_fun because the AIX xlC compiler can not - build them, but it can still do most things, including the examples. - See the comments in tests/Makefile.am. - -2005-01-21 Murray Cumming - - * sigc++/adaptors/bind.h.m4: non-member operator()(): Specify the - extra nil arguments in the templated class name prefix. Oddly, the - AIX xlC compiler says that the type of the first parameter does not - match the template if you don't do this. - -2005-01-21 Murray Cumming - - * sigc++/type_traits.h: is_base_and_derived struct: Move the - is_base_class_() functions out of the inner class, because the AIX - xlC compiler does not like that - see the comments in the code. - * sigc++/adaptors/bind.h.m4: Add the extra nil template types to - the template specializations, as in slot and signal. - -2005-01-21 Murray Cumming - - * sigc++/functors/macros/slot.h.m4, sigc++/macros/signal.h.m4: - slot and signal template specialization for - various numbers of template args: In the class slot line, specify - all the remaining template types as null, instead of expecting the - compiler to guess them in itself. This partly fixes the build on - AIX with the xlC compiler. Bug #164685. - -2005-01-19 Murray Cumming - - * sigc++/type_traits: struct is_base_and_derived: Make the test inner - struct a friend, so that it can use the big inner struct. This is - required by the Tru64 compiler. - * sigc++/adaptors/lambda/base.h: Put the unwrap_lambda_value() - definitions at the top, because Tru64 (understandably) needs them to - be declared before use. - -2005-01-19 Murray Cumming - - * scripts/: Added cxx_std.m4, with a test copied from - glibmm/scripts/cxx_std.m4 to check if the compiler has the std:: - namespace. - * sigcconfig.h: #undef the new #define and add SIGC_USING_STD(), - like GLIBMM_USING_STD, to put stuff in the std:: namespace when it - is not there already, - * configure.in: Used the new test. - * tests/*: Uses SIG_USING_STD() for every std:: thing that we use. - This is needed by the Tru64 and HP-UX compilers when using their - defaults. - -2005-01-19 Murray Cumming - - * configure.in: AC_INIT(): Provide the extra tarball name parameter, - so that it does not create a libsigc--- tarball. - -2005-01-19 Murray Cumming - - * configure.in: AC_INIT(): Use libsigc++ instead of sigc++, attempting - to get the correct tarball name. - -2005-01-18 Murray Cumming - - * configure.in: Used the autoconf 2.93 and AM_INIT_AUTOMAKE() - technique to specify ustar format for the tarball, to prevent files - with long file names from appearing at the top of the tarball. - Based on the same fix in gtkmm 2.6. - -2005-01-18 Murray Cumming - - * sigc++/functors/macros/slot_h.m4: Specify the base class when - using the rep_ member variable. This stops the HP-UX aCC compiler - from saying that a Nonstatic member is referenced in a nested class, - local class or static member initializer. Bug #150719. - -2005-01-18 Murray Cumming - - * Bug #159597 - patch from e97_far at e.kth.se to replace C-style - casts with reinterpret_cast<> and static_cast<> to avoid warnings. - -2005-01-17 Murray Cumming - - * docs/manual/Makefile.am: Specifying html/index.html instead of - just the html directory as a target seems to fix distcheck problems. - I can also now confirm that the install works on solaris, when using - gmake, though not when using make. - -2005-01-17 Murray Cumming - - * MSVC_Net2004/Makefile.am: Add built files to DISTCLEANFILES to fix - the distcheck. - * docs/reference/Makefile.am, manual/Makefile.am: Specify $srcdir in - paths, to fix distcheck of the manual, and maybe fix install problems - on Solaris. - -2005-01-11 Murray Cumming - - * docs/website/stable.html: Updated the text about binary packages. - * docs/website/docs.html: Link to the 2.0 documentation instead of the - 1.2 documentation. - -2004-12-17 GregSchussman - - * glossary.shtml: Clean up punctuation, make definitions complete - sentences, and add clarifications for certain definitions according to - what Murray Cumming's suggestions and answers to my questions. - Bug #161580. - -2005-01-11 Murray Cumming - - * docs/: Added manual, copied from the libsigc++-1.2 cvs module, - and updated it for the new 2.0 API. - -2005-01-11 Murray Cumming - - * docs/: Added website, copied from the libsigc++-1.2 cvs module. - We will use it from here from now on. - -2004-12-11 Cedric Gustin - - * configure.ac : parse version tags at configure time (for - sigc-2.0.rc). - * MSVC_Net2003/sigc-2.0.rc.in : New resource file. - * MSVC_Net2003/Makefile.am: include sigc-2.0.rc in distribution. - -2004-12-08 Cedric Gustin - - * MSVC_Net2003/Makefile.am: get sigc++config.h from $(top_builddir) - instead of $(top_srcdir). - -2004-12-08 Cedric Gustin - - * MSVC_Net2003/*/*.vcproj: Renamed libsigc++ target to - sigc-2.0d.dll (Debug) and sigc-2.0.dll (Release). Added - $(SolutionDir) and $(SolutionDir)\.. to "Additional Include - Directories" in tests projects. - * sigc++config.h.in: Rewrote dllexport/dllimport macros for - MSVC, for better consistency with glibmm/gtkmm. - * MSVC_Net2003/Makefile.am: copy sigc++config.h from $(top_srcdir) - at build time. - -2004-11-27 Murray Cumming - - * configure.in: Revert the AC_PROG_LIBTOOL change, so that this builds - with actually released libtool versions, and in jhbuild, so that it - gets testing. - -2004-11-06 Martin Schulze - - * sigc++/adaptors/macros/exception_catch.h.m4: Make catcher_ member - public so that it can be accessed by visit_each() (bug reported on - ml by Philip Langdale ). - -2004-10-24 Martin Schulze - - * MSVC_Net2003/*/*.vcproj: Link with the "multithreaded DLL" runtime - libraries and enable RTTI for the MSVC build - (patch from Timothy M. Shead ). - * MSVC_Net2003/*/.cvsignore: Hide generated build files from cvs - (patch from Timothy M. Shead ). - -2.0.6: - -2004-10-12 Martin Schulze - - * MSVC_Net2003/*/*.vcproj, MSVC_Net2003/blank.cpp: Fix project files - to compile out-of-the-box and add dummy file so that .cc files get - recognized as c++ code files (patch from Timothy M. Shead). - -2004-10-10 Martin Schulze - - * sigc++/signal_base.{h,cc}, sigc++/functors/slot_base.{h,cc}, - sigc++/functors/macros/slot.h.m4: If SIGC_NEW_DELETE_IN_LIBRARY_ONLY - is defined, implement signal_base::operator new/delete and - slot_rep::operator new/delete (suggested by Timothy M. Shead). - Remove old work-around from 2004-10-02 since it didn't work. - -2004-10-07 Martin Schulze - - * configure.ac: Update for libtool 1.5a (with support for Intel C++). - * MSVC_Net2003/sigc++config.h: Remove bogus '#define' - (reported by Timothy M. Shead ). - -2004-10-02 Martin Schulze - - * configure.ac: Bump version number to 2.0.6. - * NEWS: Add ChangeLog summary for version 2.0.6. - -2004-10-02 Martin Schulze - - * sigc++/functors/slot_base.{h,cc}, sigc++/functors/macros/slot.h.m4: - Rename (typed_)slot_rep::detach to (typed_)slot_rep::destroy. - Call the dtor of the functor stored in typed_slot_rep from destroy(). - A cleaner solution would be to add an additional "virtual" function - that calls 'delete' or a real virtual dtor. However, this would be - less efficient and might break the ABI. (Fixes #152323.) - -2004-10-02 Martin Schulze - - * sigc++config.h.in, MSVC_Net2003/sigc++config.h, - sigc++/signal_base.cc, sigc++/functors/slot_base.{h,cc}, - sigc++/functors/macros/slot.h.m4: Define and use new macro - SIGC_NEW_DELETE_IN_LIBRARY_ONLY to ABI-compatibly move - all calls to new and delete into non-inline library code. - -2004-09-26 Martin Schulze - - * sigc++/adaptors/lambda/macros/group.h.m4: Add a missing - template keyword in the definition of deduce_result_type::type - (hopefully fixes #152327). - -2004-09-26 Martin Schulze - - * sigc++/macros/object_slot.h.m4: Use correct bound_mem_functor - variants for const (volatile) methods (fixes #148744). - -2004-09-01 Martin Schulze - - * docs/index.html: Correct link to lambda module. - -2004-09-01 Martin Schulze - - * README: Update compatibility section. - -2.0.5: - -2004-09-01 Martin Schulze - - * MSVC_Net2003/Makefile.am: Add sigc++config.h to EXTRA_DIST. - * configure.ac: Bump version number to 2.0.5. - * NEWS: Add ChangeLog summary for version 2.0.5. - -2.0.4: - -2004-08-21 Martin Schulze - - * tests/test_lambda.cc: Use sigc::var("\n") instead of sigc::ref("\n"). - Comment out the affected lines, nevertheless. - Sun FORTE and Compaq C++ can handle neither sigc::ref("\n") nor - sigc::var("\n"). I see more chances fixing sigc::var("\n"). - * sigc++/adaptors/lambda/macros/base.h.m4: Add a comment about a - possible work around for sigc::var("\n") compiler problems. - * tests/test_compatibility.cc: Remove a 'const' keyword that prevents - the test case from compiling with the Sun FORTE. - * tests/test_trackable.cc: Remove a 'virtual' keyword and an unused - variable to avoid compiler warnings. - * NEWS: Add ChangeLog summary for version 2.0.4. - -2004-08-03 Martin Schulze - - * scripts/cxx.m4, sigc++config.h.in, configure.ac, - sigc++/adaptors/lambda/macros/operator.h.m4, tests/test_lambda.cc: - Rollback change from 2004-07-15: configure check - SIGC_OPERATOR_OVERLOAD_AMBIGUITY is not needed - the overload - ambiguity doesn't occur if the lambda operators take all arguments - as const reference. - * configure.ac: Bump version number to 2.0.4. - -2004-08-03 James Lin - - * Added SIGC_API qualifier to all externally-visible non-template - classes/structs. - * Added #include to the files that use SIGC_API. - * Added empty SIGC_API definition to sigc++config.h.in for non-MSVC - compilers. I'm not sure if this is the right place to put this - (probably not). - * Added MSVC-specific sigc++config.h to the MSVC project directory. - (The comment in it probably should be edited.) - * Changed MSVC project settings to output a multi-threaded DLL, set - the include paths to work (hopefully) out-of-the-box. Disabled - precompiled headers, since they just complicate things and - shouldn't be necessary for such a relatively project. - -2004-08-01 Martin Schulze - - * sigc++/type_traits.h: Remove type_trait<>::instance() - (was unimplemented and unused; caused problems with the MSVC). - -2004-07-23 Martin Schulze - - * Makefile.am: Fix typo concerning distribution of libsigc++-2.0.spec. - * AUTHORS: Mention our contributors for platforms Sun FORTE and Intel C++. - -2004-07-15 Martin Schulze - - * *.h.m4: Don't call operator()() in sun_forte_workaround(); rather copy - operator()(). Calling operator()() makes a copy of the arguments causing - wrong results if an argument type is a reference. Hopefully fixes #147311. - -2004-07-15 Martin Schulze - - * tests/test_lambda.cc: Break "std::cout << [expr] << a << std::endl;" - into "std::cout << [expr]; std::cout << a << std::endl;". - I hope this fixes #147313 where the right values for "[expr]" but wrong - values for "a" were written to std::cout for some compiler with optimizations - turned off. - -2004-07-15 Martin Schulze - - * sigc++/adaptors/lambda/macros/operator.h.m4: Correct return type deduction - of lambda expressions in lambda_operator*::operator()(). Might be related to - bug #147313. - * sigc++/adaptors/lambda/macros/group.h.m4: Use m4 macro _P_(). - -2004-07-15 Martin Schulze - - * scripts/cxx.m4, sigc++config.h.in, configure.ac, - sigc++/adaptors/lambda/macros/operator.h.m4, tests/test_lambda.cc: - Add configure check SIGC_OPERATOR_OVERLOAD_AMBIGUITY for a SUN FORTE - compiler problem (bug #147391). Use it to decide whether the lambda - action operators may be overloaded (not doing so restricts the API slightly). - * sigc++/adaptors/lambda/macros/operator.h.m4: Add some doxygen comments - and remove attic code. - * sigc++/adaptors/lambda/macros/base.h.m4: - Add templates unwrap_lambda_type and unwrap_lambda_value() to support - the non-overloaded lambda action operators. Also add some doxygen comments - and remove attic code. - * sigc++/adaptors/lambda/macros/group.h.m4: Fix a bug that resulted in - gargabe values being passed on to the functor contained in the group adaptor - (partly fixes #147313). - -2004-07-11 Martin Schulze - - * scripts/cxx.m4, sigc++config.h.in, configure.ac, *.h.m4: - Split SIGC_CXX_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD - into SIGC_CXX_GCC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD - and SIGC_CXX_MSVC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD. - Remove LIBSIGC_TEMPLATE_PREFIX. Add template keyword to - SIGC_WORKAROUND_OPERATOR_PARENTHESES depending on the configure checks. - Should fix the compiler problems with MSVC. - -2004-07-11 Martin Schulze - - * examples/hello_world.cc: Use sigc::ptr_fun instead of std::ptr_fun. - (fixes bug #144846) - -2004-07-11 Eric Bourque - - * libsigc++-2.0.spec.in: new file - * configure.ac : patched generate spec file - * .cvsignore: ignore generated file (Martin Schulze) - * Makefile.am: distribute spec file (Martin Schulze) - -2004-07-11 Murray Cumming - - * sigc++/connection.cc: Added some comments. - * sigc++/trackable.cc: operator=(): Check for self-asignment, though I - do not know of any actual bug that this fixes. Added some comments. - * sigc++/trackable.h Added some doxygen documentation. - -2004-07-09 Murray Cumming - - * tests/: Added test_disconnect_during_emit.cc, to prove that this - works. - -2004-07-08 Murray Cumming - - * tests/test_retype_return.cc: foo::operator(int): return a - value. The SUN Forte 5.5 compiler complains about this, as it should. - -2004-07-08 Murray Cumming - - * sigc++/macros/signal.h.m4: class signal*: Rename the slot_list - typedef to slot_list_type, because there is already a template class - called slot_type. SUN Forte 5.5 seems to complain about this and I am - not surprised. The old typdef is still there for backwards - compatibility, except when building with SUN Forte. - -2004-07-07 Murray Cumming - - * scripts/cxx.m4: SIGC_CXX_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD(): - Don't define the SIGC_TEMPLATE_SPECIALIZATOIN_OPERATOR_OVERLOAD C - macro at all if the test fails. This might fix the build on SUN Forte. - * sigc++/functors/macros/mem_fun.h.m4: Default constructor: Initialize - the func_ptr_ member variable. I have no evidence that this solves any - problems, but it worried me. - * sigc++/functors/slot_base.h: operator bool(): Correct documentation, - to use @code instead of - * sigc++/macros/signal.h.m4: Remove the documentation for the - parameters named first and last, because they do not exist. - -2004-05-31 Martin Schulze - - * autogen.sh: Add '--force'-flag to the 'libtoolize'-command (bug #143425). - -2.0.3: - -2004-05-30 Martin Schulze - - * configure.ac: Bump version number to 2.0.3. - * NEWS: Add ChangeLog summary for version 2.0.3. - * sigc++/macros/signal.h.m4: Fix segfault on emission of unconnected signal. - * tests/test_signal.cc, tests/test_accumulated.cc: Emit unconnected signal. - * sigc++/macros/object_slot.h.m4: Suppress compiler warning at - dynamic_cast<>-test (tested by Christof Petig/Timothy M. Shead). - -2.0.2: - -2004-05-22 Martin Schulze - - * configure.ac: Bump version number to 2.0.2. - * NEWS: Add ChangeLog summary for version 2.0.2. - -2004-05-20 Martin Schulze - - * sigc++/macros/signal.h.m4: If a custom accumulator is specified - invoke it on signal emission even if the signal's slot list is empty. - (This used to be the case in libsigc++-1.2 as pointed out by Timothy.) - -2004-05-20 Martin Schulze - - * sigc++/macros/object_slot.h.m4: Suppress compiler warning at - dynamic_cast<>-test (suggested by Timothy M. Shead). - -2004-05-01 Martin Schulze - - * README: Updated for libsigc++-2.0. - -2.0.1: - -2004-04-27 Martin Schulze - - * configure.ac: Bump version number to 2.0.1. - * NEWS: Add ChangeLog summary for version 2.0.1. - * sigc++/adaptors/lambda/macros/base.h.m4: Fixed documentation. - * sigc++/adaptors/macros/bind.h.m4: Hide work-arounds from doxygen. - * scripts/cxx.m4, sigc++config.h.in, configure.ac, - sigc++/adaptors/macros/bind.h.m4: Removed configure check. It - showed that the Apple gcc can also compile the sophisticated version - of the work-around. - -2004-04-26 Martin Schulze - - * sigc++/macros/object_slot.h.m4: Modified test for SigC::Object - inheritance so that it also works if SigC::Object is virtual base. - (Fixes bug 141094 reported by Jonathan Brandmeyer) - -2004-04-26 Martin Schulze - - * scripts/cxx.m4: Updated the configure check. It would probably - have succeeded on the Apple. - -2004-04-26 Martin Schulze - - * sigc++/adaptors/macros/bind.h.m4: Add work-arounds for - bind<-1>::deduce_result_type compilation error on Apple gcc 3.3. - * scripts/cxx.m4, sigc++config.h.in, configure.ac: Add configure - check for the compilation error above. - * sigc++/adaptors/lambda/macros/operator.h.m4: Replace _A with - _Aa. _A is a reserved keyword on Apple gcc 3.3 (Spundun Bhatt). - (fixes bug #10444 reported by Spundun Bhatt) - -2004-04-19 Martin Schulze - - * sigc++/signal_base.cc: Fixed serious bug in signal_base::impl(): - Only reference a newly created object (initial reference). - (This fixes bug #140269 reported by Andris.) - -2004-04-19 Murray Cumming - - * scripts/cxx.m4: Updated the operator() template check, because it - failed with gcc 3.4 (from cvs). Apparently the template keyword can - only be used from another template. - -2.0.0: - -2004-04-06 Martin Schulze - - * configure.ac: Bump version number to 2.0.0. - * NEWS: Add ChangeLog summary for version 2.0.0. - * TODO, AUTHORS: Bring up to date. - * sigc++-2.0.pc.in, Makefile.am: 1.9 -> 2.0 - * Added more documentation. - -2004-04-10 Murray Cumming - - * sigc++/connection.[h|cc]: Implement blocked() to avoid undefined - symbol linker error. - -2004-04-08 Murray Cumming - - * dist the scripts directory. - -1.9.16: - -2004-04-06 Martin Schulze - - * configure.ac: Bump version number to 1.9.16. - * NEWS: Add ChangeLog summary for version 1.9.16. - -2004-04-02 Murray Cumming - - * sigc++/connection.cc: Make block() and unblock() always return a - value, to fix compiler warnings. Patch from bug #138620 by - Alexander Nedotsukov. - -2004-04-02 Murray Cumming - - * Fix the compile of examples/member_method.cc. Bug #131701 from - Kirill Smelkov. I also made the examples build as part of the regular - build. - -2004-04-02 Murray Cumming - - * sigc++config.h.m4: Remove every undef apart from the one we need, to - avoid clashes, because we #include this in a public header. - -2004-03-25 Murray Cumming - - * scripts/cxx.m4, configure.in, sigc++config.h.in: Rename the - template_keyword check to template_specialization, because the problem - is with or without the keyword. - * sigc++/adaptors/macros/adaptor_trait.h.m4: Define - SIGC_WORKAROUND_OPERATOR_PARENTHESES, which calls either operator() or - sun_forte_workaround() depending on the result of the compiler test. - * many .m4 files: Add sun_forte_workaround methods that call the - operator() methods. Put them in #ifdefs so that only SUN Forte C++ - sees them. - -2004-03-22 Murray Cumming - - * Makefile.am, sigc++/Makfile.am: Fix the sigc++config.h.in disting, - to fix make distcheck. - -2004-03-21 Murray Cumming - - * Rename config.h.in to sigc++config.h.in so that gtkmm does not - include some other config.h at strange times - fixes a problem in - the gtkmm demos. This should really be in the sigc++ directory, but - that seems to add that as an include path, which causes the STL - headers to include sigc++/signal.h instead of some STL signal.h header. - -2004-03-20 Murray Cumming - - * Makefile.am: Install the config.h platform-specific header. - * sigc++-2.0.pc.in: Report the include path for config.h - -2004-03-20 Murray Cumming - - * Added config.h.in, using autoheader, from which config.h will be - generated, so we can detect compiler features. - * configure.ac: Added AC_CONFIG_HEADER(config.h) to generate config.h - from config.h.in. - * scripts/cxx.m4: Added this directory and file, with a - SIGC_CXX_TEMPLATE_KEYWORD_OPERATOR_OVERLOAD macro that defines - the SIGC_TEMPLATE_KEYWORD_OPERATOR_OVERLOAD C macro. - * autogen.sh: Added -I scripts to the aclocal call, so that it finds - the m4 macro for configure.ac. - * sigc++/adapators/macros/adaptor_trait.h.m4: Include config.h and - use SIGC_TEMPLATE_KEYOWRD_OPERATOR_OVERLOAD. - -2004-03-18 Martin Schulze - - * tests/test_mem_fun.cc, tests/test_ptr_fun.cc: Don't test - making functors from overloaded methods with partial template - specialization. Not portable among different compilers (SUN FORTE). - * adaptors/macros/apdaptor_trait.h.m4: Only gcc seems to use the - notation A.template operator()<...>(...) => adapt preprocessor check - for #define LIBSIGC_TEMPLATE_PREFIX. TODO: replace with configure check. - -2004-03-13 Murray Cumming - - * g++ 3.4 (pre-release) build fixes: - * sigc++/macros/signal.h.m4: slot_iterator_buf::operator*(): - Use blocked() and empty() instead of non-existant blocked_and_empty(). - * sigc++/functors/macros/mem_fun.h.m4: memfun_functor*::operator()(): - Use this->func_ptr_ instead of just func_ptr_. - * sigc++/adaptors/macros/deduce_result_type.h.m4: Use - T_functor::template deduce_result_type<> instead of just - T_functor::deduce_result_type<>. - * sigc++/adaptors/lambda/macros/base.h.m4, operator.h.m4, group.h.m4:: - Use template keyword again. operator[](): Use this->value_ instead of - just value_. - * sigc++/adaptors/lambda/macros/bind/m4: Use template keyword, and - this-> again. - * sigc++/adaptors/macros/compose.h.m4, hide.h.m4, bind_return.h.m4, - exception_catch.h.m4: - rettype.h.m4, rettype_return.h.m4: Use template keyword,and this-> again - -1.9.15: - -2004-02-27 Martin Schulze - - * configure.ac: Bump version number to 1.9.15. - * NEWS: Add ChangeLog summary for version 1.9.15. - -2004-02-27 Martin Schulze - - * sigc++/functors/macros/slot.h.m4: Make the unnumbered slot templates' - copy ctors use the copy ctors of the base class. Fixes bug #24698. - * tests/test_slot.cc: Test copy ctor (Bryan Forbes). - -2004-02-27 Martin Schulze - - * tests/type_functor_trait.cc: Bring it up-to-date (use sigc::ref). - Make it work with the SUN Forte. - -2004-02-24 Martin Schulze - - * sigc++/type_traits.h: Make is_base_and_derived<> work with the SUN Forte. - -2004-02-19 Martin Schulze - - * sigc++/type_traits.h: Make is_base_and_derived<> platform independant. - * sigc++/adaptors/lambda/macros/base.h.m4: Make lambda_core<> ctors - explicit. Remove an unused ctor from lambda_core. - -2004-02-14 Martin Schulze - - * sigc++/functors/slot_base.h, sigc++/functors/macros/slot.h.m4: - Move some documentation to slot_base.h. - * sigc++/signal_base.h, sigc++/macros/signal.h.m4: - Move some documentation to signal_base.h. - - API addition: - * sigc++/functors/macros/slot.h.m4: Add numbered slot# templates. - Make unnumbered slot templates inherit from slot#. - - API change: - * sigc++/functors/macros/mem_fun.h.m4: Allow for methods of the object's - base types to be passed into sigc::mem_fun(). (Used to be the case in - libsigc++-1.2). - -2004-02-13 Murray Cumming - - * sigc++/functors/slot_base.[h|cc], sigc++/trackable.[h|cc]: Create - and use a typedef for the destroy_notify callback functions, to avoid - confusion function pointer declaration syntax in the API. - -2004-02-13 Murray Cumming - - * Moved implementation to .cc files: - * sigc++/functors/: Added slot_base.[h|cc] which contains non-template - code that was previsouly in the generated functors/slot.h and - non-generated slot.cc files. All non-inline implementation is now in - the .cc file. - * sigc++/functors/macros/slot.m4: Removed the code that has been moved - to slot_base.[h|cc]. - * sigc++/: Added signal_base.[h|cc] which contains non-template code - that was previously in the generated signal.h and non-generated - signal.cc file. All non-inline implementation is now in the .cc file. - * sigc++/macros/signal.m4: Removed the code that ahs been moved to - signal.cc - * sigc++/connector.[h|cc]: method implementation moved to the .cc file. - -1.9.14: - -2004-02-13 Martin Schulze - - * configure.ac: Bump version number to 1.9.14. - * NEWS: Add ChangeLog summary for version 1.9.14. - -2004-02-09 Murray Cumming - - * sigc++/functors/macros/slot.h.m4: slot_base: Added operator bool(), needed to - check for a slot that is created with the default constructor. This was - present in libsigc++ 1.2 also. - -2004-02-06 Murray Cumming - - * Makefile.am: Build the docs directory, by adding it to SUBDIRS. - * docs/Doxyfile.in: Updated to be more glibmm-like. - * Added some @deprecated doxygen bits. - * sigc++/macros/signal.h.m4: Call base constructor from signal_base - constructor - this is an error-as-warning when building gtkmm. - -1.9.13: - -2003-11-30 Martin Schulze - - * configure.ac: Bump version number to 1.9.13. - * NEWS: Add ChangeLog summary for version 1.9.13. - * Makefile.am, MSVC_Net2003/Makefile.am, configure.ac: - Distribute MS .Net project files. - * sigc++/adaptors/macros/[bind,hide].h.m4: Correct and add - documentation. Make hide_functor ctor explicit. - -2003-11-11 Martin Schulze - - * sigc++/adaptors/macros/[bind,hide].h.m4: Change to zero-based - argument index in numbered bind() and hide() overload - (Agreement on the mailing list). - Support binding up to CALL_SIZE arguments with one bind adaptor. - (Requested by joey yandle and others). - Only support binding of multiple arguments in unnumberd overloads - to keep the API simple (Requested by Murray Cumming). - * tests/test_[bind,hide,functor_trait].cc, sigc++/bind.h: - Reflect API changes in compatibility module and test cases. - -2003-11-10 Martin Schulze - - * sigc++/adaptors/macros/[bind,hide].h.m4: Add unnumbered - bind() and hide() overloads to make specifying the argument - position optional (Proposed by Jeff Franks). - * tests/test_[bind,hide].cc: Test unnumbered bind() and hide(). - * sigc++/adaptors/macros/adaptor_trait.h.m4: - Change "#ifdef MSVC" to "#ifdef _MSC_VER" (Roel Vanhout). - -2003-11-09 Martin Schulze - - * sigc++/functors/macros/slot.h.m4: Change functor type in - typed_slot_rep to adaptor_trait::adaptor_type - and use explicit function template instantiation in - internal::slot_call::call_it(). Avoids copying of arguments - in call_it() and enables binding of object instances - to class methods through bind() (Reported by Jeff Franks). - * tests/test_bind.cc: Test binding object instances to - class methods through bind(). - * sigc++/adaptors/adaptors.h: Include retype[_result].h. - * sigc++/adaptors/macros/adaptor_trait.h.m4: - - Add documentation. - - Mark some c-tors as explicit. - - Remove ununsed operator T_functor&() from adaptor_functor. - * sigc++/adaptors/macros/deduce_result_type.h.m4: - Rewrite parts of the documentation. - * sigc++/adaptors/macros/bind.h.m4: Add documentation. - * sigc++/functors/macros/mem_fun.h.m4: Remove unnecessary - explicit markers. Minor fixes to documentation. - * sigc++/functors/macros/functor_trait.h.m4: - Minor fixes to documentation. - -1.9.12: - -2003-11-04 Martin Schulze - - * configure.ac: Bump version number to 1.9.12. - * NEWS: Add ChangeLog summary for version 1.9.12. - -2003-11-03 Martin Schulze - - * sigc++/macros/signal.h.m4: Document accumulators. - Move slot_iterator_buf into namespace internal. Since - accumulators have the iterator type as a template argument - there is no need to expose this very internal type. - * sigc++/functors/macros/*.m4: Regroup documentation. - Documentation of the core parts of the library should be - complete by now. - -2003-11-02 Martin Schulze - - * Improve documentation of the core parts of the library. - * tests/test_ptr_fun.cc: Test ptr_fun() with static - member functions. - -2003-11-02 Martin Schulze - - * Move all .m4 files into new subdirectories - sigc++/[...]/macros. Install the .m4 files on - "make install" (Reported by Ron Steinke). - -2003-11-01 Martin Schulze - - * sigc++/[class,method,object]_slot.h.m4: Include - sigc++/functors/mem_fun.h (Reported by Ron Steinke). - -2003-11-01 Martin Schulze - - * sigc++/adaptors/lambda/operator.h.m4: Add negation - operator I have completely overlooked until now. - * sigc++/tests/test_lambda.cc: Test negation operator. - -2003-11-01 Martin Schulze - - * sigc++/[class_slot,method_slot,object_slot,hide].h.m4, - sigc++/signal.h.m4, sigc++/functors/mem_fun.h.m4: - - Use a shorter notation for ..._mem_function variants. - - Change order of mem_funcotr<>'s template arguments to - match std::mem_fun_t and to be more consistent with adaptors. - - Use ::sigc::slot's implicit ctor in compatibility module. - * sigc++/adaptors/lambda/operator.h.m4: Change some - lambda action names to match action names in std. - - API addition: - * sigc++/adaptors/retype.h.m4: New file adding - adaptor retype. - * sigc++/Makefile.am: Build and distribute new file. - * tests/test_retype.cc: New file testing adaptor retype. - * MSVC_Net2003/tests/test_retype/test_reytype.vcproj, - tests/Makefile.am: Build and distribute new test case. - -2003-11-01 Martin Schulze - - * MSVC_Net2003: New directory containing project - files for Visual Studio .Net 2003. - Credits to Roel Vanhout ! - -2003-11-01 Martin Schulze - - * sigc++/retype.h.m4: Use LIBSIGC_TEMPLATE_PREFIX - in explicit function template instantiations. - * sigc++/type_traits.h: Add template specialization - for arrays (T_type[N]) to disable non-working member - type_trait::instance(). - * sigc++/visit_each.h: Remove more disturbing - limit_derived_target<>::operator() overloads. - (Should have noticed earlier that they are unnecessary.) - * sigc++/adaptors/deduce_result_type.h.m4, - sigc++/adaptors/lambda/operator.h.m4, - sigc++/functors/functor_trait.h.m4, - tests/test_[bind,compose,exception_catch,hide,lambda].cc: - Completely removed support for typeof(). We don't need - it any more and it is completely non-standard! - -2003-10-30 Cedric Gustin - - * configure.ac: Added test of win32 platform. Commented - out AM_DISABLE_SHARED (DLLs are shared libraries). - * sigc++/Makefile.am: added a few LDFLAGS for win32 - DLLs. - -2003-10-30 Martin Schulze - - * sigc++/signal.h.m4: Add SigC::Signal#<>::slot(). - * sigc++/slot.h.m4: Comment out make_slot() work-around. - * sigc++/adaptors/bind.h.m4: Remove unnecessary brackets - in template argument lists. They are confusing MSVC. - * sigc++/adaptors/*.h.m4, sigc++/adaptors/lambda/*.h.m4: - Use LIBSIGC_TEMPLATE_PREFIX in explicit function - template instantiations. - * sigc++/tests/test_*.cc: - - Include where std::string is used. - - Use double instead of float. - -2003-10-27 Martin Schulze - - * sigc++/retype.h.m4: Cleanup. - * TODO: Bring it up to date. - -1.9.11: - -2003-10-26 Martin Schulze - - * configure.ac: Bump version number to 1.9.11. - * NEWS: Add ChangeLog summary for version 1.9.11. - -2003-10-26 Martin Schulze - - Compatiblity module: - * sigc++/signal.h.m4: Move definition of compatiblity - classes SigC::SignalN to here. - * sigc++/connection.h: - - Add connection::connected(). - - Add compatibility typedef SigC::Connection. - * sigc++/bind.h, sigc++/bind_return.h, - sigc++/class_slot.h.m4, sigc++/hide.h.m4, - sigc++/method_slot.h.m4, sigc++/object.h, - sigc++/object_slot.h.m4, sigc++/retype.h.m4, - sigc++/retype_return.h sigc++/slot.h.m4, - sigc++/compatibility.h: - New files to complete compatibility module. - Split content of compatibility.h.m4 among the new files. - * sigc++/compatibility.h.m4: Removed. - * Makefile.am: Build and distribute new files. - * tests/test_compatibility.cc: Test new stuff. - - Fixes: - * sigc++/functors/slot.h.m4: Fix copy constructor and - operator=() of slot template. - * sigc++/adaptors/bind.h.m4: Fix deduce_result_type - template specializations. bind<0>() probably compiles - with gcc-3.3, now. - -2003-10-26 Martin Schulze - - Fixes: - * sigc++/functors/slot.{cc,h.m4}: - - Fix notification process: don't defer detaching of a - slot from all referred trackables during signal emission! - - Size optimization: replace virtual functions from - struct typed_slot_rep with function pointers in slot_rep - (reduces size of a typical typed_slot_rep instantiation - by 30% !!!). - * tests/test_slot.cc: Test sigc::slot more thoroughly. - * sigc++/functors/mem_fun.h.m4: Fix visit_each(). - * sigc++/adaptos/bind_return.h.m4: Add support for - sigc::ref(). - * tests/test_bind_return.cc: Use sigc::ref(). - * sigc++/signal.h.m4: Avoid compiler warning about - uninitialized variable r_ in emit(). - * sigc++/visit_each.h: Cleanup. - - API additions: - * sigc++/adpators/lambda/operators.h.m4: Add - lambda actions sigc::{reinterpret,static,dynamic}_cast_ - to support explicit parameter conversion. - * tests/test_lambda.cc: Test sigc::static_cast_. - * sigc++/adaptors/retype_return.h.m4: New file adding - adaptor retype_return (and hide_return). - * sigc++/Makefile.am: Build and distribute new file. - * tests/test_retype_return.cc: New file testing - adaptor retype_return (and hide_return). - * tests/Makefile.am: Build and distribute new test case. - -2003-10-25 Martin Schulze - - * sigc++/visit_each.h: Remove disturbing - limit_derived_target<>::operator() overloads. - * sigc++/adaptors/bind.h.m4: Add support for sigc::ref(). - * tests/test_bind.cc: Test sigc::ref(). - * sigc++/adaptors/lambda/{operator,group,base}.h.m4: - - Move support for sigc::ref() from lambda_core<> into - lambda operator and lambda group creator functions. - - Add missing visit_each() overload for lambda<> template. - * tests/test_lambda.cc: Test auto-disconnection. - TODO: Fix a strange bug that leads to "Bus error" - during auto-disconnection. - -1.9.10: - -2003-10-23 Martin Schulze - - * configure.ac: Bump version number to 1.9.10. - * NEWS: Add ChangeLog summary for version 1.9.10. - -2003-10-23 Martin Schulze - - * sigc++/functors/{functor_trait,slot}.h.m4: - Move definition of struct nil into functor_trait.h. - -2003-10-23 Martin Schulze - - * configure.ac: Disable typeof() compiler checks. - * sigc++/adaptors/bind.h.m4: Remove unnecessary - deduce_result_type<> template specializations. - -2003-10-20 Martin Schulze - - * sigc++/adaptors/compose.h.m4: - Correct order of typedefs for good. (Patch from Jeff Franks.) - -1.9.9: - -2003-10-20 Martin Schulze - - * sigc++/connection.h: Add constructor that takes - a sigc::slot_base& to support 3rd-party slot lists - like they are used in glibmm/gtkmm. - * sigc++/functors/slot.h.m4: Make sigc::slot::call_type public. - (Fixes compile problems reported by Jeff Franks.) - * sig++/type_traits.h: Don't use long long in - sigc::is_base_and_derived. - (Fixes compile problems reported by Jeff Franks.) - * sigc++/adaptors/{bind,compose,hide,exception_catch}.h.m4: - Correct order of typedefs. (Repoted by Jeff Franks.) - * configure.ac: Bump version number to 1.9.9. - * NEWS: Add ChangeLog summary for version 1.9.9. - -1.9.8: - -2003-10-19 Martin Schulze - - * sigc++/functors/slot.h.m4: Define doxygen group functors. - * configure.ac: Bump version number to 1.9.8. - * NEWS: Add ChangeLog summary for version 1.9.8. - -2003-10-19 Martin Schulze - - * NEWS: Add announces of versions 1.9.6 and 1.9.7. - * sigc++/compatibility.h.m4: New file. Defines namespace SigC. - namespace SigC should be API compatible to libsigc++-1.2. - * sigc++/Makefile.am: Build compatibility.h. - * tests/test_compatibility.cc, tests/Makefile.am: - Add test case for compatibility module. - * docs/index.html: Change group names. - * sigc++/sigc++.h: Include connection.h. - * sigc++/connection.{cc,h}: - - Rename dependency to destroy_notify_callback. - - Change parameter name in set_slot() from d to data. - - Fix operator=(): Add "return *this;" - - Get rid of namespace functor. - - Corrections in documentation. - * sigc++/signal.{cc,h.m4}: - - Add reference counter to signal_impl. Replaces "bool destroy_". - - Move signal_base, slot_iterator[_buf], slot_list out of - namespace internal. They are part of the public API. - - Add convenience function signal#::make_slot(). - - Get rid of namespace functor. - - Corrections in documentation. - * sigc++/trackable.{cc,h}: - - Rename dependency to destroy_notify_callback. - - Rename trackable::clear() to trackable::notify_callbacks(). - - Corrections in documentation. - * sigc++/type_traits.h: Add documentation. - * sigc++/visit_each.h: - - Get rid of namespace functor. - - Add documentation. - * sigc++/adaptors[/lambda]/*: Get rid of namespace functor. - * sigc++/functors/{functor_trait.h,ptr_fun.h.m4,mem_fun.h.m4}: - - Get rid of namespace functor. - - Corrections in documentation / add documentation. - * sigc++/functors/slot.{cc,h.m4}: - - Move slot_base out of namespace internal. It's public API. - - Get rid of one-letter-parameter-names. - - Get rid of namespace functor. - - Corrections in documentation. - * tests/*.cc: Get rid of "using namespace ...". - -2003-09-10 Martin Schulze - - * sigc++/adaptors/lambda/{base,operators}.h.m4: - Add subscript ([]) and assign (=) operator. I think there are now - enough operators available to make any future power user happy. - The only one missing is the comma operator and if we added it - the logical consequence would be to also add if(), switch(), do(), - etc. lambda expressions which are really out of place in libsigc++. - * sigc++/type_traits.h: Fix is_base_and_derived<> for const types. - * tests/test_lambda.cc: Test new operators. - -1.9.7: - -2003-09-05 Martin Schulze - - * configure.ac: Bump version number to 1.9.7. - -2003-09-03 Martin Schulze - - * sigc++/adaptors/lambda/operator.h.m4: - - Restructure so that the size of the generated source file stays - reasonable for 34 operators: There are only two lambda templates - lambda_operator and lambda_operator_unary. The action is an additional - template parameter. A small template lambda_action[_unary] is specialized - for all actions. - - Add most operators that boost::lambda supports. Missing operators are - "=", "[]", "," and support for pointer arithmetic. I don't know if it's - worth adding these. In libsigc++, the purpose of lambda operators is to - provide some extra functionality for the group adaptor. - * tests/test_lambda.cc: - Test pre-increment, address and dereference operator. - -2003-08-31 Martin Schulze - - * sigc++/reference_wrapper.h, sigc++/type_traits.h, sigc++/Makefile.am: - New file reference_wrapper.h provides ref() to specify that adaptors/lambdas - should take a reference to the object passed into ref() instead of a copy. - * tests/test_lambda.cc: - - Test group() with mem_fun(). - - Use ref() where lambdas should store references to objects. - - Test var() and constant(). - * sigc++/adaptors/lambda/base.h.m4: - - Support ref() in return type deduction. - - Add var() and constant() which create lambdas for usage with lambda operators. - * sigc++/adaptors/lambda/operator.h.m4: - - Fix return type deduction. - - Remove operator{+,-,*,...} overloads added on 2003-08-29. ref() is way cleaner. - * sigc++/adaptors/lambda/group.h.m4, - sigc++/adaptors/bind.h.m4, sigc++/adaptors/compose.h.m4, - sigc++/adaptors/exception_catch.h.m4, sigc++/adaptors/hide.h.m4: - Fix return type deduction. - -2003-08-29 Martin Schulze - - * tests/test_lambda.cc: Add more tests. - * sigc++/adaptors/lambda/select.h.m4, sigc++/adaptors/lambda/lambda.cc.m4: - Make _1, _2, ... constant. - * sigc++/adaptors/lambda/operator.h.m4: - Add operator{+,-,*,...} overloads to distinguish between const and non-const objects. - Store references to non-const objects rather than copies. - This allows expressions like e.g. std::cout << _1. - * sigc++/adaptors/lambda/base.h.m4, sigc++/adaptors/lambda/group.h.m4: - Remove void specializations. Functors returning void are tested and work fine. - -2003-08-27 Martin Schulze - - * tests/test_callof.cc, tests/test_deduce_result_type.cc: - Rename, correct and improve this test case. - * tests/Makefile.am: Build and run test_deduce_result_type - instead of test_callof. - -2003-08-27 Martin Schulze - - * Update TODO. - -2003-08-27 Martin Schulze - - * sigc++/adaptors/hide.h.m4: Remove usage of callof_ignore_arg<>. - * sigc++/callof.h.m4, sigc++/adaptors/deduce_result_type.h.m4, - sigc++/functors/functor_trait.h.m4: - Remove the first and move deduce_result_type templates from - functor_trait.h.m4 into new file deduce_result_type.h.m4. - * sigc++/Makefile.am, sigc++/sigc++.h, sigc++/adaptors/adaptor_trait.h.m4: - Build and include sigc++/adaptors/deduce_result_type.h instead of callof.h. - * sigc++/functors/slot.h.m4: Document struct nil. - -2003-08-24 Martin Schulze - - * sigc++/functors/functor_trait.h.m4: Simplify usage of convenience - macro SIGC_FUNCTORS_HAVE_RESULT_TYPE: - namespace sigc{ namespace functor{ SIGC_FUNCTORS_HAVE_RESULT_TYPE }} - -2003-08-24 Martin Schulze - - * sigc++/functors/functor_trait.h,m4, sigc++/adaptors[/lambda]/*.h.m4: - Merge adaptor return type deduction and typeof() into - sigc::functor::deduce_result_type. Use it for all adaptors. - * tests/test_compose.cc: Only test multi-type get-functor if - typeof() if supported. - -2003-08-24 Martin Schulze - - * sigc++/adaptors[/lambda]/*.h.m4: - - Remove unnecessary void specializations. In fact, only the one - for sigc::functor::exception_catch<> is needed and I don't really - understand why. For the lambda stuff the void specializatoins are - just commented out at the moment. - - Make typeof() optional. Surprisingly, I got the lambda stuff working - without typeof()! The test suite doesn't catch all cases yet, so maybe - some thing are still not working. - TODO: Implement configure check. - * tests/test_bind.cc, tests/test_compose.cc tests/test_exception_catch.cc, - tests/test_hide.cc, tests/test_lambda.cc: - Only test multiple functor return types if typeof() is supported. - -2003-08-06 Martin Schulze - - * sigc++/trackable.{cc,h}: Add function trackable::clear(). - -2003-06-24 Andreas Rottmann - - * TODO: Minor tweaks. - -2003-06-23 Andreas Rottmann - - * docs/reference/Doxyfile.in: Use these variables. - * docs/reference/Makefile.am (html/index.html): Provide doxygen - with SRCDIR and TOP_SRCDIR environment variables. - - * sigc++/functors/slot.h.m4: Make slot::call_type typedef public; - this fixes a g++ 3.3 error in signal.h. - - * sigc++/signal.h.m4: Make the signal::accumulated class public; - this fixes a g++ 3.3 error in test_accumulated.cc. - -2003-06-15 Martin Schulze - - * sigc++/functor/slot.h.m4: Correct typing error in docs. - * sigc++/functor/ptr_fun.h.m4: Document the whole thing. - -2003-05-31 Murray Cumming - - * Reference documentation: Rearranged the groups to make it all - a bit more like the libsigc++ 1.2 reference documentation. - Corrected some spelling and grammar too. - This needs a lot of work. The text is very hard to read and it's - generally not appropriate for a user of the code who doesn't - care about the internals. But it's not impossible - our examples - should show us what we need to say in the documentation. - We probably need some more groups for the extra stuff, like we do - in libsigc++ 1.2. - -2003-05-29 Martin Schulze - - * sigc++/signal.h.m4: Fix documentation. - * sigc++/connection.h, sigc++/functor/slot.h.m4: - Document the whole thing. - -2003-05-29 Martin Schulze - - * sigc++/signal.h.m4: - - Remove bogus operator() from unnumbered signal<> and - signal<>::accumulated templates. - - Document the whole thing. - - * docs/index.html: Fix some links. - -2003-04-06 Martin Schulze - - * TODO, configure.ac, Makefile.am, docs/*: - Add Doxygen framework. - -2003-04-06 Martin Schulze - - * sigc++/callof.h.m4, sigc++/adaptors/*, tests/test_callof.cc: - Move sigc::callof<> to sigc::functor::internal::callof<>. - - * sigc++/functors/mem_fun.h.m4, tests/test_mem_fun.cc: - Add new types [bound_][const_]volatile_mem_functor, visit_each() - and mem_fun() overloads for volatile qualifier. - Add ctor overloads in bound_*mem_functor and mem_fun() overloads - that take reference instead of pointer. - -2003-03-26 Martin Schulze - - * Change "closure" to "slot" throughout sigc++2 (file names, - class names, member variables, documentation, etc.). - -2003-03-26 Martin Schulze - - * TODO: Rewrite to reflect recent changes as well as recent discussions. - -2003-03-24 Martin Schulze - - * sigc++/adaptors/bind_return.h.m4: Make the adaptor's data member - public so that visit_each() can access it. - - * sigc++/adaptors/lambda/*.h.m4: More fixes. Add a note about - malfunctioning typeof() (probably compiler bug in gcc-3.2). - - * tests/*.cc: Test references. Fix compose equivalent in test_lambda. - -2003-03-24 Martin Schulze - - * sigc++/Makefile.am, sigc++/functors/functor_trait.h[.m4], - sigc++/adaptors/adaptor_trait.h.m4: Move detection of function - and member method pointers' return types from adaptor_trait into - functor_trait. (We'll use functor_trait rather than adaptor_trait for - our lambda stuff.) functor_trait.h needs to be generated from .m4 now. - - * sigc++/functors/functor_trait.h.m4: Add convenience macros: - - SIGC_FUNCTORS_HAVE_RESULT_TYPE indicates that the existance of - T_functor::result_type should be assumed for all unknown functors. - - SIGC_FUNCTOR_TRAIT(T_functor, T_result) explicitly specifies the - result type of a functor. - ("typename functor_trait::result_type") is used to - determine the return type of our adaptors' operator()() overloads. - - * sigc++/adaptors/[lambda/]*.h.m4: Various fixes in visit_each() and - operator()() overloads to make these operator()() overloads usable. - Most of them were just commented out before. Some adaptor types also - have void specializations, now. - - * sigc++/adaptors/lambda/group.h.m4: Change syntax from - "[some_functor] % grp([args])" to "group([some_functor], [args])" - like we agreed on the ml some time ago. - - * sigc++/tests/test_[all adaptors].cc: Test stuff that didn't work - before. - -2003-03-22 Murray Cumming - - * Added pgk-config file, from a mystery person in bug #108857 - -2003-03-22 Martin Schulze - - * tests/test_bind.cc: Test and show how to use functor_trait - for user defined or 3rd-party functors so that a - bind<0>([functor],[arg1])() call with no arguments can return a value. - -2003-03-20 Martin Schulze - - * sigc++/callof.h.m4: Add explanations. Comment in / create templates - callof_safe[#]. Unfortunately they don't work for functors with overloaded - operator() so we don't use it for now. At least everything is documented. - - * sigc++/functors/functor_trait.h, sigc++/functors/*.h.m4: Add back - functor_base compiler hint. We're using it now in adaptor_functor<>. - - * sigc++/adaptors/{adaptor_trait,bind}.h.m4: Make operator() overloads - with no arguments return the result of the functor invocation. - Fix multiple bind<0>(). - * tests/test_bind.cc: Test the stuff that's working now. - -2003-03-16 Murray Cumming - - * Added sigc++/sigc++.h, like in libsigc++ 1.2 - * examples: Added member_method example, which uses a class method - and which demonstrates disconnection. - -1.9.6: - -2003-03-11 Andreas Rottmann - - * sigc++/Makefile.am: Use substitution references instead of - $(patsubst). Is shorter and fixes the strange-dirs-in-dist-tarball - bug. - -2003-03-09 Martin Schulze - - * sigc++/connection.h: Add block() capability. - -2003-03-09 Martin Schulze - - * sigc++/signal.{cc,h.m4}: Add flag signal_impl::destroy_ - and function signal_impl::destroy(). Use them to defer - the destruction of the signal_impl object during signal - emission. - - * tests/test_disconnect.cc: Add tests for the connection - class and for deleting signals during emission. - -2003-03-09 Martin Schulze - - * sigc++/connection.{cc,h}, sigc++/Makefile.am: - - New files that add a connection class. Objects of this - class are constructed from closure list iterators and can - be used to disconnect the refered closure. As opposed to - iterators they stay valid beyond the lifetime of the closure. - -2003-03-09 Martin Schulze - - * sigc++/functors/closure.{cc,h.m4}, sigc++/signal.cc: - - Rename closure_{base,rep}::[set_]dependency_ -> [set_]parent_. - - Make closure_rep inherit trackable. This allows for - connection objects that stay valid beyond the life time - of the refered closure. - - Make some one-line-functions inline again. - -2003-03-08 Martin Schulze - - * sigc++/trackable.cc: BUGFIX in trackable_dep_list::clear() - -2003-03-08 Andreas Rottmann - - * sigc++/Makefile.am: Rewritten so we can build lambda cleanly. - * sigc++/Makefile.am_fragment: Removed. - - * sigc++/functors/Makfile.am: Removed. - * sigc++/adaptors/Makefile.am: Removed. - * sigc++/adaptors/lambda/Makefile.am: Removed. - * configure.ac (AC_OUTPUT): Remove the above Makefiles. - - * tests/Makefile.am: Re-included lambda test. - -2003-03-07 Martin Schulze - - * sigc++/signal.{cc,h.m4}: - - signal_emit#<>: New templates replacing signal#<>::caller. - The purpose of these templates is implementing the emit - function and optimizing signal emission for the case that - no accumulator is used via template specializations. - - default_accumulator<>: Removed. The default for T_accumulator - in signal#<> now is nil. An example how to use accumulators - is available in tests/test_accumulator.cc. - - signal_{base,impl}: Move the implementation of signal_base's - interface to signal_impl. An object of this class is - dynamically allocated when first connecting a closure to - the signal. This drastically reduces the size of empty signals - and allows for future addition of a reference counter to make - it safe to delete a signal during emission. - - Directly work on closure_rep during signal emission. This - seems to be quicker than using the closure templates. - - Document the classes. Restructure the header file a bit. - - * sigc++/functors/closure.h.m4: Make closure_base::rep_ data - member public, so that signal emission can directly work on it. - - * tests/test_size.cc: Add an entry for signal_impl. - -2003-03-07 Martin Schulze - - * sigc++/functors/closure.{cc,h.m4}: - - closure_base: BUGFIXES in ~closure_base() and operator=(). - - Mark some functions with the inline keyword. This seems to - help gcc 3.2 to optimize signal emission and (dis)connection. - - Document the classes. Restructure the header file a bit. - -2003-03-07 Martin Schulze - - * sigc++/trackable.{cc,h}: Make trackable allocate a - trackable_dep_list object dynamically when adding the first - dependency. (This reduces the size of objects, that are not - refered by a closure by 4 bytes (50%) and increases the size - of objects that are refered by a closure by 4 bytes (50%) - on a 32 bit architecture => This reduces total memory use - when >50% of the trackables are not refered by a closure.) - Document the classes. - -2003-03-05 Martin Schulze - - * tests/Makefile.am, tests/test_size.cc, tests/test_accumulated.cc: - Add two test cases. test_size is showing the size of public and - internal structures. (Which apart from empty signals are smaller - than the sizes of the equivalent libsigc++-1.2 structures.) - test_accumulated is a test for the template signal<>::accumulated<> - at the same time showing the use of accumulators in libsigc++2. - - * Offtopic: My note about binary sizes from 2003-02-10 is wrong. - Stripped libsigc++2 test binaries are about 8-10k in size. - -2003-03-05 Martin Schulze - - * sigc++/visit_each.h: BUGFIX in template specialization - limit_derive_target::with_type: - Add non-const overloads for static void execute_() avoiding - compile time errors. - -2003-02-16 Martin Schulze - - * tests/Makefile.am, tests/test_disconnect.cc: - Add testcase with a mixed connection & disconnection sequence. - -2003-02-16 Martin Schulze - - * sigc++/signal.cc: Bugfix in signal_base::insert(): - Set notification function in the newly created copy of - slot_ rather than in slot_ itself. - -2003-02-10 Martin Schulze - - * sigc++/signal.h.m4: Comment in typedefs for iterator types in - the signal#<> class template. Make signal#<>::connect() return an - iterator for convenience. - (Note that the first change increases the binary size of - tests/test_signal from 201k to 204k, the second change to 206k.) - -2003-01-23 Murray Cumming - - * sigc++/adaptors/lambda is disable temporarily (not built and - not distributed) because it gets built before its parent - directory, but #includes generated sources in the parent directory. - -2003-01-22 Murray Cumming - - * Added Andreas Rottman's example. - -2003-01-22 Murray Cumming - - * Applied Andreas Rottman's make dist fixes. - -2003-01-14 Murray Cumming - - * Added whitespace to make the code more readable. From 1c34dc85631f3d698b464589af59ec12b6484726 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Mon, 21 Apr 2025 16:40:56 +0200 Subject: [PATCH 108/112] CMakeLists.txt: Change minimum required cmake version from 3.2 to 3.10 Fixes #112 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a1432d85..ee64a3a4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,7 +13,7 @@ # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, see . -cmake_minimum_required (VERSION 3.2) +cmake_minimum_required (VERSION 3.10) set (SIGCXX_MAJOR_VERSION 3) set (SIGCXX_MINOR_VERSION 4) From eed01764e06bf41ebd5f729d9a1cde1dfb40fb0a Mon Sep 17 00:00:00 2001 From: Philippe Baril Lecavalier Date: Sun, 27 Apr 2025 06:27:44 -0400 Subject: [PATCH 109/112] build-pdf: Prevent infinite loop in dblatex By default, dblatex goes on an infinite loop if it can't find a font. --- tools/tutorial-custom-cmd.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/tutorial-custom-cmd.py b/tools/tutorial-custom-cmd.py index 8b4b094e..280d2559 100755 --- a/tools/tutorial-custom-cmd.py +++ b/tools/tutorial-custom-cmd.py @@ -112,6 +112,7 @@ def dblatex(): '-P', 'paper.type=a4paper', '-P', 'doc.collab.show=1', '-P', 'latex.output.revhistory=0', + '-P', 'latex.engine.options="-halt-on-error"', ] cmd = [ From c581b5b9425f6af8ea6cd7306c4808b2db98321c Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Sun, 27 Apr 2025 16:41:03 +0200 Subject: [PATCH 110/112] Meson build: Don't distribute libsigcplusplus.doap --- meson.build | 2 ++ 1 file changed, 2 insertions(+) diff --git a/meson.build b/meson.build index ed9848ef..9c97f7a0 100644 --- a/meson.build +++ b/meson.build @@ -269,8 +269,10 @@ meson.add_dist_script( python3, dist_changelog, project_source_root, ) + # Don't distribute these files and directories. dont_distribute = [ + 'libsigcplusplus.doap', '.github', ] # Add build scripts to the distribution directory, and delete .gitignore From 53f6a8cfc26ca62f50421df2581a80e81a9fdbff Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Mon, 28 Apr 2025 07:45:35 +0200 Subject: [PATCH 111/112] Meson build: Better detection of MSVC-like compilers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Treat all compilers with MSVC-like argument syntax the same. Use cpp_compiler.get_define('_MSC_VER') instead of cpp_compiler.version() to check compiler version. Suggested by Tim-Philipp Müller and Chun-wei Fan. See https://gitlab.freedesktop.org/cairo/cairomm/-/merge_requests/30 --- meson.build | 30 ++++++++++++++---------------- sigc++/meson.build | 5 +++-- 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/meson.build b/meson.build index 9c97f7a0..4d60b1b4 100644 --- a/meson.build +++ b/meson.build @@ -39,14 +39,12 @@ project_build_root = meson.project_build_root() cpp_compiler = meson.get_compiler('cpp') cpp_compiler_id = cpp_compiler.get_id() -is_msvc = cpp_compiler_id == 'msvc' or cpp_compiler_id.endswith('-cl') -is_cl_impersonator = is_msvc and cpp_compiler_id != 'msvc' +is_msvc_style = cpp_compiler.get_argument_syntax() == 'msvc' python3 = find_program('python3', version: '>=3.7') -# MSVC: We currently do not support shared and static builds at the, -# same time, since we need different defines/cflags for proper -# linking. -if is_msvc +# MSVC: We currently do not support shared and static builds at the same time, +# since we need different defines/cflags for proper linking. +if is_msvc_style if get_option('default_library') == 'both' error('-Ddefault_library=both is currently not supported for Visual Studio') endif @@ -119,11 +117,11 @@ benchmark_dep = dependency('boost', modules: ['system', 'timer'], version: '>=1.20.0', required: do_benchmark) can_benchmark = benchmark_dep.found() -if is_msvc and not is_cl_impersonator +if is_msvc_style # We must have Visual Studio 2017 15.7 or later... - assert(cpp_compiler.version().split('.')[0].to_int() >= 19 and \ - cpp_compiler.version().split('.')[1].to_int() >= 15, - 'Visual Studio 2017 15.7 or later is required') + mscver = cpp_compiler.get_define('_MSC_VER') + assert(mscver == '' or mscver.version_compare('>=1914'), + 'Visual Studio 2017 15.7 or later or compatible is required') endif # Some dependencies are required only in maintainer mode and/or @@ -184,17 +182,17 @@ endif warning_flags = [] if cpp_warnings == 'min' if warning_level == 0 - warning_flags = is_msvc ? ['/W2'] : ['-Wall'] - endif + warning_flags = is_msvc_style ? ['/W2'] : ['-Wall'] + endif elif cpp_warnings == 'max' or cpp_warnings == 'fatal' if warning_level < 3 - warning_flags = is_msvc ? ['/W4'] : ['-pedantic', '-Wall', '-Wextra'] + warning_flags = is_msvc_style ? ['/W4'] : ['-pedantic', '-Wall', '-Wextra'] endif - if not is_msvc + if not is_msvc_style warning_flags += '-Wsuggest-override -Wshadow -Wzero-as-null-pointer-constant -Wformat-security'.split() endif if cpp_warnings == 'fatal' and not werror - warning_flags += is_msvc ? ['/WX'] : ['-Werror'] + warning_flags += is_msvc_style ? ['/WX'] : ['-Werror'] endif endif @@ -205,7 +203,7 @@ add_project_arguments(warning_flags, language: 'cpp') # that should not be overlooked stand out. static_cxxflag = '-DLIBSIGCXX_STATIC' msvc_static_cxxflag = is_msvc_static ? static_cxxflag : '' -if is_msvc +if is_msvc_style disable_warnings_list = [ '/EHsc', # avoid warnings caused by exception handling model used ] diff --git a/sigc++/meson.build b/sigc++/meson.build index 9e36e7e9..4f62bad0 100644 --- a/sigc++/meson.build +++ b/sigc++/meson.build @@ -1,7 +1,8 @@ # sigc++ # Input: sigcxx_build_dep, sigcxx_pcname, sigcxx_libversion, sigcxx_api_version, -# darwin_versions, install_includedir, sig_rc, msvc_static_cxxflag +# darwin_versions, install_includedir, sig_rc, msvc_static_cxxflag, +# is_msvc_style # Output: source_h_files, sigcxx_own_dep # There are no built source files in libsigc++-3.0. @@ -76,7 +77,7 @@ extra_sigc_cppflags = [] extra_sigc_objects = [] # Make sure we are exporting the symbols from the DLL -if is_msvc +if is_msvc_style extra_sigc_cppflags += ['-DSIGC_BUILD'] endif From 552e181b458dece1794241fb693311159a6e50b3 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Mon, 28 Apr 2025 08:22:34 +0200 Subject: [PATCH 112/112] Documentation: Clarify download locations Future releases will not be stored at download.gnome.org/sources/. Very old releases are not stored at github.com/libsigcplusplus/ libsigcplusplus/releases/. --- README.md | 2 +- docs/doc.md | 4 ++-- docs/docs/_config.yml | 1 - docs/download.md | 7 +++++-- 4 files changed, 8 insertions(+), 6 deletions(-) delete mode 100644 docs/docs/_config.yml diff --git a/README.md b/README.md index bb60b64e..0b47b377 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ Web site - https://libsigcplusplus.github.io/libsigcplusplus/ Download location - - https://download.gnome.org/sources/libsigc++/ + - https://download.gnome.org/sources/libsigc++/ (until 3.6.0) - https://github.com/libsigcplusplus/libsigcplusplus/releases/ Reference documentation diff --git a/docs/doc.md b/docs/doc.md index aaf3cc10..259022f8 100644 --- a/docs/doc.md +++ b/docs/doc.md @@ -6,8 +6,8 @@ title: Documentation ## libsigc++-2.0 The documentation is not available online. You can download a tarball from -[GitHub releases](https://github.com/libsigcplusplus/libsigcplusplus/releases/) -or the [GNOME download site](https://download.gnome.org/sources/libsigc++/), +[GitHub releases](https://github.com/libsigcplusplus/libsigcplusplus/releases/) (since 2.10.1) +or the [GNOME download site](https://download.gnome.org/sources/libsigc++/) (until 2.12.1), extract it, and view the documentation at *untracked/docs/*. ## libsigc++-3.0 diff --git a/docs/docs/_config.yml b/docs/docs/_config.yml deleted file mode 100644 index 2f7efbea..00000000 --- a/docs/docs/_config.yml +++ /dev/null @@ -1 +0,0 @@ -theme: jekyll-theme-minimal \ No newline at end of file diff --git a/docs/download.md b/docs/download.md index 2cc3d16d..9a587a01 100644 --- a/docs/download.md +++ b/docs/download.md @@ -5,7 +5,10 @@ title: Download ## Source Packages -The source packages are available from the [GNOME download site](http://download.gnome.org/sources/libsigc++/). +The source packages are available from [GitHub releases](https://github.com/libsigcplusplus/libsigcplusplus/releases/) +(since 2.10.1 and 3.0.0) +and from the [GNOME download site](http://download.gnome.org/sources/libsigc++/) +(until 2.12.1 and 3.6.0). ## Binary Packages @@ -16,7 +19,7 @@ For instance, Ubuntu Linux, Debian Linux and Fedora Linux have official libsigc+ [pkg-config](http://www.freedesktop.org/wiki/Software/pkg-config/) should be used to build software that depends on libsigc++. -libsigc++ is built and tested for a standards-compliant C++ compiler. Luckily, the recent versions of all major C++ compilers are now sufficiently standards-compliant. +libsigc++ is built and tested for a standards-compliant C++ compiler. libsigc++ version 2.5.1 and later require a C++11-compliant compiler.