summaryrefslogtreecommitdiff
path: root/xfa/fxfa/app/xfa_ffwidgethandler.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-02-21 14:27:59 -0500
committerChromium commit bot <commit-bot@chromium.org>2017-02-21 20:44:29 +0000
commitb45ea1fce52d93615470bab8b671cba5907fb01e (patch)
tree15153c437a253f73b3f5bb154a294ace77fe2c6d /xfa/fxfa/app/xfa_ffwidgethandler.cpp
parent37a35df8c878d6e21a62ce0dfd2d480997d9e86c (diff)
downloadpdfium-b45ea1fce52d93615470bab8b671cba5907fb01e.tar.xz
Convert CFWL messages to use CFX_PointF
This Cl updates the various CFWL_Message classes to take CFX_PointF instead of x,y values. Change-Id: I5d9d01d68be64fc9e69c04574994c01286ad24e1 Reviewed-on: https://pdfium-review.googlesource.com/2811 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'xfa/fxfa/app/xfa_ffwidgethandler.cpp')
-rw-r--r--xfa/fxfa/app/xfa_ffwidgethandler.cpp62
1 files changed, 21 insertions, 41 deletions
diff --git a/xfa/fxfa/app/xfa_ffwidgethandler.cpp b/xfa/fxfa/app/xfa_ffwidgethandler.cpp
index bbca0409d3..2fddfb6156 100644
--- a/xfa/fxfa/app/xfa_ffwidgethandler.cpp
+++ b/xfa/fxfa/app/xfa_ffwidgethandler.cpp
@@ -40,11 +40,9 @@ bool CXFA_FFWidgetHandler::OnMouseExit(CXFA_FFWidget* hWidget) {
bool CXFA_FFWidgetHandler::OnLButtonDown(CXFA_FFWidget* hWidget,
uint32_t dwFlags,
- FX_FLOAT fx,
- FX_FLOAT fy) {
+ const CFX_PointF& point) {
m_pDocView->LockUpdate();
- CFX_PointF pos = hWidget->Rotate2Normal(CFX_PointF(fx, fy));
- bool bRet = hWidget->OnLButtonDown(dwFlags, pos.x, pos.y);
+ bool bRet = hWidget->OnLButtonDown(dwFlags, hWidget->Rotate2Normal(point));
if (bRet && m_pDocView->SetFocus(hWidget)) {
m_pDocView->GetDoc()->GetDocEnvironment()->SetFocusWidget(
m_pDocView->GetDoc(), hWidget);
@@ -56,12 +54,10 @@ bool CXFA_FFWidgetHandler::OnLButtonDown(CXFA_FFWidget* hWidget,
bool CXFA_FFWidgetHandler::OnLButtonUp(CXFA_FFWidget* hWidget,
uint32_t dwFlags,
- FX_FLOAT fx,
- FX_FLOAT fy) {
+ const CFX_PointF& point) {
m_pDocView->LockUpdate();
- CFX_PointF pos = hWidget->Rotate2Normal(CFX_PointF(fx, fy));
m_pDocView->m_bLayoutEvent = true;
- bool bRet = hWidget->OnLButtonUp(dwFlags, pos.x, pos.y);
+ bool bRet = hWidget->OnLButtonUp(dwFlags, hWidget->Rotate2Normal(point));
m_pDocView->UnlockUpdate();
m_pDocView->UpdateDocView();
return bRet;
@@ -69,20 +65,16 @@ bool CXFA_FFWidgetHandler::OnLButtonUp(CXFA_FFWidget* hWidget,
bool CXFA_FFWidgetHandler::OnLButtonDblClk(CXFA_FFWidget* hWidget,
uint32_t dwFlags,
- FX_FLOAT fx,
- FX_FLOAT fy) {
- CFX_PointF pos = hWidget->Rotate2Normal(CFX_PointF(fx, fy));
- bool bRet = hWidget->OnLButtonDblClk(dwFlags, pos.x, pos.y);
+ const CFX_PointF& point) {
+ bool bRet = hWidget->OnLButtonDblClk(dwFlags, hWidget->Rotate2Normal(point));
m_pDocView->RunInvalidate();
return bRet;
}
bool CXFA_FFWidgetHandler::OnMouseMove(CXFA_FFWidget* hWidget,
uint32_t dwFlags,
- FX_FLOAT fx,
- FX_FLOAT fy) {
- CFX_PointF pos = hWidget->Rotate2Normal(CFX_PointF(fx, fy));
- bool bRet = hWidget->OnMouseMove(dwFlags, pos.x, pos.y);
+ const CFX_PointF& point) {
+ bool bRet = hWidget->OnMouseMove(dwFlags, hWidget->Rotate2Normal(point));
m_pDocView->RunInvalidate();
return bRet;
}
@@ -90,20 +82,17 @@ bool CXFA_FFWidgetHandler::OnMouseMove(CXFA_FFWidget* hWidget,
bool CXFA_FFWidgetHandler::OnMouseWheel(CXFA_FFWidget* hWidget,
uint32_t dwFlags,
int16_t zDelta,
- FX_FLOAT fx,
- FX_FLOAT fy) {
- CFX_PointF pos = hWidget->Rotate2Normal(CFX_PointF(fx, fy));
- bool bRet = hWidget->OnMouseWheel(dwFlags, zDelta, pos.x, pos.y);
+ const CFX_PointF& point) {
+ bool bRet =
+ hWidget->OnMouseWheel(dwFlags, zDelta, hWidget->Rotate2Normal(point));
m_pDocView->RunInvalidate();
return bRet;
}
bool CXFA_FFWidgetHandler::OnRButtonDown(CXFA_FFWidget* hWidget,
uint32_t dwFlags,
- FX_FLOAT fx,
- FX_FLOAT fy) {
- CFX_PointF pos = hWidget->Rotate2Normal(CFX_PointF(fx, fy));
- bool bRet = hWidget->OnRButtonDown(dwFlags, pos.x, pos.y);
+ const CFX_PointF& point) {
+ bool bRet = hWidget->OnRButtonDown(dwFlags, hWidget->Rotate2Normal(point));
if (bRet && m_pDocView->SetFocus(hWidget)) {
m_pDocView->GetDoc()->GetDocEnvironment()->SetFocusWidget(
m_pDocView->GetDoc(), hWidget);
@@ -114,20 +103,16 @@ bool CXFA_FFWidgetHandler::OnRButtonDown(CXFA_FFWidget* hWidget,
bool CXFA_FFWidgetHandler::OnRButtonUp(CXFA_FFWidget* hWidget,
uint32_t dwFlags,
- FX_FLOAT fx,
- FX_FLOAT fy) {
- CFX_PointF pos = hWidget->Rotate2Normal(CFX_PointF(fx, fy));
- bool bRet = hWidget->OnRButtonUp(dwFlags, pos.x, pos.y);
+ const CFX_PointF& point) {
+ bool bRet = hWidget->OnRButtonUp(dwFlags, hWidget->Rotate2Normal(point));
m_pDocView->RunInvalidate();
return bRet;
}
bool CXFA_FFWidgetHandler::OnRButtonDblClk(CXFA_FFWidget* hWidget,
uint32_t dwFlags,
- FX_FLOAT fx,
- FX_FLOAT fy) {
- CFX_PointF pos = hWidget->Rotate2Normal(CFX_PointF(fx, fy));
- bool bRet = hWidget->OnRButtonDblClk(dwFlags, pos.x, pos.y);
+ const CFX_PointF& point) {
+ bool bRet = hWidget->OnRButtonDblClk(dwFlags, hWidget->Rotate2Normal(point));
m_pDocView->RunInvalidate();
return bRet;
}
@@ -158,20 +143,15 @@ bool CXFA_FFWidgetHandler::OnChar(CXFA_FFWidget* hWidget,
}
FWL_WidgetHit CXFA_FFWidgetHandler::OnHitTest(CXFA_FFWidget* hWidget,
- FX_FLOAT fx,
- FX_FLOAT fy) {
+ const CFX_PointF& point) {
if (!(hWidget->GetStatus() & XFA_WidgetStatus_Visible))
return FWL_WidgetHit::Unknown;
-
- CFX_PointF pos = hWidget->Rotate2Normal(CFX_PointF(fx, fy));
- return hWidget->OnHitTest(pos.x, pos.y);
+ return hWidget->OnHitTest(hWidget->Rotate2Normal(point));
}
bool CXFA_FFWidgetHandler::OnSetCursor(CXFA_FFWidget* hWidget,
- FX_FLOAT fx,
- FX_FLOAT fy) {
- CFX_PointF pos = hWidget->Rotate2Normal(CFX_PointF(fx, fy));
- return hWidget->OnSetCursor(pos.x, pos.y);
+ const CFX_PointF& point) {
+ return hWidget->OnSetCursor(hWidget->Rotate2Normal(point));
}
void CXFA_FFWidgetHandler::RenderWidget(CXFA_FFWidget* hWidget,