summaryrefslogtreecommitdiff
path: root/common/fltk_lines.hh
blob: 424ab827a0ea4507c93362cd0341855e0f053c3c (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
#ifndef __COMMON_FLTK_LINES_HH__
#define __COMMON_FLTK_LINES_HH__

#include "lines.hh"

namespace rtfl {

namespace common {

class FltkLinesSource: public tools::FileLinesSource
{
   class TimeoutInfo: public lout::object::Object
   {
   private:
      FltkLinesSource *source;
      int type;

   public:
      TimeoutInfo (FltkLinesSource *source, int type);

      inline FltkLinesSource *getSource () { return source; }
      inline int getType () { return type; }
   };

   lout::container::typed::List<TimeoutInfo> *timeoutInfos;

   static void staticProcessInputCallback (int fd, void *data);
   static void timeoutCallback (void *data);
   void processInputCallback (int fd);

public:
   FltkLinesSource ();
   ~FltkLinesSource ();
   
   void setup (tools::LinesSink *sink);
   void addTimeout (double secs, int type);
   void removeTimeout (int type);
};


class FltkDefaultSource: public tools::LinesSourceSequence
{
public:
   FltkDefaultSource ();
};

   
} // namespace common

} // namespace rtfl

#endif // __COMMON_FLTK_LINES_HH__