| OLD | NEW |
| 1 /* Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 /* Copyright (c) 2011 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_bool.h" |
| 9 #include "ppapi/c/pp_instance.h" | 9 #include "ppapi/c/pp_instance.h" |
| 10 #include "ppapi/c/pp_macros.h" | 10 #include "ppapi/c/pp_macros.h" |
| 11 #include "ppapi/c/pp_rect.h" | 11 #include "ppapi/c/pp_rect.h" |
| 12 #include "ppapi/c/pp_resource.h" | 12 #include "ppapi/c/pp_resource.h" |
| 13 #include "ppapi/c/pp_stdint.h" | 13 #include "ppapi/c/pp_stdint.h" |
| 14 | 14 |
| 15 typedef enum { | 15 typedef enum { |
| 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 } PP_PrintOrientation_Dev; | 20 } PP_PrintOrientation_Dev; |
| 21 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_PrintOrientation_Dev, 4); | 21 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_PrintOrientation_Dev, 4); |
| 22 | 22 |
| 23 typedef enum { | 23 typedef enum { |
| 24 PP_PRINTOUTPUTFORMAT_RASTER = 1u << 0, | 24 PP_PRINTOUTPUTFORMAT_RASTER = 1u << 0, |
| 25 PP_PRINTOUTPUTFORMAT_PDF = 1u << 1, | 25 PP_PRINTOUTPUTFORMAT_PDF = 1u << 1, |
| 26 PP_PRINTOUTPUTFORMAT_POSTSCRIPT = 1u << 2 | 26 PP_PRINTOUTPUTFORMAT_POSTSCRIPT = 1u << 2, |
| 27 PP_PRINTOUTPUTFORMAT_EMF = 1u << 3 |
| 27 } PP_PrintOutputFormat_Dev; | 28 } PP_PrintOutputFormat_Dev; |
| 28 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_PrintOutputFormat_Dev, 4); | 29 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_PrintOutputFormat_Dev, 4); |
| 29 | 30 |
| 30 struct PP_PrintSettings_Dev { | 31 struct PP_PrintSettings_Dev { |
| 31 /** This is the size of the printable area in points (1/72 of an inch) */ | 32 /** This is the size of the printable area in points (1/72 of an inch) */ |
| 32 struct PP_Rect printable_area; | 33 struct PP_Rect printable_area; |
| 33 int32_t dpi; | 34 int32_t dpi; |
| 34 PP_PrintOrientation_Dev orientation; | 35 PP_PrintOrientation_Dev orientation; |
| 35 PP_Bool grayscale; | 36 PP_Bool grayscale; |
| 36 PP_PrintOutputFormat_Dev format; | 37 PP_PrintOutputFormat_Dev format; |
| 37 }; | 38 }; |
| 38 PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_PrintSettings_Dev, 32); | 39 PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_PrintSettings_Dev, 32); |
| 39 | 40 |
| 40 /** | 41 /** |
| 41 * Specifies a contiguous range of page numbers to be printed. | 42 * Specifies a contiguous range of page numbers to be printed. |
| 42 * The page numbers use a zero-based index. | 43 * The page numbers use a zero-based index. |
| 43 */ | 44 */ |
| 44 struct PP_PrintPageNumberRange_Dev { | 45 struct PP_PrintPageNumberRange_Dev { |
| 45 uint32_t first_page_number; | 46 uint32_t first_page_number; |
| 46 uint32_t last_page_number; | 47 uint32_t last_page_number; |
| 47 }; | 48 }; |
| 48 PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_PrintPageNumberRange_Dev, 8); | 49 PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_PrintPageNumberRange_Dev, 8); |
| 49 | 50 |
| 50 /* Interface for the plugin to implement printing. */ | 51 /* Interface for the plugin to implement printing. */ |
| 51 #define PPP_PRINTING_DEV_INTERFACE_0_4 "PPP_Printing(Dev);0.4" | 52 #define PPP_PRINTING_DEV_INTERFACE_0_5 "PPP_Printing(Dev);0.5" |
| 52 #define PPP_PRINTING_DEV_INTERFACE PPP_PRINTING_DEV_INTERFACE_0_4 | 53 #define PPP_PRINTING_DEV_INTERFACE PPP_PRINTING_DEV_INTERFACE_0_5 |
| 53 | 54 |
| 54 struct PPP_Printing_Dev { | 55 struct PPP_Printing_Dev { |
| 55 /** | 56 /** |
| 56 * Returns a bit field representing the supported print output formats. For | 57 * Returns a bit field representing the supported print output formats. For |
| 57 * example, if only Raster and PostScript are supported, | 58 * example, if only Raster and PostScript are supported, |
| 58 * QuerySupportedFormats returns a value equivalent to: | 59 * QuerySupportedFormats returns a value equivalent to: |
| 59 * (PP_PRINTOUTPUTFORMAT_RASTER | PP_PRINTOUTPUTFORMAT_POSTSCRIPT) | 60 * (PP_PRINTOUTPUTFORMAT_RASTER | PP_PRINTOUTPUTFORMAT_POSTSCRIPT) |
| 60 */ | 61 */ |
| 61 uint32_t (*QuerySupportedFormats)(PP_Instance instance); | 62 uint32_t (*QuerySupportedFormats)(PP_Instance instance); |
| 62 | 63 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 76 * PP_PrintOutputFormat_Raster and a PPB_Blob otherwise. Returns 0 on | 77 * PP_PrintOutputFormat_Raster and a PPB_Blob otherwise. Returns 0 on |
| 77 * failure. | 78 * failure. |
| 78 */ | 79 */ |
| 79 PP_Resource (*PrintPages)( | 80 PP_Resource (*PrintPages)( |
| 80 PP_Instance instance, | 81 PP_Instance instance, |
| 81 const struct PP_PrintPageNumberRange_Dev* page_ranges, | 82 const struct PP_PrintPageNumberRange_Dev* page_ranges, |
| 82 uint32_t page_range_count); | 83 uint32_t page_range_count); |
| 83 | 84 |
| 84 /** Ends the print session. Further calls to PrintPage will fail. */ | 85 /** Ends the print session. Further calls to PrintPage will fail. */ |
| 85 void (*End)(PP_Instance instance); | 86 void (*End)(PP_Instance instance); |
| 87 |
| 88 /** |
| 89 * Returns true if the current content should be printed into the full page |
| 90 * and not scaled down to fit within the printer's printable area. |
| 91 */ |
| 92 PP_Bool (*IsScalingDisabled)(PP_Instance instance); |
| 86 }; | 93 }; |
| 87 | 94 |
| 88 #endif /* PPAPI_C_DEV_PPP_PRINTING_DEV_H_ */ | 95 #endif /* PPAPI_C_DEV_PPP_PRINTING_DEV_H_ */ |
| 89 | 96 |
| OLD | NEW |