| 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 "xfa/fwl/basewidget/fwl_tooltipctrlimp.h" | 10 #include "xfa/fwl/basewidget/fwl_tooltipctrlimp.h" |
| 11 #include "xfa/fwl/basewidget/ifwl_tooltip.h" |
| 12 #include "xfa/fwl/core/cfwl_message.h" |
| 11 #include "xfa/fwl/core/fwl_appimp.h" | 13 #include "xfa/fwl/core/fwl_appimp.h" |
| 12 #include "xfa/fwl/core/fwl_formimp.h" | 14 #include "xfa/fwl/core/fwl_formimp.h" |
| 13 #include "xfa/fwl/core/fwl_panelimp.h" | 15 #include "xfa/fwl/core/fwl_panelimp.h" |
| 14 #include "xfa/fwl/core/fwl_targetimp.h" | 16 #include "xfa/fwl/core/fwl_targetimp.h" |
| 15 #include "xfa/fwl/core/fwl_threadimp.h" | 17 #include "xfa/fwl/core/fwl_threadimp.h" |
| 16 #include "xfa/fwl/core/fwl_widgetimp.h" | 18 #include "xfa/fwl/core/fwl_widgetimp.h" |
| 17 #include "xfa/fwl/core/fwl_widgetmgrimp.h" | 19 #include "xfa/fwl/core/fwl_widgetmgrimp.h" |
| 18 #include "xfa/include/fwl/adapter/fwl_adapterwidgetmgr.h" | 20 #include "xfa/fwl/core/ifwl_adapterwidgetmgr.h" |
| 19 #include "xfa/include/fwl/basewidget/fwl_tooltipctrl.h" | 21 #include "xfa/fwl/core/ifwl_app.h" |
| 20 #include "xfa/include/fwl/core/fwl_app.h" | 22 #include "xfa/fwl/core/ifwl_grid.h" |
| 21 #include "xfa/include/fwl/core/fwl_grid.h" | 23 #include "xfa/fwl/core/ifwl_tooltiptarget.h" |
| 22 | 24 |
| 23 CFWL_NoteLoop::CFWL_NoteLoop(CFWL_WidgetImp* pForm) | 25 CFWL_NoteLoop::CFWL_NoteLoop(CFWL_WidgetImp* pForm) |
| 24 : m_pForm(pForm), m_bContinueModal(TRUE) {} | 26 : m_pForm(pForm), m_bContinueModal(TRUE) {} |
| 25 FX_BOOL CFWL_NoteLoop::PreProcessMessage(CFWL_Message* pMessage) { | 27 FX_BOOL CFWL_NoteLoop::PreProcessMessage(CFWL_Message* pMessage) { |
| 26 if (!m_pForm) { | 28 if (!m_pForm) { |
| 27 return FALSE; | 29 return FALSE; |
| 28 } | 30 } |
| 29 return TranslateAccelerator(pMessage); | 31 return TranslateAccelerator(pMessage); |
| 30 } | 32 } |
| 31 FWL_ERR CFWL_NoteLoop::Idle(int32_t count) { | 33 FWL_ERR CFWL_NoteLoop::Idle(int32_t count) { |
| (...skipping 766 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 798 while (pos) { | 800 while (pos) { |
| 799 void* key = NULL; | 801 void* key = NULL; |
| 800 CFWL_EventTarget* pEventTarget = NULL; | 802 CFWL_EventTarget* pEventTarget = NULL; |
| 801 m_eventTargets.GetNextAssoc(pos, key, (void*&)pEventTarget); | 803 m_eventTargets.GetNextAssoc(pos, key, (void*&)pEventTarget); |
| 802 if (pEventTarget && (bRemoveAll || pEventTarget->IsInvalid())) { | 804 if (pEventTarget && (bRemoveAll || pEventTarget->IsInvalid())) { |
| 803 m_eventTargets.RemoveKey(key); | 805 m_eventTargets.RemoveKey(key); |
| 804 delete pEventTarget; | 806 delete pEventTarget; |
| 805 } | 807 } |
| 806 } | 808 } |
| 807 } | 809 } |
| 808 class CFWL_CoreToopTipDP : public IFWL_ToolTipDP { | 810 class CFWL_CoreToolTipDP : public IFWL_ToolTipDP { |
| 809 public: | 811 public: |
| 810 FWL_ERR GetCaption(IFWL_Widget* pWidget, CFX_WideString& wsCaption); | 812 FWL_ERR GetCaption(IFWL_Widget* pWidget, CFX_WideString& wsCaption); |
| 811 int32_t GetInitialDelay(IFWL_Widget* pWidget); | 813 int32_t GetInitialDelay(IFWL_Widget* pWidget); |
| 812 int32_t GetAutoPopDelay(IFWL_Widget* pWidget); | 814 int32_t GetAutoPopDelay(IFWL_Widget* pWidget); |
| 813 CFX_DIBitmap* GetToolTipIcon(IFWL_Widget* pWidget); | 815 CFX_DIBitmap* GetToolTipIcon(IFWL_Widget* pWidget); |
| 814 CFX_SizeF GetToolTipIconSize(IFWL_Widget* pWidget); | 816 CFX_SizeF GetToolTipIconSize(IFWL_Widget* pWidget); |
| 815 CFX_RectF GetAnchor(); | 817 CFX_RectF GetAnchor(); |
| 816 CFWL_CoreToopTipDP(); | 818 CFWL_CoreToolTipDP(); |
| 817 | 819 |
| 818 CFX_WideString m_wsCaption; | 820 CFX_WideString m_wsCaption; |
| 819 int32_t m_nInitDelayTime; | 821 int32_t m_nInitDelayTime; |
| 820 int32_t m_nAutoPopDelayTime; | 822 int32_t m_nAutoPopDelayTime; |
| 821 CFX_RectF m_fAnchor; | 823 CFX_RectF m_fAnchor; |
| 822 }; | 824 }; |
| 823 CFWL_CoreToopTipDP::CFWL_CoreToopTipDP() { | 825 CFWL_CoreToolTipDP::CFWL_CoreToolTipDP() { |
| 824 m_nInitDelayTime = 500; | 826 m_nInitDelayTime = 500; |
| 825 m_nAutoPopDelayTime = 50000; | 827 m_nAutoPopDelayTime = 50000; |
| 826 m_fAnchor.Set(0.0, 0.0, 0.0, 0.0); | 828 m_fAnchor.Set(0.0, 0.0, 0.0, 0.0); |
| 827 } | 829 } |
| 828 FWL_ERR CFWL_CoreToopTipDP::GetCaption(IFWL_Widget* pWidget, | 830 FWL_ERR CFWL_CoreToolTipDP::GetCaption(IFWL_Widget* pWidget, |
| 829 CFX_WideString& wsCaption) { | 831 CFX_WideString& wsCaption) { |
| 830 wsCaption = m_wsCaption; | 832 wsCaption = m_wsCaption; |
| 831 return FWL_ERR_Succeeded; | 833 return FWL_ERR_Succeeded; |
| 832 } | 834 } |
| 833 int32_t CFWL_CoreToopTipDP::GetInitialDelay(IFWL_Widget* pWidget) { | 835 int32_t CFWL_CoreToolTipDP::GetInitialDelay(IFWL_Widget* pWidget) { |
| 834 return m_nInitDelayTime; | 836 return m_nInitDelayTime; |
| 835 } | 837 } |
| 836 int32_t CFWL_CoreToopTipDP::GetAutoPopDelay(IFWL_Widget* pWidget) { | 838 int32_t CFWL_CoreToolTipDP::GetAutoPopDelay(IFWL_Widget* pWidget) { |
| 837 return m_nAutoPopDelayTime; | 839 return m_nAutoPopDelayTime; |
| 838 } | 840 } |
| 839 CFX_DIBitmap* CFWL_CoreToopTipDP::GetToolTipIcon(IFWL_Widget* pWidget) { | 841 CFX_DIBitmap* CFWL_CoreToolTipDP::GetToolTipIcon(IFWL_Widget* pWidget) { |
| 840 return NULL; | 842 return NULL; |
| 841 } | 843 } |
| 842 CFX_SizeF CFWL_CoreToopTipDP::GetToolTipIconSize(IFWL_Widget* pWidget) { | 844 CFX_SizeF CFWL_CoreToolTipDP::GetToolTipIconSize(IFWL_Widget* pWidget) { |
| 843 return CFX_SizeF(); | 845 return CFX_SizeF(); |
| 844 } | 846 } |
| 845 CFX_RectF CFWL_CoreToopTipDP::GetAnchor() { | 847 CFX_RectF CFWL_CoreToolTipDP::GetAnchor() { |
| 846 return m_fAnchor; | 848 return m_fAnchor; |
| 847 } | 849 } |
| 848 CFWL_EventTarget::~CFWL_EventTarget() { | 850 CFWL_EventTarget::~CFWL_EventTarget() { |
| 849 m_eventSources.RemoveAll(); | 851 m_eventSources.RemoveAll(); |
| 850 } | 852 } |
| 851 int32_t CFWL_EventTarget::SetEventSource(IFWL_Widget* pSource, | 853 int32_t CFWL_EventTarget::SetEventSource(IFWL_Widget* pSource, |
| 852 FX_DWORD dwFilter) { | 854 FX_DWORD dwFilter) { |
| 853 if (pSource) { | 855 if (pSource) { |
| 854 m_eventSources.SetAt(pSource, dwFilter); | 856 m_eventSources.SetAt(pSource, dwFilter); |
| 855 return m_eventSources.GetCount(); | 857 return m_eventSources.GetCount(); |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 923 break; | 925 break; |
| 924 } | 926 } |
| 925 } | 927 } |
| 926 return bRet; | 928 return bRet; |
| 927 } | 929 } |
| 928 | 930 |
| 929 CFWL_ToolTipContainer* CFWL_ToolTipContainer::s_pInstance = NULL; | 931 CFWL_ToolTipContainer* CFWL_ToolTipContainer::s_pInstance = NULL; |
| 930 | 932 |
| 931 CFWL_ToolTipContainer::CFWL_ToolTipContainer() | 933 CFWL_ToolTipContainer::CFWL_ToolTipContainer() |
| 932 : pCurTarget(NULL), m_pToolTipImp(NULL) { | 934 : pCurTarget(NULL), m_pToolTipImp(NULL) { |
| 933 m_ToolTipDp = new CFWL_CoreToopTipDP; | 935 m_ToolTipDp = new CFWL_CoreToolTipDP; |
| 934 m_ToolTipDp->m_nInitDelayTime = 0; | 936 m_ToolTipDp->m_nInitDelayTime = 0; |
| 935 m_ToolTipDp->m_nAutoPopDelayTime = 2000; | 937 m_ToolTipDp->m_nAutoPopDelayTime = 2000; |
| 936 } | 938 } |
| 937 CFWL_ToolTipContainer::~CFWL_ToolTipContainer() { | 939 CFWL_ToolTipContainer::~CFWL_ToolTipContainer() { |
| 938 if (m_pToolTipImp) { | 940 if (m_pToolTipImp) { |
| 939 IFWL_ToolTip* pToolTip = | 941 IFWL_ToolTip* pToolTip = |
| 940 static_cast<IFWL_ToolTip*>(m_pToolTipImp->GetInterface()); | 942 static_cast<IFWL_ToolTip*>(m_pToolTipImp->GetInterface()); |
| 941 pToolTip->Finalize(); | 943 pToolTip->Finalize(); |
| 942 delete pToolTip; | 944 delete pToolTip; |
| 943 } | 945 } |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1088 return NULL; | 1090 return NULL; |
| 1089 return widget->GetInterface(); | 1091 return widget->GetInterface(); |
| 1090 } | 1092 } |
| 1091 FWL_ERR FWL_SetHook(IFWL_NoteDriver* driver, | 1093 FWL_ERR FWL_SetHook(IFWL_NoteDriver* driver, |
| 1092 FWLMessageHookCallback callback, | 1094 FWLMessageHookCallback callback, |
| 1093 void* info) { | 1095 void* info) { |
| 1094 CFWL_NoteDriver* noteDriver = static_cast<CFWL_NoteDriver*>(driver); | 1096 CFWL_NoteDriver* noteDriver = static_cast<CFWL_NoteDriver*>(driver); |
| 1095 noteDriver->SetHook(callback, info); | 1097 noteDriver->SetHook(callback, info); |
| 1096 return FWL_ERR_Succeeded; | 1098 return FWL_ERR_Succeeded; |
| 1097 } | 1099 } |
| OLD | NEW |