Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(221)

Side by Side Diff: app/gfx/insets.h

Issue 497004: Add gfx::Insets::ToString(). (Closed)
Patch Set: fix a line break Created 11 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « app/app_base.gypi ('k') | app/gfx/insets.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 APP_GFX_INSETS_H_ 5 #ifndef APP_GFX_INSETS_H_
6 #define APP_GFX_INSETS_H_ 6 #define APP_GFX_INSETS_H_
7 7
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 9
10 #if defined(OS_LINUX) 10 #if defined(OS_LINUX)
11 #include <gtk/gtkstyle.h> 11 #include <gtk/gtkstyle.h>
12 #endif 12 #endif
13 13
14 #include <string>
15
14 namespace gfx { 16 namespace gfx {
15 17
16 // 18 //
17 // An insets represents the borders of a container (the space the container must 19 // An insets represents the borders of a container (the space the container must
18 // leave at each of its edges). 20 // leave at each of its edges).
19 // 21 //
20 22
21 class Insets { 23 class Insets {
22 public: 24 public:
23 Insets() : top_(0), left_(0), bottom_(0), right_(0) {} 25 Insets() : top_(0), left_(0), bottom_(0), right_(0) {}
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 } 71 }
70 72
71 Insets& operator+=(const Insets& insets) { 73 Insets& operator+=(const Insets& insets) {
72 top_ += insets.top_; 74 top_ += insets.top_;
73 left_ += insets.left_; 75 left_ += insets.left_;
74 bottom_ += insets.bottom_; 76 bottom_ += insets.bottom_;
75 right_ += insets.right_; 77 right_ += insets.right_;
76 return *this; 78 return *this;
77 } 79 }
78 80
81 // Returns a string representation of the insets.
82 std::string ToString() const;
83
79 private: 84 private:
80 int top_; 85 int top_;
81 int left_; 86 int left_;
82 int bottom_; 87 int bottom_;
83 int right_; 88 int right_;
84 }; 89 };
85 90
86 } // namespace 91 } // namespace gfx
87 92
88 #endif // APP_GFX_INSETS_H_ 93 #endif // APP_GFX_INSETS_H_
OLDNEW
« no previous file with comments | « app/app_base.gypi ('k') | app/gfx/insets.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698