license.bot | f003cfe | 2008-08-24 09:55:55 +0900 | [diff] [blame^] | 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 |
| 3 | // found in the LICENSE file. |
initial.commit | 3f4a732 | 2008-07-27 06:49:38 +0900 | [diff] [blame] | 4 | |
| 5 | #include "base/gfx/point.h" |
| 6 | |
avi@google.com | 8227724 | 2008-08-07 05:38:29 +0900 | [diff] [blame] | 7 | #if defined(OS_WIN) |
initial.commit | 3f4a732 | 2008-07-27 06:49:38 +0900 | [diff] [blame] | 8 | #include <windows.h> |
avi@google.com | 8227724 | 2008-08-07 05:38:29 +0900 | [diff] [blame] | 9 | #endif |
initial.commit | 3f4a732 | 2008-07-27 06:49:38 +0900 | [diff] [blame] | 10 | |
| 11 | namespace gfx { |
| 12 | |
| 13 | Point::Point() : x_(0), y_(0) { |
| 14 | } |
| 15 | |
| 16 | Point::Point(int x, int y) : x_(x), y_(y) { |
| 17 | } |
| 18 | |
avi@google.com | 8227724 | 2008-08-07 05:38:29 +0900 | [diff] [blame] | 19 | #if defined(OS_WIN) |
initial.commit | 3f4a732 | 2008-07-27 06:49:38 +0900 | [diff] [blame] | 20 | Point::Point(const POINT& point) : x_(point.x), y_(point.y) { |
| 21 | } |
| 22 | |
| 23 | POINT Point::ToPOINT() const { |
| 24 | POINT p; |
| 25 | p.x = x_; |
| 26 | p.y = y_; |
| 27 | return p; |
| 28 | } |
avi@google.com | 8227724 | 2008-08-07 05:38:29 +0900 | [diff] [blame] | 29 | #elif defined(OS_MACOSX) |
| 30 | Point::Point(const CGPoint& point) : x_(point.x), y_(point.y) { |
| 31 | } |
| 32 | |
| 33 | CGPoint Point::ToCGPoint() const { |
| 34 | return CGPointMake(x_, y_); |
| 35 | } |
| 36 | #endif |
initial.commit | 3f4a732 | 2008-07-27 06:49:38 +0900 | [diff] [blame] | 37 | |
| 38 | } // namespace gfx |
license.bot | f003cfe | 2008-08-24 09:55:55 +0900 | [diff] [blame^] | 39 | |