Changeset 69313 in webkit
- Timestamp:
- Oct 7, 2010, 9:23:07 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 5 edited
- 1 copied
-
WebCore/ChangeLog (modified) (1 diff)
-
WebCore/WebCore.pro (modified) (2 diffs)
-
WebKit/qt/ChangeLog (modified) (1 diff)
-
WebKit/qt/WebCoreSupport/DeviceMotionClientQt.cpp (modified) (4 diffs)
-
WebKit/qt/WebCoreSupport/DeviceMotionClientQt.h (modified) (2 diffs)
-
WebKit/qt/WebCoreSupport/DeviceMotionProviderQt.cpp (added)
-
WebKit/qt/WebCoreSupport/DeviceMotionProviderQt.h (copied) (copied from trunk/WebKit/qt/WebCoreSupport/DeviceMotionClientQt.h ) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r69312 r69313 1 2010-10-05 Diego Gonzalez <diegohcg@webkit.org> 2 3 Reviewed by Andreas Kling. 4 5 [Qt] Hook up accelerometer data via Qt DeviceMotion 6 https://bugs.webkit.org/show_bug.cgi?id=47105 7 8 Get accelerometer necessary data via Qt mobility library using a 9 provider class. Enable, also the RotationRate using the current device 10 orientation provider. 11 12 * WebCore.pro: 13 1 14 2010-10-07 Luiz Agostini <luiz.agostini@openbossa.org> 2 15 -
trunk/WebCore/WebCore.pro
r69284 r69313 3295 3295 HEADERS += \ 3296 3296 ../WebKit/qt/WebCoreSupport/DeviceMotionClientQt.h \ 3297 ../WebKit/qt/WebCoreSupport/DeviceMotionProviderQt.h \ 3297 3298 ../WebKit/qt/WebCoreSupport/DeviceOrientationClientQt.h \ 3298 3299 ../WebKit/qt/WebCoreSupport/DeviceOrientationProviderQt.h \ … … 3300 3301 SOURCES += \ 3301 3302 ../WebKit/qt/WebCoreSupport/DeviceMotionClientQt.cpp \ 3303 ../WebKit/qt/WebCoreSupport/DeviceMotionProviderQt.cpp \ 3302 3304 ../WebKit/qt/WebCoreSupport/DeviceOrientationClientQt.cpp \ 3303 3305 ../WebKit/qt/WebCoreSupport/DeviceOrientationProviderQt.cpp \ -
trunk/WebKit/qt/ChangeLog
r69312 r69313 1 2010-10-05 Diego Gonzalez <diegohcg@webkit.org> 2 3 Reviewed by Andreas Kling. 4 5 [Qt] Hook up accelerometer data via Qt DeviceMotion 6 https://bugs.webkit.org/show_bug.cgi?id=47105 7 8 Get accelerometer necessary data via Qt mobility library using a 9 provider class. Enable, also the RotationRate using the current device 10 orientation provider. 11 12 * WebCoreSupport/DeviceMotionClientQt.cpp: 13 (WebCore::DeviceMotionClientQt::DeviceMotionClientQt): 14 (WebCore::DeviceMotionClientQt::~DeviceMotionClientQt): 15 (WebCore::DeviceMotionClientQt::startUpdating): 16 (WebCore::DeviceMotionClientQt::stopUpdating): 17 (WebCore::DeviceMotionClientQt::currentDeviceMotion): 18 (WebCore::DeviceMotionClientQt::changeDeviceMotion): 19 * WebCoreSupport/DeviceMotionClientQt.h: 20 * WebCoreSupport/DeviceMotionProviderQt.cpp: Added. 21 (WebCore::DeviceMotionProviderQt::DeviceMotionProviderQt): 22 (WebCore::DeviceMotionProviderQt::~DeviceMotionProviderQt): 23 (WebCore::DeviceMotionProviderQt::start): 24 (WebCore::DeviceMotionProviderQt::stop): 25 (WebCore::DeviceMotionProviderQt::filter): 26 * WebCoreSupport/DeviceMotionProviderQt.h: Added. 27 (WebCore::DeviceMotionProviderQt::currentDeviceMotion): 28 1 29 2010-10-07 Luiz Agostini <luiz.agostini@openbossa.org> 2 30 -
trunk/WebKit/qt/WebCoreSupport/DeviceMotionClientQt.cpp
r68978 r69313 21 21 #include "DeviceMotionClientQt.h" 22 22 23 #include "DeviceMotionController.h" 24 #include "DeviceMotionProviderQt.h" 25 23 26 #include "qwebpage.h" 24 27 … … 28 31 : m_page(page) 29 32 , m_controller(0) 33 , m_provider(new DeviceMotionProviderQt()) 30 34 { 35 36 connect(m_provider, SIGNAL(deviceMotionChanged()), SLOT(changeDeviceMotion())); 37 } 38 39 DeviceMotionClientQt::~DeviceMotionClientQt() 40 { 41 disconnect(); 42 delete m_provider; 31 43 } 32 44 … … 38 50 void DeviceMotionClientQt::startUpdating() 39 51 { 40 // call start method from a motion provider.52 m_provider->start(); 41 53 } 42 54 43 55 void DeviceMotionClientQt::stopUpdating() 44 56 { 45 // call stop method from a motion provider.57 m_provider->stop(); 46 58 } 47 59 48 60 DeviceMotionData* DeviceMotionClientQt::currentDeviceMotion() const 49 61 { 50 return 0;62 return m_provider->currentDeviceMotion(); 51 63 } 52 64 … … 56 68 } 57 69 70 void DeviceMotionClientQt::changeDeviceMotion() 71 { 72 if (!m_controller) 73 return; 74 75 m_controller->didChangeDeviceMotion(currentDeviceMotion()); 76 } 77 58 78 } // namespace WebCore 59 79 -
trunk/WebKit/qt/WebCoreSupport/DeviceMotionClientQt.h
r68978 r69313 30 30 namespace WebCore { 31 31 32 class DeviceMotionProviderQt; 33 32 34 class DeviceMotionClientQt : public QObject, public DeviceMotionClient { 33 35 Q_OBJECT 34 36 public: 35 37 DeviceMotionClientQt(QWebPage*); 36 virtual ~DeviceMotionClientQt() {}38 virtual ~DeviceMotionClientQt(); 37 39 38 40 virtual void setController(DeviceMotionController*); … … 42 44 virtual void deviceMotionControllerDestroyed(); 43 45 46 public Q_SLOTS: 47 void changeDeviceMotion(); 48 44 49 private: 45 50 QWebPage* m_page; 46 51 DeviceMotionController* m_controller; 52 DeviceMotionProviderQt* m_provider; 47 53 }; 48 54 -
trunk/WebKit/qt/WebCoreSupport/DeviceMotionProviderQt.h
r69312 r69313 18 18 * 19 19 */ 20 #ifndef DeviceMotion ClientQt_h21 #define DeviceMotion ClientQt_h20 #ifndef DeviceMotionProviderQt_h 21 #define DeviceMotionProviderQt_h 22 22 23 #include "DeviceMotionClient.h"24 23 #include "DeviceMotionData.h" 24 #include "RefPtr.h" 25 25 26 #include <QAccelerometerFilter> 26 27 #include <QObject> 27 28 28 class QWebPage; 29 QTM_USE_NAMESPACE 29 30 30 31 namespace WebCore { 31 32 32 class DeviceMotionClientQt : public QObject, public DeviceMotionClient { 33 class DeviceOrientationProviderQt; 34 35 class DeviceMotionProviderQt : public QObject, public QAccelerometerFilter { 33 36 Q_OBJECT 34 37 public: 35 DeviceMotion ClientQt(QWebPage*);36 virtual ~DeviceMotionClientQt() {}38 DeviceMotionProviderQt(); 39 ~DeviceMotionProviderQt(); 37 40 38 virtual void setController(DeviceMotionController*); 39 virtual void startUpdating(); 40 virtual void stopUpdating(); 41 virtual DeviceMotionData* currentDeviceMotion() const; 42 virtual void deviceMotionControllerDestroyed(); 41 bool filter(QAccelerometerReading*); 42 void start(); 43 void stop(); 44 DeviceMotionData* currentDeviceMotion() const { return m_motion.get(); } 45 46 Q_SIGNALS: 47 void deviceMotionChanged(); 43 48 44 49 private: 45 QWebPage* m_page; 46 DeviceMotionController* m_controller; 50 RefPtr<DeviceMotionData> m_motion; 51 QAccelerometer m_acceleration; 52 DeviceOrientationProviderQt* m_deviceOrientation; 47 53 }; 48 54 49 } // namesp ece WebCore55 } // namespace WebCore 50 56 51 #endif // DeviceMotion ClientQt_h57 #endif // DeviceMotionProviderQt_h
Note:
See TracChangeset
for help on using the changeset viewer.