diff options
Diffstat (limited to 'ivyqtloop.h')
-rw-r--r-- | ivyqtloop.h | 67 |
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 + + |