| 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 #ifndef _FPDF_PROGRESSIVE_H_ | 7 #ifndef PUBLIC_FPDF_PROGRESSIVE_H_ |
| 8 #define _FPDF_PROGRESSIVE_H_ | 8 #define PUBLIC_FPDF_PROGRESSIVE_H_ |
| 9 | 9 |
| 10 #include "fpdfview.h" | 10 #include "fpdfview.h" |
| 11 | 11 |
| 12 //Flags for progressive process status. | 12 //Flags for progressive process status. |
| 13 #define FPDF_RENDER_READER» » » 0 | 13 #define FPDF_RENDER_READER 0 |
| 14 #define FPDF_RENDER_TOBECOUNTINUED» 1 | 14 #define FPDF_RENDER_TOBECOUNTINUED 1 |
| 15 #define FPDF_RENDER_DONE» » » 2 | 15 #define FPDF_RENDER_DONE 2 |
| 16 #define FPDF_RENDER_FAILED» » » 3 | 16 #define FPDF_RENDER_FAILED 3 |
| 17 | 17 |
| 18 | 18 |
| 19 #ifdef __cplusplus | 19 #ifdef __cplusplus |
| 20 extern "C" { | 20 extern "C" { |
| 21 #endif | 21 #endif |
| 22 | 22 |
| 23 | 23 |
| 24 //IFPDF_RENDERINFO interface. | 24 //IFPDF_RENDERINFO interface. |
| 25 typedef struct _IFSDK_PAUSE | 25 typedef struct _IFSDK_PAUSE |
| 26 { | 26 { |
| 27 » /** | 27 /** |
| 28 » * Version number of the interface. Currently must be 1. | 28 * Version number of the interface. Currently must be 1. |
| 29 » **/ | 29 **/ |
| 30 » int version; | 30 int version; |
| 31 | 31 |
| 32 » /* | 32 /* |
| 33 » * Method: NeedToPauseNow | 33 * Method: NeedToPauseNow |
| 34 » *» » » Check if we need to pause a progressive process
now. | 34 * Check if we need to pause a progressive process now. |
| 35 » * Interface Version: | 35 * Interface Version: |
| 36 » *» » » 1 | 36 * 1 |
| 37 » * Implementation Required: | 37 * Implementation Required: |
| 38 » *» » » yes | 38 * yes |
| 39 » * Parameters: | 39 * Parameters: |
| 40 » *» » » pThis» » -» Pointer to the interface
structure itself | 40 * pThis - Pointer to the interface structure itself |
| 41 » * Return Value: | 41 * Return Value: |
| 42 » *» » » Non-zero for pause now, 0 for continue. | 42 * Non-zero for pause now, 0 for continue. |
| 43 » * | 43 * |
| 44 » */ | 44 */ |
| 45 » FPDF_BOOL (*NeedToPauseNow) (struct _IFSDK_PAUSE* pThis); | 45 FPDF_BOOL (*NeedToPauseNow) (struct _IFSDK_PAUSE* pThis); |
| 46 » | 46 |
| 47 » //A user defined data pointer, used by user's application. Can be NULL. | 47 //A user defined data pointer, used by user's application. Can be NULL. |
| 48 » void*» » user; | 48 void* user; |
| 49 } IFSDK_PAUSE; | 49 } IFSDK_PAUSE; |
| 50 | 50 |
| 51 // Function: FPDF_RenderPageBitmap_Start | 51 // Function: FPDF_RenderPageBitmap_Start |
| 52 //» » » Start to render page contents to a device independent bi
tmap progressively. | 52 // Start to render page contents to a device independent bitmap progres
sively. |
| 53 // Parameters: | 53 // Parameters: |
| 54 //» » » bitmap» » -» Handle to the device independent
bitmap (as the output buffer). | 54 // bitmap - Handle to the device independent bitmap (as the outp
ut buffer). |
| 55 //» » » » » » » Bitmap handle can be cre
ated by FPDFBitmap_Create function. | 55 // Bitmap handle can be created by FPDFBitmap_Create fu
nction. |
| 56 //» » » page» » -» Handle to the page. Returned by
FPDF_LoadPage function. | 56 // page - Handle to the page. Returned by FPDF_LoadPage functi
on. |
| 57 //» » » start_x»» -» Left pixel position of the displ
ay area in the bitmap coordinate. | 57 // start_x - Left pixel position of the display area in the bitma
p coordinate. |
| 58 //» » » start_y»» -» Top pixel position of the displa
y area in the bitmap coordinate. | 58 // start_y - Top pixel position of the display area in the bitmap
coordinate. |
| 59 //» » » size_x» » -» Horizontal size (in pixels) for
displaying the page. | 59 // size_x - Horizontal size (in pixels) for displaying the page. |
| 60 //» » » size_y» » -» Vertical size (in pixels) for di
splaying the page. | 60 // size_y - Vertical size (in pixels) for displaying the page. |
| 61 //» » » rotate» » -» Page orientation: 0 (normal), 1
(rotated 90 degrees clockwise), | 61 // rotate - Page orientation: 0 (normal), 1 (rotated 90 degrees
clockwise), |
| 62 //» » » » » » » » 2 (rotated 180 d
egrees), 3 (rotated 90 degrees counter-clockwise). | 62 // 2 (rotated 180 degrees), 3 (rotated 90 degrees c
ounter-clockwise). |
| 63 //» » » flags» » -» 0 for normal display, or combina
tion of flags defined above. | 63 // flags - 0 for normal display, or combination of flags define
d above. |
| 64 //» » » pause» » -» The IFSDK_PAUSE interface.A call
back mechanism allowing the page rendering process | 64 // pause - The IFSDK_PAUSE interface.A callback mechanism allow
ing the page rendering process |
| 65 // Return value: | 65 // Return value: |
| 66 //» » » Rendering Status. See flags for progressive process stat
us for the details. | 66 // Rendering Status. See flags for progressive process status for the d
etails. |
| 67 // | 67 // |
| 68 DLLEXPORT int STDCALL FPDF_RenderPageBitmap_Start(FPDF_BITMAP bitmap, FPDF_PAGE
page, int start_x, int start_y, int size_x, | 68 DLLEXPORT int STDCALL FPDF_RenderPageBitmap_Start(FPDF_BITMAP bitmap, FPDF_PAGE
page, int start_x, int start_y, int size_x, |
| 69 » » » » » » » » » »
» » int size_y, int rotate, int flags,IFSDK_PAUSE * pause); | 69 int size_y, int rotate, int f
lags,IFSDK_PAUSE * pause); |
| 70 | 70 |
| 71 // Function: FPDF_RenderPage_Continue | 71 // Function: FPDF_RenderPage_Continue |
| 72 //» » » Continue rendering a PDF page. | 72 // Continue rendering a PDF page. |
| 73 // Parameters: | 73 // Parameters: |
| 74 //» » » page» » -» Handle to the page. Returned by
FPDF_LoadPage function. | 74 // page - Handle to the page. Returned by FPDF_LoadPage functi
on. |
| 75 //» » » pause» » -» The IFSDK_PAUSE interface.A call
back mechanism allowing the page rendering process | 75 // pause - The IFSDK_PAUSE interface.A callback mechanism allow
ing the page rendering process |
| 76 //» » » » » » » to be paused before it's
finished. This can be NULL if you don't want to pause. | 76 // to be paused before it's finished. This can be NULL
if you don't want to pause. |
| 77 // Return value: | 77 // Return value: |
| 78 //» » » The rendering status. See flags for progressive process
status for the details. | 78 // The rendering status. See flags for progressive process status for t
he details. |
| 79 DLLEXPORT int STDCALL FPDF_RenderPage_Continue(FPDF_PAGE page,IFSDK_PAUSE * paus
e); | 79 DLLEXPORT int STDCALL FPDF_RenderPage_Continue(FPDF_PAGE page,IFSDK_PAUSE * paus
e); |
| 80 | 80 |
| 81 // Function: FPDF_RenderPage_Close | 81 // Function: FPDF_RenderPage_Close |
| 82 //» » » Release the resource allocate during page rendering. Nee
d to be called after finishing rendering or | 82 // Release the resource allocate during page rendering. Need to be call
ed after finishing rendering or |
| 83 //» » » cancel the rendering. | 83 // cancel the rendering. |
| 84 // Parameters: | 84 // Parameters: |
| 85 //» » » page» » -» Handle to the page. Returned by
FPDF_LoadPage function. | 85 // page - Handle to the page. Returned by FPDF_LoadPage functi
on. |
| 86 // Return value: | 86 // Return value: |
| 87 //» » » NULL | 87 // NULL |
| 88 DLLEXPORT void STDCALL FPDF_RenderPage_Close(FPDF_PAGE page); | 88 DLLEXPORT void STDCALL FPDF_RenderPage_Close(FPDF_PAGE page); |
| 89 | 89 |
| 90 #ifdef __cplusplus | 90 #ifdef __cplusplus |
| 91 } | 91 } |
| 92 #endif | 92 #endif |
| 93 | 93 |
| 94 #endif» //_FPDF_PROGRESSIVE_H_ | 94 #endif // PUBLIC_FPDF_PROGRESSIVE_H_ |
| OLD | NEW |