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/fwl/lightwidget/cfwl_theme.h" |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
11 #include "xfa/fwl/core/cfwl_themebackground.h" | 11 #include "xfa/fwl/core/cfwl_themebackground.h" |
12 #include "xfa/fwl/core/cfwl_themepart.h" | 12 #include "xfa/fwl/core/cfwl_themepart.h" |
13 #include "xfa/fwl/core/cfwl_themetext.h" | 13 #include "xfa/fwl/core/cfwl_themetext.h" |
14 #include "xfa/include/fwl/theme/barcodetp.h" | 14 #include "xfa/fwl/theme/cfwl_barcodetp.h" |
15 #include "xfa/include/fwl/theme/carettp.h" | 15 #include "xfa/fwl/theme/cfwl_carettp.h" |
16 #include "xfa/include/fwl/theme/checkboxtp.h" | 16 #include "xfa/fwl/theme/cfwl_checkboxtp.h" |
17 #include "xfa/include/fwl/theme/comboboxtp.h" | 17 #include "xfa/fwl/theme/cfwl_comboboxtp.h" |
18 #include "xfa/include/fwl/theme/datetimepickertp.h" | 18 #include "xfa/fwl/theme/cfwl_datetimepickertp.h" |
19 #include "xfa/include/fwl/theme/edittp.h" | 19 #include "xfa/fwl/theme/cfwl_edittp.h" |
20 #include "xfa/include/fwl/theme/formtp.h" | 20 #include "xfa/fwl/theme/cfwl_formtp.h" |
21 #include "xfa/include/fwl/theme/listboxtp.h" | 21 #include "xfa/fwl/theme/cfwl_listboxtp.h" |
22 #include "xfa/include/fwl/theme/monthcalendartp.h" | 22 #include "xfa/fwl/theme/cfwl_monthcalendartp.h" |
23 #include "xfa/include/fwl/theme/pictureboxtp.h" | 23 #include "xfa/fwl/theme/cfwl_pictureboxtp.h" |
24 #include "xfa/include/fwl/theme/pushbuttontp.h" | 24 #include "xfa/fwl/theme/cfwl_pushbuttontp.h" |
25 #include "xfa/include/fwl/theme/scrollbartp.h" | 25 #include "xfa/fwl/theme/cfwl_scrollbartp.h" |
26 | 26 |
27 CFWL_Theme::CFWL_Theme() { | 27 CFWL_Theme::CFWL_Theme() { |
28 m_ThemesArray.push_back(std::unique_ptr<CFWL_WidgetTP>(new CFWL_FormTP)); | 28 m_ThemesArray.push_back(std::unique_ptr<CFWL_WidgetTP>(new CFWL_FormTP)); |
29 m_ThemesArray.push_back( | 29 m_ThemesArray.push_back( |
30 std::unique_ptr<CFWL_WidgetTP>(new CFWL_PushButtonTP)); | 30 std::unique_ptr<CFWL_WidgetTP>(new CFWL_PushButtonTP)); |
31 m_ThemesArray.push_back(std::unique_ptr<CFWL_WidgetTP>(new CFWL_CheckBoxTP)); | 31 m_ThemesArray.push_back(std::unique_ptr<CFWL_WidgetTP>(new CFWL_CheckBoxTP)); |
32 m_ThemesArray.push_back(std::unique_ptr<CFWL_WidgetTP>(new CFWL_ListBoxTP)); | 32 m_ThemesArray.push_back(std::unique_ptr<CFWL_WidgetTP>(new CFWL_ListBoxTP)); |
33 m_ThemesArray.push_back( | 33 m_ThemesArray.push_back( |
34 std::unique_ptr<CFWL_WidgetTP>(new CFWL_PictureBoxTP)); | 34 std::unique_ptr<CFWL_WidgetTP>(new CFWL_PictureBoxTP)); |
35 m_ThemesArray.push_back(std::unique_ptr<CFWL_WidgetTP>(new CFWL_ScrollBarTP)); | 35 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... |
129 return FWL_ERR_Succeeded; | 129 return FWL_ERR_Succeeded; |
130 } | 130 } |
131 | 131 |
132 CFWL_WidgetTP* CFWL_Theme::GetTheme(IFWL_Widget* pWidget) { | 132 CFWL_WidgetTP* CFWL_Theme::GetTheme(IFWL_Widget* pWidget) { |
133 for (const auto& pTheme : m_ThemesArray) { | 133 for (const auto& pTheme : m_ThemesArray) { |
134 if (pTheme->IsValidWidget(pWidget)) | 134 if (pTheme->IsValidWidget(pWidget)) |
135 return pTheme.get(); | 135 return pTheme.get(); |
136 } | 136 } |
137 return nullptr; | 137 return nullptr; |
138 } | 138 } |
OLD | NEW |