1 /* vim:tw=78:ts=8:sw=4:set ft=c: */
3 Copyright (C) 2002-2013 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
22 #define COPYRIGHT "Copyright (C) 2002-2013 " PACKAGE_BUGREPORT
23 #define LINE_GRAPHIC(c) ((!config.linegraphics) ? ' ' : c)
24 #define ROWTOMATRIX(r) ((8 - r) * 2 + 2 - 1)
25 #define COLTOMATRIX(c) ((c == 1) ? 1 : c * 4 - 3)
26 #define BOARD_HEIGHT 18
27 #define BOARD_WIDTH 34
28 #define STATUS_HEIGHT 12
29 #define STATUS_WIDTH (COLS - BOARD_WIDTH)
30 #define TAG_HEIGHT LINES - STATUS_HEIGHT - 1
31 #define TAG_WIDTH (COLS - BOARD_WIDTH)
32 #define HISTORY_HEIGHT (LINES - BOARD_HEIGHT)
33 #define HISTORY_WIDTH (COLS - STATUS_WIDTH)
34 #define MAX_VALUE_WIDTH (COLS - 8)
53 static char gameexp
[255];
54 static char moveexp
[255];
55 struct itimerval clock_timer
;
57 int markstart
= -1, markend
= -1;
59 char loadfile
[FILENAME_MAX
];
63 // Loaded filename from the command line or from the file input dialog.
66 FILE_NONE
, FILE_PGN
, FILE_FEN
, FILE_EPD
69 const char *history_menu_help_str
= {
70 " UP/DOWN - previous/next menu item\n" \
71 " HOME/END - first/last menu item\n" \
72 " PGDN/PGUP - next/previous page\n" \
73 " a-zA-Z0-9 - jump to item\n" \
74 " CTRL-a - annotate the selected move\n" \
75 " ENTER - view annotation\n" \
76 " CTRL-d - toggle board details\n" \
80 const char *mainhelp
= {
81 "p - play mode keys\n" \
82 "h - history mode keys\n" \
83 "e - board edit mode keys\n" \
84 "g - global game keys"
87 const char *naghelp
= {
88 " UP/DOWN - previous/next menu item\n" \
89 " HOME/END - first/last menu item\n" \
90 " PGDN/PGUP - next/previous page\n" \
91 " a-zA-Z0-9 - jump to item\n" \
92 " SPACE - toggle selected item\n" \
93 " CTRL-X - quit with changes"
98 static int macro_match
;
102 char *notify
; // The status window notification line buffer.
105 int curses_initialized
;
107 // When in history mode a full step is to the next move of the same playing
108 // side. Half stepping is alternating sides.
111 void update_all(GAME g
);
112 void update_status_notify(GAME g
, char *fmt
, ...);
113 void edit_tags(GAME g
, BOARD b
, int edit
);
114 void add_custom_tags(TAG
***t
);
115 static void free_userdata_once(GAME g
);
117 #ifndef HAVE_PROGNAME