OLD | NEW |
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_FWL_THEME_CFWL_WIDGETTP_H_ | 7 #ifndef XFA_FWL_THEME_CFWL_WIDGETTP_H_ |
8 #define XFA_FWL_THEME_CFWL_WIDGETTP_H_ | 8 #define XFA_FWL_THEME_CFWL_WIDGETTP_H_ |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 }; | 229 }; |
230 FX_BOOL FWLTHEME_Init(); | 230 FX_BOOL FWLTHEME_Init(); |
231 void FWLTHEME_Release(); | 231 void FWLTHEME_Release(); |
232 uint32_t FWL_GetThemeLayout(uint32_t dwThemeID); | 232 uint32_t FWL_GetThemeLayout(uint32_t dwThemeID); |
233 uint32_t FWL_GetThemeColor(uint32_t dwThemeID); | 233 uint32_t FWL_GetThemeColor(uint32_t dwThemeID); |
234 | 234 |
235 class CFWL_FontData { | 235 class CFWL_FontData { |
236 public: | 236 public: |
237 CFWL_FontData(); | 237 CFWL_FontData(); |
238 virtual ~CFWL_FontData(); | 238 virtual ~CFWL_FontData(); |
| 239 |
239 FX_BOOL Equal(const CFX_WideStringC& wsFontFamily, | 240 FX_BOOL Equal(const CFX_WideStringC& wsFontFamily, |
240 uint32_t dwFontStyles, | 241 uint32_t dwFontStyles, |
241 uint16_t wCodePage); | 242 uint16_t wCodePage); |
242 FX_BOOL LoadFont(const CFX_WideStringC& wsFontFamily, | 243 FX_BOOL LoadFont(const CFX_WideStringC& wsFontFamily, |
243 uint32_t dwFontStyles, | 244 uint32_t dwFontStyles, |
244 uint16_t wCodePage); | 245 uint16_t wCodePage); |
245 CFGAS_GEFont* GetFont() const { return m_pFont; } | 246 CFGAS_GEFont* GetFont() const { return m_pFont.get(); } |
246 | 247 |
247 protected: | 248 protected: |
248 CFX_WideString m_wsFamily; | 249 CFX_WideString m_wsFamily; |
249 uint32_t m_dwStyles; | 250 uint32_t m_dwStyles; |
250 uint32_t m_dwCodePage; | 251 uint32_t m_dwCodePage; |
251 CFGAS_GEFont* m_pFont; | |
252 IFGAS_FontMgr* m_pFontMgr; | |
253 #if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ | 252 #if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ |
254 CFX_FontSourceEnum_File* m_pFontSource; | 253 std::unique_ptr<CFX_FontSourceEnum_File> m_pFontSource; |
255 #endif | 254 #endif |
| 255 std::unique_ptr<IFGAS_FontMgr> m_pFontMgr; |
| 256 std::unique_ptr<CFGAS_GEFont> m_pFont; |
256 }; | 257 }; |
257 | 258 |
258 class CFWL_FontManager { | 259 class CFWL_FontManager { |
259 public: | 260 public: |
260 static CFWL_FontManager* GetInstance(); | 261 static CFWL_FontManager* GetInstance(); |
261 static void DestroyInstance(); | 262 static void DestroyInstance(); |
262 | 263 |
263 CFGAS_GEFont* FindFont(const CFX_WideStringC& wsFontFamily, | 264 CFGAS_GEFont* FindFont(const CFX_WideStringC& wsFontFamily, |
264 uint32_t dwFontStyles, | 265 uint32_t dwFontStyles, |
265 uint16_t dwCodePage); | 266 uint16_t dwCodePage); |
266 | 267 |
267 protected: | 268 protected: |
268 CFWL_FontManager(); | 269 CFWL_FontManager(); |
269 virtual ~CFWL_FontManager(); | 270 virtual ~CFWL_FontManager(); |
270 | 271 |
271 static CFWL_FontManager* s_FontManager; | 272 static CFWL_FontManager* s_FontManager; |
272 std::vector<std::unique_ptr<CFWL_FontData>> m_FontsArray; | 273 std::vector<std::unique_ptr<CFWL_FontData>> m_FontsArray; |
273 }; | 274 }; |
274 | 275 |
275 #endif // XFA_FWL_THEME_CFWL_WIDGETTP_H_ | 276 #endif // XFA_FWL_THEME_CFWL_WIDGETTP_H_ |
OLD | NEW |