OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2003, 2006 Apple Computer, Inc. All rights reserved. | 2 * Copyright (C) 2003, 2006 Apple Computer, Inc. All rights reserved. |
3 * Copyright (C) 2005 Nokia. All rights reserved. | 3 * Copyright (C) 2005 Nokia. All rights reserved. |
4 * 2008 Eric Seidel <eric@webkit.org> | 4 * 2008 Eric Seidel <eric@webkit.org> |
5 * | 5 * |
6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
8 * are met: | 8 * are met: |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 16 matching lines...) Expand all Loading... |
27 | 27 |
28 #ifndef FloatSize_h | 28 #ifndef FloatSize_h |
29 #define FloatSize_h | 29 #define FloatSize_h |
30 | 30 |
31 #include <wtf/Platform.h> | 31 #include <wtf/Platform.h> |
32 | 32 |
33 #if PLATFORM(CG) | 33 #if PLATFORM(CG) |
34 typedef struct CGSize CGSize; | 34 typedef struct CGSize CGSize; |
35 #endif | 35 #endif |
36 | 36 |
37 #if PLATFORM(MAC) | 37 #if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && PLATFORM(DARWIN)) |
38 #ifdef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES | 38 #ifdef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES |
39 typedef struct CGSize NSSize; | 39 typedef struct CGSize NSSize; |
40 #else | 40 #else |
41 typedef struct _NSSize NSSize; | 41 typedef struct _NSSize NSSize; |
42 #endif | 42 #endif |
43 #endif | 43 #endif |
44 | 44 |
45 namespace WebCore { | 45 namespace WebCore { |
46 | 46 |
47 class IntSize; | 47 class IntSize; |
(...skipping 24 matching lines...) Expand all Loading... |
72 { | 72 { |
73 return FloatSize(m_width < other.m_width ? m_width : other.m_width, | 73 return FloatSize(m_width < other.m_width ? m_width : other.m_width, |
74 m_height < other.m_height ? m_height : other.m_height); | 74 m_height < other.m_height ? m_height : other.m_height); |
75 } | 75 } |
76 | 76 |
77 #if PLATFORM(CG) | 77 #if PLATFORM(CG) |
78 explicit FloatSize(const CGSize&); // don't do this implicitly since it's lo
ssy | 78 explicit FloatSize(const CGSize&); // don't do this implicitly since it's lo
ssy |
79 operator CGSize() const; | 79 operator CGSize() const; |
80 #endif | 80 #endif |
81 | 81 |
82 #if PLATFORM(MAC) && !defined(NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES) | 82 #if (PLATFORM(MAC) && !defined(NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES)) \ |
| 83 || (PLATFORM(CHROMIUM) && PLATFORM(DARWIN)) |
83 explicit FloatSize(const NSSize &); // don't do this implicitly since it's l
ossy | 84 explicit FloatSize(const NSSize &); // don't do this implicitly since it's l
ossy |
84 operator NSSize() const; | 85 operator NSSize() const; |
85 #endif | 86 #endif |
86 | 87 |
87 private: | 88 private: |
88 float m_width, m_height; | 89 float m_width, m_height; |
89 }; | 90 }; |
90 | 91 |
91 inline FloatSize& operator+=(FloatSize& a, const FloatSize& b) | 92 inline FloatSize& operator+=(FloatSize& a, const FloatSize& b) |
92 { | 93 { |
(...skipping 30 matching lines...) Expand all Loading... |
123 } | 124 } |
124 | 125 |
125 inline bool operator!=(const FloatSize& a, const FloatSize& b) | 126 inline bool operator!=(const FloatSize& a, const FloatSize& b) |
126 { | 127 { |
127 return a.width() != b.width() || a.height() != b.height(); | 128 return a.width() != b.width() || a.height() != b.height(); |
128 } | 129 } |
129 | 130 |
130 } // namespace WebCore | 131 } // namespace WebCore |
131 | 132 |
132 #endif // FloatSize_h | 133 #endif // FloatSize_h |
OLD | NEW |