diff --git a/.github/workflows/autotools-clang-10.yml b/.github/workflows/autotools-clang.yml similarity index 70% rename from .github/workflows/autotools-clang-10.yml rename to .github/workflows/autotools-clang.yml index 9d6263a7..756baf23 100644 --- a/.github/workflows/autotools-clang-10.yml +++ b/.github/workflows/autotools-clang.yml @@ -1,11 +1,11 @@ -name: "CI: autotools: clang 10" +name: "Autotools: clang" on: [push] jobs: build: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 @@ -14,8 +14,8 @@ 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 docbook-xsl --yes - export CC=clang-10 CXX=clang++-10 + sudo apt install mm-common clang make docbook-xsl --yes + export CC=clang CXX=clang++ ./autogen.sh --enable-warnings=fatal make - name: Test @@ -23,5 +23,5 @@ jobs: - name: Distcheck run: | # distcheck runs configure again so we need to specify CC and CXX again. - export CC=clang-10 CXX=clang++-10 + export CC=clang CXX=clang++ make distcheck diff --git a/.github/workflows/autotools-gcc-10.yml b/.github/workflows/autotools-gcc.yml similarity index 55% rename from .github/workflows/autotools-gcc-10.yml rename to .github/workflows/autotools-gcc.yml index 1f601b0b..018fdc1a 100644 --- a/.github/workflows/autotools-gcc-10.yml +++ b/.github/workflows/autotools-gcc.yml @@ -1,19 +1,21 @@ -name: "CI: autotools: gcc 10" +name: "Autotools: gcc" on: [push] jobs: build: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest 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 g++-10 docbook-xsl - export CXX=g++-10 + sudo apt install mm-common g++ make docbook-xsl --yes + export CXX=g++ ./autogen.sh --enable-warnings=fatal make - name: Test @@ -21,5 +23,5 @@ jobs: - name: Distcheck run: | # distcheck runs configure again so we need to specify CXX again. - export CXX=g++-10 + export CXX=g++ make distcheck diff --git a/.github/workflows/clang-format-check.yml b/.github/workflows/clang-format-check.yml index fd6fb3a6..ffe78737 100644 --- a/.github/workflows/clang-format-check.yml +++ b/.github/workflows/clang-format-check.yml @@ -1,6 +1,7 @@ -name: "CI: Check Code Formatting" +name: "Check Code Formatting" -on: [push] +# Triggered manually +on: [workflow_dispatch] jobs: build: @@ -14,5 +15,5 @@ jobs: # Prevent blocking the install on a question during configuring of tzdata. export ENV DEBIAN_FRONTEND=noninteractive sudo apt update - sudo apt install clang-format-12 --yes - clang-format-12 --dry-run --Werror `find . -name "*.h" -or -name "*.cc"` + sudo apt install clang-format --yes + clang-format --dry-run --Werror `find . -name "*.h" -or -name "*.cc"` diff --git a/.github/workflows/cmake-msvc.yml b/.github/workflows/cmake-msvc.yml index 72f90659..88a93323 100644 --- a/.github/workflows/cmake-msvc.yml +++ b/.github/workflows/cmake-msvc.yml @@ -1,11 +1,12 @@ -name: "CI: cmake: msvc 2019" +name: "CMake: MSVC" -on: [push] +# Triggered manually +on: [workflow_dispatch] jobs: build: - runs-on: windows-2019 + runs-on: windows-latest steps: - uses: actions/checkout@v1 diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 13f3729d..470b5b76 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -1,4 +1,4 @@ -name: "CI: cmake" +name: "CMake: gcc" on: [push] diff --git a/.github/workflows/meson-gcc-10.yml b/.github/workflows/meson-clang.yml similarity index 54% rename from .github/workflows/meson-gcc-10.yml rename to .github/workflows/meson-clang.yml index d358d7fc..660a7010 100644 --- a/.github/workflows/meson-gcc-10.yml +++ b/.github/workflows/meson-clang.yml @@ -1,11 +1,13 @@ -name: "meson: gcc 10" +# 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] jobs: build: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 @@ -14,11 +16,11 @@ 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++-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++-10 + 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 meson compile @@ -30,6 +32,6 @@ jobs: run: | sudo apt install git --yes # dist runs setup again so we need to specify CXX again. - export CXX=g++-10 + export CXX=clang++ cd _build meson dist diff --git a/.github/workflows/meson-clang-10.yml b/.github/workflows/meson-gcc.yml similarity index 55% rename from .github/workflows/meson-clang-10.yml rename to .github/workflows/meson-gcc.yml index 092c00ef..fe2ba8ae 100644 --- a/.github/workflows/meson-clang-10.yml +++ b/.github/workflows/meson-gcc.yml @@ -1,11 +1,13 @@ -name: "meson: clang 10" +# 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] jobs: build: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 @@ -14,11 +16,11 @@ 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-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=clang++-10 + 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 meson compile @@ -30,6 +32,6 @@ jobs: run: | sudo apt install git --yes # dist runs setup again so we need to specify CXX again. - export CXX=clang++-10 + export CXX=g++ cd _build meson dist diff --git a/.github/workflows/meson-msvc.yml b/.github/workflows/meson-msvc.yml new file mode 100644 index 00000000..a9aef1a1 --- /dev/null +++ b/.github/workflows/meson-msvc.yml @@ -0,0 +1,35 @@ +name: "Meson: MSVC" + +on: [push] + +jobs: + build: + + runs-on: windows-latest + + steps: + - uses: actions/checkout@v3 + - uses: ssciwr/doxygen-install@v1 + - uses: actions/setup-python@v4 + with: + python-version: '3.x' + - run: pip install meson ninja + + - name: Prepare MSVC + uses: bus1/cabuild/action/msdevshell@v1 + with: + architecture: x64 + + - name: Configure + # Don't use warning_level or werror. They are applied also to subprojects. + # 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 -Dbuild-manual=false -Dmm-common:use-network=true _build + + - name: Compile + run: meson compile -C _build + + - name: Test + run: meson test -C _build diff --git a/.github/workflows/publish-docs.yml b/.github/workflows/publish-docs.yml index 95b0a6fa..6d450fe4 100644 --- a/.github/workflows/publish-docs.yml +++ b/.github/workflows/publish-docs.yml @@ -3,9 +3,10 @@ # 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 +name: Publish docs -# 2022-12-17: 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 push: @@ -20,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 @@ -31,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. @@ -51,15 +53,16 @@ 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@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/ @@ -72,5 +75,5 @@ jobs: steps: - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v1 + uses: actions/deploy-pages@v4 diff --git a/CMakeLists.txt b/CMakeLists.txt index c4b291c1..ee64a3a4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,10 +11,9 @@ # 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) +cmake_minimum_required (VERSION 3.10) set (SIGCXX_MAJOR_VERSION 3) set (SIGCXX_MINOR_VERSION 4) 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. 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/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/README.md b/README.md index fe9a88cb..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 @@ -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. 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/configure.ac b/configure.ac index 52237da4..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]) @@ -74,6 +74,8 @@ AS_IF([test "x$enable_benchmark" = xyes],[ ]) AC_SUBST(MSVC_STATIC_CXXFLAG, '') +AC_SUBST(DOXYGEN_HAVE_DOT, [YES]) +AM_SUBST_NOTMAKE(DOXYGEN_HAVE_DOT) AC_CONFIG_FILES([Makefile ${SIGCXX_MODULE_NAME}.pc:sigc++.pc.in diff --git a/docs/doc.md b/docs/doc.md index 7d5e6ede..259022f8 100644 --- a/docs/doc.md +++ b/docs/doc.md @@ -5,13 +5,9 @@ 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 -[GitHub releases](https://github.com/libsigcplusplus/libsigcplusplus/releases/) -or the [GNOME download site](https://download.gnome.org/sources/libsigc++/), +The documentation is not available online. You can download a tarball from +[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/docs/manual/libsigc_manual.xml b/docs/docs/manual/libsigc_manual.xml index 2fed5ae6..bf572582 100644 --- a/docs/docs/manual/libsigc_manual.xml +++ b/docs/docs/manual/libsigc_manual.xml @@ -258,13 +258,19 @@ int main()
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 ignoring until now. connect() returns a sigc::connection object, which has a disconnect() member method. This does just what you think it does. + Also, sigc++ 3.6 adds sigc::scoped_connection. + A scoped connection can be constructed or assigned from a normal/unscoped sigc::connection, + whereupon it effectively takes ownership of the connection, and will automatically disconnect() + it when the sigc::scoped_connection is destroyed (goes out of scope) or reassigned. + This lets you tie whether a slot is called to the lifetime of a scoped connection object, e.g. as a class member, + instead of having to manually disconnect. Scoped connections can be put in containers, or made ref-counted via std::shared_ptr. + See the sigc::scoped_connection class documentation for examples.
@@ -431,7 +437,6 @@ asignal.connect( sigc::retype( sigc::ptr_fun(&dostuff) ) ); Reference - - See the reference documentation online + See the reference documentation online diff --git a/docs/docs/manual/meson.build b/docs/docs/manual/meson.build index 8c721c8e..7cd56ec0 100644 --- a/docs/docs/manual/meson.build +++ b/docs/docs/manual/meson.build @@ -1,13 +1,15 @@ # 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 +# 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 @@ -59,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 @@ -93,13 +96,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/Doxyfile.in b/docs/docs/reference/Doxyfile.in index 0ffb9eba..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 #--------------------------------------------------------------------------- @@ -162,7 +160,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 +190,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 +221,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 #--------------------------------------------------------------------------- @@ -296,10 +291,8 @@ EXTERNAL_PAGES = YES #--------------------------------------------------------------------------- DIA_PATH = HIDE_UNDOC_RELATIONS = NO -HAVE_DOT = YES +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 +316,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 diff --git a/docs/docs/reference/meson.build b/docs/docs/reference/meson.build index e0c0c4b6..fcf0c74e 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 +# 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 == '' @@ -60,6 +59,7 @@ doc_conf_data.set('abs_top_builddir', project_build_root) doc_conf_data.set('abs_top_srcdir', project_source_root) doc_conf_data.set('SIGCXX_API_VERSION', sigcxx_api_version) doc_conf_data.set('DOXYGEN_TAGFILES', doxygen_tagfiles) +doc_conf_data.set('DOXYGEN_HAVE_DOT', dot.found() ? 'YES' : 'NO') doxyfile = configure_file( input: 'Doxyfile.in', @@ -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,17 +126,16 @@ meson.add_install_script( devhelp_file.full_path(), install_devhelpdir, install_reference_docdir / 'html', - docinstall_flags + docinstall_flags, + install_tag: 'doc', ) -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/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. 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/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 4c975d44..4d60b1b4 100644 --- a/meson.build +++ b/meson.build @@ -1,14 +1,13 @@ # 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', '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' @@ -34,19 +33,18 @@ 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') -is_msvc = cpp_compiler.get_id() == 'msvc' -python3 = find_program('python3', version: '>=3.5') +cpp_compiler_id = cpp_compiler.get_id() +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 @@ -87,7 +85,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') @@ -114,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 +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 @@ -134,9 +137,14 @@ if maintainer_mode and not mm_common_get.found() endif doxygen = find_program('doxygen', required: build_documentation) -dot = find_program('dot', required: build_documentation) # Used by Doxygen +dot = find_program('dot', required: false) # Used by Doxygen, if found xsltproc = find_program('xsltproc', required: build_documentation) +if build_documentation and not dot.found() + message('The \'dot\' command is not found.\n ' + \ + 'This will affect the look of the inheritance diagrams in the documentation.') +endif + script_dir = project_source_root / 'untracked' / 'build_scripts' doc_reference = script_dir / 'doc-reference.py' dist_changelog = script_dir / 'dist-changelog.py' @@ -174,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 @@ -194,7 +202,8 @@ 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 +msvc_static_cxxflag = is_msvc_static ? static_cxxflag : '' +if is_msvc_style disable_warnings_list = [ '/EHsc', # avoid warnings caused by exception handling model used ] @@ -224,13 +233,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) @@ -240,20 +242,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' @@ -261,12 +249,11 @@ configure_file( input: sigcxxconfig_h_meson, output: 'sigc++config.h', configuration: pkg_conf_data, + install: true, install_dir: install_includeconfigdir, + install_tag: 'devel', ) -# 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++') @@ -275,30 +262,30 @@ 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 = [ + 'libsigcplusplus.doap', + '.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 = { '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()} @@ -325,16 +312,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 = [ @@ -347,6 +347,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, 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++/.gitignore b/sigc++/.gitignore deleted file mode 100644 index e69de29b..00000000 diff --git a/sigc++/CMakeLists.txt b/sigc++/CMakeLists.txt index fa5a91a9..d6945b2f 100644 --- a/sigc++/CMakeLists.txt +++ b/sigc++/CMakeLists.txt @@ -11,11 +11,11 @@ # 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 + scoped_connection.cc signal_base.cc trackable.cc functors/slot_base.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 1d48383e..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 @@ -53,8 +51,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/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 10f948ca..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 @@ -38,8 +36,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..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 @@ -61,8 +59,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..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 @@ -50,8 +48,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..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 @@ -41,7 +39,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++/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 0e733760..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,12 +11,12 @@ * 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 #define SIGC_CONNECTION_HPP + #include #include #include @@ -28,15 +27,23 @@ 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)); * @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()). * + * sigc::connection doesnʼt disconnect the slot automatically upon destruction. + * You do not need to keep the sigc::connection object to retain the connection + * of the slot to the signal. See also @ref sigc::scoped_connection, which does + * disconnect automatically when the connection object is destroyed or replaced. + * * @ingroup signal */ struct SIGC_API connection diff --git a/sigc++/filelist.am b/sigc++/filelist.am index 4092b241..ea9155fb 100644 --- a/sigc++/filelist.am +++ b/sigc++/filelist.am @@ -24,8 +24,10 @@ sigc_public_h = \ member_method_trait.h \ reference_wrapper.h \ retype_return.h \ + scoped_connection.h \ signal.h \ signal_base.h \ + signal_connect.h \ slot.h \ trackable.h \ tuple-utils/tuple_cdr.h \ @@ -58,6 +60,7 @@ sigc_public_h = \ functors/slot_base.h sigc_sources_cc = \ + scoped_connection.cc \ signal_base.cc \ trackable.cc \ connection.cc \ 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 3f4b5108..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 @@ -194,7 +192,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++/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++/meson.build b/sigc++/meson.build index d9c1231d..4f62bad0 100644 --- a/sigc++/meson.build +++ b/sigc++/meson.build @@ -1,13 +1,15 @@ # 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, +# is_msvc_style # Output: source_h_files, sigcxx_own_dep # There are no built source files in libsigc++-3.0. source_cc_files = [ 'connection.cc', + 'scoped_connection.cc', 'signal_base.cc', 'trackable.cc', 'functors' / 'slot_base.cc', @@ -21,8 +23,10 @@ sigc_h_files = [ 'member_method_trait.h', 'reference_wrapper.h', 'retype_return.h', + 'scoped_connection.h', 'signal.h', 'signal_base.h', + 'signal_connect.h', 'slot.h', 'trackable.h', 'type_traits.h', @@ -73,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 @@ -99,6 +103,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( 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 new file mode 100644 index 00000000..1eae69f0 --- /dev/null +++ b/sigc++/scoped_connection.cc @@ -0,0 +1,114 @@ +/* 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 + * 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, see . + */ + +#include +#include + +namespace sigc +{ + +// All we are doing is assigning weak_raw_ptr, which is noexcept, so declare it. +// connectionʼs copy operators can be noexcept for that reason, if breaking ABI. +scoped_connection::scoped_connection(connection c) noexcept +: conn_(std::move(c)) +{ +} + +scoped_connection& +scoped_connection::operator=(connection c) +{ + conn_.disconnect(); + conn_ = std::move(c); + return *this; +} + +// We do not implement move-ctor in terms of move-assign, so we can be noexcept, +// as we do not need to call the maybe-throwing disconnect() for obvious reason. +scoped_connection::scoped_connection(scoped_connection&& sc) noexcept +: conn_(std::exchange(sc.conn_, connection())) +{ +} + +scoped_connection& +scoped_connection::operator=(scoped_connection&& sc) +{ + conn_.disconnect(); + conn_ = std::exchange(sc.conn_, connection()); + return *this; +} + +scoped_connection::~scoped_connection() +{ + conn_.disconnect(); +} + +bool +scoped_connection::empty() const noexcept +{ + return conn_.empty(); +} + +bool +scoped_connection::connected() const noexcept +{ + return conn_.connected(); +} + +bool +scoped_connection::blocked() const noexcept +{ + return conn_.blocked(); +} + +bool +scoped_connection::block(bool should_block) noexcept +{ + return conn_.block(should_block); +} + +bool +scoped_connection::unblock() noexcept +{ + return conn_.unblock(); +} + +void +scoped_connection::disconnect() +{ + conn_.disconnect(); +} + +scoped_connection::operator bool() const noexcept +{ + return conn_.operator bool(); +} + +// Swapping can be noexcept, as it does not need to disconnect either connection +// because they will still stay alive, just in opposite instances post-swapping. +void +swap(scoped_connection& sca, scoped_connection& scb) noexcept +{ + using std::swap; + swap(sca.conn_, scb.conn_); +} + +connection +scoped_connection::release() noexcept +{ + return std::exchange(conn_, connection()); +} + +} /* namespace sigc */ diff --git a/sigc++/scoped_connection.h b/sigc++/scoped_connection.h new file mode 100644 index 00000000..3b297f91 --- /dev/null +++ b/sigc++/scoped_connection.h @@ -0,0 +1,175 @@ +/* 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 + * 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, see . + */ + +#ifndef SIGC_SCOPED_CONNECTION_HPP +#define SIGC_SCOPED_CONNECTION_HPP + +#include + +namespace sigc +{ + +/** Convenience class for safe disconnection, including automatic disconnection + * upon destruction. + * + * This is a variant of @ref sigc::connection which also disconnect()s the slot + * automatically when the scoped_connection is destructed or re-assigned. Refer + * to @ref sigc::connection for full information about the common functionality. + * + * 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()" 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. + * + * Once a connection is scoped, it canʼt be copied as that would make it unclear + * which of the copies would hold responsibility to auto-disconnect the slot. It + * can, however, be moved, so itʼs usable in containers or so ‘ownership’ of the + * connection/auto-disconnect can be moved to another instance. Moving from the + * scoped_connection clears its reference to the slot so it wonʼt disconnect it. + * + * If you want a reference-counted scoped_connection, wrap in a std::shared_ptr. + * + * @code + * // Automatic disconnection: + * { + * sigc::scoped_connection sconn = sig.connect(&some_function); + * // Do stuff that requires the slot to be connected & called. + * } + * // The scoped_connection was destroyed, so the slot is no longer connected. + * + * // *** + * + * // Moving ownership: + * { + * sigc::scoped_connection sconn = sig.connect(&some_function); + * // Do stuff that requires the slot to be connected & called. + * take_ownership(std::move(sconn)); // Pass by rvalue. + * } + * // Now our `sconn` no longer referred to slot, so it did NOT auto-disconnect. + * + * // *** + * + * // Shared ownership: + * { + * auto shconn = std::make_shared(sig.connect(&some_function)); + * take_copy(shconn); // Pass by copy/value + * // Now we AND take_copy() must destroy our shared_ptr to auto-disconnect(). + * } + * // take_copy() may still hold a shared_ptr reference, keeping the slot alive. + * @endcode + * + * @ingroup signal + * @newin{3,6} + */ +struct SIGC_API scoped_connection final +{ + /** Constructs an empty scoped connection object. */ + 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. + */ + 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. + * 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. + */ + scoped_connection& operator=(connection c); + + /// scoped_connection canʼt be copied as it would confuse ownership—see intro. + scoped_connection& operator=(const scoped_connection&) = delete; + /// scoped_connection canʼt be copied as it would confuse ownership—see intro. + scoped_connection(const scoped_connection&) = delete; + + /** Constructs a scoped connection object moving an existing one. + * The source scoped connection will no longer refer to / disconnect the slot. + * @param sc The scoped connection object to move from. + */ + scoped_connection(scoped_connection&& sc) noexcept; + + /** Overrides this scoped connection object moving another one. + * The current slot, if any, will be disconnect()ed before being replaced. + * The source scoped connection will no longer refer to / disconnect the slot. + * @param sc The scoped connection object to move from. + */ + scoped_connection& operator=(scoped_connection&& sc); + + /// Swap two scoped connections. + friend SIGC_API void swap(scoped_connection& sca, scoped_connection& scb) noexcept; + + /// scoped_connection disconnects the referred slot, if any, upon destruction. + ~scoped_connection(); + + /** Returns whether the connection is still active. + * @return @p false if the connection is still active. + */ + bool empty() const noexcept; + + /** Returns whether the connection is still active. + * @return @p true if the connection is still active. + */ + bool connected() const noexcept; + + /** Returns whether the connection is blocked. + * @return @p true if the connection is blocked. + */ + bool blocked() const noexcept; + + /** Sets or unsets the blocking state of this connection. + * See slot_base::block() for details. + * @param should_block Indicates whether the blocking state should be set or unset. + * @return @p true if the connection has been in blocking state before. + */ + bool block(bool should_block = true) noexcept; + + /** Unsets the blocking state of this connection. + * @return @p true if the connection has been in blocking state before. + */ + bool unblock() noexcept; + + /// Disconnects the referred slot. This will also happen upon destruction. + void disconnect(); + + /** Returns whether the connection is still active. + * @return @p true if the connection is still active. + */ + 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. + */ + connection release() noexcept; + +private: + sigc::connection conn_; +}; + +/// Swap two scoped connections. +SIGC_API +void swap(scoped_connection& sca, scoped_connection& scb) noexcept; + +} /* namespace sigc */ + +#endif /* SIGC_SCOPED_CONNECTION_HPP */ diff --git a/sigc++/sigc++.h b/sigc++/sigc++.h index b0b4ebbb..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 @@ -34,10 +31,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 * @@ -117,7 +114,9 @@ #include #include +#include #include +#include #include #include diff --git a/sigc++/signal.h b/sigc++/signal.h index 8cddf103..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 @@ -374,14 +371,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 +398,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 +423,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 +435,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 +541,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! * @@ -542,7 +578,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 @@ -634,13 +672,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 +728,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 +738,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 +850,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..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 @@ -128,6 +126,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 +270,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..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 @@ -109,13 +107,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 +121,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 +234,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 @@ -264,6 +279,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, @@ -347,7 +378,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 +386,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 +395,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/sigc++/signal_connect.h b/sigc++/signal_connect.h new file mode 100644 index 00000000..c00516f3 --- /dev/null +++ b/sigc++/signal_connect.h @@ -0,0 +1,76 @@ +/* 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, see . + */ + +#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. + * + * @newin{3,8} + * @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. + * + * @newin{3,8} + * @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. + * + * @newin{3,8} + * @ingroup signal + */ +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)); +} + +} /* namespace sigc */ + +#endif /* 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 9485b45f..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 () @@ -40,7 +39,9 @@ set (TEST_SOURCE_FILES test_retype.cc test_retype_return.cc 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 b05f7b47..c34f0020 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -47,7 +47,9 @@ check_PROGRAMS = \ test_retype \ test_retype_return \ test_rvalue_ref \ + test_scoped_connection \ test_signal \ + test_signal_connect \ test_signal_move \ test_size \ test_slot \ @@ -92,7 +94,9 @@ 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_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 e0f57d72..4b627e94 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -29,7 +29,9 @@ test_programs = [ [[], '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_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']], @@ -68,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. @@ -91,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 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 diff --git a/tests/test_scoped_connection.cc b/tests/test_scoped_connection.cc new file mode 100644 index 00000000..520197fc --- /dev/null +++ b/tests/test_scoped_connection.cc @@ -0,0 +1,214 @@ +/* Copyright 2023, The libsigc++ Development Team + * Assigned to public domain. Use as you wish without restriction. + */ + +#include "testutilities.h" +#include +#include +#include +#include +#include + +// Test the expected special members and conversions, esp. NOT copyable BUT movable. +static_assert( std::is_nothrow_default_constructible_v); +static_assert(!std::is_copy_constructible_v ); +static_assert(!std::is_copy_assignable_v ); +static_assert( std::is_nothrow_move_constructible_v ); +static_assert( std::is_move_assignable_v ); +static_assert( std::is_nothrow_swappable_v ); +// TODO: C++20: Test the stronger std::is_nothrow_convertible_v; it should pass. +static_assert( std::is_convertible_v); +static_assert(!std::is_convertible_v); +static_assert( std::is_assignable_v ); +static_assert(!std::is_assignable_v ); + +namespace +{ +std::ostringstream result_stream; + +int +foo(int i) +{ + result_stream << "foo(" << i << ") "; + return 1; +} + +int +bar(double i) +{ + result_stream << "bar(" << i << ") "; + return 1; +} + +struct A : public sigc::trackable +{ + int foo(int i) + { + result_stream << "A::foo(" << i << ") "; + return 1; + } +}; + +} // end anonymous namespace + +int +main(int argc, char* argv[]) +{ + auto util = TestUtilities::get_instance(); + + if (!util->check_command_args(argc, argv)) + return util->get_result_and_delete_instance() ? EXIT_SUCCESS : EXIT_FAILURE; + + sigc::signal sig; + sigc::connection confoo; + sigc::connection conbar; + sigc::connection cona; + + { + A a; + sig.connect(sigc::mem_fun(a, &A::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): 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() << "): "; + sig(2); + util->check_result(result_stream, "sig is connected to (size=2): foo(2) bar(2) "); + + { + A a; + sig.connect(sigc::mem_fun(a, &A::foo)); + sigc::scoped_connection sconfoo = sig.connect(&foo); + 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): 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() << "): "; + sig(4); + util->check_result(result_stream, "sig is connected to (size=2): foo(4) bar(4) "); + + // copying connection to a scoped connection disconnects when latter destroyed + // copy-constructor: + { + sigc::scoped_connection sconfoo = confoo; + result_stream << "sig is connected to (size=" << sig.size() << "): "; + sig(5); + util->check_result( + result_stream, "sig is connected to (size=2): foo(5) bar(5) "); + } + result_stream << "sig is connected to (size=" << sig.size() << "): "; + sig(6); + util->check_result( + result_stream, "sig is connected to (size=1): bar(6) "); + // copy-assignment: + confoo = sig.connect(&foo); + { + sigc::scoped_connection sconfoo = sig.connect(&bar); + result_stream << "sig is connected to (size=" << sig.size() << "): "; + sig(7); + util->check_result( + result_stream, "sig is connected to (size=3): bar(7) foo(7) bar(7) "); + // copy-assignment disconnects currently held connection & replaces with new + sconfoo = confoo; + result_stream << "sig is connected to (size=" << sig.size() << "): "; + sig(8); + util->check_result( + result_stream, "sig is connected to (size=2): bar(8) foo(8) "); + } + result_stream << "sig is connected to (size=" << sig.size() << "): "; + sig(9); + util->check_result( + result_stream, "sig is connected to (size=1): bar(9) "); + + // moving scoped_connection transfers ownership/disconnection to destination + // move-constructor: + { + auto src = std::make_unique(sig.connect(&foo)); + result_stream << "sig is connected to (size=" << sig.size() << "): "; + sig(10); + util->check_result( + result_stream, "sig is connected to (size=2): bar(10) foo(10) "); + + sigc::scoped_connection dst = std::move(*src); + src.reset(); // This will NOT disconnect from foo() + result_stream << "sig is connected to (size=" << sig.size() << "): "; + sig(11); + util->check_result( + result_stream, "sig is connected to (size=2): bar(11) foo(11) "); + } + + // move-assignment: + { + auto src = std::make_unique(sig.connect(&foo)); + result_stream << "sig is connected to (size=" << sig.size() << "): "; + sig(12); + util->check_result( + result_stream, "sig is connected to (size=2): bar(12) foo(12) "); + + sigc::scoped_connection dst; + dst = std::move(*src); + src.reset(); // This will NOT disconnect from foo() + result_stream << "sig is connected to (size=" << sig.size() << "): "; + sig(13); + util->check_result( + result_stream, "sig is connected to (size=2): bar(13) foo(13) "); + } + + // dst from above is now destroyed + result_stream << "sig is connected to (size=" << sig.size() << "): "; + sig(14); + util->check_result( + result_stream, "sig is connected to (size=1): bar(14) "); + + // swap + sigc::scoped_connection sconfoo = sig.connect(&foo); + result_stream << "sig is connected to (size=" << sig.size() << "): "; + sig(15); + util->check_result( + result_stream, "sig is connected to (size=2): bar(15) foo(15) "); + sigc::scoped_connection sconbar = sig.connect(&bar); + result_stream << "sig is connected to (size=" << sig.size() << "): "; + sig(16); + util->check_result( + result_stream, "sig is connected to (size=3): bar(16) foo(16) bar(16) "); + swap(sconbar, sconfoo); + // disconnect sconbar, which was swapped to refer to &foo + sconbar.disconnect(); + result_stream << "sig is connected to (size=" << sig.size() << "): "; + sig(17); + util->check_result( + result_stream, "sig is connected to (size=2): bar(17) bar(17) "); + + // manual disconnection + sconfoo.disconnect(); // was swapped to refer to 2nd &bar + result_stream << "sig is connected to (size=" << sig.size() << "): "; + sig(18); + util->check_result( + result_stream, "sig is connected to (size=1): bar(18) "); + + // release + sconfoo = sig.connect(&foo); + result_stream << "sig is connected to (size=" << sig.size() << "): "; + sig(19); + util->check_result( + result_stream, "sig is connected to (size=2): bar(19) foo(19) "); + sigc::connection rconfoo = sconfoo.release(); + result_stream << "sig is connected to (size=" << sig.size() << "): "; + sig(20); + util->check_result( + result_stream, "sig is connected to (size=2): bar(20) foo(20) "); + rconfoo.disconnect(); + result_stream << "sig is connected to (size=" << sig.size() << "): "; + sig(21); + util->check_result( + result_stream, "sig is connected to (size=1): bar(21) "); + + return util->get_result_and_delete_instance() ? EXIT_SUCCESS : EXIT_FAILURE; +} 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(); diff --git a/tests/test_signal_connect.cc b/tests/test_signal_connect.cc new file mode 100644 index 00000000..ef4e1045 --- /dev/null +++ b/tests/test_signal_connect.cc @@ -0,0 +1,121 @@ +/* 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 << ")"; + } +}; + +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; +} 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 = [