Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(68)

Side by Side Diff: public/fpdfview.h

Issue 1139993003: Tidy public fpdfview.h and fpdf_flatten.h. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Rebase. Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« public/fpdf_flatten.h ('K') | « public/fpdf_flatten.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 // NOTE: External docs refer to this file as "fpdfview.h", so do not rename 7 // NOTE: External docs refer to this file as "fpdfview.h", so do not rename
8 // despite lack of consitency with other public files. 8 // despite lack of consitency with other public files.
9 9
10 #ifndef PUBLIC_FPDFVIEW_H_ 10 #ifndef PUBLIC_FPDFVIEW_H_
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 // however, special care needs to be taken if you expect to process Unicod e larger than 0xffff. 64 // however, special care needs to be taken if you expect to process Unicod e larger than 0xffff.
65 // For Linux/Unix programmers: most compiler/library environment uses 4 bytes fo r a Unicode character, 65 // For Linux/Unix programmers: most compiler/library environment uses 4 bytes fo r a Unicode character,
66 // you have to convert between FPDF_WIDESTRING and system wide string by yo urself. 66 // you have to convert between FPDF_WIDESTRING and system wide string by yo urself.
67 67
68 #ifdef _WIN32_WCE 68 #ifdef _WIN32_WCE
69 typedef const unsigned short* FPDF_STRING; 69 typedef const unsigned short* FPDF_STRING;
70 #else 70 #else
71 typedef const char* FPDF_STRING; 71 typedef const char* FPDF_STRING;
72 #endif 72 #endif
73 73
74 #ifndef _FS_DEF_MATRIX_
75 #define _FS_DEF_MATRIX_
76 /** @brief Matrix for transformation. */ 74 /** @brief Matrix for transformation. */
77 typedef struct _FS_MATRIX_ 75 typedef struct _FS_MATRIX_
78 { 76 {
79 float a; /**< @brief Coefficient a.*/ 77 float a; /**< @brief Coefficient a.*/
80 float b; /**< @brief Coefficient b.*/ 78 float b; /**< @brief Coefficient b.*/
81 float c; /**< @brief Coefficient c.*/ 79 float c; /**< @brief Coefficient c.*/
82 float d; /**< @brief Coefficient d.*/ 80 float d; /**< @brief Coefficient d.*/
83 float e; /**< @brief Coefficient e.*/ 81 float e; /**< @brief Coefficient e.*/
84 float f; /**< @brief Coefficient f.*/ 82 float f; /**< @brief Coefficient f.*/
85 } FS_MATRIX; 83 } FS_MATRIX;
86 #endif
87 84
88 #ifndef _FS_DEF_RECTF_
89 #define _FS_DEF_RECTF_
90 /** @brief Rectangle area(float) in device or page coordination system. */ 85 /** @brief Rectangle area(float) in device or page coordination system. */
91 typedef struct _FS_RECTF_ 86 typedef struct _FS_RECTF_
92 { 87 {
93 /**@{*/ 88 /**@{*/
94 /** @brief The x-coordinate of the left-top corner. */ 89 /** @brief The x-coordinate of the left-top corner. */
95 float left; 90 float left;
96 /** @brief The y-coordinate of the left-top corner. */ 91 /** @brief The y-coordinate of the left-top corner. */
97 float top; 92 float top;
98 /** @brief The x-coordinate of the right-bottom corner. */ 93 /** @brief The x-coordinate of the right-bottom corner. */
99 float right; 94 float right;
100 /** @brief The y-coordinate of the right-bottom corner. */ 95 /** @brief The y-coordinate of the right-bottom corner. */
101 float bottom; 96 float bottom;
102 /**@}*/ 97 /**@}*/
103 }* FS_LPRECTF, FS_RECTF; 98 }* FS_LPRECTF, FS_RECTF;
104 /** @brief Const Pointer to ::FS_RECTF structure.*/ 99 /** @brief Const Pointer to ::FS_RECTF structure.*/
105 typedef const FS_RECTF* FS_LPCRECTF; 100 typedef const FS_RECTF* FS_LPCRECTF;
106 #endif
107 101
108 #if defined(_WIN32) && defined(FPDFSDK_EXPORTS) 102 #if defined(_WIN32) && defined(FPDFSDK_EXPORTS)
109 // On Windows system, functions are exported in a DLL 103 // On Windows system, functions are exported in a DLL
110 #define DLLEXPORT __declspec( dllexport ) 104 #define DLLEXPORT __declspec( dllexport )
111 #define STDCALL __stdcall 105 #define STDCALL __stdcall
112 #else 106 #else
113 #define DLLEXPORT 107 #define DLLEXPORT
114 #define STDCALL 108 #define STDCALL
115 #endif 109 #endif
116 110
117 extern const char g_ExpireDate[];
118 extern const char g_ModuleCodes[];
119
120 // Exported Functions 111 // Exported Functions
121 #ifdef __cplusplus 112 #ifdef __cplusplus
122 extern "C" { 113 extern "C" {
123 #endif 114 #endif
124 115
125 // Function: FPDF_InitLibrary 116 // Function: FPDF_InitLibrary
126 // Initialize the FPDFSDK library 117 // Initialize the FPDFSDK library
127 // Parameters: 118 // Parameters:
128 // None 119 // None
129 // Return value: 120 // Return value:
130 // None. 121 // None.
131 // Comments: 122 // Comments:
132 // You have to call this function before you can call any PDF processin g functions. 123 // You have to call this function before you can call any PDF processin g functions.
133
134 DLLEXPORT void STDCALL FPDF_InitLibrary(); 124 DLLEXPORT void STDCALL FPDF_InitLibrary();
135 125
136
137 // Function: FPDF_DestroyLibary 126 // Function: FPDF_DestroyLibary
138 // Release all resources allocated by the FPDFSDK library. 127 // Release all resources allocated by the FPDFSDK library.
139 // Parameters: 128 // Parameters:
140 // None. 129 // None.
141 // Return value: 130 // Return value:
142 // None. 131 // None.
143 // Comments: 132 // Comments:
144 // You can call this function to release all memory blocks allocated by the library. 133 // You can call this function to release all memory blocks allocated by the library.
145 // After this function called, you should not call any PDF processing f unctions. 134 // After this function called, you should not call any PDF processing f unctions.
146 DLLEXPORT void STDCALL FPDF_DestroyLibrary(); 135 DLLEXPORT void STDCALL FPDF_DestroyLibrary();
147 136
148 //Policy for accessing the local machine time. 137 //Policy for accessing the local machine time.
149 #define FPDF_POLICY_MACHINETIME_ACCESS 0 138 #define FPDF_POLICY_MACHINETIME_ACCESS 0
150 139
151 // Function: FPDF_SetSandBoxPolicy 140 // Function: FPDF_SetSandBoxPolicy
152 // Set the policy for the sandbox environment. 141 // Set the policy for the sandbox environment.
153 // Parameters: 142 // Parameters:
154 // policy - The specified policy for setting, for example:FPDF_P OLICY_MACHINETIME_ACCESS. 143 // policy - The specified policy for setting, for example:FPDF_P OLICY_MACHINETIME_ACCESS.
155 // enable - True for enable, False for disable the policy. 144 // enable - True for enable, False for disable the policy.
156 // Return value: 145 // Return value:
157 // None. 146 // None.
158 DLLEXPORT void STDCALL FPDF_SetSandBoxPolicy(FPDF_DWORD policy, FPDF_BOOL enabl e); 147 DLLEXPORT void STDCALL FPDF_SetSandBoxPolicy(FPDF_DWORD policy, FPDF_BOOL enabl e);
159 148
160 /** 149 //
Lei Zhang 2015/05/19 19:11:29 Just delete this line and the last empty comment l
Tom Sepez 2015/05/19 19:40:01 Done. Also change for consistency.
161 * Open and load a PDF document. 150 // Open and load a PDF document.
162 * @param[in] file_path - Path to the PDF file (including extension). 151 // @param[in] file_path - Path to the PDF file (including extension).
163 * @param[in] password - A string used as the password for PDF file. 152 // @param[in] password - A string used as the password for PDF file.
164 * If no password needed, empty or NULL can be used. 153 // If no password needed, empty or NULL can be used.
165 * @note Loaded document can be closed by FPDF_CloseDocument. 154 // @note Loaded document can be closed by FPDF_CloseDocument.
166 * If this function fails, you can use FPDF_GetLastError() to retrieve 155 // If this function fails, you can use FPDF_GetLastError() to retrieve
167 * the reason why it fails. 156 // the reason why it fails.
168 * @retval A handle to the loaded document. If failed, NULL is returned. 157 // @retval A handle to the loaded document. If failed, NULL is returned.
169 */ 158 //
170 DLLEXPORT FPDF_DOCUMENT STDCALL FPDF_LoadDocument(FPDF_STRING file_path, 159 DLLEXPORT FPDF_DOCUMENT STDCALL FPDF_LoadDocument(FPDF_STRING file_path,
171 FPDF_BYTESTRING password); 160 FPDF_BYTESTRING password);
172 161
173 // Function: FPDF_LoadMemDocument 162 // Function: FPDF_LoadMemDocument
174 // Open and load a PDF document from memory. 163 // Open and load a PDF document from memory.
175 // Parameters: 164 // Parameters:
176 // data_buf - Pointer to a buffer containing the PDF document. 165 // data_buf - Pointer to a buffer containing the PDF document.
177 // size - Number of bytes in the PDF document. 166 // size - Number of bytes in the PDF document.
178 // password - A string used as the password for PDF file. 167 // password - A string used as the password for PDF file.
179 // If no password needed, empty or NULL can be used. 168 // If no password needed, empty or NULL can be used.
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 // Parameters: 305 // Parameters:
317 // document - Handle to document. Returned by FPDF_LoadDocument fu nction. 306 // document - Handle to document. Returned by FPDF_LoadDocument fu nction.
318 // page_index - Page index, zero for the first page. 307 // page_index - Page index, zero for the first page.
319 // width - Pointer to a double value receiving the page width ( in points). 308 // width - Pointer to a double value receiving the page width ( in points).
320 // height - Pointer to a double value receiving the page height (in points). 309 // height - Pointer to a double value receiving the page height (in points).
321 // Return value: 310 // Return value:
322 // Non-zero for success. 0 for error (document or page not found). 311 // Non-zero for success. 0 for error (document or page not found).
323 // 312 //
324 DLLEXPORT int STDCALL FPDF_GetPageSizeByIndex(FPDF_DOCUMENT document, int page_i ndex, double* width, double* height); 313 DLLEXPORT int STDCALL FPDF_GetPageSizeByIndex(FPDF_DOCUMENT document, int page_i ndex, double* width, double* height);
325 314
326
327 // Page rendering flags. They can be combined with bit OR. 315 // Page rendering flags. They can be combined with bit OR.
328 #define FPDF_ANNOT 0x01 // Set if annotations are to be rendered . 316 #define FPDF_ANNOT 0x01 // Set if annotations are to be rendered .
329 #define FPDF_LCD_TEXT 0x02 // Set if using text rendering optimized for LCD display. 317 #define FPDF_LCD_TEXT 0x02 // Set if using text rendering optimized for LCD display.
330 #define FPDF_NO_NATIVETEXT 0x04 // Don't use the native text output avai lable on some platforms 318 #define FPDF_NO_NATIVETEXT 0x04 // Don't use the native text output avai lable on some platforms
331 #define FPDF_GRAYSCALE 0x08 // Grayscale output. 319 #define FPDF_GRAYSCALE 0x08 // Grayscale output.
332 #define FPDF_DEBUG_INFO 0x80 // Set if you want to get some debug inf o. 320 #define FPDF_DEBUG_INFO 0x80 // Set if you want to get some debug inf o.
333 // Please discuss with Foxit first if yo u need to collect debug info. 321 // Please discuss with Foxit first if yo u need to collect debug info.
334 #define FPDF_NO_CATCH 0x100 // Set if you don't want to catch except ion. 322 #define FPDF_NO_CATCH 0x100 // Set if you don't want to catch except ion.
335 #define FPDF_RENDER_LIMITEDIMAGECACHE 0x200 // Limit image cache size. 323 #define FPDF_RENDER_LIMITEDIMAGECACHE 0x200 // Limit image cache size.
336 #define FPDF_RENDER_FORCEHALFTONE 0x400 // Always use halftone for image stretching. 324 #define FPDF_RENDER_FORCEHALFTONE 0x400 // Always use halftone for image stretching.
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
637 // 2) Second time pass in allocated |buffer| and buflen to retrieve |bu ffer|, which should be used as wchar_t*. 625 // 2) Second time pass in allocated |buffer| and buflen to retrieve |bu ffer|, which should be used as wchar_t*.
638 // If buflen is not sufficiently large, it will be set to -1 upon re turn. 626 // If buflen is not sufficiently large, it will be set to -1 upon re turn.
639 // 627 //
640 DLLEXPORT FPDF_DEST STDCALL FPDF_GetNamedDest(FPDF_DOCUMENT document, int index, void* buffer, long* buflen); 628 DLLEXPORT FPDF_DEST STDCALL FPDF_GetNamedDest(FPDF_DOCUMENT document, int index, void* buffer, long* buflen);
641 629
642 #ifdef __cplusplus 630 #ifdef __cplusplus
643 } 631 }
644 #endif 632 #endif
645 633
646 #endif // PUBLIC_FPDFVIEW_H_ 634 #endif // PUBLIC_FPDFVIEW_H_
OLDNEW
« public/fpdf_flatten.h ('K') | « public/fpdf_flatten.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698