OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium 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 #include <limits.h> | 5 #include <limits.h> |
6 #include <stdio.h> | 6 #include <stdio.h> |
7 #include <stdlib.h> | 7 #include <stdlib.h> |
8 #include <string.h> | 8 #include <string.h> |
9 | 9 |
10 #include <list> | 10 #include <list> |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 // If a PS_NULL pen is used, the dimensions of the rectangle are 1 pixel less. | 188 // If a PS_NULL pen is used, the dimensions of the rectangle are 1 pixel less. |
189 Rectangle(dc, 0, 0, width + 1, height + 1); | 189 Rectangle(dc, 0, 0, width + 1, height + 1); |
190 | 190 |
191 FPDF_RenderPage(dc, page, 0, 0, width, height, 0, | 191 FPDF_RenderPage(dc, page, 0, 0, width, height, 0, |
192 FPDF_ANNOT | FPDF_PRINTING | FPDF_NO_CATCH); | 192 FPDF_ANNOT | FPDF_PRINTING | FPDF_NO_CATCH); |
193 | 193 |
194 DeleteEnhMetaFile(CloseEnhMetaFile(dc)); | 194 DeleteEnhMetaFile(CloseEnhMetaFile(dc)); |
195 } | 195 } |
196 #endif | 196 #endif |
197 | 197 |
198 int ExampleAppAlert(IPDF_JSPLATFORM*, FPDF_WIDESTRING msg, FPDF_WIDESTRING, | 198 int ExampleAppAlert(IPDF_JSPLATFORM*, |
199 int, int) { | 199 FPDF_WIDESTRING msg, |
200 std::wstring platform_string = GetPlatformWString(msg); | 200 FPDF_WIDESTRING title, |
201 printf("Alert: %ls\n", platform_string.c_str()); | 201 int nType, |
| 202 int nIcon) { |
| 203 printf("%ls", GetPlatformWString(title).c_str()); |
| 204 if (nIcon || nType) |
| 205 printf("[icon=%d,type=%d]", nIcon, nType); |
| 206 printf(": %ls\n", GetPlatformWString(msg).c_str()); |
202 return 0; | 207 return 0; |
203 } | 208 } |
204 | 209 |
205 void ExampleDocGotoPage(IPDF_JSPLATFORM*, int pageNumber) { | 210 void ExampleDocGotoPage(IPDF_JSPLATFORM*, int pageNumber) { |
206 printf("Goto Page: %d\n", pageNumber); | 211 printf("Goto Page: %d\n", pageNumber); |
207 } | 212 } |
208 | 213 |
209 void ExampleUnsupportedHandler(UNSUPPORT_INFO*, int type) { | 214 void ExampleUnsupportedHandler(UNSUPPORT_INFO*, int type) { |
210 std::string feature = "Unknown"; | 215 std::string feature = "Unknown"; |
211 switch (type) { | 216 switch (type) { |
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
625 } | 630 } |
626 | 631 |
627 FPDF_DestroyLibrary(); | 632 FPDF_DestroyLibrary(); |
628 #ifdef PDF_ENABLE_V8 | 633 #ifdef PDF_ENABLE_V8 |
629 v8::V8::ShutdownPlatform(); | 634 v8::V8::ShutdownPlatform(); |
630 delete platform; | 635 delete platform; |
631 #endif // PDF_ENABLE_V8 | 636 #endif // PDF_ENABLE_V8 |
632 | 637 |
633 return 0; | 638 return 0; |
634 } | 639 } |
OLD | NEW |