OLD | NEW |
---|---|
1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 /* Copyright (c) 2012 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 /** | 6 /** |
7 * Implementation of the Printing interface. | 7 * Implementation of the Printing interface. |
8 */ | 8 */ |
9 | 9 |
10 label Chrome { | 10 label Chrome { |
11 M14 = 0.5 | 11 M14 = 0.5 |
12 }; | 12 }; |
13 | 13 |
14 [assert_size(4)] | 14 [assert_size(4)] |
15 enum PP_PrintOrientation_Dev { | 15 enum PP_PrintOrientation_Dev { |
16 PP_PRINTORIENTATION_NORMAL = 0, | 16 PP_PRINTORIENTATION_NORMAL = 0, |
17 PP_PRINTORIENTATION_ROTATED_90_CW = 1, | 17 PP_PRINTORIENTATION_ROTATED_90_CW = 1, |
18 PP_PRINTORIENTATION_ROTATED_180 = 2, | 18 PP_PRINTORIENTATION_ROTATED_180 = 2, |
19 PP_PRINTORIENTATION_ROTATED_90_CCW = 3 | 19 PP_PRINTORIENTATION_ROTATED_90_CCW = 3 |
20 }; | 20 }; |
21 | 21 |
22 [assert_size(4)] | 22 [assert_size(4)] |
23 enum PP_PrintOutputFormat_Dev { | 23 enum PP_PrintOutputFormat_Dev { |
24 PP_PRINTOUTPUTFORMAT_RASTER = 1u << 0, | |
viettrungluu
2012/04/16 04:53:53
There's no particular reason to remove it from her
| |
25 PP_PRINTOUTPUTFORMAT_PDF = 1u << 1, | 24 PP_PRINTOUTPUTFORMAT_PDF = 1u << 1, |
26 PP_PRINTOUTPUTFORMAT_POSTSCRIPT = 1u << 2, | 25 PP_PRINTOUTPUTFORMAT_POSTSCRIPT = 1u << 2, |
27 PP_PRINTOUTPUTFORMAT_EMF = 1u << 3 | 26 PP_PRINTOUTPUTFORMAT_EMF = 1u << 3 |
28 }; | 27 }; |
29 | 28 |
30 [assert_size(32)] | 29 [assert_size(32)] |
31 struct PP_PrintSettings_Dev { | 30 struct PP_PrintSettings_Dev { |
32 /** This is the size of the printable area in points (1/72 of an inch) */ | 31 /** This is the size of the printable area in points (1/72 of an inch) */ |
33 PP_Rect printable_area; | 32 PP_Rect printable_area; |
34 int32_t dpi; | 33 int32_t dpi; |
35 PP_PrintOrientation_Dev orientation; | 34 PP_PrintOrientation_Dev orientation; |
36 PP_Bool grayscale; | 35 PP_Bool grayscale; |
37 PP_PrintOutputFormat_Dev format; | 36 PP_PrintOutputFormat_Dev format; |
38 }; | 37 }; |
39 | 38 |
40 /** | 39 /** |
41 * Specifies a contiguous range of page numbers to be printed. | 40 * Specifies a contiguous range of page numbers to be printed. |
42 * The page numbers use a zero-based index. | 41 * The page numbers use a zero-based index. |
43 */ | 42 */ |
44 [assert_size(8)] | 43 [assert_size(8)] |
45 struct PP_PrintPageNumberRange_Dev { | 44 struct PP_PrintPageNumberRange_Dev { |
46 uint32_t first_page_number; | 45 uint32_t first_page_number; |
47 uint32_t last_page_number; | 46 uint32_t last_page_number; |
48 }; | 47 }; |
49 | 48 |
50 interface PPP_Printing_Dev { | 49 interface PPP_Printing_Dev { |
51 /** | 50 /** |
52 * Returns a bit field representing the supported print output formats. For | 51 * Returns a bit field representing the supported print output formats. For |
53 * example, if only Raster and PostScript are supported, | 52 * example, if only PDF and PostScript are supported, |
54 * QuerySupportedFormats returns a value equivalent to: | 53 * QuerySupportedFormats returns a value equivalent to: |
55 * (PP_PRINTOUTPUTFORMAT_RASTER | PP_PRINTOUTPUTFORMAT_POSTSCRIPT) | 54 * (PP_PRINTOUTPUTFORMAT_PDF | PP_PRINTOUTPUTFORMAT_POSTSCRIPT) |
56 */ | 55 */ |
57 uint32_t QuerySupportedFormats([in] PP_Instance instance); | 56 uint32_t QuerySupportedFormats([in] PP_Instance instance); |
58 | 57 |
59 /** | 58 /** |
60 * Begins a print session with the given print settings. Calls to PrintPage | 59 * Begins a print session with the given print settings. Calls to PrintPage |
61 * can only be made after a successful call to Begin. Returns the number of | 60 * can only be made after a successful call to Begin. Returns the number of |
62 * pages required for the print output at the given page size (0 indicates | 61 * pages required for the print output at the given page size (0 indicates |
63 * a failure). | 62 * a failure). |
64 */ | 63 */ |
65 int32_t Begin([in] PP_Instance instance, | 64 int32_t Begin([in] PP_Instance instance, |
66 [in] PP_PrintSettings_Dev print_settings); | 65 [in] PP_PrintSettings_Dev print_settings); |
67 | 66 |
68 /** | 67 /** |
69 * Prints the specified pages using the format specified in Begin. | 68 * Prints the specified pages using the format specified in Begin. |
70 * Returns a resource that represents the printed output. | 69 * Returns a PPB_Buffer resource that represents the printed output. Returns |
71 * This is a PPB_ImageData resource if the output format is | 70 * 0 on failure. |
viettrungluu
2012/04/16 04:53:53
(Though I always wondered what it was supposed to
| |
72 * PP_PrintOutputFormat_Raster and a PPB_Buffer otherwise. Returns 0 on | |
73 * failure. | |
74 */ | 71 */ |
75 PP_Resource PrintPages([in] PP_Instance instance, | 72 PP_Resource PrintPages([in] PP_Instance instance, |
76 [in] PP_PrintPageNumberRange_Dev page_ranges, | 73 [in] PP_PrintPageNumberRange_Dev page_ranges, |
77 [in] uint32_t page_range_count); | 74 [in] uint32_t page_range_count); |
78 | 75 |
79 /** Ends the print session. Further calls to PrintPage will fail. */ | 76 /** Ends the print session. Further calls to PrintPage will fail. */ |
viettrungluu
2012/04/16 04:53:53
I suppose that, while you're here: s/PrintPage/&s/
| |
80 void End([in] PP_Instance instance); | 77 void End([in] PP_Instance instance); |
81 | 78 |
82 /** | 79 /** |
83 * Returns true if the current content should be printed into the full page | 80 * Returns true if the current content should be printed into the full page |
84 * and not scaled down to fit within the printer's printable area. | 81 * and not scaled down to fit within the printer's printable area. |
85 */ | 82 */ |
86 PP_Bool IsScalingDisabled([in] PP_Instance instance); | 83 PP_Bool IsScalingDisabled([in] PP_Instance instance); |
87 }; | 84 }; |
88 | 85 |
OLD | NEW |