| OLD | NEW |
| 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 UI_GFX_INSETS_H_ | 5 #ifndef UI_GFX_INSETS_H_ |
| 6 #define UI_GFX_INSETS_H_ | 6 #define UI_GFX_INSETS_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "build/build_config.h" | 11 #include "build/build_config.h" |
| 12 #include "ui/base/ui_export.h" | 12 #include "ui/base/ui_export.h" |
| 13 | 13 |
| 14 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 14 #if defined(TOOLKIT_USES_GTK) |
| 15 #include <gtk/gtkstyle.h> | 15 #include <gtk/gtkstyle.h> |
| 16 #endif | 16 #endif |
| 17 | 17 |
| 18 namespace gfx { | 18 namespace gfx { |
| 19 | 19 |
| 20 // | 20 // |
| 21 // An insets represents the borders of a container (the space the container must | 21 // An insets represents the borders of a container (the space the container must |
| 22 // leave at each of its edges). | 22 // leave at each of its edges). |
| 23 // | 23 // |
| 24 | 24 |
| 25 class UI_EXPORT Insets { | 25 class UI_EXPORT Insets { |
| 26 public: | 26 public: |
| 27 Insets() : top_(0), left_(0), bottom_(0), right_(0) {} | 27 Insets() : top_(0), left_(0), bottom_(0), right_(0) {} |
| 28 Insets(int top, int left, int bottom, int right) | 28 Insets(int top, int left, int bottom, int right) |
| 29 : top_(top), | 29 : top_(top), |
| 30 left_(left), | 30 left_(left), |
| 31 bottom_(bottom), | 31 bottom_(bottom), |
| 32 right_(right) {} | 32 right_(right) {} |
| 33 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 33 #if defined(TOOLKIT_USES_GTK) |
| 34 explicit Insets(const GtkBorder& border) | 34 explicit Insets(const GtkBorder& border) |
| 35 : top_(border.top), | 35 : top_(border.top), |
| 36 left_(border.left), | 36 left_(border.left), |
| 37 bottom_(border.bottom), | 37 bottom_(border.bottom), |
| 38 right_(border.right) {} | 38 right_(border.right) {} |
| 39 #endif | 39 #endif |
| 40 | 40 |
| 41 ~Insets() {} | 41 ~Insets() {} |
| 42 | 42 |
| 43 int top() const { return top_; } | 43 int top() const { return top_; } |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 private: | 86 private: |
| 87 int top_; | 87 int top_; |
| 88 int left_; | 88 int left_; |
| 89 int bottom_; | 89 int bottom_; |
| 90 int right_; | 90 int right_; |
| 91 }; | 91 }; |
| 92 | 92 |
| 93 } // namespace gfx | 93 } // namespace gfx |
| 94 | 94 |
| 95 #endif // UI_GFX_INSETS_H_ | 95 #endif // UI_GFX_INSETS_H_ |
| OLD | NEW |