Commit Graph

100431 Commits

Author SHA1 Message Date
aryanrawlani28
cbff58200f GUI: U32: Use u32 for EditRecordDialog and RecorderDialog
- Mark _authors as U32String
- Adjust accordingly in EditRecordDialog
- Some janitorial whitespaces fixes
2020-08-30 14:43:41 +02:00
aryanrawlani28
7a19c7ffee I18N: Update POTFILES
In the previous commit, some new places where translations could be used were found. This commit adds the relevant files to POTFILES.
2020-08-30 14:43:41 +02:00
aryanrawlani28
4b6976c558 GUI: U32: Reduce number of files changed and fixes
Up until last commit, everything was working fine but the amount of files changed was too large. This commit tries to reduce the changes.

- Add a fake constructor to Keymap, text-to-speech, setDescription (save-state)
- Redirecting functions for PopUpWidget::appendEntry, ButtonWidget::setLabel, GUIErrorMessage
- Use the above functions and constructors to reduce changes in Engines
- Fix warnings being in unicode. Only output english text in - Warnings, Errors, etc.
- Mark some strings as "translation" strings. (Not yet added to POTFILES)
- Remove some CP related things from po/modules.mk
- Previously used some Common::convertToU32 where it was not necessary, replace this with u32constructor
2020-08-30 14:43:41 +02:00
aryanrawlani28
ffc89d1a2b GUI: U32: SCUMM: Make variables in help to use U32
Make titles and other translation dependent variables to use u32
2020-08-30 14:43:41 +02:00
aryanrawlani28
bd19eaa5bf GUI: U32: More code improvements in engines and misc fixes
- Xeen's GUIError now takes in U32String
- Scumm's ValueDisplayDialog takes in U32
- Mohawk's InfoDialog & PauseDialog takes in U32
- Mohawk - in riven.cpp, Some assignment fixes
- Backends -in sdl.cpp, Remove incorrect conversion from iso8859 when setting text in clipboard
- Graphics - Add u32 strings instead of decoding each piece in format
2020-08-30 14:43:41 +02:00
aryanrawlani28
f46be5c766 GUI: U32: Improve splitting osd messages
Use iterators for construction instead of continous adding
2020-08-30 14:43:41 +02:00
aryanrawlani28
d3e64b2df4 GUI: U32: Use const-references for tooltips 2020-08-30 14:43:41 +02:00
aryanrawlani28
d12c6c4338 GUI: U32: Code cleanup
- Remove extra parantheses leftover from temp code
- SaveLoadDialog - do not encode when setting labels
- Remove mapping variable from ThemeEngine::loadScalableFont (and use default 0)
- Remove incorrect u32 constructor wrapper from confman.set in eventrecorder.cpp
2020-08-30 14:43:41 +02:00
aryanrawlani28
185fb72783 GUI: U32: Improve U32 code
- Revert accidentally put translations in mt32.cpp
- Use U32::format in some places earlier missed
- Add %u and %i for u32::format
- Add support for GUIErrorMsgFormat to use u32::format internally
- Use the above whereever needed
- Improve linux tts by removing redundant code
- Some places I had changed nullptr -> "". Revert this
2020-08-30 14:43:41 +02:00
aryanrawlani28
22ef76638c GUI: U32: Return visual from convertBiDiU32String 2020-08-30 14:43:41 +02:00
aryanrawlani28
cec0985d5a GUI: U32: Update credits.pl script to not write ascii string
- Also generate new credits file to reflect above changes
- Remove ascii checks from about dialog
2020-08-30 14:43:41 +02:00
aryanrawlani28
b6278f3400 GUI: U32: Write translation description and size for english language also as uint32BE.
All blocks of sizes are now written in uint32BE.
2020-08-30 14:43:41 +02:00
aryanrawlani28
9573f1e515 GUI: U32: Remove useless check when converting bidiString 2020-08-30 14:43:41 +02:00
aryanrawlani28
77937f3e2b GUI: U32: Remove more redundant code, and add UTF-8 check
Modifies the CREATE_TRANSLATIONS tool.

- Remove _charset for PoMessageEntryList
- Add useUTF8 bool variable and helper function
- Add UTF-8 checking for each po file. Error out if file is not coded in UTF-8.
2020-08-30 14:43:41 +02:00
aryanrawlani28
3d97be2559 GUI: U32: Remove redundant code
Because po files now (should) use UTF-8, a bunch of code in ScummVM is redundant. This commit addresses that.

- Remove charsetMapping and related variables.
- Remove the code that used these functions.
- Remove cp_parser.cpp. This is removed because the use of codepages is no longer needed.
- Remove iso-8859-x codepages (see above message)
- Always set mapping as 0 in ThemeEngine::loadScalableFont
- Check if ascii or not by getting charset in about dialog.
2020-08-30 14:43:41 +02:00
aryanrawlani28
810b7cfccc GUI: U32: Write block sizes as Uint32BE
- Changes made in create_translations tool and translations.cpp
- After converting po files to UTF-8, length of block did not fit in 16 bits. This commit addresses that.
2020-08-30 14:43:41 +02:00
aryanrawlani28
546fe374df GRAPHICS: Properly assign chars in handleEllipsis according to stringtype 2020-08-30 14:43:41 +02:00
aryanrawlani28
fc91436ea6 GUI: U32: Remove charsets being written to .dat 2020-08-30 14:43:41 +02:00
aryanrawlani28
6747e354b8 GUI: U32: Load translation info correctly 2020-08-30 14:43:41 +02:00
aryanrawlani28
dc1c82b74e GUI: U32: Define new translation version "4" 2020-08-30 14:43:41 +02:00
aryanrawlani28
085f375c98 GUI: U32: Store messages as U32Strings and remove codepages reading from .dat
- The previous commit removes all codepage additions to the create_translations tool.
- Following that, this commit removes all the reading from .dat file related to codepages
2020-08-30 14:43:41 +02:00
aryanrawlani28
79c518e9c1 GUI: U32: I18N: Remove codepages from create_translations tool
- Removed because all .po files will use UTF-8
2020-08-30 14:43:41 +02:00
aryanrawlani28
e91f968992 GUI: U32: encode and use c strings for translations in macos dialogs 2020-08-30 14:43:41 +02:00
aryanrawlani28
8cfa8a5589 GUI: U32: Use u32 for menu items in mac 2020-08-30 14:43:41 +02:00
aryanrawlani28
4bcac1df17 GUI: U32: Use u32 in clipboards for MacOS 2020-08-30 14:43:41 +02:00
aryanrawlani28
a9a816e7fe GUI: U32: Improve U32String::format
- Keep adding chars and strings to output instead of deleting and inserting at specific pos
- Use const_iterators for input
2020-08-30 14:43:41 +02:00
aryanrawlani28
c142360bf4 GUI: U32: Add minimal implementation for itoa (base 10) 2020-08-30 14:43:41 +02:00
aryanrawlani28
a9bfe35216 GUI: U32: More issue fixes and general improvements
- Use the fake constructor for message dialog less often
- solve errors regarding comparision between string and u32string in midi
- solve errors in testbed/speech related to ttsMan->say
- fix unsigned comparision warning in tab.cpp
- fix issue with static strings and translations in sdl-graphics
2020-08-30 14:43:41 +02:00
aryanrawlani28
da380a9002 GUI: U32: Fix issues with ustr formatting
- Fix one off error with 'pos'
- Fix last line not being inserted in osdMessage when display
2020-08-30 14:43:41 +02:00
aryanrawlani28
521acaf459 GUI: RTL: Fix 1-off issue for drawing u32 strings
When RTL mode is on, previously it was fixed in a commit. This commit just reapplies that, for u32 string drawing.
2020-08-30 14:43:41 +02:00
aryanrawlani28
4506bcd9f3 GUI: U32: Fix compilation errors
After rebasing to get even with master, some compilation errors occured. This commit fixes that.
2020-08-30 14:43:41 +02:00
aryanrawlani28
b9e1ac102d GUI: U32: properly cleanupHotkey with u32 const iterators 2020-08-30 14:43:41 +02:00
aryanrawlani28
6987d1a674 GUI: U32: Use u32 for KeysDialog.
- Turn titles into u32
- change tooltip "0" -> U32String("")
- Use u32::format where necessary
2020-08-30 14:43:41 +02:00
aryanrawlani28
ba0d57f350 GUI: Compare iterator condition properly for about dialog 2020-08-30 14:43:41 +02:00
aryanrawlani28
e22b32abfe GUI: U32: Use Common::U32String::format where necessary and GUIError to u32
- Where necessary as in, where translated messages are used.
- GUIErrorMessage now takes in U32String
- error messages across some engines use U32Strings. they are changed because they show a message dialog.
2020-08-30 14:43:41 +02:00
aryanrawlani28
1ca1712b4d GUI: U32: Fix problems with u32strings formatting
- Improve U32's format helper
- Add insertString helper to u32
2020-08-30 14:43:41 +02:00
aryanrawlani28
0118839c59 GUI: U32: Use u32 for tts (MacOS) 2020-08-30 14:43:41 +02:00
aryanrawlani28
bcbe2fe2ea GUI: U32: Enable u32 for tts (Linux) 2020-08-30 14:43:41 +02:00
aryanrawlani28
ef7ec444d3 GUI: U32: Enable u32 for tts (Windows)
They always take in U32 strings now.

- Revert tts descriptions to string, they don't use translations, so better to keep it as strings.
- Make read() take in const U32 references.
2020-08-30 14:43:41 +02:00
aryanrawlani28
d4d5b8906e GUI: U32: Begin making TTS take in U32Strings for saying
Only for strings without an explicit action. The first level takes in a u32 string, encodes it, and passes it along further with the default action

- For gui widgets, the strings are passed in as native u32 strings.
- For everything else, they are being converted to u32 by Common::convertToU32... and then being passed along
2020-08-30 14:43:41 +02:00
aryanrawlani28
bed05ea134 GUI: U32: Fix compilation errors across entire project
After the initial changes just to scummvm/gui for u32, this commit includes the whole project

- Widget creations now always have u32 descriptions, labels, or tooltips
- Message dialogs make use of default arguments instead of providing the same argument explicitly
- encode String::format properly before passing on as argument where necessary
- Modify hugo utils (yesNoBox and notify box) to use u32
- Also provide fake constructors for the above which redirect to the u32 constructor
- Convert all keymap descriptions to u32 across all engines
- showConfirmationDialog in mohawk now uses u32
- showScummVMDialog also uses u32
- Scumm engine has dialogs now which use u32
- General fixes and wrapping convertToU32String for setLabels and related functions
- Add a fake constructor to MesssageDialog which redirects to the u32 constructor
2020-08-30 14:43:41 +02:00
aryanrawlani28
fd763b61e5 GUI: U32: Add U32String conversion helpers to str.cpp
This commit adds a constructor and a "=" operator to allow conversion from u32strings->strings
2020-08-30 14:43:41 +02:00
aryanrawlani28
49c36c2b45 GUI: U32: Begin converting texts in clipboards to u32strings
With this commit the base class variables and the parts where getClipboard and setClipboard are used is changed accordingly.
2020-08-30 14:43:41 +02:00
aryanrawlani28
cbc83065c0 GUI: U32: Fix warnings with printf statements
Command line printfs used some functions which returned u32 strings. Correctly encode them and then turn into c_str
2020-08-30 14:43:41 +02:00
aryanrawlani28
c0458adec2 GUI: U32: Use u32 for about dialog 2020-08-30 14:43:41 +02:00
aryanrawlani28
3641e24daa JANITORIAL: Add missing space 2020-08-30 14:43:41 +02:00
aryanrawlani28
b9a449480b GUI: U32: Remove u32::format references
- Removed because implicit conversion can simply handle this usecase
2020-08-30 14:43:41 +02:00
aryanrawlani28
160a1320cc GUI: U32: Rename more temp code and fix issues
- Remove convertFromU32.. where necessary
- Replace convertFromU32 to .encode() for better readability
- Fix spacing issues in tabs
- Fix spacing issues in popups
- Fix weird font rendering in certain menus.
- Fix dialog changing sizes by huge amount when changing languages
- Some minor changes from String::format to U32String::Format
2020-08-30 14:43:41 +02:00
aryanrawlani28
96912f4adb GUI: U32: Rename some references of strings to use U32() & not helper method 2020-08-30 14:43:41 +02:00
aryanrawlani28
f800ca4ada GUI: U32: Convert majority of code to use U32
This commit also includes some additional major changes.

- Return U32String from TransMan getTranslation()
- Change tooltips to be U32Strings
- Remove temporary code of convertToU32String
- U32 Support various dialogs (Browser, FileBrowser, Messages, Chooser, etc)
- U32 for music plugins
- U32 for OSD messages
- Add some helper functions to ustr.cpp
- Change default tooltips from nullptr & 0 -> ""
- Some runtime exceptions may occur when changing languages due to incorrect String::Format
2020-08-30 14:43:41 +02:00