/[hurd]/hurd/hurd/console.h
ViewVC logotype

Diff of /hurd/hurd/console.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.5 by marcus, Mon Sep 16 02:48:56 2002 UTC revision 1.6 by marcus, Wed Sep 18 17:31:54 2002 UTC
# Line 92  struct cons_display Line 92  struct cons_display
92                                     bits define the age, upper 16 bits                                     bits define the age, upper 16 bits
93                                     the major version.  */                                     the major version.  */
94    
95    
96    /* Various one bit flags that don't deserve their own field.  */    /* Various one bit flags that don't deserve their own field.  */
97  #define CONS_FLAGS_SCROLL_LOCK 0x00000001  
98      /* The output is stopped.  The client can display the status of this
99         flag, but should not otherwise interpret it.  */
100    #define CONS_FLAGS_SCROLL_LOCK  0x00000001
101    
102      /* Tracking mouse events is requested.  See CONS_MOUSE_* macros
103         further down.  */
104    #define CONS_FLAGS_TRACK_MOUSE  0x00000002
105    
106    uint32_t flags;    uint32_t flags;
107    
108    
109    struct    struct
110    {    {
111      uint32_t width;     /* Width of screen matrix.  */      uint32_t width;     /* Width of screen matrix.  */
# Line 257  struct cons_display Line 267  struct cons_display
267  #define CONS_KEY_PPAGE          "\e[5~"         /* Previous page.  */  #define CONS_KEY_PPAGE          "\e[5~"         /* Previous page.  */
268  #define CONS_KEY_NPAGE          "\e[6~"         /* Next page.  */  #define CONS_KEY_NPAGE          "\e[6~"         /* Next page.  */
269  #define CONS_KEY_BTAB           "\e[Z"          /* Back tab key.  */  #define CONS_KEY_BTAB           "\e[Z"          /* Back tab key.  */
270    #define CONS_KEY_B2             "\e[G"          /* Center of keypad.  */
271    
272    /* Mouse support is compatible to xterm's mouse tracking feature.  */
273    
274    #define CONS_MOUSE_BUTTON_MASK  0x03
275    #define CONS_MOUSE_BUTTON1      0x00
276    #define CONS_MOUSE_BUTTON2      0x01
277    #define CONS_MOUSE_BUTTON3      0x02
278    #define CONS_MOUSE_RELEASE      0x03
279    #define CONS_MOUSE_MOD_MASK     0x1c
280    #define CONS_MOUSE_MOD_SHIFT    0x04
281    #define CONS_MOUSE_MOD_META     0x08
282    #define CONS_MOUSE_MOD_CTRL     0x10
283    
284    /* Screen positions are offset by this value.  */
285    #define CONS_MOUSE_OFFSET_BASE  0x21
286    
287    #define CONS_MOUSE_EVENT_LENGTH 6
288    #define CONS_MOUSE_EVENT_PREFIX "\e[M"
289    
290    /* This macro populates STR with the mouse event EVENT at position X
291       and Y, and returns 1 if successul and 0 if X or Y is out of
292       range.  X and Y start from 0.  */
293    #define CONS_MOUSE_EVENT(str,event,x,y)                                 \
294      (((int)(x) < 0 || (int)(x) + CONS_MOUSE_OFFSET_BASE > 255             \
295       || (int)(y) < 0 || (int)(y) + CONS_MOUSE_OFFSET_BASE > 255) ? 0      \
296       : ((*(str) = CONS_MOUSE_EVENT_PREFIX[0]),                            \
297         (*((str) + 1) = CONS_MOUSE_EVENT_PREFIX[1]),                       \
298         (*((str) + 2) = CONS_MOUSE_EVENT_PREFIX[2]),                       \
299         (*((str) + 3) = (char)((int)(event) + CONS_MOUSE_OFFSET_BASE)),    \
300         (*((str) + 4) = (char)((int)(x) + CONS_MOUSE_OFFSET_BASE)),        \
301         (*((str) + 5) = (char)((int)(y) + CONS_MOUSE_OFFSET_BASE), 1)))
302    
303  #endif  /* _HURD_CONSOLE_H */  #endif  /* _HURD_CONSOLE_H */

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26