kinokero 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (187) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +44 -0
  3. data/.ruby-gemset +1 -0
  4. data/.ruby-version +1 -0
  5. data/Gemfile +6 -0
  6. data/Gemfile.lock +49 -0
  7. data/Gemfile_mock +8 -0
  8. data/LICENSE +20 -0
  9. data/README.md +955 -0
  10. data/Rakefile +1 -0
  11. data/console/.ruby-gemset +1 -0
  12. data/console/.ruby-version +1 -0
  13. data/console/Gemfile +6 -0
  14. data/console/Gemfile.lock +63 -0
  15. data/console/README.md +34 -0
  16. data/console/config/application_configuration.rb +39 -0
  17. data/console/config/gcp_seed.yml +73 -0
  18. data/console/config/kinokero_initializer_template.rb +108 -0
  19. data/console/console +2 -0
  20. data/console/irb_console +2 -0
  21. data/console/lib/appliance_common.rb +73 -0
  22. data/console/twiga.rb +579 -0
  23. data/hp-check.log +244 -0
  24. data/kinokero.gemspec +35 -0
  25. data/lib/kinokero.rb +183 -0
  26. data/lib/kinokero/blank.rb +105 -0
  27. data/lib/kinokero/cloudprint.rb +1159 -0
  28. data/lib/kinokero/device.rb +6 -0
  29. data/lib/kinokero/jingle.rb +176 -0
  30. data/lib/kinokero/log.rb +157 -0
  31. data/lib/kinokero/printer.rb +313 -0
  32. data/lib/kinokero/proxy.rb +341 -0
  33. data/lib/kinokero/ruby_extensions.rb +21 -0
  34. data/lib/kinokero/sasl_xoauth2.rb +164 -0
  35. data/lib/kinokero/version.rb +3 -0
  36. data/lib/proto/cloud_device_description.proto +18 -0
  37. data/lib/proto/cloud_device_state.proto +30 -0
  38. data/lib/proto/cloud_device_state_type.proto +20 -0
  39. data/lib/proto/cloud_device_ui_state.proto +42 -0
  40. data/lib/proto/cloud_device_ui_state_severity.proto +12 -0
  41. data/lib/proto/cloud_job_ticket.proto +18 -0
  42. data/lib/proto/collate.proto +4 -0
  43. data/lib/proto/collate_ticket_item.proto +5 -0
  44. data/lib/proto/color.proto +42 -0
  45. data/lib/proto/color_ticket_item.proto +12 -0
  46. data/lib/proto/copies.proto +6 -0
  47. data/lib/proto/copies_ticket_item.proto +5 -0
  48. data/lib/proto/cover.proto +31 -0
  49. data/lib/proto/cover_state.proto +25 -0
  50. data/lib/proto/device_action_cause.proto +19 -0
  51. data/lib/proto/dpi.proto +27 -0
  52. data/lib/proto/dpi_ticket_item.proto +13 -0
  53. data/lib/proto/duplex.proto +15 -0
  54. data/lib/proto/duplex_ticket_item.proto +8 -0
  55. data/lib/proto/fit_to_page.proto +20 -0
  56. data/lib/proto/fit_to_page_ticket_item.proto +8 -0
  57. data/lib/proto/input_tray_state.proto +31 -0
  58. data/lib/proto/input_tray_unit.proto +35 -0
  59. data/lib/proto/job_state.proto +143 -0
  60. data/lib/proto/local_settings.proto +36 -0
  61. data/lib/proto/localized_string.proto +119 -0
  62. data/lib/proto/margins.proto +33 -0
  63. data/lib/proto/margins_ticket_item.proto +14 -0
  64. data/lib/proto/marker.proto +62 -0
  65. data/lib/proto/marker_state.proto +31 -0
  66. data/lib/proto/media_path.proto +6 -0
  67. data/lib/proto/media_path_state.proto +25 -0
  68. data/lib/proto/media_size.proto +216 -0
  69. data/lib/proto/media_size_ticket_item.proto +17 -0
  70. data/lib/proto/output_bin_state.proto +31 -0
  71. data/lib/proto/output_bin_unit.proto +32 -0
  72. data/lib/proto/page_orientation.proto +16 -0
  73. data/lib/proto/page_orientation_ticket_item.proto +9 -0
  74. data/lib/proto/page_range.proto +15 -0
  75. data/lib/proto/page_range_ticket_item.proto +7 -0
  76. data/lib/proto/print_job_state.proto +18 -0
  77. data/lib/proto/print_job_state_diff.proto +13 -0
  78. data/lib/proto/print_job_ui_state.proto +24 -0
  79. data/lib/proto/print_ticket_section.proto +30 -0
  80. data/lib/proto/printer_description_section.proto +107 -0
  81. data/lib/proto/printer_state_section.proto +49 -0
  82. data/lib/proto/printer_ui_state_section.proto +39 -0
  83. data/lib/proto/printing_speed.proto +35 -0
  84. data/lib/proto/pwg_raster_config.proto +176 -0
  85. data/lib/proto/range_capability.proto +14 -0
  86. data/lib/proto/reverse_order.proto +5 -0
  87. data/lib/proto/reverse_order_ticket_item.proto +5 -0
  88. data/lib/proto/scanner_description_section.proto +5 -0
  89. data/lib/proto/scanner_state_section.proto +25 -0
  90. data/lib/proto/select_capability.proto +31 -0
  91. data/lib/proto/supported_content_type.proto +12 -0
  92. data/lib/proto/typed_value_capability.proto +15 -0
  93. data/lib/proto/vendor_capability.proto +40 -0
  94. data/lib/proto/vendor_state.proto +26 -0
  95. data/lib/proto/vendor_ticket_item.proto +9 -0
  96. data/lib/proto_lib/cloud_device_state.pb.rb +21 -0
  97. data/lib/proto_lib/cloud_device_state_type.pb.rb +16 -0
  98. data/lib/proto_lib/cloud_device_ui_state.pb.rb +22 -0
  99. data/lib/proto_lib/cloud_device_ui_state_severity.pb.rb +17 -0
  100. data/lib/proto_lib/collate.pb.rb +11 -0
  101. data/lib/proto_lib/color.pb.rb +31 -0
  102. data/lib/proto_lib/copies.pb.rb +12 -0
  103. data/lib/proto_lib/cover.pb.rb +21 -0
  104. data/lib/proto_lib/cover_state.pb.rb +27 -0
  105. data/lib/proto_lib/device_action_cause.pb.rb +18 -0
  106. data/lib/proto_lib/dpi.pb.rb +27 -0
  107. data/lib/proto_lib/duplex.pb.rb +26 -0
  108. data/lib/proto_lib/fit_to_page.pb.rb +28 -0
  109. data/lib/proto_lib/input_tray_state.pb.rb +30 -0
  110. data/lib/proto_lib/input_tray_unit.pb.rb +25 -0
  111. data/lib/proto_lib/job_state.pb.rb +99 -0
  112. data/lib/proto_lib/localized_string.pb.rb +118 -0
  113. data/lib/proto_lib/margins.pb.rb +30 -0
  114. data/lib/proto_lib/marker.pb.rb +45 -0
  115. data/lib/proto_lib/marker_state.pb.rb +30 -0
  116. data/lib/proto_lib/media_path.pb.rb +11 -0
  117. data/lib/proto_lib/media_path_state.pb.rb +27 -0
  118. data/lib/proto_lib/media_size.pb.rb +198 -0
  119. data/lib/proto_lib/output_bin_state.pb.rb +30 -0
  120. data/lib/proto_lib/output_bin_unit.pb.rb +22 -0
  121. data/lib/proto_lib/page_orientation.pb.rb +26 -0
  122. data/lib/proto_lib/page_range.pb.rb +20 -0
  123. data/lib/proto_lib/print_job_state_diff.pb.rb +12 -0
  124. data/lib/proto_lib/printer_description_section.pb.rb +30 -0
  125. data/lib/proto_lib/printer_state_section.pb.rb +23 -0
  126. data/lib/proto_lib/printer_ui_state_section.pb.rb +28 -0
  127. data/lib/proto_lib/printing_speed.pb.rb +21 -0
  128. data/lib/proto_lib/pwg_raster_config.pb.rb +103 -0
  129. data/lib/proto_lib/range_capability.pb.rb +19 -0
  130. data/lib/proto_lib/reverse_order.pb.rb +11 -0
  131. data/lib/proto_lib/scanner_description_section.pb.rb +10 -0
  132. data/lib/proto_lib/scanner_state_section.pb.rb +17 -0
  133. data/lib/proto_lib/select_capability.pb.rb +22 -0
  134. data/lib/proto_lib/supported_content_type.pb.rb +13 -0
  135. data/lib/proto_lib/typed_value_capability.pb.rb +19 -0
  136. data/lib/proto_lib/vendor_capability.pb.rb +23 -0
  137. data/lib/proto_lib/vendor_state.pb.rb +27 -0
  138. data/test/.ruby-gemset +1 -0
  139. data/test/.ruby-version +1 -0
  140. data/test/Gemfile +68 -0
  141. data/test/Gemfile.lock +269 -0
  142. data/test/README.md +2 -0
  143. data/test/Rakefile +6 -0
  144. data/test/app/assets/javascripts/application.js +16 -0
  145. data/test/app/assets/stylesheets/application.css +13 -0
  146. data/test/app/controllers/application_controller.rb +13 -0
  147. data/test/app/controllers/home_controller.rb +10 -0
  148. data/test/app/helpers/application_helper.rb +2 -0
  149. data/test/app/views/home/index.html.erb +2 -0
  150. data/test/app/views/home/show.html.erb +2 -0
  151. data/test/app/views/layouts/application.html.erb +14 -0
  152. data/test/bin/bundle +3 -0
  153. data/test/bin/rails +4 -0
  154. data/test/bin/rake +4 -0
  155. data/test/config/application.rb +29 -0
  156. data/test/config/boot.rb +4 -0
  157. data/test/config/database.yml +25 -0
  158. data/test/config/environment.rb +5 -0
  159. data/test/config/environments/development.rb +48 -0
  160. data/test/config/environments/production.rb +95 -0
  161. data/test/config/environments/test.rb +42 -0
  162. data/test/config/initializers/backtrace_silencers.rb +7 -0
  163. data/test/config/initializers/filter_parameter_logging.rb +4 -0
  164. data/test/config/initializers/inflections.rb +16 -0
  165. data/test/config/initializers/mime_types.rb +5 -0
  166. data/test/config/initializers/secret_token.rb +12 -0
  167. data/test/config/initializers/session_store.rb +3 -0
  168. data/test/config/initializers/wrap_parameters.rb +14 -0
  169. data/test/config/locales/en.yml +23 -0
  170. data/test/config/routes.rb +65 -0
  171. data/test/db/development.sqlite3 +0 -0
  172. data/test/db/migrate/20111012050200_add_sessions_table.rb +12 -0
  173. data/test/db/schema.rb +26 -0
  174. data/test/db/seeds.rb +7 -0
  175. data/test/db/test.sqlite3 +0 -0
  176. data/test/log/development.log +0 -0
  177. data/test/log/test.log +0 -0
  178. data/test/test/controllers/home_controller_test.rb +133 -0
  179. data/test/test/ctlr_test_helper.rb +7 -0
  180. data/test/test/fixtures/gcp_seed.yml +51 -0
  181. data/test/test/models/cloudprint_test.rb +186 -0
  182. data/test/test/models/jingle_test.rb +44 -0
  183. data/test/test/models/printer_test.rb +99 -0
  184. data/test/test/models/proxy_test.rb +102 -0
  185. data/test/test/test_helper.rb +31 -0
  186. data/test/test/test_kinokero.rb +234 -0
  187. metadata +462 -0
@@ -0,0 +1,24 @@
1
+ // Represents a print job's state in a form convenient for display in a UI.
2
+ message PrintJobUiState {
3
+
4
+ enum Summary {
5
+ DRAFT = 0;
6
+ QUEUED = 1;
7
+ IN_PROGRESS = 2;
8
+ PAUSED = 3;
9
+ DONE = 4;
10
+ CANCELLED = 5;
11
+ ERROR = 6;
12
+ EXPIRED = 7;
13
+ }
14
+
15
+ // Job state summary (required).
16
+ optional Summary summary = 1;
17
+
18
+ // Localized string describing the progress of the job, e.g. the number of
19
+ // attempts to deliver it or the number of pages which have been printed.
20
+ optional string progress = 2;
21
+
22
+ // Localized string describing the cause of an abnormal state of the job.
23
+ optional string cause = 3;
24
+ }
@@ -0,0 +1,30 @@
1
+ // Section of a CJT which describes how a print job should be handled by a
2
+ // cloud-connected printer.
3
+
4
+ import 'vendor_ticket_item.proto';
5
+ import 'color_ticket_item.proto';
6
+ import 'duplex_ticket_item.proto';
7
+ import 'page_orientation_ticket_item.proto';
8
+ import 'copies_ticket_item.proto';
9
+ import 'margins_ticket_item.proto';
10
+ import 'dpi_ticket_item.proto';
11
+ import 'fit_to_page_ticket_item.proto';
12
+ import 'page_range_ticket_item.proto';
13
+ import 'media_size_ticket_item.proto';
14
+ import 'collate_ticket_item.proto';
15
+ import 'reverse_order_ticket_item.proto';
16
+
17
+ message PrintTicketSection {
18
+ repeated VendorTicketItem vendor_ticket_item = 1;
19
+ optional ColorTicketItem color = 2;
20
+ optional DuplexTicketItem duplex = 3;
21
+ optional PageOrientationTicketItem page_orientation = 4;
22
+ optional CopiesTicketItem copies = 5;
23
+ optional MarginsTicketItem margins = 6;
24
+ optional DpiTicketItem dpi = 7;
25
+ optional FitToPageTicketItem fit_to_page = 8;
26
+ optional PageRangeTicketItem page_range = 9;
27
+ optional MediaSizeTicketItem media_size = 10;
28
+ optional CollateTicketItem collate = 11;
29
+ optional ReverseOrderTicketItem reverse_order = 12;
30
+ }
@@ -0,0 +1,107 @@
1
+ // Section of a CDD that describes the capabilities and physical units of a
2
+ // cloud-connected printer.
3
+
4
+ import 'supported_content_type.proto';
5
+ import 'printing_speed.proto';
6
+ import 'pwg_raster_config.proto';
7
+ import 'input_tray_unit.proto';
8
+ import 'output_bin_unit.proto';
9
+ import 'marker.proto';
10
+ import 'cover.proto';
11
+ import 'media_path.proto';
12
+ import 'vendor_capability.proto';
13
+ import 'color.proto';
14
+ import 'duplex.proto';
15
+ import 'page_orientation.proto';
16
+ import 'copies.proto';
17
+ import 'margins.proto';
18
+ import 'dpi.proto';
19
+ import 'fit_to_page.proto';
20
+ import 'page_range.proto';
21
+ import 'media_size.proto';
22
+ import 'collate.proto';
23
+ import 'reverse_order.proto';
24
+
25
+ message PrinterDescriptionSection {
26
+
27
+ // Content types (sometimes referred to as MIME types) that are supported by
28
+ // the printer.
29
+ //
30
+ // The order of these types determines which content type the document should
31
+ // be converted to. For example, if the types are ordered as:
32
+ //
33
+ // [
34
+ // {"content_type": "application/pdf"},
35
+ // {"content_type": "image/pwg-raster"}
36
+ // ]
37
+ //
38
+ // Then the document's content type will first be matched to any content type
39
+ // in the list. If there is a match, then the document will be sent to the
40
+ // printer as is. If there is no match, then the document will be converted to
41
+ // a content type which the server supports starting from the first option. In
42
+ // this example, if the document is sent as "text/html" and the printer
43
+ // supports "application/pdf" and "image/pwg-raster", then the document will
44
+ // be converted to "application/pdf" and not "image/pwg-raster", because
45
+ // "application/pdf" is declared earlier in this list.
46
+ repeated SupportedContentType supported_content_type = 1;
47
+
48
+ // Printing speeds that the printer can operate at.
49
+ optional PrintingSpeed printing_speed = 2;
50
+
51
+ // PWG raster configuration of the printer. Required if the printer supports
52
+ // image/pwg-raster content type, and it should be omitted otherwise.
53
+ // This allows a cloud service to understand how to rasterize a document in
54
+ // PWG-raster for the printer.
55
+ optional PwgRasterConfig pwg_raster_config = 3;
56
+
57
+ // Physical model of the printer's input trays.
58
+ repeated InputTrayUnit input_tray_unit = 4;
59
+
60
+ // Physical model of the printer's output bins.
61
+ repeated OutputBinUnit output_bin_unit = 5;
62
+
63
+ // Physical model of the printer's markers.
64
+ repeated Marker marker = 6;
65
+
66
+ // Physical model of the printer's covers.
67
+ repeated Cover cover = 7;
68
+
69
+ // Physical model of the printer's media paths.
70
+ repeated MediaPath media_path = 8;
71
+
72
+ // Vendor-provided printer capabilities.
73
+ repeated VendorCapability vendor_capability = 101;
74
+
75
+ // Color printing capabilities of the printer.
76
+ optional Color color = 102;
77
+
78
+ // Duplexing capabilities of the printer.
79
+ optional Duplex duplex = 103;
80
+
81
+ // Page/paper orientation capabilities of the printer.
82
+ optional PageOrientation page_orientation = 104;
83
+
84
+ // Multiple copy capability of the printer.
85
+ optional Copies copies = 105;
86
+
87
+ // Page margins capability of the printer.
88
+ optional Margins margins = 106;
89
+
90
+ // Printing quality or dots-per-inch (DPI) capabilities of the printer.
91
+ optional Dpi dpi = 107;
92
+
93
+ // Page fitting capabilities of the printer.
94
+ optional FitToPage fit_to_page = 108;
95
+
96
+ // Page range selection capability of the printer.
97
+ optional PageRange page_range = 109;
98
+
99
+ // Page or media size capabilities of the printer.
100
+ optional MediaSize media_size = 110;
101
+
102
+ // Paper collation capability of the printer.
103
+ optional Collate collate = 111;
104
+
105
+ // Reverse order printing capability of the printer.
106
+ optional ReverseOrder reverse_order = 112;
107
+ }
@@ -0,0 +1,49 @@
1
+ // Represents the printer state.
2
+
3
+ // import 'cloud_device_state.proto';
4
+ import 'input_tray_state.proto';
5
+ import 'output_bin_state.proto';
6
+ import 'marker_state.proto';
7
+ import 'cover_state.proto';
8
+ import 'media_path_state.proto';
9
+ import 'vendor_state.proto';
10
+
11
+ message PrinterStateSection {
12
+
13
+ // Supported device states.
14
+ enum StateType {
15
+
16
+ // Device is ready to accept jobs. Self-testing, low power and all other
17
+ // states in which the device can start processing newly submitted jobs
18
+ // without user intervention should be mapped into this state.
19
+ IDLE = 0;
20
+
21
+ // Processing jobs (e.g. printing).
22
+ PROCESSING = 1;
23
+
24
+ // Device cannot process jobs. User should fix the problem to resume the
25
+ // processing (e.g. printer is out of paper).
26
+ STOPPED = 2;
27
+ }
28
+
29
+ // Current printer state (required).
30
+ optional StateType state = 1;
31
+
32
+ // State of the input trays.
33
+ optional InputTrayState input_tray_state = 2;
34
+
35
+ // State of the output bins.
36
+ optional OutputBinState output_bin_state = 3;
37
+
38
+ // State of the markers.
39
+ optional MarkerState marker_state = 4;
40
+
41
+ // State of the printer doors/covers/etc.
42
+ optional CoverState cover_state = 5;
43
+
44
+ // State of the printer media paths.
45
+ optional MediaPathState media_path_state = 6;
46
+
47
+ // Vendor-specific printer state.
48
+ optional VendorState vendor_state = 101;
49
+ }
@@ -0,0 +1,39 @@
1
+ // Contains one UI state item for each CDS state item using the information
2
+ // obtained from cross-referencing the CDD.
3
+
4
+ import 'cloud_device_ui_state_severity.proto';
5
+ import 'marker.proto';
6
+
7
+ message PrinterUiStateSection {
8
+
9
+ // A UI state item with a severity level and either:
10
+ // (1) a localized message and UI-displayable data from the properties and
11
+ // state of a particular unit of the device, or
12
+ // (2) a possibly non-localized vendor state message.
13
+ message Item {
14
+
15
+ // The severity of this individual state item (required).
16
+ optional CloudDeviceUiStateSeverity.Severity severity = 1;
17
+
18
+ // A message produced from a state item, e.g. Black ink level is 60%. This
19
+ // message may not be localized if it is from a VendorState.Item (required).
20
+ optional string message = 2;
21
+
22
+ // A non-localized vendor-specific message that provides additional
23
+ // information about the state of the device unit described by this item.
24
+ optional string vendor_message = 3;
25
+
26
+ // The fullness level of an input tray, output bin or marker.
27
+ optional int32 level_percent = 4;
28
+
29
+ // The color of a marker.
30
+ optional Marker.Color.Type color = 5;
31
+ }
32
+
33
+ repeated Item vendor_item = 1;
34
+ repeated Item input_tray_item = 2;
35
+ repeated Item output_bin_item = 3;
36
+ repeated Item marker_item = 4;
37
+ repeated Item cover_item = 5;
38
+ repeated Item media_path_item = 6;
39
+ }
@@ -0,0 +1,35 @@
1
+ // Property that defines what speeds (in pages per minute) the printer can
2
+ // operate at.
3
+
4
+ import 'color.proto';
5
+ import 'media_size.proto';
6
+
7
+ message PrintingSpeed {
8
+ // Available speed of the printer.
9
+ //
10
+ // Specify settings that are associated with the given speed. If a setting
11
+ // is left unset, then it will be assumed that the speed is independent of
12
+ // that setting. For example, the following Option
13
+ //
14
+ // {
15
+ // "speed_ppm": 5.5,
16
+ // "color_type": ["STANDARD_MONOCHROME"],
17
+ // "media_size_name": ["NA_LETTER", "ISO_A4"]
18
+ // }
19
+ //
20
+ // indicates that the printer prints at 5.5 pages per minute when printing in
21
+ // STANDARD_MONOCHROME in either NA_LETTER or ISO_A4 paper sizes.
22
+ message Option {
23
+ // Speed measured in pages per minute (required).
24
+ optional float speed_ppm = 1;
25
+
26
+ // Types of color settings that operate at this speed.
27
+ repeated Color.Type color_type = 2;
28
+
29
+ // Names of media sizes that operate at this speed.
30
+ repeated MediaSize.Name media_size_name = 3;
31
+ }
32
+
33
+ // Speeds that the printer can operate at.
34
+ repeated Option option = 1;
35
+ }
@@ -0,0 +1,176 @@
1
+ // Configuration of how printer should receive PWG raster images.
2
+
3
+ import 'duplex.proto';
4
+
5
+ message PwgRasterConfig {
6
+
7
+ message Resolution {
8
+ optional int32 cross_feed_dir = 1; // Horizontal resolution in DPI.
9
+ optional int32 feed_dir = 2; // Vertical resolution in DPI.
10
+ }
11
+
12
+ // Resolutions (in DPI) of the pages that the printer supports in PWG-raster
13
+ // format. The resolution MUST be supported for every page media supported by
14
+ // the printer. (Same as PwgRasterDocumentResolutionSupported PWG-raster
15
+ // semantic model element.) This field is strongly recommended, as it helps
16
+ // GCP to decide which resolutions are supported by the printer for PWG-raster
17
+ // documents if it has to downscale the document to a lower resolution.
18
+ //
19
+ // This list can be a subset of the full set of resolutions supported by the
20
+ // printer (in formats different from PWG-raster, e.g. PDF), but it MUST
21
+ // include an NxN DPI resolution where N <= 360 and N evenly divides all
22
+ // resolutions supported by the printer. A resolution NxN where N >= 600
23
+ // (possibly 600 or 720) is also strongly recommended.
24
+ //
25
+ // GCP will generate PWG-raster pages not necessarily at the resolution
26
+ // reported in the ticket, but the actual DPIs of the page (horizontal and
27
+ // vertical) will always perfectly divide the corresponding values reported in
28
+ // the ticket.
29
+ repeated Resolution document_resolution_supported = 2;
30
+
31
+ // List of PWG-raster document types (in terms of color space and bits per
32
+ // color) supported by the printer. Color printers MUST support SRGB_8 and
33
+ // possibly SGRAY_8. Monochrome printers must support either SRGB_8 or
34
+ // SGRAY_8. However, any printer that doesn't support SGRAY_8 must be able
35
+ // to perform conversion from RGB to grayscale if it receives a PWG-raster
36
+ // document in SRGB and the print job ticket specifies monochrome printing.
37
+ //
38
+ // This field is strongly recommended, and we recommend to include all types
39
+ // supported by the printer, as GCP may start serving more document types in
40
+ // the future.
41
+ repeated PwgDocumentTypeSupported document_type_supported = 3;
42
+
43
+ // Describes which transformation needs to be applied to back pages in
44
+ // duplexing in order to have them printed properly.
45
+ // The value mainly depends on how duplexing works on the printer, and the
46
+ // actual effect depends on which duplexing is specified in the ticket.
47
+ enum DocumentSheetBack {
48
+ // No special treatment for back pages (same as front page).
49
+ NORMAL = 0;
50
+ // Back pages are rotated 180 degrees if the document is portrait
51
+ // (TwoSidedLongEdge duplexing).
52
+ ROTATED = 1;
53
+ // Back pages are rotated 180 degrees if the document is landscape
54
+ // (TwoSidedShortEdge duplexing, opposite of ROTATED).
55
+ MANUAL_TUMBLE = 2;
56
+ // Page is flipped upside-down if portrait (TwoSidedLongEdge duplexing),
57
+ // left-right if landscape (TwoSidedShortEdge duplexing).
58
+ FLIPPED = 3;
59
+ }
60
+ // Same as PwgRasterDocumentSheetBack PWG-raster semantic model element.
61
+ // Default value is ROTATED.
62
+ optional DocumentSheetBack document_sheet_back = 4 [default = ROTATED];
63
+
64
+ // Instructs GCP that the printer wants to print pages from the last to the
65
+ // first. In that case GCP will stream PWG-raster pages in that order.
66
+ optional bool reverse_order_streaming = 5;
67
+
68
+ // Instructs GCP that the printer prefers receiving pages rotated 180 degrees.
69
+ // This rotation is in addition to possible additional rotations of even pages
70
+ // based on document_sheet_back in case of duplexing.
71
+ optional bool rotate_all_pages = 6;
72
+
73
+ // PWG-raster document types (in terms of color space and bits per color).
74
+ // This list is based on the PWG-raster specs of March 14, 2012, and it
75
+ // will be extended without notice if new types are added to newer versions
76
+ // of the specs. If a new type is not accepted by GCP capability parser please
77
+ // inform the GCP team. (This doesn't mean that GCP will start sending
78
+ // documents of the new kind.)
79
+ //
80
+ // The string names are identical to the keyword attribute values in
81
+ // PWG-raster documentation, except they are uppercase, and dashes are
82
+ // replaced by underscores.
83
+ enum PwgDocumentTypeSupported {
84
+ BLACK_1 = 1;
85
+ SGRAY_1 = 2;
86
+ ADOBE_RGB_8 = 3;
87
+ BLACK_8 = 4;
88
+ CMYK_8 = 5;
89
+ DEVICE1_8 = 6;
90
+ DEVICE2_8 = 7;
91
+ DEVICE3_8 = 8;
92
+ DEVICE4_8 = 9;
93
+ DEVICE5_8 = 10;
94
+ DEVICE6_8 = 11;
95
+ DEVICE7_8 = 12;
96
+ DEVICE8_8 = 13;
97
+ DEVICE9_8 = 14;
98
+ DEVICE10_8 = 15;
99
+ DEVICE11_8 = 16;
100
+ DEVICE12_8 = 17;
101
+ DEVICE13_8 = 18;
102
+ DEVICE14_8 = 19;
103
+ DEVICE15_8 = 20;
104
+ RGB_8 = 21;
105
+ SGRAY_8 = 22;
106
+ SRGB_8 = 23;
107
+ ADOBE_RGB_16 = 24;
108
+ BLACK_16 = 25;
109
+ CMYK_16 = 26;
110
+ DEVICE1_16 = 27;
111
+ DEVICE2_16 = 28;
112
+ DEVICE3_16 = 29;
113
+ DEVICE4_16 = 30;
114
+ DEVICE5_16 = 31;
115
+ DEVICE6_16 = 32;
116
+ DEVICE7_16 = 33;
117
+ DEVICE8_16 = 34;
118
+ DEVICE9_16 = 35;
119
+ DEVICE10_16 = 36;
120
+ DEVICE11_16 = 37;
121
+ DEVICE12_16 = 38;
122
+ DEVICE13_16 = 39;
123
+ DEVICE14_16 = 40;
124
+ DEVICE15_16 = 41;
125
+ RGB_16 = 42;
126
+ SGRAY_16 = 43;
127
+ SRGB_16 = 44;
128
+ }
129
+
130
+ // [Deprecated: Please use the other fields of PwgRasterConfig.]
131
+ // Transformation to apply to pages during PWG rasterization.
132
+ message Transformation {
133
+ // Types of transformation operations to apply.
134
+ enum Operation {
135
+ // Rotate pages 180 degrees.
136
+ ROTATE_180 = 0;
137
+
138
+ // Flip pages along the long edge of the paper.
139
+ FLIP_ON_LONG_EDGE = 1;
140
+
141
+ // Flip pages along the short edge of the paper.
142
+ FLIP_ON_SHORT_EDGE = 2;
143
+ }
144
+
145
+ // Selectors of which pages to apply the transformation to.
146
+ enum Operand {
147
+ // Apply transformation to all pages.
148
+ ALL_PAGES = 0;
149
+ // Apply transformation to even pages only when duplexing (deprecated,
150
+ // instead use EVEN_PAGES and specify appropriate duplex types).
151
+ ONLY_DUPLEXED_EVEN_PAGES = 1;
152
+ // Apply transformation to odd pages only when duplexing (deprecated,
153
+ // instead use ODD_PAGES and specify appropriate duplex types).
154
+ ONLY_DUPLEXED_ODD_PAGES = 2;
155
+ // Apply transformation to even pages.
156
+ EVEN_PAGES = 3;
157
+ // Apply transformation to odd pages.
158
+ ODD_PAGES = 4;
159
+ }
160
+ // Required.
161
+ optional Operation operation = 1;
162
+ // Required.
163
+ optional Operand operand = 2;
164
+ // Duplex types that the transformation applies to. Leave empty if the
165
+ // transformation is applicable to all duplex types.
166
+ repeated Duplex.Type duplex_type = 3;
167
+ }
168
+
169
+ // [Deprecated and only partially supported. Please use the other fields of
170
+ // PwgRasterConfig.
171
+ // Out of all possible transformations GCP will only support rotating all
172
+ // pages, but for that we strongly recommend using the rotate_all_pages
173
+ // boolean field instead.]
174
+ // What transformations to apply to pages in the print job.
175
+ repeated Transformation transformation = 1;
176
+ }