Imported Upstream version 2.99.2
[platform/upstream/libsigc++.git] / docs / reference / html / index.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://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.8.9.1"/>
7 <title>libsigc++: libsigc++ Reference Manual</title>
8 <link href="tabs.css" rel="stylesheet" type="text/css"/>
9 <script type="text/javascript" src="jquery.js"></script>
10 <script type="text/javascript" src="dynsections.js"></script>
11 <link href="doxygen.css" rel="stylesheet" type="text/css" />
12 <link href="doxygen-extra.css" rel="stylesheet" type="text/css"/>
13 </head>
14 <body>
15 <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
16 <div id="titlearea">
17 <table cellspacing="0" cellpadding="0">
18  <tbody>
19  <tr style="height: 56px;">
20   <td style="padding-left: 0.5em;">
21    <div id="projectname">libsigc++
22    &#160;<span id="projectnumber">2.99.2</span>
23    </div>
24   </td>
25  </tr>
26  </tbody>
27 </table>
28 </div>
29 <!-- end header part -->
30 <!-- Generated by Doxygen 1.8.9.1 -->
31   <div id="navrow1" class="tabs">
32     <ul class="tablist">
33       <li class="current"><a href="index.html"><span>Main&#160;Page</span></a></li>
34       <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
35       <li><a href="modules.html"><span>Modules</span></a></li>
36       <li><a href="namespaces.html"><span>Namespaces</span></a></li>
37       <li><a href="annotated.html"><span>Classes</span></a></li>
38     </ul>
39   </div>
40 </div><!-- top -->
41 <div class="header">
42   <div class="headertitle">
43 <div class="title">libsigc++ Reference Manual </div>  </div>
44 </div><!--header-->
45 <div class="contents">
46 <div class="textblock"><h1><a class="anchor" id="description"></a>
47 Description</h1>
48 <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>
49 <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>
50 <p>See also the <a href="http://libsigc.sourceforge.net/libsigc2/docs/manual/html/index.html">libsigc++ tutorial</a>, the <a href="http://libsigc.sourceforge.net/">libsigc++ website</a>, and the <a href="http://library.gnome.org/devel/gtkmm-tutorial/unstable/chapter-signals.html">Signals appendix of the Programming with gtkmm book</a>.</p>
51 <h1><a class="anchor" id="features"></a>
52 Features</h1>
53 <ul>
54 <li>Compile-time typesafe callbacks (also faster than run time checks)</li>
55 <li>Type-safety violations report the line number correctly with template names (no tracing template failures into headers)</li>
56 <li>No compiler extensions or meta compilers required</li>
57 <li>Proper handling of dynamic objects and signals (deleted objects will not cause crashes)</li>
58 <li>Extendable API at any level: signal, slot, connection and trackable</li>
59 <li>Extensions do not require alteration of basic components</li>
60 <li>User-definable accumulators</li>
61 <li>A variety of adaptors to change the callback signature: bind, hide, retype, and compose</li>
62 </ul>
63 <h1><a class="anchor" id="basics"></a>
64 Basic Usage</h1>
65 <p>Include the libsigc++ header: </p><div class="fragment"><div class="line"><span class="preprocessor">#include &lt;sigc++/sigc++.h&gt;</span></div>
66 </div><!-- fragment --><p> (You may include individual headers, such as <code>sigc++/bind</code>.h instead.)</p>
67 <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>++-3.0`</div>
68 </div><!-- fragment --><h2><a class="anchor" id="autotools"></a>
69 Using Autotools</h2>
70 <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>++-3.0])</div>
71 </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>
72 <div class="line">yourprogram_LDADD = $(DEPS_LIBS)</div>
73 </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>
74 <h2><a class="anchor" id="cmake"></a>
75 Using CMake</h2>
76 <p>If using CMake, use the following in <code>CMakeList.txt:</code> </p><div class="fragment"><div class="line">include(FindPkgConfig)</div>
77 <div class="line">pkg_check_modules(DEPS REQUIRED <a class="code" href="namespacesigc.html">sigc</a>++-3.0)</div>
78 <div class="line">include_directories(${DEPS_INCLUDE_DIRS})</div>
79 <div class="line">target_link_libraries(yourprogram ${DEPS_LIBRARIES})</div>
80 </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>
81 <h1><a class="anchor" id="scope"></a>
82 Scope of Documentation</h1>
83 <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>
84 </div></div><!-- contents -->
85 <!-- start footer part -->
86 <hr class="footer"/><address class="footer"><small>
87 Generated on Wed Mar 16 2016 20:53:28 for libsigc++ by &#160;<a href="http://www.doxygen.org/index.html">
88 <img class="footer" src="doxygen.png" alt="doxygen"/>
89 </a> 1.8.9.1
90 </small></address>
91 </body>
92 </html>