OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 |
| 7 #include "xfa/fwl/theme/cfwl_arrowdata.h" |
| 8 |
| 9 #include <algorithm> |
| 10 |
| 11 namespace { |
| 12 |
| 13 CFWL_ArrowData* g_pInstance = nullptr; |
| 14 |
| 15 } // namespace |
| 16 |
| 17 CFWL_ArrowData* CFWL_ArrowData::GetInstance() { |
| 18 if (!g_pInstance) |
| 19 g_pInstance = new CFWL_ArrowData; |
| 20 return g_pInstance; |
| 21 } |
| 22 |
| 23 FX_BOOL CFWL_ArrowData::HasInstance() { |
| 24 return !!g_pInstance; |
| 25 } |
| 26 |
| 27 void CFWL_ArrowData::DestroyInstance() { |
| 28 delete g_pInstance; |
| 29 g_pInstance = nullptr; |
| 30 } |
| 31 |
| 32 CFWL_ArrowData::~CFWL_ArrowData() {} |
| 33 |
| 34 void CFWL_ArrowData::SetColorData(uint32_t dwID) { |
| 35 if (!m_pColorData) |
| 36 m_pColorData.reset(new CColorData); |
| 37 |
| 38 if (dwID) { |
| 39 m_pColorData->clrBorder[0] = ArgbEncode(255, 142, 153, 125); |
| 40 m_pColorData->clrBorder[1] = ArgbEncode(255, 157, 171, 119); |
| 41 m_pColorData->clrBorder[2] = ArgbEncode(255, 118, 131, 97); |
| 42 m_pColorData->clrBorder[3] = ArgbEncode(255, 172, 168, 153); |
| 43 m_pColorData->clrStart[0] = ArgbEncode(255, 203, 215, 186); |
| 44 m_pColorData->clrStart[1] = ArgbEncode(255, 218, 232, 185); |
| 45 m_pColorData->clrStart[2] = ArgbEncode(255, 203, 215, 186); |
| 46 m_pColorData->clrStart[3] = ArgbEncode(255, 254, 254, 251); |
| 47 m_pColorData->clrEnd[0] = ArgbEncode(255, 149, 167, 117); |
| 48 m_pColorData->clrEnd[1] = ArgbEncode(255, 198, 211, 155); |
| 49 m_pColorData->clrEnd[2] = ArgbEncode(255, 149, 167, 117); |
| 50 m_pColorData->clrEnd[3] = ArgbEncode(255, 243, 241, 236); |
| 51 m_pColorData->clrSign[0] = ArgbEncode(255, 255, 255, 255); |
| 52 m_pColorData->clrSign[1] = ArgbEncode(255, 255, 255, 255); |
| 53 m_pColorData->clrSign[2] = ArgbEncode(255, 255, 255, 255); |
| 54 m_pColorData->clrSign[3] = ArgbEncode(255, 128, 128, 128); |
| 55 } else { |
| 56 m_pColorData->clrBorder[0] = ArgbEncode(255, 202, 216, 249); |
| 57 m_pColorData->clrBorder[1] = ArgbEncode(255, 171, 190, 233); |
| 58 m_pColorData->clrBorder[2] = ArgbEncode(255, 135, 147, 219); |
| 59 m_pColorData->clrBorder[3] = ArgbEncode(255, 172, 168, 153); |
| 60 m_pColorData->clrStart[0] = ArgbEncode(255, 225, 234, 254); |
| 61 m_pColorData->clrStart[1] = ArgbEncode(255, 253, 255, 255); |
| 62 m_pColorData->clrStart[2] = ArgbEncode(255, 110, 142, 241); |
| 63 m_pColorData->clrStart[3] = ArgbEncode(255, 254, 254, 251); |
| 64 m_pColorData->clrEnd[0] = ArgbEncode(255, 175, 204, 251); |
| 65 m_pColorData->clrEnd[1] = ArgbEncode(255, 185, 218, 251); |
| 66 m_pColorData->clrEnd[2] = ArgbEncode(255, 210, 222, 235); |
| 67 m_pColorData->clrEnd[3] = ArgbEncode(255, 243, 241, 236); |
| 68 m_pColorData->clrSign[0] = ArgbEncode(255, 77, 97, 133); |
| 69 m_pColorData->clrSign[1] = ArgbEncode(255, 77, 97, 133); |
| 70 m_pColorData->clrSign[2] = ArgbEncode(255, 77, 97, 133); |
| 71 m_pColorData->clrSign[3] = ArgbEncode(255, 128, 128, 128); |
| 72 } |
| 73 } |
OLD | NEW |