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/lightwidget/cfwl_theme.h" | 7 #include "xfa/fwl/lightwidget/cfwl_theme.h" |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
(...skipping 27 matching lines...) Expand all Loading... |
38 m_ThemesArray.push_back(std::unique_ptr<CFWL_WidgetTP>(new CFWL_BarcodeTP)); | 38 m_ThemesArray.push_back(std::unique_ptr<CFWL_WidgetTP>(new CFWL_BarcodeTP)); |
39 m_ThemesArray.push_back( | 39 m_ThemesArray.push_back( |
40 std::unique_ptr<CFWL_WidgetTP>(new CFWL_DateTimePickerTP)); | 40 std::unique_ptr<CFWL_WidgetTP>(new CFWL_DateTimePickerTP)); |
41 m_ThemesArray.push_back( | 41 m_ThemesArray.push_back( |
42 std::unique_ptr<CFWL_WidgetTP>(new CFWL_MonthCalendarTP)); | 42 std::unique_ptr<CFWL_WidgetTP>(new CFWL_MonthCalendarTP)); |
43 m_ThemesArray.push_back(std::unique_ptr<CFWL_WidgetTP>(new CFWL_CaretTP)); | 43 m_ThemesArray.push_back(std::unique_ptr<CFWL_WidgetTP>(new CFWL_CaretTP)); |
44 } | 44 } |
45 | 45 |
46 CFWL_Theme::~CFWL_Theme() {} | 46 CFWL_Theme::~CFWL_Theme() {} |
47 | 47 |
48 FX_BOOL CFWL_Theme::IsValidWidget(IFWL_Widget* pWidget) { | 48 bool CFWL_Theme::IsValidWidget(IFWL_Widget* pWidget) { |
49 return !!GetTheme(pWidget); | 49 return !!GetTheme(pWidget); |
50 } | 50 } |
51 | 51 |
52 uint32_t CFWL_Theme::GetThemeID(IFWL_Widget* pWidget) { | 52 uint32_t CFWL_Theme::GetThemeID(IFWL_Widget* pWidget) { |
53 return GetTheme(pWidget)->GetThemeID(pWidget); | 53 return GetTheme(pWidget)->GetThemeID(pWidget); |
54 } | 54 } |
55 | 55 |
56 uint32_t CFWL_Theme::SetThemeID(IFWL_Widget* pWidget, | 56 uint32_t CFWL_Theme::SetThemeID(IFWL_Widget* pWidget, |
57 uint32_t dwThemeID, | 57 uint32_t dwThemeID, |
58 FX_BOOL bChildren) { | 58 FX_BOOL bChildren) { |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 return FWL_Error::Succeeded; | 131 return FWL_Error::Succeeded; |
132 } | 132 } |
133 | 133 |
134 CFWL_WidgetTP* CFWL_Theme::GetTheme(IFWL_Widget* pWidget) { | 134 CFWL_WidgetTP* CFWL_Theme::GetTheme(IFWL_Widget* pWidget) { |
135 for (const auto& pTheme : m_ThemesArray) { | 135 for (const auto& pTheme : m_ThemesArray) { |
136 if (pTheme->IsValidWidget(pWidget)) | 136 if (pTheme->IsValidWidget(pWidget)) |
137 return pTheme.get(); | 137 return pTheme.get(); |
138 } | 138 } |
139 return nullptr; | 139 return nullptr; |
140 } | 140 } |
OLD | NEW |