| 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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 } | 83 } |
| 84 | 84 |
| 85 FWL_Error CFWL_ToolTipImp::Finalize() { | 85 FWL_Error CFWL_ToolTipImp::Finalize() { |
| 86 delete m_pDelegate; | 86 delete m_pDelegate; |
| 87 m_pDelegate = nullptr; | 87 m_pDelegate = nullptr; |
| 88 return CFWL_WidgetImp::Finalize(); | 88 return CFWL_WidgetImp::Finalize(); |
| 89 } | 89 } |
| 90 FWL_Error CFWL_ToolTipImp::GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize) { | 90 FWL_Error CFWL_ToolTipImp::GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize) { |
| 91 if (bAutoSize) { | 91 if (bAutoSize) { |
| 92 rect.Set(0, 0, 0, 0); | 92 rect.Set(0, 0, 0, 0); |
| 93 if (!m_pProperties->m_pThemeProvider) { | 93 if (!m_pProperties->m_pThemeProvider) |
| 94 m_pProperties->m_pThemeProvider = GetAvailableTheme(); | 94 m_pProperties->m_pThemeProvider = GetAvailableTheme(); |
| 95 } | 95 |
| 96 CFX_WideString wsCaption; | 96 CFX_WideString wsCaption; |
| 97 IFWL_ToolTipDP* pData = | 97 IFWL_ToolTipDP* pData = |
| 98 static_cast<IFWL_ToolTipDP*>(m_pProperties->m_pDataProvider); | 98 static_cast<IFWL_ToolTipDP*>(m_pProperties->m_pDataProvider); |
| 99 if (pData) { | 99 if (pData) { |
| 100 pData->GetCaption(m_pInterface, wsCaption); | 100 pData->GetCaption(m_pInterface, wsCaption); |
| 101 } | 101 } |
| 102 int32_t iLen = wsCaption.GetLength(); | 102 int32_t iLen = wsCaption.GetLength(); |
| 103 if (iLen > 0) { | 103 if (iLen > 0) { |
| 104 CFX_SizeF sz = CalcTextSize(wsCaption, m_pProperties->m_pThemeProvider); | 104 CFX_SizeF sz = CalcTextSize(wsCaption, m_pProperties->m_pThemeProvider); |
| 105 rect.Set(0, 0, sz.x, sz.y); | 105 rect.Set(0, 0, sz.x, sz.y); |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 void CFWL_ToolTipImpDelegate::OnProcessMessage(CFWL_Message* pMessage) { | 300 void CFWL_ToolTipImpDelegate::OnProcessMessage(CFWL_Message* pMessage) { |
| 301 CFWL_WidgetImpDelegate::OnProcessMessage(pMessage); | 301 CFWL_WidgetImpDelegate::OnProcessMessage(pMessage); |
| 302 } | 302 } |
| 303 | 303 |
| 304 void CFWL_ToolTipImpDelegate::OnProcessEvent(CFWL_Event* pEvent) {} | 304 void CFWL_ToolTipImpDelegate::OnProcessEvent(CFWL_Event* pEvent) {} |
| 305 | 305 |
| 306 void CFWL_ToolTipImpDelegate::OnDrawWidget(CFX_Graphics* pGraphics, | 306 void CFWL_ToolTipImpDelegate::OnDrawWidget(CFX_Graphics* pGraphics, |
| 307 const CFX_Matrix* pMatrix) { | 307 const CFX_Matrix* pMatrix) { |
| 308 m_pOwner->DrawWidget(pGraphics, pMatrix); | 308 m_pOwner->DrawWidget(pGraphics, pMatrix); |
| 309 } | 309 } |
| OLD | NEW |