Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(135)

Side by Side Diff: ppapi/c/dev/ppp_printing_dev.h

Issue 8041052: Add IsScalingDisabled and PP_PRINTOUTPUTFORMAT_EMF to pepper printing interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | ppapi/cpp/dev/printing_dev.h » ('j') | ppapi/cpp/dev/printing_dev.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
63 /** 64 /**
65 * Returns true if the current content should be printed into the full page
66 * and not scaled down to fit within the printer's printable area.
67 */
68 bool (*IsScalingDisabled)(PP_Instance instance);
dmichael (off chromium) 2011/09/27 15:28:38 We avoid using bool in C for various reasons (part
vandebo (ex-Chrome) 2011/09/27 20:02:24 Done.
69
70 /**
64 * Begins a print session with the given print settings. Calls to PrintPage 71 * Begins a print session with the given print settings. Calls to PrintPage
65 * can only be made after a successful call to Begin. Returns the number of 72 * can only be made after a successful call to Begin. Returns the number of
66 * pages required for the print output at the given page size (0 indicates 73 * pages required for the print output at the given page size (0 indicates
67 * a failure). 74 * a failure).
68 */ 75 */
69 int32_t (*Begin)(PP_Instance instance, 76 int32_t (*Begin)(PP_Instance instance,
70 const struct PP_PrintSettings_Dev* print_settings); 77 const struct PP_PrintSettings_Dev* print_settings);
71 78
72 /** 79 /**
73 * Prints the specified pages using the format specified in Begin. 80 * Prints the specified pages using the format specified in Begin.
74 * Returns a resource that represents the printed output. 81 * Returns a resource that represents the printed output.
75 * This is a PPB_ImageData resource if the output format is 82 * This is a PPB_ImageData resource if the output format is
76 * PP_PrintOutputFormat_Raster and a PPB_Blob otherwise. Returns 0 on 83 * PP_PrintOutputFormat_Raster and a PPB_Blob otherwise. Returns 0 on
77 * failure. 84 * failure.
78 */ 85 */
79 PP_Resource (*PrintPages)( 86 PP_Resource (*PrintPages)(
80 PP_Instance instance, 87 PP_Instance instance,
81 const struct PP_PrintPageNumberRange_Dev* page_ranges, 88 const struct PP_PrintPageNumberRange_Dev* page_ranges,
82 uint32_t page_range_count); 89 uint32_t page_range_count);
83 90
84 /** Ends the print session. Further calls to PrintPage will fail. */ 91 /** Ends the print session. Further calls to PrintPage will fail. */
85 void (*End)(PP_Instance instance); 92 void (*End)(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
OLDNEW
« no previous file with comments | « no previous file | ppapi/cpp/dev/printing_dev.h » ('j') | ppapi/cpp/dev/printing_dev.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698