blob: 567b0a4e4990f8d7ed4e8918aa09233addb54f89 (
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
|
// license:BSD-3-Clause
// copyright-holders:Nicola Salmoria, Aaron Giles, Nathan Woods
/***************************************************************************
ui/widgets.h
Internal MAME widgets for the user interface.
***************************************************************************/
#ifndef MAME_FRONTEND_UI_WIDGETS_H
#define MAME_FRONTEND_UI_WIDGETS_H
#pragma once
#include "bitmap.h"
#include "render.h"
#include <memory>
#include <functional>
namespace ui {
/***************************************************************************
TYPE DEFINITIONS
***************************************************************************/
class widgets_manager
{
public:
widgets_manager(running_machine &machine);
render_texture *hilight_texture() { return m_hilight_texture.get(); }
render_texture *hilight_main_texture() { return m_hilight_main_texture.get(); }
render_texture *arrow_texture() { return m_arrow_texture.get(); }
class texture_destroyer
{
public:
texture_destroyer(render_manager &manager) : m_manager(manager) { }
void operator()(render_texture *texture) const { m_manager.get().texture_free(texture); }
private:
std::reference_wrapper<render_manager> m_manager;
};
using bitmap_ptr = std::unique_ptr<bitmap_argb32>;
using texture_ptr = std::unique_ptr<render_texture, texture_destroyer>;
private:
static void render_triangle(bitmap_argb32 &dest, bitmap_argb32 &source, const rectangle &sbounds, void *param);
bitmap_ptr m_hilight_bitmap;
texture_ptr m_hilight_texture;
bitmap_ptr m_hilight_main_bitmap;
texture_ptr m_hilight_main_texture;
texture_ptr m_arrow_texture;
};
} // namespace ui
#endif // MAME_FRONTEND_UI_WIDGETS_H
|