1 /*
2  * keys.h: header for keys.c
3  *
4  * Written By Michael Sandrof
5  *
6  * Copyright (c) 1990 Michael Sandrof.
7  * Copyright (c) 1991, 1992 Troy Rollo.
8  * Copyright (c) 1992-2014 Matthew R. Green.
9  * All rights reserved.
10  *
11  * Redistribution and use in source and binary forms, with or without
12  * modification, are permitted provided that the following conditions
13  * are met:
14  * 1. Redistributions of source code must retain the above copyright
15  *    notice, this list of conditions and the following disclaimer.
16  * 2. Redistributions in binary form must reproduce the above copyright
17  *    notice, this list of conditions and the following disclaimer in the
18  *    documentation and/or other materials provided with the distribution.
19  * 3. The name of the author may not be used to endorse or promote products
20  *    derived from this software without specific prior written permission.
21  *
22  * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
23  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
24  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
25  * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
29  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
30  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32  * SUCH DAMAGE.
33  */
34 
35 /*
36  * @(#)$eterna: keys.h,v 1.39 2017/07/09 06:45:33 mrg Exp $
37  */
38 
39 #ifndef irc__keys_h_
40 #define irc__keys_h_
41 
42 /* Move KeyMap and KeyMapNames, and their variables into keys.c */
43 /* KeyMap: the structure of the irc keymaps */
44 typedef struct
45 {
46 	int	index;
47 	u_char	changed;
48 	int	global;
49 	u_char	*stuff;
50 }	KeyMap;
51 
52 typedef	void	(*KeyMap_Func)(u_int, u_char *);
53 
54 	void	save_bindings(FILE *, int);
55 	void	bindcmd(u_char *, u_char *, u_char *);
56 	void	rbindcmd(u_char *, u_char *, u_char *);
57 	void	parsekeycmd(u_char *, u_char *, u_char *);
58 	void	typecmd(u_char *, u_char *, u_char *);
59 	KeyMap_Func keys_get_func_from_index_and_meta(u_char, int);
60 	u_char *keys_get_str_from_key_and_meta(u_char, int);
61 
62 enum {
63 	BACKSPACE = 0,
64 	BACKWARD_CHARACTER,
65 	BACKWARD_HISTORY,
66 	BACKWARD_WORD,
67 	BEGINNING_OF_LINE,
68 	CLEAR_SCREEN,
69 	COMMAND_COMPLETION,
70 	DELETE_CHARACTER,
71 	DELETE_NEXT_WORD,
72 	DELETE_PREVIOUS_WORD,
73 	END_OF_LINE,
74 	ENTER_DIGRAPH,
75 	ENTER_MENU,
76 	ERASE_LINE,
77 	ERASE_TO_BEG_OF_LINE,
78 	ERASE_TO_END_OF_LINE,
79 	FORWARD_CHARACTER,
80 	FORWARD_HISTORY,
81 	FORWARD_WORD,
82 	META1_CHARACTER,
83 	META2_CHARACTER,
84 	META3_CHARACTER,
85 	META4_CHARACTER,
86 	META5_CHARACTER,
87 	META6_CHARACTER,
88 	META7_CHARACTER,
89 	META8_CHARACTER,
90 	NEXT_WINDOW,
91 	NOTHING,
92 	PARSE_COMMAND,
93 	PREVIOUS_WINDOW,
94 	QUIT_IRC,
95 	QUOTE_CHARACTER,
96 	REFRESH_INPUTLINE,
97 	REFRESH_SCREEN,
98 	REFRESH_WINDOW_LASTLOG,
99 	SCROLL_BACKWARD,
100 	SCROLL_END,
101 	SCROLL_FORWARD,
102 	SCROLL_START,
103 	SELF_INSERT,
104 	SEND_LINE,
105 	STOP_IRC,
106 	SWAP_LAST_WINDOW,
107 	SWAP_NEXT_WINDOW,
108 	SWAP_PREVIOUS_WINDOW,
109 	SWITCH_CHANNELS,
110 	TOGGLE_INSERT_MODE,
111 	TOGGLE_STOP_SCREEN,
112 	TRANSPOSE_CHARACTERS,
113 	TYPE_TEXT,
114 	UNSTOP_ALL_WINDOWS,
115 	YANK_FROM_CUTBUFFER,
116 	NUMBER_OF_FUNCTIONS
117 };
118 
119 #endif /* irc__keys_h_ */
120