summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/osdepend.h
blob: c5c1aaf285d6825f6a2bf34b91bc559d61cd472a (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
// license:BSD-3-Clause
// copyright-holders:Aaron Giles
/***************************************************************************

    osdepend.h

    OS-dependent code interface.

*******************************************************************c********/

#pragma once

#ifndef __OSDEPEND_H__
#define __OSDEPEND_H__

#include "emucore.h"
#include "osdcore.h"
#include "unicode.h"
#include "cliopts.h"

// forward references
class input_type_entry;     // FIXME: including emu.h does not work because emu.h includes osdepend.h


//============================================================
//  TYPE DEFINITIONS
//============================================================

// ======================> osd_font interface

class osd_font
{
public:
    virtual ~osd_font() {}

    virtual bool open(const char *font_path, const char *name, int &height) = 0;
    virtual void close() = 0;
    virtual bool get_bitmap(unicode_char chnum, bitmap_argb32 &bitmap, INT32 &width, INT32 &xoffs, INT32 &yoffs) = 0;
};

// ======================> osd_interface

/* FIXME: this should be replaced by a proper module implementation
 * For the time being only one font provider can be linked
 */

osd_font *osd_font_alloc();

// description of the currently-running machine
class osd_interface
{
public:

	// general overridables
	virtual void init(running_machine &machine) = 0;
	virtual void update(bool skip_redraw) = 0;

	// debugger overridables
	virtual void init_debugger() = 0;
	virtual void wait_for_debugger(device_t &device, bool firststop) = 0;

	// audio overridables
	virtual void update_audio_stream(const INT16 *buffer, int samples_this_frame) = 0;
	virtual void set_mastervolume(int attenuation) = 0;
	virtual bool no_sound() = 0;

	// input overridables
	virtual void customize_input_type_list(simple_list<input_type_entry> &typelist) = 0;

	// video overridables
	virtual void *get_slider_list() = 0; // FIXME: returns slider_state *

	// font interface

	// font is allocated with global_alloc; therefore use global_free!
	osd_font *font_alloc() { return osd_font_alloc(); }

	// command option overrides
	virtual bool execute_command(const char *command) = 0;

};

#endif  /* __OSDEPEND_H__ */