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 #ifndef PPAPI_C_DEV_PPP_PRINTING_DEV_H_ | 5 #ifndef PPAPI_C_DEV_PPP_PRINTING_DEV_H_ |
6 #define PPAPI_C_DEV_PPP_PRINTING_DEV_H_ | 6 #define PPAPI_C_DEV_PPP_PRINTING_DEV_H_ |
7 | 7 |
| 8 #include "ppapi/c/pp_bool.h" |
8 #include "ppapi/c/pp_instance.h" | 9 #include "ppapi/c/pp_instance.h" |
9 #include "ppapi/c/pp_rect.h" | 10 #include "ppapi/c/pp_rect.h" |
10 #include "ppapi/c/pp_resource.h" | 11 #include "ppapi/c/pp_resource.h" |
11 #include "ppapi/c/pp_stdint.h" | 12 #include "ppapi/c/pp_stdint.h" |
12 | 13 |
13 typedef enum { | 14 typedef enum { |
14 PP_PRINTORIENTATION_NORMAL = 0, | 15 PP_PRINTORIENTATION_NORMAL = 0, |
15 PP_PRINTORIENTATION_ROTATED_90_CW = 1, | 16 PP_PRINTORIENTATION_ROTATED_90_CW = 1, |
16 PP_PRINTORIENTATION_ROTATED_180 = 2, | 17 PP_PRINTORIENTATION_ROTATED_180 = 2, |
17 PP_PRINTORIENTATION_ROTATED_90_CCW = 3 | 18 PP_PRINTORIENTATION_ROTATED_90_CCW = 3 |
18 } PP_PrintOrientation_Dev; | 19 } PP_PrintOrientation_Dev; |
19 | 20 |
20 typedef enum { | 21 typedef enum { |
21 PP_PRINTOUTPUTFORMAT_RASTER = 0, | 22 PP_PRINTOUTPUTFORMAT_RASTER = 0, |
22 PP_PRINTOUTPUTFORMAT_PDF = 1, | 23 PP_PRINTOUTPUTFORMAT_PDF = 1, |
23 PP_PRINTOUTPUTFORMAT_POSTSCRIPT = 2 | 24 PP_PRINTOUTPUTFORMAT_POSTSCRIPT = 2 |
24 } PP_PrintOutputFormat_Dev; | 25 } PP_PrintOutputFormat_Dev; |
25 | 26 |
26 struct PP_PrintSettings_Dev { | 27 struct PP_PrintSettings_Dev { |
27 // This is the size of the printable area in points (1/72 of an inch) | 28 // This is the size of the printable area in points (1/72 of an inch) |
28 struct PP_Rect printable_area; | 29 struct PP_Rect printable_area; |
29 int32_t dpi; | 30 int32_t dpi; |
30 PP_PrintOrientation_Dev orientation; | 31 PP_PrintOrientation_Dev orientation; |
31 bool grayscale; | 32 PP_Bool grayscale; |
32 PP_PrintOutputFormat_Dev format; | 33 PP_PrintOutputFormat_Dev format; |
33 }; | 34 }; |
34 | 35 |
35 // Specifies a contiguous range of page numbers to be printed. | 36 // Specifies a contiguous range of page numbers to be printed. |
36 // The page numbers use a zero-based index. | 37 // The page numbers use a zero-based index. |
37 struct PP_PrintPageNumberRange_Dev { | 38 struct PP_PrintPageNumberRange_Dev { |
38 uint32_t first_page_number; | 39 uint32_t first_page_number; |
39 uint32_t last_page_number; | 40 uint32_t last_page_number; |
40 }; | 41 }; |
41 | 42 |
42 // Interface for the plugin to implement printing. | 43 // Interface for the plugin to implement printing. |
43 #define PPP_PRINTING_DEV_INTERFACE "PPP_Printing(Dev);0.1" | 44 #define PPP_PRINTING_DEV_INTERFACE "PPP_Printing(Dev);0.2" |
44 | 45 |
45 struct PPP_Printing_Dev { | 46 struct PPP_Printing_Dev { |
46 // Returns array of supported print output formats. The array is allocated | 47 // Returns array of supported print output formats. The array is allocated |
47 // using PPB_Core.MemAlloc. The caller is responsible for freeing the array | 48 // using PPB_Core.MemAlloc. The caller is responsible for freeing the array |
48 // using PPB_Core.MemFree. | 49 // using PPB_Core.MemFree. |
49 // Sets |*format_count| to 0 returns NULL if printing is not supported at all. | 50 // Sets |*format_count| to 0 returns NULL if printing is not supported at all. |
50 PP_PrintOutputFormat_Dev* (*QuerySupportedFormats)(PP_Instance instance, | 51 PP_PrintOutputFormat_Dev* (*QuerySupportedFormats)(PP_Instance instance, |
51 uint32_t* format_count); | 52 uint32_t* format_count); |
52 | 53 |
53 // Begins a print session with the given print settings. Calls to PrintPage | 54 // Begins a print session with the given print settings. Calls to PrintPage |
(...skipping 10 matching lines...) Expand all Loading... |
64 PP_Resource (*PrintPages)( | 65 PP_Resource (*PrintPages)( |
65 PP_Instance instance, | 66 PP_Instance instance, |
66 const struct PP_PrintPageNumberRange_Dev* page_ranges, | 67 const struct PP_PrintPageNumberRange_Dev* page_ranges, |
67 uint32_t page_range_count); | 68 uint32_t page_range_count); |
68 | 69 |
69 // Ends the print session. Further calls to PrintPage will fail. | 70 // Ends the print session. Further calls to PrintPage will fail. |
70 void (*End)(PP_Instance instance); | 71 void (*End)(PP_Instance instance); |
71 }; | 72 }; |
72 | 73 |
73 #endif // PPAPI_C_DEV_PPP_PRINTING_DEV_H_ | 74 #endif // PPAPI_C_DEV_PPP_PRINTING_DEV_H_ |
74 | |
OLD | NEW |