| 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 #include <utility> | 10 #include <utility> |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 m_pTextOut->SetFont(m_pFDEFont); | 178 m_pTextOut->SetFont(m_pFDEFont); |
| 179 m_pTextOut->SetFontSize(FWLTHEME_CAPACITY_FontSize); | 179 m_pTextOut->SetFontSize(FWLTHEME_CAPACITY_FontSize); |
| 180 m_pTextOut->SetTextColor(FWLTHEME_CAPACITY_TextColor); | 180 m_pTextOut->SetTextColor(FWLTHEME_CAPACITY_TextColor); |
| 181 m_pTextOut->SetEllipsisString(L"..."); | 181 m_pTextOut->SetEllipsisString(L"..."); |
| 182 } | 182 } |
| 183 | 183 |
| 184 void CFWL_WidgetTP::FinalizeTTO() { | 184 void CFWL_WidgetTP::FinalizeTTO() { |
| 185 m_pTextOut.reset(); | 185 m_pTextOut.reset(); |
| 186 } | 186 } |
| 187 | 187 |
| 188 void CFWL_WidgetTP::DrawEdge(CFX_Graphics* pGraphics, | |
| 189 uint32_t dwStyles, | |
| 190 const CFX_RectF* pRect, | |
| 191 CFX_Matrix* pMatrix) { | |
| 192 if (!pGraphics) | |
| 193 return; | |
| 194 if (!pRect) | |
| 195 return; | |
| 196 pGraphics->SaveGraphState(); | |
| 197 CFX_Color crStroke(ArgbEncode(255, 127, 157, 185)); | |
| 198 pGraphics->SetStrokeColor(&crStroke); | |
| 199 CFX_Path path; | |
| 200 path.Create(); | |
| 201 path.AddRectangle(pRect->left, pRect->top, pRect->width - 1, | |
| 202 pRect->height - 1); | |
| 203 pGraphics->StrokePath(&path, pMatrix); | |
| 204 path.Clear(); | |
| 205 crStroke.Set(ArgbEncode(255, 255, 255, 255)); | |
| 206 pGraphics->SetStrokeColor(&crStroke); | |
| 207 path.AddRectangle(pRect->left + 1, pRect->top + 1, pRect->width - 3, | |
| 208 pRect->height - 3); | |
| 209 pGraphics->StrokePath(&path, pMatrix); | |
| 210 pGraphics->RestoreGraphState(); | |
| 211 } | |
| 212 | |
| 213 void CFWL_WidgetTP::Draw3DRect(CFX_Graphics* pGraphics, | 188 void CFWL_WidgetTP::Draw3DRect(CFX_Graphics* pGraphics, |
| 214 FWLTHEME_EDGE eType, | 189 FWLTHEME_EDGE eType, |
| 215 FX_FLOAT fWidth, | 190 FX_FLOAT fWidth, |
| 216 const CFX_RectF* pRect, | 191 const CFX_RectF* pRect, |
| 217 FX_ARGB cr1, | 192 FX_ARGB cr1, |
| 218 FX_ARGB cr2, | 193 FX_ARGB cr2, |
| 219 FX_ARGB cr3, | 194 FX_ARGB cr3, |
| 220 FX_ARGB cr4, | 195 FX_ARGB cr4, |
| 221 CFX_Matrix* pMatrix) { | 196 CFX_Matrix* pMatrix) { |
| 222 if (!pGraphics) | 197 if (!pGraphics) |
| (...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 678 if (!pFontData->LoadFont(wsFontFamily, dwFontStyles, wCodePage)) | 653 if (!pFontData->LoadFont(wsFontFamily, dwFontStyles, wCodePage)) |
| 679 return nullptr; | 654 return nullptr; |
| 680 m_FontsArray.push_back(std::move(pFontData)); | 655 m_FontsArray.push_back(std::move(pFontData)); |
| 681 return m_FontsArray.back()->GetFont(); | 656 return m_FontsArray.back()->GetFont(); |
| 682 } | 657 } |
| 683 | 658 |
| 684 void FWLTHEME_Release() { | 659 void FWLTHEME_Release() { |
| 685 CFWL_ArrowData::DestroyInstance(); | 660 CFWL_ArrowData::DestroyInstance(); |
| 686 CFWL_FontManager::DestroyInstance(); | 661 CFWL_FontManager::DestroyInstance(); |
| 687 } | 662 } |
| OLD | NEW |