Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(372)

Side by Side Diff: xfa/fgas/font/fgas_font.h

Issue 2031873003: Get rid of NULLs in xfa/ (Closed) Base URL: https://pdfium.googlesource.com/pdfium@nullptr_fpdfsdk
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « xfa/fgas/crt/fgas_utils.cpp ('k') | xfa/fgas/font/fgas_fontutils.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #ifndef XFA_FGAS_FONT_FGAS_FONT_H_ 7 #ifndef XFA_FGAS_FONT_FGAS_FONT_H_
8 #define XFA_FGAS_FONT_FGAS_FONT_H_ 8 #define XFA_FGAS_FONT_FGAS_FONT_H_
9 9
10 #include "core/fxge/include/fx_font.h" 10 #include "core/fxge/include/fx_font.h"
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 const CFX_FontDescriptors& fonts); 146 const CFX_FontDescriptors& fonts);
147 FX_LPMatchFont FX_GetDefFontMatchor(); 147 FX_LPMatchFont FX_GetDefFontMatchor();
148 class IFGAS_FontMgr { 148 class IFGAS_FontMgr {
149 public: 149 public:
150 static IFGAS_FontMgr* Create(FX_LPEnumAllFonts pEnumerator); 150 static IFGAS_FontMgr* Create(FX_LPEnumAllFonts pEnumerator);
151 virtual ~IFGAS_FontMgr() {} 151 virtual ~IFGAS_FontMgr() {}
152 virtual void Release() = 0; 152 virtual void Release() = 0;
153 virtual IFGAS_Font* GetDefFontByCodePage( 153 virtual IFGAS_Font* GetDefFontByCodePage(
154 uint16_t wCodePage, 154 uint16_t wCodePage,
155 uint32_t dwFontStyles, 155 uint32_t dwFontStyles,
156 const FX_WCHAR* pszFontFamily = NULL) = 0; 156 const FX_WCHAR* pszFontFamily = nullptr) = 0;
157 virtual IFGAS_Font* GetDefFontByCharset( 157 virtual IFGAS_Font* GetDefFontByCharset(
158 uint8_t nCharset, 158 uint8_t nCharset,
159 uint32_t dwFontStyles, 159 uint32_t dwFontStyles,
160 const FX_WCHAR* pszFontFamily = NULL) = 0; 160 const FX_WCHAR* pszFontFamily = nullptr) = 0;
161 virtual IFGAS_Font* GetDefFontByUnicode( 161 virtual IFGAS_Font* GetDefFontByUnicode(
162 FX_WCHAR wUnicode, 162 FX_WCHAR wUnicode,
163 uint32_t dwFontStyles, 163 uint32_t dwFontStyles,
164 const FX_WCHAR* pszFontFamily = NULL) = 0; 164 const FX_WCHAR* pszFontFamily = nullptr) = 0;
165 virtual IFGAS_Font* GetDefFontByLanguage( 165 virtual IFGAS_Font* GetDefFontByLanguage(
166 uint16_t wLanguage, 166 uint16_t wLanguage,
167 uint32_t dwFontStyles, 167 uint32_t dwFontStyles,
168 const FX_WCHAR* pszFontFamily = NULL) = 0; 168 const FX_WCHAR* pszFontFamily = nullptr) = 0;
169 virtual IFGAS_Font* LoadFont(const FX_WCHAR* pszFontFamily, 169 virtual IFGAS_Font* LoadFont(const FX_WCHAR* pszFontFamily,
170 uint32_t dwFontStyles, 170 uint32_t dwFontStyles,
171 uint16_t wCodePage = 0xFFFF) = 0; 171 uint16_t wCodePage = 0xFFFF) = 0;
172 virtual IFGAS_Font* LoadFont(const uint8_t* pBuffer, int32_t iLength) = 0; 172 virtual IFGAS_Font* LoadFont(const uint8_t* pBuffer, int32_t iLength) = 0;
173 virtual IFGAS_Font* LoadFont(const FX_WCHAR* pszFileName) = 0; 173 virtual IFGAS_Font* LoadFont(const FX_WCHAR* pszFileName) = 0;
174 virtual IFGAS_Font* LoadFont(IFX_Stream* pFontStream, 174 virtual IFGAS_Font* LoadFont(IFX_Stream* pFontStream,
175 const FX_WCHAR* pszFontAlias = NULL, 175 const FX_WCHAR* pszFontAlias = nullptr,
176 uint32_t dwFontStyles = 0, 176 uint32_t dwFontStyles = 0,
177 uint16_t wCodePage = 0, 177 uint16_t wCodePage = 0,
178 FX_BOOL bSaveStream = FALSE) = 0; 178 FX_BOOL bSaveStream = FALSE) = 0;
179 virtual IFGAS_Font* LoadFont(IFGAS_Font* pSrcFont, 179 virtual IFGAS_Font* LoadFont(IFGAS_Font* pSrcFont,
180 uint32_t dwFontStyles, 180 uint32_t dwFontStyles,
181 uint16_t wCodePage = 0xFFFF) = 0; 181 uint16_t wCodePage = 0xFFFF) = 0;
182 virtual void ClearFontCache() = 0; 182 virtual void ClearFontCache() = 0;
183 virtual void RemoveFont(IFGAS_Font* pFont) = 0; 183 virtual void RemoveFont(IFGAS_Font* pFont) = 0;
184 }; 184 };
185 185
186 #else // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ 186 #else // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
187 187
188 class IFGAS_FontMgr { 188 class IFGAS_FontMgr {
189 public: 189 public:
190 static IFGAS_FontMgr* Create(CFX_FontSourceEnum_File* pFontEnum); 190 static IFGAS_FontMgr* Create(CFX_FontSourceEnum_File* pFontEnum);
191 virtual ~IFGAS_FontMgr() {} 191 virtual ~IFGAS_FontMgr() {}
192 virtual void Release() = 0; 192 virtual void Release() = 0;
193 virtual IFGAS_Font* GetDefFontByCodePage( 193 virtual IFGAS_Font* GetDefFontByCodePage(
194 uint16_t wCodePage, 194 uint16_t wCodePage,
195 uint32_t dwFontStyles, 195 uint32_t dwFontStyles,
196 const FX_WCHAR* pszFontFamily = NULL) = 0; 196 const FX_WCHAR* pszFontFamily = nullptr) = 0;
197 virtual IFGAS_Font* GetDefFontByCharset( 197 virtual IFGAS_Font* GetDefFontByCharset(
198 uint8_t nCharset, 198 uint8_t nCharset,
199 uint32_t dwFontStyles, 199 uint32_t dwFontStyles,
200 const FX_WCHAR* pszFontFamily = NULL) = 0; 200 const FX_WCHAR* pszFontFamily = nullptr) = 0;
201 virtual IFGAS_Font* GetDefFontByUnicode( 201 virtual IFGAS_Font* GetDefFontByUnicode(
202 FX_WCHAR wUnicode, 202 FX_WCHAR wUnicode,
203 uint32_t dwFontStyles, 203 uint32_t dwFontStyles,
204 const FX_WCHAR* pszFontFamily = NULL) = 0; 204 const FX_WCHAR* pszFontFamily = nullptr) = 0;
205 virtual IFGAS_Font* GetDefFontByLanguage( 205 virtual IFGAS_Font* GetDefFontByLanguage(
206 uint16_t wLanguage, 206 uint16_t wLanguage,
207 uint32_t dwFontStyles, 207 uint32_t dwFontStyles,
208 const FX_WCHAR* pszFontFamily = NULL) = 0; 208 const FX_WCHAR* pszFontFamily = nullptr) = 0;
209 virtual IFGAS_Font* GetFontByCodePage( 209 virtual IFGAS_Font* GetFontByCodePage(
210 uint16_t wCodePage, 210 uint16_t wCodePage,
211 uint32_t dwFontStyles, 211 uint32_t dwFontStyles,
212 const FX_WCHAR* pszFontFamily = NULL) = 0; 212 const FX_WCHAR* pszFontFamily = nullptr) = 0;
213 inline IFGAS_Font* LoadFont(const FX_WCHAR* pszFontFamily, 213 inline IFGAS_Font* LoadFont(const FX_WCHAR* pszFontFamily,
214 uint32_t dwFontStyles, 214 uint32_t dwFontStyles,
215 uint16_t wCodePage) { 215 uint16_t wCodePage) {
216 return GetFontByCodePage(wCodePage, dwFontStyles, pszFontFamily); 216 return GetFontByCodePage(wCodePage, dwFontStyles, pszFontFamily);
217 } 217 }
218 virtual IFGAS_Font* GetFontByCharset( 218 virtual IFGAS_Font* GetFontByCharset(
219 uint8_t nCharset, 219 uint8_t nCharset,
220 uint32_t dwFontStyles, 220 uint32_t dwFontStyles,
221 const FX_WCHAR* pszFontFamily = NULL) = 0; 221 const FX_WCHAR* pszFontFamily = nullptr) = 0;
222 virtual IFGAS_Font* GetFontByUnicode( 222 virtual IFGAS_Font* GetFontByUnicode(
223 FX_WCHAR wUnicode, 223 FX_WCHAR wUnicode,
224 uint32_t dwFontStyles, 224 uint32_t dwFontStyles,
225 const FX_WCHAR* pszFontFamily = NULL) = 0; 225 const FX_WCHAR* pszFontFamily = nullptr) = 0;
226 virtual IFGAS_Font* GetFontByLanguage( 226 virtual IFGAS_Font* GetFontByLanguage(
227 uint16_t wLanguage, 227 uint16_t wLanguage,
228 uint32_t dwFontStyles, 228 uint32_t dwFontStyles,
229 const FX_WCHAR* pszFontFamily = NULL) = 0; 229 const FX_WCHAR* pszFontFamily = nullptr) = 0;
230 virtual IFGAS_Font* LoadFont(const uint8_t* pBuffer, 230 virtual IFGAS_Font* LoadFont(const uint8_t* pBuffer,
231 int32_t iLength, 231 int32_t iLength,
232 int32_t iFaceIndex, 232 int32_t iFaceIndex,
233 int32_t* pFaceCount = NULL) = 0; 233 int32_t* pFaceCount = nullptr) = 0;
234 virtual IFGAS_Font* LoadFont(const FX_WCHAR* pszFileName, 234 virtual IFGAS_Font* LoadFont(const FX_WCHAR* pszFileName,
235 int32_t iFaceIndex, 235 int32_t iFaceIndex,
236 int32_t* pFaceCount = NULL) = 0; 236 int32_t* pFaceCount = nullptr) = 0;
237 virtual IFGAS_Font* LoadFont(IFX_Stream* pFontStream, 237 virtual IFGAS_Font* LoadFont(IFX_Stream* pFontStream,
238 int32_t iFaceIndex, 238 int32_t iFaceIndex,
239 int32_t* pFaceCount = NULL, 239 int32_t* pFaceCount = nullptr,
240 FX_BOOL bSaveStream = FALSE) = 0; 240 FX_BOOL bSaveStream = FALSE) = 0;
241 241
242 virtual void ClearFontCache() = 0; 242 virtual void ClearFontCache() = 0;
243 virtual void RemoveFont(IFGAS_Font* pFont) = 0; 243 virtual void RemoveFont(IFGAS_Font* pFont) = 0;
244 }; 244 };
245 #endif // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ 245 #endif // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
246 246
247 #endif // XFA_FGAS_FONT_FGAS_FONT_H_ 247 #endif // XFA_FGAS_FONT_FGAS_FONT_H_
OLDNEW
« no previous file with comments | « xfa/fgas/crt/fgas_utils.cpp ('k') | xfa/fgas/font/fgas_fontutils.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698