| 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_widgetmgrimp.h" | 7 #include "xfa/fwl/core/fwl_widgetmgrimp.h" |
| 8 | 8 |
| 9 #include "xfa/fwl/core/cfwl_message.h" | 9 #include "xfa/fwl/core/cfwl_message.h" |
| 10 #include "xfa/fwl/core/fwl_appimp.h" | 10 #include "xfa/fwl/core/fwl_appimp.h" |
| (...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 657 return -1; | 657 return -1; |
| 658 } | 658 } |
| 659 return iCount - 1; | 659 return iCount - 1; |
| 660 } | 660 } |
| 661 FX_BOOL CFWL_WidgetMgr::IsAbleNative(IFWL_Widget* pWidget) { | 661 FX_BOOL CFWL_WidgetMgr::IsAbleNative(IFWL_Widget* pWidget) { |
| 662 if (!pWidget) | 662 if (!pWidget) |
| 663 return FALSE; | 663 return FALSE; |
| 664 if (!pWidget->IsInstance(FX_WSTRC(FWL_CLASS_Form))) { | 664 if (!pWidget->IsInstance(FX_WSTRC(FWL_CLASS_Form))) { |
| 665 return FALSE; | 665 return FALSE; |
| 666 } | 666 } |
| 667 FX_DWORD dwStyles = pWidget->GetStyles(); | 667 uint32_t dwStyles = pWidget->GetStyles(); |
| 668 return ((dwStyles & FWL_WGTSTYLE_WindowTypeMask) == | 668 return ((dwStyles & FWL_WGTSTYLE_WindowTypeMask) == |
| 669 FWL_WGTSTYLE_OverLapper) || | 669 FWL_WGTSTYLE_OverLapper) || |
| 670 (dwStyles & FWL_WGTSTYLE_Popup); | 670 (dwStyles & FWL_WGTSTYLE_Popup); |
| 671 } | 671 } |
| 672 FX_BOOL CFWL_WidgetMgr::IsThreadEnabled() { | 672 FX_BOOL CFWL_WidgetMgr::IsThreadEnabled() { |
| 673 return !(m_dwCapability & FWL_WGTMGR_DisableThread); | 673 return !(m_dwCapability & FWL_WGTMGR_DisableThread); |
| 674 } | 674 } |
| 675 FX_BOOL CFWL_WidgetMgr::IsFormDisabled() { | 675 FX_BOOL CFWL_WidgetMgr::IsFormDisabled() { |
| 676 return m_dwCapability & FWL_WGTMGR_DisableForm; | 676 return m_dwCapability & FWL_WGTMGR_DisableForm; |
| 677 } | 677 } |
| 678 FX_BOOL CFWL_WidgetMgr::GetAdapterPopupPos(IFWL_Widget* pWidget, | 678 FX_BOOL CFWL_WidgetMgr::GetAdapterPopupPos(IFWL_Widget* pWidget, |
| 679 FX_FLOAT fMinHeight, | 679 FX_FLOAT fMinHeight, |
| 680 FX_FLOAT fMaxHeight, | 680 FX_FLOAT fMaxHeight, |
| 681 const CFX_RectF& rtAnchor, | 681 const CFX_RectF& rtAnchor, |
| 682 CFX_RectF& rtPopup) { | 682 CFX_RectF& rtPopup) { |
| 683 IFWL_AdapterWidgetMgr* pSDApapter = GetAdapterWidgetMgr(); | 683 IFWL_AdapterWidgetMgr* pSDApapter = GetAdapterWidgetMgr(); |
| 684 return pSDApapter->GetPopupPos(pWidget, fMinHeight, fMaxHeight, rtAnchor, | 684 return pSDApapter->GetPopupPos(pWidget, fMinHeight, fMaxHeight, rtAnchor, |
| 685 rtPopup); | 685 rtPopup); |
| 686 } | 686 } |
| 687 CFWL_WidgetMgrDelegate::CFWL_WidgetMgrDelegate(CFWL_WidgetMgr* pWidgetMgr) | 687 CFWL_WidgetMgrDelegate::CFWL_WidgetMgrDelegate(CFWL_WidgetMgr* pWidgetMgr) |
| 688 : m_pWidgetMgr(pWidgetMgr) {} | 688 : m_pWidgetMgr(pWidgetMgr) {} |
| 689 FWL_ERR CFWL_WidgetMgrDelegate::OnSetCapability(FX_DWORD dwCapability) { | 689 FWL_ERR CFWL_WidgetMgrDelegate::OnSetCapability(uint32_t dwCapability) { |
| 690 m_pWidgetMgr->m_dwCapability = dwCapability; | 690 m_pWidgetMgr->m_dwCapability = dwCapability; |
| 691 return FWL_ERR_Succeeded; | 691 return FWL_ERR_Succeeded; |
| 692 } | 692 } |
| 693 int32_t CFWL_WidgetMgrDelegate::OnProcessMessageToForm(CFWL_Message* pMessage) { | 693 int32_t CFWL_WidgetMgrDelegate::OnProcessMessageToForm(CFWL_Message* pMessage) { |
| 694 if (!pMessage) | 694 if (!pMessage) |
| 695 return 0; | 695 return 0; |
| 696 if (!pMessage->m_pDstTarget) | 696 if (!pMessage->m_pDstTarget) |
| 697 return 0; | 697 return 0; |
| 698 IFWL_Widget* pDstWidget = pMessage->m_pDstTarget; | 698 IFWL_Widget* pDstWidget = pMessage->m_pDstTarget; |
| 699 IFWL_NoteThread* pNoteThread = pDstWidget->GetOwnerThread(); | 699 IFWL_NoteThread* pNoteThread = pDstWidget->GetOwnerThread(); |
| (...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1067 if (child == find) { | 1067 if (child == find) { |
| 1068 return TRUE; | 1068 return TRUE; |
| 1069 } | 1069 } |
| 1070 if (FWL_WidgetIsChild(child, find)) { | 1070 if (FWL_WidgetIsChild(child, find)) { |
| 1071 return TRUE; | 1071 return TRUE; |
| 1072 } | 1072 } |
| 1073 child = FWL_GetWidgetMgr()->GetWidget(child, FWL_WGTRELATION_NextSibling); | 1073 child = FWL_GetWidgetMgr()->GetWidget(child, FWL_WGTRELATION_NextSibling); |
| 1074 } | 1074 } |
| 1075 return FALSE; | 1075 return FALSE; |
| 1076 } | 1076 } |
| OLD | NEW |