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_formproxy.h" | 7 #include "xfa/fwl/core/ifwl_formproxy.h" |
8 | 8 |
9 #include "third_party/base/ptr_util.h" | 9 #include "third_party/base/ptr_util.h" |
10 #include "xfa/fwl/core/fwl_noteimp.h" | 10 #include "xfa/fwl/core/fwl_noteimp.h" |
11 | 11 |
12 IFWL_FormProxy::IFWL_FormProxy(const IFWL_App* app, | 12 IFWL_FormProxy::IFWL_FormProxy(const IFWL_App* app, |
13 const CFWL_WidgetImpProperties& properties, | 13 const CFWL_WidgetImpProperties& properties, |
14 IFWL_Widget* pOuter) | 14 IFWL_Widget* pOuter) |
15 : IFWL_Form(app, properties, pOuter) { | 15 : IFWL_Form(app, properties, pOuter) { |
16 SetDelegate(pdfium::MakeUnique<CFWL_FormProxyImpDelegate>(this)); | |
17 } | 16 } |
18 | 17 |
19 IFWL_FormProxy::~IFWL_FormProxy() {} | 18 IFWL_FormProxy::~IFWL_FormProxy() {} |
20 | 19 |
21 FWL_Type IFWL_FormProxy::GetClassID() const { | 20 FWL_Type IFWL_FormProxy::GetClassID() const { |
22 return FWL_Type::FormProxy; | 21 return FWL_Type::FormProxy; |
23 } | 22 } |
24 | 23 |
25 FX_BOOL IFWL_FormProxy::IsInstance(const CFX_WideStringC& wsClass) const { | 24 FX_BOOL IFWL_FormProxy::IsInstance(const CFX_WideStringC& wsClass) const { |
26 if (wsClass == CFX_WideStringC(FWL_CLASS_FormProxy)) { | 25 if (wsClass == CFX_WideStringC(FWL_CLASS_FormProxy)) { |
27 return TRUE; | 26 return TRUE; |
28 } | 27 } |
29 return IFWL_Form::IsInstance(wsClass); | 28 return IFWL_Form::IsInstance(wsClass); |
30 } | 29 } |
31 | 30 |
32 FWL_Error IFWL_FormProxy::Update() { | 31 FWL_Error IFWL_FormProxy::Update() { |
33 return FWL_Error::Succeeded; | 32 return FWL_Error::Succeeded; |
34 } | 33 } |
35 | 34 |
36 FWL_Error IFWL_FormProxy::DrawWidget(CFX_Graphics* pGraphics, | 35 FWL_Error IFWL_FormProxy::DrawWidget(CFX_Graphics* pGraphics, |
37 const CFX_Matrix* pMatrix) { | 36 const CFX_Matrix* pMatrix) { |
38 return FWL_Error::Succeeded; | 37 return FWL_Error::Succeeded; |
39 } | 38 } |
40 | 39 |
41 CFWL_FormProxyImpDelegate::CFWL_FormProxyImpDelegate(IFWL_FormProxy* pOwner) | 40 void IFWL_FormProxy::OnProcessMessage(CFWL_Message* pMessage) { |
42 : m_pOwner(pOwner) {} | 41 m_pOuter->GetDelegate()->OnProcessMessage(pMessage); |
43 | |
44 void CFWL_FormProxyImpDelegate::OnProcessMessage(CFWL_Message* pMessage) { | |
45 m_pOwner->m_pOuter->GetCurrentDelegate()->OnProcessMessage(pMessage); | |
46 } | 42 } |
OLD | NEW |