Completely get rid of unused m4/ directory
[shogivar/ydirson.git] / backend.h
blob306c68020b86a351d1c5ab2566b9e23807c54ddb
1 // data types used in backend.c
3 #define False 0
4 #define True 1
6 typedef int INT;
7 typedef char STRING[80];
8 typedef float SINGLE;
9 typedef long int LONG;
11 typedef struct {
12 INT number;
13 STRING Name;
14 char sname[5]; // As String * 4;
15 INT Value;
16 INT PrValue;
17 INT Promotes;
18 INT Graphic;
19 INT PrGraphic;
20 INT Moves[9];
21 char special; // As String * 1;
22 INT Mask;
23 INT Range;
24 } Piece;
26 // form???
28 typedef struct {
29 STRING Filename;
30 STRING DialogTitle;
31 int Flags;
32 int Action;
33 } DIALOG;
35 typedef struct {
36 STRING Caption;
37 int Visible;
38 int Enabled;
39 int Checked;
40 int dragged;
41 int Interval;
42 void *Picture;
43 int Value;
44 STRING List[10];
45 int ListIndex;
46 int ForeColor;
47 int x, y, width, height;
48 int oldX, oldY, oldWidth, oldHeight, oldVisible;
49 void (*Move)(int draw, int x, int y), (*Drag)(int mode);
50 } OBJECT, MENU;
52 typedef struct {
53 STRING Caption;
55 OBJECT Frame;
56 OBJECT Held[NTYPES];
57 OBJECT Timer1;
58 OBJECT Timer2;
59 OBJECT showpic[NSQUARES];
60 OBJECT HandPic[NTYPES];
61 OBJECT WhiteClock;
62 OBJECT BlackClock;
63 OBJECT LastMove;
64 OBJECT PieceID;
65 OBJECT NextMove;
66 OBJECT NotTop, NotSide;
67 OBJECT Pix[NPIECES];
68 OBJECT White, Black;
69 OBJECT Game[10];
70 OBJECT Title[18];
71 OBJECT CmdPiece;
73 int FillColor;
74 int FillStyle;
75 int ForeColor;
76 int MousePointer;
77 int ScaleWidth, DrawWidth;
78 int CurrentX, CurrentY;
79 int AutoRedraw;
80 void *Picture;
81 int WindowState;
82 int Top, Left, Height;
84 MENU MnuClockOn;
85 MENU MnuClockOff;
86 MENU MnuSwitch;
87 MENU MnuVer1, MnuVer2;
88 MENU MnuShowOn, MnuShowOff;
89 MENU MnuShowLastOn, MnuShowLastOff;
90 MENU MnuThreatOn, MnuThreatOff;
91 MENU MnuAutoOn, MnuAutoOff;
92 MENU MnuEvalOn, MnuEvalOff;
93 MENU MnuLVer1, MnuLVer2;
94 MENU MnuNotOn, MnuNotOff;
95 MENU MnuWhitePlayer, MnuBlackPlayer;
96 MENU MnuWhiteComp, MnuBlackComp;
97 MENU MnuWhite, MnuBlack;
98 MENU MnuHandicap;
99 MENU MnuNextWhite, MnuNextBlack;
100 MENU MnuWeak, MnuBest, MnuLessWeak;
102 DIALOG CMDiagram;
103 DIALOG CMSave;
105 void (*Refresh)(), (*Hide)(), (*Show)();
106 void (*Line)(int x1, int y1, int x2, int y2, int color, char *options);
107 void (*Circle)(int x, int y, int r);
108 void (*Print)(char *c); // prints the passed character
109 } FORM;
111 typedef struct {
112 STRING Caption;
113 OBJECT NewPiece;
114 int Visible;
115 int Enabled;
116 } ADDPIECES;
118 // backend.c functions called from menus
120 void ConfigSave();
121 void SetPieces();
122 void EndSetup();
123 void SetHandicap();
124 void SeeMoves();
125 void SetThreat();
126 void SetEval();
127 void CompMain();
128 void SetWhitePlayer();
129 void SetBlackPlayer();
130 void Compute();
131 void SetWhitePlayer();
132 void Notation();
133 void SetAutoPromote();
134 void ClocksOn();
135 void ClocksOff();
136 void SetLionHawk();
137 void LoadGame();
138 void SaveGame();
139 void ChangeGame();
140 void TakeBack();
141 void TakeAll();
142 void Replay();
143 void ReplayAll();
144 void SetSuggest();
145 void PrintScore();
146 void DiagramFile();
147 void DiagramSmall();
148 void Rotate();
149 void SwitchCompPlayer();
150 void SetGeneral();
151 void SetRules();
152 void SetDifficulty();
153 void SetLastMove();
154 void Clock();
155 void ClearBoard();
156 void CheckAdd();
157 void MovePieces();
158 void AddSomePieces();
159 void StartUp();
160 void ResetHand();
161 void NotSet();
162 void PicDrop();
163 void ShowProm();
164 void DropPiece();
165 void DropPiece2();
166 void ClearLegal();
167 void HeldDown();
168 void HeldProm();
169 void FillSquare();
170 void FormDrop();
171 void EndTilde();
172 void PicDown();
173 void Main();
175 // globals in backend.c altered by menus
177 extern STRING Direct;
178 extern STRING Threat;
179 extern STRING Cap;
180 extern STRING Computer;
181 extern STRING Turn;
182 extern STRING Grade;
183 extern STRING Choice;
184 extern STRING ExtraPiece;
186 extern INT Reverse;
187 extern INT Timing;
188 extern INT EndMove;
189 extern INT NewGame;
190 extern INT ShowLast;
191 extern INT SeeMove;
192 extern INT Eval;
193 extern INT Notate;
194 extern INT AutoPromote;
195 extern INT LionHawkVer;
196 extern INT LegalMoves;
197 extern INT CCC, I;
198 extern SINGLE NewX, NewY;
199 extern INT NewButton;
200 extern INT NewIndex;
201 extern INT ClickPiece;
202 extern INT PieceNum;
203 extern INT Drop;
204 extern INT Selection;
205 extern INT Reduce;
206 extern INT MovePiece;
207 extern INT MoveCount;
208 extern INT TurnCount;
209 extern INT PromDotY;
210 extern INT XStart;
211 extern INT Pixels;
212 extern INT BoardSizeX, BoardSizeY;
214 extern Piece Pieces[];
216 extern FORM Board;
217 extern FORM PieceHelp;