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

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: Reduce indentation even more, fix typo. 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
« no previous file with comments | « 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 // Function: FPDF_LoadDocument
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 // Parameters:
163 * @param[in] password - A string used as the password for PDF file. 152 // file_path [in] - Path to the PDF file (including extension).
164 * If no password needed, empty or NULL can be used. 153 // password [in] - A string used as the password for PDF file.
165 * @note Loaded document can be closed by FPDF_CloseDocument. 154 // If no password needed, empty or NULL can be used.
166 * If this function fails, you can use FPDF_GetLastError() to retrieve 155 // Return value:
167 * the reason why it fails. 156 // A handle to the loaded document, or NULL on failure.
168 * @retval A handle to the loaded document. If failed, NULL is returned. 157 // Comments:
169 */ 158 // Loaded document can be closed by FPDF_CloseDocument().
159 // If this function fails, you can use FPDF_GetLastError() to retrieve
160 // the reason why it failed.
170 DLLEXPORT FPDF_DOCUMENT STDCALL FPDF_LoadDocument(FPDF_STRING file_path, 161 DLLEXPORT FPDF_DOCUMENT STDCALL FPDF_LoadDocument(FPDF_STRING file_path,
171 FPDF_BYTESTRING password); 162 FPDF_BYTESTRING password);
172 163
173 // Function: FPDF_LoadMemDocument 164 // Function: FPDF_LoadMemDocument
174 // Open and load a PDF document from memory. 165 // Open and load a PDF document from memory.
175 // Parameters: 166 // Parameters:
176 // data_buf - Pointer to a buffer containing the PDF document. 167 // data_buf - Pointer to a buffer containing the PDF document.
177 // size - Number of bytes in the PDF document. 168 // size - Number of bytes in the PDF document.
178 // password - A string used as the password for PDF file. 169 // password - A string used as the password for PDF file.
179 // If no password needed, empty or NULL can be used. 170 // If no password needed, empty or NULL can be used.
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 // Parameters: 307 // Parameters:
317 // document - Handle to document. Returned by FPDF_LoadDocument fu nction. 308 // document - Handle to document. Returned by FPDF_LoadDocument fu nction.
318 // page_index - Page index, zero for the first page. 309 // page_index - Page index, zero for the first page.
319 // width - Pointer to a double value receiving the page width ( in points). 310 // 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). 311 // height - Pointer to a double value receiving the page height (in points).
321 // Return value: 312 // Return value:
322 // Non-zero for success. 0 for error (document or page not found). 313 // Non-zero for success. 0 for error (document or page not found).
323 // 314 //
324 DLLEXPORT int STDCALL FPDF_GetPageSizeByIndex(FPDF_DOCUMENT document, int page_i ndex, double* width, double* height); 315 DLLEXPORT int STDCALL FPDF_GetPageSizeByIndex(FPDF_DOCUMENT document, int page_i ndex, double* width, double* height);
325 316
326
327 // Page rendering flags. They can be combined with bit OR. 317 // Page rendering flags. They can be combined with bit OR.
328 #define FPDF_ANNOT 0x01 // Set if annotations are to be rendered . 318 #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. 319 #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 320 #define FPDF_NO_NATIVETEXT 0x04 // Don't use the native text output avai lable on some platforms
331 #define FPDF_GRAYSCALE 0x08 // Grayscale output. 321 #define FPDF_GRAYSCALE 0x08 // Grayscale output.
332 #define FPDF_DEBUG_INFO 0x80 // Set if you want to get some debug inf o. 322 #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. 323 // 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. 324 #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. 325 #define FPDF_RENDER_LIMITEDIMAGECACHE 0x200 // Limit image cache size.
336 #define FPDF_RENDER_FORCEHALFTONE 0x400 // Always use halftone for image stretching. 326 #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*. 627 // 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. 628 // If buflen is not sufficiently large, it will be set to -1 upon re turn.
639 // 629 //
640 DLLEXPORT FPDF_DEST STDCALL FPDF_GetNamedDest(FPDF_DOCUMENT document, int index, void* buffer, long* buflen); 630 DLLEXPORT FPDF_DEST STDCALL FPDF_GetNamedDest(FPDF_DOCUMENT document, int index, void* buffer, long* buflen);
641 631
642 #ifdef __cplusplus 632 #ifdef __cplusplus
643 } 633 }
644 #endif 634 #endif
645 635
646 #endif // PUBLIC_FPDFVIEW_H_ 636 #endif // PUBLIC_FPDFVIEW_H_
OLDNEW
« no previous file with comments | « public/fpdf_flatten.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698