Update copyright year to 2015.
[cboard.git] / src / keys.h
blob23c7dbf54c514e95482d4b4d28df3b46867931be
1 /* vim:tw=78:ts=8:sw=4:set ft=c: */
2 /*
3 Copyright (C) 2002-2015 Ben Kibbey <bjk@luxsci.net>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 #ifndef KEYS_H
20 #define KEYS_H
22 #define CTRL_KEY(x) ((x) & 0x1f)
23 #define KEY_ESCAPE CTRL_KEY('[')
25 enum {
26 MODE_HISTORY, MODE_PLAY, MODE_EDIT
29 enum {
30 PLAY_HE, PLAY_EH
33 enum {
34 CURSOR_POSITION, SP_POSITION, SPS_POSITION
37 typedef void (key_func)(void);
39 struct key_s {
40 key_func *f;
41 wint_t c;
42 wchar_t *key;
43 wchar_t *d;
44 int r;
47 struct macro_s {
48 wint_t c;
49 wint_t *keys;
50 int n;
51 int total;
52 int mode;
53 } **macros;
55 int *macro_depth;
56 int macro_depth_n;
58 struct key_s **history_keys;
59 key_func do_history_jump_next;
60 key_func do_history_jump_prev;
61 key_func do_history_next;
62 key_func do_history_prev;
63 key_func do_history_half_move_toggle;
64 key_func do_history_rotate_board;
65 key_func do_history_jump;
66 key_func do_history_find_new;
67 key_func do_history_find_next;
68 key_func do_history_find_prev;
69 key_func do_history_annotate;
70 key_func do_history_rav_next;
71 key_func do_history_rav_prev;
72 key_func do_history_menu;
73 key_func do_history_toggle;
74 key_func do_history_help;
76 struct key_s **edit_keys;
77 key_func do_edit_select;
78 key_func do_edit_commit;
79 key_func do_edit_cancel_selected;
80 key_func do_edit_delete;
81 key_func do_edit_insert;
82 key_func do_edit_toggle_castle;
83 key_func do_edit_enpassant;
84 key_func do_edit_switch_turn;
85 key_func do_edit_help;
86 key_func do_edit_exit;
88 struct key_s **play_keys;
89 key_func do_play_select;
90 key_func do_play_commit;
91 key_func do_play_cancel_selected;
92 key_func do_play_set_clock;
93 //key_func do_play_switch_turn;
94 key_func do_play_undo;
95 key_func do_play_go;
96 key_func do_play_send_command;
97 key_func do_play_toggle_eh_mode;
98 key_func do_play_toggle_engine;
99 key_func do_play_toggle_human;
100 key_func do_play_help;
101 key_func do_play_toggle_pause;
102 key_func do_play_history_mode;
103 key_func do_play_edit_mode;
105 struct key_s **global_keys;
106 key_func do_global_tag_edit;
107 key_func do_global_tag_view;
108 key_func do_global_find_new;
109 key_func do_global_find_next;
110 key_func do_global_find_prev;
111 key_func do_global_new_game;
112 key_func do_global_new_all;
113 key_func do_global_copy_game;
114 key_func do_global_next_game;
115 key_func do_global_prev_game;
116 key_func do_global_game_jump;
117 key_func do_global_toggle_delete;
118 key_func do_global_delete_game;
119 key_func do_global_resume_game;
120 key_func do_global_save_game;
121 key_func do_global_about;
122 key_func do_global_quit;
123 key_func do_global_toggle_engine_window;
124 key_func do_global_toggle_board_details;
125 key_func do_global_toggle_strict_castling;
126 key_func do_global_redraw;
127 key_func do_global_help;
128 #ifdef WITH_LIBPERL
129 key_func do_global_perl;
130 #endif
132 #endif