1 /*  Copyright 1992 John Bovey, University of Kent at Canterbury.
2  *
3  *  Redistribution and use in source code and/or executable forms, with
4  *  or without modification, are permitted provided that the following
5  *  condition is met:
6  *
7  *  Any redistribution must retain the above copyright notice, this
8  *  condition and the following disclaimer, either as part of the
9  *  program source code included in the redistribution or in human-
10  *  readable materials provided with the redistribution.
11  *
12  *  THIS SOFTWARE IS PROVIDED "AS IS".  Any express or implied
13  *  warranties concerning this software are disclaimed by the copyright
14  *  holder to the fullest extent permitted by applicable law.  In no
15  *  event shall the copyright-holder be liable for any damages of any
16  *  kind, however caused and on any theory of liability, arising in any
17  *  way out of the use of, or inability to use, this software.
18  *
19  *  -------------------------------------------------------------------
20  *
21  *  In other words, do not misrepresent my work as your own work, and
22  *  do not sue me if it causes problems.  Feel free to do anything else
23  *  you wish with it.
24  */
25 
26 /* @(#)token.h	1.2 16/11/93 (UKC) */
27 
28 /*  Values of tk_region for Xevent generated tokens.
29  */
30 #define MAINWIN		0
31 #define SCREEN		1
32 #define SCROLLBAR	2
33 
34 /*  Token types
35  */
36 #define TK_NULL		0	/* null token to be ignored */
37 #define TK_STRING	1	/* string of printable characters */
38 #define TK_CHAR		2	/* single character */
39 #define TK_EOF		3	/* read end of file */
40 
41 #define TK_ENTRY	4	/* cursor crossed window boundery */
42 #define TK_EXPOSE	5	/* window has been exposed */
43 #define TK_RESIZE	6	/* main window has been resized */
44 
45 #define TK_SBSWITCH	7	/* switch scrollbar in or out */
46 #define TK_SBGOTO	8	/* scrollbar goto */
47 #define TK_SBUP		9	/* scrollbar move up */
48 #define TK_SBDOWN	10	/* scrollbar move down */
49 
50 #define TK_SELSTART	11	/* start the selection */
51 #define TK_SELEXTND	12	/* extend the selection */
52 #define TK_SELDRAG	13	/* drag the selection */
53 #define TK_SELINSRT	14	/* insert the selection */
54 #define TK_SELWORD	15	/* select a word */
55 #define TK_SELLINE	16	/* select a line */
56 #define TK_SELECT	17	/* confirm the selection */
57 
58 #define TK_SELCLEAR	18	/* selection clear request */
59 #define TK_SELNOTIFY	19	/* selection notify request */
60 #define TK_SELREQUEST	20	/* selection request */
61 
62 #define TK_TXTPAR	21	/* seq with text parameter */
63 
64 #define TK_FOCUS	22	/* keyboard focus event */
65 
66 /*  DEC VT100 control sequence token types
67  */
68 #define TK_CUU		'A'	/* Cursor up */
69 #define TK_CUD		'B'	/* cursor down */
70 #define TK_CUF		'C'	/* cursor back */
71 #define TK_CUB		'D'	/* cursor back */
72 #define TK_CUP		'H'	/* position cursor */
73 #define TK_ED		'J'	/* erase to start or end of screen */
74 #define TK_EL		'K'	/* erase to start or end of line */
75 #define TK_IL		'L'	/* insert lines */
76 #define TK_DL		'M'	/* delete lines */
77 #define TK_DCH		'P'	/* Delete characters */
78 #define TK_ICH		'@'	/* insert characters */
79 #define TK_DA		'c'	/* device attributes request */
80 #define TK_HVP		'f'	/* horizontal and vertical position */
81 #define TK_TBC		'g'	/* tab clear */
82 #define TK_SET		'h'	/* set mode */
83 #define TK_RESET	'l'	/* reset mode */
84 #define TK_SGR		'm'	/* set graphics rendition */
85 #define TK_DSR		'n'	/* report status or position */
86 #define TK_DECSTBM	'r'	/* set top and bottom margins */
87 
88 #define TK_DECSWH	'#'	/* set character width or height */
89 #define TK_SCS0		'('	/* set character set G0 */
90 #define TK_SCS1		')'	/* set character set G1 */
91 #define TK_DECSC	'7'	/* save cursor position */
92 #define TK_DECRC	'8'	/* restore cursor position */
93 #define TK_DECPAM	'='	/* keypad to applications mode */
94 #define TK_DECPNM	'>'	/* keypad to numeric mode */
95 #define TK_IND		0x100	/* index downward */
96 #define TK_NEL		0x101	/* beginning of next line */
97 #define TK_HTS		0x102	/* horizontal tab set */
98 #define TK_RI		0x103	/* reverse index */
99 #define TK_SS2		0x104	/* single shift 2 */
100 #define TK_SS3		0x105	/* single shift 3 */
101 #define TK_DECID	0x106	/* request terminal ID */
102