summaryrefslogtreecommitdiffstatshomepage
path: root/src/frontend
diff options
context:
space:
mode:
author therealmogminer@gmail.com <therealmogminer@gmail.com>2016-05-16 19:58:59 +0200
committer therealmogminer@gmail.com <therealmogminer@gmail.com>2016-05-16 19:59:15 +0200
commitb06be31dfe70c4d13f88b304e7e8dab515bd0919 (patch)
tree2bbce2c5b5902b647e33853aa087c59f0d5be2fb /src/frontend
parent0069d44ff7f06dca7d3b233305c8e13185867615 (diff)
Move slider_state and ui_menu_item into src/frontend/mame, nw
Diffstat (limited to 'src/frontend')
-rw-r--r--src/frontend/mame/ui/menu.h2
-rw-r--r--src/frontend/mame/ui/menuitem.h42
-rw-r--r--src/frontend/mame/ui/slider.h36
-rw-r--r--src/frontend/mame/ui/sliders.cpp2
-rw-r--r--src/frontend/mame/ui/submenu.cpp1
-rw-r--r--src/frontend/mame/ui/ui.cpp2
-rw-r--r--src/frontend/mame/ui/ui.h4
7 files changed, 85 insertions, 4 deletions
diff --git a/src/frontend/mame/ui/menu.h b/src/frontend/mame/ui/menu.h
index 041a409a2a6..c7638925cb0 100644
--- a/src/frontend/mame/ui/menu.h
+++ b/src/frontend/mame/ui/menu.h
@@ -16,7 +16,7 @@
#include "render.h"
#include "language.h"
#include "ui/ui.h"
-
+#include "ui/menuitem.h"
/***************************************************************************
CONSTANTS
diff --git a/src/frontend/mame/ui/menuitem.h b/src/frontend/mame/ui/menuitem.h
new file mode 100644
index 00000000000..92ceab86628
--- /dev/null
+++ b/src/frontend/mame/ui/menuitem.h
@@ -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__ \ No newline at end of file
diff --git a/src/frontend/mame/ui/slider.h b/src/frontend/mame/ui/slider.h
new file mode 100644
index 00000000000..ef3622a0ee5
--- /dev/null
+++ b/src/frontend/mame/ui/slider.h
@@ -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__ \ No newline at end of file
diff --git a/src/frontend/mame/ui/sliders.cpp b/src/frontend/mame/ui/sliders.cpp
index c466e5aced0..54121bcc400 100644
--- a/src/frontend/mame/ui/sliders.cpp
+++ b/src/frontend/mame/ui/sliders.cpp
@@ -14,7 +14,7 @@
#include "ui/ui.h"
#include "ui/menu.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)
{
diff --git a/src/frontend/mame/ui/submenu.cpp b/src/frontend/mame/ui/submenu.cpp
index 2537ef55a2d..c70d56b0f2c 100644
--- a/src/frontend/mame/ui/submenu.cpp
+++ b/src/frontend/mame/ui/submenu.cpp
@@ -12,6 +12,7 @@
#include "ui/ui.h"
#include "ui/submenu.h"
#include "ui/utils.h"
+#include "ui/menuitem.h"
#include <limits>
//-------------------------------------------------
diff --git a/src/frontend/mame/ui/ui.cpp b/src/frontend/mame/ui/ui.cpp
index fa7ad9daa53..05ba0138210 100644
--- a/src/frontend/mame/ui/ui.cpp
+++ b/src/frontend/mame/ui/ui.cpp
@@ -2815,5 +2815,5 @@ void mame_ui_manager::save_main_option()
void mame_ui_manager::menu_reset()
{
- ui_menu::stack_reset(machine());
+ ui_menu::stack_reset(machine());
} \ No newline at end of file
diff --git a/src/frontend/mame/ui/ui.h b/src/frontend/mame/ui/ui.h
index b59c36671ac..1005b50318e 100644
--- a/src/frontend/mame/ui/ui.h
+++ b/src/frontend/mame/ui/ui.h
@@ -19,6 +19,8 @@
#include "moptions.h"
#include "language.h"
#include "ui/uimain.h"
+#include "ui/menuitem.h"
+#include "ui/slider.h"
class ui_menu_item;
@@ -171,7 +173,7 @@ public:
virtual void popup_time_string(int seconds, std::string message) override;
virtual void image_display(const device_type &type, device_image_interface *image) override;
-
+
virtual void menu_reset() override;
private:
// instance variables