Changeset 69024 in webkit
- Timestamp:
- Oct 4, 2010 12:04:31 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 5 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r69022 r69024 1 2010-10-04 Diego Gonzalez <diegohcg@webkit.org> 2 3 Reviewed by Kenneth Rohde Christiansen. 4 5 [Qt] Hook up DeviceOrientation data for Qt support 6 https://bugs.webkit.org/show_bug.cgi?id=47052 7 8 Get DeviceOrientation necessary data via Qt mobility library 9 using a provider class. 10 11 * WebCore.pro: 12 1 13 2010-10-01 Victoria Kirst <vrk@google.com> 2 14 -
trunk/WebCore/WebCore.pro
r68996 r69024 3272 3272 ../WebKit/qt/WebCoreSupport/DeviceMotionClientQt.h \ 3273 3273 ../WebKit/qt/WebCoreSupport/DeviceOrientationClientQt.h \ 3274 ../WebKit/qt/WebCoreSupport/DeviceOrientationProviderQt.h \ 3274 3275 bindings/generic/RuntimeEnabledFeatures.h 3275 3276 SOURCES += \ 3276 3277 ../WebKit/qt/WebCoreSupport/DeviceMotionClientQt.cpp \ 3277 3278 ../WebKit/qt/WebCoreSupport/DeviceOrientationClientQt.cpp \ 3279 ../WebKit/qt/WebCoreSupport/DeviceOrientationProviderQt.cpp \ 3278 3280 bindings/generic/RuntimeEnabledFeatures.cpp 3281 3282 CONFIG += mobility 3283 MOBILITY += sensors 3279 3284 } 3280 3285 -
trunk/WebKit/qt/ChangeLog
r69009 r69024 1 2010-10-04 Diego Gonzalez <diegohcg@webkit.org> 2 3 Reviewed by Kenneth Rohde Christiansen. 4 5 [Qt] Hook up DeviceOrientation data for Qt support 6 https://bugs.webkit.org/show_bug.cgi?id=47052 7 8 Get DeviceOrientation necessary data via Qt mobility library 9 using a provider class. 10 11 * WebCoreSupport/DeviceOrientationClientQt.cpp: 12 (WebCore::DeviceOrientationClientQt::DeviceOrientationClientQt): 13 (WebCore::DeviceOrientationClientQt::~DeviceOrientationClientQt): 14 (WebCore::DeviceOrientationClientQt::startUpdating): 15 (WebCore::DeviceOrientationClientQt::stopUpdating): 16 (WebCore::DeviceOrientationClientQt::lastOrientation): 17 (WebCore::DeviceOrientationClientQt::changeDeviceOrientation): 18 * WebCoreSupport/DeviceOrientationClientQt.h: 19 * WebCoreSupport/DeviceOrientationProviderQt.cpp: Added. 20 (WebCore::DeviceOrientationProviderQt::DeviceOrientationProviderQt): 21 (WebCore::DeviceOrientationProviderQt::~DeviceOrientationProviderQt): 22 (WebCore::DeviceOrientationProviderQt::start): 23 (WebCore::DeviceOrientationProviderQt::stop): 24 (WebCore::DeviceOrientationProviderQt::filter): 25 * WebCoreSupport/DeviceOrientationProviderQt.h: Added. 26 (WebCore::DeviceOrientationProviderQt::isActive): 27 (WebCore::DeviceOrientationProviderQt::orientation): 28 (WebCore::DeviceOrientationProviderQt::hasAlpha): 29 1 30 2010-09-28 Luiz Agostini <luiz.agostini@openbossa.org> 2 31 -
trunk/WebKit/qt/WebCoreSupport/DeviceOrientationClientQt.cpp
r68978 r69024 21 21 #include "DeviceOrientationClientQt.h" 22 22 23 #include "DeviceOrientationController.h" 24 #include "DeviceOrientationProviderQt.h" 23 25 #include "qwebpage.h" 24 26 … … 28 30 : m_page(page) 29 31 , m_controller(0) 32 , m_provider(new DeviceOrientationProviderQt()) 30 33 { 34 connect(m_provider, SIGNAL(deviceOrientationChanged(DeviceOrientation*)), SLOT(changeDeviceOrientation(DeviceOrientation*))); 35 } 36 37 DeviceOrientationClientQt::~DeviceOrientationClientQt() 38 { 39 disconnect(); 40 delete m_provider; 31 41 } 32 42 … … 38 48 void DeviceOrientationClientQt::startUpdating() 39 49 { 40 // call start method from a orientation provider.50 m_provider->start(); 41 51 } 42 52 43 53 void DeviceOrientationClientQt::stopUpdating() 44 54 { 45 // call stop method from a orientation provider.55 m_provider->stop(); 46 56 } 47 57 48 58 DeviceOrientation* DeviceOrientationClientQt::lastOrientation() const 49 59 { 50 return 0;60 return m_provider->orientation(); 51 61 } 52 62 … … 56 66 } 57 67 68 void DeviceOrientationClientQt::changeDeviceOrientation(DeviceOrientation* orientation) 69 { 70 if (!m_controller) 71 return; 72 73 m_controller->didChangeDeviceOrientation(orientation); 74 } 75 58 76 } // namespace WebCore 59 77 -
trunk/WebKit/qt/WebCoreSupport/DeviceOrientationClientQt.h
r68978 r69024 30 30 namespace WebCore { 31 31 32 class DeviceOrientationProviderQt; 33 32 34 class DeviceOrientationClientQt : public QObject, public DeviceOrientationClient { 33 35 Q_OBJECT 34 36 public: 35 37 DeviceOrientationClientQt(QWebPage*); 36 virtual ~DeviceOrientationClientQt() {}38 virtual ~DeviceOrientationClientQt(); 37 39 38 40 virtual void setController(DeviceOrientationController*); … … 42 44 virtual void deviceOrientationControllerDestroyed(); 43 45 46 public Q_SLOTS: 47 void changeDeviceOrientation(DeviceOrientation*); 48 44 49 private: 45 50 QWebPage* m_page; 46 51 DeviceOrientationController* m_controller; 52 DeviceOrientationProviderQt* m_provider; 47 53 }; 48 54 -
trunk/WebKit/qt/WebCoreSupport/DeviceOrientationProviderQt.h
r69023 r69024 18 18 * 19 19 */ 20 #ifndef DeviceOrientation ClientQt_h21 #define DeviceOrientation ClientQt_h20 #ifndef DeviceOrientationProviderQt_h 21 #define DeviceOrientationProviderQt_h 22 22 23 23 #include "DeviceOrientation.h" 24 #include " DeviceOrientationClient.h"24 #include "RefPtr.h" 25 25 26 26 #include <QObject> 27 #include <QRotationFilter> 27 28 28 class QWebPage; 29 QTM_USE_NAMESPACE 29 30 30 31 namespace WebCore { 31 32 32 class DeviceOrientationClientQt : public QObject, public DeviceOrientationClient { 33 class DeviceOrientationClientQt; 34 35 class DeviceOrientationProviderQt : public QObject, public QRotationFilter { 33 36 Q_OBJECT 34 37 public: 35 DeviceOrientation ClientQt(QWebPage*);36 virtual ~DeviceOrientationClientQt() {}38 DeviceOrientationProviderQt(); 39 ~DeviceOrientationProviderQt(); 37 40 38 virtual void setController(DeviceOrientationController*); 39 virtual void startUpdating(); 40 virtual void stopUpdating(); 41 virtual DeviceOrientation* lastOrientation() const; 42 virtual void deviceOrientationControllerDestroyed(); 41 bool filter(QRotationReading*); 42 void start(); 43 void stop(); 44 bool isActive() const { return m_rotation.isActive(); } 45 DeviceOrientation* orientation() const { return m_orientation.get(); } 46 bool hasAlpha() const { return m_rotation.property("hasZ").toBool(); } 47 48 Q_SIGNALS: 49 void deviceOrientationChanged(DeviceOrientation*); 43 50 44 51 private: 45 QWebPage* m_page;46 DeviceOrientationController* m_controller;52 RefPtr<DeviceOrientation> m_orientation; 53 QRotationSensor m_rotation; 47 54 }; 48 55 49 } // namespace WebCore56 } 50 57 51 #endif // DeviceOrientation ClientQt_h58 #endif // DeviceOrientationProviderQt_h
Note: See TracChangeset
for help on using the changeset viewer.