summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/osdepend.h
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2016-03-16 19:42:01 +1100
committer Vas Crabb <vas@vastheman.com>2016-03-17 00:04:52 +1100
commita3b35f8bc689901ac82a2d47bbe344a57c3632ba (patch)
tree0ffb561e756b9b46e1021dff80a16a410eab61a7 /src/osd/osdepend.h
parent7b7f2a3fb02c4515392b307ea04bb968450bdbbf (diff)
Move font enumeration to OSD, separate font name from display name as needed for OSX
Diffstat (limited to 'src/osd/osdepend.h')
-rw-r--r--src/osd/osdepend.h30
1 files changed, 23 insertions, 7 deletions
diff --git a/src/osd/osdepend.h b/src/osd/osdepend.h
index 3e5b7d91e8f..b6ab45003e1 100644
--- a/src/osd/osdepend.h
+++ b/src/osd/osdepend.h
@@ -10,14 +10,18 @@
#pragma once
-#ifndef __OSDEPEND_H__
-#define __OSDEPEND_H__
+#ifndef MAME_OSD_OSDEPEND_H
+#define MAME_OSD_OSDEPEND_H
#include "emucore.h"
#include "osdcore.h"
#include "unicode.h"
#include "cliopts.h"
+#include <memory>
+#include <string>
+#include <vector>
+
// forward references
class input_type_entry; // FIXME: including emu.h does not work because emu.h includes osdepend.h
@@ -32,11 +36,22 @@ class input_type_entry; // FIXME: including emu.h does not work because emu.
class osd_font
{
public:
- virtual ~osd_font() {}
+ typedef std::unique_ptr<osd_font> ptr;
+
+ virtual ~osd_font() { }
- virtual bool open(const char *font_path, const char *name, int &height) = 0;
+ /** attempt to "open" a handle to the font with the given name */
+ virtual bool open(std::string const &font_path, std::string const &name, int &height) = 0;
+
+ /** release resources associated with a given OSD font */
virtual void close() = 0;
- virtual bool get_bitmap(unicode_char chnum, bitmap_argb32 &bitmap, INT32 &width, INT32 &xoffs, INT32 &yoffs) = 0;
+
+ /*!
+ * allocate and populate a BITMAP_FORMAT_ARGB32 bitmap containing
+ * the pixel values rgb_t(0xff,0xff,0xff,0xff) or
+ * rgb_t(0x00,0xff,0xff,0xff) for each pixel of a black & white font
+ */
+ virtual bool get_bitmap(unicode_char chnum, bitmap_argb32 &bitmap, std::int32_t &width, std::int32_t &xoffs, std::int32_t &yoffs) = 0;
};
// ======================> osd_interface
@@ -68,7 +83,8 @@ public:
virtual slider_state *get_slider_list() = 0;
// font interface
- virtual osd_font *font_alloc() = 0;
+ virtual osd_font::ptr font_alloc() = 0;
+ virtual bool get_font_families(std::string const &font_path, std::vector<std::pair<std::string, std::string> > &result) = 0;
// command option overrides
virtual bool execute_command(const char *command) = 0;
@@ -80,4 +96,4 @@ protected:
virtual ~osd_interface() { }
};
-#endif /* __OSDEPEND_H__ */
+#endif // MAME_OSD_OSDEPEND_H