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/include/fwl/lightwidget/theme.h" | 7 #include "xfa/include/fwl/lightwidget/theme.h" |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
11 #include "xfa/include/fwl/theme/barcodetp.h" | 11 #include "xfa/include/fwl/theme/barcodetp.h" |
12 #include "xfa/include/fwl/theme/carettp.h" | 12 #include "xfa/include/fwl/theme/carettp.h" |
13 #include "xfa/include/fwl/theme/checkboxtp.h" | 13 #include "xfa/include/fwl/theme/checkboxtp.h" |
14 #include "xfa/include/fwl/theme/comboboxtp.h" | 14 #include "xfa/include/fwl/theme/comboboxtp.h" |
15 #include "xfa/include/fwl/theme/datetimepickertp.h" | 15 #include "xfa/include/fwl/theme/datetimepickertp.h" |
16 #include "xfa/include/fwl/theme/edittp.h" | 16 #include "xfa/include/fwl/theme/edittp.h" |
17 #include "xfa/include/fwl/theme/formtp.h" | 17 #include "xfa/include/fwl/theme/formtp.h" |
18 #include "xfa/include/fwl/theme/listboxtp.h" | 18 #include "xfa/include/fwl/theme/listboxtp.h" |
19 #include "xfa/include/fwl/theme/monthcalendartp.h" | 19 #include "xfa/include/fwl/theme/monthcalendartp.h" |
20 #include "xfa/include/fwl/theme/pictureboxtp.h" | 20 #include "xfa/include/fwl/theme/pictureboxtp.h" |
21 #include "xfa/include/fwl/theme/pushbuttontp.h" | 21 #include "xfa/include/fwl/theme/pushbuttontp.h" |
22 #include "xfa/include/fwl/theme/scrollbartp.h" | 22 #include "xfa/include/fwl/theme/scrollbartp.h" |
23 #include "xfa/src/foxitlib.h" | |
24 | 23 |
25 CFWL_Theme::CFWL_Theme() { | 24 CFWL_Theme::CFWL_Theme() { |
26 m_ThemesArray.push_back(std::unique_ptr<CFWL_WidgetTP>(new CFWL_FormTP)); | 25 m_ThemesArray.push_back(std::unique_ptr<CFWL_WidgetTP>(new CFWL_FormTP)); |
27 m_ThemesArray.push_back( | 26 m_ThemesArray.push_back( |
28 std::unique_ptr<CFWL_WidgetTP>(new CFWL_PushButtonTP)); | 27 std::unique_ptr<CFWL_WidgetTP>(new CFWL_PushButtonTP)); |
29 m_ThemesArray.push_back(std::unique_ptr<CFWL_WidgetTP>(new CFWL_CheckBoxTP)); | 28 m_ThemesArray.push_back(std::unique_ptr<CFWL_WidgetTP>(new CFWL_CheckBoxTP)); |
30 m_ThemesArray.push_back(std::unique_ptr<CFWL_WidgetTP>(new CFWL_ListBoxTP)); | 29 m_ThemesArray.push_back(std::unique_ptr<CFWL_WidgetTP>(new CFWL_ListBoxTP)); |
31 m_ThemesArray.push_back( | 30 m_ThemesArray.push_back( |
32 std::unique_ptr<CFWL_WidgetTP>(new CFWL_PictureBoxTP)); | 31 std::unique_ptr<CFWL_WidgetTP>(new CFWL_PictureBoxTP)); |
33 m_ThemesArray.push_back(std::unique_ptr<CFWL_WidgetTP>(new CFWL_ScrollBarTP)); | 32 m_ThemesArray.push_back(std::unique_ptr<CFWL_WidgetTP>(new CFWL_ScrollBarTP)); |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 return FWL_ERR_Succeeded; | 126 return FWL_ERR_Succeeded; |
128 } | 127 } |
129 | 128 |
130 CFWL_WidgetTP* CFWL_Theme::GetTheme(IFWL_Widget* pWidget) { | 129 CFWL_WidgetTP* CFWL_Theme::GetTheme(IFWL_Widget* pWidget) { |
131 for (const auto& pTheme : m_ThemesArray) { | 130 for (const auto& pTheme : m_ThemesArray) { |
132 if (pTheme->IsValidWidget(pWidget)) | 131 if (pTheme->IsValidWidget(pWidget)) |
133 return pTheme.get(); | 132 return pTheme.get(); |
134 } | 133 } |
135 return nullptr; | 134 return nullptr; |
136 } | 135 } |
OLD | NEW |