OLD | NEW |
1 /* Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 /* Copyright (c) 2006-2009 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 | 5 |
6 #ifndef _NP_EXTENSIONS_H_ | 6 #ifndef _NP_EXTENSIONS_H_ |
7 #define _NP_EXTENSIONS_H_ | 7 #define _NP_EXTENSIONS_H_ |
8 | 8 |
9 // Use the shorter include path here so that this file can be used in non- | 9 // Use the shorter include path here so that this file can be used in non- |
10 // Chromium projects, such as the Native Client SDK. | 10 // Chromium projects, such as the Native Client SDK. |
(...skipping 941 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
952 | 952 |
953 struct _NPDeviceContextAudio { | 953 struct _NPDeviceContextAudio { |
954 NPDeviceContextAudioConfig config; | 954 NPDeviceContextAudioConfig config; |
955 void *outBuffer; | 955 void *outBuffer; |
956 void *inBuffer; | 956 void *inBuffer; |
957 void *reserved; | 957 void *reserved; |
958 }; | 958 }; |
959 | 959 |
960 /* Printing related APIs ---------------------------------------------------*/ | 960 /* Printing related APIs ---------------------------------------------------*/ |
961 | 961 |
| 962 /* Defines a contiguous range of pages to be printed. Page numbers use a |
| 963 * zero-based index. */ |
| 964 typedef struct _NPPrintPageNumberRange { |
| 965 int32_t firstPageNumber; |
| 966 int32_t lastPageNumber; |
| 967 } NPPrintPageNumberRange; |
| 968 |
962 /* Being a print operation. Returns the total number of pages to print at the | 969 /* Being a print operation. Returns the total number of pages to print at the |
963 * given printableArea size and DPI. printableArea is in points (a point is 1/72 | 970 * given printableArea size and DPI. printableArea is in points (a point is 1/72 |
964 * of an inch). The plugin is expected to remember the values of printableArea | 971 * of an inch). The plugin is expected to remember the values of printableArea |
965 * and printerDPI for use in subsequent print interface calls. These values | 972 * and printerDPI for use in subsequent print interface calls. These values |
966 * should be cleared in printEnd. */ | 973 * should be cleared in printEnd. */ |
967 typedef NPError (*NPPPrintBeginPtr) ( | 974 typedef NPError (*NPPPrintBeginPtr) ( |
968 NPP instance, | 975 NPP instance, |
969 NPRect* printableArea, | 976 NPRect* printableArea, |
970 int32_t printerDPI, | 977 int32_t printerDPI, |
971 int32_t* numPages); | 978 int32_t* numPages); |
972 /* Returns the required raster dimensions for the given page. */ | 979 /* Returns the required raster dimensions for the given page. */ |
973 typedef NPError (*NPPGetRasterDimensionsPtr) ( | 980 typedef NPError (*NPPGetRasterDimensionsPtr) ( |
974 NPP instance, | 981 NPP instance, |
975 int32_t pageNumber, | 982 int32_t pageNumber, |
976 int32_t* widthInPixels, | 983 int32_t* widthInPixels, |
977 int32_t* heightInPixels); | 984 int32_t* heightInPixels); |
978 /* Prints the specified page This allows the plugin to print a raster output. */ | 985 /* Prints the specified page This allows the plugin to print a raster output. */ |
979 typedef NPError (*NPPPrintPageRasterPtr) ( | 986 typedef NPError (*NPPPrintPageRasterPtr) ( |
980 NPP instance, | 987 NPP instance, |
981 int32_t pageNumber, | 988 int32_t pageNumber, |
982 NPDeviceContext2D* printSurface); | 989 NPDeviceContext2D* printSurface); |
983 /* Ends the print operation */ | 990 /* Ends the print operation */ |
984 typedef NPError (*NPPPrintEndPtr) (NPP instance); | 991 typedef NPError (*NPPPrintEndPtr) (NPP instance); |
985 /* Prints the specified page as PDF. The plugin allocates the output buffer | 992 /* Prints the specified pages as PDF. The plugin allocates the output buffer |
986 * pointed to by pdf_output using the browser-supplied NPN_MemAlloc function. | 993 * pointed to by pdf_output using the browser-supplied NPN_MemAlloc function. |
987 * The caller is expected to free the output buffer upon success.*/ | 994 * The caller is expected to free the output buffer upon success.*/ |
988 typedef NPError (*NPPrintPageAsPDFPtr)(NPP instance, int32_t page_number, | 995 typedef NPError (*NPPrintPagesAsPDFPtr)(NPP instance, |
989 unsigned char** pdf_output, | 996 NPPrintPageNumberRange* page_ranges, |
990 int32_t* output_size); | 997 int32_t page_range_count, |
| 998 unsigned char** pdf_output, |
| 999 int32_t* output_size); |
991 | 1000 |
992 | 1001 |
993 /* TODO(sanjeevr) : Provide a vector interface for printing. We need to decide | 1002 /* TODO(sanjeevr) : Provide a vector interface for printing. We need to decide |
994 * on a vector format that can support embedded fonts. A vector format will | 1003 * on a vector format that can support embedded fonts. A vector format will |
995 * greatly reduce the size of the required output buffer. */ | 1004 * greatly reduce the size of the required output buffer. */ |
996 | 1005 |
997 typedef struct _NPPPrintExtensions { | 1006 typedef struct _NPPPrintExtensions { |
998 NPPPrintBeginPtr printBegin; | 1007 NPPPrintBeginPtr printBegin; |
999 NPPGetRasterDimensionsPtr getRasterDimensions; | 1008 NPPGetRasterDimensionsPtr getRasterDimensions; |
1000 NPPPrintPageRasterPtr printPageRaster; | 1009 NPPPrintPageRasterPtr printPageRaster; |
1001 NPPPrintEndPtr printEnd; | 1010 NPPPrintEndPtr printEnd; |
1002 NPPrintPageAsPDFPtr printPageAsPDF; | 1011 NPPrintPagesAsPDFPtr printPagesAsPDF; |
1003 } NPPPrintExtensions; | 1012 } NPPPrintExtensions; |
1004 | 1013 |
1005 /* Returns NULL if the plugin does not support print extensions */ | 1014 /* Returns NULL if the plugin does not support print extensions */ |
1006 typedef NPPPrintExtensions* (*NPPGetPrintExtensionsPtr)(NPP instance); | 1015 typedef NPPPrintExtensions* (*NPPGetPrintExtensionsPtr)(NPP instance); |
1007 | 1016 |
1008 /* Find ---------------------------------------------------------------------*/ | 1017 /* Find ---------------------------------------------------------------------*/ |
1009 | 1018 |
1010 /* Finds the given UTF-8 text starting at the current selection. The number of | 1019 /* Finds the given UTF-8 text starting at the current selection. The number of |
1011 * results will be updated asynchronously via numberOfFindResultsChanged. Note | 1020 * results will be updated asynchronously via numberOfFindResultsChanged. Note |
1012 * that multiple StartFind calls can happen before StopFind is called in the | 1021 * that multiple StartFind calls can happen before StopFind is called in the |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1051 | 1060 |
1052 typedef struct _NPPExtensions { | 1061 typedef struct _NPPExtensions { |
1053 NPPGetPrintExtensionsPtr getPrintExtensions; | 1062 NPPGetPrintExtensionsPtr getPrintExtensions; |
1054 NPPGetFindExtensionsPtr getFindExtensions; | 1063 NPPGetFindExtensionsPtr getFindExtensions; |
1055 NPPZoomPtr zoom; | 1064 NPPZoomPtr zoom; |
1056 NPPWidgetPropertyChangedPtr widgetPropertyChanged; | 1065 NPPWidgetPropertyChangedPtr widgetPropertyChanged; |
1057 NPPCopyPtr copy; | 1066 NPPCopyPtr copy; |
1058 } NPPExtensions; | 1067 } NPPExtensions; |
1059 | 1068 |
1060 #endif /* _NP_EXTENSIONS_H_ */ | 1069 #endif /* _NP_EXTENSIONS_H_ */ |
OLD | NEW |