A lot of changes

- Fix the broken itemindex of ComboBox  in the Settings dialog
- Change from LCID to uint32_t
- Rewrite the headers of the lang related functions (can handle the whole LCID as input)
- Add dummy functions to unix.c
- Add proper combobox handling in win_settings.c
- Added a lot of debug calls temporarily
- Reactivate every disabled option related to language changes
- Move lang_id to 86box.h from win.h
- Implement on-fly resource switch as discussed with OBattler
- Reimplement everything language related in the initialization section of the program
- Implemented the ladder of three points
1, what is the --lang?
2, what are definied in the config? (to be implemented)
3, what is the system language
This commit is contained in:
Laci bá
2021-11-09 22:33:54 +01:00
parent 11527d39b0
commit dafc429e93
7 changed files with 79 additions and 42 deletions

View File

@@ -15,6 +15,7 @@
*
* Copyright 2016-2020 Miran Grca.
* Copyright 2017-2020 Fred N. van Kempen.
* Copyright 2021 Laci bá'
*/
#ifndef EMU_86BOX_H
# define EMU_86BOX_H
@@ -90,6 +91,7 @@ extern int window_w, window_h, /* (C) window size and */
vid_resize, /* (C) allow resizing */
invert_display, /* (C) invert the display */
suppress_overscan; /* (C) suppress overscans */
extern uint32_t lang_id; /* (C) language code identifier */
extern int scale; /* (C) screen scale factor */
extern int dpi_scale; /* (C) DPI scaling of the emulated screen */
extern int vid_api; /* (C) video renderer */

View File

@@ -15,6 +15,7 @@
*
* Copyright 2016-2019 Miran Grca.
* Copyright 2017-2019 Fred N. van Kempen.
* Copyright 2021 Laci bá'
*/
#ifndef EMU_PLAT_H
# define EMU_PLAT_H
@@ -121,10 +122,10 @@ extern void plat_setfullscreen(int on);
extern void plat_resize(int x, int y);
extern void plat_vidapi_enable(int enabled);
extern void plat_vid_reload_options(void);
extern int plat_set_language(char* langcode);
extern uint32_t plat_language_code(char* langcode);
/* Resource management. */
extern void set_language(int id);
extern void set_language(uint32_t id);
extern wchar_t *plat_get_string(int id);

View File

@@ -17,6 +17,7 @@
* Copyright 2008-2019 Sarah Walker.
* Copyright 2016-2019 Miran Grca.
* Copyright 2017-2019 Fred N. van Kempen.
* Copyright 2021 Laci bá'
*/
#ifndef PLAT_WIN_H
# define PLAT_WIN_H
@@ -105,7 +106,6 @@ extern HINSTANCE hinstance;
extern HWND hwndMain,
hwndRender;
extern HANDLE ghMutex;
extern LCID lang_id;
extern HICON hIcon[256];
extern RECT oldclip;
extern int sbar_height, user_resize;
@@ -129,8 +129,8 @@ extern void do_start(void);
extern void do_stop(void);
/* Internal platform support functions. */
extern int has_language_changed(int id);
extern void set_language(int id);
extern int has_language_changed(uint32_t id);
extern void set_language(uint32_t id);
extern int get_vidpause(void);
extern void show_cursor(int);