diff options
author | maruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-20 17:55:55 +0000 |
---|---|---|
committer | maruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-20 17:55:55 +0000 |
commit | 4ae30d08d2df7fdb8b236b6c650a1a29a84ee562 (patch) | |
tree | 97a77e2c9bbab02533378c88aa3311cd2353562b /printing/units.h | |
parent | de4024067816c20a69189c1e0d7728aa2cf16d66 (diff) | |
download | chromium_src-4ae30d08d2df7fdb8b236b6c650a1a29a84ee562.zip chromium_src-4ae30d08d2df7fdb8b236b6c650a1a29a84ee562.tar.gz chromium_src-4ae30d08d2df7fdb8b236b6c650a1a29a84ee562.tar.bz2 |
Move units to new module printing. Add printing_unittests on Windows too. Make test_shell and chrome_dll dependent on printing.
Review URL: http://codereview.chromium.org/21475
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10105 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'printing/units.h')
-rw-r--r-- | printing/units.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/printing/units.h b/printing/units.h new file mode 100644 index 0000000..d23e268 --- /dev/null +++ b/printing/units.h @@ -0,0 +1,27 @@ +// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef PRINTING_UNITS_H_ +#define PRINTING_UNITS_H_ + +namespace printing { + +// Length of a thousanth of inches in 0.01mm unit. +const int kHundrethsMMPerInch = 2540; + +// Converts from one unit system to another using integer arithmetics. +int ConvertUnit(int value, int old_unit, int new_unit); + +// Converts from one unit system to another using doubles. +double ConvertUnitDouble(double value, double old_unit, double new_unit); + +// Converts from 0.001 inch unit to 0.00001 meter. +int ConvertMilliInchToHundredThousanthMeter(int milli_inch); + +// Converts from 0.00001 meter unit to 0.001 inch. +int ConvertHundredThousanthMeterToMilliInch(int cmm); + +} // namespace printing + +#endif // PRINTING_UNITS_H_ |