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_edittp.h" | 7 #include "xfa/fwl/theme/cfwl_edittp.h" |
8 | 8 |
9 #include "xfa/fwl/basewidget/ifwl_edit.h" | 9 #include "xfa/fwl/basewidget/ifwl_edit.h" |
10 #include "xfa/fwl/core/cfwl_themebackground.h" | 10 #include "xfa/fwl/core/cfwl_themebackground.h" |
11 #include "xfa/fwl/core/ifwl_widget.h" | 11 #include "xfa/fwl/core/ifwl_widget.h" |
| 12 #include "xfa/fxfa/app/xfa_fwltheme.h" |
| 13 #include "xfa/fxfa/xfa_ffwidget.h" |
12 #include "xfa/fxgraphics/cfx_color.h" | 14 #include "xfa/fxgraphics/cfx_color.h" |
13 #include "xfa/fxgraphics/cfx_path.h" | 15 #include "xfa/fxgraphics/cfx_path.h" |
14 | 16 |
15 CFWL_EditTP::CFWL_EditTP() {} | 17 CFWL_EditTP::CFWL_EditTP() {} |
16 CFWL_EditTP::~CFWL_EditTP() {} | 18 CFWL_EditTP::~CFWL_EditTP() {} |
17 | 19 |
18 bool CFWL_EditTP::IsValidWidget(IFWL_Widget* pWidget) { | 20 bool CFWL_EditTP::IsValidWidget(IFWL_Widget* pWidget) { |
19 return pWidget && pWidget->GetClassID() == FWL_Type::Edit; | 21 return pWidget && pWidget->GetClassID() == FWL_Type::Edit; |
20 } | 22 } |
21 | 23 |
22 FX_BOOL CFWL_EditTP::DrawBackground(CFWL_ThemeBackground* pParams) { | 24 FX_BOOL CFWL_EditTP::DrawBackground(CFWL_ThemeBackground* pParams) { |
| 25 if (CFWL_Part::CombTextLine == pParams->m_iPart) { |
| 26 CXFA_FFWidget* pWidget = XFA_ThemeGetOuterWidget(pParams->m_pWidget); |
| 27 FX_ARGB cr = 0xFF000000; |
| 28 FX_FLOAT fWidth = 1.0f; |
| 29 if (CXFA_Border borderUI = pWidget->GetDataAcc()->GetUIBorder()) { |
| 30 CXFA_Edge edge = borderUI.GetEdge(0); |
| 31 if (edge) { |
| 32 cr = edge.GetColor(); |
| 33 fWidth = edge.GetThickness(); |
| 34 } |
| 35 } |
| 36 CFX_Color crLine(cr); |
| 37 pParams->m_pGraphics->SetStrokeColor(&crLine); |
| 38 pParams->m_pGraphics->SetLineWidth(fWidth); |
| 39 pParams->m_pGraphics->StrokePath(pParams->m_pPath, &pParams->m_matrix); |
| 40 return TRUE; |
| 41 } |
| 42 |
23 switch (pParams->m_iPart) { | 43 switch (pParams->m_iPart) { |
24 case CFWL_Part::Border: { | 44 case CFWL_Part::Border: { |
25 DrawBorder(pParams->m_pGraphics, &pParams->m_rtPart, &pParams->m_matrix); | 45 DrawBorder(pParams->m_pGraphics, &pParams->m_rtPart, &pParams->m_matrix); |
26 break; | 46 break; |
27 } | 47 } |
28 case CFWL_Part::Edge: { | 48 case CFWL_Part::Edge: { |
29 DrawEdge(pParams->m_pGraphics, pParams->m_pWidget->GetStyles(), | 49 DrawEdge(pParams->m_pGraphics, pParams->m_pWidget->GetStyles(), |
30 &pParams->m_rtPart, &pParams->m_matrix); | 50 &pParams->m_rtPart, &pParams->m_matrix); |
31 break; | 51 break; |
32 } | 52 } |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 return TRUE; | 97 return TRUE; |
78 } | 98 } |
79 FWL_Error CFWL_EditTP::Initialize() { | 99 FWL_Error CFWL_EditTP::Initialize() { |
80 InitTTO(); | 100 InitTTO(); |
81 return CFWL_WidgetTP::Initialize(); | 101 return CFWL_WidgetTP::Initialize(); |
82 } | 102 } |
83 FWL_Error CFWL_EditTP::Finalize() { | 103 FWL_Error CFWL_EditTP::Finalize() { |
84 FinalizeTTO(); | 104 FinalizeTTO(); |
85 return CFWL_WidgetTP::Finalize(); | 105 return CFWL_WidgetTP::Finalize(); |
86 } | 106 } |
OLD | NEW |