summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/util/unicode.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Patched up some gaps in functionality and fixed some bugs. Vas Crabb2022-09-021-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ui: Added some missing functionality: * Added an option to copy input device IDs to the relevant menus. * Added an item for setting the software lists files path (-hashpath) to the folder setup menu. * Allow pasting text from clipboard in most places that allow typing (searching, entering filenames, entering barcodes). * Changed the software selection menu heading to be a bit less misleading. * Made barcode menu less eager to rebuild itself unnecessarily, and removed some confusing and apparently pointless code. Exposed more Lua bindings: * Added low-level palette objects. * Added indexed bitmap types. * Added a bitmap method for extracting pixels from a rectangular area as a packed binary string. * Changed screen device pixels method to return width and height in addition to the pixels. osd: Added some functionality and cleaned up a little: * Added a function for copying text to the clipboard. * Moved function for converting Windows error codes to standard error conditions to winutil.cpp so it can be used from more places. * Removed duplicate declaration of osd_get_clipboard_text and made the function noexcept (including fixing implementations). * Made macOS implementation of osd_get_clipboard_text skip the encoding conversion if it finds UTF-8 text first. * Changed the default -uimodekey setting so it doesn't lose the "not shift" that stops the default from interfering with UI paste. Various bug fixes: * util/unicode.cpp: Fixed the version of utf8_from_uchar that returns std::string blowing up on invalid codepoints. * util/bitmap.h: Fixed wrapping constructors for indexed bitmaps taking the wrong parameter type (nothing was using them before). * util/bitmap.cpp: Fixed potential use-after-free issues with bitmap palettes. * emu/input.cpp, emu/inputdev.cpp: Log 1-based device numbers, matching what's shown in the internal UI and used in tokens in CFG files. * emu/emumem.cpp: Added the bank tag to a fatal error message where it was missing. docs: Reworked and expanded documentation on configuring stable controller IDs. For translators, the changes are quite minor: * There's a menu item for copying a device ID to the clipboard, and associated success/failure messages. * There's the menu item for setting the software list file search path. * One of the lines in the software selection menu heading has changes as it could be interpreted as implying it showed a software list name.
* unicode.cpp: Fix build on non-WIN32 systems AJR2021-10-081-1/+1
|
* util/unicode.cpp: string_view treatment for the last two holdouts. Vas Crabb2021-10-091-4/+4
|
* Overdue internal UI enhancements (#8674) Vas Crabb2021-10-091-1/+0
| | | | | | | | | | | | | | | | * frontend: Added support for message context to localisations. * frontend: Added string_view versions of the message lookup functions. * frontend: Added a few more folder options to the internal UI. * emu/softlist.cpp: Use more appropriate containers. * Switched to Python 3 by default - this will become a requirement. * Updated msgfmt.py for message context support. * frontend: Show all software item info in the internal UI. * frontend: Search alternate titles in software selection menu. * 3rdparty/utf8proc: Updated to v2.6.1 (has several fixes). * frontend: Added software filters for common info fields. * frontend: Allow UI manager to hold onto persistent session data. * frontend: Cache software lists for eight machines. * frontend: Added support for loading localised system names. * frontend: Add UI for selecting localised system names.
* -ui: Made zoom controls a bit more intuitive. Vas Crabb2021-09-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * The UI controls are described as zoom in/out, but they had the opposite effect on the palette and tile viewers. That has been changed to make them consistent with the tilemap viewer. * Made the default zoom key not act as a toggle. People are familiar with the function of Ctrl+0/=/- in web browsers, so making them behave similarly in MAME should make it more approachable. Also added the default zoom key to the relevant documentation page. * Implemented the default zoom key for the palette and tile viewers. * In the tilemap viewer, if the view is in default expand to fit mode, zoom in/out starting from the actual zoom ratio. Once again, this behaves more like the zoom controls in a web browser displaying an image so it should be more intuitive. * Made more messages from the tilemap viewer localisable. -util/zippath.cpp: Fixed MT08074. * There were multiple issues at play here. After #8443 was applied, is_root was simply never returning true on Windows, as OSD_WINDOWS isn't actually defined outside libosd and libocore. This caused phantom parent items to appear in disk roots on Windows, but it meant that the check in zippath_resolve would always fail so the trailing backslash would be trimmed. Fixing the macro test in is_root meant the trailing backslash from C:\ would no longer be trimmed, which caused the stat in zippath_resolve to fail. -bigbord2.cpp: Hooked up floppy DRQ that had somehow got lost. -Reduced tag map lookups in several drivers and devices. -util/coretmpl.h: Removed an overload of bitswap that can be avoided using if constexpr. -Added doxygen comments to some classes, and fixed several doxygen warnings. -util, osd: Test for _WIN32 rather than WIN32. * In C++17 mode, WIN32 is no longer a predefined macro, although various things in 3rdparty define it to maintain legacy support. We're better off moving forward anyway for when WIN32 disappears entirely. (WIN32 is not a reserved name, while _WIN32 is, starting with an underscore follwed by an uppercase letter.)
* API cleanups and miscellaneous fixes. Vas Crabb2021-07-151-20/+12
| | | | | | | | | | | | | | | | emu/ioport.cpp: Allow controller files to override input sequences for inputs that don't use defaults, and to override the toggle setting for digital inputs. emu/config.cpp: Expose configuration level (mostly matters for controller files), improved verbose diagnostic messages, and moved a few things out of the global and preprocessor namespaces. docs: Added documentation for some controller configuration file features. The device mapping feature documentation will be merged in at some point. util/unicode.cpp, emu/input.cpp: API cleanups.
* Eliminate ARRAY_LENGTH template in favor of C++17's std::size AJR2021-02-141-1/+1
| | | | | | | | | | * osdcomm.h: Move definition of EQUIVALENT_ARRAY to coretmpl.h * sharc.cpp, gt64xxx.cpp, ym2413.cpp, gb_lcd.cpp, snes_ppu.cpp: Use STRUCT_MEMBER for save state registration * gio/newport.cpp, megadrive/svp.cpp, nes_ctrl/bcbattle.cpp, arm7.cpp, tms9995.cpp, pckeybrd.cpp, sa1110.cpp, sa1111.cpp, jangou_blitter.cpp, vic4567.cpp: Use std::fill(_n) instead of memset * emucore.h: Remove obsolete typedef
* Low-level #include overhaul AJR2021-01-021-0/+2
| | | | | | | - vecstream.h: Revert changes made in aa29519528cb3dbdbfac56819bea670ed8c56c5d. The std::string_view conversion has been made a non-member function (util::buf_to_string_view) and moved to coretmpl.h. - strformat.h: Remove the using declaration importing util::string_format into the global namespace. It has been moved to emucore.h and a few tool sources; other references have been qualified. - osdcore.h: Split out file, directory and path classes and methods to a new header (osdfile.h), Doxygenizing the documentation comments. - Disaggregate many #includes that were including other standard or custom headers. emu.h now includes basically the same things that it did, but other headers have been streamlined; for instance, emucore.h no longer stealth-includes osdcore.h several ways.
* unicode.h: Updates AJR2020-12-151-2/+13
| | | | | - Remove from emu.h (except for UTF8_xxx macros, which have been transplanted to emucore.h since a lot of drivers use them) and osdepend.h - Add std::string_view overrides for uchar_from_utf8 and normalize_unicode
* Fix spelling, tidy whitespace Zoë Blade2019-10-211-1/+1
|
* (nw) Clean up the mess on master Vas Crabb2019-03-261-69/+101
| | | | | | | | | | | | | This effectively reverts b380514764cf857469bae61c11143a19f79a74c5 and c24473ddff715ecec2e258a6eb38960cf8c8e98e, restoring the state at 598cd5227223c3b04ca31f0dbc1981256d9ea3ff. Before pushing, please check that what you're about to push is sane. Check your local commit log and ensure there isn't anything out-of-place before pushing to mainline. When things like this happen, it wastes everyone's time. I really don't need this in a week when real work™ is busting my balls and I'm behind where I want to be with preparing for MAME release.
* Revert "conflict resolution (nw)" andreasnaive2019-03-251-101/+69
| | | | | This reverts commit c24473ddff715ecec2e258a6eb38960cf8c8e98e, reversing changes made to 009cba4fb8102102168ef32870892438327f3705.
* Make search not suck as badly (use algorithm derived from Jaro-Winkler ↵ Vas Crabb2019-01-141-69/+101
| | | | similarity to match search strings, match on more useful stuff)
* Renamed flipendian -> swapendian, as I spent minutes trying to find the ↵ mooglyguy2018-11-051-4/+4
| | | | functions to tell to another person who spent minutes trying to find the functions, and we refer to such functions as swapping just about everywhere else in the codebase, nw
* srcclean (nw) Vas Crabb2017-08-271-2/+2
|
* Imgtool: Merged normalize_filename() into cannonicalize_path(), ↵ npwoods2017-07-301-0/+22
| | | | C++-ification (#2527)
* Revert "reordering the #include lets you build this file with latest mingw ↵ smf-2017-05-141-6/+3
| | | | | | headers (nw)" This reverts commit c3b10caf4e83135756ce400ec39d1b10b7d97b93.
* reordering the #include lets you build this file with latest mingw headers (nw) smf-2017-05-141-3/+6
|
* Fixed building using system utf8proc Julian Sikorski2017-01-261-1/+1
|
* srcclean (nw) Vas Crabb2017-01-221-4/+4
|
* Vas Crabb feedback: Nathan Woods2017-01-041-3/+3
| | | | | | | | 1. Changed the Win32 code to use _O_U8TEXT() 2. Reordered system #includes 3. Changed a number of 'std::wcout << ...' to use util::stream_format() I'm getting massive code compilation issues, and it isn't clear to me what the problem is. I'm committing my WIP right now, with the intention of reviewing the specifics soon.
* [Imgtool] Changed to use wcout/wcerr in order to support Unicode console output Nathan Woods2017-01-021-0/+36
| | | | I really don't like the prevalence of '#ifdef WIN32' in this change, both the _setmode() and bypassing codecvt. I strongly suspect that the latter is the consequence of some mistake that in practice doesn't cause problems in MSVC. I welcome all eyes.
* Introduced utf8proc and created wrapper code to expose a prettier API Nathan Woods2016-12-311-1/+88
|
* use standard types uintptr_t, char16_t and char32_t instead of FPTR, ↵ Miodrag Milanovic2016-10-221-15/+15
| | | | utf16_char, unicode_char (nw)
* srcclean (nw) Vas Crabb2016-09-261-3/+3
|
* Consolidated code that inputs characters into buffers Nathan Woods2016-09-191-0/+27
|
* Fix UTF-16 encode, pass UTF-16 to Windows character drawing (unfortunately ↵ Vas Crabb2016-08-021-8/+10
| | | | still no nice speaker icon)
* std::min and std:max instead of MIN and MAX, also some more macros converted ↵ Miodrag Milanovic2016-07-311-4/+4
| | | | to inline functions (nw)
* Cleanups and version bump Miodrag Milanovic2016-07-271-1/+1
|
* Converted menu_file_create to use std::string for its filename buffer Nathan Woods2016-07-021-0/+13
|
* C++-ification of src/lib/util/unicode.[cpp|h] Nathan Woods2016-07-021-72/+72
|
* clang-modernize part 1 (nw) Miodrag Milanovic2015-12-031-2/+2
|
* Rename *.c -> *.cpp in our source (nw) Miodrag Milanovic2015-11-081-0/+365