+2005-09-29 Timothy Hatcher <timothy@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@apple.com>
Add support for parsing of the CSS3 box-sizing property. This
{
}
+#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
{
#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;
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; }
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:
#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 {
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;
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_
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)
{
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
{
#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; }
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 &);
{
}
+#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
{
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
{