[webkit-changes] cvs commit: WebCore/kwq KWQPoint.mm
KWQPointArray.h KWQRect.h KWQRect.mm KWQSize.h KWQSize.mm
Timothy
thatcher at opensource.apple.com
Thu Sep 29 21:04:58 PDT 2005
thatcher 05/09/29 21:04:58
Modified: . ChangeLog
kwq KWQPoint.mm KWQPointArray.h KWQRect.h KWQRect.mm
KWQSize.h KWQSize.mm
Log:
Fixes build failures on a future release train.
Reviewed by Maciej.
Test cases added: (None needed.)
* kwq/KWQPointArray.h: check if NSPoint is the same as CGPoint
* kwq/KWQPoint.mm: ditto
* kwq/KWQRect.h: check if NSRect is the same as CGRect
* kwq/KWQRect.mm: ditto
* kwq/KWQSize.h: check if NSSize is the same as CGSize
* kwq/KWQSize.mm: ditto
Revision Changes Path
1.177 +15 -0 WebCore/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /cvs/root/WebCore/ChangeLog,v
retrieving revision 1.176
retrieving revision 1.177
diff -u -r1.176 -r1.177
--- ChangeLog 30 Sep 2005 00:03:16 -0000 1.176
+++ ChangeLog 30 Sep 2005 04:04:54 -0000 1.177
@@ -1,3 +1,18 @@
+2005-09-29 Timothy Hatcher <timothy at apple.com>
+
+ Fixes build failures on a future release train.
+
+ Reviewed by Maciej.
+
+ Test cases added: (None needed.)
+
+ * kwq/KWQPointArray.h: check if NSPoint is the same as CGPoint
+ * kwq/KWQPoint.mm: ditto
+ * kwq/KWQRect.h: check if NSRect is the same as CGRect
+ * kwq/KWQRect.mm: ditto
+ * kwq/KWQSize.h: check if NSSize is the same as CGSize
+ * kwq/KWQSize.mm: ditto
+
2005-09-29 David Hyatt <hyatt at apple.com>
Add support for parsing of the CSS3 box-sizing property. This
1.11 +8 -0 WebCore/kwq/KWQPoint.mm
Index: KWQPoint.mm
===================================================================
RCS file: /cvs/root/WebCore/kwq/KWQPoint.mm,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- KWQPoint.mm 7 Jul 2005 06:25:02 -0000 1.10
+++ KWQPoint.mm 30 Sep 2005 04:04:57 -0000 1.11
@@ -33,14 +33,22 @@
{
}
+#ifndef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
QPoint::QPoint(const NSPoint &p) : xCoord((int)p.x), yCoord((int)p.y)
{
}
+#endif
+QPoint::QPoint(const CGPoint &p) : xCoord((int)p.x), yCoord((int)p.y)
+{
+}
+
+#ifndef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
QPoint::operator NSPoint() const
{
return NSMakePoint(xCoord, yCoord);
}
+#endif
QPoint::operator CGPoint() const
{
1.28 +10 -1 WebCore/kwq/KWQPointArray.h
Index: KWQPointArray.h
===================================================================
RCS file: /cvs/root/WebCore/kwq/KWQPointArray.h,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -r1.27 -r1.28
--- KWQPointArray.h 7 Jul 2005 06:25:02 -0000 1.27
+++ KWQPointArray.h 30 Sep 2005 04:04:57 -0000 1.28
@@ -34,7 +34,11 @@
#include "KWQMemArray.h"
+#ifdef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
+typedef struct CGPoint NSPoint;
+#else
typedef struct _NSPoint NSPoint;
+#endif
typedef struct CGPoint CGPoint;
class QRect;
@@ -43,8 +47,11 @@
public:
QPoint();
QPoint(int, int);
+#ifndef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
explicit QPoint(const NSPoint &); // don't do this implicitly since it's lossy
-
+#endif
+ explicit QPoint(const CGPoint &); // don't do this implicitly since it's lossy
+
int x() const { return xCoord; }
int y() const { return yCoord; }
@@ -58,7 +65,9 @@
friend QPoint operator+(const QPoint &, const QPoint &);
friend QPoint operator-(const QPoint &, const QPoint &);
+#ifndef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
operator NSPoint() const;
+#endif
operator CGPoint() const;
private:
1.33 +8 -0 WebCore/kwq/KWQRect.h
Index: KWQRect.h
===================================================================
RCS file: /cvs/root/WebCore/kwq/KWQRect.h,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -r1.32 -r1.33
--- KWQRect.h 24 Jun 2005 18:57:22 -0000 1.32
+++ KWQRect.h 30 Sep 2005 04:04:57 -0000 1.33
@@ -29,7 +29,11 @@
#include "KWQSize.h"
#include "KWQPointArray.h"
+#ifdef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
+typedef struct CGRect NSRect;
+#else
typedef struct _NSRect NSRect;
+#endif
typedef struct CGRect CGRect;
class QRect {
@@ -38,7 +42,9 @@
QRect(QPoint p, QSize s);
QRect(int, int, int, int);
QRect(const QPoint &, const QPoint &);
+#ifndef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
explicit QRect(const NSRect &); // don't do this implicitly since it's lossy
+#endif
explicit QRect(const CGRect &); // don't do this implicitly since it's lossy
bool isNull() const;
@@ -84,7 +90,9 @@
inline QRect operator&(const QRect &r) const { return intersect(r); }
+#ifndef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
operator NSRect() const;
+#endif
operator CGRect() const;
#ifdef _KWQ_IOSTREAM_
1.16 +4 -0 WebCore/kwq/KWQRect.mm
Index: KWQRect.mm
===================================================================
RCS file: /cvs/root/WebCore/kwq/KWQRect.mm,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- KWQRect.mm 24 Jun 2005 18:57:22 -0000 1.15
+++ KWQRect.mm 30 Sep 2005 04:04:57 -0000 1.16
@@ -50,9 +50,11 @@
h = bottomRight.y() - topLeft.y() + 1;
}
+#ifndef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
QRect::QRect(const NSRect &r) : xp((int)r.origin.x), yp((int)r.origin.y), w((int)r.size.width), h((int)r.size.height)
{
}
+#endif
QRect::QRect(const CGRect &r) : xp((int)r.origin.x), yp((int)r.origin.y), w((int)r.size.width), h((int)r.size.height)
{
@@ -184,10 +186,12 @@
h += 2*s;
}
+#ifndef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
QRect::operator NSRect() const
{
return NSMakeRect(xp, yp, w, h);
}
+#endif
QRect::operator CGRect() const
{
1.21 +9 -0 WebCore/kwq/KWQSize.h
Index: KWQSize.h
===================================================================
RCS file: /cvs/root/WebCore/kwq/KWQSize.h,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- KWQSize.h 1 Jul 2005 10:03:04 -0000 1.20
+++ KWQSize.h 30 Sep 2005 04:04:57 -0000 1.21
@@ -32,14 +32,21 @@
#include <iosfwd>
#endif
+#ifdef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
+typedef struct CGSize NSSize;
+#else
typedef struct _NSSize NSSize;
+#endif
typedef struct CGSize CGSize;
class QSize {
public:
QSize();
QSize(int,int);
+#ifndef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
explicit QSize(const NSSize &);
+#endif
+ explicit QSize(const CGSize &);
bool isValid() const;
int width() const { return w; }
@@ -48,7 +55,9 @@
void setHeight(int height) { h = height; }
QSize expandedTo(const QSize &) const;
+#ifndef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
operator NSSize() const;
+#endif
operator CGSize() const;
friend QSize operator+(const QSize &, const QSize &);
1.10 +8 -0 WebCore/kwq/KWQSize.mm
Index: KWQSize.mm
===================================================================
RCS file: /cvs/root/WebCore/kwq/KWQSize.mm,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- KWQSize.mm 1 Jul 2005 10:03:04 -0000 1.9
+++ KWQSize.mm 30 Sep 2005 04:04:57 -0000 1.10
@@ -33,9 +33,15 @@
{
}
+#ifndef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
QSize::QSize(const NSSize &s) : w((int)s.width), h((int)s.height)
{
}
+#endif
+
+QSize::QSize(const CGSize &s) : w((int)s.width), h((int)s.height)
+{
+}
bool QSize::isValid() const
{
@@ -47,10 +53,12 @@
return QSize(w > o.w ? w : o.w, h > o.h ? h : o.h);
}
+#ifndef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
QSize::operator NSSize() const
{
return NSMakeSize(w, h);
}
+#endif
QSize::operator CGSize() const
{
More information about the webkit-changes
mailing list