OpenRCT2/src/openrct2/localisation/language.h

103 lines
3.1 KiB
C
Raw Normal View History

#pragma region Copyright (c) 2014-2017 OpenRCT2 Developers
2014-08-15 00:46:36 +02:00
/*****************************************************************************
* OpenRCT2, an open source clone of Roller Coaster Tycoon 2.
*
* OpenRCT2 is the work of many authors, a full list can be found in contributors.md
* For more information, visit https://github.com/OpenRCT2/OpenRCT2
2014-08-15 00:46:36 +02:00
*
* OpenRCT2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* A full copy of the GNU General Public License can be found in licence.txt
2014-08-15 00:46:36 +02:00
*****************************************************************************/
#pragma endregion
2014-08-15 00:46:36 +02:00
#ifndef _LANGUAGE_H_
#define _LANGUAGE_H_
2014-10-06 18:36:58 +02:00
#include "../common.h"
#include "../drawing/font.h"
2014-08-15 00:46:36 +02:00
enum {
LANGUAGE_UNDEFINED,
2017-10-09 10:53:09 +02:00
LANGUAGE_ARABIC,
LANGUAGE_CATALAN,
LANGUAGE_CHINESE_SIMPLIFIED,
LANGUAGE_CHINESE_TRADITIONAL,
LANGUAGE_CZECH,
LANGUAGE_GERMAN,
LANGUAGE_ENGLISH_UK,
LANGUAGE_ENGLISH_US,
2017-10-09 10:53:09 +02:00
LANGUAGE_SPANISH,
LANGUAGE_FRENCH,
2017-10-09 10:53:09 +02:00
LANGUAGE_ITALIAN,
LANGUAGE_JAPANESE,
LANGUAGE_KOREAN,
LANGUAGE_HUNGARIAN,
2017-10-09 10:53:09 +02:00
LANGUAGE_DUTCH,
LANGUAGE_NORWEGIAN,
LANGUAGE_POLISH,
LANGUAGE_PORTUGUESE_BR,
LANGUAGE_RUSSIAN,
2017-10-09 10:53:09 +02:00
LANGUAGE_FINNISH,
LANGUAGE_SWEDISH,
LANGUAGE_COUNT
2014-08-15 00:46:36 +02:00
};
2015-07-26 18:50:01 +02:00
#define FONT_OPENRCT2_SPRITE NULL
2016-05-12 23:57:40 +02:00
typedef struct language_descriptor {
const char *locale;
const utf8 *english_name;
const utf8 *native_name;
2017-01-03 22:57:15 +01:00
#ifndef NO_TTF
TTFFontSetDescriptor *font;
2017-01-03 22:57:15 +01:00
#else
void * font;
2017-01-03 22:57:15 +01:00
#endif // NO_TTF
uint8 rct2_original_id;
2015-07-26 18:50:01 +02:00
} language_descriptor;
#ifdef __cplusplus
extern "C" {
#endif
2015-07-26 18:50:01 +02:00
extern const language_descriptor LanguagesDescriptors[LANGUAGE_COUNT];
2017-01-04 22:17:08 +01:00
extern sint32 gCurrentLanguage;
2015-07-26 18:50:01 +02:00
extern bool gUseTrueTypeFont;
2014-08-15 00:46:36 +02:00
2015-07-27 02:09:24 +02:00
extern const utf8 BlackUpArrowString[];
extern const utf8 BlackDownArrowString[];
extern const utf8 BlackLeftArrowString[];
extern const utf8 BlackRightArrowString[];
extern const utf8 CheckBoxMarkString[];
2014-08-15 00:46:36 +02:00
const char *language_get_string(rct_string_id id);
2017-01-04 22:17:08 +01:00
bool language_open(sint32 id);
void language_close_all();
2014-08-15 00:46:36 +02:00
2015-07-26 01:55:17 +02:00
uint32 utf8_get_next(const utf8 *char_ptr, const utf8 **nextchar_ptr);
utf8 *utf8_write_codepoint(utf8 *dst, uint32 codepoint);
2017-01-04 22:17:08 +01:00
sint32 utf8_insert_codepoint(utf8 *dst, uint32 codepoint);
bool utf8_is_codepoint_start(const utf8 *text);
void utf8_remove_format_codes(utf8 *text, bool allowcolours);
2017-01-04 22:17:08 +01:00
sint32 utf8_get_codepoint_length(sint32 codepoint);
sint32 utf8_length(const utf8 *text);
wchar_t *utf8_to_widechar(const utf8 *src);
utf8 *widechar_to_utf8(const wchar_t *src);
2015-07-26 01:55:17 +02:00
2017-01-04 22:17:08 +01:00
utf8 *rct2_language_string_to_utf8(const char *src, size_t srcSize, sint32 languageId);
2015-09-08 19:46:22 +02:00
bool language_get_localised_scenario_strings(const utf8 *scenarioFilename, rct_string_id *outStringIds);
2016-06-25 17:34:35 +02:00
rct_string_id language_allocate_object_string(const utf8 * target);
void language_free_object_string(rct_string_id stringId);
2016-07-04 19:53:35 +02:00
rct_string_id language_get_object_override_string_id(const char * identifier, uint8 index);
2015-09-08 19:46:22 +02:00
#ifdef __cplusplus
}
#endif
2014-10-21 02:08:55 +02:00
#endif