home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0010 - 0019 / ibm0010-0019 / ibm0010.tar / ibm0010 / UNIX3862.ZIP / U386-06.ZIP / U386-6.TD0 / usr / include / sys / xque.h < prev    next >
Encoding:
C/C++ Source or Header  |  1988-06-26  |  2.4 KB  |  75 lines

  1. /*    Copyright (c) 1984, 1986, 1987, 1988 AT&T    */
  2. /*      All Rights Reserved      */
  3.  
  4. /*    THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T    */
  5. /*    The copyright notice above does not evidence any       */
  6. /*    actual or intended publication of such source code.    */
  7.  
  8. /*    Copyright (c) 1987, 1988 Microsoft Corporation    */
  9. /*      All Rights Reserved    */
  10.  
  11. /*    This Module contains Proprietary Information of Microsoft  */
  12. /*    Corporation and should be treated as Confidential.       */
  13.  
  14. #ident    "@(#)head.sys:xque.h    1.1.1.5"
  15.  
  16. /*
  17.  * Keyboard/mouse event queue entries
  18.  */
  19.  
  20. typedef struct xqEvent {
  21.     unchar    xq_type;    /* event type (see below) */
  22.     unchar    xq_code;    /* when xq_type is XQ_KEY, => scan code;
  23.                    when xq_type is XQ_MOTION or XQ_BUTTON, =>
  24.                     bit 0 clear if right button pushed;
  25.                     bit 1 clear if middle button pushed;
  26.                     bit 2 clear if left button pushed; */
  27.     char    xq_x;        /* delta x movement (mouse motion only) */
  28.     char    xq_y;        /* delta y movement (mouse motion only) */
  29.     time_t    xq_time;     /* event timestamp in "milliseconds" */
  30. } xqEvent;
  31.  
  32. /*    xq_type values        */
  33.  
  34. #define XQ_BUTTON    0    /* button state change only */
  35. #define XQ_MOTION    1    /* mouse movement (and maybe button change) */
  36. #define XQ_KEY        2    /* key pressed or released */
  37.  
  38. /*
  39.  * The event queue
  40.  */
  41.  
  42. typedef struct xqEventQueue {
  43.     char    xq_sigenable;    /* allow signal when queue becomes non-empty
  44.                    0 => don't send signals
  45.                    non-zero => send a signal if queue is empty
  46.                       and a new event is added */
  47.     int    xq_head;    /* index into queue of next event to be dequeued */
  48.     int    xq_tail;    /* index into queue of next event slot to be filled */
  49.     time_t    xq_curtime;    /* time in milliseconds since 1/1/70 GMT */
  50.     int    xq_size;    /* number of elements in xq_events array */
  51.     xqEvent    xq_events[1];    /* configurable-size array of events */
  52. } xqEventQueue;
  53.  
  54. #ifdef INKERNEL
  55.  
  56. /*
  57.  * The driver's private data structure to keep track of xqEventQueue
  58.  */
  59.  
  60. typedef struct xqInfo {
  61.     xqEventQueue    *xq_queue;    /* pointer to the xqEventQueue structure */
  62.     int    xq_ptail;    /* private copy of xq_tail */
  63.     int    xq_psize;    /* private copy of xq_size */
  64.     int    xq_signo;    /* signal number to send for xq_sigenable */
  65.     proc_t    *xq_proc;    /* pointer to x server process (for signalling) */
  66.     int    xq_pid;        /* process id of server process */
  67.     struct xqInfo    *xq_next,    /* next xqInfo structure in list */
  68.             *xq_prev;    /* previous xqInfo structure in list */
  69.     preg_t    *xq_preg;    /* region for mapping queue into user space */
  70. } xqInfo;
  71.  
  72. #endif
  73.  
  74. caddr_t xq_init();
  75.