282 |
282 |
283 DEBUG("- CMIDDisplayable::ConstructL"); |
283 DEBUG("- CMIDDisplayable::ConstructL"); |
284 } |
284 } |
285 |
285 |
286 CMIDDisplayable::CMIDDisplayable(MMIDEnv& aEnv,CMIDUIManager& aUIManager) |
286 CMIDDisplayable::CMIDDisplayable(MMIDEnv& aEnv,CMIDUIManager& aUIManager) |
287 :CEikBorderedControl(TGulBorder(KMIDLetBorder)), |
287 :CEikBorderedControl(TGulBorder(KMIDLetBorder)), |
288 iUIManager(&aUIManager),iEnv(aEnv), |
288 iUIManager(&aUIManager),iEnv(aEnv), |
289 iIsFullScreenMode(EFalse),iActive(EFalse), iSelectCommand(NULL), iSelectCommandEnabled(ETrue), |
289 iIsFullScreenMode(EFalse),iActive(EFalse), iSelectCommand(NULL), iSelectCommandEnabled(ETrue), |
290 iFullscreenCanvasLabelCacheIsValid(EFalse) |
290 iFullscreenCanvasLabelCacheIsValid(EFalse) |
291 #ifdef RD_TACTILE_FEEDBACK |
291 #ifdef RD_TACTILE_FEEDBACK |
292 ,iPenInputServerConnected(EFalse) |
292 ,iPenInputServerConnected(EFalse) |
293 #endif //RD_TACTILE_FEEDBACK |
293 #endif //RD_TACTILE_FEEDBACK |
294 ,iIdOfMSKCommand(KErrNotFound) |
294 ,iIdOfMSKCommand(KErrNotFound) |
295 ,iRestoreOrientation(EFalse) |
295 ,iRestoreOrientation(EFalse) |
296 ,iReleaseCnt(0) |
296 ,iReleaseCnt(0) |
297 { |
297 { |
298 #ifdef RD_JAVA_S60_RELEASE_9_2 |
298 #ifdef RD_JAVA_S60_RELEASE_9_2 |
299 iSplitScreenKeyboard = EFalse; |
299 iSplitScreenKeyboard = EFalse; |
300 #endif // RD_JAVA_S60_RELEASE_9_2 |
300 #endif // RD_JAVA_S60_RELEASE_9_2 |
301 iAppUi = (CMIDAppUi*)java::ui::CoreUiAvkonLcdui::getInstance().getJavaUiAppUi()->getLcduiChild(); |
301 iAppUi = (CMIDAppUi*)java::ui::CoreUiAvkonLcdui::getInstance().getJavaUiAppUi()->getLcduiChild(); |
422 |
422 |
423 void CMIDDisplayable::Draw(const TRect& aRect) const |
423 void CMIDDisplayable::Draw(const TRect& aRect) const |
424 { |
424 { |
425 CWindowGc& gc = SystemGc(); |
425 CWindowGc& gc = SystemGc(); |
426 |
426 |
427 // Set up update region - preventing DSA to be destroyed by redrawing |
427 // Set up update region - preventing MMAPI content area to |
|
428 // be destroyed by redrawing |
|
429 #ifdef RD_JAVA_NGA_ENABLED |
|
430 // Video overlays supported only for Canvas |
|
431 CMIDCanvas* canvas = GetContentCanvas(); |
|
432 TBool overlayEnabled = iEnv.VideoOverlayEnabled() && |
|
433 canvas && !canvas->IsGameCanvas(); |
|
434 |
|
435 if (!iDirectContentsRegion.IsEmpty() && !overlayEnabled) |
|
436 #else |
428 if (!iDirectContentsRegion.IsEmpty()) |
437 if (!iDirectContentsRegion.IsEmpty()) |
|
438 #endif // RD_JAVA_NGA_ENABLED |
429 { |
439 { |
430 gc.CancelClippingRect(); |
440 gc.CancelClippingRect(); |
431 iUpdateRegion.Clear(); |
441 iUpdateRegion.Clear(); |
432 iUpdateRegion.AddRect(aRect); |
442 iUpdateRegion.AddRect(aRect); |
|
443 |
|
444 // Protect access to iDirectContentsRegion, |
|
445 // because it may be modified in MMAPI thread. |
|
446 MMIDEnv::TCriticalSectionAutoLock autoLock(iEnv.GetMMAPILock()); |
433 // Remove occupied areas out from update region |
447 // Remove occupied areas out from update region |
434 iUpdateRegion.SubRegion(iDirectContentsRegion); |
448 iUpdateRegion.SubRegion(iDirectContentsRegion); |
|
449 |
435 // Set the update region for the context |
450 // Set the update region for the context |
436 gc.SetClippingRegion(iUpdateRegion); |
451 gc.SetClippingRegion(iUpdateRegion); |
437 } |
452 } |
438 |
453 |
439 if (iContent->Type() != ECanvas) |
454 if (iContent->Type() != ECanvas) |
531 #else |
546 #else |
532 if (aMenuType == CMIDMenuHandler::EOkMenu) |
547 if (aMenuType == CMIDMenuHandler::EOkMenu) |
533 #endif // RD_JAVA_S60_RELEASE_9_2 |
548 #endif // RD_JAVA_S60_RELEASE_9_2 |
534 { |
549 { |
535 if ((!isItemCommands && |
550 if ((!isItemCommands && |
536 (command->CommandType() != MMIDCommand::EOk) && |
551 (command->CommandType() != MMIDCommand::EOk) && |
537 (command->CommandType() != MMIDCommand::EItem)) || |
552 (command->CommandType() != MMIDCommand::EItem)) || |
538 (command->Id() == CMIDEdwinUtils::EMenuCommandFetchPhoneNumber) || |
553 (command->Id() == CMIDEdwinUtils::EMenuCommandFetchPhoneNumber) || |
539 (command->Id() == CMIDEdwinUtils::EMenuCommandFetchEmailAddress) || |
554 (command->Id() == CMIDEdwinUtils::EMenuCommandFetchEmailAddress) || |
540 (command->Id() == CMIDEdwinUtils::EMenuCommandCreatePhoneCall)) |
555 (command->Id() == CMIDEdwinUtils::EMenuCommandCreatePhoneCall)) |
541 { |
556 { |
542 continue; |
557 continue; |
543 } |
558 } |
544 } |
559 } |
545 |
560 |
3210 // This should be called just after addition or removal of dc rectangle |
3225 // This should be called just after addition or removal of dc rectangle |
3211 // --------------------------------------------------------------------------- |
3226 // --------------------------------------------------------------------------- |
3212 // |
3227 // |
3213 void CMIDDisplayable::UpdateDirectContentsRegion() |
3228 void CMIDDisplayable::UpdateDirectContentsRegion() |
3214 { |
3229 { |
|
3230 // iDirectContentsRegion is accessed both in LCDUI and MMAPI threads |
|
3231 MMIDEnv::TCriticalSectionAutoLock autoLock(iEnv.GetMMAPILock()); |
|
3232 |
3215 iDirectContentsRegion.Clear(); |
3233 iDirectContentsRegion.Clear(); |
3216 TInt count = iDirectContentsRects.Count(); |
3234 TInt count = iDirectContentsRects.Count(); |
3217 for (int index = 0; index < count; index++) |
3235 for (int index = 0; index < count; index++) |
3218 { |
3236 { |
3219 iDirectContentsRegion.AddRect(iDirectContentsRects[ index ].iRect); |
3237 iDirectContentsRegion.AddRect(iDirectContentsRects[ index ].iRect); |
3220 } |
3238 } |
3221 } |
3239 } |
3222 |
3240 |
3223 |
|
3224 TBool CMIDDisplayable::NoDirectContentAreaDefined() |
|
3225 { |
|
3226 return iDirectContentsRegion.IsEmpty(); |
|
3227 } |
|
3228 |
3241 |
3229 void CMIDDisplayable::SetPopupTextBox(TBool aPopup) |
3242 void CMIDDisplayable::SetPopupTextBox(TBool aPopup) |
3230 { |
3243 { |
3231 iIsPopupTextBox = aPopup; |
3244 iIsPopupTextBox = aPopup; |
3232 } |
3245 } |
3373 { |
3386 { |
3374 ProcessCommandL(iIdOfMSKCommand); |
3387 ProcessCommandL(iIdOfMSKCommand); |
3375 } |
3388 } |
3376 } |
3389 } |
3377 |
3390 |
|
3391 #ifdef RD_JAVA_NGA_ENABLED |
|
3392 void CMIDDisplayable::GetDirectContentsRegion(RRegion& region) const |
|
3393 { |
|
3394 // Protect access to iDirectContentsRegion, |
|
3395 // because it may be modified in MMAPI thread. |
|
3396 MMIDEnv::TCriticalSectionAutoLock autoLock(iEnv.GetMMAPILock()); |
|
3397 region.Copy(iDirectContentsRegion); |
|
3398 } |
|
3399 |
|
3400 TInt CMIDDisplayable::DirectContentsCount() const |
|
3401 { |
|
3402 return iDirectContentsRegion.Count(); |
|
3403 } |
|
3404 #endif // RD_JAVA_NGA_ENABLED |
|
3405 |
3378 void CMIDDisplayable::DisplayableBehindPopupIsDestroyed() |
3406 void CMIDDisplayable::DisplayableBehindPopupIsDestroyed() |
3379 { |
3407 { |
3380 // Old fullscreen Displayable is destroyed. |
3408 // Old fullscreen Displayable is destroyed. |
3381 iDisplayableBehindPopup = NULL; |
3409 iDisplayableBehindPopup = NULL; |
3382 } |
3410 } |
3408 HideIndicator(pane, EEikStatusPaneUidMessage); |
3436 HideIndicator(pane, EEikStatusPaneUidMessage); |
3409 HideIndicator(pane, EEikStatusPaneUidClock); |
3437 HideIndicator(pane, EEikStatusPaneUidClock); |
3410 HideIndicator(pane, EEikStatusPaneUidDigitalClock); |
3438 HideIndicator(pane, EEikStatusPaneUidDigitalClock); |
3411 } |
3439 } |
3412 |
3440 |
3413 CMIDCanvas* CMIDDisplayable::GetContentCanvas() |
3441 CMIDCanvas* CMIDDisplayable::GetContentCanvas() const |
3414 { |
3442 { |
3415 CMIDCanvas* ret = NULL; |
3443 CMIDCanvas* ret = NULL; |
3416 if (iContent && iContentControl && |
3444 if (iContent && iContentControl && |
3417 (iContent->Type() == MMIDComponent::ECanvas || |
3445 (iContent->Type() == MMIDComponent::ECanvas || |
3418 iContent->Type() == MMIDComponent::EGameCanvas)) |
3446 iContent->Type() == MMIDComponent::EGameCanvas)) |