1. wxFontMapper almost finished

2. font helper functions are now in separate files, not utilsunx.cpp


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4376 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
1999-11-05 19:03:19 +00:00
parent feef75abca
commit 7beba2fc73
32 changed files with 1331 additions and 679 deletions

View File

@@ -20,9 +20,8 @@
// headers
// ----------------------------------------------------------------------------
#include "wx/defs.h" // for wxDEFAULT &c
#include "wx/font.h" // for wxFontEncoding
#include "wx/font.h" // for wxFont and wxFontEncoding
#include "wx/fontutil.h" // for wxNativeEncodingInfo
class WXDLLEXPORT wxConfigBase;
@@ -49,14 +48,38 @@ public:
// virtual dtor for a base class
virtual ~wxFontMapper();
// find an alternative for the given encoding (which is supposed to not be
// available on this system). If successful, return TRUE and fill info
// structure with the parameters required to create the font, otherwise
// return FALSE
virtual bool GetAltForEncoding(wxFontEncoding encoding,
wxNativeEncodingInfo *info,
bool interactive = TRUE);
// returns the encoding for the given charset (in the form of RFC 2046) or
// wxFONTENCODING_SYSTEM if couldn't decode it
virtual wxFontEncoding CharsetToEncoding(const wxString& charset,
bool interactive = TRUE);
// encoding names
// --------------
// return internal string identifier for the encoding (see also
// GetEncodingDescription())
static wxString GetEncodingName(wxFontEncoding encoding);
// return user-readable string describing the given encoding
//
// NB: hard-coded now, but might change later (read it from config?)
static wxString GetEncodingDescription(wxFontEncoding encoding);
// configure the appearance of the dialogs we may popup
// ----------------------------------------------------
// the parent window for modal dialogs
void SetDialogParent(wxWindow *parent) { m_windowParent = parent; }
// the title for the dialogs (note that default is quite reasonable)
void SetDialogTitle(const wxString& title) { m_titleDialog = title; }
// functions which allow to configure the config object used: by default,
@@ -94,6 +117,17 @@ protected:
// restore the config path after use
void RestorePath(const wxString& pathOld);
// GetAltForEncoding() helper: tests for the existence of the given
// encoding and saves the result in config if ok - this results in the
// following (desired) behaviour: when an unknown/unavailable encoding is
// requested for the first time, the user is asked about a replacement,
// but if he doesn't choose any and the default logic finds one, it will
// be saved in the config so that the user won't be asked about it any
// more
bool TestAltEncoding(const wxString& configEntry,
wxFontEncoding encReplacement,
wxNativeEncodingInfo *info);
// config object and path (in it) to use
wxConfigBase *m_config;
wxString m_configRootPath;
@@ -103,6 +137,15 @@ protected:
// the parent window for our dialogs
wxWindow *m_windowParent;
friend class wxFontMapperPathChanger;
};
// ----------------------------------------------------------------------------
// global variables
// ----------------------------------------------------------------------------
// the default font mapper for wxWindows programs
WXDLLEXPORT_DATA(extern wxFontMapper *) wxTheFontMapper;
#endif // _WX_FONTMAPPER_H_