4 * $XConsortium: Notifier.hh /main/4 1996/04/21 19:42:50 drk $
6 * RESTRICTED CONFIDENTIAL INFORMATION:
8 * The information in this document is subject to special
9 * restrictions in a confidential disclosure agreement between
10 * HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
11 * document outside HP, IBM, Sun, USL, SCO, or Univel without
12 * Sun's specific written approval. This document and all copies
13 * and derivative works thereof must be returned or destroyed at
16 * Copyright 1993 Sun Microsystems, Inc. All rights reserved.
24 #include <X11/Intrinsic.h>
26 #include <DtMail/DtMailTypes.h>
27 #include <DtMail/DtVirtArray.hh>
28 #include <DtMail/HashTable.hh>
33 virtual ~NotifyEvent(void);
35 virtual void eventTriggered(void); // PURE VIRTUAL
40 Notifier(XtAppContext);
41 virtual ~Notifier(void);
43 void notify(NotifyEvent & event,
44 DtMailBoolean fast_path = DTM_FALSE);
46 typedef void * IntervalId;
47 IntervalId addInterval(int interval_ms,
48 DtMailBoolean multi_shot,
50 void removeInterval(IntervalId id);
52 void signalEvent(int sig, NotifyEvent & event);
53 void removeSignal(int sig);
57 DtVirtArray<NotifyEvent *> _events;
62 class EventKey : public ObjectKey {
67 virtual int operator==(ObjectKey &);
68 virtual int operator!=(ObjectKey &);
69 virtual int operator<(ObjectKey &);
70 virtual int operator>(ObjectKey &);
71 virtual int operator<=(ObjectKey &);
72 virtual int operator>=(ObjectKey &);
74 virtual HashVal hashValue(void);
76 void * keyValue(void) { return _key; }
83 DtMailBoolean multi_shot;
88 HashTable<TimerEvent *> _timer_events;
90 XtAppContext _context;
93 static void eventProc(XtPointer client_data, int * fd, XtInputId *);
94 static void timerProc(XtPointer, XtIntervalId *);
96 static int deleteTimerEvent(ObjectKey &, TimerEvent *, void *);
99 TimerEvent * srch_event;
102 static int searchTimer(ObjectKey &, TimerEvent *, void *);