| 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_checkboxtp.h" | 7 #include "xfa/fwl/theme/cfwl_checkboxtp.h" |
| 8 | 8 |
| 9 #include "core/fxge/cfx_pathdata.h" | 9 #include "core/fxge/cfx_pathdata.h" |
| 10 #include "xfa/fde/tto/fde_textout.h" | 10 #include "xfa/fde/tto/fde_textout.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 | 34 |
| 35 CFWL_CheckBoxTP::~CFWL_CheckBoxTP() { | 35 CFWL_CheckBoxTP::~CFWL_CheckBoxTP() { |
| 36 if (m_pCheckPath) | 36 if (m_pCheckPath) |
| 37 m_pCheckPath->Clear(); | 37 m_pCheckPath->Clear(); |
| 38 } | 38 } |
| 39 | 39 |
| 40 bool CFWL_CheckBoxTP::IsValidWidget(IFWL_Widget* pWidget) { | 40 bool CFWL_CheckBoxTP::IsValidWidget(IFWL_Widget* pWidget) { |
| 41 return pWidget && pWidget->GetClassID() == FWL_Type::CheckBox; | 41 return pWidget && pWidget->GetClassID() == FWL_Type::CheckBox; |
| 42 } | 42 } |
| 43 | 43 |
| 44 uint32_t CFWL_CheckBoxTP::SetThemeID(IFWL_Widget* pWidget, | 44 uint32_t CFWL_CheckBoxTP::SetThemeID(IFWL_Widget* pWidget, uint32_t dwThemeID) { |
| 45 uint32_t dwThemeID, | |
| 46 FX_BOOL bChildren) { | |
| 47 if (m_pThemeData) | 45 if (m_pThemeData) |
| 48 SetThemeData(FWL_GetThemeColor(dwThemeID)); | 46 SetThemeData(FWL_GetThemeColor(dwThemeID)); |
| 49 return CFWL_WidgetTP::SetThemeID(pWidget, dwThemeID, bChildren); | 47 return CFWL_WidgetTP::SetThemeID(pWidget, dwThemeID); |
| 50 } | 48 } |
| 51 | 49 |
| 52 FX_BOOL CFWL_CheckBoxTP::DrawText(CFWL_ThemeText* pParams) { | 50 FX_BOOL CFWL_CheckBoxTP::DrawText(CFWL_ThemeText* pParams) { |
| 53 if (!m_pTextOut) | 51 if (!m_pTextOut) |
| 54 return FALSE; | 52 return FALSE; |
| 55 m_pTextOut->SetTextColor(pParams->m_dwStates & CFWL_PartState_Disabled | 53 m_pTextOut->SetTextColor(pParams->m_dwStates & CFWL_PartState_Disabled |
| 56 ? FWLTHEME_CAPACITY_TextDisColor | 54 ? FWLTHEME_CAPACITY_TextDisColor |
| 57 : FWLTHEME_CAPACITY_TextColor); | 55 : FWLTHEME_CAPACITY_TextColor); |
| 58 return CFWL_WidgetTP::DrawText(pParams); | 56 return CFWL_WidgetTP::DrawText(pParams); |
| 59 } | 57 } |
| (...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 508 pt1.x + px2 * FX_BEZIER, pt1.y + py2 * FX_BEZIER, | 506 pt1.x + px2 * FX_BEZIER, pt1.y + py2 * FX_BEZIER, |
| 509 pt1.x, pt1.y); | 507 pt1.x, pt1.y); |
| 510 FX_FLOAT fScale = fCheckLen / kSignPath; | 508 FX_FLOAT fScale = fCheckLen / kSignPath; |
| 511 CFX_Matrix mt; | 509 CFX_Matrix mt; |
| 512 mt.Set(1, 0, 0, 1, 0, 0); | 510 mt.Set(1, 0, 0, 1, 0, 0); |
| 513 mt.Scale(fScale, fScale); | 511 mt.Scale(fScale, fScale); |
| 514 CFX_PathData* pData = m_pCheckPath->GetPathData(); | 512 CFX_PathData* pData = m_pCheckPath->GetPathData(); |
| 515 pData->Transform(&mt); | 513 pData->Transform(&mt); |
| 516 } | 514 } |
| 517 } | 515 } |
| OLD | NEW |