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/core/ifwl_barcode.h" | 7 #include "xfa/fwl/core/ifwl_barcode.h" |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
11 #include "third_party/base/ptr_util.h" | 11 #include "third_party/base/ptr_util.h" |
12 #include "xfa/fgas/font/cfgas_gefont.h" | 12 #include "xfa/fgas/font/cfgas_gefont.h" |
| 13 #include "xfa/fwl/core/cfwl_notedriver.h" |
13 #include "xfa/fwl/core/cfwl_themepart.h" | 14 #include "xfa/fwl/core/cfwl_themepart.h" |
14 #include "xfa/fwl/core/cfx_barcode.h" | 15 #include "xfa/fwl/core/cfx_barcode.h" |
15 #include "xfa/fwl/core/fwl_noteimp.h" | |
16 #include "xfa/fwl/core/ifwl_themeprovider.h" | 16 #include "xfa/fwl/core/ifwl_themeprovider.h" |
17 | 17 |
18 IFWL_Barcode::IFWL_Barcode(const IFWL_App* app, | 18 IFWL_Barcode::IFWL_Barcode(const IFWL_App* app, |
19 std::unique_ptr<CFWL_WidgetProperties> properties) | 19 std::unique_ptr<CFWL_WidgetProperties> properties) |
20 : IFWL_Edit(app, std::move(properties), nullptr), | 20 : IFWL_Edit(app, std::move(properties), nullptr), |
21 m_dwStatus(0), | 21 m_dwStatus(0), |
22 m_type(BC_UNKNOWN) {} | 22 m_type(BC_UNKNOWN) {} |
23 | 23 |
24 IFWL_Barcode::~IFWL_Barcode() {} | 24 IFWL_Barcode::~IFWL_Barcode() {} |
25 | 25 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 } | 59 } |
60 IFWL_Edit::DrawWidget(pGraphics, pMatrix); | 60 IFWL_Edit::DrawWidget(pGraphics, pMatrix); |
61 } | 61 } |
62 | 62 |
63 void IFWL_Barcode::GenerateBarcodeImageCache() { | 63 void IFWL_Barcode::GenerateBarcodeImageCache() { |
64 if ((m_dwStatus & XFA_BCS_NeedUpdate) == 0) | 64 if ((m_dwStatus & XFA_BCS_NeedUpdate) == 0) |
65 return; | 65 return; |
66 | 66 |
67 m_dwStatus = 0; | 67 m_dwStatus = 0; |
68 CreateBarcodeEngine(); | 68 CreateBarcodeEngine(); |
69 IFWL_BarcodeDP* pData = | 69 IFWL_Barcode::DataProvider* pData = |
70 static_cast<IFWL_BarcodeDP*>(m_pProperties->m_pDataProvider); | 70 static_cast<IFWL_Barcode::DataProvider*>(m_pProperties->m_pDataProvider); |
71 if (!pData) | 71 if (!pData) |
72 return; | 72 return; |
73 if (!m_pBarcodeEngine) | 73 if (!m_pBarcodeEngine) |
74 return; | 74 return; |
75 | 75 |
76 CFX_WideString wsText; | 76 CFX_WideString wsText; |
77 GetText(wsText); | 77 GetText(wsText); |
78 | 78 |
79 CFWL_ThemePart part; | 79 CFWL_ThemePart part; |
80 part.m_pWidget = this; | 80 part.m_pWidget = this; |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 return false; | 168 return false; |
169 } | 169 } |
170 | 170 |
171 void IFWL_Barcode::OnProcessEvent(CFWL_Event* pEvent) { | 171 void IFWL_Barcode::OnProcessEvent(CFWL_Event* pEvent) { |
172 if (pEvent->GetClassID() == CFWL_EventType::TextChanged) { | 172 if (pEvent->GetClassID() == CFWL_EventType::TextChanged) { |
173 m_pBarcodeEngine.reset(); | 173 m_pBarcodeEngine.reset(); |
174 m_dwStatus = XFA_BCS_NeedUpdate; | 174 m_dwStatus = XFA_BCS_NeedUpdate; |
175 } | 175 } |
176 IFWL_Edit::OnProcessEvent(pEvent); | 176 IFWL_Edit::OnProcessEvent(pEvent); |
177 } | 177 } |
OLD | NEW |