| 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_noteimp.h" | 7 #include "xfa/fwl/core/fwl_noteimp.h" |
| 8 | 8 |
| 9 #include "core/fxcrt/include/fx_ext.h" | 9 #include "core/fxcrt/include/fx_ext.h" |
| 10 #include "third_party/base/stl_util.h" | 10 #include "third_party/base/stl_util.h" |
| (...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 661 auto old = it++; | 661 auto old = it++; |
| 662 if (old->second && (bRemoveAll || old->second->IsInvalid())) { | 662 if (old->second && (bRemoveAll || old->second->IsInvalid())) { |
| 663 delete old->second; | 663 delete old->second; |
| 664 m_eventTargets.erase(old); | 664 m_eventTargets.erase(old); |
| 665 } | 665 } |
| 666 } | 666 } |
| 667 } | 667 } |
| 668 | 668 |
| 669 class CFWL_CoreToolTipDP : public IFWL_ToolTipDP { | 669 class CFWL_CoreToolTipDP : public IFWL_ToolTipDP { |
| 670 public: | 670 public: |
| 671 FWL_Error GetCaption(IFWL_Widget* pWidget, CFX_WideString& wsCaption); | 671 // IFWL_ToolTipDP |
| 672 int32_t GetInitialDelay(IFWL_Widget* pWidget); | 672 FWL_Error GetCaption(IFWL_Widget* pWidget, |
| 673 int32_t GetAutoPopDelay(IFWL_Widget* pWidget); | 673 CFX_WideString& wsCaption) override; |
| 674 CFX_DIBitmap* GetToolTipIcon(IFWL_Widget* pWidget); | 674 int32_t GetInitialDelay(IFWL_Widget* pWidget) override; |
| 675 CFX_SizeF GetToolTipIconSize(IFWL_Widget* pWidget); | 675 int32_t GetAutoPopDelay(IFWL_Widget* pWidget) override; |
| 676 CFX_DIBitmap* GetToolTipIcon(IFWL_Widget* pWidget) override; |
| 677 CFX_SizeF GetToolTipIconSize(IFWL_Widget* pWidget) override; |
| 678 |
| 676 CFX_RectF GetAnchor(); | 679 CFX_RectF GetAnchor(); |
| 677 CFWL_CoreToolTipDP(); | 680 CFWL_CoreToolTipDP(); |
| 678 | 681 |
| 679 CFX_WideString m_wsCaption; | 682 CFX_WideString m_wsCaption; |
| 680 int32_t m_nInitDelayTime; | 683 int32_t m_nInitDelayTime; |
| 681 int32_t m_nAutoPopDelayTime; | 684 int32_t m_nAutoPopDelayTime; |
| 682 CFX_RectF m_fAnchor; | 685 CFX_RectF m_fAnchor; |
| 683 }; | 686 }; |
| 687 |
| 684 CFWL_CoreToolTipDP::CFWL_CoreToolTipDP() { | 688 CFWL_CoreToolTipDP::CFWL_CoreToolTipDP() { |
| 685 m_nInitDelayTime = 500; | 689 m_nInitDelayTime = 500; |
| 686 m_nAutoPopDelayTime = 50000; | 690 m_nAutoPopDelayTime = 50000; |
| 687 m_fAnchor.Set(0.0, 0.0, 0.0, 0.0); | 691 m_fAnchor.Set(0.0, 0.0, 0.0, 0.0); |
| 688 } | 692 } |
| 693 |
| 689 FWL_Error CFWL_CoreToolTipDP::GetCaption(IFWL_Widget* pWidget, | 694 FWL_Error CFWL_CoreToolTipDP::GetCaption(IFWL_Widget* pWidget, |
| 690 CFX_WideString& wsCaption) { | 695 CFX_WideString& wsCaption) { |
| 691 wsCaption = m_wsCaption; | 696 wsCaption = m_wsCaption; |
| 692 return FWL_Error::Succeeded; | 697 return FWL_Error::Succeeded; |
| 693 } | 698 } |
| 699 |
| 694 int32_t CFWL_CoreToolTipDP::GetInitialDelay(IFWL_Widget* pWidget) { | 700 int32_t CFWL_CoreToolTipDP::GetInitialDelay(IFWL_Widget* pWidget) { |
| 695 return m_nInitDelayTime; | 701 return m_nInitDelayTime; |
| 696 } | 702 } |
| 703 |
| 697 int32_t CFWL_CoreToolTipDP::GetAutoPopDelay(IFWL_Widget* pWidget) { | 704 int32_t CFWL_CoreToolTipDP::GetAutoPopDelay(IFWL_Widget* pWidget) { |
| 698 return m_nAutoPopDelayTime; | 705 return m_nAutoPopDelayTime; |
| 699 } | 706 } |
| 707 |
| 700 CFX_DIBitmap* CFWL_CoreToolTipDP::GetToolTipIcon(IFWL_Widget* pWidget) { | 708 CFX_DIBitmap* CFWL_CoreToolTipDP::GetToolTipIcon(IFWL_Widget* pWidget) { |
| 701 return NULL; | 709 return NULL; |
| 702 } | 710 } |
| 711 |
| 703 CFX_SizeF CFWL_CoreToolTipDP::GetToolTipIconSize(IFWL_Widget* pWidget) { | 712 CFX_SizeF CFWL_CoreToolTipDP::GetToolTipIconSize(IFWL_Widget* pWidget) { |
| 704 return CFX_SizeF(); | 713 return CFX_SizeF(); |
| 705 } | 714 } |
| 715 |
| 706 CFX_RectF CFWL_CoreToolTipDP::GetAnchor() { | 716 CFX_RectF CFWL_CoreToolTipDP::GetAnchor() { |
| 707 return m_fAnchor; | 717 return m_fAnchor; |
| 708 } | 718 } |
| 719 |
| 720 CFWL_EventTarget::CFWL_EventTarget(CFWL_NoteDriver* pNoteDriver, |
| 721 IFWL_Widget* pListener) |
| 722 : m_pListener(pListener), m_pNoteDriver(pNoteDriver), m_bInvalid(FALSE) {} |
| 709 CFWL_EventTarget::~CFWL_EventTarget() { | 723 CFWL_EventTarget::~CFWL_EventTarget() { |
| 710 m_eventSources.RemoveAll(); | 724 m_eventSources.RemoveAll(); |
| 711 } | 725 } |
| 726 |
| 712 int32_t CFWL_EventTarget::SetEventSource(IFWL_Widget* pSource, | 727 int32_t CFWL_EventTarget::SetEventSource(IFWL_Widget* pSource, |
| 713 uint32_t dwFilter) { | 728 uint32_t dwFilter) { |
| 714 if (pSource) { | 729 if (pSource) { |
| 715 m_eventSources.SetAt(pSource, dwFilter); | 730 m_eventSources.SetAt(pSource, dwFilter); |
| 716 return m_eventSources.GetCount(); | 731 return m_eventSources.GetCount(); |
| 717 } | 732 } |
| 718 return 1; | 733 return 1; |
| 719 } | 734 } |
| 720 | 735 |
| 721 FX_BOOL CFWL_EventTarget::ProcessEvent(CFWL_Event* pEvent) { | 736 FX_BOOL CFWL_EventTarget::ProcessEvent(CFWL_Event* pEvent) { |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 885 if (HasToolTip(pEvt->m_pDstTarget) && NULL != m_pToolTipImp) { | 900 if (HasToolTip(pEvt->m_pDstTarget) && NULL != m_pToolTipImp) { |
| 886 m_pToolTipImp->Hide(); | 901 m_pToolTipImp->Hide(); |
| 887 pCurTarget = NULL; | 902 pCurTarget = NULL; |
| 888 return TRUE; | 903 return TRUE; |
| 889 } | 904 } |
| 890 return FALSE; | 905 return FALSE; |
| 891 } | 906 } |
| 892 IFWL_ToolTipTarget* CFWL_ToolTipContainer::GetCurrentToolTipTarget() { | 907 IFWL_ToolTipTarget* CFWL_ToolTipContainer::GetCurrentToolTipTarget() { |
| 893 return pCurTarget; | 908 return pCurTarget; |
| 894 } | 909 } |
| OLD | NEW |