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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 | 53 |
54 FWL_Error CFWL_FormTP::Finalize() { | 54 FWL_Error CFWL_FormTP::Finalize() { |
55 FinalizeTTO(); | 55 FinalizeTTO(); |
56 delete m_pActiveBitmap; | 56 delete m_pActiveBitmap; |
57 m_pActiveBitmap = nullptr; | 57 m_pActiveBitmap = nullptr; |
58 delete m_pDeactivebitmap; | 58 delete m_pDeactivebitmap; |
59 m_pDeactivebitmap = nullptr; | 59 m_pDeactivebitmap = nullptr; |
60 return CFWL_WidgetTP::Finalize(); | 60 return CFWL_WidgetTP::Finalize(); |
61 } | 61 } |
62 | 62 |
63 FX_BOOL CFWL_FormTP::IsValidWidget(IFWL_Widget* pWidget) { | 63 bool CFWL_FormTP::IsValidWidget(IFWL_Widget* pWidget) { |
64 if (!pWidget) | 64 return pWidget && pWidget->GetClassID() == FWL_Type::Form; |
65 return FALSE; | |
66 uint32_t dwHash = pWidget->GetClassID(); | |
67 return dwHash == FWL_CLASSHASH_Form; | |
68 } | 65 } |
| 66 |
69 uint32_t CFWL_FormTP::SetThemeID(IFWL_Widget* pWidget, | 67 uint32_t CFWL_FormTP::SetThemeID(IFWL_Widget* pWidget, |
70 uint32_t dwThemeID, | 68 uint32_t dwThemeID, |
71 FX_BOOL bChildren) { | 69 FX_BOOL bChildren) { |
72 if (m_pThemeData) { | 70 if (m_pThemeData) { |
73 SetThemeData(FWL_GetThemeColor(dwThemeID)); | 71 SetThemeData(FWL_GetThemeColor(dwThemeID)); |
74 } | 72 } |
75 InitCaption(TRUE); | 73 InitCaption(TRUE); |
76 InitCaption(FALSE); | 74 InitCaption(FALSE); |
77 return CFWL_WidgetTP::SetThemeID(pWidget, dwThemeID, bChildren); | 75 return CFWL_WidgetTP::SetThemeID(pWidget, dwThemeID, bChildren); |
78 } | 76 } |
(...skipping 796 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
875 path.Clear(); | 873 path.Clear(); |
876 path.AddRectangle(0, 5, 1, 15); | 874 path.AddRectangle(0, 5, 1, 15); |
877 DrawAxialShading(&gs, 0, 5, 0, 20, m_pThemeData->clrHeadBK[1][1], | 875 DrawAxialShading(&gs, 0, 5, 0, 20, m_pThemeData->clrHeadBK[1][1], |
878 m_pThemeData->clrHeadBK[1][2], &path); | 876 m_pThemeData->clrHeadBK[1][2], &path); |
879 path.Clear(); | 877 path.Clear(); |
880 path.AddRectangle(0, 20, 1, kCYCaption - 19); | 878 path.AddRectangle(0, 20, 1, kCYCaption - 19); |
881 DrawAxialShading(&gs, 0, 20, 0, kCYCaption, m_pThemeData->clrHeadBK[1][2], | 879 DrawAxialShading(&gs, 0, 20, 0, kCYCaption, m_pThemeData->clrHeadBK[1][2], |
882 m_pThemeData->clrHeadBK[1][3], &path); | 880 m_pThemeData->clrHeadBK[1][3], &path); |
883 } | 881 } |
884 } | 882 } |
OLD | NEW |