summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/modules/font/font_none.cpp
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/modules/font/font_none.cpp
parent7b7f2a3fb02c4515392b307ea04bb968450bdbbf (diff)
Move font enumeration to OSD, separate font name from display name as needed for OSX
Diffstat (limited to 'src/osd/modules/font/font_none.cpp')
-rw-r--r--src/osd/modules/font/font_none.cpp48
1 files changed, 6 insertions, 42 deletions
diff --git a/src/osd/modules/font/font_none.cpp b/src/osd/modules/font/font_none.cpp
index de9d01bb103..2716b52cf8e 100644
--- a/src/osd/modules/font/font_none.cpp
+++ b/src/osd/modules/font/font_none.cpp
@@ -8,61 +8,25 @@
#include "font_module.h"
#include "modules/osdmodule.h"
-//-------------------------------------------------
-// font_open - attempt to "open" a handle to the
-// font with the given name
-//-------------------------------------------------
-
class osd_font_none : public osd_font
{
public:
virtual ~osd_font_none() { }
- virtual bool open(const char *font_path, const char *name, int &height) override;
- virtual void close() override;
- virtual bool get_bitmap(unicode_char chnum, bitmap_argb32 &bitmap, INT32 &width, INT32 &xoffs, INT32 &yoffs) override;
+ virtual bool open(std::string const &font_path, std::string const &name, int &height) override { return false; }
+ virtual void close() override { }
+ virtual bool get_bitmap(unicode_char chnum, bitmap_argb32 &bitmap, std::int32_t &width, std::int32_t &xoffs, std::int32_t &yoffs) override { return false; }
};
-bool osd_font_none::open(const char *font_path, const char *_name, int &height)
-{
- return false;
-}
-
-//-------------------------------------------------
-// font_close - release resources associated with
-// a given OSD font
-//-------------------------------------------------
-
-void osd_font_none::close()
-{
-}
-
-//-------------------------------------------------
-// font_get_bitmap - 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
-//-------------------------------------------------
-
-bool osd_font_none::get_bitmap(unicode_char chnum, bitmap_argb32 &bitmap, INT32 &width, INT32 &xoffs, INT32 &yoffs)
-{
- return false;
-}
-
class font_none : public osd_module, public font_module
{
public:
- font_none() : osd_module(OSD_FONT_PROVIDER, "none"), font_module()
- {
- }
+ font_none() : osd_module(OSD_FONT_PROVIDER, "none"), font_module() { }
virtual int init(const osd_options &options) override { return 0; }
- virtual osd_font *font_alloc() override
- {
- return global_alloc(osd_font_none);
- }
+ virtual osd_font::ptr font_alloc() override { return std::make_unique<osd_font_none>(); }
+ virtual bool get_font_families(std::string const &font_path, std::vector<std::pair<std::string, std::string> > &result) override { return false; }
};
MODULE_DEFINITION(FONT_NONE, font_none)
span> { /* terminal symbols denoted by reserved words */ TK_AND = FIRST_RESERVED, TK_BREAK, TK_DO, TK_ELSE, TK_ELSEIF, TK_END, TK_FALSE, TK_FOR, TK_FUNCTION, TK_GOTO, TK_IF, TK_IN, TK_LOCAL, TK_NIL, TK_NOT, TK_OR, TK_REPEAT, TK_RETURN, TK_THEN, TK_TRUE, TK_UNTIL, TK_WHILE, /* other terminal symbols */ TK_IDIV, TK_CONCAT, TK_DOTS, TK_EQ, TK_GE, TK_LE, TK_NE, TK_SHL, TK_SHR, TK_DBCOLON, TK_EOS, TK_FLT, TK_INT, TK_NAME, TK_STRING }; /* number of reserved words */ #define NUM_RESERVED (cast(int, TK_WHILE-FIRST_RESERVED+1)) typedef union { lua_Number r; lua_Integer i; TString *ts; } SemInfo; /* semantics information */ typedef struct Token { int token; SemInfo seminfo; } Token; /* state of the lexer plus state of the parser when shared by all functions */ typedef struct LexState { int current; /* current character (charint) */ int linenumber; /* input line counter */ int lastline; /* line of last token 'consumed' */ Token t; /* current token */ Token lookahead; /* look ahead token */ struct FuncState *fs; /* current function (parser) */ struct lua_State *L; ZIO *z; /* input stream */ Mbuffer *buff; /* buffer for tokens */ Table *h; /* to avoid collection/reuse strings */ struct Dyndata *dyd; /* dynamic structures used by the parser */ TString *source; /* current source name */ TString *envn; /* environment variable name */ } LexState; LUAI_FUNC void luaX_init (lua_State *L); LUAI_FUNC void luaX_setinput (lua_State *L, LexState *ls, ZIO *z, TString *source, int firstchar); LUAI_FUNC TString *luaX_newstring (LexState *ls, const char *str, size_t l); LUAI_FUNC void luaX_next (LexState *ls); LUAI_FUNC int luaX_lookahead (LexState *ls); LUAI_FUNC l_noret luaX_syntaxerror (LexState *ls, const char *s); LUAI_FUNC const char *luaX_token2str (LexState *ls, int token); #endif