]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/fmappriv.h
1 ///////////////////////////////////////////////////////////////////////////////
3 // Purpose: private wxFontMapper stuff, not to be used by the library users
4 // Author: Vadim Zeitlin
6 // Created: 21.06.2003 (extracted from common/fontmap.cpp)
7 // Copyright: (c) 1999-2003 Vadim Zeitlin <vadim@wxwidgets.org>
8 // Licence: wxWindows licence
9 ///////////////////////////////////////////////////////////////////////////////
11 #ifndef _WX_FMAPPRIV_H_
12 #define _WX_FMAPPRIV_H_
14 // ----------------------------------------------------------------------------
16 // ----------------------------------------------------------------------------
18 // a special pseudo encoding which means "don't ask me about this charset
19 // any more" -- we need it to avoid driving the user crazy with asking him
20 // time after time about the same charset which he [presumably] doesn't
22 enum { wxFONTENCODING_UNKNOWN
= -2 };
24 // the config paths we use
27 #define FONTMAPPER_ROOT_PATH wxT("/wxWindows/FontMapper")
28 #define FONTMAPPER_CHARSET_PATH wxT("Charsets")
29 #define FONTMAPPER_CHARSET_ALIAS_PATH wxT("Aliases")
31 #endif // wxUSE_CONFIG
33 // ----------------------------------------------------------------------------
34 // wxFontMapperPathChanger: change the config path during our lifetime
35 // ----------------------------------------------------------------------------
37 #if wxUSE_CONFIG && wxUSE_FILECONFIG
39 class wxFontMapperPathChanger
42 wxFontMapperPathChanger(wxFontMapperBase
*fontMapper
, const wxString
& path
)
44 m_fontMapper
= fontMapper
;
45 m_ok
= m_fontMapper
->ChangePath(path
, &m_pathOld
);
48 bool IsOk() const { return m_ok
; }
50 ~wxFontMapperPathChanger()
53 m_fontMapper
->RestorePath(m_pathOld
);
57 // the fontmapper object we're working with
58 wxFontMapperBase
*m_fontMapper
;
60 // the old path to be restored if m_ok
63 // have we changed the path successfully?
67 wxDECLARE_NO_COPY_CLASS(wxFontMapperPathChanger
);
70 #endif // wxUSE_CONFIG
72 #endif // _WX_FMAPPRIV_H_