source: golgotha/src/i4/time/timedev.hh @ 80

Last change on this file since 80 was 80, checked in by Sam Hocevar, 12 years ago
  • Adding the Golgotha source code. Not sure what's going to be interesting in there, but since it's all public domain, there's certainly stuff to pick up.
File size: 1.8 KB
RevLine 
[80]1/********************************************************************** <BR>
2  This file is part of Crack dot Com's free source code release of
3  Golgotha. <a href="http://www.crack.com/golgotha_release"> <BR> for
4  information about compiling & licensing issues visit this URL</a>
5  <PRE> If that doesn't help, contact Jonathan Clark at
6  golgotha_source@usa.net (Subject should have "GOLG" in it)
7***********************************************************************/
8
9#ifndef __TIMEDEV_HPP_
10#define __TIMEDEV_HPP_
11
12
13
14
15#include "device/device.hh"
16#include "time/time.hh"
17class i4_event_handler_class;
18class i4_event;
19
20
21class i4_time_device_class : public i4_device_class
22{
23
24
25public:
26#ifdef _WINDOWS
27  void callback(w32 id);
28#endif
29
30 
31  class timed_event
32  {
33  public:
34    i4_event_handler_class *send_to;
35    i4_event *event;
36    i4_time_class start_time;
37    w32 milli_wait;
38    w32 win32_timer_id;
39    timed_event *next;
40    timed_event(i4_event_handler_class *send_to, i4_event *event, w32 milli_wait);
41    ~timed_event();
42  } ;
43
44 
45  class id
46  {
47  public:
48    timed_event *reference;
49    id(timed_event *reference) : reference(reference) {}
50    id() { reference=0; }
51  } ;
52
53
54  id request_event(i4_event_handler_class *send_to,   // who to send the event to
55      i4_event *event,                                // what event to send
56      w32 milli_wait);                   // how much time to wait until sending (in milli-seconds)
57
58  i4_bool cancel_event(const id &handle);
59   
60  virtual i4_bool process_events();       // returns true if an event was dispatched
61  virtual char *name() { return "Time Device"; }
62  virtual device_flags reports_events() { return 0; }  // doesn't not report common events
63} ;
64
65extern i4_time_device_class i4_time_dev;
66
67
68#endif
Note: See TracBrowser for help on using the repository browser.