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 513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
524 void* CFWL_WidgetImp::GetAssociateWidget() const { | 524 void* CFWL_WidgetImp::GetAssociateWidget() const { |
525 return m_pAssociate; | 525 return m_pAssociate; |
526 } | 526 } |
527 | 527 |
528 void CFWL_WidgetImp::SetAssociateWidget(void* pAssociate) { | 528 void CFWL_WidgetImp::SetAssociateWidget(void* pAssociate) { |
529 m_pAssociate = pAssociate; | 529 m_pAssociate = pAssociate; |
530 } | 530 } |
531 | 531 |
532 CFWL_WidgetImp::CFWL_WidgetImp(const CFWL_WidgetImpProperties& properties, | 532 CFWL_WidgetImp::CFWL_WidgetImp(const CFWL_WidgetImpProperties& properties, |
533 IFWL_Widget* pOuter) | 533 IFWL_Widget* pOuter) |
534 : m_pProperties(new CFWL_WidgetImpProperties), | 534 : m_pWidgetMgr(CFWL_WidgetMgr::GetInstance()), |
| 535 m_pProperties(new CFWL_WidgetImpProperties(properties)), |
535 m_pDelegate(nullptr), | 536 m_pDelegate(nullptr), |
536 m_pCurDelegate(nullptr), | 537 m_pCurDelegate(nullptr), |
537 m_pOuter(pOuter), | 538 m_pOuter(pOuter), |
538 m_pInterface(nullptr), | 539 m_pInterface(nullptr), |
539 m_pLayoutItem(nullptr), | 540 m_pLayoutItem(nullptr), |
540 m_pAssociate(nullptr), | 541 m_pAssociate(nullptr), |
541 m_iLock(0), | 542 m_iLock(0), |
542 m_nEventKey(0) { | 543 m_nEventKey(0) { |
543 *m_pProperties = properties; | |
544 m_pWidgetMgr = CFWL_WidgetMgr::GetInstance(); | |
545 ASSERT(m_pWidgetMgr); | 544 ASSERT(m_pWidgetMgr); |
546 } | 545 } |
547 | 546 |
548 CFWL_WidgetImp::~CFWL_WidgetImp() { | 547 CFWL_WidgetImp::~CFWL_WidgetImp() {} |
549 delete m_pProperties; | |
550 } | |
551 | 548 |
552 FX_BOOL CFWL_WidgetImp::IsEnabled() const { | 549 FX_BOOL CFWL_WidgetImp::IsEnabled() const { |
553 return (m_pProperties->m_dwStates & FWL_WGTSTATE_Disabled) == 0; | 550 return (m_pProperties->m_dwStates & FWL_WGTSTATE_Disabled) == 0; |
554 } | 551 } |
555 FX_BOOL CFWL_WidgetImp::IsVisible() const { | 552 FX_BOOL CFWL_WidgetImp::IsVisible() const { |
556 return (m_pProperties->m_dwStates & FWL_WGTSTATE_Invisible) == 0; | 553 return (m_pProperties->m_dwStates & FWL_WGTSTATE_Invisible) == 0; |
557 } | 554 } |
558 FX_BOOL CFWL_WidgetImp::IsActive() const { | 555 FX_BOOL CFWL_WidgetImp::IsActive() const { |
559 return (m_pProperties->m_dwStates & FWL_WGTSTATE_Deactivated) == 0; | 556 return (m_pProperties->m_dwStates & FWL_WGTSTATE_Deactivated) == 0; |
560 } | 557 } |
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1043 } | 1040 } |
1044 } | 1041 } |
1045 | 1042 |
1046 void CFWL_WidgetImpDelegate::OnProcessEvent(CFWL_Event* pEvent) {} | 1043 void CFWL_WidgetImpDelegate::OnProcessEvent(CFWL_Event* pEvent) {} |
1047 | 1044 |
1048 void CFWL_WidgetImpDelegate::OnDrawWidget(CFX_Graphics* pGraphics, | 1045 void CFWL_WidgetImpDelegate::OnDrawWidget(CFX_Graphics* pGraphics, |
1049 const CFX_Matrix* pMatrix) { | 1046 const CFX_Matrix* pMatrix) { |
1050 CFWL_EvtDraw evt; | 1047 CFWL_EvtDraw evt; |
1051 evt.m_pGraphics = pGraphics; | 1048 evt.m_pGraphics = pGraphics; |
1052 } | 1049 } |
OLD | NEW |