]>
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)
8 // Copyright: (c) 1999-2003 Vadim Zeitlin <vadim@wxwindows.org>
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_FMAPPRIV_H_
13 #define _WX_FMAPPRIV_H_
15 // ----------------------------------------------------------------------------
17 // ----------------------------------------------------------------------------
19 // a special pseudo encoding which means "don't ask me about this charset
20 // any more" -- we need it to avoid driving the user crazy with asking him
21 // time after time about the same charset which he [presumably] doesn't
23 enum { wxFONTENCODING_UNKNOWN
= -2 };
25 // the config paths we use
28 #define FONTMAPPER_ROOT_PATH wxT("/wxWindows/FontMapper")
29 #define FONTMAPPER_CHARSET_PATH wxT("Charsets")
30 #define FONTMAPPER_CHARSET_ALIAS_PATH wxT("Aliases")
32 #endif // wxUSE_CONFIG
34 // ----------------------------------------------------------------------------
35 // wxFontMapperPathChanger: change the config path during our lifetime
36 // ----------------------------------------------------------------------------
38 #if wxUSE_CONFIG && wxUSE_FILECONFIG
40 class wxFontMapperPathChanger
43 wxFontMapperPathChanger(wxFontMapperBase
*fontMapper
, const wxString
& path
)
45 m_fontMapper
= fontMapper
;
46 m_ok
= m_fontMapper
->ChangePath(path
, &m_pathOld
);
49 bool IsOk() const { return m_ok
; }
51 ~wxFontMapperPathChanger()
54 m_fontMapper
->RestorePath(m_pathOld
);
58 // the fontmapper object we're working with
59 wxFontMapperBase
*m_fontMapper
;
61 // the old path to be restored if m_ok
64 // have we changed the path successfully?
68 DECLARE_NO_COPY_CLASS(wxFontMapperPathChanger
)
71 #endif // wxUSE_CONFIG
73 #endif // _WX_FMAPPRIV_H_