mirror of
https://github.com/holub/mame
synced 2025-10-07 17:27:06 +03:00
Move slider_state and ui_menu_item into src/frontend/mame, nw
This commit is contained in:
parent
0069d44ff7
commit
b06be31dfe
@ -80,6 +80,7 @@
|
|||||||
#include "debug/debugvw.h"
|
#include "debug/debugvw.h"
|
||||||
#include "image.h"
|
#include "image.h"
|
||||||
#include "network.h"
|
#include "network.h"
|
||||||
|
#include "ui/uimain.h"
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
#if defined(EMSCRIPTEN)
|
#if defined(EMSCRIPTEN)
|
||||||
|
@ -14,58 +14,11 @@
|
|||||||
#define __BASIC_UI_H__
|
#define __BASIC_UI_H__
|
||||||
|
|
||||||
#include "emu.h"
|
#include "emu.h"
|
||||||
/***************************************************************************
|
|
||||||
CONSTANTS
|
|
||||||
***************************************************************************/
|
|
||||||
|
|
||||||
// special menu item for separators
|
|
||||||
#define MENU_SEPARATOR_ITEM "---"
|
|
||||||
|
|
||||||
|
|
||||||
#define SLIDER_NOCHANGE 0x12345678
|
|
||||||
|
|
||||||
|
|
||||||
typedef INT32(*slider_update)(running_machine &machine, void *arg, int id, std::string *str, INT32 newval);
|
|
||||||
|
|
||||||
struct slider_state
|
|
||||||
{
|
|
||||||
slider_state * next; /* pointer to next slider */
|
|
||||||
slider_update update; /* callback */
|
|
||||||
void * arg; /* argument */
|
|
||||||
INT32 minval; /* minimum value */
|
|
||||||
INT32 defval; /* default value */
|
|
||||||
INT32 maxval; /* maximum value */
|
|
||||||
INT32 incval; /* increment value */
|
|
||||||
int id;
|
|
||||||
char description[1]; /* textual description */
|
|
||||||
};
|
|
||||||
|
|
||||||
// types of menu items (TODO: please expand)
|
|
||||||
enum class ui_menu_item_type
|
|
||||||
{
|
|
||||||
UNKNOWN,
|
|
||||||
SLIDER,
|
|
||||||
SEPARATOR
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
TYPE DEFINITIONS
|
TYPE DEFINITIONS
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
class ui_menu_item
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
const char *text;
|
|
||||||
const char *subtext;
|
|
||||||
UINT32 flags;
|
|
||||||
void *ref;
|
|
||||||
ui_menu_item_type type; // item type (eventually will go away when itemref is proper ui_menu_item class rather than void*)
|
|
||||||
|
|
||||||
inline bool is_selectable() const;
|
|
||||||
};
|
|
||||||
|
|
||||||
class ui_manager
|
class ui_manager
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
#include "render.h"
|
#include "render.h"
|
||||||
#include "language.h"
|
#include "language.h"
|
||||||
#include "ui/ui.h"
|
#include "ui/ui.h"
|
||||||
|
#include "ui/menuitem.h"
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
CONSTANTS
|
CONSTANTS
|
||||||
|
42
src/frontend/mame/ui/menuitem.h
Normal file
42
src/frontend/mame/ui/menuitem.h
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
// license:BSD-3-Clause
|
||||||
|
// copyright-holders:Nicola Salmoria, Aaron Giles, Nathan Woods
|
||||||
|
|
||||||
|
/***************************************************************************
|
||||||
|
|
||||||
|
ui/menuitem.h
|
||||||
|
|
||||||
|
Internal data representation for a UI menu item.
|
||||||
|
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifndef __UI_MENUITEM__
|
||||||
|
#define __UI_MENUITEM__
|
||||||
|
|
||||||
|
#include "emu.h"
|
||||||
|
|
||||||
|
// special menu item for separators
|
||||||
|
#define MENU_SEPARATOR_ITEM "---"
|
||||||
|
|
||||||
|
// types of menu items (TODO: please expand)
|
||||||
|
enum class ui_menu_item_type
|
||||||
|
{
|
||||||
|
UNKNOWN,
|
||||||
|
SLIDER,
|
||||||
|
SEPARATOR
|
||||||
|
};
|
||||||
|
|
||||||
|
class ui_menu_item
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
const char *text;
|
||||||
|
const char *subtext;
|
||||||
|
UINT32 flags;
|
||||||
|
void *ref;
|
||||||
|
ui_menu_item_type type; // item type (eventually will go away when itemref is proper ui_menu_item class rather than void*)
|
||||||
|
|
||||||
|
inline bool is_selectable() const;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // __UI_MENUITEM__
|
36
src/frontend/mame/ui/slider.h
Normal file
36
src/frontend/mame/ui/slider.h
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
// license:BSD-3-Clause
|
||||||
|
// copyright-holders:Nicola Salmoria, Aaron Giles, Nathan Woods
|
||||||
|
|
||||||
|
/***************************************************************************
|
||||||
|
|
||||||
|
ui/slider.h
|
||||||
|
|
||||||
|
Internal data representation for an adjustment slider.
|
||||||
|
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifndef __UI_SLIDER__
|
||||||
|
#define __UI_SLIDER__
|
||||||
|
|
||||||
|
#include "emu.h"
|
||||||
|
|
||||||
|
#define SLIDER_NOCHANGE 0x12345678
|
||||||
|
|
||||||
|
typedef INT32(*slider_update)(running_machine &machine, void *arg, int id, std::string *str, INT32 newval);
|
||||||
|
|
||||||
|
struct slider_state
|
||||||
|
{
|
||||||
|
slider_state * next; /* pointer to next slider */
|
||||||
|
slider_update update; /* callback */
|
||||||
|
void * arg; /* argument */
|
||||||
|
INT32 minval; /* minimum value */
|
||||||
|
INT32 defval; /* default value */
|
||||||
|
INT32 maxval; /* maximum value */
|
||||||
|
INT32 incval; /* increment value */
|
||||||
|
int id;
|
||||||
|
char description[1]; /* textual description */
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // __UI_SLIDER__
|
@ -14,7 +14,7 @@
|
|||||||
#include "ui/ui.h"
|
#include "ui/ui.h"
|
||||||
#include "ui/menu.h"
|
#include "ui/menu.h"
|
||||||
#include "ui/sliders.h"
|
#include "ui/sliders.h"
|
||||||
|
#include "ui/slider.h"
|
||||||
|
|
||||||
ui_menu_sliders::ui_menu_sliders(mame_ui_manager &mui, render_container *container, bool menuless_mode) : ui_menu(mui, container)
|
ui_menu_sliders::ui_menu_sliders(mame_ui_manager &mui, render_container *container, bool menuless_mode) : ui_menu(mui, container)
|
||||||
{
|
{
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
#include "ui/ui.h"
|
#include "ui/ui.h"
|
||||||
#include "ui/submenu.h"
|
#include "ui/submenu.h"
|
||||||
#include "ui/utils.h"
|
#include "ui/utils.h"
|
||||||
|
#include "ui/menuitem.h"
|
||||||
#include <limits>
|
#include <limits>
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
@ -19,6 +19,8 @@
|
|||||||
#include "moptions.h"
|
#include "moptions.h"
|
||||||
#include "language.h"
|
#include "language.h"
|
||||||
#include "ui/uimain.h"
|
#include "ui/uimain.h"
|
||||||
|
#include "ui/menuitem.h"
|
||||||
|
#include "ui/slider.h"
|
||||||
|
|
||||||
class ui_menu_item;
|
class ui_menu_item;
|
||||||
|
|
||||||
|
@ -24,8 +24,7 @@
|
|||||||
#include "modules/midi/midi_module.h"
|
#include "modules/midi/midi_module.h"
|
||||||
#include "modules/output/output_module.h"
|
#include "modules/output/output_module.h"
|
||||||
#include "emuopts.h"
|
#include "emuopts.h"
|
||||||
|
#include "../frontend/mame/ui/menuitem.h"
|
||||||
class ui_menu_item;
|
|
||||||
|
|
||||||
//============================================================
|
//============================================================
|
||||||
// Defines
|
// Defines
|
||||||
|
@ -10,9 +10,9 @@
|
|||||||
#define __OSDWINDOW__
|
#define __OSDWINDOW__
|
||||||
|
|
||||||
#include "emu.h"
|
#include "emu.h"
|
||||||
#include "ui/uimain.h"
|
|
||||||
#include "render.h"
|
#include "render.h"
|
||||||
#include "osdhelper.h"
|
#include "osdhelper.h"
|
||||||
|
#include "../frontend/mame/ui/menuitem.h"
|
||||||
|
|
||||||
// standard windows headers
|
// standard windows headers
|
||||||
#ifdef OSD_WINDOWS
|
#ifdef OSD_WINDOWS
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
//============================================================
|
//============================================================
|
||||||
|
|
||||||
#include "emu.h"
|
#include "emu.h"
|
||||||
#include "ui/uimain.h"
|
#include "../frontend/mame/ui/slider.h"
|
||||||
|
|
||||||
#include "osdcore.h"
|
#include "osdcore.h"
|
||||||
#include "modules/osdwindow.h"
|
#include "modules/osdwindow.h"
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
#include "texturemanager.h"
|
#include "texturemanager.h"
|
||||||
#include "targetmanager.h"
|
#include "targetmanager.h"
|
||||||
#include "effectmanager.h"
|
#include "effectmanager.h"
|
||||||
|
#include "../frontend/mame/ui/menuitem.h"
|
||||||
|
|
||||||
class running_machine;
|
class running_machine;
|
||||||
class osd_window;
|
class osd_window;
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
//
|
//
|
||||||
//============================================================
|
//============================================================
|
||||||
|
|
||||||
#include "ui/uimain.h"
|
#include "../frontend/mame/ui/slider.h"
|
||||||
|
|
||||||
#include "emucore.h"
|
#include "emucore.h"
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "ui/uimain.h"
|
#include "../frontend/mame/ui/menuitem.h"
|
||||||
|
|
||||||
class bgfx_effect;
|
class bgfx_effect;
|
||||||
class chain_manager;
|
class chain_manager;
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
#include <bgfx/bgfx.h>
|
#include <bgfx/bgfx.h>
|
||||||
|
|
||||||
#include <modules/lib/osdobj_common.h>
|
#include "modules/lib/osdobj_common.h"
|
||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "emu.h"
|
#include "emu.h"
|
||||||
#include "ui/uimain.h"
|
#include "../frontend/mame/ui/slider.h"
|
||||||
|
|
||||||
class bgfx_slider
|
class bgfx_slider
|
||||||
{
|
{
|
||||||
|
@ -18,7 +18,6 @@
|
|||||||
#include "emu.h"
|
#include "emu.h"
|
||||||
#include "drivenum.h"
|
#include "drivenum.h"
|
||||||
#include "render.h"
|
#include "render.h"
|
||||||
#include "ui/uimain.h"
|
|
||||||
#include "rendutil.h"
|
#include "rendutil.h"
|
||||||
#include "emuopts.h"
|
#include "emuopts.h"
|
||||||
#include "aviio.h"
|
#include "aviio.h"
|
||||||
@ -32,6 +31,7 @@
|
|||||||
#include "d3dcomm.h"
|
#include "d3dcomm.h"
|
||||||
#include "strconv.h"
|
#include "strconv.h"
|
||||||
#include "d3dhlsl.h"
|
#include "d3dhlsl.h"
|
||||||
|
#include "../frontend/mame/ui/slider.h"
|
||||||
|
|
||||||
|
|
||||||
//============================================================
|
//============================================================
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include "aviio.h"
|
#include "aviio.h"
|
||||||
|
#include "../frontend/mame/ui/menuitem.h"
|
||||||
|
|
||||||
//============================================================
|
//============================================================
|
||||||
// CONSTANTS
|
// CONSTANTS
|
||||||
@ -21,8 +22,6 @@
|
|||||||
// TYPE DEFINITIONS
|
// TYPE DEFINITIONS
|
||||||
//============================================================
|
//============================================================
|
||||||
|
|
||||||
struct slider_state;
|
|
||||||
|
|
||||||
class effect;
|
class effect;
|
||||||
class shaders;
|
class shaders;
|
||||||
|
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
#include "bgfx/chain.h"
|
#include "bgfx/chain.h"
|
||||||
#include "bgfx/chainmanager.h"
|
#include "bgfx/chainmanager.h"
|
||||||
#include "sliderdirtynotifier.h"
|
#include "sliderdirtynotifier.h"
|
||||||
|
#include "../frontend/mame/ui/menuitem.h"
|
||||||
|
|
||||||
class texture_manager;
|
class texture_manager;
|
||||||
class target_manager;
|
class target_manager;
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
#include "emucore.h"
|
#include "emucore.h"
|
||||||
#include "osdcore.h"
|
#include "osdcore.h"
|
||||||
#include "unicode.h"
|
#include "unicode.h"
|
||||||
#include "ui/uimain.h"
|
#include "../frontend/mame/ui/menuitem.h"
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
// MAME headers
|
// MAME headers
|
||||||
#include "emu.h"
|
#include "emu.h"
|
||||||
#include "uiinput.h"
|
#include "uiinput.h"
|
||||||
|
#include "ui/uimain.h"
|
||||||
|
|
||||||
// MAMEOS headers
|
// MAMEOS headers
|
||||||
#include "winmain.h"
|
#include "winmain.h"
|
||||||
|
Loading…
Reference in New Issue
Block a user