2003-06-23 20:56:19 -04:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: wx/fmappriv.h
|
|
|
|
// Purpose: private wxFontMapper stuff, not to be used by the library users
|
|
|
|
// Author: Vadim Zeitlin
|
|
|
|
// Modified by:
|
|
|
|
// Created: 21.06.2003 (extracted from common/fontmap.cpp)
|
|
|
|
// RCS-ID: $Id$
|
2004-05-23 10:56:36 -04:00
|
|
|
// Copyright: (c) 1999-2003 Vadim Zeitlin <vadim@wxwidgets.org>
|
2004-05-23 16:53:33 -04:00
|
|
|
// Licence: wxWindows licence
|
2003-06-23 20:56:19 -04:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_FMAPPRIV_H_
|
|
|
|
#define _WX_FMAPPRIV_H_
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// constants
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
// a special pseudo encoding which means "don't ask me about this charset
|
|
|
|
// any more" -- we need it to avoid driving the user crazy with asking him
|
|
|
|
// time after time about the same charset which he [presumably] doesn't
|
|
|
|
// have the fonts for
|
|
|
|
enum { wxFONTENCODING_UNKNOWN = -2 };
|
|
|
|
|
|
|
|
// the config paths we use
|
|
|
|
#if wxUSE_CONFIG
|
|
|
|
|
2004-05-26 06:49:43 -04:00
|
|
|
#define FONTMAPPER_ROOT_PATH wxT("/wxWindows/FontMapper")
|
2003-06-23 20:56:19 -04:00
|
|
|
#define FONTMAPPER_CHARSET_PATH wxT("Charsets")
|
|
|
|
#define FONTMAPPER_CHARSET_ALIAS_PATH wxT("Aliases")
|
|
|
|
|
|
|
|
#endif // wxUSE_CONFIG
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// wxFontMapperPathChanger: change the config path during our lifetime
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
2003-07-11 18:06:00 -04:00
|
|
|
#if wxUSE_CONFIG && wxUSE_FILECONFIG
|
2003-06-23 20:56:19 -04:00
|
|
|
|
|
|
|
class wxFontMapperPathChanger
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
wxFontMapperPathChanger(wxFontMapperBase *fontMapper, const wxString& path)
|
|
|
|
{
|
|
|
|
m_fontMapper = fontMapper;
|
|
|
|
m_ok = m_fontMapper->ChangePath(path, &m_pathOld);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool IsOk() const { return m_ok; }
|
|
|
|
|
|
|
|
~wxFontMapperPathChanger()
|
|
|
|
{
|
|
|
|
if ( IsOk() )
|
|
|
|
m_fontMapper->RestorePath(m_pathOld);
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
// the fontmapper object we're working with
|
|
|
|
wxFontMapperBase *m_fontMapper;
|
|
|
|
|
|
|
|
// the old path to be restored if m_ok
|
|
|
|
wxString m_pathOld;
|
|
|
|
|
|
|
|
// have we changed the path successfully?
|
|
|
|
bool m_ok;
|
|
|
|
|
|
|
|
|
2009-02-08 06:45:59 -05:00
|
|
|
wxDECLARE_NO_COPY_CLASS(wxFontMapperPathChanger);
|
2003-06-23 20:56:19 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // wxUSE_CONFIG
|
|
|
|
|
|
|
|
#endif // _WX_FMAPPRIV_H_
|
|
|
|
|