summaryrefslogtreecommitdiff
path: root/comm/TkMultiplexer.h
blob: 5f970e23c6f5cc572178e716426af50411c2074c (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
/*
 *	Ivy League
 *
 *	Tk-based multiplexers/schedulers
 *
 *	Copyright 1996-2000
 *	Centre d'Etudes de la Navigation Aerienne (CENA)
 *
 *	code by Stephane Chatty
 *
 *	$Id$
 *
 */

#ifndef TkMultiplexer_H_
#define TkMultiplexer_H_

#include "Multiplexer.h"
#include "error.h"

/* taken from tcl7.0 and tk3.3 */
typedef struct Tk_TimerToken_ *Tk_TimerToken;
#ifndef _CLIENTDATA
#   ifdef __STDC__
    typedef void *ClientData;
#   else
    typedef int *ClientData;
#   endif /* __STDC__ */
#define _CLIENTDATA
#endif

class IvlTkMultiplexer : public IvlBaseMultiplexer {
private:
static	void	FireSignals (ClientData);
static	void	FireTimers (ClientData);

protected:
	bool	Active [NFILE];
	Tk_TimerToken	TimeOut;

	void	SetMasks (int, IOMODE);
	void	SetTimeOut (Millisecond);
	void	SuppressTimeOut ();
	void	AddSignalHook ();
	MPX_RES	Loop ();

public:
		IvlTkMultiplexer ();
		~IvlTkMultiplexer ();
};

#endif	/* TkMultiplexer_H_ */