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

Side by Side Diff: gfx/rect.h

Issue 3013015: Initial pass at integrating Differ into the chromoting host code.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 4 months 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 | Annotate | Revision Log
« no previous file with comments | « gfx/point.h ('k') | gfx/rect.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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 // Defines a simple integer rectangle class. The containment semantics 5 // Defines a simple integer rectangle class. The containment semantics
6 // are array-like; that is, the coordinate (x, y) is considered to be 6 // are array-like; that is, the coordinate (x, y) is considered to be
7 // contained by the rectangle, but the coordinate (x + width, y) is not. 7 // contained by the rectangle, but the coordinate (x + width, y) is not.
8 // The class will happily let you create malformed rectangles (that is, 8 // The class will happily let you create malformed rectangles (that is,
9 // rectangles with negative width and/or height), but there will be assertions 9 // rectangles with negative width and/or height), but there will be assertions
10 // in the operations (such as Contains()) to complain in this case. 10 // in the operations (such as Contains()) to complain in this case.
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 95
96 // Returns true if the area of the rectangle is zero. 96 // Returns true if the area of the rectangle is zero.
97 bool IsEmpty() const { return size_.IsEmpty(); } 97 bool IsEmpty() const { return size_.IsEmpty(); }
98 98
99 bool operator==(const Rect& other) const; 99 bool operator==(const Rect& other) const;
100 100
101 bool operator!=(const Rect& other) const { 101 bool operator!=(const Rect& other) const {
102 return !(*this == other); 102 return !(*this == other);
103 } 103 }
104 104
105 // A rect is less than another rect if its origin is less than
106 // the other rect's origin. If the origins are equal, then the
107 // shortest rect is less than the other. If the origin and the
108 // height are equal, then the narrowest rect is less than.
109 // This comparison is required to use Rects in sets, or sorted
110 // vectors.
111 bool operator<(const Rect& other) const;
112
105 #if defined(OS_WIN) 113 #if defined(OS_WIN)
106 // Construct an equivalent Win32 RECT object. 114 // Construct an equivalent Win32 RECT object.
107 RECT ToRECT() const; 115 RECT ToRECT() const;
108 #elif defined(USE_X11) 116 #elif defined(USE_X11)
109 GdkRectangle ToGdkRectangle() const; 117 GdkRectangle ToGdkRectangle() const;
110 #elif defined(OS_MACOSX) 118 #elif defined(OS_MACOSX)
111 // Construct an equivalent CoreGraphics object. 119 // Construct an equivalent CoreGraphics object.
112 CGRect ToCGRect() const; 120 CGRect ToCGRect() const;
113 #endif 121 #endif
114 122
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 private: 171 private:
164 gfx::Point origin_; 172 gfx::Point origin_;
165 gfx::Size size_; 173 gfx::Size size_;
166 }; 174 };
167 175
168 } // namespace gfx 176 } // namespace gfx
169 177
170 std::ostream& operator<<(std::ostream& out, const gfx::Rect& r); 178 std::ostream& operator<<(std::ostream& out, const gfx::Rect& r);
171 179
172 #endif // GFX_RECT_H_ 180 #endif // GFX_RECT_H_
OLDNEW
« no previous file with comments | « gfx/point.h ('k') | gfx/rect.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698