summaryrefslogtreecommitdiff
path: root/xfa/fxfa
diff options
context:
space:
mode:
authorthestig <thestig@chromium.org>2016-06-07 17:33:37 -0700
committerCommit bot <commit-bot@chromium.org>2016-06-07 17:33:37 -0700
commita4fdfc5ed0e8d2e6acc52cc34eac42c6072f0ccc (patch)
tree255d0e11679bd1f54f94dd717e74db5827f967e9 /xfa/fxfa
parent759de3828419522e8ecd7cdaee469e55061a7c08 (diff)
downloadpdfium-a4fdfc5ed0e8d2e6acc52cc34eac42c6072f0ccc.tar.xz
Replace IFGAS_Font with underlying concrete type
Review-Url: https://codereview.chromium.org/2037563002
Diffstat (limited to 'xfa/fxfa')
-rw-r--r--xfa/fxfa/app/xfa_ffwidgetacc.cpp2
-rw-r--r--xfa/fxfa/app/xfa_fontmgr.cpp56
-rw-r--r--xfa/fxfa/app/xfa_fwltheme.cpp5
-rw-r--r--xfa/fxfa/app/xfa_fwltheme.h2
-rw-r--r--xfa/fxfa/app/xfa_textlayout.cpp4
-rw-r--r--xfa/fxfa/app/xfa_textlayout.h6
-rw-r--r--xfa/fxfa/include/fxfa.h2
-rw-r--r--xfa/fxfa/include/fxfa_widget.h12
-rw-r--r--xfa/fxfa/include/xfa_fontmgr.h52
9 files changed, 72 insertions, 69 deletions
diff --git a/xfa/fxfa/app/xfa_ffwidgetacc.cpp b/xfa/fxfa/app/xfa_ffwidgetacc.cpp
index c440848941..1a579e222e 100644
--- a/xfa/fxfa/app/xfa_ffwidgetacc.cpp
+++ b/xfa/fxfa/app/xfa_ffwidgetacc.cpp
@@ -1517,7 +1517,7 @@ CXFA_WidgetLayoutData* CXFA_WidgetAcc::GetWidgetLayoutData() {
return m_pLayoutData.get();
}
-IFGAS_Font* CXFA_WidgetAcc::GetFDEFont() {
+CFGAS_GEFont* CXFA_WidgetAcc::GetFDEFont() {
CFX_WideStringC wsFontName = FX_WSTRC(L"Courier");
uint32_t dwFontStyle = 0;
if (CXFA_Font font = GetFont()) {
diff --git a/xfa/fxfa/app/xfa_fontmgr.cpp b/xfa/fxfa/app/xfa_fontmgr.cpp
index ed93b16ad2..964c0352b8 100644
--- a/xfa/fxfa/app/xfa_fontmgr.cpp
+++ b/xfa/fxfa/app/xfa_fontmgr.cpp
@@ -12,6 +12,7 @@
#include "core/fpdfapi/fpdf_font/include/cpdf_font.h"
#include "core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h"
#include "core/fpdfapi/fpdf_parser/include/cpdf_document.h"
+#include "xfa/fgas/font/fgas_gefont.h"
#include "xfa/fxfa/include/xfa_ffapp.h"
#include "xfa/fxfa/include/xfa_ffdoc.h"
@@ -1742,13 +1743,13 @@ CXFA_DefFontMgr::~CXFA_DefFontMgr() {
m_CacheFonts[i]->Release();
}
-IFGAS_Font* CXFA_DefFontMgr::GetFont(CXFA_FFDoc* hDoc,
- const CFX_WideStringC& wsFontFamily,
- uint32_t dwFontStyles,
- uint16_t wCodePage) {
+CFGAS_GEFont* CXFA_DefFontMgr::GetFont(CXFA_FFDoc* hDoc,
+ const CFX_WideStringC& wsFontFamily,
+ uint32_t dwFontStyles,
+ uint16_t wCodePage) {
CFX_WideString wsFontName(wsFontFamily);
IFGAS_FontMgr* pFDEFontMgr = hDoc->GetApp()->GetFDEFontMgr();
- IFGAS_Font* pFont =
+ CFGAS_GEFont* pFont =
pFDEFontMgr->LoadFont(wsFontName.c_str(), dwFontStyles, wCodePage);
if (!pFont) {
const XFA_FONTINFO* pCurFont =
@@ -1787,12 +1788,13 @@ IFGAS_Font* CXFA_DefFontMgr::GetFont(CXFA_FFDoc* hDoc,
return pFont;
}
-IFGAS_Font* CXFA_DefFontMgr::GetDefaultFont(CXFA_FFDoc* hDoc,
- const CFX_WideStringC& wsFontFamily,
- uint32_t dwFontStyles,
- uint16_t wCodePage) {
+CFGAS_GEFont* CXFA_DefFontMgr::GetDefaultFont(
+ CXFA_FFDoc* hDoc,
+ const CFX_WideStringC& wsFontFamily,
+ uint32_t dwFontStyles,
+ uint16_t wCodePage) {
IFGAS_FontMgr* pFDEFontMgr = hDoc->GetApp()->GetFDEFontMgr();
- IFGAS_Font* pFont =
+ CFGAS_GEFont* pFont =
pFDEFontMgr->LoadFont(L"Arial Narrow", dwFontStyles, wCodePage);
if (!pFont)
pFont =
@@ -1824,11 +1826,11 @@ CXFA_PDFFontMgr::~CXFA_PDFFontMgr() {
pair.second->Release();
}
}
-IFGAS_Font* CXFA_PDFFontMgr::FindFont(CFX_ByteString strPsName,
- FX_BOOL bBold,
- FX_BOOL bItalic,
- CPDF_Font** pDstPDFFont,
- FX_BOOL bStrictMatch) {
+CFGAS_GEFont* CXFA_PDFFontMgr::FindFont(CFX_ByteString strPsName,
+ FX_BOOL bBold,
+ FX_BOOL bItalic,
+ CPDF_Font** pDstPDFFont,
+ FX_BOOL bStrictMatch) {
CPDF_Document* pDoc = m_pDoc->GetPDFDoc();
if (pDoc == NULL) {
return NULL;
@@ -1867,15 +1869,15 @@ IFGAS_Font* CXFA_PDFFontMgr::FindFont(CFX_ByteString strPsName,
*pDstPDFFont = pPDFFont;
return NULL;
}
- return IFGAS_Font::LoadFont(&pPDFFont->m_Font, pFDEFontMgr);
+ return CFGAS_GEFont::LoadFont(&pPDFFont->m_Font, pFDEFontMgr, FALSE);
}
return NULL;
}
-IFGAS_Font* CXFA_PDFFontMgr::GetFont(const CFX_WideStringC& wsFontFamily,
- uint32_t dwFontStyles,
- CPDF_Font** pPDFFont,
- FX_BOOL bStrictMatch) {
+CFGAS_GEFont* CXFA_PDFFontMgr::GetFont(const CFX_WideStringC& wsFontFamily,
+ uint32_t dwFontStyles,
+ CPDF_Font** pPDFFont,
+ FX_BOOL bStrictMatch) {
uint32_t dwHashCode = FX_HashCode_GetW(wsFontFamily, false);
CFX_ByteString strKey;
strKey.Format("%u%u", dwHashCode, dwFontStyles);
@@ -1887,7 +1889,7 @@ IFGAS_Font* CXFA_PDFFontMgr::GetFont(const CFX_WideStringC& wsFontFamily,
FX_BOOL bBold = (dwFontStyles & FX_FONTSTYLE_Bold) == FX_FONTSTYLE_Bold;
FX_BOOL bItalic = (dwFontStyles & FX_FONTSTYLE_Italic) == FX_FONTSTYLE_Italic;
CFX_ByteString strFontName = PsNameToFontName(bsPsName, bBold, bItalic);
- IFGAS_Font* pFont =
+ CFGAS_GEFont* pFont =
FindFont(strFontName, bBold, bItalic, pPDFFont, bStrictMatch);
if (pFont)
m_FontMap[strKey] = pFont;
@@ -1982,7 +1984,7 @@ FX_BOOL CXFA_PDFFontMgr::PsNameMatchDRFontName(
}
return TRUE;
}
-FX_BOOL CXFA_PDFFontMgr::GetCharWidth(IFGAS_Font* pFont,
+FX_BOOL CXFA_PDFFontMgr::GetCharWidth(CFGAS_GEFont* pFont,
FX_WCHAR wUnicode,
int32_t& iWidth,
FX_BOOL bCharCode) {
@@ -2002,10 +2004,10 @@ CXFA_FontMgr::CXFA_FontMgr() {}
CXFA_FontMgr::~CXFA_FontMgr() {}
-IFGAS_Font* CXFA_FontMgr::GetFont(CXFA_FFDoc* hDoc,
- const CFX_WideStringC& wsFontFamily,
- uint32_t dwFontStyles,
- uint16_t wCodePage) {
+CFGAS_GEFont* CXFA_FontMgr::GetFont(CXFA_FFDoc* hDoc,
+ const CFX_WideStringC& wsFontFamily,
+ uint32_t dwFontStyles,
+ uint16_t wCodePage) {
uint32_t dwHash = FX_HashCode_GetW(wsFontFamily, false);
CFX_ByteString bsKey;
bsKey.Format("%u%u%u", dwHash, dwFontStyles, wCodePage);
@@ -2018,7 +2020,7 @@ IFGAS_Font* CXFA_FontMgr::GetFont(CXFA_FFDoc* hDoc,
CXFA_PDFFontMgr* pMgr =
it != m_PDFFontMgrMap.end() ? it->second.get() : nullptr;
CPDF_Font* pPDFFont = nullptr;
- IFGAS_Font* pFont = nullptr;
+ CFGAS_GEFont* pFont = nullptr;
if (pMgr) {
pFont = pMgr->GetFont(wsEnglishName.AsStringC(), dwFontStyles, &pPDFFont);
if (pFont)
diff --git a/xfa/fxfa/app/xfa_fwltheme.cpp b/xfa/fxfa/app/xfa_fwltheme.cpp
index 0c8e346066..e2e1b29c08 100644
--- a/xfa/fxfa/app/xfa_fwltheme.cpp
+++ b/xfa/fxfa/app/xfa_fwltheme.cpp
@@ -8,6 +8,7 @@
#include "xfa/fde/tto/fde_textout.h"
#include "xfa/fgas/crt/fgas_codepage.h"
+#include "xfa/fgas/font/fgas_gefont.h"
#include "xfa/fwl/basewidget/ifwl_barcode.h"
#include "xfa/fwl/basewidget/ifwl_caret.h"
#include "xfa/fwl/basewidget/ifwl_checkbox.h"
@@ -78,8 +79,8 @@ FWL_Error CXFA_FWLTheme::Initialize() {
m_pTextOut.reset(new CFDE_TextOut);
for (size_t i = 0; !m_pCalendarFont && i < FX_ArraySize(g_FWLTheme_CalFonts);
++i) {
- m_pCalendarFont = IFGAS_Font::LoadFont(g_FWLTheme_CalFonts[i], 0, 0,
- m_pApp->GetFDEFontMgr());
+ m_pCalendarFont = CFGAS_GEFont::LoadFont(g_FWLTheme_CalFonts[i], 0, 0,
+ m_pApp->GetFDEFontMgr());
}
if (!m_pCalendarFont) {
#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
diff --git a/xfa/fxfa/app/xfa_fwltheme.h b/xfa/fxfa/app/xfa_fwltheme.h
index b73239c003..fdd12c37ba 100644
--- a/xfa/fxfa/app/xfa_fwltheme.h
+++ b/xfa/fxfa/app/xfa_fwltheme.h
@@ -81,7 +81,7 @@ class CXFA_FWLTheme final : public IFWL_ThemeProvider {
std::unique_ptr<CFDE_TextOut> m_pTextOut;
FX_FLOAT m_fCapacity;
uint32_t m_dwCapacity;
- IFGAS_Font* m_pCalendarFont;
+ CFGAS_GEFont* m_pCalendarFont;
CFX_WideString m_wsResource;
CXFA_FFApp* m_pApp;
CFX_RectF m_Rect;
diff --git a/xfa/fxfa/app/xfa_textlayout.cpp b/xfa/fxfa/app/xfa_textlayout.cpp
index c40e29c04b..4e23fc39f9 100644
--- a/xfa/fxfa/app/xfa_textlayout.cpp
+++ b/xfa/fxfa/app/xfa_textlayout.cpp
@@ -332,8 +332,8 @@ FX_BOOL CXFA_TextParser::IsSpaceRun(IFDE_CSSComputedStyle* pStyle) const {
}
return FALSE;
}
-IFGAS_Font* CXFA_TextParser::GetFont(CXFA_TextProvider* pTextProvider,
- IFDE_CSSComputedStyle* pStyle) const {
+CFGAS_GEFont* CXFA_TextParser::GetFont(CXFA_TextProvider* pTextProvider,
+ IFDE_CSSComputedStyle* pStyle) const {
CFX_WideStringC wsFamily = FX_WSTRC(L"Courier");
uint32_t dwStyle = 0;
CXFA_Font font = pTextProvider->GetFontNode();
diff --git a/xfa/fxfa/app/xfa_textlayout.h b/xfa/fxfa/app/xfa_textlayout.h
index a4bd9cede7..842c6ec731 100644
--- a/xfa/fxfa/app/xfa_textlayout.h
+++ b/xfa/fxfa/app/xfa_textlayout.h
@@ -95,8 +95,8 @@ class CXFA_TextParser {
FX_BOOL IsSpaceRun(IFDE_CSSComputedStyle* pStyle) const;
FX_BOOL GetTabstops(IFDE_CSSComputedStyle* pStyle,
CXFA_TextTabstopsContext* pTabstopContext);
- IFGAS_Font* GetFont(CXFA_TextProvider* pTextProvider,
- IFDE_CSSComputedStyle* pStyle) const;
+ CFGAS_GEFont* GetFont(CXFA_TextProvider* pTextProvider,
+ IFDE_CSSComputedStyle* pStyle) const;
FX_FLOAT GetFontSize(CXFA_TextProvider* pTextProvider,
IFDE_CSSComputedStyle* pStyle) const;
int32_t GetHorScale(CXFA_TextProvider* pTextProvider,
@@ -259,7 +259,7 @@ class XFA_TextPiece : public CFX_Target {
int32_t iUnderline;
int32_t iPeriod;
int32_t iLineThrough;
- IFGAS_Font* pFont;
+ CFGAS_GEFont* pFont;
FX_ARGB dwColor;
FX_FLOAT fFontSize;
CFX_RectF rtPiece;
diff --git a/xfa/fxfa/include/fxfa.h b/xfa/fxfa/include/fxfa.h
index 7b40cd8cb1..981fcabffc 100644
--- a/xfa/fxfa/include/fxfa.h
+++ b/xfa/fxfa/include/fxfa.h
@@ -12,6 +12,7 @@
#include "xfa/fxfa/include/fxfa_basic.h"
#include "xfa/fxfa/include/fxfa_widget.h"
+class CFGAS_GEFont;
class CFX_Graphics;
class CPDF_Document;
class CXFA_FFPageView;
@@ -19,7 +20,6 @@ class CXFA_Node;
class CXFA_NodeList;
class CXFA_WidgetAcc;
class IFWL_AdapterTimerMgr;
-class IFGAS_Font;
class IXFA_AppProvider;
class IXFA_DocProvider;
class IXFA_WidgetAccIterator;
diff --git a/xfa/fxfa/include/fxfa_widget.h b/xfa/fxfa/include/fxfa_widget.h
index b4a0080425..a8bed176ab 100644
--- a/xfa/fxfa/include/fxfa_widget.h
+++ b/xfa/fxfa/include/fxfa_widget.h
@@ -17,15 +17,15 @@
#include "xfa/fxfa/parser/cxfa_value.h"
#include "xfa/fxfa/parser/cxfa_widgetdata.h"
-class CXFA_Node;
-class CXFA_FFDocView;
-class CXFA_FFDoc;
-class CXFA_FFApp;
+class CFGAS_GEFont;
class CXFA_EventParam;
+class CXFA_FFApp;
+class CXFA_FFDoc;
+class CXFA_FFDocView;
class CXFA_FFWidget;
+class CXFA_Node;
class CXFA_TextLayout;
class CXFA_WidgetLayoutData;
-class IFGAS_Font;
class IXFA_AppProvider;
class CXFA_WidgetAcc : public CXFA_WidgetData {
@@ -73,7 +73,7 @@ class CXFA_WidgetAcc : public CXFA_WidgetData {
void UpdateUIDisplay(CXFA_FFWidget* pExcept = NULL);
CXFA_Node* GetDatasets();
- IFGAS_Font* GetFDEFont();
+ CFGAS_GEFont* GetFDEFont();
FX_FLOAT GetFontSize();
FX_ARGB GetTextColor();
FX_FLOAT GetLineHeight();
diff --git a/xfa/fxfa/include/xfa_fontmgr.h b/xfa/fxfa/include/xfa_fontmgr.h
index 90418441de..121df588d2 100644
--- a/xfa/fxfa/include/xfa_fontmgr.h
+++ b/xfa/fxfa/include/xfa_fontmgr.h
@@ -30,17 +30,17 @@ class CXFA_DefFontMgr {
CXFA_DefFontMgr() {}
~CXFA_DefFontMgr();
- IFGAS_Font* GetFont(CXFA_FFDoc* hDoc,
- const CFX_WideStringC& wsFontFamily,
- uint32_t dwFontStyles,
- uint16_t wCodePage = 0xFFFF);
- IFGAS_Font* GetDefaultFont(CXFA_FFDoc* hDoc,
- const CFX_WideStringC& wsFontFamily,
- uint32_t dwFontStyles,
- uint16_t wCodePage = 0xFFFF);
+ CFGAS_GEFont* GetFont(CXFA_FFDoc* hDoc,
+ const CFX_WideStringC& wsFontFamily,
+ uint32_t dwFontStyles,
+ uint16_t wCodePage = 0xFFFF);
+ CFGAS_GEFont* GetDefaultFont(CXFA_FFDoc* hDoc,
+ const CFX_WideStringC& wsFontFamily,
+ uint32_t dwFontStyles,
+ uint16_t wCodePage = 0xFFFF);
protected:
- CFX_ArrayTemplate<IFGAS_Font*> m_CacheFonts;
+ CFX_ArrayTemplate<CFGAS_GEFont*> m_CacheFonts;
};
class CXFA_PDFFontMgr {
@@ -48,22 +48,22 @@ class CXFA_PDFFontMgr {
explicit CXFA_PDFFontMgr(CXFA_FFDoc* pDoc);
~CXFA_PDFFontMgr();
- IFGAS_Font* GetFont(const CFX_WideStringC& wsFontFamily,
- uint32_t dwFontStyles,
- CPDF_Font** pPDFFont,
- FX_BOOL bStrictMatch = TRUE);
- FX_BOOL GetCharWidth(IFGAS_Font* pFont,
+ CFGAS_GEFont* GetFont(const CFX_WideStringC& wsFontFamily,
+ uint32_t dwFontStyles,
+ CPDF_Font** pPDFFont,
+ FX_BOOL bStrictMatch = TRUE);
+ FX_BOOL GetCharWidth(CFGAS_GEFont* pFont,
FX_WCHAR wUnicode,
int32_t& iWidth,
FX_BOOL bCharCode);
- std::map<IFGAS_Font*, CPDF_Font*> m_FDE2PDFFont;
+ std::map<CFGAS_GEFont*, CPDF_Font*> m_FDE2PDFFont;
protected:
- IFGAS_Font* FindFont(CFX_ByteString strFamilyName,
- FX_BOOL bBold,
- FX_BOOL bItalic,
- CPDF_Font** pPDFFont,
- FX_BOOL bStrictMatch = TRUE);
+ CFGAS_GEFont* FindFont(CFX_ByteString strFamilyName,
+ FX_BOOL bBold,
+ FX_BOOL bItalic,
+ CPDF_Font** pPDFFont,
+ FX_BOOL bStrictMatch = TRUE);
CFX_ByteString PsNameToFontName(const CFX_ByteString& strPsName,
FX_BOOL bBold,
FX_BOOL bItalic);
@@ -74,7 +74,7 @@ class CXFA_PDFFontMgr {
FX_BOOL bStrictMatch = TRUE);
CXFA_FFDoc* m_pDoc;
- std::map<CFX_ByteString, IFGAS_Font*> m_FontMap;
+ std::map<CFX_ByteString, CFGAS_GEFont*> m_FontMap;
};
class CXFA_FontMgr {
@@ -82,10 +82,10 @@ class CXFA_FontMgr {
CXFA_FontMgr();
~CXFA_FontMgr();
- IFGAS_Font* GetFont(CXFA_FFDoc* hDoc,
- const CFX_WideStringC& wsFontFamily,
- uint32_t dwFontStyles,
- uint16_t wCodePage = 0xFFFF);
+ CFGAS_GEFont* GetFont(CXFA_FFDoc* hDoc,
+ const CFX_WideStringC& wsFontFamily,
+ uint32_t dwFontStyles,
+ uint16_t wCodePage = 0xFFFF);
void LoadDocFonts(CXFA_FFDoc* hDoc);
void ReleaseDocFonts(CXFA_FFDoc* hDoc);
void SetDefFontMgr(std::unique_ptr<CXFA_DefFontMgr> pFontMgr);
@@ -93,7 +93,7 @@ class CXFA_FontMgr {
protected:
std::unique_ptr<CXFA_DefFontMgr> m_pDefFontMgr;
std::map<CXFA_FFDoc*, std::unique_ptr<CXFA_PDFFontMgr>> m_PDFFontMgrMap;
- std::map<CFX_ByteString, IFGAS_Font*> m_FontMap;
+ std::map<CFX_ByteString, CFGAS_GEFont*> m_FontMap;
};
#endif // XFA_FXFA_INCLUDE_XFA_FONTMGR_H_