| 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_widgetimp.h" | 7 #include "xfa/fwl/core/fwl_widgetimp.h" |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 } | 111 } |
| 112 FWL_ERR IFWL_Widget::Update() { | 112 FWL_ERR IFWL_Widget::Update() { |
| 113 return static_cast<CFWL_WidgetImp*>(GetImpl())->Update(); | 113 return static_cast<CFWL_WidgetImp*>(GetImpl())->Update(); |
| 114 } | 114 } |
| 115 FWL_ERR IFWL_Widget::LockUpdate() { | 115 FWL_ERR IFWL_Widget::LockUpdate() { |
| 116 return static_cast<CFWL_WidgetImp*>(GetImpl())->LockUpdate(); | 116 return static_cast<CFWL_WidgetImp*>(GetImpl())->LockUpdate(); |
| 117 } | 117 } |
| 118 FWL_ERR IFWL_Widget::UnlockUpdate() { | 118 FWL_ERR IFWL_Widget::UnlockUpdate() { |
| 119 return static_cast<CFWL_WidgetImp*>(GetImpl())->UnlockUpdate(); | 119 return static_cast<CFWL_WidgetImp*>(GetImpl())->UnlockUpdate(); |
| 120 } | 120 } |
| 121 uint32_t IFWL_Widget::HitTest(FX_FLOAT fx, FX_FLOAT fy) { | 121 FWL_WidgetHitTest IFWL_Widget::HitTest(FX_FLOAT fx, FX_FLOAT fy) { |
| 122 return static_cast<CFWL_WidgetImp*>(GetImpl())->HitTest(fx, fy); | 122 return static_cast<CFWL_WidgetImp*>(GetImpl())->HitTest(fx, fy); |
| 123 } | 123 } |
| 124 FWL_ERR IFWL_Widget::TransformTo(IFWL_Widget* pWidget, | 124 FWL_ERR IFWL_Widget::TransformTo(IFWL_Widget* pWidget, |
| 125 FX_FLOAT& fx, | 125 FX_FLOAT& fx, |
| 126 FX_FLOAT& fy) { | 126 FX_FLOAT& fy) { |
| 127 return static_cast<CFWL_WidgetImp*>(GetImpl())->TransformTo(pWidget, fx, fy); | 127 return static_cast<CFWL_WidgetImp*>(GetImpl())->TransformTo(pWidget, fx, fy); |
| 128 } | 128 } |
| 129 FWL_ERR IFWL_Widget::TransformTo(IFWL_Widget* pWidget, CFX_RectF& rt) { | 129 FWL_ERR IFWL_Widget::TransformTo(IFWL_Widget* pWidget, CFX_RectF& rt) { |
| 130 return static_cast<CFWL_WidgetImp*>(GetImpl())->TransformTo(pWidget, rt); | 130 return static_cast<CFWL_WidgetImp*>(GetImpl())->TransformTo(pWidget, rt); |
| 131 } | 131 } |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 FWL_ERR CFWL_WidgetImp::LockUpdate() { | 358 FWL_ERR CFWL_WidgetImp::LockUpdate() { |
| 359 m_iLock++; | 359 m_iLock++; |
| 360 return FWL_ERR_Succeeded; | 360 return FWL_ERR_Succeeded; |
| 361 } | 361 } |
| 362 FWL_ERR CFWL_WidgetImp::UnlockUpdate() { | 362 FWL_ERR CFWL_WidgetImp::UnlockUpdate() { |
| 363 if (IsLocked()) { | 363 if (IsLocked()) { |
| 364 m_iLock--; | 364 m_iLock--; |
| 365 } | 365 } |
| 366 return FWL_ERR_Succeeded; | 366 return FWL_ERR_Succeeded; |
| 367 } | 367 } |
| 368 uint32_t CFWL_WidgetImp::HitTest(FX_FLOAT fx, FX_FLOAT fy) { | 368 FWL_WidgetHitTest CFWL_WidgetImp::HitTest(FX_FLOAT fx, FX_FLOAT fy) { |
| 369 CFX_RectF rtClient; | 369 CFX_RectF rtClient; |
| 370 GetClientRect(rtClient); | 370 GetClientRect(rtClient); |
| 371 if (rtClient.Contains(fx, fy)) { | 371 if (rtClient.Contains(fx, fy)) |
| 372 return FWL_WGTHITTEST_Client; | 372 return FWL_WidgetHitTest::Client; |
| 373 } | |
| 374 if (HasEdge()) { | 373 if (HasEdge()) { |
| 375 CFX_RectF rtEdge; | 374 CFX_RectF rtEdge; |
| 376 GetEdgeRect(rtEdge); | 375 GetEdgeRect(rtEdge); |
| 377 if (rtEdge.Contains(fx, fy)) { | 376 if (rtEdge.Contains(fx, fy)) |
| 378 return FWL_WGTHITTEST_Edge; | 377 return FWL_WidgetHitTest::Edge; |
| 379 } | |
| 380 } | 378 } |
| 381 if (HasBorder()) { | 379 if (HasBorder()) { |
| 382 CFX_RectF rtRelative; | 380 CFX_RectF rtRelative; |
| 383 GetRelativeRect(rtRelative); | 381 GetRelativeRect(rtRelative); |
| 384 if (rtRelative.Contains(fx, fy)) { | 382 if (rtRelative.Contains(fx, fy)) |
| 385 return FWL_WGTHITTEST_Border; | 383 return FWL_WidgetHitTest::Border; |
| 386 } | |
| 387 } | 384 } |
| 388 return FWL_WGTHITTEST_Unknown; | 385 return FWL_WidgetHitTest::Unknown; |
| 389 } | 386 } |
| 390 FWL_ERR CFWL_WidgetImp::TransformTo(IFWL_Widget* pWidget, | 387 FWL_ERR CFWL_WidgetImp::TransformTo(IFWL_Widget* pWidget, |
| 391 FX_FLOAT& fx, | 388 FX_FLOAT& fx, |
| 392 FX_FLOAT& fy) { | 389 FX_FLOAT& fy) { |
| 393 if (m_pWidgetMgr->IsFormDisabled()) { | 390 if (m_pWidgetMgr->IsFormDisabled()) { |
| 394 CFX_SizeF szOffset; | 391 CFX_SizeF szOffset; |
| 395 if (IsParent(pWidget)) { | 392 if (IsParent(pWidget)) { |
| 396 szOffset = GetOffsetFromParent(pWidget); | 393 szOffset = GetOffsetFromParent(pWidget); |
| 397 } else { | 394 } else { |
| 398 szOffset = pWidget->GetOffsetFromParent(m_pInterface); | 395 szOffset = pWidget->GetOffsetFromParent(m_pInterface); |
| (...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1073 FWL_ERR CFWL_WidgetImpDelegate::OnProcessEvent(CFWL_Event* pEvent) { | 1070 FWL_ERR CFWL_WidgetImpDelegate::OnProcessEvent(CFWL_Event* pEvent) { |
| 1074 return FWL_ERR_Succeeded; | 1071 return FWL_ERR_Succeeded; |
| 1075 } | 1072 } |
| 1076 | 1073 |
| 1077 FWL_ERR CFWL_WidgetImpDelegate::OnDrawWidget(CFX_Graphics* pGraphics, | 1074 FWL_ERR CFWL_WidgetImpDelegate::OnDrawWidget(CFX_Graphics* pGraphics, |
| 1078 const CFX_Matrix* pMatrix) { | 1075 const CFX_Matrix* pMatrix) { |
| 1079 CFWL_EvtDraw evt; | 1076 CFWL_EvtDraw evt; |
| 1080 evt.m_pGraphics = pGraphics; | 1077 evt.m_pGraphics = pGraphics; |
| 1081 return FWL_ERR_Succeeded; | 1078 return FWL_ERR_Succeeded; |
| 1082 } | 1079 } |
| OLD | NEW |