From 018db51fa49c2761516f4377a4958a2ce5b91fe3 Mon Sep 17 00:00:00 2001 From: bustico Date: Tue, 25 Jan 2011 16:27:07 +0000 Subject: -add a Qt flavor of ivy c++ library -add testIvyQt to show how to use ivy-c++ with Qt -fix testIvyXt --Cette ligne, et les suivantes ci-dessous, seront ignorees-- D ivyprobe.c A + testIvyXt.cxx AM ivyqtloop.h M Ivycpp.h A ivyqtloop.cxx D testIvy.cxx M Ivy.cxx A ivy-c++.readme A testIvyQt.cxx M Makefile --- testIvy.cxx | 87 ------------------------------------------------------------- 1 file changed, 87 deletions(-) delete mode 100644 testIvy.cxx (limited to 'testIvy.cxx') diff --git a/testIvy.cxx b/testIvy.cxx deleted file mode 100644 index 53d83d8..0000000 --- a/testIvy.cxx +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Ivy probe - * - * Copyright (C) 1997-1999 - * Centre d'Études de la Navigation Aérienne - * - * Main and only file - * - * Authors: François-Régis Colin - * - * $Id$ - * - * Please refer to file version.h for the - * copyright notice regarding this software - */ - -#include -#include -#include - -#include -#include -#include -#include "Ivy.h" -#include "IvyApplication.h" - - -class IvyTest : public IvyApplicationCallback, public IvyMessageCallback { -public: - Ivy *bus; - void Start(); - void OnApplicationConnected(IvyApplication *app); - void OnApplicationDisconnected(IvyApplication *app); - void OnMessage(IvyApplication *app, int argc, const char **argv); - IvyTest(); -}; -IvyTest :: IvyTest() -{ -} -void IvyTest :: Start() -{ - bus = new Ivy( "TestIvy", "TestIvy READY", this ); - bus->BindMsg( "(.*)", this ); - bus->start(NULL); -} -void IvyTest :: OnMessage(IvyApplication *app, int argc, const char **argv) -{ - int i; - printf ("%s sent ",app->GetName()); - for (i = 0; i < argc; i++) - printf(" '%s'",argv[i]); - printf("\n"); -} -void IvyTest :: OnApplicationConnected (IvyApplication *app) -{ - const char *appname; - const char *host; - appname = app->GetName(); - host = app->GetHost(); - - printf("%s connected from %s\n", appname, host); - -} -void IvyTest :: OnApplicationDisconnected (IvyApplication *app) -{ - const char *appname; - const char *host; - appname = app->GetName (); - host = app->GetHost(); - - printf("%s disconnected from %s\n", appname, host); -} - -int main(int argc, char *argv[]) -{ - XtAppContext cntx = XtCreateApplicationContext(); - IvyTest test; - test.bus->setXtAppContext(cntx); - - test.Start(); - - XtAppMainLoop (cntx); - - return 0; -} - - -- cgit v1.1