1 /*
2     XBlockOut a 3D Tetris
3 
4     Copyright (C) 1992,1993,1994,2001  Thierry EXCOFFIER
5 
6     This program is free software; you can redistribute it and/or modify
7     it under the terms of the GNU General Public License as published by
8     the Free Software Foundation; either version 1, or (at your option)
9     any later version.
10 
11     This program is distributed in the hope that it will be useful,
12     but WITHOUT ANY WARRANTY; without even the implied warranty of
13     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14     GNU General Public License for more details.
15 
16     You should have received a copy of the GNU General Public License
17     along with this program; if not, write to the Free Software
18     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 
20     Contact: Thierry.EXCOFFIER@liris.univ-lyon1.fr
21 */
22 
23 #include <X11/Xlib.h>
24 #include "movingbutton.h"
25 #include "keyid.h"
26 
27 #define TEXT 0
28 #define INTEGER 1
29 #define FUNCTION 2
30 
31 #define ZOO_NBX_PIECES 7	/* Number of piece in zoo width */
32 #define ZOO_NBY_PIECES 6	/* Number of piece in zoo height */
33 #define ZOO_WIDTH	512
34 
35 struct menu
36 	{
37 	Display *display ;
38 	Window window ;		/* The menu window */
39 	Window zoo ;		/* The zoo window */
40 	int showscore ;		/* Boolean */
41 	int showzoo ;		/* Boolean */
42 	unsigned int xzoo,yzoo ;/* Zoo window size */
43 	Font font,font2 ;	/* Normal and big font */
44 	XFontStruct *xfont,*xfont2 ;
45 	int char_height ;	/* Maximum char height for normal char */
46 	GC white,black,text,text1,text2 ;
47 	GC flat,upleft,downright ;
48 	int layersize ;
49 	Pixmap helpkey ;	/* The bitmap with the help cube */
50 	int widthhelpkey,heighthelpkey ;
51 	int tx[KEY_ROT_Z_NEG+1] ;
52 	int ty[KEY_ROT_Z_NEG+1] ;
53 	struct bl *bl ;
54 	struct row_column *all ;
55 	struct moving_button
56 		*score,
57 		*hiscore,
58 		*cube,
59 		*bloc,
60 		*destroylevel,
61 		*level,
62 		*nextpiece,
63 
64 		*land,
65 		*typepiece,
66 		*width,*height,*depth,
67 		*startlevel,
68 		*training,
69 		*volume,
70 		*viewzoo,*viewscore,
71 	        *stereo,
72 		*frame,
73 
74 		*smooth,
75 		*draw,
76 		*key,
77 		*help,
78 		*quit,
79 		*state,
80 		*counting,
81 		*copyright ;
82 	 } ;
83 
84 extern void initmenu(struct bl *bl) ;
85 extern void createhelp(struct moving_button *b,char *key) ;
86 extern void displaymenu(struct menu *b,int x,int y,int dx,int dy) ;
87 extern void menuevent(struct bl *bl,XEvent *event) ;
88