File: menu.h

package info (click to toggle)
atris 1.0.7.dfsg.1-3
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,712 kB
  • ctags: 649
  • sloc: ansic: 6,528; sh: 2,666; makefile: 156
file content (80 lines) | stat: -rw-r--r-- 2,070 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/*
 *                               Alizarin Tetris
 * A generic way to display menus.
 *
 * Copyright 2000, Kiri Wagstaff & Westley Weimer
 */

#ifndef __MENU_H
#define __MENU_H

#include "button.h"
#include "button.pro"

typedef struct _ATMenu
{
  int nButtons;
  ATButton** buttons;
  char* clicked; /* one per button */
  int x, y; /* upper left position */
  int w, h;
  int defaultchoice;
} ATMenu;

typedef struct _WalkRadio
{
    int n;		/* number of choices */
    char **label;	/* array of choice labels */
    int x,y;		/* upper-left corner */
    int defaultchoice;	/* the default choice */
    int (* action)(struct _WalkRadio *);
			/* what to do when they make a selection:
			 * a non-zero return value means we are done
			 * with this menu */
    int *var_to_set;
    void *data;
    int inactive;	/* if this is is set, we don't check this 
			 * this particular radio menu for input */
    /* --- set by setup_radio --- */
    Uint32 face_color[2];
    Uint32 text_color[2];
    Uint32 border_color[2];
    int w,h;
    SDL_Rect area;
    SDL_Surface **bitmap0;
    SDL_Surface **bitmap1;
} WalkRadio;

typedef struct _WalkRadioGroup {
    WalkRadio *wr;
    int n;		/* number of walk-radios */
    int cur;		/* currently selected walk radio button group */
} WalkRadioGroup;

#include "menu.pro"

#endif

/*
 * $Log: menu.h,v $
 * Revision 1.6  2000/11/06 00:24:01  weimer
 * add WalkRadioGroup modifications (inactive field for Kiri) and some support
 * for special pieces
 *
 * Revision 1.5  2000/11/02 03:06:20  weimer
 * better interface for walk-radio menus: we are now ready for Kiri to change
 * them to add run-time options ...
 *
 * Revision 1.4  2000/10/21 01:14:43  weimer
 * massic autoconf/automake restructure ...
 *
 * Revision 1.3  2000/10/12 00:49:08  weimer
 * added "AI" support and walking radio menus for initial game configuration
 *
 * Revision 1.2  2000/09/04 22:49:51  wkiri
 * gamemenu now uses the new nifty menus.  Also, added delete_menu.
 *
 * Revision 1.1  2000/09/04 19:54:26  wkiri
 * Added menus (menu.[ch]).
 *
 */