home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / df3os2.zip / CURSOR.H < prev    next >
C/C++ Source or Header  |  1993-11-13  |  941b  |  48 lines

  1. // ------------- cursor.h
  2. //
  3. // modified for OS/2 operation - jw21sep93
  4.  
  5. #ifndef CURSOR_H
  6. #define CURSOR_H
  7.  
  8.  
  9. #define INCL_BASE
  10. #define INCL_NOPMAPI
  11. #include <os2.h>
  12.  
  13. const int MAXSAVES = 50;  // depth of cursor save/restore stack
  14.  
  15. class Cursor 
  16.     {
  17.     VIOCURSORINFO ci;
  18.  
  19.     // --- cursor save/restore stack
  20.     int  cursorpos[MAXSAVES];
  21.     int  cursorshape[MAXSAVES];
  22.     int  cs;                     // count of cursor saves in effect
  23.     void Cursor::GetCursor();
  24.  
  25. public:
  26.     Cursor();
  27.     ~Cursor();
  28.     void SetPosition(int x, int y);
  29.     void GetPosition(int &x, int &y);
  30.     void SetType(unsigned t);
  31.     void NormalCursor() { SetType(0x0607); }
  32.     void BoxCursor()    { SetType(0x0107); }
  33.     void Hide();
  34.     void Show();
  35.     void Save();
  36.     void Restore();
  37.     void SwapStack();
  38.     };
  39.  
  40. inline void swap(int& a, int& b)
  41.     {
  42.     int x = a;
  43.     a = b;
  44.     b = x;
  45.     }
  46.  
  47. #endif
  48.