From 62aca5b9f103f6b8a12e2c1925abb02caa946907 Mon Sep 17 00:00:00 2001 From: fcolin Date: Thu, 1 Feb 2007 13:03:24 +0000 Subject: Utilisateur : Fcolin Date : 1/06/06 Heure : 10:14 Archivé dans $/Bus/Ivy Commentaire: ajout Binding Callback et SetFilter (vss 13) --- Ivy/IvySynchroWnd.cxx | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) (limited to 'Ivy') diff --git a/Ivy/IvySynchroWnd.cxx b/Ivy/IvySynchroWnd.cxx index 9df473a..2109a61 100644 --- a/Ivy/IvySynchroWnd.cxx +++ b/Ivy/IvySynchroWnd.cxx @@ -187,4 +187,57 @@ void IvySynchronousApplicationCallback::CallCallback() target->OnApplicationDisconnected( app ); break; } +} + + +IvySynchronousBindingCallback::IvySynchronousBindingCallback( IvyBindingCallback *cb ) +{ + target = cb; +} +void IvySynchronousBindingCallback::OnAddBind( IvyApplication *app, int id, const char *regexp) +{ + // duplicate on the Message Queue + IvySynchronousBindingCallback *param = new IvySynchronousBindingCallback(target); + param->type = ADD_CB; + param->app = app; + param->id = id; + param->regexp = _strdup(regexp); + m_synchro->PostIvyCB( param ); +} + +void IvySynchronousBindingCallback::OnRemoveBind( IvyApplication *app, int id, const char *regexp) +{ + // duplicate on the Message Queue + IvySynchronousBindingCallback *param = new IvySynchronousBindingCallback(target); + param->type = REMOVE_CB; + param->app = app; + param->id = id; + param->regexp = _strdup(regexp); + m_synchro->PostIvyCB( param ); +} +void IvySynchronousBindingCallback::OnFilterBind( IvyApplication *app, int id, const char *regexp) +{ + // duplicate on the Message Queue + IvySynchronousBindingCallback *param = new IvySynchronousBindingCallback(target); + param->type = FILTER_CB; + param->app = app; + param->id = id; + param->regexp = _strdup(regexp); + m_synchro->PostIvyCB( param ); +} +void IvySynchronousBindingCallback::CallCallback() +{ + switch ( type ) + { + case ADD_CB: + target->OnAddBind( app, id, regexp ); + break; + case REMOVE_CB: + target->OnRemoveBind( app, id, regexp ); + break; + case FILTER_CB: + target->OnFilterBind( app, id, regexp ); + break; + } + delete regexp; } \ No newline at end of file -- cgit v1.1