summaryrefslogtreecommitdiff
path: root/ivyqtloop.h
diff options
context:
space:
mode:
authorbustico2011-01-25 16:27:07 +0000
committerbustico2011-01-25 16:27:07 +0000
commit018db51fa49c2761516f4377a4958a2ce5b91fe3 (patch)
tree5c6624c3f88148bc1c9941c7aa5d0eedd7bef320 /ivyqtloop.h
parentc55fdd5c11903b4a7f8d706f7065997410c154c7 (diff)
downloadivy-cplusplus-018db51fa49c2761516f4377a4958a2ce5b91fe3.zip
ivy-cplusplus-018db51fa49c2761516f4377a4958a2ce5b91fe3.tar.gz
ivy-cplusplus-018db51fa49c2761516f4377a4958a2ce5b91fe3.tar.bz2
ivy-cplusplus-018db51fa49c2761516f4377a4958a2ce5b91fe3.tar.xz
-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
Diffstat (limited to 'ivyqtloop.h')
-rw-r--r--ivyqtloop.h67
1 files changed, 67 insertions, 0 deletions
diff --git a/ivyqtloop.h b/ivyqtloop.h
new file mode 100644
index 0000000..360efc6
--- /dev/null
+++ b/ivyqtloop.h
@@ -0,0 +1,67 @@
+/*
+ * Ivy, C interface
+ *
+ * Copyright (C) 1997-2000
+ * Centre d'Études de la Navigation Aérienne
+ *
+ * Main loop based on the QT Toolkit (troltech)
+ *
+ * Authors: Alexandre Bustico
+ *
+ *
+ * $Id: ivyqtloop.h 1231 2011-01-11 16:34:15Z bustico $
+ *
+ * Please refer to file version.h for the
+ * copyright notice regarding this software
+ */
+
+#ifndef IVYQTLOOP_H
+#define IVYQTLOOP_H
+
+using namespace std;
+
+#include <Qt/qsocketnotifier.h>
+#include "Ivy/ivychannel.h"
+
+
+
+class IvyQt;
+
+struct _channel {
+ IvyQt *ivyQt;
+
+ int fd;
+ void *data;
+ ChannelHandleDelete handle_delete;
+ ChannelHandleRead handle_read;
+ ChannelHandleWrite handle_write;
+};
+
+class IvyQt : public QObject {
+ Q_OBJECT
+public:
+ IvyQt(struct _channel *chan, QObject *parent=0);
+ ~IvyQt();
+
+private slots:
+ void ivyRead (int);
+ void ivyWrite (int);
+ void ivyDelete (int);
+
+
+private:
+ struct _channel *channel;
+ QSocketNotifier* id_read;
+ QSocketNotifier* id_write;
+ QSocketNotifier* id_delete;
+
+public:
+ void startNotifiersRead ();
+ void startNotifiersWrite ();
+ void removeNotifiersRead ();
+ void removeNotifiersWrite ();
+};
+
+#endif // IVYQTLOOP_H
+
+