00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #if !defined( __EVENT_CODES )
00013 #define __EVENT_CODES
00014
00019
00020
00025 const int evMouseDown = 0x0001;
00026
00031 const int evMouseUp = 0x0002;
00032
00037 const int evMouseMove = 0x0004;
00038
00043 const int evMouseAuto = 0x0008;
00044
00049 const int evKeyDown = 0x0010;
00050
00055 const int evCommand = 0x0100;
00056
00061 const int evBroadcast = 0x0200;
00062
00063
00064
00069 const int evNothing = 0x0000;
00070
00075 const int evMouse = 0x000f;
00076
00081 const int evKeyboard = 0x0010;
00082
00087 const int evMessage = 0xFF00;
00088
00089
00090
00091 const int mbLeftButton = 0x01;
00092 const int mbRightButton = 0x02;
00093
00094
00095
00096 const int meMouseMoved = 0x01;
00097 const int meDoubleClick = 0x02;
00098
00099 #endif // __EVENT_CODES
00100
00101 #if defined( Uses_TEvent ) && !defined( __TEvent )
00102 #define __TEvent
00103
00114 struct MouseEventType
00115 {
00119 TPoint where;
00134 ulong eventFlags;
00158 ulong controlKeyState;
00182 uchar buttons;
00183 };
00184
00185 #include <myendian.h>
00186
00193 struct CharScanType
00194 {
00195 #if (BYTE_ORDER == LITTLE_ENDIAN)
00196
00203 uchar charCode;
00210 uchar scanCode;
00211 #elif (BYTE_ORDER == BIG_ENDIAN)
00212
00215 uchar scanCode;
00219 uchar charCode;
00220 #else
00221 #error architecture not supported by this library
00222 #endif
00223 };
00224
00239 struct KeyDownEvent
00240 {
00241 union
00242 {
00249 ushort keyCode;
00254 CharScanType charScan;
00255 };
00279 ulong controlKeyState;
00280 };
00281
00294 struct MessageEvent
00295 {
00303 ushort command;
00304 union
00305 {
00313 void *infoPtr;
00317 long infoLong;
00321 ushort infoWord;
00325 short infoInt;
00329 uchar infoByte;
00333 char infoChar;
00334 };
00335 };
00336
00349 struct TEvent
00350 {
00391 ushort what;
00392 union
00393 {
00397 MouseEventType mouse;
00401 KeyDownEvent keyDown;
00405 MessageEvent message;
00406 };
00407 };
00408
00409 #endif // Uses_TEvent
00410
00411 #if defined( Uses_TEventQueue ) && !defined( __TEventQueue )
00412 #define __TEventQueue
00413
00425 class TEventQueue
00426 {
00427 public:
00435 static ushort doubleDelay;
00440 static Boolean mouseReverse;
00441 };
00442
00443 #endif // Uses_TEventQueue
00444
00445 #if defined( Uses_TScreen ) && !defined( __TScreen )
00446 #define __TScreen
00447
00458 class TDisplay
00459 {
00460 public:
00466 enum videoModes
00467 {
00468 smBW80 = 0x0002,
00469 smCO80 = 0x0003,
00470 smMono = 0x0007,
00471 smFont8x8 = 0x0100
00472 };
00473 };
00474
00475 #include <sys/types.h>
00476
00489 class TScreen: public TDisplay
00490 {
00491 public:
00499 TScreen();
00505 ~TScreen();
00509 static void getEvent(TEvent &event);
00513 static void makeBeep();
00519 static void putEvent(TEvent &event);
00527 static void resume();
00535 static void suspend();
00541 static void drawCursor(int show);
00547 static void drawMouse(int show);
00553 static void moveCursor(int x, int y);
00561 static void writeRow(int dst, ushort *src, int len);
00569 static ushort screenMode;
00575 static uchar screenWidth;
00581 static uchar screenHeight;
00587 static ushort *screenBuffer;
00595 static fd_set fdSetRead;
00602 static fd_set fdSetWrite;
00609 static fd_set fdSetExcept;
00616 static fd_set fdActualRead;
00623 static fd_set fdActualWrite;
00630 static fd_set fdActualExcept;
00631 };
00632
00633 #endif // Uses_TScreen