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_barcode.h" | 7 #include "xfa/fwl/lightwidget/cfwl_barcode.h" |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
11 IFWL_Barcode* CFWL_Barcode::GetWidget() { | 11 IFWL_Barcode* CFWL_Barcode::GetWidget() { |
12 return static_cast<IFWL_Barcode*>(m_pIface.get()); | 12 return static_cast<IFWL_Barcode*>(m_pIface.get()); |
13 } | 13 } |
14 | 14 |
15 const IFWL_Barcode* CFWL_Barcode::GetWidget() const { | 15 const IFWL_Barcode* CFWL_Barcode::GetWidget() const { |
16 return static_cast<IFWL_Barcode*>(m_pIface.get()); | 16 return static_cast<IFWL_Barcode*>(m_pIface.get()); |
17 } | 17 } |
18 | 18 |
19 FWL_Error CFWL_Barcode::Initialize(const CFWL_WidgetProperties* pProperties) { | 19 FWL_Error CFWL_Barcode::Initialize(const CFWL_WidgetProperties* pProperties) { |
20 if (m_pIface) | 20 if (m_pIface) |
21 return FWL_Error::Indefinite; | 21 return FWL_Error::Indefinite; |
22 if (pProperties) { | 22 if (pProperties) { |
23 *m_pProperties = *pProperties; | 23 *m_pProperties = *pProperties; |
24 } | 24 } |
25 std::unique_ptr<IFWL_Barcode> pBarcode(IFWL_Barcode::Create( | 25 std::unique_ptr<IFWL_Barcode> pBarcode( |
26 m_pProperties->MakeWidgetImpProperties(&m_barcodeData))); | 26 new IFWL_Barcode(m_pProperties->MakeWidgetImpProperties(&m_barcodeData))); |
27 FWL_Error ret = pBarcode->Initialize(); | 27 FWL_Error ret = pBarcode->Initialize(); |
28 if (ret != FWL_Error::Succeeded) { | 28 if (ret != FWL_Error::Succeeded) { |
29 return ret; | 29 return ret; |
30 } | 30 } |
31 m_pIface = std::move(pBarcode); | 31 m_pIface = std::move(pBarcode); |
32 CFWL_Widget::Initialize(); | 32 CFWL_Widget::Initialize(); |
33 return FWL_Error::Succeeded; | 33 return FWL_Error::Succeeded; |
34 } | 34 } |
35 | 35 |
36 CFWL_Barcode::CFWL_Barcode() {} | 36 CFWL_Barcode::CFWL_Barcode() {} |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 return m_nECLevel; | 102 return m_nECLevel; |
103 } | 103 } |
104 | 104 |
105 FX_BOOL CFWL_Barcode::CFWL_BarcodeDP::GetTruncated() { | 105 FX_BOOL CFWL_Barcode::CFWL_BarcodeDP::GetTruncated() { |
106 return m_bTruncated; | 106 return m_bTruncated; |
107 } | 107 } |
108 | 108 |
109 uint32_t CFWL_Barcode::CFWL_BarcodeDP::GetBarcodeAttributeMask() { | 109 uint32_t CFWL_Barcode::CFWL_BarcodeDP::GetBarcodeAttributeMask() { |
110 return m_dwAttributeMask; | 110 return m_dwAttributeMask; |
111 } | 111 } |
OLD | NEW |