1 #ifndef __LIBSIG_COMP_H
2 #define __LIBSIG_COMP_H
4 #include <sigc++/sigc++.h>
5 #include <sigc++/bind.h>
7 #ifdef SIGC_CXX_NAMESPACES
11 #define CONNECT(SENDER, EMPFAENGER) SENDER.connect(slot(*this, &EMPFAENGER))
12 // use this Makro to connect with a method
13 // void bla::foo(int x);
15 // Signal<void, int> testSig;
17 // CONNECT(testSig, bla::foo);
18 // signal and method (slot) must have the same signature
20 #define CONNECT_1_0(SENDER, EMPFAENGER, PARAM) SENDER.connect( bind( slot(*this, &EMPFAENGER) ,PARAM ) )
21 // use this for connect with a method
22 // void bla::foo(int);
24 // Signal0<void> testSig;
25 // CONNECT_1_0(testSig, bla:foo, 0);
26 // here the signal has no parameter, but the slot have an int
27 // the last parameter of the CONNECT_1_0 makro is the value that given to the paramater of the Slot method
29 #define CONNECT_2_0(SENDER, EMPFAENGER, PARAM1, PARAM2) SENDER.connect( bind( slot(*this, &EMPFAENGER) ,PARAM1, PARAM2 ) )
31 #define CONNECT_2_1(SENDER, EMPFAENGER, PARAM) SENDER.connect( bind( slot(*this, &EMPFAENGER) ,PARAM ) )
33 #endif // __LIBSIG_COMP_H