home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / jove-4.16-src.tgz / tar.out / bsd / jove / xjove / mousemsg.h < prev    next >
Text File  |  1996-09-28  |  3KB  |  98 lines

  1. /***************************************************************************
  2.  * This program is Copyright (C) 1991-1996 by C.H.Lindsey, University of   *
  3.  * Manchester.  (X)JOVETOOL is provided to you without charge, and with no *
  4.  * warranty.  You may give away copies of (X)JOVETOOL, including sources,  *
  5.  * provided that this notice is included in all the files, except insofar  *
  6.  * as a more specific copyright notices attaches to the file (x)jovetool.c *
  7.  ***************************************************************************/
  8.  
  9. /* JoveTool/XJove Mouse Message Format
  10.  *
  11.  * Mouse button events become:
  12.  *    ^XmC(button-state x-col y-line font-width)
  13.  * or (if the mouse has not moved):
  14.  *    ^XmC(button-state)
  15.  *
  16.  * - C is an eventcode, a single character describing what has just
  17.  *   happened to the mouse.
  18.  * - button-state is a decimal numeral (mostly) describing the current
  19.  *   state of the buttons and shifts.
  20.  * - x-col is a decimal numeral reporting the horizontal PIXEL column
  21.  *   containing the mouse pointer.  The leftmost column is numbered 0.
  22.  * - y-col is a decimal numeral reporting the vertical CHARACTER row
  23.  *   containing the mouse pointer.  The top row is numbered 1.
  24.  * - font-width is a decimal numeral reporting the width of each character
  25.  *   in pixels (the font must be fixed pitch).  This allows the conversion
  26.  *   of x-col to characters.
  27.  */
  28.  
  29. /* Event Code
  30.  *
  31.  * Code for the current event in mouse_code (left/middle/right).
  32.  * It is encoded as a single decimal digit, in ASCII.
  33.  * Note: right-button events won't get passed to child, so there
  34.  * is no need to encode the digits 10 to 14.
  35.  * This code is intended to be used to select the desired JOVE command,
  36.  * via the key-binding mechanism.
  37.  *
  38.  * 0/5/10 down
  39.  * 1/6/11 double-click down
  40.  * 2/7/12 triple-click down
  41.  * 3/8/13 release
  42.  * 4/9/14 drag with button down
  43.  */
  44.  
  45. #define    JTEC_LEFT    0
  46. #define    JTEC_MIDDLE    5
  47. #define    JTEC_RIGHT    10
  48.  
  49. #define    JTEC_DOWN    0
  50. #define    JTEC_CLICK2    1
  51. #define    JTEC_CLICK3    2
  52. #define    JTEC_UP        3
  53. #define    JTEC_DRAG    4
  54.  
  55. /* Button State
  56.  *
  57.  * The JT_LEFT, JT_MIDDLE, and JT_RIGHT are mutually exclusive,
  58.  * and indicate the last button that changed state.  Note that JT_RIGHT
  59.  * will not be seen by a client program since the right button is
  60.  * used internally for menu selection.
  61.  *
  62.  * JT_SHIFT and JT_CONTROL indicate the state of these shift keys
  63.  * at the time of the event.
  64.  *
  65.  * JT_CLICK2 and JT_CLICK3 indicate whether a button up or button down
  66.  * is part of a double or triple click.  Note that a multiclick down
  67.  * might be followed by a non-multiclick up (if the release is slow).
  68.  *
  69.  * JT_UPEVENT and JT_DRAGEVENT together indicate what kind of event
  70.  * just occurred: button down (neither on), button up, or a mouse
  71.  * movement while a button was depressed.
  72.  *
  73.  * JT_PASTE and JT_CUT indicate whether these keys were down
  74.  * at the time of the event.
  75.  */
  76.  
  77. #define JT_LEFT        00001
  78. #define JT_MIDDLE    00002
  79. #define JT_RIGHT    00004
  80. #define    JT_BUTMASK    (JT_LEFT | JT_MIDDLE | JT_RIGHT)
  81.  
  82. #define JT_SHIFT    00010
  83. #define JT_CONTROL    00020
  84. #define JT_CSMASK    (JT_SHIFT | JT_CONTROL)
  85.  
  86. #define JT_CLICK2    00040
  87. #define JT_CLICK3    00100
  88. #define    JT_CLICKMASK    (JT_CLICK2 | JT_CLICK3)
  89.  
  90. #define    JT_DOWNEVENT    00000
  91. #define JT_UPEVENT    00200
  92. #define JT_DRAGEVENT    00400
  93. #define    JT_EVENTMASK    (JT_UPEVENT | JT_DRAGEVENT)
  94.  
  95. #define JT_PASTE    01000
  96. #define JT_CUT        02000
  97. #define JT_PASTEMASK    (JT_PASTE | JT_CUT)
  98.