blob: 880ffcd9aa56f35ce7efbd16ff4688f49330bf4b [file] [log] [blame]
license.botf003cfe2008-08-24 09:55:55 +09001// 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.commit3f4a7322008-07-27 06:49:38 +09004
5#include "base/gfx/point.h"
6
avi@google.com82277242008-08-07 05:38:29 +09007#if defined(OS_WIN)
initial.commit3f4a7322008-07-27 06:49:38 +09008#include <windows.h>
avi@google.com82277242008-08-07 05:38:29 +09009#endif
initial.commit3f4a7322008-07-27 06:49:38 +090010
11namespace gfx {
12
13Point::Point() : x_(0), y_(0) {
14}
15
16Point::Point(int x, int y) : x_(x), y_(y) {
17}
18
avi@google.com82277242008-08-07 05:38:29 +090019#if defined(OS_WIN)
initial.commit3f4a7322008-07-27 06:49:38 +090020Point::Point(const POINT& point) : x_(point.x), y_(point.y) {
21}
22
23POINT Point::ToPOINT() const {
24 POINT p;
25 p.x = x_;
26 p.y = y_;
27 return p;
28}
avi@google.com82277242008-08-07 05:38:29 +090029#elif defined(OS_MACOSX)
30Point::Point(const CGPoint& point) : x_(point.x), y_(point.y) {
31}
32
33CGPoint Point::ToCGPoint() const {
34 return CGPointMake(x_, y_);
35}
36#endif
initial.commit3f4a7322008-07-27 06:49:38 +090037
38} // namespace gfx
license.botf003cfe2008-08-24 09:55:55 +090039