rocksndiamonds-1.2.0
[rocksndiamonds.git] / src / buttons.h
1 /***********************************************************
2 *  Rocks'n'Diamonds -- McDuffin Strikes Back!              *
3 *----------------------------------------------------------*
4 *  (c) 1995-98 Artsoft Entertainment                       *
5 *              Holger Schemel                              *
6 *              Oststrasse 11a                              *
7 *              33604 Bielefeld                             *
8 *              phone: ++49 +521 290471                     *
9 *              email: aeglos@valinor.owl.de                *
10 *----------------------------------------------------------*
11 *  buttons.h                                               *
12 ***********************************************************/
13
14 #ifndef BUTTONS_H
15 #define BUTTONS_H
16
17 #include "main.h"
18
19 /* the following definitions are also used by tools.c */
20
21 /* some positions in the video tape control window */
22 #define VIDEO_DISPLAY1_XPOS     5
23 #define VIDEO_DISPLAY1_YPOS     5
24 #define VIDEO_DISPLAY2_XPOS     5
25 #define VIDEO_DISPLAY2_YPOS     41
26 #define VIDEO_DISPLAY_XSIZE     90
27 #define VIDEO_DISPLAY_YSIZE     31
28 #define VIDEO_BUTTON_XSIZE      18
29 #define VIDEO_BUTTON_YSIZE      18
30 #define VIDEO_CONTROL_XPOS      5
31 #define VIDEO_CONTROL_YPOS      77
32 #define VIDEO_CONTROL_XSIZE     (VIDEO_DISPLAY_XSIZE)
33 #define VIDEO_CONTROL_YSIZE     (VIDEO_BUTTON_YSIZE)
34
35 /* values for requests */
36 #define BUTTON_OK               (1L<<0)
37 #define BUTTON_NO               (1L<<1)
38 #define BUTTON_CONFIRM          (1L<<2)
39
40 /* values for choosing network player */
41 #define BUTTON_PLAYER_1         (1L<<10)
42 #define BUTTON_PLAYER_2         (1L<<11)
43 #define BUTTON_PLAYER_3         (1L<<12)
44 #define BUTTON_PLAYER_4         (1L<<13)
45
46 /* for DrawPlayerButton() */
47 #define DB_INIT                 0
48 #define DB_NORMAL               1
49
50 /* the following definitions are also used by screens.c */
51
52 /* buttons of the video tape player */
53 #define BUTTON_VIDEO_EJECT      1
54 #define BUTTON_VIDEO_STOP       2
55 #define BUTTON_VIDEO_PAUSE      3
56 #define BUTTON_VIDEO_REC        4
57 #define BUTTON_VIDEO_PLAY       5
58
59 /* values for video tape control */
60 #define VIDEO_STATE_PLAY_OFF    (1L<<0)
61 #define VIDEO_STATE_PLAY_ON     (1L<<1)
62 #define VIDEO_STATE_PLAY        (VIDEO_STATE_PLAY_OFF   | VIDEO_STATE_PLAY_ON)
63 #define VIDEO_STATE_REC_OFF     (1L<<2)
64 #define VIDEO_STATE_REC_ON      (1L<<3)
65 #define VIDEO_STATE_REC         (VIDEO_STATE_REC_OFF    | VIDEO_STATE_REC_ON)
66 #define VIDEO_STATE_PAUSE_OFF   (1L<<4)
67 #define VIDEO_STATE_PAUSE_ON    (1L<<5)
68 #define VIDEO_STATE_PAUSE       (VIDEO_STATE_PAUSE_OFF  | VIDEO_STATE_PAUSE_ON)
69 #define VIDEO_STATE_DATE_OFF    (1L<<6)
70 #define VIDEO_STATE_DATE_ON     (1L<<7)
71 #define VIDEO_STATE_DATE        (VIDEO_STATE_DATE_OFF   | VIDEO_STATE_DATE_ON)
72 #define VIDEO_STATE_TIME_OFF    (1L<<8)
73 #define VIDEO_STATE_TIME_ON     (1L<<9)
74 #define VIDEO_STATE_TIME        (VIDEO_STATE_TIME_OFF   | VIDEO_STATE_TIME_ON)
75 #define VIDEO_PRESS_PLAY_ON     (1L<<10)
76 #define VIDEO_PRESS_PLAY_OFF    (1L<<11)
77 #define VIDEO_PRESS_PLAY        (VIDEO_PRESS_PLAY_OFF   | VIDEO_PRESS_PLAY_ON)
78 #define VIDEO_PRESS_REC_ON      (1L<<12)
79 #define VIDEO_PRESS_REC_OFF     (1L<<13)
80 #define VIDEO_PRESS_REC         (VIDEO_PRESS_REC_OFF    | VIDEO_PRESS_REC_ON)
81 #define VIDEO_PRESS_PAUSE_ON    (1L<<14)
82 #define VIDEO_PRESS_PAUSE_OFF   (1L<<15)
83 #define VIDEO_PRESS_PAUSE       (VIDEO_PRESS_PAUSE_OFF  | VIDEO_PRESS_PAUSE_ON)
84 #define VIDEO_PRESS_STOP_ON     (1L<<16)
85 #define VIDEO_PRESS_STOP_OFF    (1L<<17)
86 #define VIDEO_PRESS_STOP        (VIDEO_PRESS_STOP_OFF   | VIDEO_PRESS_STOP_ON)
87 #define VIDEO_PRESS_EJECT_ON    (1L<<18)
88 #define VIDEO_PRESS_EJECT_OFF   (1L<<19)
89 #define VIDEO_PRESS_EJECT       (VIDEO_PRESS_EJECT_OFF  | VIDEO_PRESS_EJECT_ON)
90
91 /* special */
92 #define VIDEO_STATE_FFWD_OFF    ((1L<<20) | VIDEO_STATE_PAUSE_OFF)
93 #define VIDEO_STATE_FFWD_ON     (1L<<21)
94 #define VIDEO_STATE_FFWD        (VIDEO_STATE_FFWD_OFF   | VIDEO_STATE_FFWD_ON)
95 #define VIDEO_STATE_PBEND_OFF   (1L<<22)
96 #define VIDEO_STATE_PBEND_ON    (1L<<23)
97 #define VIDEO_STATE_PBEND       (VIDEO_STATE_PBEND_OFF  | VIDEO_STATE_PBEND_ON)
98
99 /* tags to draw video display labels or symbols only */
100 #define VIDEO_DISPLAY_DEFAULT           0
101 #define VIDEO_DISPLAY_LABEL_ONLY        1
102 #define VIDEO_DISPLAY_SYMBOL_ONLY       2
103
104 /* values for sound control */
105 #define BUTTON_SOUND_MUSIC      (1L<<0)
106 #define BUTTON_SOUND_LOOPS      (1L<<1)
107 #define BUTTON_SOUND_SIMPLE     (1L<<2)
108 #define BUTTON_RELEASED         0
109 #define BUTTON_PRESSED          (1L<<3)
110 #define BUTTON_OFF              0
111 #define BUTTON_ON               (1L<<4)
112 #define BUTTON_SOUND_MUSIC_OFF  (BUTTON_SOUND_MUSIC  | BUTTON_OFF)
113 #define BUTTON_SOUND_LOOPS_OFF  (BUTTON_SOUND_LOOPS  | BUTTON_OFF)
114 #define BUTTON_SOUND_SIMPLE_OFF (BUTTON_SOUND_SIMPLE | BUTTON_OFF)
115 #define BUTTON_SOUND_MUSIC_ON   (BUTTON_SOUND_MUSIC  | BUTTON_ON)
116 #define BUTTON_SOUND_LOOPS_ON   (BUTTON_SOUND_LOOPS  | BUTTON_ON)
117 #define BUTTON_SOUND_SIMPLE_ON  (BUTTON_SOUND_SIMPLE | BUTTON_ON)
118
119 /* values for game control */
120 #define BUTTON_GAME_STOP        (1L<<0)
121 #define BUTTON_GAME_PAUSE       (1L<<1)
122 #define BUTTON_GAME_PLAY        (1L<<2)
123
124 /* the following definitions are also used by game.c */
125
126 /* some positions in the game control window */
127 #define GAME_BUTTON_XSIZE       30
128 #define GAME_BUTTON_YSIZE       30
129 #define GAME_CONTROL_XPOS       5
130 #define GAME_CONTROL_YPOS       215
131 #define GAME_CONTROL_XSIZE      (3*GAME_BUTTON_XSIZE)
132 #define GAME_CONTROL_YSIZE      (1*GAME_BUTTON_YSIZE)
133
134 /* the following definitions are also used by editor.c */
135
136 /* some positions in the editor control window */
137 #define ED_BUTTON_EUP_XPOS      35
138 #define ED_BUTTON_EUP_YPOS      5
139 #define ED_BUTTON_EUP_XSIZE     30
140 #define ED_BUTTON_EUP_YSIZE     25
141 #define ED_BUTTON_EDOWN_XPOS    35
142 #define ED_BUTTON_EDOWN_YPOS    250
143 #define ED_BUTTON_EDOWN_XSIZE   30
144 #define ED_BUTTON_EDOWN_YSIZE   25
145 #define ED_BUTTON_ELEM_XPOS     6
146 #define ED_BUTTON_ELEM_YPOS     30
147 #define ED_BUTTON_ELEM_XSIZE    22
148 #define ED_BUTTON_ELEM_YSIZE    22
149
150 #define ED_BUTTON_EUP_Y2POS     140
151 #define ED_BUTTON_EDOWN_Y2POS   165
152 #define ED_BUTTON_ELEM_Y2POS    190
153
154 #define ED_BUTTON_CTRL_XPOS     5
155 #define ED_BUTTON_CTRL_YPOS     5
156 #define ED_BUTTON_CTRL_XSIZE    90
157 #define ED_BUTTON_CTRL_YSIZE    30
158 #define ED_BUTTON_FILL_XPOS     5
159 #define ED_BUTTON_FILL_YPOS     35
160 #define ED_BUTTON_FILL_XSIZE    90
161 #define ED_BUTTON_FILL_YSIZE    20
162 #define ED_BUTTON_LEFT_XPOS     5
163 #define ED_BUTTON_LEFT_YPOS     65
164 #define ED_BUTTON_LEFT_XSIZE    30
165 #define ED_BUTTON_LEFT_YSIZE    20
166 #define ED_BUTTON_UP_XPOS       35
167 #define ED_BUTTON_UP_YPOS       55
168 #define ED_BUTTON_UP_XSIZE      30
169 #define ED_BUTTON_UP_YSIZE      20
170 #define ED_BUTTON_DOWN_XPOS     35
171 #define ED_BUTTON_DOWN_YPOS     75
172 #define ED_BUTTON_DOWN_XSIZE    30
173 #define ED_BUTTON_DOWN_YSIZE    20
174 #define ED_BUTTON_RIGHT_XPOS    65
175 #define ED_BUTTON_RIGHT_YPOS    65
176 #define ED_BUTTON_RIGHT_XSIZE   30
177 #define ED_BUTTON_RIGHT_YSIZE   20
178
179 #define ED_BUTTON_EDIT_XPOS     5
180 #define ED_BUTTON_EDIT_YPOS     5
181 #define ED_BUTTON_EDIT_XSIZE    90
182 #define ED_BUTTON_EDIT_YSIZE    30
183 #define ED_BUTTON_CLEAR_XPOS    5
184 #define ED_BUTTON_CLEAR_YPOS    35
185 #define ED_BUTTON_CLEAR_XSIZE   90
186 #define ED_BUTTON_CLEAR_YSIZE   20
187 #define ED_BUTTON_UNDO_XPOS     5
188 #define ED_BUTTON_UNDO_YPOS     55
189 #define ED_BUTTON_UNDO_XSIZE    90
190 #define ED_BUTTON_UNDO_YSIZE    20
191 #define ED_BUTTON_EXIT_XPOS     5
192 #define ED_BUTTON_EXIT_YPOS     75
193 #define ED_BUTTON_EXIT_XSIZE    90
194 #define ED_BUTTON_EXIT_YSIZE    20
195
196 #define ED_BUTTON_MINUS_XPOS    2
197 #define ED_BUTTON_MINUS_YPOS    60
198 #define ED_BUTTON_MINUS_XSIZE   20
199 #define ED_BUTTON_MINUS_YSIZE   20
200 #define ED_WIN_COUNT_XPOS       (ED_BUTTON_MINUS_XPOS+ED_BUTTON_MINUS_XSIZE+2)
201 #define ED_WIN_COUNT_YPOS       ED_BUTTON_MINUS_YPOS
202 #define ED_WIN_COUNT_XSIZE      52
203 #define ED_WIN_COUNT_YSIZE      ED_BUTTON_MINUS_YSIZE
204 #define ED_BUTTON_PLUS_XPOS     (ED_WIN_COUNT_XPOS+ED_WIN_COUNT_XSIZE+2)
205 #define ED_BUTTON_PLUS_YPOS     ED_BUTTON_MINUS_YPOS
206 #define ED_BUTTON_PLUS_XSIZE    ED_BUTTON_MINUS_XSIZE
207 #define ED_BUTTON_PLUS_YSIZE    ED_BUTTON_MINUS_YSIZE
208
209 #define ED_COUNT_GADGET_XPOS    16
210 #define ED_COUNT_GADGET_YPOS    (16+3*MINI_TILEY+64)
211 #define ED_COUNT_GADGET_YSIZE   (ED_BUTTON_MINUS_YSIZE+4)
212 #define ED_COUNT_TEXT_XPOS      (ED_COUNT_GADGET_XPOS+DXSIZE+10)
213 #define ED_COUNT_TEXT_YPOS      (ED_COUNT_GADGET_YPOS+3)
214 #define ED_COUNT_TEXT_YSIZE     ED_COUNT_GADGET_YSIZE
215 #define ED_COUNT_VALUE_XPOS     (ED_COUNT_GADGET_XPOS+ED_BUTTON_MINUS_XSIZE+7)
216 #define ED_COUNT_VALUE_YPOS     ED_COUNT_TEXT_YPOS
217 #define ED_SIZE_GADGET_XPOS     (SX+21*MINI_TILEX)
218 #define ED_SIZE_GADGET_YPOS     (SY+4*MINI_TILEY)
219 #define ED_SIZE_GADGET_YSIZE    (ED_BUTTON_MINUS_YSIZE+4)
220 #define ED_SIZE_TEXT_XPOS       (ED_SIZE_GADGET_XPOS+DXSIZE+10)
221 #define ED_SIZE_TEXT_YPOS       (ED_SIZE_GADGET_YPOS+3)
222 #define ED_SIZE_TEXT_YSIZE      ED_COUNT_GADGET_YSIZE
223 #define ED_SIZE_VALUE_XPOS      (ED_SIZE_GADGET_XPOS+ED_BUTTON_MINUS_XSIZE+7)
224 #define ED_SIZE_VALUE_YPOS      ED_SIZE_TEXT_YPOS
225
226 /* values for asking control */
227 #define ED_BUTTON_CTRL          (1L<<0)
228 #define ED_BUTTON_FILL          (1L<<1)
229 #define ED_BUTTON_LEFT          (1L<<2)
230 #define ED_BUTTON_UP            (1L<<3)
231 #define ED_BUTTON_DOWN          (1L<<4)
232 #define ED_BUTTON_RIGHT         (1L<<5)
233 #define ED_BUTTON_EDIT          (1L<<6)
234 #define ED_BUTTON_CLEAR         (1L<<7)
235 #define ED_BUTTON_UNDO          (1L<<8)
236 #define ED_BUTTON_EXIT          (1L<<9)
237
238 #define ED_BUTTON_PRESSED       (1L<<10)
239 #define ED_BUTTON_RELEASED      (1L<<11)
240
241 #define ED_BUTTON_EUP           0
242 #define ED_BUTTON_EDOWN         1
243 #define ED_BUTTON_ELEM          2
244
245 void DrawVideoDisplay(unsigned long, unsigned long);
246 void DrawCompleteVideoDisplay(void);
247 void DrawSoundDisplay(unsigned long);
248 void DrawGameButton(unsigned long);
249 void DrawYesNoButton(unsigned long, int);
250 void DrawConfirmButton(unsigned long, int);
251 void DrawPlayerButton(unsigned long, int);
252 void DrawEditButton(unsigned long state);
253 void DrawCtrlButton(unsigned long state);
254 void DrawElemButton(int, int);
255 void DrawCountButton(int, int);
256 int CheckVideoButtons(int, int, int);
257 int CheckSoundButtons(int, int, int);
258 int CheckGameButtons(int, int, int);
259 int CheckYesNoButtons(int, int, int);
260 int CheckConfirmButton(int, int, int);
261 int CheckPlayerButtons(int, int, int);
262 int CheckEditButtons(int, int, int);
263 int CheckCtrlButtons(int, int, int);
264 int CheckElemButtons(int, int, int);
265 int CheckCountButtons(int, int, int);
266
267 #endif