summaryrefslogtreecommitdiff
path: root/fpdfsdk/cpdfsdk_pageview.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 /fpdfsdk/cpdfsdk_pageview.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 'fpdfsdk/cpdfsdk_pageview.cpp')
-rw-r--r--fpdfsdk/cpdfsdk_pageview.cpp23
1 files changed, 10 insertions, 13 deletions
diff --git a/fpdfsdk/cpdfsdk_pageview.cpp b/fpdfsdk/cpdfsdk_pageview.cpp
index 0136077df5..1f041dfb25 100644
--- a/fpdfsdk/cpdfsdk_pageview.cpp
+++ b/fpdfsdk/cpdfsdk_pageview.cpp
@@ -130,22 +130,20 @@ void CPDFSDK_PageView::PageView_OnDraw(CFX_RenderDevice* pDevice,
}
}
-CPDFSDK_Annot* CPDFSDK_PageView::GetFXAnnotAtPoint(FX_FLOAT pageX,
- FX_FLOAT pageY) {
+CPDFSDK_Annot* CPDFSDK_PageView::GetFXAnnotAtPoint(const CFX_PointF& point) {
CPDFSDK_AnnotHandlerMgr* pAnnotMgr = m_pFormFillEnv->GetAnnotHandlerMgr();
CPDFSDK_AnnotIteration annotIteration(this, false);
for (const auto& pSDKAnnot : annotIteration) {
CFX_FloatRect rc = pAnnotMgr->Annot_OnGetViewBBox(this, pSDKAnnot.Get());
if (pSDKAnnot->GetAnnotSubtype() == CPDF_Annot::Subtype::POPUP)
continue;
- if (rc.Contains(pageX, pageY))
+ if (rc.Contains(point))
return pSDKAnnot.Get();
}
return nullptr;
}
-CPDFSDK_Annot* CPDFSDK_PageView::GetFXWidgetAtPoint(FX_FLOAT pageX,
- FX_FLOAT pageY) {
+CPDFSDK_Annot* CPDFSDK_PageView::GetFXWidgetAtPoint(const CFX_PointF& point) {
CPDFSDK_AnnotHandlerMgr* pAnnotMgr = m_pFormFillEnv->GetAnnotHandlerMgr();
CPDFSDK_AnnotIteration annotIteration(this, false);
for (const auto& pSDKAnnot : annotIteration) {
@@ -156,8 +154,7 @@ CPDFSDK_Annot* CPDFSDK_PageView::GetFXWidgetAtPoint(FX_FLOAT pageX,
#endif // PDF_ENABLE_XFA
if (bHitTest) {
pAnnotMgr->Annot_OnGetViewBBox(this, pSDKAnnot.Get());
- if (pAnnotMgr->Annot_OnHitTest(this, pSDKAnnot.Get(),
- CFX_PointF(pageX, pageY)))
+ if (pAnnotMgr->Annot_OnHitTest(this, pSDKAnnot.Get(), point))
return pSDKAnnot.Get();
}
}
@@ -247,7 +244,7 @@ CPDFSDK_Annot* CPDFSDK_PageView::GetAnnotByXFAWidget(CXFA_FFWidget* hWidget) {
#endif // PDF_ENABLE_XFA
bool CPDFSDK_PageView::OnLButtonDown(const CFX_PointF& point, uint32_t nFlag) {
- CPDFSDK_Annot::ObservedPtr pAnnot(GetFXWidgetAtPoint(point.x, point.y));
+ CPDFSDK_Annot::ObservedPtr pAnnot(GetFXWidgetAtPoint(point));
if (!pAnnot) {
m_pFormFillEnv->KillFocusAnnot(nFlag);
return false;
@@ -267,7 +264,7 @@ bool CPDFSDK_PageView::OnLButtonDown(const CFX_PointF& point, uint32_t nFlag) {
#ifdef PDF_ENABLE_XFA
bool CPDFSDK_PageView::OnRButtonDown(const CFX_PointF& point, uint32_t nFlag) {
- CPDFSDK_Annot::ObservedPtr pAnnot(GetFXWidgetAtPoint(point.x, point.y));
+ CPDFSDK_Annot::ObservedPtr pAnnot(GetFXWidgetAtPoint(point));
if (!pAnnot)
return false;
@@ -286,7 +283,7 @@ bool CPDFSDK_PageView::OnRButtonDown(const CFX_PointF& point, uint32_t nFlag) {
bool CPDFSDK_PageView::OnRButtonUp(const CFX_PointF& point, uint32_t nFlag) {
CPDFSDK_AnnotHandlerMgr* pAnnotHandlerMgr =
m_pFormFillEnv->GetAnnotHandlerMgr();
- CPDFSDK_Annot::ObservedPtr pFXAnnot(GetFXWidgetAtPoint(point.x, point.y));
+ CPDFSDK_Annot::ObservedPtr pFXAnnot(GetFXWidgetAtPoint(point));
if (!pFXAnnot)
return false;
@@ -300,7 +297,7 @@ bool CPDFSDK_PageView::OnRButtonUp(const CFX_PointF& point, uint32_t nFlag) {
bool CPDFSDK_PageView::OnLButtonUp(const CFX_PointF& point, uint32_t nFlag) {
CPDFSDK_AnnotHandlerMgr* pAnnotHandlerMgr =
m_pFormFillEnv->GetAnnotHandlerMgr();
- CPDFSDK_Annot::ObservedPtr pFXAnnot(GetFXWidgetAtPoint(point.x, point.y));
+ CPDFSDK_Annot::ObservedPtr pFXAnnot(GetFXWidgetAtPoint(point));
CPDFSDK_Annot::ObservedPtr pFocusAnnot(GetFocusAnnot());
if (pFocusAnnot && pFocusAnnot != pFXAnnot) {
// Last focus Annot gets a chance to handle the event.
@@ -314,7 +311,7 @@ bool CPDFSDK_PageView::OnLButtonUp(const CFX_PointF& point, uint32_t nFlag) {
bool CPDFSDK_PageView::OnMouseMove(const CFX_PointF& point, int nFlag) {
CPDFSDK_AnnotHandlerMgr* pAnnotHandlerMgr =
m_pFormFillEnv->GetAnnotHandlerMgr();
- CPDFSDK_Annot::ObservedPtr pFXAnnot(GetFXAnnotAtPoint(point.x, point.y));
+ CPDFSDK_Annot::ObservedPtr pFXAnnot(GetFXAnnotAtPoint(point));
if (pFXAnnot) {
if (m_pCaptureWidget && m_pCaptureWidget != pFXAnnot) {
m_bExitWidget = true;
@@ -347,7 +344,7 @@ bool CPDFSDK_PageView::OnMouseWheel(double deltaX,
double deltaY,
const CFX_PointF& point,
int nFlag) {
- CPDFSDK_Annot::ObservedPtr pAnnot(GetFXWidgetAtPoint(point.x, point.y));
+ CPDFSDK_Annot::ObservedPtr pAnnot(GetFXWidgetAtPoint(point));
if (!pAnnot)
return false;