From 4825c4b7dad8f3118dbad1daf3b4743616b343bd Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Tue, 26 Sep 2017 12:08:48 -0400 Subject: Share public part of CFGAS_FontMgr declaration This CL moves the public part of the CFGAS_FontMgr declaration to be shared across all platforms. Change-Id: I92e587fe06611c92f72746477775802c2f3b8b57 Reviewed-on: https://pdfium-review.googlesource.com/14817 Reviewed-by: Henrique Nakashima Commit-Queue: dsinclair --- xfa/fgas/font/cfgas_fontmgr.cpp | 4 +++ xfa/fgas/font/cfgas_fontmgr.h | 69 ++++++++++++++++------------------------- 2 files changed, 30 insertions(+), 43 deletions(-) diff --git a/xfa/fgas/font/cfgas_fontmgr.cpp b/xfa/fgas/font/cfgas_fontmgr.cpp index df7c36fd53..a00b903d48 100644 --- a/xfa/fgas/font/cfgas_fontmgr.cpp +++ b/xfa/fgas/font/cfgas_fontmgr.cpp @@ -192,6 +192,10 @@ CFGAS_FontMgr::CFGAS_FontMgr() CFGAS_FontMgr::~CFGAS_FontMgr() {} +bool CFGAS_FontMgr::EnumFonts() { + return true; +} + RetainPtr CFGAS_FontMgr::GetFontByCodePage( uint16_t wCodePage, uint32_t dwFontStyles, diff --git a/xfa/fgas/font/cfgas_fontmgr.h b/xfa/fgas/font/cfgas_fontmgr.h index d0d73bb688..903ab65937 100644 --- a/xfa/fgas/font/cfgas_fontmgr.h +++ b/xfa/fgas/font/cfgas_fontmgr.h @@ -81,48 +81,6 @@ typedef void (*FX_LPEnumAllFonts)(std::deque* fonts, FX_LPEnumAllFonts FX_GetDefFontEnumerator(); -class CFGAS_FontMgr : public Observable { - public: - CFGAS_FontMgr(); - ~CFGAS_FontMgr(); - - RetainPtr GetFontByCodePage(uint16_t wCodePage, - uint32_t dwFontStyles, - const wchar_t* pszFontFamily); - RetainPtr GetFontByUnicode(wchar_t wUnicode, - uint32_t dwFontStyles, - const wchar_t* pszFontFamily); - RetainPtr LoadFont(const wchar_t* pszFontFamily, - uint32_t dwFontStyles, - uint16_t wCodePage); - void RemoveFont(const RetainPtr& pFont); - - bool EnumFonts() { return true; } - - private: - RetainPtr LoadFont(const RetainPtr& pSrcFont, - uint32_t dwFontStyles, - uint16_t wCodePage); - void RemoveFont(std::map>* pFontMap, - const RetainPtr& pFont); - const FX_FONTDESCRIPTOR* FindFont(const wchar_t* pszFontFamily, - uint32_t dwFontStyles, - uint32_t dwMatchFlags, - uint16_t wCodePage, - uint32_t dwUSB, - wchar_t wUnicode); - - FX_LPEnumAllFonts m_pEnumerator; - std::deque m_FontFaces; - std::vector> m_Fonts; - std::map> m_CPFonts; - std::map> m_FamilyFonts; - std::map> m_UnicodeFonts; - std::map> m_BufferFonts; - std::map> m_StreamFonts; - std::map> m_DeriveFonts; -}; - #else // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ class CFX_FontDescriptor { public: @@ -179,6 +137,8 @@ class CFX_FontSourceEnum_File { std::vector m_FolderPaths; }; +#endif // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ + class CFGAS_FontMgr : public Observable { public: CFGAS_FontMgr(); @@ -198,6 +158,29 @@ class CFGAS_FontMgr : public Observable { bool EnumFonts(); private: +#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ + RetainPtr LoadFont(const RetainPtr& pSrcFont, + uint32_t dwFontStyles, + uint16_t wCodePage); + void RemoveFont(std::map>* pFontMap, + const RetainPtr& pFont); + const FX_FONTDESCRIPTOR* FindFont(const wchar_t* pszFontFamily, + uint32_t dwFontStyles, + uint32_t dwMatchFlags, + uint16_t wCodePage, + uint32_t dwUSB, + wchar_t wUnicode); + + FX_LPEnumAllFonts m_pEnumerator; + std::deque m_FontFaces; + std::vector> m_Fonts; + std::map> m_CPFonts; + std::map> m_FamilyFonts; + std::map> m_UnicodeFonts; + std::map> m_BufferFonts; + std::map> m_StreamFonts; + std::map> m_DeriveFonts; +#else // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ bool EnumFontsFromFontMapper(); bool EnumFontsFromFiles(); void RegisterFace(FXFT_Face pFace, const WideString* pFaceName); @@ -240,7 +223,7 @@ class CFGAS_FontMgr : public Observable { std::map, RetainPtr> m_IFXFont2FileRead; std::set m_FailedUnicodesSet; -}; #endif // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ +}; #endif // XFA_FGAS_FONT_CFGAS_FONTMGR_H_ -- cgit v1.2.3