| 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 /* From dev/ppp_printing_dev.idl modified Tue Apr 17 20:28:30 2012. */ | 6 /* From dev/ppp_printing_dev.idl modified Tue May 15 15:17:01 2012. */ |
| 7 | 7 |
| 8 #ifndef PPAPI_C_DEV_PPP_PRINTING_DEV_H_ | 8 #ifndef PPAPI_C_DEV_PPP_PRINTING_DEV_H_ |
| 9 #define PPAPI_C_DEV_PPP_PRINTING_DEV_H_ | 9 #define PPAPI_C_DEV_PPP_PRINTING_DEV_H_ |
| 10 | 10 |
| 11 #include "ppapi/c/pp_bool.h" | 11 #include "ppapi/c/pp_bool.h" |
| 12 #include "ppapi/c/pp_instance.h" | 12 #include "ppapi/c/pp_instance.h" |
| 13 #include "ppapi/c/pp_macros.h" | 13 #include "ppapi/c/pp_macros.h" |
| 14 #include "ppapi/c/pp_point.h" | 14 #include "ppapi/c/pp_point.h" |
| 15 #include "ppapi/c/pp_rect.h" | 15 #include "ppapi/c/pp_rect.h" |
| 16 #include "ppapi/c/pp_resource.h" | 16 #include "ppapi/c/pp_resource.h" |
| 17 #include "ppapi/c/pp_size.h" | 17 #include "ppapi/c/pp_size.h" |
| 18 #include "ppapi/c/pp_stdint.h" | 18 #include "ppapi/c/pp_stdint.h" |
| 19 | 19 |
| 20 #define PPP_PRINTING_DEV_INTERFACE_0_5 "PPP_Printing(Dev);0.5" | 20 #define PPP_PRINTING_DEV_INTERFACE_0_6 "PPP_Printing(Dev);0.6" |
| 21 #define PPP_PRINTING_DEV_INTERFACE PPP_PRINTING_DEV_INTERFACE_0_5 | 21 #define PPP_PRINTING_DEV_INTERFACE PPP_PRINTING_DEV_INTERFACE_0_6 |
| 22 | 22 |
| 23 /** | 23 /** |
| 24 * @file | 24 * @file |
| 25 * Implementation of the Printing interface. | 25 * Implementation of the Printing interface. |
| 26 */ | 26 */ |
| 27 | 27 |
| 28 | 28 |
| 29 /** | 29 /** |
| 30 * @addtogroup Enums | 30 * @addtogroup Enums |
| 31 * @{ | 31 * @{ |
| 32 */ | 32 */ |
| 33 typedef enum { | 33 typedef enum { |
| 34 PP_PRINTORIENTATION_NORMAL = 0, | 34 PP_PRINTORIENTATION_NORMAL = 0, |
| 35 PP_PRINTORIENTATION_ROTATED_90_CW = 1, | 35 PP_PRINTORIENTATION_ROTATED_90_CW = 1, |
| 36 PP_PRINTORIENTATION_ROTATED_180 = 2, | 36 PP_PRINTORIENTATION_ROTATED_180 = 2, |
| 37 PP_PRINTORIENTATION_ROTATED_90_CCW = 3 | 37 PP_PRINTORIENTATION_ROTATED_90_CCW = 3 |
| 38 } PP_PrintOrientation_Dev; | 38 } PP_PrintOrientation_Dev; |
| 39 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_PrintOrientation_Dev, 4); | 39 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_PrintOrientation_Dev, 4); |
| 40 | 40 |
| 41 typedef enum { | 41 typedef enum { |
| 42 PP_PRINTOUTPUTFORMAT_RASTER = 1u << 0, | 42 PP_PRINTOUTPUTFORMAT_RASTER = 1u << 0, |
| 43 PP_PRINTOUTPUTFORMAT_PDF = 1u << 1, | 43 PP_PRINTOUTPUTFORMAT_PDF = 1u << 1, |
| 44 PP_PRINTOUTPUTFORMAT_POSTSCRIPT = 1u << 2, | 44 PP_PRINTOUTPUTFORMAT_POSTSCRIPT = 1u << 2, |
| 45 PP_PRINTOUTPUTFORMAT_EMF = 1u << 3 | 45 PP_PRINTOUTPUTFORMAT_EMF = 1u << 3 |
| 46 } PP_PrintOutputFormat_Dev; | 46 } PP_PrintOutputFormat_Dev; |
| 47 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_PrintOutputFormat_Dev, 4); | 47 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_PrintOutputFormat_Dev, 4); |
| 48 |
| 49 typedef enum { |
| 50 PP_PRINTSCALINGOPTION_NONE = 0, |
| 51 PP_PRINTSCALINGOPTION_FIT_TO_PRINTABLE_AREA = 1, |
| 52 PP_PRINTSCALINGOPTION_SOURCE_SIZE = 2 |
| 53 } PP_PrintScalingOption_Dev; |
| 54 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_PrintScalingOption_Dev, 4); |
| 48 /** | 55 /** |
| 49 * @} | 56 * @} |
| 50 */ | 57 */ |
| 51 | 58 |
| 52 /** | 59 /** |
| 53 * @addtogroup Structs | 60 * @addtogroup Structs |
| 54 * @{ | 61 * @{ |
| 55 */ | 62 */ |
| 56 struct PP_PrintSettings_Dev { | 63 struct PP_PrintSettings_Dev { |
| 57 /** This is the size of the printable area in points (1/72 of an inch) */ | 64 /** This is the size of the printable area in points (1/72 of an inch) */ |
| 58 struct PP_Rect printable_area; | 65 struct PP_Rect printable_area; |
| 66 struct PP_Rect content_area; |
| 67 struct PP_Size paper_size; |
| 59 int32_t dpi; | 68 int32_t dpi; |
| 60 PP_PrintOrientation_Dev orientation; | 69 PP_PrintOrientation_Dev orientation; |
| 70 PP_PrintScalingOption_Dev print_scaling_option; |
| 61 PP_Bool grayscale; | 71 PP_Bool grayscale; |
| 62 /** Note that Chrome currently only supports PDF printing. */ | 72 /** Note that Chrome currently only supports PDF printing. */ |
| 63 PP_PrintOutputFormat_Dev format; | 73 PP_PrintOutputFormat_Dev format; |
| 64 }; | 74 }; |
| 65 PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_PrintSettings_Dev, 32); | 75 PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_PrintSettings_Dev, 60); |
| 66 | 76 |
| 67 /** | 77 /** |
| 68 * Specifies a contiguous range of page numbers to be printed. | 78 * Specifies a contiguous range of page numbers to be printed. |
| 69 * The page numbers use a zero-based index. | 79 * The page numbers use a zero-based index. |
| 70 */ | 80 */ |
| 71 struct PP_PrintPageNumberRange_Dev { | 81 struct PP_PrintPageNumberRange_Dev { |
| 72 uint32_t first_page_number; | 82 uint32_t first_page_number; |
| 73 uint32_t last_page_number; | 83 uint32_t last_page_number; |
| 74 }; | 84 }; |
| 75 PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_PrintPageNumberRange_Dev, 8); | 85 PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_PrintPageNumberRange_Dev, 8); |
| 76 /** | 86 /** |
| 77 * @} | 87 * @} |
| 78 */ | 88 */ |
| 79 | 89 |
| 80 /** | 90 /** |
| 81 * @addtogroup Interfaces | 91 * @addtogroup Interfaces |
| 82 * @{ | 92 * @{ |
| 83 */ | 93 */ |
| 84 struct PPP_Printing_Dev_0_5 { | 94 struct PPP_Printing_Dev_0_6 { |
| 85 /** | 95 /** |
| 86 * Returns a bit field representing the supported print output formats. For | 96 * Returns a bit field representing the supported print output formats. For |
| 87 * example, if only PDF and PostScript are supported, | 97 * example, if only PDF and PostScript are supported, |
| 88 * QuerySupportedFormats returns a value equivalent to: | 98 * QuerySupportedFormats returns a value equivalent to: |
| 89 * (PP_PRINTOUTPUTFORMAT_PDF | PP_PRINTOUTPUTFORMAT_POSTSCRIPT) | 99 * (PP_PRINTOUTPUTFORMAT_PDF | PP_PRINTOUTPUTFORMAT_POSTSCRIPT) |
| 90 */ | 100 */ |
| 91 uint32_t (*QuerySupportedFormats)(PP_Instance instance); | 101 uint32_t (*QuerySupportedFormats)(PP_Instance instance); |
| 92 /** | 102 /** |
| 93 * Begins a print session with the given print settings. Calls to PrintPages | 103 * Begins a print session with the given print settings. Calls to PrintPages |
| 94 * can only be made after a successful call to Begin. Returns the number of | 104 * can only be made after a successful call to Begin. Returns the number of |
| (...skipping 13 matching lines...) Expand all Loading... |
| 108 uint32_t page_range_count); | 118 uint32_t page_range_count); |
| 109 /** Ends the print session. Further calls to PrintPages will fail. */ | 119 /** Ends the print session. Further calls to PrintPages will fail. */ |
| 110 void (*End)(PP_Instance instance); | 120 void (*End)(PP_Instance instance); |
| 111 /** | 121 /** |
| 112 * Returns true if the current content should be printed into the full page | 122 * Returns true if the current content should be printed into the full page |
| 113 * and not scaled down to fit within the printer's printable area. | 123 * and not scaled down to fit within the printer's printable area. |
| 114 */ | 124 */ |
| 115 PP_Bool (*IsScalingDisabled)(PP_Instance instance); | 125 PP_Bool (*IsScalingDisabled)(PP_Instance instance); |
| 116 }; | 126 }; |
| 117 | 127 |
| 118 typedef struct PPP_Printing_Dev_0_5 PPP_Printing_Dev; | 128 typedef struct PPP_Printing_Dev_0_6 PPP_Printing_Dev; |
| 119 /** | 129 /** |
| 120 * @} | 130 * @} |
| 121 */ | 131 */ |
| 122 | 132 |
| 123 #endif /* PPAPI_C_DEV_PPP_PRINTING_DEV_H_ */ | 133 #endif /* PPAPI_C_DEV_PPP_PRINTING_DEV_H_ */ |
| 124 | 134 |
| OLD | NEW |