84 const TInt KInternalStatusPaneChange = 0x50000000; |
85 const TInt KInternalStatusPaneChange = 0x50000000; |
85 |
86 |
86 //this macro exists because EColor16MAP enum value doesn't exist in Symbian OS 9.2 |
87 //this macro exists because EColor16MAP enum value doesn't exist in Symbian OS 9.2 |
87 #define Q_SYMBIAN_ECOLOR16MAP TDisplayMode(13) |
88 #define Q_SYMBIAN_ECOLOR16MAP TDisplayMode(13) |
88 |
89 |
|
90 class QS60ThreadLocalData |
|
91 { |
|
92 public: |
|
93 QS60ThreadLocalData(); |
|
94 ~QS60ThreadLocalData(); |
|
95 bool usingCONEinstances; |
|
96 RWsSession wsSession; |
|
97 CWsScreenDevice *screenDevice; |
|
98 }; |
|
99 |
89 class QS60Data |
100 class QS60Data |
90 { |
101 { |
91 public: |
102 public: |
92 QS60Data(); |
103 QS60Data(); |
|
104 QThreadStorage<QS60ThreadLocalData *> tls; |
93 TUid uid; |
105 TUid uid; |
94 int screenDepth; |
106 int screenDepth; |
95 QPoint lastCursorPos; |
107 QPoint lastCursorPos; |
96 QPoint lastPointerEventPos; |
108 QPoint lastPointerEventPos; |
97 QPointer<QWidget> lastPointerEventTarget; |
109 QPointer<QWidget> lastPointerEventTarget; |
127 int virtualMouseRequired : 1; |
139 int virtualMouseRequired : 1; |
128 int qtOwnsS60Environment : 1; |
140 int qtOwnsS60Environment : 1; |
129 int supportsPremultipliedAlpha : 1; |
141 int supportsPremultipliedAlpha : 1; |
130 int avkonComponentsSupportTransparency : 1; |
142 int avkonComponentsSupportTransparency : 1; |
131 int menuBeingConstructed : 1; |
143 int menuBeingConstructed : 1; |
|
144 int memoryLimitForHwRendering; |
132 QApplication::QS60MainApplicationFactory s60ApplicationFactory; // typedef'ed pointer type |
145 QApplication::QS60MainApplicationFactory s60ApplicationFactory; // typedef'ed pointer type |
133 static inline void updateScreenSize(); |
146 static inline void updateScreenSize(); |
134 static inline RWsSession& wsSession(); |
147 inline RWsSession& wsSession(); |
135 static inline RWindowGroup& windowGroup(); |
148 static inline RWindowGroup& windowGroup(); |
136 static inline CWsScreenDevice* screenDevice(); |
149 inline CWsScreenDevice* screenDevice(); |
137 static inline CCoeAppUi* appUi(); |
150 static inline CCoeAppUi* appUi(); |
138 static inline CEikMenuBar* menuBar(); |
151 static inline CEikMenuBar* menuBar(); |
139 #ifdef Q_WS_S60 |
152 #ifdef Q_WS_S60 |
140 static inline CEikStatusPane* statusPane(); |
153 static inline CEikStatusPane* statusPane(); |
141 static inline CCoeControl* statusPaneSubPane(TInt aPaneId); |
154 static inline CCoeControl* statusPaneSubPane(TInt aPaneId); |
142 static inline CAknTitlePane* titlePane(); |
155 static inline CAknTitlePane* titlePane(); |
143 static inline CAknContextPane* contextPane(); |
156 static inline CAknContextPane* contextPane(); |
144 static inline CEikButtonGroupContainer* buttonGroupContainer(); |
157 static inline CEikButtonGroupContainer* buttonGroupContainer(); |
145 |
158 #endif |
|
159 |
|
160 #ifdef Q_OS_SYMBIAN |
146 TTrapHandler *s60InstalledTrapHandler; |
161 TTrapHandler *s60InstalledTrapHandler; |
147 #endif |
162 #endif |
148 }; |
163 }; |
149 |
164 |
150 QS60Data* qGlobalS60Data(); |
165 QS60Data* qGlobalS60Data(); |
193 |
208 |
194 protected: // from MAknFadedComponent |
209 protected: // from MAknFadedComponent |
195 TInt CountFadedComponents() {return 1;} |
210 TInt CountFadedComponents() {return 1;} |
196 CCoeControl* FadedComponent(TInt /*aIndex*/) {return this;} |
211 CCoeControl* FadedComponent(TInt /*aIndex*/) {return this;} |
197 #else |
212 #else |
198 #warning No fallback implementation for QSymbianControl::FadeBehindPopup |
213 // #warning No fallback implementation for QSymbianControl::FadeBehindPopup |
199 void FadeBehindPopup(bool /*fade*/){ } |
214 void FadeBehindPopup(bool /*fade*/){ } |
200 #endif |
215 #endif |
201 |
216 |
202 protected: |
217 protected: |
203 void Draw(const TRect& aRect) const; |
218 void Draw(const TRect& aRect) const; |
214 QWidget *receiver, |
229 QWidget *receiver, |
215 QEvent::Type type, |
230 QEvent::Type type, |
216 const QPoint &globalPos, |
231 const QPoint &globalPos, |
217 Qt::MouseButton button, |
232 Qt::MouseButton button, |
218 Qt::KeyboardModifiers modifiers); |
233 Qt::KeyboardModifiers modifiers); |
|
234 void processTouchEvent(int pointerNumber, TPointerEvent::TType type, QPointF screenPos, qreal pressure); |
219 void HandleLongTapEventL( const TPoint& aPenEventLocation, const TPoint& aPenEventScreenLocation ); |
235 void HandleLongTapEventL( const TPoint& aPenEventLocation, const TPoint& aPenEventScreenLocation ); |
220 #ifdef QT_SYMBIAN_SUPPORTS_ADVANCED_POINTER |
236 #ifdef QT_SYMBIAN_SUPPORTS_ADVANCED_POINTER |
221 void translateAdvancedPointerEvent(const TAdvancedPointerEvent *event); |
237 void translateAdvancedPointerEvent(const TAdvancedPointerEvent *event); |
222 #endif |
238 #endif |
223 void handleClientAreaChange(); |
239 void handleClientAreaChange(); |
237 TAknPopupFader popupFader; |
253 TAknPopupFader popupFader; |
238 #endif |
254 #endif |
239 }; |
255 }; |
240 |
256 |
241 inline QS60Data::QS60Data() |
257 inline QS60Data::QS60Data() |
242 { |
258 : uid(TUid::Null()), |
243 memclr(this, sizeof(QS60Data)); //zero init data |
259 screenDepth(0), |
|
260 screenWidthInPixels(0), |
|
261 screenHeightInPixels(0), |
|
262 screenWidthInTwips(0), |
|
263 screenHeightInTwips(0), |
|
264 defaultDpiX(0), |
|
265 defaultDpiY(0), |
|
266 curWin(0), |
|
267 virtualMousePressedKeys(0), |
|
268 virtualMouseAccelDX(0), |
|
269 virtualMouseAccelDY(0), |
|
270 virtualMouseMaxAccel(0), |
|
271 #ifndef Q_SYMBIAN_FIXED_POINTER_CURSORS |
|
272 brokenPointerCursors(0), |
|
273 #endif |
|
274 hasTouchscreen(0), |
|
275 mouseInteractionEnabled(0), |
|
276 virtualMouseRequired(0), |
|
277 qtOwnsS60Environment(0), |
|
278 supportsPremultipliedAlpha(0), |
|
279 avkonComponentsSupportTransparency(0), |
|
280 menuBeingConstructed(0), |
|
281 memoryLimitForHwRendering(0), |
|
282 s60ApplicationFactory(0) |
|
283 #ifdef Q_OS_SYMBIAN |
|
284 ,s60InstalledTrapHandler(0) |
|
285 #endif |
|
286 { |
244 } |
287 } |
245 |
288 |
246 inline void QS60Data::updateScreenSize() |
289 inline void QS60Data::updateScreenSize() |
247 { |
290 { |
248 TPixelsTwipsAndRotation params; |
291 TPixelsTwipsAndRotation params; |
261 S60->defaultDpiX = S60->screenWidthInPixels / inches; |
304 S60->defaultDpiX = S60->screenWidthInPixels / inches; |
262 } |
305 } |
263 |
306 |
264 inline RWsSession& QS60Data::wsSession() |
307 inline RWsSession& QS60Data::wsSession() |
265 { |
308 { |
266 return CCoeEnv::Static()->WsSession(); |
309 if(!tls.hasLocalData()) { |
|
310 tls.setLocalData(new QS60ThreadLocalData); |
|
311 } |
|
312 return tls.localData()->wsSession; |
267 } |
313 } |
268 |
314 |
269 inline RWindowGroup& QS60Data::windowGroup() |
315 inline RWindowGroup& QS60Data::windowGroup() |
270 { |
316 { |
271 return CCoeEnv::Static()->RootWin(); |
317 return CCoeEnv::Static()->RootWin(); |
272 } |
318 } |
273 |
319 |
274 inline CWsScreenDevice* QS60Data::screenDevice() |
320 inline CWsScreenDevice* QS60Data::screenDevice() |
275 { |
321 { |
276 return CCoeEnv::Static()->ScreenDevice(); |
322 if(!tls.hasLocalData()) { |
|
323 tls.setLocalData(new QS60ThreadLocalData); |
|
324 } |
|
325 return tls.localData()->screenDevice; |
277 } |
326 } |
278 |
327 |
279 inline CCoeAppUi* QS60Data::appUi() |
328 inline CCoeAppUi* QS60Data::appUi() |
280 { |
329 { |
281 return CCoeEnv::Static()-> AppUi(); |
330 return CCoeEnv::Static()-> AppUi(); |