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/basewidget/fwl_tooltipctrlimp.h" | 7 #include "xfa/fwl/basewidget/fwl_tooltipctrlimp.h" |
8 | 8 |
9 #include "xfa/fde/tto/fde_textout.h" | 9 #include "xfa/fde/tto/fde_textout.h" |
10 #include "xfa/fwl/basewidget/ifwl_tooltip.h" | 10 #include "xfa/fwl/basewidget/ifwl_tooltip.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 CFWL_ToolTipImp::~CFWL_ToolTipImp() { | 56 CFWL_ToolTipImp::~CFWL_ToolTipImp() { |
57 if (m_pTimer) { | 57 if (m_pTimer) { |
58 delete m_pTimer; | 58 delete m_pTimer; |
59 m_pTimer = NULL; | 59 m_pTimer = NULL; |
60 } | 60 } |
61 } | 61 } |
62 FWL_ERR CFWL_ToolTipImp::GetClassName(CFX_WideString& wsClass) const { | 62 FWL_ERR CFWL_ToolTipImp::GetClassName(CFX_WideString& wsClass) const { |
63 wsClass = FWL_CLASS_ToolTip; | 63 wsClass = FWL_CLASS_ToolTip; |
64 return FWL_ERR_Succeeded; | 64 return FWL_ERR_Succeeded; |
65 } | 65 } |
66 FX_DWORD CFWL_ToolTipImp::GetClassID() const { | 66 uint32_t CFWL_ToolTipImp::GetClassID() const { |
67 return FWL_CLASSHASH_ToolTip; | 67 return FWL_CLASSHASH_ToolTip; |
68 } | 68 } |
69 FWL_ERR CFWL_ToolTipImp::Initialize() { | 69 FWL_ERR CFWL_ToolTipImp::Initialize() { |
70 m_pProperties->m_dwStyles |= FWL_WGTSTYLE_Popup; | 70 m_pProperties->m_dwStyles |= FWL_WGTSTYLE_Popup; |
71 m_pProperties->m_dwStyles &= ~FWL_WGTSTYLE_Child; | 71 m_pProperties->m_dwStyles &= ~FWL_WGTSTYLE_Child; |
72 if (CFWL_WidgetImp::Initialize() != FWL_ERR_Succeeded) | 72 if (CFWL_WidgetImp::Initialize() != FWL_ERR_Succeeded) |
73 return FWL_ERR_Indefinite; | 73 return FWL_ERR_Indefinite; |
74 m_pDelegate = new CFWL_ToolTipImpDelegate(this); | 74 m_pDelegate = new CFWL_ToolTipImpDelegate(this); |
75 return FWL_ERR_Succeeded; | 75 return FWL_ERR_Succeeded; |
76 } | 76 } |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 if (m_hTimerHide) { | 219 if (m_hTimerHide) { |
220 FWL_StopTimer(m_hTimerHide); | 220 FWL_StopTimer(m_hTimerHide); |
221 m_hTimerHide = NULL; | 221 m_hTimerHide = NULL; |
222 } | 222 } |
223 if (m_hTimerShow) { | 223 if (m_hTimerShow) { |
224 FWL_StopTimer(m_hTimerShow); | 224 FWL_StopTimer(m_hTimerShow); |
225 m_hTimerShow = NULL; | 225 m_hTimerShow = NULL; |
226 } | 226 } |
227 return TRUE; | 227 return TRUE; |
228 } | 228 } |
229 FWL_ERR CFWL_ToolTipImp::SetStates(FX_DWORD dwStates, FX_BOOL bSet) { | 229 FWL_ERR CFWL_ToolTipImp::SetStates(uint32_t dwStates, FX_BOOL bSet) { |
230 if ((dwStates & FWL_WGTSTATE_Invisible) && !bSet) { | 230 if ((dwStates & FWL_WGTSTATE_Invisible) && !bSet) { |
231 IFWL_ToolTipDP* pData = | 231 IFWL_ToolTipDP* pData = |
232 static_cast<IFWL_ToolTipDP*>(m_pProperties->m_pDataProvider); | 232 static_cast<IFWL_ToolTipDP*>(m_pProperties->m_pDataProvider); |
233 int32_t nAutoPopDelay = pData->GetAutoPopDelay(m_pInterface); | 233 int32_t nAutoPopDelay = pData->GetAutoPopDelay(m_pInterface); |
234 m_hTimerHide = FWL_StartTimer(&m_TimerHide, nAutoPopDelay, FALSE); | 234 m_hTimerHide = FWL_StartTimer(&m_TimerHide, nAutoPopDelay, FALSE); |
235 } | 235 } |
236 return CFWL_WidgetImp::SetStates(dwStates, bSet); | 236 return CFWL_WidgetImp::SetStates(dwStates, bSet); |
237 } | 237 } |
238 void CFWL_ToolTipImp::RefreshToolTipPos() { | 238 void CFWL_ToolTipImp::RefreshToolTipPos() { |
239 if ((m_pProperties->m_dwStyleExes & FWL_STYLEEXT_TTP_NoAnchor) == 0) { | 239 if ((m_pProperties->m_dwStyleExes & FWL_STYLEEXT_TTP_NoAnchor) == 0) { |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 int32_t CFWL_ToolTipImpDelegate::OnProcessMessage(CFWL_Message* pMessage) { | 288 int32_t CFWL_ToolTipImpDelegate::OnProcessMessage(CFWL_Message* pMessage) { |
289 return CFWL_WidgetImpDelegate::OnProcessMessage(pMessage); | 289 return CFWL_WidgetImpDelegate::OnProcessMessage(pMessage); |
290 } | 290 } |
291 FWL_ERR CFWL_ToolTipImpDelegate::OnProcessEvent(CFWL_Event* pEvent) { | 291 FWL_ERR CFWL_ToolTipImpDelegate::OnProcessEvent(CFWL_Event* pEvent) { |
292 return FWL_ERR_Succeeded; | 292 return FWL_ERR_Succeeded; |
293 } | 293 } |
294 FWL_ERR CFWL_ToolTipImpDelegate::OnDrawWidget(CFX_Graphics* pGraphics, | 294 FWL_ERR CFWL_ToolTipImpDelegate::OnDrawWidget(CFX_Graphics* pGraphics, |
295 const CFX_Matrix* pMatrix) { | 295 const CFX_Matrix* pMatrix) { |
296 return m_pOwner->DrawWidget(pGraphics, pMatrix); | 296 return m_pOwner->DrawWidget(pGraphics, pMatrix); |
297 } | 297 } |
OLD | NEW |