home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 15 / 15.iso / s / s053 / 9.ddi / usr / include / sys / xque.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-12-08  |  2.4 KB  |  77 lines

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