trunk/src/osd/sdl/sdlmain.c
| r242993 | r242994 | |
| 31 | 31 | #include <unistd.h> |
| 32 | 32 | #endif |
| 33 | 33 | |
| 34 | // only for strconv.h |
| 35 | #if defined(SDLMAME_WIN32) |
| 36 | #define WIN32_LEAN_AND_MEAN |
| 37 | #include <windows.h> |
| 38 | #endif |
| 39 | |
| 40 | |
| 34 | 41 | #ifdef SDLMAME_OS2 |
| 35 | 42 | #define INCL_DOS |
| 36 | 43 | #include <os2.h> |
| r242993 | r242994 | |
| 47 | 54 | #include "emu.h" |
| 48 | 55 | #include "clifront.h" |
| 49 | 56 | #include "emuopts.h" |
| 57 | #include "strconv.h" |
| 50 | 58 | |
| 51 | 59 | // OSD headers |
| 52 | 60 | #include "video.h" |
| r242993 | r242994 | |
| 1203 | 1211 | return result; |
| 1204 | 1212 | } |
| 1205 | 1213 | |
| 1206 | | osd_font sdl_osd_interface::font_open(const char *_name, int &height) |
| 1214 | osd_font *sdl_osd_interface::font_open(const char *_name, int &height) |
| 1207 | 1215 | { |
| 1208 | 1216 | // accept qualifiers from the name |
| 1209 | 1217 | astring name(_name); |
| r242993 | r242994 | |
| 1228 | 1236 | logfont.lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE; |
| 1229 | 1237 | |
| 1230 | 1238 | // copy in the face name |
| 1231 | | TCHAR *face = wstring_from_utf8(name); |
| 1232 | | wcsncpy(logfont.lfFaceName, face, sizeof(logfont.lfFaceName) / sizeof(TCHAR)); |
| 1239 | TCHAR *face = tstring_from_utf8(name); |
| 1240 | _tcsncpy(logfont.lfFaceName, face, sizeof(logfont.lfFaceName) / sizeof(TCHAR)); |
| 1233 | 1241 | logfont.lfFaceName[sizeof(logfont.lfFaceName) / sizeof(TCHAR)-1] = 0; |
| 1234 | 1242 | osd_free(face); |
| 1235 | 1243 | |
| 1236 | 1244 | // create the font |
| 1237 | 1245 | height = logfont.lfHeight; |
| 1238 | | osd_font font = reinterpret_cast<osd_font>(CreateFontIndirect(&logfont)); |
| 1246 | osd_font *font = reinterpret_cast<osd_font *>(CreateFontIndirect(&logfont)); |
| 1239 | 1247 | if (font == NULL) |
| 1240 | 1248 | return NULL; |
| 1241 | 1249 | |
| r242993 | r242994 | |
| 1248 | 1256 | DeleteDC(dummyDC); |
| 1249 | 1257 | |
| 1250 | 1258 | // if it doesn't match our request, fail |
| 1251 | | char *utf = utf8_from_wstring(realname); |
| 1259 | char *utf = utf8_from_tstring(realname); |
| 1252 | 1260 | int result = core_stricmp(utf, name); |
| 1253 | 1261 | osd_free(utf); |
| 1254 | 1262 | |
| r242993 | r242994 | |
| 1267 | 1275 | // a given OSD font |
| 1268 | 1276 | //------------------------------------------------- |
| 1269 | 1277 | |
| 1270 | | void sdl_osd_interface::font_close(osd_font font) |
| 1278 | void sdl_osd_interface::font_close(osd_font *font) |
| 1271 | 1279 | { |
| 1272 | 1280 | // delete the font ojbect |
| 1273 | 1281 | if (font != NULL) |
| r242993 | r242994 | |
| 1283 | 1291 | // pixel of a black & white font |
| 1284 | 1292 | //------------------------------------------------- |
| 1285 | 1293 | |
| 1286 | | bool sdl_osd_interface::font_get_bitmap(osd_font font, unicode_char chnum, bitmap_argb32 &bitmap, INT32 &width, INT32 &xoffs, INT32 &yoffs) |
| 1294 | bool sdl_osd_interface::font_get_bitmap(osd_font *font, unicode_char chnum, bitmap_argb32 &bitmap, INT32 &width, INT32 &xoffs, INT32 &yoffs) |
| 1287 | 1295 | { |
| 1288 | 1296 | // create a dummy DC to work with |
| 1289 | 1297 | HDC dummyDC = CreateCompatibleDC(NULL); |
| r242993 | r242994 | |
| 1425 | 1433 | // font with the given name |
| 1426 | 1434 | //------------------------------------------------- |
| 1427 | 1435 | |
| 1428 | | osd_font sdl_osd_interface::font_open(const char *_name, int &height) |
| 1436 | osd_font *sdl_osd_interface::font_open(const char *_name, int &height) |
| 1429 | 1437 | { |
| 1430 | | return (osd_font)NULL; |
| 1438 | return (osd_font *)NULL; |
| 1431 | 1439 | } |
| 1432 | 1440 | |
| 1433 | 1441 | //------------------------------------------------- |
| r242993 | r242994 | |
| 1435 | 1443 | // a given OSD font |
| 1436 | 1444 | //------------------------------------------------- |
| 1437 | 1445 | |
| 1438 | | void sdl_osd_interface::font_close(osd_font font) |
| 1446 | void sdl_osd_interface::font_close(osd_font *font) |
| 1439 | 1447 | { |
| 1440 | 1448 | } |
| 1441 | 1449 | |
| r242993 | r242994 | |
| 1447 | 1455 | // pixel of a black & white font |
| 1448 | 1456 | //------------------------------------------------- |
| 1449 | 1457 | |
| 1450 | | bool sdl_osd_interface::font_get_bitmap(osd_font font, unicode_char chnum, bitmap_argb32 &bitmap, INT32 &width, INT32 &xoffs, INT32 &yoffs) |
| 1458 | bool sdl_osd_interface::font_get_bitmap(osd_font *font, unicode_char chnum, bitmap_argb32 &bitmap, INT32 &width, INT32 &xoffs, INT32 &yoffs) |
| 1451 | 1459 | { |
| 1452 | 1460 | return false; |
| 1453 | 1461 | } |
trunk/src/osd/sdl/strconv.h
| r242993 | r242994 | |
| 1 | // license:BSD-3-Clause |
| 2 | // copyright-holders:Aaron Giles |
| 1 | 3 | //============================================================ |
| 2 | 4 | // |
| 3 | | // strconv.h - SDL string conversion |
| 5 | // strconv.h - String conversion |
| 4 | 6 | // |
| 5 | 7 | // Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team. |
| 6 | 8 | // Visit http://mamedev.org for licensing and usage restrictions. |
| 7 | 9 | // |
| 8 | 10 | //============================================================ |
| 9 | 11 | |
| 10 | | #ifndef __SDLSTRCONV__ |
| 11 | | #define __SDLSTRCONV__ |
| 12 | #ifndef __OSD_STRCONV__ |
| 13 | #define __OSD_STRCONV__ |
| 12 | 14 | |
| 13 | 15 | #include "osdcore.h" |
| 14 | 16 | |
| r242993 | r242994 | |
| 18 | 20 | // FUNCTION PROTOTYPES |
| 19 | 21 | //============================================================ |
| 20 | 22 | |
| 21 | | #ifdef SDLMAME_WIN32 |
| 23 | #if defined(SDLMAME_WIN32) || defined(OSD_WINDOWS) |
| 22 | 24 | |
| 25 | #define WIN32_LEAN_AND_MEAN |
| 26 | #include <windows.h> |
| 23 | 27 | // the result of these functions has to be released with osd_free() |
| 24 | 28 | |
| 25 | 29 | CHAR *astring_from_utf8(const char *s); |
| r242993 | r242994 | |
| 36 | 40 | #define utf8_from_tstring utf8_from_astring |
| 37 | 41 | #endif // UNICODE |
| 38 | 42 | |
| 43 | #if defined(SDLMAME_WIN32) |
| 44 | #define _tcsncpy wcsncpy |
| 45 | #endif |
| 46 | |
| 39 | 47 | #endif //SDLMAME_WIN32 |
| 40 | 48 | |
| 41 | | #endif // __SDLSTRCONV__ |
| 49 | |
| 50 | #endif // __OSD_STRCONV__ |
trunk/src/osd/windows/strconv.h
| r242993 | r242994 | |
| 2 | 2 | // copyright-holders:Aaron Giles |
| 3 | 3 | //============================================================ |
| 4 | 4 | // |
| 5 | | // strconv.h - Win32 string conversion |
| 5 | // strconv.h - String conversion |
| 6 | 6 | // |
| 7 | // Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team. |
| 8 | // Visit http://mamedev.org for licensing and usage restrictions. |
| 9 | // |
| 7 | 10 | //============================================================ |
| 8 | 11 | |
| 9 | | #ifndef __WIN_STRCONV__ |
| 10 | | #define __WIN_STRCONV__ |
| 12 | #ifndef __OSD_STRCONV__ |
| 13 | #define __OSD_STRCONV__ |
| 11 | 14 | |
| 12 | 15 | #include "osdcore.h" |
| 13 | 16 | |
| r242993 | r242994 | |
| 17 | 20 | // FUNCTION PROTOTYPES |
| 18 | 21 | //============================================================ |
| 19 | 22 | |
| 23 | #if defined(SDLMAME_WIN32) || defined(OSD_WINDOWS) |
| 24 | |
| 20 | 25 | // the result of these functions has to be released with osd_free() |
| 21 | 26 | |
| 22 | 27 | CHAR *astring_from_utf8(const char *s); |
| r242993 | r242994 | |
| 33 | 38 | #define utf8_from_tstring utf8_from_astring |
| 34 | 39 | #endif // UNICODE |
| 35 | 40 | |
| 41 | #endif //SDLMAME_WIN32 |
| 36 | 42 | |
| 37 | 43 | |
| 38 | | #endif // __WIN_STRCONV__ |
| 44 | #endif // __OSD_STRCONV__ |