]> git.tdb.fi Git - ext/sigc++-2.0.git/blob - untracked/docs/reference/html/index.html
Import libsigc++ 2.10.8 sources
[ext/sigc++-2.0.git] / untracked / docs / reference / html / index.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2 <html xmlns="http://www.w3.org/1999/xhtml">
3 <head>
4 <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
5 <meta http-equiv="X-UA-Compatible" content="IE=9"/>
6 <meta name="generator" content="Doxygen 1.9.1"/>
7 <meta name="viewport" content="width=device-width, initial-scale=1"/>
8 <title>libsigc++: libsigc++ Reference Manual</title>
9 <link href="tabs.css" rel="stylesheet" type="text/css"/>
10 <script type="text/javascript" src="jquery.js"></script>
11 <script type="text/javascript" src="dynsections.js"></script>
12 <link href="doxygen.css" rel="stylesheet" type="text/css" />
13 <link href="doxygen-extra.css" rel="stylesheet" type="text/css"/>
14 </head>
15 <body>
16 <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
17 <div id="titlearea">
18 <table cellspacing="0" cellpadding="0">
19  <tbody>
20  <tr style="height: 56px;">
21   <td id="projectalign" style="padding-left: 0.5em;">
22    <div id="projectname">libsigc++
23    &#160;<span id="projectnumber">2.10.8</span>
24    </div>
25   </td>
26  </tr>
27  </tbody>
28 </table>
29 </div>
30 <!-- end header part -->
31 <!-- Generated by Doxygen 1.9.1 -->
32 <script type="text/javascript" src="menudata.js"></script>
33 <script type="text/javascript" src="menu.js"></script>
34 <script type="text/javascript">
35 /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
36 $(function() {
37   initMenu('',false,false,'search.php','Search');
38 });
39 /* @license-end */</script>
40 <div id="main-nav"></div>
41 </div><!-- top -->
42 <div class="PageDoc"><div class="header">
43   <div class="headertitle">
44 <div class="title">libsigc++ Reference Manual </div>  </div>
45 </div><!--header-->
46 <div class="contents">
47 <div class="textblock"><h1><a class="anchor" id="description"></a>
48 Description</h1>
49 <p>libsigc++ provides a typesafe (at compile time) callback system for standard C++. It allows you to define signals and to connect those signals to any callback function, either a global or a member function, regardless of whether it is static or virtual. It also contains adaptor classes for connection of dissimilar callbacks.</p>
50 <p>For instance, see the <a class="el" href="group__signal.html">Signals</a>, <a class="el" href="group__sigcfunctors.html">Functors</a>, <a class="el" href="group__slot.html">Slots</a> and <a class="el" href="group__adaptors.html">Adaptors</a>.</p>
51 <p>See also the <a href="https://developer.gnome.org/libsigc++-tutorial/2.10/">libsigc++ tutorial</a>, the <a href="https://libsigcplusplus.github.io/libsigcplusplus/">libsigc++ website</a>, and the <a href="https://developer.gnome.org/gtkmm-tutorial/3.24/chapter-signals.html">Signals appendix of the Programming with gtkmm book</a>.</p>
52 <h1><a class="anchor" id="features"></a>
53 Features</h1>
54 <ul>
55 <li>Compile-time typesafe callbacks (also faster than run time checks)</li>
56 <li>Type-safety violations report the line number correctly with template names (no tracing template failures into headers)</li>
57 <li>No compiler extensions or meta compilers required</li>
58 <li>Proper handling of dynamic objects and signals (deleted objects will not cause crashes)</li>
59 <li>Extendable API at any level: signal, slot, connection and trackable</li>
60 <li>Extensions do not require alteration of basic components</li>
61 <li>User-definable accumulators</li>
62 <li>A variety of adaptors to change the callback signature: bind, hide, retype, and compose</li>
63 </ul>
64 <h1><a class="anchor" id="basics"></a>
65 Basic Usage</h1>
66 <p>Include the libsigc++ header: </p><div class="fragment"><div class="line"><span class="preprocessor">#include &lt;sigc++/sigc++.h&gt;</span></div>
67 </div><!-- fragment --><p> (You may include individual headers, such as <code>sigc++/bind</code>.h instead.)</p>
68 <p>If your source file is <code>program.cc</code>, you can compile it with: </p><div class="fragment"><div class="line">g++ program.cc -o program `pkg-config --cflags --libs <a class="code" href="namespacesigc.html">sigc</a>++-2.0`</div>
69 <div class="ttc" id="anamespacesigc_html"><div class="ttname"><a href="namespacesigc.html">sigc</a></div><div class="ttdoc">The libsigc++ namespace.</div><div class="ttdef"><b>Definition:</b> limit_reference.h:12</div></div>
70 </div><!-- fragment --><p> If your version of g++ is not C++11-compliant by default, add the <code>-std=c++11</code> option.</p>
71 <h2><a class="anchor" id="meson"></a>
72 Using Meson</h2>
73 <p>If using <a href="https://mesonbuild.com/">Meson</a>, include the following in <code>meson.build:</code> </p><div class="fragment"><div class="line">sigc_dep = dependency(<span class="stringliteral">&#39;sigc++-2.0&#39;</span>)</div>
74 <div class="line">program_name = &#39;program&#39;</div>
75 <div class="line">cpp_sources = [ &#39;program.cc&#39; ]</div>
76 <div class="line">executable(program_name,</div>
77 <div class="line">  cpp_sources,</div>
78 <div class="line">  dependencies: sigc_dep</div>
79 <div class="line">)</div>
80 </div><!-- fragment --><p>Your <code>dependencies:</code> keyword argument should also mention any other libraries that you need to use.</p>
81 <h2><a class="anchor" id="autotools"></a>
82 Using Autotools</h2>
83 <p>Alternatively, if using autoconf, use the following in <code>configure.ac:</code> </p><div class="fragment"><div class="line">PKG_CHECK_MODULES([DEPS], [<a class="code" href="namespacesigc.html">sigc</a>++-2.0])</div>
84 </div><!-- fragment --><p> Then use the generated <code>DEPS_CFLAGS</code> and <code>DEPS_LIBS</code> variables in the project <code>Makefile.am</code> files. For example: </p><div class="fragment"><div class="line">yourprogram_CPPFLAGS = $(DEPS_CFLAGS)</div>
85 <div class="line">yourprogram_LDADD = $(DEPS_LIBS)</div>
86 </div><!-- fragment --><p>Your <code>PKG_CHECK_MODULES()</code> call should also mention any other libraries that you need to use via pkg-config.</p>
87 <h2><a class="anchor" id="cmake"></a>
88 Using CMake</h2>
89 <p>If using CMake, use the following in <code>CMakeList.txt:</code> </p><div class="fragment"><div class="line">include(FindPkgConfig)</div>
90 <div class="line">pkg_check_modules(DEPS REQUIRED <a class="code" href="namespacesigc.html">sigc</a>++-2.0)</div>
91 <div class="line">include_directories(${DEPS_INCLUDE_DIRS})</div>
92 <div class="line">target_link_libraries(yourprogram ${DEPS_LIBRARIES})</div>
93 </div><!-- fragment --><p>Your <code>pkg_check_modules()</code> call should also mention any other libraries that you need to use via pkg-config.</p>
94 <h1><a class="anchor" id="scope"></a>
95 Scope of Documentation</h1>
96 <p>libsigc++ contains many template functions and template classes/structs, some with many specializations. This reference manual does not show all specializations of those templates that hardly any user will use directly. </p>
97 </div></div><!-- PageDoc -->
98 </div><!-- contents -->
99 <!-- start footer part -->
100 <hr class="footer"/><address class="footer"><small>
101 Generated on Fri Feb 11 2022 15:40:59 for libsigc++ by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1
102 </small></address>
103 </body>
104 </html>