summaryrefslogtreecommitdiff
path: root/Ivy/IvyCallback.h
diff options
context:
space:
mode:
Diffstat (limited to 'Ivy/IvyCallback.h')
-rw-r--r--Ivy/IvyCallback.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/Ivy/IvyCallback.h b/Ivy/IvyCallback.h
index 68b286a..25368f0 100644
--- a/Ivy/IvyCallback.h
+++ b/Ivy/IvyCallback.h
@@ -19,22 +19,24 @@ public:
};
class IvyMessageCallbackFunction: public IvyMessageCallback {
public:
- typedef void ( *IvyMessageCallback_fun )( IvyApplication *app, int argc, const char **argv );
+ typedef void ( *IvyMessageCallback_fun )( IvyApplication *app, void *user_data, int argc, const char **argv );
IvyMessageCallback_fun MessageCb;
+ void *data;
public:
- IvyMessageCallbackFunction ( IvyMessageCallback_fun m_cb ) : MessageCb( m_cb )
+ IvyMessageCallbackFunction ( IvyMessageCallback_fun m_cb, void *udata = NULL ) : MessageCb( m_cb )
{
+ data = udata;
}
~IvyMessageCallbackFunction ()
{
}
void OnMessage (IvyApplication *app, int argc, const char **argv)
{
- (*MessageCb) (app, argc, argv);
+ (*MessageCb) (app, data, argc, argv);
}
/* raccourci d'ecriture */
-#define BUS_CALLBACK( m ) new IvyMessageCallbackFunction( m )
+#define BUS_CALLBACK( m , d ) new IvyMessageCallbackFunction( m, d )
};
/* template Class Callback for the normal bus Message */
template <class T> class IvyMessageCallbackOf : public IvyMessageCallback {