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_formtp.h" | 7 #include "xfa/fwl/theme/cfwl_formtp.h" |
8 | 8 |
9 #include "xfa/fde/tto/fde_textout.h" | 9 #include "xfa/fde/tto/fde_textout.h" |
10 #include "xfa/fwl/core/cfwl_themebackground.h" | 10 #include "xfa/fwl/core/cfwl_themebackground.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 delete m_pActiveBitmap; | 52 delete m_pActiveBitmap; |
53 m_pActiveBitmap = nullptr; | 53 m_pActiveBitmap = nullptr; |
54 delete m_pDeactivebitmap; | 54 delete m_pDeactivebitmap; |
55 m_pDeactivebitmap = nullptr; | 55 m_pDeactivebitmap = nullptr; |
56 return CFWL_WidgetTP::Finalize(); | 56 return CFWL_WidgetTP::Finalize(); |
57 } | 57 } |
58 | 58 |
59 FX_BOOL CFWL_FormTP::IsValidWidget(IFWL_Widget* pWidget) { | 59 FX_BOOL CFWL_FormTP::IsValidWidget(IFWL_Widget* pWidget) { |
60 if (!pWidget) | 60 if (!pWidget) |
61 return FALSE; | 61 return FALSE; |
62 uint32_t dwHash = pWidget->GetClassID(); | 62 return pWidget->GetClassID() == FWL_Type::Form; |
63 return dwHash == FWL_CLASSHASH_Form; | |
64 } | 63 } |
65 uint32_t CFWL_FormTP::SetThemeID(IFWL_Widget* pWidget, | 64 uint32_t CFWL_FormTP::SetThemeID(IFWL_Widget* pWidget, |
66 uint32_t dwThemeID, | 65 uint32_t dwThemeID, |
67 FX_BOOL bChildren) { | 66 FX_BOOL bChildren) { |
68 if (m_pThemeData) { | 67 if (m_pThemeData) { |
69 SetThemeData(FWL_GetThemeColor(dwThemeID)); | 68 SetThemeData(FWL_GetThemeColor(dwThemeID)); |
70 } | 69 } |
71 InitCaption(TRUE); | 70 InitCaption(TRUE); |
72 InitCaption(FALSE); | 71 InitCaption(FALSE); |
73 return CFWL_WidgetTP::SetThemeID(pWidget, dwThemeID, bChildren); | 72 return CFWL_WidgetTP::SetThemeID(pWidget, dwThemeID, bChildren); |
(...skipping 807 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
881 path.AddRectangle(0, 5, 1, 15); | 880 path.AddRectangle(0, 5, 1, 15); |
882 DrawAxialShading(&gs, 0, 5, 0, 20, m_pThemeData->clrHeadBK[1][1], | 881 DrawAxialShading(&gs, 0, 5, 0, 20, m_pThemeData->clrHeadBK[1][1], |
883 m_pThemeData->clrHeadBK[1][2], &path); | 882 m_pThemeData->clrHeadBK[1][2], &path); |
884 path.Clear(); | 883 path.Clear(); |
885 path.AddRectangle(0, 20, 1, FWLTHEME_CAPACITY_CYCaption - 19); | 884 path.AddRectangle(0, 20, 1, FWLTHEME_CAPACITY_CYCaption - 19); |
886 DrawAxialShading(&gs, 0, 20, 0, FWLTHEME_CAPACITY_CYCaption, | 885 DrawAxialShading(&gs, 0, 20, 0, FWLTHEME_CAPACITY_CYCaption, |
887 m_pThemeData->clrHeadBK[1][2], | 886 m_pThemeData->clrHeadBK[1][2], |
888 m_pThemeData->clrHeadBK[1][3], &path); | 887 m_pThemeData->clrHeadBK[1][3], &path); |
889 } | 888 } |
890 } | 889 } |
OLD | NEW |