| 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 #include "xfa/fwl/theme/cfwl_widgettp.h" | 7 #include "xfa/fwl/theme/cfwl_widgettp.h" |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| 11 #include "xfa/fde/tto/fde_textout.h" | 11 #include "xfa/fde/tto/fde_textout.h" |
| 12 #include "xfa/fgas/font/fgas_gefont.h" | 12 #include "xfa/fgas/font/fgas_gefont.h" |
| 13 #include "xfa/fgas/font/fgas_stdfontmgr.h" | 13 #include "xfa/fgas/font/cfgas_fontmgr.h" |
| 14 #include "xfa/fwl/core/cfwl_themebackground.h" | 14 #include "xfa/fwl/core/cfwl_themebackground.h" |
| 15 #include "xfa/fwl/core/cfwl_themepart.h" | 15 #include "xfa/fwl/core/cfwl_themepart.h" |
| 16 #include "xfa/fwl/core/cfwl_themetext.h" | 16 #include "xfa/fwl/core/cfwl_themetext.h" |
| 17 #include "xfa/fwl/core/cfwl_widgetmgr.h" | 17 #include "xfa/fwl/core/cfwl_widgetmgr.h" |
| 18 #include "xfa/fwl/core/ifwl_themeprovider.h" | 18 #include "xfa/fwl/core/ifwl_themeprovider.h" |
| 19 #include "xfa/fwl/core/ifwl_widget.h" | 19 #include "xfa/fwl/core/ifwl_widget.h" |
| 20 #include "xfa/fwl/theme/cfwl_arrowdata.h" | 20 #include "xfa/fwl/theme/cfwl_arrowdata.h" |
| 21 #include "xfa/fxgraphics/cfx_color.h" | 21 #include "xfa/fxgraphics/cfx_color.h" |
| 22 #include "xfa/fxgraphics/cfx_path.h" | 22 #include "xfa/fxgraphics/cfx_path.h" |
| 23 #include "xfa/fxgraphics/cfx_shading.h" | 23 #include "xfa/fxgraphics/cfx_shading.h" |
| (...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 657 } | 657 } |
| 658 | 658 |
| 659 bool CFWL_FontData::LoadFont(const CFX_WideStringC& wsFontFamily, | 659 bool CFWL_FontData::LoadFont(const CFX_WideStringC& wsFontFamily, |
| 660 uint32_t dwFontStyles, | 660 uint32_t dwFontStyles, |
| 661 uint16_t dwCodePage) { | 661 uint16_t dwCodePage) { |
| 662 m_wsFamily = wsFontFamily; | 662 m_wsFamily = wsFontFamily; |
| 663 m_dwStyles = dwFontStyles; | 663 m_dwStyles = dwFontStyles; |
| 664 m_dwCodePage = dwCodePage; | 664 m_dwCodePage = dwCodePage; |
| 665 if (!m_pFontMgr) { | 665 if (!m_pFontMgr) { |
| 666 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ | 666 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ |
| 667 m_pFontMgr = IFGAS_FontMgr::Create(FX_GetDefFontEnumerator()); | 667 m_pFontMgr = CFGAS_FontMgr::Create(FX_GetDefFontEnumerator()); |
| 668 #else | 668 #else |
| 669 m_pFontSource.reset(new CFX_FontSourceEnum_File); | 669 m_pFontSource.reset(new CFX_FontSourceEnum_File); |
| 670 m_pFontMgr = IFGAS_FontMgr::Create(m_pFontSource.get()); | 670 m_pFontMgr = CFGAS_FontMgr::Create(m_pFontSource.get()); |
| 671 #endif | 671 #endif |
| 672 } | 672 } |
| 673 m_pFont.reset(CFGAS_GEFont::LoadFont(wsFontFamily.c_str(), dwFontStyles, | 673 m_pFont.reset(CFGAS_GEFont::LoadFont(wsFontFamily.c_str(), dwFontStyles, |
| 674 dwCodePage, m_pFontMgr.get())); | 674 dwCodePage, m_pFontMgr.get())); |
| 675 return !!m_pFont; | 675 return !!m_pFont; |
| 676 } | 676 } |
| 677 | 677 |
| 678 CFWL_FontManager* CFWL_FontManager::s_FontManager = nullptr; | 678 CFWL_FontManager* CFWL_FontManager::s_FontManager = nullptr; |
| 679 CFWL_FontManager* CFWL_FontManager::GetInstance() { | 679 CFWL_FontManager* CFWL_FontManager::GetInstance() { |
| 680 if (!s_FontManager) | 680 if (!s_FontManager) |
| (...skipping 29 matching lines...) Expand all Loading... |
| 710 CFWL_FontManager::DestroyInstance(); | 710 CFWL_FontManager::DestroyInstance(); |
| 711 } | 711 } |
| 712 | 712 |
| 713 uint32_t FWL_GetThemeLayout(uint32_t dwThemeID) { | 713 uint32_t FWL_GetThemeLayout(uint32_t dwThemeID) { |
| 714 return 0xffff0000 & dwThemeID; | 714 return 0xffff0000 & dwThemeID; |
| 715 } | 715 } |
| 716 | 716 |
| 717 uint32_t FWL_GetThemeColor(uint32_t dwThemeID) { | 717 uint32_t FWL_GetThemeColor(uint32_t dwThemeID) { |
| 718 return 0x0000ffff & dwThemeID; | 718 return 0x0000ffff & dwThemeID; |
| 719 } | 719 } |
| OLD | NEW |