From 405bb3ecf7b29362ddf9a906bf820928765a7835 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 14 Aug 2021 17:41:08 +0100 Subject: [PATCH] Move wxLanguageInfo declaration to wx/localedefs.h too No real changes, just allow wxUILocale code to use this struct without including the full wx/intl.h. This commit is best viewed with --color-moved git option. --- include/wx/intl.h | 34 ---------------------------------- include/wx/localedefs.h | 38 +++++++++++++++++++++++++++++++++++++- 2 files changed, 37 insertions(+), 35 deletions(-) diff --git a/include/wx/intl.h b/include/wx/intl.h index ab871ea6aa..866bcfbcac 100644 --- a/include/wx/intl.h +++ b/include/wx/intl.h @@ -41,40 +41,6 @@ class WXDLLIMPEXP_FWD_BASE wxLanguageInfoArray; // locale support // ============================================================================ -// ---------------------------------------------------------------------------- -// wxLanguageInfo: encapsulates wxLanguage to OS native lang.desc. -// translation information -// ---------------------------------------------------------------------------- - -struct WXDLLIMPEXP_BASE wxLanguageInfo -{ - int Language; // wxLanguage id - wxString CanonicalName; // Canonical name, e.g. fr_FR -#ifdef __WINDOWS__ - wxUint32 WinLang, // Win32 language identifiers - WinSublang; -#endif // __WINDOWS__ - wxString Description; // human-readable name of the language - wxLayoutDirection LayoutDirection; - -#ifdef __WINDOWS__ - // return the LCID corresponding to this language - wxUint32 GetLCID() const; -#endif // __WINDOWS__ - - // return the locale name corresponding to this language usable with - // setlocale() on the current system or empty string if this locale is not - // supported - wxString GetLocaleName() const; - - // Call setlocale() and return non-null value if it works for this language. - // - // This function is mostly for internal use, as changing locale involves - // more than just calling setlocale() on some platforms, use wxLocale to - // do everything that needs to be done instead of calling this method. - const char* TrySetLocale() const; -}; - // ---------------------------------------------------------------------------- // wxLocale: encapsulates all language dependent settings, including current // message catalogs, date, time and currency formats (TODO) &c diff --git a/include/wx/localedefs.h b/include/wx/localedefs.h index 727c79bbd0..d5b43b2eff 100644 --- a/include/wx/localedefs.h +++ b/include/wx/localedefs.h @@ -1,6 +1,6 @@ /////////////////////////////////////////////////////////////////////////////// // Name: wx/localedefs.h -// Purpose: Definitions of common locale-related constants +// Purpose: Definitions of common locale-related constants and structs. // Author: Vadim Zeitlin // Created: 2021-07-31 (extracted from wx/intl.h) // Copyright: (c) 2021 Vadim Zeitlin @@ -26,6 +26,8 @@ enum wxLayoutDirection #if wxUSE_INTL +#include "wx/string.h" + // ---------------------------------------------------------------------------- // wxLocaleCategory: the category of locale settings // ---------------------------------------------------------------------------- @@ -72,6 +74,40 @@ enum wxLocaleInfo }; +// ---------------------------------------------------------------------------- +// wxLanguageInfo: encapsulates wxLanguage to OS native lang.desc. +// translation information +// ---------------------------------------------------------------------------- + +struct WXDLLIMPEXP_BASE wxLanguageInfo +{ + int Language; // wxLanguage id + wxString CanonicalName; // Canonical name, e.g. fr_FR +#ifdef __WINDOWS__ + wxUint32 WinLang, // Win32 language identifiers + WinSublang; +#endif // __WINDOWS__ + wxString Description; // human-readable name of the language + wxLayoutDirection LayoutDirection; + +#ifdef __WINDOWS__ + // return the LCID corresponding to this language + wxUint32 GetLCID() const; +#endif // __WINDOWS__ + + // return the locale name corresponding to this language usable with + // setlocale() on the current system or empty string if this locale is not + // supported + wxString GetLocaleName() const; + + // Call setlocale() and return non-null value if it works for this language. + // + // This function is mostly for internal use, as changing locale involves + // more than just calling setlocale() on some platforms, use wxLocale to + // do everything that needs to be done instead of calling this method. + const char* TrySetLocale() const; +}; + #endif // wxUSE_INTL #endif // _WX_LOCALEDEFS_H_