2 * xgamelist.c -- Game list window, part of X front end for XBoard
4 * Copyright 1995, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016 Free Software Foundation, Inc.
5 * ------------------------------------------------------------------------
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.
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.
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/. *
20 *------------------------------------------------------------------------
21 ** See the file ChangeLog for a revision history. */
28 #include <sys/types.h>
33 #else /* not STDC_HEADERS */
34 extern char *getenv();
37 # else /* not HAVE_STRING_H */
39 # endif /* not HAVE_STRING_H */
40 #endif /* not STDC_HEADERS */
46 #include <X11/Intrinsic.h>
47 #include <X11/StringDefs.h>
48 #include <X11/Shell.h>
49 #include <X11/cursorfont.h>
51 #include <X11/Xaw3d/Dialog.h>
52 #include <X11/Xaw3d/Form.h>
53 #include <X11/Xaw3d/List.h>
54 #include <X11/Xaw3d/Label.h>
55 #include <X11/Xaw3d/SimpleMenu.h>
56 #include <X11/Xaw3d/SmeBSB.h>
57 #include <X11/Xaw3d/SmeLine.h>
58 #include <X11/Xaw3d/Box.h>
59 #include <X11/Xaw3d/MenuButton.h>
60 #include <X11/Xaw3d/Text.h>
61 #include <X11/Xaw3d/AsciiText.h>
62 #include <X11/Xaw3d/Viewport.h>
64 #include <X11/Xaw/Dialog.h>
65 #include <X11/Xaw/Form.h>
66 #include <X11/Xaw/List.h>
67 #include <X11/Xaw/Label.h>
68 #include <X11/Xaw/SimpleMenu.h>
69 #include <X11/Xaw/SmeBSB.h>
70 #include <X11/Xaw/SmeLine.h>
71 #include <X11/Xaw/Box.h>
72 #include <X11/Xaw/MenuButton.h>
73 #include <X11/Xaw/Text.h>
74 #include <X11/Xaw/AsciiText.h>
75 #include <X11/Xaw/Viewport.h>
81 #include "xgamelist.h"
85 char gameListTranslations[] =
86 "<Btn4Down>: WheelProc(-3) \n \
87 <Btn5Down>: WheelProc(3) \n \
88 <Btn1Down>: LoadSelectedProc(100) Set() \n \
89 <Btn1Up>(2): LoadSelectedProc(0) \n \
90 <Key>Home: LoadSelectedProc(-2) \n \
91 <Key>End: LoadSelectedProc(2) \n \
92 Ctrl<Key>Up: LoadSelectedProc(-3) \n \
93 Ctrl<Key>Down: LoadSelectedProc(3) \n \
94 <Key>Up: LoadSelectedProc(-1) \n \
95 <Key>Down: LoadSelectedProc(1) \n \
96 <Key>Left: LoadSelectedProc(-1) \n \
97 <Key>Right: LoadSelectedProc(1) \n \
98 <Key>Prior: LoadSelectedProc(-4) \n \
99 <Key>Next: LoadSelectedProc(4) \n \
100 <Key>Return: LoadSelectedProc(0) \n";
101 char filterTranslations[] =
102 "<Key>Return: SetFilterProc() \n";
106 LoadSelectedProc (Widget w, XEvent *event, String *prms, Cardinal *nprms)
108 if(GameListClicks(atoi(prms[0]))) return; // if no game loaded, no focus transfer
109 XSync(xDisplay, False);
110 XSetInputFocus(xDisplay, XtWindow(boardWidget), RevertToPointerRoot, CurrentTime);
114 SetFilterProc (Widget w, XEvent *event, String *prms, Cardinal *nprms)