| OLD | NEW |
| 1 // Copyright 2016 PDFium Authors. All rights reserved. | 1 // Copyright 2016 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 "fpdfsdk/cfx_systemhandler.h" | 7 #include "fpdfsdk/cfx_systemhandler.h" |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 } | 110 } |
| 111 | 111 |
| 112 CPDF_Font* CFX_SystemHandler::AddNativeTrueTypeFontToPDF( | 112 CPDF_Font* CFX_SystemHandler::AddNativeTrueTypeFontToPDF( |
| 113 CPDF_Document* pDoc, | 113 CPDF_Document* pDoc, |
| 114 CFX_ByteString sFontFaceName, | 114 CFX_ByteString sFontFaceName, |
| 115 uint8_t nCharset) { | 115 uint8_t nCharset) { |
| 116 if (!pDoc) | 116 if (!pDoc) |
| 117 return nullptr; | 117 return nullptr; |
| 118 | 118 |
| 119 std::unique_ptr<CFX_Font> pFXFont(new CFX_Font); | 119 std::unique_ptr<CFX_Font> pFXFont(new CFX_Font); |
| 120 pFXFont->LoadSubst(sFontFaceName, TRUE, 0, 0, 0, CharSet2CP(nCharset), FALSE); | 120 pFXFont->LoadSubst(sFontFaceName, TRUE, 0, 0, 0, CharSet2CP(nCharset), false); |
| 121 return pDoc->AddFont(pFXFont.get(), nCharset, FALSE); | 121 return pDoc->AddFont(pFXFont.get(), nCharset, FALSE); |
| 122 } | 122 } |
| 123 | 123 |
| 124 int32_t CFX_SystemHandler::SetTimer(int32_t uElapse, | 124 int32_t CFX_SystemHandler::SetTimer(int32_t uElapse, |
| 125 TimerCallback lpTimerFunc) { | 125 TimerCallback lpTimerFunc) { |
| 126 return m_pEnv->SetTimer(uElapse, lpTimerFunc); | 126 return m_pEnv->SetTimer(uElapse, lpTimerFunc); |
| 127 } | 127 } |
| 128 | 128 |
| 129 void CFX_SystemHandler::KillTimer(int32_t nID) { | 129 void CFX_SystemHandler::KillTimer(int32_t nID) { |
| 130 m_pEnv->KillTimer(nID); | 130 m_pEnv->KillTimer(nID); |
| 131 } | 131 } |
| 132 | 132 |
| 133 bool CFX_SystemHandler::IsSHIFTKeyDown(uint32_t nFlag) const { | 133 bool CFX_SystemHandler::IsSHIFTKeyDown(uint32_t nFlag) const { |
| 134 return !!m_pEnv->IsSHIFTKeyDown(nFlag); | 134 return !!m_pEnv->IsSHIFTKeyDown(nFlag); |
| 135 } | 135 } |
| 136 | 136 |
| 137 bool CFX_SystemHandler::IsCTRLKeyDown(uint32_t nFlag) const { | 137 bool CFX_SystemHandler::IsCTRLKeyDown(uint32_t nFlag) const { |
| 138 return !!m_pEnv->IsCTRLKeyDown(nFlag); | 138 return !!m_pEnv->IsCTRLKeyDown(nFlag); |
| 139 } | 139 } |
| 140 | 140 |
| 141 bool CFX_SystemHandler::IsALTKeyDown(uint32_t nFlag) const { | 141 bool CFX_SystemHandler::IsALTKeyDown(uint32_t nFlag) const { |
| 142 return !!m_pEnv->IsALTKeyDown(nFlag); | 142 return !!m_pEnv->IsALTKeyDown(nFlag); |
| 143 } | 143 } |
| OLD | NEW |