| 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 "public/fpdf_formfill.h" | 7 #include "public/fpdf_formfill.h" |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 | 180 |
| 181 DLLEXPORT FPDF_BOOL STDCALL FORM_OnMouseMove(FPDF_FORMHANDLE hHandle, | 181 DLLEXPORT FPDF_BOOL STDCALL FORM_OnMouseMove(FPDF_FORMHANDLE hHandle, |
| 182 FPDF_PAGE page, | 182 FPDF_PAGE page, |
| 183 int modifier, | 183 int modifier, |
| 184 double page_x, | 184 double page_x, |
| 185 double page_y) { | 185 double page_y) { |
| 186 CPDFSDK_PageView* pPageView = FormHandleToPageView(hHandle, page); | 186 CPDFSDK_PageView* pPageView = FormHandleToPageView(hHandle, page); |
| 187 if (!pPageView) | 187 if (!pPageView) |
| 188 return FALSE; | 188 return FALSE; |
| 189 | 189 |
| 190 CFX_FloatPoint pt((FX_FLOAT)page_x, (FX_FLOAT)page_y); | 190 CPDF_Point pt((FX_FLOAT)page_x, (FX_FLOAT)page_y); |
| 191 return pPageView->OnMouseMove(pt, modifier); | 191 return pPageView->OnMouseMove(pt, modifier); |
| 192 } | 192 } |
| 193 | 193 |
| 194 DLLEXPORT FPDF_BOOL STDCALL FORM_OnLButtonDown(FPDF_FORMHANDLE hHandle, | 194 DLLEXPORT FPDF_BOOL STDCALL FORM_OnLButtonDown(FPDF_FORMHANDLE hHandle, |
| 195 FPDF_PAGE page, | 195 FPDF_PAGE page, |
| 196 int modifier, | 196 int modifier, |
| 197 double page_x, | 197 double page_x, |
| 198 double page_y) { | 198 double page_y) { |
| 199 CPDFSDK_PageView* pPageView = FormHandleToPageView(hHandle, page); | 199 CPDFSDK_PageView* pPageView = FormHandleToPageView(hHandle, page); |
| 200 if (!pPageView) | 200 if (!pPageView) |
| 201 return FALSE; | 201 return FALSE; |
| 202 | 202 |
| 203 CFX_FloatPoint pt((FX_FLOAT)page_x, (FX_FLOAT)page_y); | 203 CPDF_Point pt((FX_FLOAT)page_x, (FX_FLOAT)page_y); |
| 204 return pPageView->OnLButtonDown(pt, modifier); | 204 return pPageView->OnLButtonDown(pt, modifier); |
| 205 } | 205 } |
| 206 | 206 |
| 207 DLLEXPORT FPDF_BOOL STDCALL FORM_OnLButtonUp(FPDF_FORMHANDLE hHandle, | 207 DLLEXPORT FPDF_BOOL STDCALL FORM_OnLButtonUp(FPDF_FORMHANDLE hHandle, |
| 208 FPDF_PAGE page, | 208 FPDF_PAGE page, |
| 209 int modifier, | 209 int modifier, |
| 210 double page_x, | 210 double page_x, |
| 211 double page_y) { | 211 double page_y) { |
| 212 CPDFSDK_PageView* pPageView = FormHandleToPageView(hHandle, page); | 212 CPDFSDK_PageView* pPageView = FormHandleToPageView(hHandle, page); |
| 213 if (!pPageView) | 213 if (!pPageView) |
| 214 return FALSE; | 214 return FALSE; |
| 215 | 215 |
| 216 CFX_FloatPoint pt((FX_FLOAT)page_x, (FX_FLOAT)page_y); | 216 CPDF_Point pt((FX_FLOAT)page_x, (FX_FLOAT)page_y); |
| 217 return pPageView->OnLButtonUp(pt, modifier); | 217 return pPageView->OnLButtonUp(pt, modifier); |
| 218 } | 218 } |
| 219 | 219 |
| 220 #ifdef PDF_ENABLE_XFA | 220 #ifdef PDF_ENABLE_XFA |
| 221 DLLEXPORT FPDF_BOOL STDCALL FORM_OnRButtonDown(FPDF_FORMHANDLE hHandle, | 221 DLLEXPORT FPDF_BOOL STDCALL FORM_OnRButtonDown(FPDF_FORMHANDLE hHandle, |
| 222 FPDF_PAGE page, | 222 FPDF_PAGE page, |
| 223 int modifier, | 223 int modifier, |
| 224 double page_x, | 224 double page_x, |
| 225 double page_y) { | 225 double page_y) { |
| 226 CPDFSDK_PageView* pPageView = FormHandleToPageView(hHandle, page); | 226 CPDFSDK_PageView* pPageView = FormHandleToPageView(hHandle, page); |
| 227 if (!pPageView) | 227 if (!pPageView) |
| 228 return FALSE; | 228 return FALSE; |
| 229 | 229 |
| 230 CFX_FloatPoint pt((FX_FLOAT)page_x, (FX_FLOAT)page_y); | 230 CPDF_Point pt((FX_FLOAT)page_x, (FX_FLOAT)page_y); |
| 231 return pPageView->OnRButtonDown(pt, modifier); | 231 return pPageView->OnRButtonDown(pt, modifier); |
| 232 } | 232 } |
| 233 | 233 |
| 234 DLLEXPORT FPDF_BOOL STDCALL FORM_OnRButtonUp(FPDF_FORMHANDLE hHandle, | 234 DLLEXPORT FPDF_BOOL STDCALL FORM_OnRButtonUp(FPDF_FORMHANDLE hHandle, |
| 235 FPDF_PAGE page, | 235 FPDF_PAGE page, |
| 236 int modifier, | 236 int modifier, |
| 237 double page_x, | 237 double page_x, |
| 238 double page_y) { | 238 double page_y) { |
| 239 CPDFSDK_PageView* pPageView = FormHandleToPageView(hHandle, page); | 239 CPDFSDK_PageView* pPageView = FormHandleToPageView(hHandle, page); |
| 240 if (!pPageView) | 240 if (!pPageView) |
| 241 return FALSE; | 241 return FALSE; |
| 242 | 242 |
| 243 CFX_FloatPoint pt((FX_FLOAT)page_x, (FX_FLOAT)page_y); | 243 CPDF_Point pt((FX_FLOAT)page_x, (FX_FLOAT)page_y); |
| 244 return pPageView->OnRButtonUp(pt, modifier); | 244 return pPageView->OnRButtonUp(pt, modifier); |
| 245 } | 245 } |
| 246 #endif // PDF_ENABLE_XFA | 246 #endif // PDF_ENABLE_XFA |
| 247 | 247 |
| 248 DLLEXPORT FPDF_BOOL STDCALL FORM_OnKeyDown(FPDF_FORMHANDLE hHandle, | 248 DLLEXPORT FPDF_BOOL STDCALL FORM_OnKeyDown(FPDF_FORMHANDLE hHandle, |
| 249 FPDF_PAGE page, | 249 FPDF_PAGE page, |
| 250 int nKeyCode, | 250 int nKeyCode, |
| 251 int modifier) { | 251 int modifier) { |
| 252 CPDFSDK_PageView* pPageView = FormHandleToPageView(hHandle, page); | 252 CPDFSDK_PageView* pPageView = FormHandleToPageView(hHandle, page); |
| 253 if (!pPageView) | 253 if (!pPageView) |
| (...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 726 pActionHandler->DoAction_Page(action, CPDF_AAction::OpenPage, pSDKDoc); | 726 pActionHandler->DoAction_Page(action, CPDF_AAction::OpenPage, pSDKDoc); |
| 727 } | 727 } |
| 728 } else { | 728 } else { |
| 729 if (aa.ActionExist(CPDF_AAction::ClosePage)) { | 729 if (aa.ActionExist(CPDF_AAction::ClosePage)) { |
| 730 CPDF_Action action = aa.GetAction(CPDF_AAction::ClosePage); | 730 CPDF_Action action = aa.GetAction(CPDF_AAction::ClosePage); |
| 731 pActionHandler->DoAction_Page(action, CPDF_AAction::ClosePage, pSDKDoc); | 731 pActionHandler->DoAction_Page(action, CPDF_AAction::ClosePage, pSDKDoc); |
| 732 } | 732 } |
| 733 } | 733 } |
| 734 } | 734 } |
| 735 } | 735 } |
| OLD | NEW |