1 /*********************************************************************
2 
3   usrintrf.h
4 
5   Functions used to handle MAME's crude user interface.
6 
7 *********************************************************************/
8 
9 #ifndef USRINTRF_H
10 #define USRINTRF_H
11 
12 struct DisplayText
13 {
14 	const char *text;	/* 0 marks the end of the array */
15 	int color;	/* see #defines below */
16 	int x;
17 	int y;
18 };
19 
20 #define UI_COLOR_NORMAL 0	/* white on black text */
21 #define UI_COLOR_INVERSE 1	/* black on white text */
22 
23 #define SEL_BITS 12		/* main menu selection mask */
24 #define SEL_BITS2 4		/* submenu selection masks */
25 #define SEL_MASK ((1<<SEL_BITS)-1)
26 #define SEL_MASK2 ((1<<SEL_BITS2)-1)
27 
28 extern UINT8 ui_dirty;
29 
30 struct GfxElement *builduifont(void);
31 void pick_uifont_colors(void);
32 void displaytext(struct mame_bitmap *bitmap,const struct DisplayText *dt);
33 
34 void ui_drawchar(struct mame_bitmap *dest, int ch, int color, int sx, int sy);
35 void ui_text(struct mame_bitmap *bitmap,const char *buf,int x,int y);
36 void ui_drawbox(struct mame_bitmap *bitmap,int leftx,int topy,int width,int height);
37 void ui_copyright_and_warnings(void);
38 void ui_displaymessagewindow(struct mame_bitmap *bitmap,const char *text);
39 void ui_displaymenu(struct mame_bitmap *bitmap,const char **items,const char **subitems,char *flag,int selected,int arrowize_subitem);
40 void set_ui_visarea (int xmin, int ymin, int xmax, int ymax);
41 
42 void init_user_interface(void);
43 int handle_user_interface(struct mame_bitmap *bitmap);
44 void setup_menu_init(void);
45 
46 void generate_xml_dat(void);
47 
48 int setup_active(void);
49 
50 #if defined(__sgi)
51 int is_game_paused(void);
52 #endif
53 
54 #ifdef __GNUC__
55 void CLIB_DECL usrintf_showmessage(const char *text,...)
56       __attribute__ ((format (printf, 1, 2)));
57 
58 void CLIB_DECL usrintf_showmessage_secs(int seconds, const char *text,...)
59       __attribute__ ((format (printf, 2, 3)));
60 #else
61 void CLIB_DECL usrintf_showmessage(const char *text,...);
62 void CLIB_DECL usrintf_showmessage_secs(int seconds, const char *text,...);
63 #endif
64 
65 #endif
66