summaryrefslogtreecommitdiff
path: root/ivyqtloop.h
blob: 360efc64230613796845e8175157c4da75f8eff9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
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