]> git.saurik.com Git - wxWidgets.git/blob - include/wx/encinfo.h
Add wxActivateEvent::GetActivationReason().
[wxWidgets.git] / include / wx / encinfo.h
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
11 #ifndef _WX_ENCINFO_H_
12 #define _WX_ENCINFO_H_
13
14 #include "wx/string.h"
15
16 // ----------------------------------------------------------------------------
17 // wxNativeEncodingInfo contains all encoding parameters for this platform
18 // ----------------------------------------------------------------------------
19
20 // This private structure specifies all the parameters needed to create a font
21 // with the given encoding on this platform.
22 //
23 // Under X, it contains the last 2 elements of the font specifications
24 // (registry and encoding).
25 //
26 // Under Windows, it contains a number which is one of predefined CHARSET_XXX
27 // values.
28 //
29 // Under all platforms it also contains a facename string which should be
30 // used, if not empty, to create fonts in this encoding (this is the only way
31 // to create a font of non-standard encoding (like KOI8) under Windows - the
32 // facename specifies the encoding then)
33
34 struct WXDLLIMPEXP_CORE wxNativeEncodingInfo
35 {
36 wxString facename; // may be empty meaning "any"
37 wxFontEncoding encoding; // so that we know what this struct represents
38
39 #if defined(__WXMSW__) || \
40 defined(__WXPM__) || \
41 defined(__WXMAC__) || \
42 defined(__WXCOCOA__) // FIXME: __WXCOCOA__
43
44 wxNativeEncodingInfo()
45 : facename()
46 , encoding(wxFONTENCODING_SYSTEM)
47 , charset(0) /* ANSI_CHARSET */
48 { }
49
50 int charset;
51 #elif defined(_WX_X_FONTLIKE)
52 wxString xregistry,
53 xencoding;
54 #elif defined(wxHAS_UTF8_FONTS)
55 // ports using UTF-8 for text don't need encoding information for fonts
56 #else
57 #error "Unsupported toolkit"
58 #endif
59 // this struct is saved in config by wxFontMapper, so it should know to
60 // serialise itself (implemented in platform-specific code)
61 bool FromString(const wxString& s);
62 wxString ToString() const;
63 };
64
65 #endif // _WX_ENCINFO_H_
66