src/strings_type.h
author terom@frrb.lan
Fri, 19 Dec 2008 01:32:07 +0200
changeset 10438 51bff16a04c9
parent 10249 77b68778b102
permissions -rw-r--r--
initial mini-map stuff
8114
dd6d21dc99c1 (svn r11675) -Codechange: split the string types from the string functions.
rubidium
parents:
diff changeset
     1
/* $Id$ */
dd6d21dc99c1 (svn r11675) -Codechange: split the string types from the string functions.
rubidium
parents:
diff changeset
     2
dd6d21dc99c1 (svn r11675) -Codechange: split the string types from the string functions.
rubidium
parents:
diff changeset
     3
/** @file strings_type.h Types related to strings. */
dd6d21dc99c1 (svn r11675) -Codechange: split the string types from the string functions.
rubidium
parents:
diff changeset
     4
dd6d21dc99c1 (svn r11675) -Codechange: split the string types from the string functions.
rubidium
parents:
diff changeset
     5
#ifndef STRINGS_TYPE_H
dd6d21dc99c1 (svn r11675) -Codechange: split the string types from the string functions.
rubidium
parents:
diff changeset
     6
#define STRINGS_TYPE_H
dd6d21dc99c1 (svn r11675) -Codechange: split the string types from the string functions.
rubidium
parents:
diff changeset
     7
9773
fd7309d22bc6 (svn r13910) -Document: string drawing related functions and types (Alberth)
rubidium
parents: 9648
diff changeset
     8
/**
fd7309d22bc6 (svn r13910) -Document: string drawing related functions and types (Alberth)
rubidium
parents: 9648
diff changeset
     9
 * Numeric value that represents a string, independent of the selected language.
fd7309d22bc6 (svn r13910) -Document: string drawing related functions and types (Alberth)
rubidium
parents: 9648
diff changeset
    10
 */
8114
dd6d21dc99c1 (svn r11675) -Codechange: split the string types from the string functions.
rubidium
parents:
diff changeset
    11
typedef uint16 StringID;
9773
fd7309d22bc6 (svn r13910) -Document: string drawing related functions and types (Alberth)
rubidium
parents: 9648
diff changeset
    12
static const StringID INVALID_STRING_ID = 0xFFFF;  ///< Constant representing an invalid string
8114
dd6d21dc99c1 (svn r11675) -Codechange: split the string types from the string functions.
rubidium
parents:
diff changeset
    13
dd6d21dc99c1 (svn r11675) -Codechange: split the string types from the string functions.
rubidium
parents:
diff changeset
    14
enum {
9773
fd7309d22bc6 (svn r13910) -Document: string drawing related functions and types (Alberth)
rubidium
parents: 9648
diff changeset
    15
	MAX_LANG = 64, ///< Maximal number of languages supported by the game
8114
dd6d21dc99c1 (svn r11675) -Codechange: split the string types from the string functions.
rubidium
parents:
diff changeset
    16
};
dd6d21dc99c1 (svn r11675) -Codechange: split the string types from the string functions.
rubidium
parents:
diff changeset
    17
10249
77b68778b102 (svn r14480) -Add: warning when trying to use a right-to-left language without support for it in OpenTTD.
rubidium
parents: 9773
diff changeset
    18
/** Directions a text can go to */
77b68778b102 (svn r14480) -Add: warning when trying to use a right-to-left language without support for it in OpenTTD.
rubidium
parents: 9773
diff changeset
    19
enum TextDirection {
77b68778b102 (svn r14480) -Add: warning when trying to use a right-to-left language without support for it in OpenTTD.
rubidium
parents: 9773
diff changeset
    20
	TD_LTR, ///< Text is written left-to-right by default
77b68778b102 (svn r14480) -Add: warning when trying to use a right-to-left language without support for it in OpenTTD.
rubidium
parents: 9773
diff changeset
    21
	TD_RTL, ///< Text is written right-to-left by default
77b68778b102 (svn r14480) -Add: warning when trying to use a right-to-left language without support for it in OpenTTD.
rubidium
parents: 9773
diff changeset
    22
};
77b68778b102 (svn r14480) -Add: warning when trying to use a right-to-left language without support for it in OpenTTD.
rubidium
parents: 9773
diff changeset
    23
8114
dd6d21dc99c1 (svn r11675) -Codechange: split the string types from the string functions.
rubidium
parents:
diff changeset
    24
/** Information about a language */
dd6d21dc99c1 (svn r11675) -Codechange: split the string types from the string functions.
rubidium
parents:
diff changeset
    25
struct Language {
dd6d21dc99c1 (svn r11675) -Codechange: split the string types from the string functions.
rubidium
parents:
diff changeset
    26
	char *name; ///< The internal name of the language
dd6d21dc99c1 (svn r11675) -Codechange: split the string types from the string functions.
rubidium
parents:
diff changeset
    27
	char *file; ///< The name of the language as it appears on disk
dd6d21dc99c1 (svn r11675) -Codechange: split the string types from the string functions.
rubidium
parents:
diff changeset
    28
};
dd6d21dc99c1 (svn r11675) -Codechange: split the string types from the string functions.
rubidium
parents:
diff changeset
    29
dd6d21dc99c1 (svn r11675) -Codechange: split the string types from the string functions.
rubidium
parents:
diff changeset
    30
/** Used for dynamic language support */
dd6d21dc99c1 (svn r11675) -Codechange: split the string types from the string functions.
rubidium
parents:
diff changeset
    31
struct DynamicLanguages {
8321
96c331ee5ac3 (svn r11886) -Add: sort the strings in languages dropdown
glx
parents: 8114
diff changeset
    32
	int num;                  ///< Number of languages
96c331ee5ac3 (svn r11886) -Add: sort the strings in languages dropdown
glx
parents: 8114
diff changeset
    33
	int curr;                 ///< Currently selected language index
96c331ee5ac3 (svn r11886) -Add: sort the strings in languages dropdown
glx
parents: 8114
diff changeset
    34
	char curr_file[MAX_PATH]; ///< Currently selected language file name without path (needed for saving the filename of the loaded language).
10249
77b68778b102 (svn r14480) -Add: warning when trying to use a right-to-left language without support for it in OpenTTD.
rubidium
parents: 9773
diff changeset
    35
	TextDirection text_dir;   ///< Text direction of the currently selected language
8321
96c331ee5ac3 (svn r11886) -Add: sort the strings in languages dropdown
glx
parents: 8114
diff changeset
    36
	Language ent[MAX_LANG];   ///< Information about the languages
8114
dd6d21dc99c1 (svn r11675) -Codechange: split the string types from the string functions.
rubidium
parents:
diff changeset
    37
};
dd6d21dc99c1 (svn r11675) -Codechange: split the string types from the string functions.
rubidium
parents:
diff changeset
    38
9773
fd7309d22bc6 (svn r13910) -Document: string drawing related functions and types (Alberth)
rubidium
parents: 9648
diff changeset
    39
/** Special string constants */
8114
dd6d21dc99c1 (svn r11675) -Codechange: split the string types from the string functions.
rubidium
parents:
diff changeset
    40
enum SpecialStrings {
dd6d21dc99c1 (svn r11675) -Codechange: split the string types from the string functions.
rubidium
parents:
diff changeset
    41
dd6d21dc99c1 (svn r11675) -Codechange: split the string types from the string functions.
rubidium
parents:
diff changeset
    42
	// special strings for town names. the town name is generated dynamically on request.
dd6d21dc99c1 (svn r11675) -Codechange: split the string types from the string functions.
rubidium
parents:
diff changeset
    43
	SPECSTR_TOWNNAME_START     = 0x20C0,
dd6d21dc99c1 (svn r11675) -Codechange: split the string types from the string functions.
rubidium
parents:
diff changeset
    44
	SPECSTR_TOWNNAME_ENGLISH   = SPECSTR_TOWNNAME_START,
dd6d21dc99c1 (svn r11675) -Codechange: split the string types from the string functions.
rubidium
parents:
diff changeset
    45
	SPECSTR_TOWNNAME_FRENCH,
dd6d21dc99c1 (svn r11675) -Codechange: split the string types from the string functions.
rubidium
parents:
diff changeset
    46
	SPECSTR_TOWNNAME_GERMAN,
dd6d21dc99c1 (svn r11675) -Codechange: split the string types from the string functions.
rubidium
parents:
diff changeset
    47
	SPECSTR_TOWNNAME_AMERICAN,
dd6d21dc99c1 (svn r11675) -Codechange: split the string types from the string functions.
rubidium
parents:
diff changeset
    48
	SPECSTR_TOWNNAME_LATIN,
dd6d21dc99c1 (svn r11675) -Codechange: split the string types from the string functions.
rubidium
parents:
diff changeset
    49
	SPECSTR_TOWNNAME_SILLY,
dd6d21dc99c1 (svn r11675) -Codechange: split the string types from the string functions.
rubidium
parents:
diff changeset
    50
	SPECSTR_TOWNNAME_SWEDISH,
dd6d21dc99c1 (svn r11675) -Codechange: split the string types from the string functions.
rubidium
parents:
diff changeset
    51
	SPECSTR_TOWNNAME_DUTCH,
dd6d21dc99c1 (svn r11675) -Codechange: split the string types from the string functions.
rubidium
parents:
diff changeset
    52
	SPECSTR_TOWNNAME_FINNISH,
dd6d21dc99c1 (svn r11675) -Codechange: split the string types from the string functions.
rubidium
parents:
diff changeset
    53
	SPECSTR_TOWNNAME_POLISH,
dd6d21dc99c1 (svn r11675) -Codechange: split the string types from the string functions.
rubidium
parents:
diff changeset
    54
	SPECSTR_TOWNNAME_SLOVAKISH,
dd6d21dc99c1 (svn r11675) -Codechange: split the string types from the string functions.
rubidium
parents:
diff changeset
    55
	SPECSTR_TOWNNAME_NORWEGIAN,
dd6d21dc99c1 (svn r11675) -Codechange: split the string types from the string functions.
rubidium
parents:
diff changeset
    56
	SPECSTR_TOWNNAME_HUNGARIAN,
dd6d21dc99c1 (svn r11675) -Codechange: split the string types from the string functions.
rubidium
parents:
diff changeset
    57
	SPECSTR_TOWNNAME_AUSTRIAN,
dd6d21dc99c1 (svn r11675) -Codechange: split the string types from the string functions.
rubidium
parents:
diff changeset
    58
	SPECSTR_TOWNNAME_ROMANIAN,
dd6d21dc99c1 (svn r11675) -Codechange: split the string types from the string functions.
rubidium
parents:
diff changeset
    59
	SPECSTR_TOWNNAME_CZECH,
dd6d21dc99c1 (svn r11675) -Codechange: split the string types from the string functions.
rubidium
parents:
diff changeset
    60
	SPECSTR_TOWNNAME_SWISS,
dd6d21dc99c1 (svn r11675) -Codechange: split the string types from the string functions.
rubidium
parents:
diff changeset
    61
	SPECSTR_TOWNNAME_DANISH,
dd6d21dc99c1 (svn r11675) -Codechange: split the string types from the string functions.
rubidium
parents:
diff changeset
    62
	SPECSTR_TOWNNAME_TURKISH,
dd6d21dc99c1 (svn r11675) -Codechange: split the string types from the string functions.
rubidium
parents:
diff changeset
    63
	SPECSTR_TOWNNAME_ITALIAN,
dd6d21dc99c1 (svn r11675) -Codechange: split the string types from the string functions.
rubidium
parents:
diff changeset
    64
	SPECSTR_TOWNNAME_CATALAN,
dd6d21dc99c1 (svn r11675) -Codechange: split the string types from the string functions.
rubidium
parents:
diff changeset
    65
	SPECSTR_TOWNNAME_LAST      = SPECSTR_TOWNNAME_CATALAN,
dd6d21dc99c1 (svn r11675) -Codechange: split the string types from the string functions.
rubidium
parents:
diff changeset
    66
dd6d21dc99c1 (svn r11675) -Codechange: split the string types from the string functions.
rubidium
parents:
diff changeset
    67
	// special strings for player names on the form "TownName transport".
dd6d21dc99c1 (svn r11675) -Codechange: split the string types from the string functions.
rubidium
parents:
diff changeset
    68
	SPECSTR_PLAYERNAME_START   = 0x70EA,
dd6d21dc99c1 (svn r11675) -Codechange: split the string types from the string functions.
rubidium
parents:
diff changeset
    69
	SPECSTR_PLAYERNAME_ENGLISH = SPECSTR_PLAYERNAME_START,
dd6d21dc99c1 (svn r11675) -Codechange: split the string types from the string functions.
rubidium
parents:
diff changeset
    70
	SPECSTR_PLAYERNAME_FRENCH,
dd6d21dc99c1 (svn r11675) -Codechange: split the string types from the string functions.
rubidium
parents:
diff changeset
    71
	SPECSTR_PLAYERNAME_GERMAN,
dd6d21dc99c1 (svn r11675) -Codechange: split the string types from the string functions.
rubidium
parents:
diff changeset
    72
	SPECSTR_PLAYERNAME_AMERICAN,
dd6d21dc99c1 (svn r11675) -Codechange: split the string types from the string functions.
rubidium
parents:
diff changeset
    73
	SPECSTR_PLAYERNAME_LATIN,
dd6d21dc99c1 (svn r11675) -Codechange: split the string types from the string functions.
rubidium
parents:
diff changeset
    74
	SPECSTR_PLAYERNAME_SILLY,
dd6d21dc99c1 (svn r11675) -Codechange: split the string types from the string functions.
rubidium
parents:
diff changeset
    75
	SPECSTR_PLAYERNAME_LAST    = SPECSTR_PLAYERNAME_SILLY,
dd6d21dc99c1 (svn r11675) -Codechange: split the string types from the string functions.
rubidium
parents:
diff changeset
    76
dd6d21dc99c1 (svn r11675) -Codechange: split the string types from the string functions.
rubidium
parents:
diff changeset
    77
	SPECSTR_ANDCO_NAME         = 0x70E6,
dd6d21dc99c1 (svn r11675) -Codechange: split the string types from the string functions.
rubidium
parents:
diff changeset
    78
	SPECSTR_PRESIDENT_NAME     = 0x70E7,
dd6d21dc99c1 (svn r11675) -Codechange: split the string types from the string functions.
rubidium
parents:
diff changeset
    79
	SPECSTR_SONGNAME           = 0x70E8,
dd6d21dc99c1 (svn r11675) -Codechange: split the string types from the string functions.
rubidium
parents:
diff changeset
    80
dd6d21dc99c1 (svn r11675) -Codechange: split the string types from the string functions.
rubidium
parents:
diff changeset
    81
	// reserve MAX_LANG strings for the *.lng files
dd6d21dc99c1 (svn r11675) -Codechange: split the string types from the string functions.
rubidium
parents:
diff changeset
    82
	SPECSTR_LANGUAGE_START     = 0x7100,
dd6d21dc99c1 (svn r11675) -Codechange: split the string types from the string functions.
rubidium
parents:
diff changeset
    83
	SPECSTR_LANGUAGE_END       = SPECSTR_LANGUAGE_START + MAX_LANG - 1,
dd6d21dc99c1 (svn r11675) -Codechange: split the string types from the string functions.
rubidium
parents:
diff changeset
    84
dd6d21dc99c1 (svn r11675) -Codechange: split the string types from the string functions.
rubidium
parents:
diff changeset
    85
	// reserve 32 strings for various screen resolutions
dd6d21dc99c1 (svn r11675) -Codechange: split the string types from the string functions.
rubidium
parents:
diff changeset
    86
	SPECSTR_RESOLUTION_START   = SPECSTR_LANGUAGE_END + 1,
dd6d21dc99c1 (svn r11675) -Codechange: split the string types from the string functions.
rubidium
parents:
diff changeset
    87
	SPECSTR_RESOLUTION_END     = SPECSTR_RESOLUTION_START + 0x1F,
dd6d21dc99c1 (svn r11675) -Codechange: split the string types from the string functions.
rubidium
parents:
diff changeset
    88
dd6d21dc99c1 (svn r11675) -Codechange: split the string types from the string functions.
rubidium
parents:
diff changeset
    89
	// reserve 32 strings for screenshot formats
dd6d21dc99c1 (svn r11675) -Codechange: split the string types from the string functions.
rubidium
parents:
diff changeset
    90
	SPECSTR_SCREENSHOT_START   = SPECSTR_RESOLUTION_END + 1,
dd6d21dc99c1 (svn r11675) -Codechange: split the string types from the string functions.
rubidium
parents:
diff changeset
    91
	SPECSTR_SCREENSHOT_END     = SPECSTR_SCREENSHOT_START + 0x1F,
dd6d21dc99c1 (svn r11675) -Codechange: split the string types from the string functions.
rubidium
parents:
diff changeset
    92
};
dd6d21dc99c1 (svn r11675) -Codechange: split the string types from the string functions.
rubidium
parents:
diff changeset
    93
dd6d21dc99c1 (svn r11675) -Codechange: split the string types from the string functions.
rubidium
parents:
diff changeset
    94
#endif /* STRINGS_TYPE_H */