Transfer most available gtk-xt code to xoptions.c
[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 <gtk/gtk.h>
47
48 #include "common.h"
49 #include "backend.h"
50 #include "xboard.h"
51 #include "xgamelist.h"
52 #include "dialogs.h"
53
54
55 char gameListTranslations[] =
56   "<Btn4Down>: WheelProc(-3) \n \
57    <Btn5Down>: WheelProc(3) \n \
58    <Btn1Down>: LoadSelectedProc(100) Set() \n \
59    <Btn1Up>(2): LoadSelectedProc(0) \n \
60    <Key>Home: LoadSelectedProc(-2) \n \
61    <Key>End: LoadSelectedProc(2) \n \
62    Ctrl<Key>Up: LoadSelectedProc(-3) \n \
63    Ctrl<Key>Down: LoadSelectedProc(3) \n \
64    <Key>Up: LoadSelectedProc(-1) \n \
65    <Key>Down: LoadSelectedProc(1) \n \
66    <Key>Left: LoadSelectedProc(-1) \n \
67    <Key>Right: LoadSelectedProc(1) \n \
68    <Key>Prior: LoadSelectedProc(-4) \n \
69    <Key>Next: LoadSelectedProc(4) \n \
70    <Key>Return: LoadSelectedProc(0) \n";
71 char filterTranslations[] =
72   "<Key>Return: SetFilterProc() \n";
73
74
75 #ifdef TODO_GTK
76 void
77 LoadSelectedProc (Widget w, XEvent *event, String *prms, Cardinal *nprms)
78 {
79     if(GameListClicks(atoi(prms[0]))) return; // if no game loaded, no focus transfer
80     XSync(xDisplay, False);
81     XSetInputFocus(xDisplay, XtWindow(boardWidget), RevertToPointerRoot, CurrentTime);
82 }
83
84 void
85 SetFilterProc (Widget w, XEvent *event, String *prms, Cardinal *nprms)
86 {
87     SetFilter();
88 }
89 #endif
90