| Line | |
|---|
| 1 | #ifndef __OS2TIMER_H__
|
|---|
| 2 | #define __OS2TIMER_H__
|
|---|
| 3 | /*
|
|---|
| 4 | * OS/2 Timer class
|
|---|
| 5 | *
|
|---|
| 6 | * Copyright 1998 Sander van Leeuwen (sandervl@xs4all.nl)
|
|---|
| 7 | *
|
|---|
| 8 | * Project Odin Software License can be found in LICENSE.TXT
|
|---|
| 9 | *
|
|---|
| 10 | */
|
|---|
| 11 |
|
|---|
| 12 | #ifdef _OS2WIN_H
|
|---|
| 13 | #define HEV int
|
|---|
| 14 | #define HTIMER int
|
|---|
| 15 | #endif
|
|---|
| 16 |
|
|---|
| 17 | class OS2Timer
|
|---|
| 18 | {
|
|---|
| 19 | public:
|
|---|
| 20 | OS2Timer();
|
|---|
| 21 | ~OS2Timer();
|
|---|
| 22 |
|
|---|
| 23 | void TimerHandler();
|
|---|
| 24 | BOOL StartTimer(int period, int resolution, LPTIMECALLBACK lptc,
|
|---|
| 25 | int dwUser, int fuEvent);
|
|---|
| 26 | void StopTimer();
|
|---|
| 27 | void KillTimer();
|
|---|
| 28 |
|
|---|
| 29 | protected:
|
|---|
| 30 |
|
|---|
| 31 | private:
|
|---|
| 32 | HEV TimerSem;
|
|---|
| 33 | HTIMER TimerHandle;
|
|---|
| 34 | int TimerThreadID;
|
|---|
| 35 | LPTIMECALLBACK clientCallback;
|
|---|
| 36 | DWORD userData;
|
|---|
| 37 |
|
|---|
| 38 | BOOL fFatal;
|
|---|
| 39 | int TimerStatus;
|
|---|
| 40 | enum {
|
|---|
| 41 | InActive = 0,
|
|---|
| 42 | Running,
|
|---|
| 43 | Stopped
|
|---|
| 44 | };
|
|---|
| 45 | static int timerPeriod;
|
|---|
| 46 |
|
|---|
| 47 | // Linked list management
|
|---|
| 48 | OS2Timer* next; // Next Timer
|
|---|
| 49 | static OS2Timer* timers; // List of Timer
|
|---|
| 50 |
|
|---|
| 51 | };
|
|---|
| 52 |
|
|---|
| 53 | #endif
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.