OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #include "printing/backend/cups_ipp_util.h" | 5 #include "printing/backend/cups_ipp_util.h" |
6 | 6 |
7 #include <cups/cups.h> | 7 #include <cups/cups.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <string> | 10 #include <string> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/logging.h" | 13 #include "base/logging.h" |
14 #include "base/stl_util.h" | 14 #include "base/stl_util.h" |
15 #include "base/strings/string_number_conversions.h" | 15 #include "base/strings/string_number_conversions.h" |
16 #include "base/strings/string_piece.h" | 16 #include "base/strings/string_piece.h" |
17 #include "base/strings/string_split.h" | 17 #include "base/strings/string_split.h" |
18 #include "base/strings/string_util.h" | 18 #include "base/strings/string_util.h" |
19 #include "printing/backend/cups_printer.h" | 19 #include "printing/backend/cups_printer.h" |
20 #include "printing/backend/print_backend_consts.h" | 20 #include "printing/backend/print_backend_consts.h" |
21 #include "printing/units.h" | 21 #include "printing/units.h" |
22 | 22 |
23 namespace printing { | 23 namespace printing { |
24 | 24 |
25 namespace { | 25 // property names |
26 | |
27 const char kIppCollate[] = "sheet-collate"; // RFC 3381 | 26 const char kIppCollate[] = "sheet-collate"; // RFC 3381 |
28 const char kIppCopies[] = CUPS_COPIES; | 27 const char kIppCopies[] = CUPS_COPIES; |
29 const char kIppColor[] = CUPS_PRINT_COLOR_MODE; | 28 const char kIppColor[] = CUPS_PRINT_COLOR_MODE; |
30 const char kIppMedia[] = CUPS_MEDIA; | 29 const char kIppMedia[] = CUPS_MEDIA; |
31 const char kIppDuplex[] = CUPS_SIDES; | 30 const char kIppDuplex[] = CUPS_SIDES; |
32 | 31 |
33 const char kCollated[] = "collated"; | 32 const char kCollated[] = "collated"; |
| 33 const char kUncollated[] = "uncollated"; |
| 34 |
| 35 namespace { |
34 | 36 |
35 const int kMicronsPerMM = 1000; | 37 const int kMicronsPerMM = 1000; |
36 const double kMMPerInch = 25.4; | 38 const double kMMPerInch = 25.4; |
37 const double kMicronsPerInch = kMMPerInch * kMicronsPerMM; | 39 const double kMicronsPerInch = kMMPerInch * kMicronsPerMM; |
38 | 40 |
39 enum Unit { | 41 enum Unit { |
40 INCHES, | 42 INCHES, |
41 MILLIMETERS, | 43 MILLIMETERS, |
42 }; | 44 }; |
43 | 45 |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 printer_info->default_paper = DefaultPaper(printer); | 291 printer_info->default_paper = DefaultPaper(printer); |
290 printer_info->papers = SupportedPapers(printer); | 292 printer_info->papers = SupportedPapers(printer); |
291 | 293 |
292 ExtractCopies(printer, printer_info); | 294 ExtractCopies(printer, printer_info); |
293 ExtractColor(printer, printer_info); | 295 ExtractColor(printer, printer_info); |
294 | 296 |
295 // TODO(skau): Add dpi and default_dpi | 297 // TODO(skau): Add dpi and default_dpi |
296 } | 298 } |
297 | 299 |
298 } // namespace printing | 300 } // namespace printing |
OLD | NEW |