home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / x / xibm.zip / common / ibmXQueue.h < prev    next >
C/C++ Source or Header  |  1991-09-20  |  3KB  |  104 lines

  1. /*
  2.  * $Id: ibmXQueue.h,v 1.1 1991/09/20 18:24:03 mtranle Exp $
  3.  *
  4.  * Copyright IBM Corporation 1987,1988,1989
  5.  *
  6.  * All Rights Reserved
  7.  *
  8.  * Permission to use, copy, modify, and distribute this software and its
  9.  * documentation for any purpose and without fee is hereby granted,
  10.  * provided that the above copyright notice appear in all copies and that 
  11.  * both that copyright notice and this permission notice appear in
  12.  * supporting documentation, and that the name of IBM not be
  13.  * used in advertising or publicity pertaining to distribution of the
  14.  * software without specific, written prior permission.
  15.  *
  16.  * IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  17.  * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  18.  * IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  19.  * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  20.  * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  21.  * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  22.  * SOFTWARE.
  23.  *
  24. */
  25.  
  26. /*
  27. * IBM -- Required Event Queue Structures
  28. * If your kernel doesn't give you this, you are in trouble.
  29. *
  30. * Event queue entries
  31. */
  32.  
  33. #ifndef _XQEVENT_
  34. #define _XQEVENT_
  35.  
  36. typedef struct _X_event {
  37.     unsigned short xe_x ; /* x position */
  38.     unsigned short xe_y ; /* y position */
  39. #ifndef i386
  40.     unsigned short xe_time ; /* 10 millisecond units (button only) */
  41. #else
  42.     long xe_time ; /* 1 millisecond units (button only) */
  43. #endif
  44.     unsigned char xe_type ; /* button or motion? */
  45.     unsigned char xe_key ; /* the key (button only) */
  46.     unsigned char xe_direction ; /* which direction (button only) */
  47.     unsigned char xe_device ; /* which device (button only) */
  48. } XEvent ;
  49.  
  50. /* xe_type field */
  51. #define XE_BUTTON 0 /* button moved */
  52. #define XE_MMOTION 1 /* mouse moved */
  53. #define XE_TMOTION 2 /* tablet moved */
  54.  
  55. /* xe_direction field */
  56. #define XE_KBTUP 0 /* up */
  57. #define XE_KBTDOWN 1 /* down */
  58. #define XE_KBTRAW 2 /* undetermined */
  59.  
  60. /* xe_device field */
  61. #define XE_MOUSE 1 /* mouse */
  62. #define XE_DKB 2 /* main keyboard */
  63. #define XE_TABLET 3 /* graphics tablet */
  64. #define XE_AUX 4 /* auxiliary */
  65. #define XE_CONSOLE 5 /* console */
  66.  
  67. /* The event queue */
  68.  
  69. typedef struct _X_eventqueue {
  70.     XEvent *events ; /* input event buffer */
  71.     int size ; /* size of event buffer */
  72.     int head ; /* index into events */
  73.     int tail ; /* index into events */
  74. } XEventQueue ;
  75.  
  76. /* mouse cursor position */
  77. typedef struct _X_cursor {
  78.     short x ;
  79.     short y ;
  80. } XCursor ;
  81.  
  82. /* mouse motion rectangle */
  83. typedef struct _X_box {
  84.     short bottom ;
  85.     short right ;
  86.     short left ;
  87.     short top ;
  88. } XBox ;
  89.  
  90. struct x_screen_size {
  91.     int x_x_min ; /* minimum x for mouse */
  92.     int x_y_min ; /* minimum y for mouse */
  93.     int x_x_max ; /* maximum x for mouse */
  94.     int x_y_max ; /* maximum y for mouse */
  95. } ;
  96.  
  97. struct x_softc {
  98.     struct x_screen_size x_size ; /* screen size for mouse tracking */
  99.     short x_cursor ; /* is the kernel cursor on or off */
  100.     short x_notrack ; /* can the kernel cursor be turned on */
  101. } ;
  102.  
  103. # endif _XQEVENT_
  104.