Chromium Code Reviews| 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/fwl_widgetimp.h" | 7 #include "xfa/fwl/core/fwl_widgetimp.h" |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 90 uint32_t dwStylesExRemoved) { | 90 uint32_t dwStylesExRemoved) { |
| 91 return static_cast<CFWL_WidgetImp*>(GetImpl()) | 91 return static_cast<CFWL_WidgetImp*>(GetImpl()) |
| 92 ->ModifyStylesEx(dwStylesExAdded, dwStylesExRemoved); | 92 ->ModifyStylesEx(dwStylesExAdded, dwStylesExRemoved); |
| 93 } | 93 } |
| 94 uint32_t IFWL_Widget::GetStates() { | 94 uint32_t IFWL_Widget::GetStates() { |
| 95 return static_cast<CFWL_WidgetImp*>(GetImpl())->GetStates(); | 95 return static_cast<CFWL_WidgetImp*>(GetImpl())->GetStates(); |
| 96 } | 96 } |
| 97 void IFWL_Widget::SetStates(uint32_t dwStates, FX_BOOL bSet) { | 97 void IFWL_Widget::SetStates(uint32_t dwStates, FX_BOOL bSet) { |
| 98 static_cast<CFWL_WidgetImp*>(GetImpl())->SetStates(dwStates, bSet); | 98 static_cast<CFWL_WidgetImp*>(GetImpl())->SetStates(dwStates, bSet); |
| 99 } | 99 } |
| 100 | |
| 101 uint32_t IFWL_Widget::GetEventKey() const { | |
| 102 return static_cast<CFWL_WidgetImp*>(GetImpl())->GetEventKey(); | |
|
Lei Zhang
2016/05/26 01:32:20
GetImpl() and many other calls to it in this file
Tom Sepez
2016/05/26 16:15:55
Done.
| |
| 103 } | |
| 104 | |
| 105 void IFWL_Widget::SetEventKey(uint32_t key) { | |
| 106 static_cast<CFWL_WidgetImp*>(GetImpl())->SetEventKey(key); | |
| 107 } | |
| 108 | |
| 100 FWL_Error IFWL_Widget::SetPrivateData(void* module_id, | 109 FWL_Error IFWL_Widget::SetPrivateData(void* module_id, |
| 101 void* pData, | 110 void* pData, |
| 102 PD_CALLBACK_FREEDATA callback) { | 111 PD_CALLBACK_FREEDATA callback) { |
| 103 return static_cast<CFWL_WidgetImp*>(GetImpl()) | 112 return static_cast<CFWL_WidgetImp*>(GetImpl()) |
| 104 ->SetPrivateData(module_id, pData, callback); | 113 ->SetPrivateData(module_id, pData, callback); |
| 105 } | 114 } |
| 106 void* IFWL_Widget::GetPrivateData(void* module_id) { | 115 void* IFWL_Widget::GetPrivateData(void* module_id) { |
| 107 return static_cast<CFWL_WidgetImp*>(GetImpl())->GetPrivateData(module_id); | 116 return static_cast<CFWL_WidgetImp*>(GetImpl())->GetPrivateData(module_id); |
| 108 } | 117 } |
| 109 FWL_Error IFWL_Widget::Update() { | 118 FWL_Error IFWL_Widget::Update() { |
| (...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 499 FWL_Error CFWL_WidgetImp::SetOwnerApp(CFWL_AppImp* pOwnerApp) { | 508 FWL_Error CFWL_WidgetImp::SetOwnerApp(CFWL_AppImp* pOwnerApp) { |
| 500 m_pOwnerApp = pOwnerApp; | 509 m_pOwnerApp = pOwnerApp; |
| 501 return FWL_Error::Succeeded; | 510 return FWL_Error::Succeeded; |
| 502 } | 511 } |
| 503 IFWL_Widget* CFWL_WidgetImp::GetInterface() const { | 512 IFWL_Widget* CFWL_WidgetImp::GetInterface() const { |
| 504 return m_pInterface; | 513 return m_pInterface; |
| 505 } | 514 } |
| 506 void CFWL_WidgetImp::SetInterface(IFWL_Widget* pInterface) { | 515 void CFWL_WidgetImp::SetInterface(IFWL_Widget* pInterface) { |
| 507 m_pInterface = pInterface; | 516 m_pInterface = pInterface; |
| 508 } | 517 } |
| 518 | |
| 519 uint32_t CFWL_WidgetImp::GetEventKey() const { | |
| 520 return m_nEventKey; | |
| 521 } | |
| 522 | |
| 523 void CFWL_WidgetImp::SetEventKey(uint32_t key) { | |
| 524 m_nEventKey = key; | |
| 525 } | |
| 526 | |
| 509 CFWL_WidgetImp::CFWL_WidgetImp(const CFWL_WidgetImpProperties& properties, | 527 CFWL_WidgetImp::CFWL_WidgetImp(const CFWL_WidgetImpProperties& properties, |
| 510 IFWL_Widget* pOuter) | 528 IFWL_Widget* pOuter) |
| 511 : m_pProperties(new CFWL_WidgetImpProperties), | 529 : m_pProperties(new CFWL_WidgetImpProperties), |
| 512 m_pPrivateData(NULL), | 530 m_pPrivateData(NULL), |
| 513 m_pDelegate(NULL), | 531 m_pDelegate(NULL), |
| 514 m_pCurDelegate(NULL), | 532 m_pCurDelegate(NULL), |
| 515 m_pOuter(pOuter), | 533 m_pOuter(pOuter), |
| 516 m_pInterface(NULL), | 534 m_pInterface(NULL), |
| 517 m_iLock(0) { | 535 m_iLock(0), |
| 536 m_nEventKey(0) { | |
| 518 *m_pProperties = properties; | 537 *m_pProperties = properties; |
| 519 m_pWidgetMgr = CFWL_WidgetMgr::GetInstance(); | 538 m_pWidgetMgr = CFWL_WidgetMgr::GetInstance(); |
| 520 ASSERT(m_pWidgetMgr != NULL); | 539 ASSERT(m_pWidgetMgr != NULL); |
| 521 } | 540 } |
| 522 CFWL_WidgetImp::~CFWL_WidgetImp() { | 541 CFWL_WidgetImp::~CFWL_WidgetImp() { |
| 523 if (m_pPrivateData) { | 542 if (m_pPrivateData) { |
| 524 delete m_pPrivateData; | 543 delete m_pPrivateData; |
| 525 m_pPrivateData = NULL; | 544 m_pPrivateData = NULL; |
| 526 } | 545 } |
| 527 if (m_pProperties) { | 546 if (m_pProperties) { |
| (...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1023 } | 1042 } |
| 1024 } | 1043 } |
| 1025 | 1044 |
| 1026 void CFWL_WidgetImpDelegate::OnProcessEvent(CFWL_Event* pEvent) {} | 1045 void CFWL_WidgetImpDelegate::OnProcessEvent(CFWL_Event* pEvent) {} |
| 1027 | 1046 |
| 1028 void CFWL_WidgetImpDelegate::OnDrawWidget(CFX_Graphics* pGraphics, | 1047 void CFWL_WidgetImpDelegate::OnDrawWidget(CFX_Graphics* pGraphics, |
| 1029 const CFX_Matrix* pMatrix) { | 1048 const CFX_Matrix* pMatrix) { |
| 1030 CFWL_EvtDraw evt; | 1049 CFWL_EvtDraw evt; |
| 1031 evt.m_pGraphics = pGraphics; | 1050 evt.m_pGraphics = pGraphics; |
| 1032 } | 1051 } |
| OLD | NEW |