From c35af9417286090f968d0eef9288fd00d2e736e8 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) --- Bus/Ivy/IvySynchroWnd.cxx | 53 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) (limited to 'Bus/Ivy/IvySynchroWnd.cxx') diff --git a/Bus/Ivy/IvySynchroWnd.cxx b/Bus/Ivy/IvySynchroWnd.cxx index 9df473a..2109a61 100644 --- a/Bus/Ivy/IvySynchroWnd.cxx +++ b/Bus/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