82e43bffc1fa119a452c289b83df540c70b9d7b1
[xboard.git] / xgamelist.c
1 /*
2  * xgamelist.c -- Game list window, part of X front end for XBoard
3  *
4  * Copyright 1995, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
5  * ------------------------------------------------------------------------
6  *
7  * GNU XBoard is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or (at
10  * your option) any later version.
11  *
12  * GNU XBoard is distributed in the hope that it will be useful, but
13  * WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see http://www.gnu.org/licenses/.  *
19  *
20  *------------------------------------------------------------------------
21  ** See the file ChangeLog for a revision history.  */
22
23 #include "config.h"
24
25 #include <stdio.h>
26 #include <ctype.h>
27 #include <errno.h>
28 #include <sys/types.h>
29
30 #if STDC_HEADERS
31 # include <stdlib.h>
32 # include <string.h>
33 #else /* not STDC_HEADERS */
34 extern char *getenv();
35 # if HAVE_STRING_H
36 #  include <string.h>
37 # else /* not HAVE_STRING_H */
38 #  include <strings.h>
39 # endif /* not HAVE_STRING_H */
40 #endif /* not STDC_HEADERS */
41
42 #if HAVE_UNISTD_H
43 # include <unistd.h>
44 #endif
45
46 #include "common.h"
47 #include "backend.h"
48 #include "xboard.h"
49 #include "xgamelist.h"
50 #include "dialogs.h"
51
52
53 char gameListTranslations[] =
54   "<Btn4Down>: WheelProc(-3) \n \
55    <Btn5Down>: WheelProc(3) \n \
56    <Btn1Down>: LoadSelectedProc(100) Set() \n \
57    <Btn1Up>(2): LoadSelectedProc(0) \n \
58    <Key>Home: LoadSelectedProc(-2) \n \
59    <Key>End: LoadSelectedProc(2) \n \
60    Ctrl<Key>Up: LoadSelectedProc(-3) \n \
61    Ctrl<Key>Down: LoadSelectedProc(3) \n \
62    <Key>Up: LoadSelectedProc(-1) \n \
63    <Key>Down: LoadSelectedProc(1) \n \
64    <Key>Left: LoadSelectedProc(-1) \n \
65    <Key>Right: LoadSelectedProc(1) \n \
66    <Key>Prior: LoadSelectedProc(-4) \n \
67    <Key>Next: LoadSelectedProc(4) \n \
68    <Key>Return: LoadSelectedProc(0) \n";
69 char filterTranslations[] =
70   "<Key>Return: SetFilterProc() \n";
71
72
73 #ifdef TODO_GTK
74 void
75 LoadSelectedProc (Widget w, XEvent *event, String *prms, Cardinal *nprms)
76 {
77     if(GameListClicks(atoi(prms[0]))) return; // if no game loaded, no focus transfer
78     XSync(xDisplay, False);
79     XSetInputFocus(xDisplay, XtWindow(boardWidget), RevertToPointerRoot, CurrentTime);
80 }
81
82 void
83 SetFilterProc (Widget w, XEvent *event, String *prms, Cardinal *nprms)
84 {
85     SetFilter();
86 }
87 #endif
88