summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/uimenu.h
blob: 3bc42964eae781f3ad76d96693e353a15dffe687 (plain) (blame)
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
81
82
83
84
/***************************************************************************

    uimenu.h

    Internal MAME menus for the user interface.

    Copyright Nicola Salmoria and the MAME Team.
    Visit http://mamedev.org for licensing and usage restrictions.

***************************************************************************/

#pragma once

#ifndef __UIMENU_H__
#define __UIMENU_H__

#include "mamecore.h"


/***************************************************************************
    CONSTANTS
***************************************************************************/

/* flags for menu items */
#define MENU_FLAG_LEFT_ARROW	(1 << 0)
#define MENU_FLAG_RIGHT_ARROW	(1 << 1)
#define MENU_FLAG_INVERT		(1 << 2)



/***************************************************************************
    TYPE DEFINITIONS
***************************************************************************/

typedef UINT32 (*ui_menu_handler)(UINT32 state);

typedef struct _ui_menu_item ui_menu_item;
struct _ui_menu_item
{
   const char *text;
   const char *subtext;
   UINT32 flags;
   void *ref;
};


typedef struct _menu_extra menu_extra;
struct _menu_extra
{
	float	top;			/* amount of extra height to add at the top */
	float	bottom;			/* amount of extra height to add at the bottom*/
	void 	(*render)(const menu_extra *extra, float x, float y, float x2, float y2);
	void *	param;			/* parameter to pass through */
};



/***************************************************************************
    FUNCTION PROTOTYPES
***************************************************************************/

/* initialization */
void ui_menu_init(running_machine *machine);

/* draw a menu, returning the number of visible items */
int ui_menu_draw(const ui_menu_item *items, int numitems, int selected, const menu_extra *extra);

/* master handler */
UINT32 ui_menu_ui_handler(running_machine *machine, UINT32 state);

/* menu keyboard handling */
int ui_menu_generic_keys(UINT32 *selected, int num_items, int visible_items);

/* menu stack management */
void ui_menu_stack_reset(void);
UINT32 ui_menu_stack_push(ui_menu_handler new_handler, UINT32 new_state);
UINT32 ui_menu_stack_pop(void);

/* force game select menu */
void ui_menu_force_game_select(void);
int ui_menu_is_force_game_select(void);


#endif	/* __UIMENU_H__ */