[SyncFS] Build indexes from FileTracker entries on disk.
[chromium-blink-merge.git] / ui / gfx / geometry / insets.h
blob00b612540dd5e98d4bb5618a5bf1cbb11761008d
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
3 // found in the LICENSE file.
5 #ifndef UI_GFX_GEOMETRY_INSETS_H_
6 #define UI_GFX_GEOMETRY_INSETS_H_
8 #include <string>
10 #include "build/build_config.h"
11 #include "ui/gfx/geometry/insets_base.h"
12 #include "ui/gfx/geometry/insets_f.h"
13 #include "ui/gfx/gfx_export.h"
15 namespace gfx {
17 // An integer version of gfx::Insets.
18 class GFX_EXPORT Insets : public InsetsBase<Insets, int> {
19 public:
20 Insets();
21 Insets(int top, int left, int bottom, int right);
23 ~Insets();
25 Insets Scale(float scale) const {
26 return Scale(scale, scale);
29 Insets Scale(float x_scale, float y_scale) const {
30 return Insets(static_cast<int>(top() * y_scale),
31 static_cast<int>(left() * x_scale),
32 static_cast<int>(bottom() * y_scale),
33 static_cast<int>(right() * x_scale));
36 operator InsetsF() const {
37 return InsetsF(top(), left(), bottom(), right());
40 // Returns a string representation of the insets.
41 std::string ToString() const;
44 #if !defined(COMPILER_MSVC)
45 extern template class InsetsBase<Insets, int>;
46 #endif
48 } // namespace gfx
50 #endif // UI_GFX_GEOMETRY_INSETS_H_