summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--BUILD.gn4
-rw-r--r--fpdfsdk/fpdf_formfill.cpp16
-rw-r--r--pdfium.gni3
3 files changed, 23 insertions, 0 deletions
diff --git a/BUILD.gn b/BUILD.gn
index d88c1d621b..3422b81535 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -30,6 +30,10 @@ config("pdfium_common_config") {
defines += [ "PDF_ENABLE_V8" ]
}
+ if (pdf_enable_click_logging) {
+ defines += [ "PDF_ENABLE_CLICK_LOGGING" ]
+ }
+
if (pdf_enable_xfa) {
defines += [ "PDF_ENABLE_XFA" ]
if (pdf_enable_xfa_bmp) {
diff --git a/fpdfsdk/fpdf_formfill.cpp b/fpdfsdk/fpdf_formfill.cpp
index 62d2c00d55..de2bf4d35e 100644
--- a/fpdfsdk/fpdf_formfill.cpp
+++ b/fpdfsdk/fpdf_formfill.cpp
@@ -362,6 +362,10 @@ FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FORM_OnLButtonDown(FPDF_FORMHANDLE hHandle,
CPDFSDK_PageView* pPageView = FormHandleToPageView(hHandle, page);
if (!pPageView)
return false;
+#ifdef PDF_ENABLE_CLICK_LOGGING
+ fprintf(stderr, "mousedown,left,%d,%d\n", static_cast<int>(round(page_x)),
+ static_cast<int>(round(page_y)));
+#endif // PDF_ENABLE_CLICK_LOGGING
return pPageView->OnLButtonDown(CFX_PointF(page_x, page_y), modifier);
}
@@ -373,6 +377,10 @@ FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FORM_OnLButtonUp(FPDF_FORMHANDLE hHandle,
CPDFSDK_PageView* pPageView = FormHandleToPageView(hHandle, page);
if (!pPageView)
return false;
+#ifdef PDF_ENABLE_CLICK_LOGGING
+ fprintf(stderr, "mouseup,left,%d,%d\n", static_cast<int>(round(page_x)),
+ static_cast<int>(round(page_y)));
+#endif // PDF_ENABLE_CLICK_LOGGING
return pPageView->OnLButtonUp(CFX_PointF(page_x, page_y), modifier);
}
@@ -385,6 +393,10 @@ FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FORM_OnRButtonDown(FPDF_FORMHANDLE hHandle,
CPDFSDK_PageView* pPageView = FormHandleToPageView(hHandle, page);
if (!pPageView)
return false;
+#ifdef PDF_ENABLE_CLICK_LOGGING
+ fprintf(stderr, "mousedown,right,%d,%d\n", static_cast<int>(round(page_x)),
+ static_cast<int>(round(page_y)));
+#endif // PDF_ENABLE_CLICK_LOGGING
return pPageView->OnRButtonDown(CFX_PointF(page_x, page_y), modifier);
}
@@ -396,6 +408,10 @@ FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FORM_OnRButtonUp(FPDF_FORMHANDLE hHandle,
CPDFSDK_PageView* pPageView = FormHandleToPageView(hHandle, page);
if (!pPageView)
return false;
+#ifdef PDF_ENABLE_CLICK_LOGGING
+ fprintf(stderr, "mouseup,right,%d,%d\n", static_cast<int>(round(page_x)),
+ static_cast<int>(round(page_y)));
+#endif // PDF_ENABLE_CLICK_LOGGING
return pPageView->OnRButtonUp(CFX_PointF(page_x, page_y), modifier);
}
#endif // PDF_ENABLE_XFA
diff --git a/pdfium.gni b/pdfium.gni
index 237d7c7add..2b34cbc89d 100644
--- a/pdfium.gni
+++ b/pdfium.gni
@@ -15,6 +15,9 @@ declare_args() {
# //build/config/freetype.
pdf_bundle_freetype = pdf_bundle_freetype_override
+ # Generate logging messages for click events that reach PDFium
+ pdf_enable_click_logging = false
+
# Build PDFium either with or without v8 support.
pdf_enable_v8 = pdf_enable_v8_override