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