#include <sig_proxies.h>
Public Member Functions | |
SignalProxy (Signal< Slot > *sig) | |
virtual ConnectionProxy | connect (Slot const &what) |
Connect slot to the signal. | |
virtual | ~SignalProxy () |
SignalProxy and friends are signal system for photonmm
SignalProxy can be used with C- widget without modifying the code as follows
typedef SigC::Slot2<long int, PhEvent_t*> CustomSlot;
...
static int ev_my_callback (PtWidget_t*, void* data, PtCallbackInfo_t* cbinfo) { // this part is mandatory CustomSlot* slot = (CustomSlot*) data; // extract actual arguments for the c++ handler form cbinfo.. on own.. // call C++ handler.. (void) (*slot) (cbinfo->reason, cbinfo->event); ... }
// derivation from SigC::Object is mandatory class C : public SigC::Object { public: void fun (long int, PhEvent_t*) { ... } } ... PtWidget_t* widget; C o; ... Sig::SignalProxy<CustomSlot> sig (new Sig::Callback<CustomSlot> (&ev_my_callback, widget, Cw_CB_MYCUSTOM_CALLBACK)); sig.connect (SigC::slot (&o, &C::fun)); ...
|
|
|
|
|
Connect slot to the signal.
|
Documentation for photonmm by Yakov <iakovz@gmail.com>.