Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

wacom.h

Go to the documentation of this file.
00001 /*----------------------------------------------------------------------------
00002 
00003 NAME
00004 
00005    wacom.h -- Definition file for Wacom Symbols.
00006 
00007 
00008 COPYRIGHT
00009 
00010    Copyright WACOM Technologies, Inc. 1998
00011    All rights reserved.
00012 
00013 -----------------------------------------------------------------------------*/
00014 
00015 #ifndef __SDK_WACOM_H__
00016 #define __SDK_WACOM_H__
00017 
00018 
00019 #define  WACOM_NAME     "wacom"
00020 #define  WACOM_TYPE     "TABLET"
00021 
00022 /*
00023  * buttons...
00024  * For backward compatibility
00025  */
00026 #define WACOM_NUM_BUTTONS  16
00027 #define WAC_POINTER_BUTTON 1  /* default X button for stylus pres */
00028 #define WAC_BARREL_BUTTON  3  /* default X button for stylus button */
00029 #define WAC_ERASER_BUTTON  2  /* def button for eraser/second barrel switch */
00030 #define WAC_CHORDED_BUTTON 2  /* def button for tip + switch together */
00031 
00032 /*
00033  * Puck buttons
00034  */
00035 #define WAC_PUCK1_BUTTON   1  /* top center puck */
00036 #define WAC_PUCK2_BUTTON   0  /* left puck */
00037 #define WAC_PUCK3_BUTTON   3  /* bottom center puck */
00038 #define WAC_PUCK4_BUTTON   2  /* right puck */
00039 
00040 /*
00041  * Defines the data format for the X event queue.
00042  * Wacom sends up to 16 32-bit data values to the queue.
00043  * The WAC_*_I are indexes into that data.
00044  */
00045 #define WACOM_NUM_VALUATORS   16
00046 
00047 /*
00048  * First transducer valuators
00049  */
00050 #define WAC_XCOORD_I          0
00051 #define WAC_YCOORD_I          1
00052 #define WAC_PRESSURE_I        2
00053 #define WAC_BUTTON_I          3
00054 #define WAC_TRANSDUCER_I      4
00055 #define WAC_XTILT_I           5
00056 #define WAC_YTILT_I           6
00057 #define WAC_ZCOORD_I          7
00058 #define WAC_HEIGHT_I          WAC_ZCOORD_I
00059 
00060 /*
00061  * Second transducer valuators
00062  */
00063 #define WAC_2XCOORD_I         8
00064 #define WAC_2YCOORD_I         9
00065 
00066 /*
00067  * New information
00068  */
00069 #define WAC_TAN_PRESSURE_I    10
00070 #define WAC_ROTATION_I        11
00071 #define WAC_SERIAL_NUM_I      12
00072 
00073 /*
00074  * New second transducer information
00075  */
00076 #define WAC_2SERIAL_NUM_I     13
00077 #define WAC_2TRANSDUCER_I     14
00078 #define WAC_2BUTTON_I         15
00079 
00080 /*
00081  * Additional second transducer information
00082  * shared with first transducer
00083  * This data is not present unless the
00084  * "multimode new" ioctl is sent.
00085  */
00086 #define WAC_FIRST_MSK         0x0000ffff  /* extract above info. */
00087 #define WAC_SECOND_MSK        0xffff0000  /* extract above info. */
00088 #define WAC_SECOND_OFFSET     16
00089 
00090 #define WAC_2PRESSURE_I       WAC_PRESSURE_I
00091 #define WAC_2XTILT_I          WAC_XTILT_I
00092 #define WAC_2YTILT_I          WAC_YTILT_I
00093 #define WAC_2ZCOORD_I         WAC_ZCOORD_I
00094 #define WAC_2HEIGHT_I         WAC_2ZCOORD_I
00095 #define WAC_2TAN_PRESSURE_I   WAC_TAN_PRESSURE_I
00096 #define WAC_2ROTATION_I       WAC_ROTATION_I
00097 
00098 /*
00099  * Pointer event info
00100  */
00101 #define WACOM_NUM_PTR_AXIS    2
00102 #define WAC_XPTR_I            0
00103 #define WAC_YPTR_I            1
00104 
00105 /* 
00106  * WAC_BUTTON_I holds combination all active button bits from recent
00107  *  stylus, puck or menu.
00108  */
00109 #define WAC_BTN_STYLUS_MSK    0x001f      /* bitset of stylus buttons */
00110 #define WAC_BTN_PUCK_MSK      0x1f00      /* ordinal puck button */
00111 #define WAC_MENU_ITEM_MSK     0x001f0000  /* ordinal menu item */
00112 #define WAC_STYLUS_OFFSET     0
00113 #define WAC_PUCK_OFFSET       8
00114 #define WAC_MENU_OFFSET       16
00115 #define WAC_STYLUS_BUTTONS(x) (((x)&WAC_BTN_STYLUS_MSK)>>WAC_STYLUS_OFFSET)
00116 #define WAC_PUCK_BUTTONS(x)   (((x)&WAC_BTN_PUCK_MSK)>>WAC_PUCK_OFFSET)
00117 #define WAC_MENU_BUTTONS(x)   (((x)&WAC_MENU_ITEM_MSK)>>WAC_MENU_OFFSET)
00118 
00119 #define WACOM_NUM_MENU_BUTTONS   30 /* Unused -- rough limit */
00120 
00121 /*
00122  * Pointer identifiers for WAC_TRANSDUCER_I.
00123  */
00124 #define WAC_TRANSDUCER_ID_MSK    0xfff00  /* transducer ID mask, 12 bits */
00125 #define WAC_TRANSDUCER_MSK       0x7      /* transducer id msk */
00126 #define WAC_PUCK_ID              0x0      /* puck */
00127 #define WAC_STYLUS_ID            0x1      /* stylus pointer end */
00128 #define WAC_ERASER_ID            0x2      /* stylus eraser tip */
00129 #define WAC_MENU_ID              0x10     /* menu item; also get transducer */
00130 #define WAC_TRANSDUCER_PROX_MSK  0x8      /* 1 if in prox, 0 if not */
00131 #define WAC_TRANSDUCER_ID(x)     (((x) & WAC_TRANSDUCER_ID_MSK) >> 8)
00132 
00133 /*
00134  * Addenda for Xsgi driver
00135  */
00136 #define WAC_STYLUS_BUTTON_ID(x)     ((x)>>1)
00137 #define WAC_STYLUS_BUTTON_STATE(x)  ((x)&0x1)
00138 
00139 #define WAC_ROT_INTG_MSK   0xffc0
00140 #define WAC_ROT_FRAC_MSK   0x003f
00141 #define WAC_ROT_INTG_OFFSET   6
00142 #define WAC_ROT_FRAC_OFFSET   0
00143 #define WAC_ROTATION_INTG(x)  (((x)&WAC_ROT_INTG_MSK)>>WAC_ROT_INTG_OFFSET)
00144 #define WAC_ROTATION_FRAC(x)  (((x)&WAC_ROT_FRAC_MSK)>>WAC_ROT_FRAC_OFFSET)
00145 
00146 /* Values range from 0 to 360 degrees in 0.2 degree increments (angle defined
00147    wrt the vertical position of the cursor). */
00148 #define WAC_CURSOR_ROTATION(x)   ((x)*0.2)
00149 
00150 /*
00151  * Addenda for XFree driver
00152  */
00153 #define  WACOM_STYLUS_NAME "stylus"
00154 #define  WACOM_ERASER_NAME "eraser"
00155 #define  WACOM_CURSOR_NAME "cursor" /* Other name for PUCK device */
00156 
00157 #define WACOM_STYLUS_NUM_VALUATORS  6
00158 #define WACOM_ERASER_NUM_VALUATORS  6
00159 #define WACOM_CURSOR_NUM_VALUATORS  6
00160 
00161 #define WACOM_XCOORD_I     0
00162 #define WACOM_YCOORD_I     1
00163 #define WACOM_PRESSURE_I   2
00164 #define WACOM_XTILT_I      3
00165 #define WACOM_YTILT_I      4
00166 #define WACOM_ROTATION_I   WACOM_XTILT_I /* 4D mouse rotation */
00167 #define WACOM_WHEEL_I      5             /* 4D mouse thumbwheel */
00168 
00169 #define WACOM_STYLUS_BUTTON_ID(x)   ((x)>>2)
00170 #define WACOM_STYLUS_BUTTON_STATE(x)   (((x)>>1)&0x1)
00171 
00172 /* Values range from 0 to 180 degrees (clockwise) and from 0 to -180 degrees
00173    (counterclockwise) in 0.4 degree increments. */
00174 #define WACOM_CURSOR_ROTATION(x) ((x)*0.4)
00175 
00176 /* Wacom buttons. */
00177 #define WACOM_BUTTONS_UP      0
00178 
00179 /* Wacom stylus buttons. */
00180 #define WACOM_BOTTOM_BUTTON_DOWN 1
00181 #define WACOM_TOP_BUTTON_DOWN    2
00182 
00183 /* Wacom cursor buttons. */
00184 #define WACOM_TOP_LEFT_BUTTON_DOWN  2
00185 #define WACOM_TOP_MIDDLE_BUTTON_DOWN   4
00186 #define WACOM_TOP_RIGHT_BUTTON_DOWN 8
00187 #define WACOM_BOTTOM_RIGHT_BUTTON_DOWN 16
00188 #define WACOM_BOTTOM_LEFT_BUTTON_DOWN  32
00189 
00190 #endif /* __SDK_WACOM_H__ */

Generated on Mon Sep 18 11:39:34 2006 for jot by  doxygen 1.4.4