Also supply shortcut for start directory in GTK file chooser
[xboard.git] / gtk / xboard.h
1 /*
2  * xboard.h -- Parameter definitions for X front end
3  *
4  * Copyright 1991 by Digital Equipment Corporation, Maynard,
5  * Massachusetts.
6  *
7  * Enhancements Copyright 1992-2001, 2002, 2003, 2004, 2005, 2006,
8  * 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016 Free
9  * Software Foundation, Inc.
10  *
11  * The following terms apply to Digital Equipment Corporation's copyright
12  * interest in XBoard:
13  * ------------------------------------------------------------------------
14  * All Rights Reserved
15  *
16  * Permission to use, copy, modify, and distribute this software and its
17  * documentation for any purpose and without fee is hereby granted,
18  * provided that the above copyright notice appear in all copies and that
19  * both that copyright notice and this permission notice appear in
20  * supporting documentation, and that the name of Digital not be
21  * used in advertising or publicity pertaining to distribution of the
22  * software without specific, written prior permission.
23  *
24  * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
25  * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
26  * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
27  * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
28  * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
29  * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
30  * SOFTWARE.
31  * ------------------------------------------------------------------------
32  *
33  * The following terms apply to the enhanced version of XBoard
34  * distributed by the Free Software Foundation:
35  * ------------------------------------------------------------------------
36  *
37  * GNU XBoard is free software: you can redistribute it and/or modify
38  * it under the terms of the GNU General Public License as published by
39  * the Free Software Foundation, either version 3 of the License, or (at
40  * your option) any later version.
41  *
42  * GNU XBoard is distributed in the hope that it will be useful, but
43  * WITHOUT ANY WARRANTY; without even the implied warranty of
44  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
45  * General Public License for more details.
46  *
47  * You should have received a copy of the GNU General Public License
48  * along with this program. If not, see http://www.gnu.org/licenses/.  *
49  *
50  *------------------------------------------------------------------------
51  ** See the file ChangeLog for a revision history.  */
52
53 #include <stdio.h>
54
55 #define ICS_LOGON    ".icsrc"
56 #define MANPAGE      "xboard.6"
57 #define CLOCK_FONT_NAME         "Sans Bold %d"
58 #define COORD_FONT_NAME         "Sans Bold %d"
59 #define DEFAULT_FONT_NAME       "Sans Normal %d"
60 #define CONSOLE_FONT_NAME       "Monospace Normal %d"
61 #define HISTORY_FONT_NAME       "Sans Normal %d"
62 #define COMMENT_FONT_NAME       "Sans Normal %d"
63 #define TAGS_FONT_NAME          "Sans Normal %d"
64 #define GAMELIST_FONT_NAME      "Sans Normal %d"
65 #define COLOR_SHOUT             "green"
66 #define COLOR_SSHOUT            "green,black,1"
67 #define COLOR_CHANNEL1          "cyan"
68 #define COLOR_CHANNEL           "cyan,black,1"
69 #define COLOR_KIBITZ            "magenta,black,1"
70 #define COLOR_TELL              "yellow,black,1"
71 #define COLOR_CHALLENGE         "red,black,1"
72 #define COLOR_REQUEST           "red"
73 #define COLOR_SEEK              "blue"
74 #define COLOR_NORMAL            "default"
75 #define COLOR_LOWTIMEWARNING    "red"
76
77 typedef struct {
78     char *name;
79     int squareSize;
80     int lineGap;
81     int clockFontPxlSize;
82     int coordFontPxlSize;
83     int fontPxlSize;
84     int smallLayout;
85     int tinyLayout;
86     int minScreenSize;
87 } SizeDefaults;
88
89 #define SIZE_DEFAULTS \
90 { { "Titanic",  129, 4, 34, 14, 14, 0, 0, 1200 }, \
91   { "Colossal", 116, 4, 34, 14, 14, 0, 0, 1200 }, \
92   { "Giant",    108, 3, 34, 14, 14, 0, 0, 1024 }, \
93   { "Huge",     95, 3, 34, 14, 14, 0, 0, 1024 }, \
94   { "Big",      87, 3, 34, 14, 14, 0, 0, 864 }, \
95   { "Large",    80, 3, 34, 14, 14, 0, 0, 864 }, \
96   { "Bulky",    72, 3, 34, 12, 14, 0, 0, 864 }, \
97   { "Medium",   64, 3, 34, 12, 14, 1, 0, 768 }, \
98   { "Moderate", 58, 3, 34, 12, 14, 1, 0, 768 }, \
99   { "Average",  54, 2, 30, 11, 12, 1, 0, 600 }, \
100   { "Middling", 49, 2, 24, 10, 12, 1, 0, 600 }, \
101   { "Mediocre", 45, 2, 20, 10, 12, 1, 4, 600 }, \
102   { "Small",    40, 2, 20, 10, 12, 1, 3, 480 }, \
103   { "Slim",     37, 2, 20, 10, 12, 1, 3, 480 }, \
104   { "Petite",   33, 1, 15, 9,  11, 1, 2, 480 }, \
105   { "Dinky",    29, 1, 15, 9,  11, 1, 1, 480 }, \
106   { "Teeny",    25, 1, 12, 8,  11, 1, 1, 480 }, \
107   { "Tiny",     21, 1, 12, 8,  11, 1, 1, 0 }, \
108   {   NULL,      0, 0,  0, 0,   0, 0, 0, 0 } }
109
110 #define BORDER_X_OFFSET 3
111 #define BORDER_Y_OFFSET 27
112 #define FIRST_CHESS_PROGRAM     "fairymax"
113 #define SECOND_CHESS_PROGRAM    ""
114 #define FIRST_DIRECTORY         "."
115 #define SECOND_DIRECTORY        "."
116 #define SOUND_BELL              ""
117 #define ICS_NAMES               ""
118 #define FCP_NAMES               ""
119 #define SCP_NAMES               ""
120 #define ICS_TEXT_MENU_DEFAULT   ""
121 #define SETTINGS_FILE           SYSCONFDIR"/xboard.conf"
122 #define COLOR_BKGD              "white"
123
124 GdkPixbuf *LoadIconFile P((char *name));
125 void NewTagsPopup P((char *text, char *msg));
126 int AppendText P((Option *opt, char *s));
127 void NewCommentPopup P((char *title, char *text, int index));
128 void GetActualPlacement P((GtkWidget *shell, WindowPlacement *wp));
129 void DelayedDrag P((void));
130 #ifdef TODO_GTK
131 void CatchDeleteWindow(Widget w, String procname);
132 void GenericPopDown P((Widget w, XEvent *event, String *prms, Cardinal *nprms));
133 void SetFocus(Widget w, XtPointer data, XEvent *event, Boolean *b); // from xoptions.c
134 void TypeInProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms));
135 Widget CreateMenuItem P((Widget menu, char *msg, XtCallbackProc CB, int n));
136 void WheelProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms));
137 void TabProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms));
138 void GenericMenu P((Widget w, XEvent *event, String *prms, Cardinal *nprms));
139
140 // from xengineoutput.c
141 void SelectPV P((Widget w, XEvent * event, String * params, Cardinal * nParams));
142 void StopPV P((Widget w, XEvent * event, String * params, Cardinal * nParams));
143 #endif
144
145 extern char memoTranslations[];
146
147 extern GtkAccelGroup *GtkAccelerators;
148
149 #if TODO_GTK
150 extern Widget shells[];
151 extern Widget formWidget, shellWidget, boardWidget, menuBarWidget;
152 extern Display *xDisplay;
153 extern Window xBoardWindow;
154 extern Pixmap xMarkPixmap, wIconPixmap, bIconPixmap;
155 extern Pixel timerForegroundPixel, timerBackgroundPixel, dialogColor, buttonColor;
156 extern Atom wm_delete_window;
157 extern GC coordGC;
158 extern Dimension textHeight; // of message widget in board window
159 #else
160 extern GtkWidget *shells[];
161 #endif
162 extern int dialogError;
163 extern int squareSize;
164 extern char *layoutName;
165 extern int useImages, useImageSqs;
166 extern char ICSInputTranslations[];
167 extern char *selected_fen_position;
168 extern char *chessDir;
169
170
171 #define TOPLEVEL 1 /* preference item; 1 = make popup windows toplevel */