diff -r 6aeb7a756187 -r 3c88a81ff781 ginebra2/WebGestureHelper.h --- a/ginebra2/WebGestureHelper.h Thu Sep 23 15:32:11 2010 -0400 +++ b/ginebra2/WebGestureHelper.h Fri Oct 15 17:30:59 2010 -0400 @@ -25,6 +25,9 @@ #include "qstmgestureevent.h" #include //#include "BWFGlobal.h" +#if defined(ORBIT_UI) +#include +#endif #if !defined(Q_WS_X11) #define XEvent void @@ -34,7 +37,7 @@ class QStm_QtDummyGestureRecognizer; class WebGestureHelper -{ +{ public: WebGestureHelper(QWidget* ctrl); @@ -44,8 +47,10 @@ QStm_GestureContext* gestureContext(){ return m_gestures; } bool symbianEventFilter(const QSymbianEvent *event); bool x11EventFilter (XEvent* event); + bool winEventFilter(void* event); void setupGestureEngine(QWidget* ctrl); - + bool shouldHandleGesture(); + bool isFilteredByGestureEngine(); private: QStm_GestureEngineApi* m_gestureEngine; QStm_GestureContext* m_gestures; @@ -61,19 +66,36 @@ #define browserApp (static_cast(QApplication::instance())) -class BrowserApp : public QApplication + +#if defined(ORBIT_UI) +#define ParentApp HbApplication +#else +#define ParentApp QApplication +#endif + +#ifndef Q_OS_WIN +typedef void* MSG; +#endif + +class BrowserApp : public ParentApp { Q_OBJECT public: - BrowserApp(int argc, char** argv); + +#if defined(ORBIT_UI) + BrowserApp(QS60MainApplicationFactory appfactory, int & argc, char** argv); +#endif + BrowserApp(int & argc, char** argv); virtual bool symbianEventFilter(const QSymbianEvent *event); virtual bool x11EventFilter (XEvent* event); + virtual bool winEventFilter(MSG* message, long* result); void setGestureHelper(WebGestureHelper* gh); WebGestureHelper* gestureHelper() { return m_gestureHelper; } void setMainWindow(QWidget* mw) { m_mainWindow = mw; } QWidget* mainWindow() { return m_mainWindow; } QStm_GestureEngineApi* gestureEngine() { return m_gestureEngine; } +// bool event(QEvent* event); private: WebGestureHelper* m_gestureHelper; @@ -83,22 +105,13 @@ -class WebGestureHelperEventFilter : public QObject -{ -public: - WebGestureHelperEventFilter() {} - virtual ~WebGestureHelperEventFilter() {} - static WebGestureHelperEventFilter* instance(); - bool eventFilter(QObject* receiver, QEvent* event); - -private: - static WebGestureHelperEventFilter* m_instance; -}; -class QStm_QtDummyGestureRecognizer : public QGestureRecognizer, +class QStm_QtDummyGestureRecognizer : public QObject, + public QGestureRecognizer, public QStm_GestureListenerApiIf { + Q_OBJECT public: QStm_QtDummyGestureRecognizer(QStm_GestureContext* ctx); ~QStm_QtDummyGestureRecognizer(); @@ -111,6 +124,9 @@ //from QStm_GestureListenerApiIf QStm_ProcessingResult handleGestureEvent(qstmGesture::QStm_GestureUid uid, qstmGesture::QStm_GestureIf* gesture); +public slots: + void handleQStmUiEvent(const qstmUiEventEngine::QStm_UiEventIf&); + private: QStm_GestureContext* m_context; QStm_Gesture* m_currentGesture;