From fc2f5b2cd655f1391f2abda1b39e37cdec98a951 Mon Sep 17 00:00:00 2001 From: Felix Domke Date: Fri, 17 Oct 2003 15:35:43 +0000 Subject: Initial revision --- include/libsig_comp.h | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 include/libsig_comp.h (limited to 'include/libsig_comp.h') diff --git a/include/libsig_comp.h b/include/libsig_comp.h new file mode 100644 index 00000000..83550ed5 --- /dev/null +++ b/include/libsig_comp.h @@ -0,0 +1,33 @@ +#ifndef __LIBSIG_COMP_H +#define __LIBSIG_COMP_H + +#include +#include + +#ifdef SIGC_CXX_NAMESPACES +using namespace SigC; +#endif + +#define CONNECT(SENDER, EMPFAENGER) SENDER.connect(slot(*this, &EMPFAENGER)) +// use this Makro to connect with a method +// void bla::foo(int x); +// to an +// Signal testSig; +// +// CONNECT(testSig, bla::foo); +// signal and method (slot) must have the same signature + +#define CONNECT_1_0(SENDER, EMPFAENGER, PARAM) SENDER.connect( bind( slot(*this, &EMPFAENGER) ,PARAM ) ) +// use this for connect with a method +// void bla::foo(int); +// to an +// Signal0 testSig; +// CONNECT_1_0(testSig, bla:foo, 0); +// here the signal has no parameter, but the slot have an int +// the last parameter of the CONNECT_1_0 makro is the value that given to the paramater of the Slot method + +#define CONNECT_2_0(SENDER, EMPFAENGER, PARAM1, PARAM2) SENDER.connect( bind( slot(*this, &EMPFAENGER) ,PARAM1, PARAM2 ) ) + +#define CONNECT_2_1(SENDER, EMPFAENGER, PARAM) SENDER.connect( bind( slot(*this, &EMPFAENGER) ,PARAM ) ) + +#endif // __LIBSIG_COMP_H -- cgit v1.2.3