Changeset 116767 in webkit
- Timestamp:
- May 11, 2012 7:11:26 AM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r116766 r116767 1 2012-05-11 Allan Sandfeld Jensen <allan.jensen@nokia.com> 2 3 Qt support for new layout types. 4 https://bugs.webkit.org/show_bug.cgi?id=85607 5 6 Reviewed by Simon Hausmann. 7 8 Adds similar Qt support to FractionalLayout classes as Qt has for 9 FloatSomething and IntSomething classes. This means Qt code can stay 10 unchanged from after the redefinition of Layout classes. 11 12 No new functionality. No new tests. 13 14 * Target.pri: 15 * platform/FractionalLayoutUnit.h: 16 (WebCore::operator<<): 17 (WebCore::operator>>): 18 * platform/graphics/FractionalLayoutPoint.h: 19 (FractionalLayoutPoint): 20 * platform/graphics/FractionalLayoutRect.h: 21 (FractionalLayoutRect): 22 * platform/graphics/FractionalLayoutSize.h: 23 (FractionalLayoutSize): 24 * platform/graphics/qt/FractionalLayoutPointQt.cpp: Added. 25 (WebCore::FractionalLayoutPoint::FractionalLayoutPoint): 26 (WebCore::FractionalLayoutPoint::operator QPointF): 27 * platform/graphics/qt/FractionalLayoutRectQt.cpp: Added. 28 (WebCore::FractionalLayoutRect::FractionalLayoutRect): 29 (WebCore::FractionalLayoutRect::operator QRectF): 30 * platform/graphics/qt/FractionalLayoutSizeQt.cpp: Added. 31 (WebCore::FractionalLayoutSize::FractionalLayoutSize): 32 (WebCore::FractionalLayoutSize::operator QSizeF): 33 1 34 2012-05-11 Allan Sandfeld Jensen <allan.jensen@nokia.com> 2 35 -
trunk/Source/WebCore/Target.pri
r116690 r116767 2857 2857 platform/graphics/qt/FloatPointQt.cpp \ 2858 2858 platform/graphics/qt/FloatRectQt.cpp \ 2859 platform/graphics/qt/FractionalLayoutPointQt.cpp \ 2860 platform/graphics/qt/FractionalLayoutRectQt.cpp \ 2861 platform/graphics/qt/FractionalLayoutSizeQt.cpp \ 2859 2862 platform/graphics/qt/GradientQt.cpp \ 2860 2863 platform/graphics/qt/GraphicsContextQt.cpp \ -
trunk/Source/WebCore/platform/FractionalLayoutUnit.h
r116549 r116767 37 37 #include <stdlib.h> 38 38 39 #if PLATFORM(QT) 40 #include <QDataStream> 41 #endif 42 39 43 namespace WebCore { 40 44 … … 591 595 } 592 596 597 #if PLATFORM(QT) 598 inline QDataStream& operator<<(QDataStream& stream, const FractionalLayoutUnit& value) 599 { 600 if (kFixedPointDenominator == 1) 601 stream << value.rawValue(); 602 else 603 stream << QString::fromLatin1("%1").arg(value.toFloat(), 0, 'f', 2); 604 605 return stream; 606 } 607 608 inline QDataStream& operator>>(QDataStream& stream, FractionalLayoutUnit& value) 609 { 610 float v; 611 stream >> v; 612 value = v; 613 return stream; 614 } 615 #endif 616 593 617 } // namespace WebCore 594 618 -
trunk/Source/WebCore/platform/graphics/FractionalLayoutPoint.h
r114470 r116767 35 35 #include "FractionalLayoutSize.h" 36 36 #include <wtf/MathExtras.h> 37 38 #if PLATFORM(QT) 39 #include <qglobal.h> 40 QT_BEGIN_NAMESPACE 41 class QPoint; 42 class QPointF; 43 QT_END_NAMESPACE 44 #endif 37 45 38 46 namespace WebCore { … … 82 90 return FractionalLayoutPoint(m_y, m_x); 83 91 } 92 93 #if PLATFORM(QT) 94 explicit FractionalLayoutPoint(const QPoint&); 95 explicit FractionalLayoutPoint(const QPointF&); 96 operator QPointF() const; 97 #endif 84 98 85 99 private: … … 159 173 } 160 174 161 162 175 } // namespace WebCore 163 176 -
trunk/Source/WebCore/platform/graphics/FractionalLayoutRect.h
r116549 r116767 36 36 #include <wtf/Vector.h> 37 37 38 #if PLATFORM(QT) 39 #include <qglobal.h> 40 QT_BEGIN_NAMESPACE 41 class QRect; 42 class QRectF; 43 QT_END_NAMESPACE 44 #endif 45 38 46 namespace WebCore { 39 47 … … 154 162 static FractionalLayoutRect infiniteRect() {return FractionalLayoutRect(FractionalLayoutUnit::min() / 2, FractionalLayoutUnit::min() / 2, FractionalLayoutUnit::max(), FractionalLayoutUnit::max()); } 155 163 164 #if PLATFORM(QT) 165 explicit FractionalLayoutRect(const QRect&); 166 explicit FractionalLayoutRect(const QRectF&); 167 operator QRectF() const; 168 #endif 169 156 170 private: 157 171 FractionalLayoutPoint m_location; -
trunk/Source/WebCore/platform/graphics/FractionalLayoutSize.h
r116549 r116767 35 35 #include "FractionalLayoutUnit.h" 36 36 #include "IntSize.h" 37 38 #if PLATFORM(QT) 39 #include <qglobal.h> 40 QT_BEGIN_NAMESPACE 41 class QSize; 42 class QSizeF; 43 QT_END_NAMESPACE 44 #endif 37 45 38 46 namespace WebCore { … … 93 101 } 94 102 103 #if PLATFORM(QT) 104 explicit FractionalLayoutSize(const QSize&); 105 explicit FractionalLayoutSize(const QSizeF&); 106 operator QSizeF() const; 107 #endif 108 95 109 private: 96 110 FractionalLayoutUnit m_width, m_height;
Note: See TracChangeset
for help on using the changeset viewer.