diff options
author | Lei Zhang <thestig@chromium.org> | 2018-04-12 17:24:45 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-04-12 17:24:45 +0000 |
commit | 822886b0c4478eb339fc5e2ec89f3fbdd78d57be (patch) | |
tree | b51a1b4748fd8503beb05b4a22dd2d9d4740908a /public | |
parent | 56cc5c12a7f569f218c44a6186cdc3676ea0793b (diff) | |
download | pdfium-822886b0c4478eb339fc5e2ec89f3fbdd78d57be.tar.xz |
Add return value to FPDF_DeviceToPage().
Do the same for FPDF_PageToDevice(). Clean up the internal
implementation as well.
Change-Id: Ia207bfa779d144cb9f0310e768750ab10e603b8f
Reviewed-on: https://pdfium-review.googlesource.com/17370
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'public')
-rw-r--r-- | public/fpdfview.h | 46 |
1 files changed, 24 insertions, 22 deletions
diff --git a/public/fpdfview.h b/public/fpdfview.h index 62b7b88410..2c93e962f3 100644 --- a/public/fpdfview.h +++ b/public/fpdfview.h @@ -736,7 +736,8 @@ FPDF_EXPORT void FPDF_CALLCONV FPDF_CloseDocument(FPDF_DOCUMENT document); // page_y - A pointer to a double receiving the converted Y // value in page coordinates. // Return value: -// None. +// Returns true if the conversion succeeds, and |page_x| and |page_y| +// successfully receives the converted coordinates. // Comments: // The page coordinate system has its origin at the left-bottom corner // of the page, with the X-axis on the bottom going to the right, and @@ -754,16 +755,16 @@ FPDF_EXPORT void FPDF_CALLCONV FPDF_CloseDocument(FPDF_DOCUMENT document); // You must make sure the start_x, start_y, size_x, size_y // and rotate parameters have exactly same values as you used in // the FPDF_RenderPage() function call. -FPDF_EXPORT void FPDF_CALLCONV FPDF_DeviceToPage(FPDF_PAGE page, - int start_x, - int start_y, - int size_x, - int size_y, - int rotate, - int device_x, - int device_y, - double* page_x, - double* page_y); +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDF_DeviceToPage(FPDF_PAGE page, + int start_x, + int start_y, + int size_x, + int size_y, + int rotate, + int device_x, + int device_y, + double* page_x, + double* page_y); // Function: FPDF_PageToDevice // Convert the page coordinates of a point to screen coordinates. @@ -787,19 +788,20 @@ FPDF_EXPORT void FPDF_CALLCONV FPDF_DeviceToPage(FPDF_PAGE page, // device_y - A pointer to an integer receiving the result Y // value in device coordinates. // Return value: -// None. +// Returns true if the conversion succeeds, and |device_x| and +// |device_y| successfully receives the converted coordinates. // Comments: // See comments for FPDF_DeviceToPage(). -FPDF_EXPORT void FPDF_CALLCONV FPDF_PageToDevice(FPDF_PAGE page, - int start_x, - int start_y, - int size_x, - int size_y, - int rotate, - double page_x, - double page_y, - int* device_x, - int* device_y); +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDF_PageToDevice(FPDF_PAGE page, + int start_x, + int start_y, + int size_x, + int size_y, + int rotate, + double page_x, + double page_y, + int* device_x, + int* device_y); // Function: FPDFBitmap_Create // Create a device independent bitmap (FXDIB). |