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

Side by Side Diff: ui/gfx/point.h

Issue 8044015: ui/gfx: Add ToString() function to Point class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 2 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 | « no previous file | ui/gfx/point.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) 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_POINT_H_ 5 #ifndef UI_GFX_POINT_H_
6 #define UI_GFX_POINT_H_ 6 #define UI_GFX_POINT_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string>
10
9 #include "build/build_config.h" 11 #include "build/build_config.h"
10
11 #include <iosfwd>
12
13 #include "ui/base/ui_export.h" 12 #include "ui/base/ui_export.h"
14 13
15 #if defined(OS_WIN) 14 #if defined(OS_WIN)
16 typedef unsigned long DWORD; 15 typedef unsigned long DWORD;
17 typedef struct tagPOINT POINT; 16 typedef struct tagPOINT POINT;
18 #elif defined(OS_MACOSX) 17 #elif defined(OS_MACOSX)
19 #include <ApplicationServices/ApplicationServices.h> 18 #include <ApplicationServices/ApplicationServices.h>
20 #endif 19 #endif
21 20
22 namespace gfx { 21 namespace gfx {
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 bool operator<(const Point& rhs) const { 83 bool operator<(const Point& rhs) const {
85 return (y_ == rhs.y_) ? (x_ < rhs.x_) : (y_ < rhs.y_); 84 return (y_ == rhs.y_) ? (x_ < rhs.x_) : (y_ < rhs.y_);
86 } 85 }
87 86
88 #if defined(OS_WIN) 87 #if defined(OS_WIN)
89 POINT ToPOINT() const; 88 POINT ToPOINT() const;
90 #elif defined(OS_MACOSX) 89 #elif defined(OS_MACOSX)
91 CGPoint ToCGPoint() const; 90 CGPoint ToCGPoint() const;
92 #endif 91 #endif
93 92
93 // Returns a string representation of point.
94 std::string ToString() const;
95
94 private: 96 private:
95 int x_; 97 int x_;
96 int y_; 98 int y_;
97 }; 99 };
98 100
99 UI_EXPORT std::ostream& operator<<(std::ostream& out, const gfx::Point& p);
100
101 } // namespace gfx 101 } // namespace gfx
102 102
103 #endif // UI_GFX_POINT_H_ 103 #endif // UI_GFX_POINT_H_
OLDNEW
« no previous file with comments | « no previous file | ui/gfx/point.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698