encinfo.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. ///////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/encinfo.h
  3. // Purpose: declares wxNativeEncodingInfo struct
  4. // Author: Vadim Zeitlin
  5. // Modified by:
  6. // Created: 19.09.2003 (extracted from wx/fontenc.h)
  7. // Copyright: (c) 2003 Vadim Zeitlin <vadim@wxwidgets.org>
  8. // Licence: wxWindows licence
  9. ///////////////////////////////////////////////////////////////////////////////
  10. #ifndef _WX_ENCINFO_H_
  11. #define _WX_ENCINFO_H_
  12. #include "wx/string.h"
  13. // ----------------------------------------------------------------------------
  14. // wxNativeEncodingInfo contains all encoding parameters for this platform
  15. // ----------------------------------------------------------------------------
  16. // This private structure specifies all the parameters needed to create a font
  17. // with the given encoding on this platform.
  18. //
  19. // Under X, it contains the last 2 elements of the font specifications
  20. // (registry and encoding).
  21. //
  22. // Under Windows, it contains a number which is one of predefined CHARSET_XXX
  23. // values.
  24. //
  25. // Under all platforms it also contains a facename string which should be
  26. // used, if not empty, to create fonts in this encoding (this is the only way
  27. // to create a font of non-standard encoding (like KOI8) under Windows - the
  28. // facename specifies the encoding then)
  29. struct WXDLLIMPEXP_CORE wxNativeEncodingInfo
  30. {
  31. wxString facename; // may be empty meaning "any"
  32. wxFontEncoding encoding; // so that we know what this struct represents
  33. #if defined(__WXMSW__) || \
  34. defined(__WXPM__) || \
  35. defined(__WXMAC__) || \
  36. defined(__WXCOCOA__) // FIXME: __WXCOCOA__
  37. wxNativeEncodingInfo()
  38. : facename()
  39. , encoding(wxFONTENCODING_SYSTEM)
  40. , charset(0) /* ANSI_CHARSET */
  41. { }
  42. int charset;
  43. #elif defined(_WX_X_FONTLIKE)
  44. wxString xregistry,
  45. xencoding;
  46. #elif defined(wxHAS_UTF8_FONTS)
  47. // ports using UTF-8 for text don't need encoding information for fonts
  48. #else
  49. #error "Unsupported toolkit"
  50. #endif
  51. // this struct is saved in config by wxFontMapper, so it should know to
  52. // serialise itself (implemented in platform-specific code)
  53. bool FromString(const wxString& s);
  54. wxString ToString() const;
  55. };
  56. #endif // _WX_ENCINFO_H_