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