OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved. |
3 * Copyright (C) 2005 Nokia. All rights reserved. | 3 * Copyright (C) 2005 Nokia. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 18 matching lines...) Expand all Loading... |
29 | 29 |
30 #include "FloatSize.h" | 30 #include "FloatSize.h" |
31 #include "IntPoint.h" | 31 #include "IntPoint.h" |
32 #include <wtf/MathExtras.h> | 32 #include <wtf/MathExtras.h> |
33 #include <wtf/Platform.h> | 33 #include <wtf/Platform.h> |
34 | 34 |
35 #if PLATFORM(CG) | 35 #if PLATFORM(CG) |
36 typedef struct CGPoint CGPoint; | 36 typedef struct CGPoint CGPoint; |
37 #endif | 37 #endif |
38 | 38 |
39 #if PLATFORM(MAC) | 39 #if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && PLATFORM(DARWIN)) |
40 #ifdef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES | 40 #ifdef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES |
41 typedef struct CGPoint NSPoint; | 41 typedef struct CGPoint NSPoint; |
42 #else | 42 #else |
43 typedef struct _NSPoint NSPoint; | 43 typedef struct _NSPoint NSPoint; |
44 #endif | 44 #endif |
45 #endif | 45 #endif |
46 | 46 |
47 #if PLATFORM(QT) | 47 #if PLATFORM(QT) |
48 #include "qglobal.h" | 48 #include "qglobal.h" |
49 QT_BEGIN_NAMESPACE | 49 QT_BEGIN_NAMESPACE |
(...skipping 27 matching lines...) Expand all Loading... |
77 | 77 |
78 void setX(float x) { m_x = x; } | 78 void setX(float x) { m_x = x; } |
79 void setY(float y) { m_y = y; } | 79 void setY(float y) { m_y = y; } |
80 void move(float dx, float dy) { m_x += dx; m_y += dy; } | 80 void move(float dx, float dy) { m_x += dx; m_y += dy; } |
81 | 81 |
82 #if PLATFORM(CG) | 82 #if PLATFORM(CG) |
83 FloatPoint(const CGPoint&); | 83 FloatPoint(const CGPoint&); |
84 operator CGPoint() const; | 84 operator CGPoint() const; |
85 #endif | 85 #endif |
86 | 86 |
87 #if PLATFORM(MAC) && !defined(NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES) | 87 #if (PLATFORM(MAC) && !defined(NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES)) \ |
| 88 || (PLATFORM(CHROMIUM) && PLATFORM(DARWIN)) |
88 FloatPoint(const NSPoint&); | 89 FloatPoint(const NSPoint&); |
89 operator NSPoint() const; | 90 operator NSPoint() const; |
90 #endif | 91 #endif |
91 | 92 |
92 #if PLATFORM(QT) | 93 #if PLATFORM(QT) |
93 FloatPoint(const QPointF&); | 94 FloatPoint(const QPointF&); |
94 operator QPointF() const; | 95 operator QPointF() const; |
95 #endif | 96 #endif |
96 | 97 |
97 #if PLATFORM(HAIKU) | 98 #if PLATFORM(HAIKU) |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 } | 150 } |
150 | 151 |
151 inline IntPoint roundedIntPoint(const FloatPoint& p) | 152 inline IntPoint roundedIntPoint(const FloatPoint& p) |
152 { | 153 { |
153 return IntPoint(static_cast<int>(roundf(p.x())), static_cast<int>(roundf(p.y
()))); | 154 return IntPoint(static_cast<int>(roundf(p.x())), static_cast<int>(roundf(p.y
()))); |
154 } | 155 } |
155 | 156 |
156 } | 157 } |
157 | 158 |
158 #endif | 159 #endif |
OLD | NEW |