]> icculus.org git repositories - taylor/freespace2.git/blob - include/snazzyui.h
Initial revision
[taylor/freespace2.git] / include / snazzyui.h
1
2 /*
3  * $Logfile: /Freespace2/code/MenuUI/SnazzyUI.h $
4  * $Revision$
5  * $Date$
6  * $Author$
7  *
8  *  Header file for the Snazzy User Interface routines.
9  *
10  * $Log$
11  * Revision 1.1  2002/05/03 03:28:12  root
12  * Initial revision
13  *
14  * 
15  * 3     12/18/98 1:13a Dave
16  * Rough 1024x768 support for Direct3D. Proper detection and usage through
17  * the launcher.
18  * 
19  * 2     10/07/98 10:53a Dave
20  * Initial checkin.
21  * 
22  * 1     10/07/98 10:49a Dave
23  * 
24  * 17    4/09/98 5:51p Lawrance
25  * Be able to disable sounds for certain menus
26  * 
27  * 16    2/03/98 11:52p Lawrance
28  * call snazzy_flush() from game_flush()
29  * 
30  * 15    12/23/97 5:28p Hoffoss
31  * Made enter key act the same as clicking the mouse button in main hall
32  * screen.
33  * 
34  * 14    9/07/97 10:06p Lawrance
35  * let snazzy code keep track of mouse status
36  * 
37  * 13    8/11/97 9:48p Lawrance
38  * don't poll keyboard if not requested 
39  * 
40  * 12    2/25/97 11:11a Lawrance
41  * adding more functionality needed for ship selection screen
42  * 
43  * 11    12/10/96 4:18p Lawrance
44  * added snazzy_menu_close() call and integrated with existing menus
45  * 
46  * 10    12/09/96 2:53p Lawrance
47  * fixed bug where both the snazzy code and ui code were reading the
48  * keyboard, and the keypress from the snazzy code was being lost
49  * 
50  * 9     11/21/96 7:14p Lawrance
51  * converted menu code to use a file (menu.tbl) to get the data for the
52  * menu
53  * 
54  * 8     11/15/96 12:09p John
55  * Added new UI code.  Made mouse not return Enter when you click it.
56  * Changed the doSnazzyUI function and names to be snazzy_menu_xxx.   
57  * 
58  * 7     11/13/96 4:02p Lawrance
59  * complete over-haul of the menu system and the states associated with
60  * them
61  * 
62  * 6     11/13/96 8:32a Lawrance
63  * streamlined menu code
64  * 
65  * 5     11/06/96 8:54a Lawrance
66  * added revision templates, made more efficient
67  *
68  * $NoKeywords: $
69  *
70 */
71
72 #ifndef _SNAZZYUI_H
73 #define _SNAZZYUI_H
74
75 #define MAX_CHAR                150
76 #define ESC_PRESSED     -2
77
78 #include "pstypes.h"
79
80 typedef struct menu_region {
81         int     mask;                                   // mask color for the region
82         int     key;                                    // shortcut key for the region
83         char    text[MAX_CHAR]; // The text associated with this item.
84         int     click_sound;            // Id of sound to play when mask area clicked on
85 } MENU_REGION;
86
87 // These are the actions thare are returned in the action parameter.  
88 #define SNAZZY_OVER                     1       // mouse is over a region
89 #define SNAZZY_CLICKED          2       // mouse button has gone from down to up over a region
90
91 int snazzy_menu_do(ubyte *data, int mask_w, int mask_h, int num_regions, MENU_REGION *regions, int *action, int poll_key = 1, int *key = NULL);
92 void read_menu_tbl(char *menu_name, char *bkg_filename, char *mask_filename, MENU_REGION *regions, int* num_regions, int play_sound=1);
93 void snazzy_menu_add_region(MENU_REGION *region, char* text, int mask, int key, int click_sound = -1);
94
95 void snazzy_menu_init();                // Call the first time a snazzy menu is inited
96 void snazzy_menu_close();
97 void snazzy_flush();
98
99 #endif
100