796 entry.iWindowGroupNodeId = aWindowGroupNodeId; |
804 entry.iWindowGroupNodeId = aWindowGroupNodeId; |
797 entry.iClientWindowGroupId = aClientWindowGroupId; |
805 entry.iClientWindowGroupId = aClientWindowGroupId; |
798 entry.iSecureId = aSecureId; |
806 entry.iSecureId = aSecureId; |
799 // we have received start effect for this group, but the group did not exist in alf universe at the time. hide the group. |
807 // we have received start effect for this group, but the group did not exist in alf universe at the time. hide the group. |
800 if (iFullScreenEffectData |
808 if (iFullScreenEffectData |
801 && iFullScreenEffectData->iWaitingWindowGroup |
809 && (iFullScreenEffectData->State() == EWaitingWindowGroup || iFullScreenEffectData->State() == EEndFullScreenReceivedWaitingWindowGroup) |
802 && iFullScreenEffectData->iToSecureId == aSecureId) |
810 && iFullScreenEffectData->iToSecureId == aSecureId) |
803 { |
811 { |
804 iFullScreenEffectData->iToWg = aClientWindowGroupId; |
812 iFullScreenEffectData->iToWg = aClientWindowGroupId; |
|
813 if (iSecondaryFullScreenEffectData) |
|
814 { |
|
815 iSecondaryFullScreenEffectData->iToWg = aClientWindowGroupId; |
|
816 } |
805 CHuiControlGroup* fromGroup = NULL; |
817 CHuiControlGroup* fromGroup = NULL; |
806 CHuiLayout* fromLayout = NULL; |
818 CHuiLayout* fromLayout = NULL; |
807 fromGroup = FindControlGroupByFullScreenFromEffect(); |
819 fromGroup = FindControlGroupByFullScreenFromEffect(); |
808 if (fromGroup) |
820 if (fromGroup) |
809 { |
821 { |
813 |
825 |
814 |
826 |
815 // First HandleGfxEvent, then clear iWaitingWindowGroup. |
827 // First HandleGfxEvent, then clear iWaitingWindowGroup. |
816 __ALFFXLOGSTRING1("CAlfBridge::CreateControlGroupL - try triggering effect 0x%x", layout); |
828 __ALFFXLOGSTRING1("CAlfBridge::CreateControlGroupL - try triggering effect 0x%x", layout); |
817 TBool failed = HandleGfxEventL( *iFullScreenEffectData, layout, fromLayout ); |
829 TBool failed = HandleGfxEventL( *iFullScreenEffectData, layout, fromLayout ); |
818 if ( iFullScreenEffectData ) |
830 if ( iFullScreenEffectData->State() == EWaitingWindowGroup) |
819 { |
831 { |
820 iFullScreenEffectData->iWaitingWindowGroup = EFalse; |
832 iFullScreenEffectData->SetState(EWaitEndFullScreen); |
821 } |
833 } |
|
834 else |
|
835 { |
|
836 // was CFullScreenEffectState::EEndFullScreenReceivedWaitingWindowGroup |
|
837 iFullScreenEffectData->SetState(EEndFullscreenReceived); |
|
838 } |
|
839 |
822 if ( failed ) |
840 if ( failed ) |
823 { |
841 { |
824 // Effect failed, reset state |
842 // Effect failed, reset state |
825 __ALFFXLOGSTRING1("CAlfBridge::CreateControlGroupL - effect failed on layout 0x%x", layout); |
843 __ALFFXLOGSTRING1("CAlfBridge::CreateControlGroupL - effect failed on layout 0x%x", layout); |
826 HandleGfxStopEvent( EFalse ); // destroys iFullScreenEffectData |
844 HandleGfxStopEvent( EFalse ); // destroys iFullScreenEffectData |
1600 |
1623 |
1601 if ( hasLayers && iActivated ) |
1624 if ( hasLayers && iActivated ) |
1602 { |
1625 { |
1603 HandleLayerVisibility( layout, controlgroup, control, hasActiveVisualsInVisualTree ); |
1626 HandleLayerVisibility( layout, controlgroup, control, hasActiveVisualsInVisualTree ); |
1604 } |
1627 } |
|
1628 |
|
1629 TBool isLayoutActive = !(layout->Flags() & EHuiVisualFlagInactive); |
|
1630 |
|
1631 // we need to set /clear inactive flags before we evaluate the fade effect, |
|
1632 // otherwise the fade effect will be removed without a reason in |
|
1633 // some use cases |
|
1634 if (isLayoutActive && !hasActiveVisualsInVisualTree && !IsOpaqueEffect(layout->Effect())) |
|
1635 { |
|
1636 // Setting also the root visual (layout) as inactive, if it had none |
|
1637 // active children. This is because otherwise the Inactive checks won't |
|
1638 // work correctly within RosterImpl ScanDirty & ClearChanged phases. |
|
1639 // If root visual is having an opaque effect, it must remain active |
|
1640 layout->SetFlag(EHuiVisualFlagInactive); |
|
1641 } |
|
1642 else if(!isLayoutActive && (hasActiveVisualsInVisualTree || IsOpaqueEffect(layout->Effect()))) |
|
1643 { |
|
1644 layout->ClearFlag(EHuiVisualFlagInactive); |
|
1645 layout->SetPos(fullscreen.iTl); |
|
1646 layout->SetSize(fullscreen.Size()); |
|
1647 } |
|
1648 |
1605 |
1649 |
1606 // If we layout is active setup the fade effects. Also if it is inactive, but has been |
1650 // If we layout is active setup the fade effects. Also if it is inactive, but has been |
1607 // flagged as containing fade effect, then run the setup as well so that effects which |
1651 // flagged as containing fade effect, then run the setup as well so that effects which |
1608 // are no more needed get removed. |
1652 // are no more needed get removed. |
1609 if (hasActiveVisualsInVisualTree || (!hasActiveVisualsInVisualTree && hasFadeEffectsInVisualTree)) |
1653 if (hasActiveVisualsInVisualTree || (!hasActiveVisualsInVisualTree && hasFadeEffectsInVisualTree)) |
1624 else |
1668 else |
1625 { |
1669 { |
1626 layout->ClearCanvasFlags(EHuiCanvasFlagExternalFadeExistsInsideVisualTree); |
1670 layout->ClearCanvasFlags(EHuiCanvasFlagExternalFadeExistsInsideVisualTree); |
1627 } |
1671 } |
1628 } |
1672 } |
1629 |
1673 |
1630 TBool isLayoutActive = !(layout->Flags() & EHuiVisualFlagInactive); |
|
1631 if (isLayoutActive && !hasActiveVisualsInVisualTree) |
|
1632 { |
|
1633 // Setting also the root visual (layout) as inactive, if it had none |
|
1634 // active children. This is because otherwise the Inactive checks won't |
|
1635 // work correctly within RosterImpl ScanDirty & ClearChanged phases. |
|
1636 layout->SetFlag(EHuiVisualFlagInactive); |
|
1637 } |
|
1638 else if(!isLayoutActive && hasActiveVisualsInVisualTree) |
|
1639 { |
|
1640 layout->ClearFlag(EHuiVisualFlagInactive); |
|
1641 layout->SetPos(fullscreen.iTl); |
|
1642 layout->SetSize(fullscreen.Size()); |
|
1643 } |
|
1644 |
|
1645 #ifdef ALF_DEBUG_PRINT_WINDOWGROUP_ORDER |
1674 #ifdef ALF_DEBUG_PRINT_WINDOWGROUP_ORDER |
1646 __ALFLOGSTRING1(">>>> HandleVisualVisibility: Control group index: %d", j ); |
1675 __ALFLOGSTRING1(">>>> HandleVisualVisibility: Control group index: %d", j ); |
1647 __ALFLOGSTRING1(">>>> HandleVisualVisibility: Active visuals : %d", activevisualcount ); |
1676 __ALFLOGSTRING1(">>>> HandleVisualVisibility: Active visuals : %d", activevisualcount ); |
1648 __ALFLOGSTRING1(">>>> HandleVisualVisibility: Passive visuals: %d", passivevisualcount ); |
1677 __ALFLOGSTRING1(">>>> HandleVisualVisibility: Passive visuals: %d", passivevisualcount ); |
1649 #endif |
1678 #endif |
3335 else |
3364 else |
3336 { |
3365 { |
3337 __ALFLOGSTRING3("CAlfBridge::HandlePostCanvasBufferL, EAlfDSPostCanvasBuffer: Visual not found! Screen: %d, Id: %d, GroupId: %d ", screenNumber, windowNodeId, windowGroupNodeId ); |
3366 __ALFLOGSTRING3("CAlfBridge::HandlePostCanvasBufferL, EAlfDSPostCanvasBuffer: Visual not found! Screen: %d, Id: %d, GroupId: %d ", screenNumber, windowNodeId, windowGroupNodeId ); |
3338 } |
3367 } |
3339 #ifdef USE_APPLICATION_ENDFULLSCREEN_TIMEOUT |
3368 #ifdef USE_APPLICATION_ENDFULLSCREEN_TIMEOUT |
3340 if (iFullScreenEffectData |
3369 if (iFullScreenEffectData |
|
3370 && !iSecondaryFullScreenEffectData |
3341 && iFullScreenEffectData->iEffectType != CFullScreenEffectState::ENotDefinedEffect |
3371 && iFullScreenEffectData->iEffectType != CFullScreenEffectState::ENotDefinedEffect |
3342 && !iFullScreenEffectData->iEndFullScreen) |
3372 && iFullScreenEffectData->State() == EWaitEndFullScreen |
|
3373 && iFullScreenEffectData->iTwoPhaseEffect != CFullScreenEffectState::ESecondPartActive) |
3343 { |
3374 { |
3344 CHuiControlGroup *to_group = NULL; |
3375 CHuiControlGroup *to_group = NULL; |
3345 if (iFullScreenEffectData->iEffectType == CFullScreenEffectState::EExitEffect) |
3376 if (iFullScreenEffectData->iEffectType == CFullScreenEffectState::EExitEffect) |
3346 { |
3377 { |
3347 to_group = FindControlGroupByFullScreenFromEffect(); |
3378 to_group = FindControlGroupByFullScreenFromEffect(); |
4533 } |
4564 } |
4534 } |
4565 } |
4535 |
4566 |
4536 TBool CAlfBridge::HandleGfxEventL(CFullScreenEffectState& aEvent, CHuiLayout* aToLayout, CHuiLayout *aFromLayout) |
4567 TBool CAlfBridge::HandleGfxEventL(CFullScreenEffectState& aEvent, CHuiLayout* aToLayout, CHuiLayout *aFromLayout) |
4537 { |
4568 { |
4538 __ALFFXLOGSTRING2("CAlfBridge::HandleGfxEventL - To SecureUid: 0x%x, From SecureUid: 0x%x", aEvent.iToSecureId, aEvent.iFromSecureId); |
4569 __ALFFXLOGSTRING3("CAlfBridge::HandleGfxEventL - To SecureUid: 0x%x, From SecureUid: 0x%x, effect %S", aEvent.iToSecureId, aEvent.iFromSecureId, aEvent.iEffectName); |
4539 __ALFFXLOGSTRING4("CAlfBridge::HandleGfxEventL - To layout: 0x%x, From layout: 0x%x, Effect handle: %d, Action: %d", aToLayout, aFromLayout, aEvent.iHandle, aEvent.iAction); |
4570 __ALFFXLOGSTRING4("CAlfBridge::HandleGfxEventL - To layout: 0x%x, From layout: 0x%x, Effect handle: %d, Action: %d", aToLayout, aFromLayout, aEvent.iHandle, aEvent.iAction); |
|
4571 |
4540 TInt err = KErrNone; |
4572 TInt err = KErrNone; |
4541 TBool failed = EFalse; |
4573 TBool failed = EFalse; |
4542 |
4574 |
4543 // Check if there is an effects engine in HuiEnv |
4575 // Check if there is an effects engine in HuiEnv |
4544 CHuiFxEffect* effect = NULL; |
4576 CHuiFxEffect* effect = NULL; |
4603 // Effect end observer is given to engine in LoadEffectL |
4640 // Effect end observer is given to engine in LoadEffectL |
4604 // It will be set to effect there and called when the effect ends or is deleted |
4641 // It will be set to effect there and called when the effect ends or is deleted |
4605 |
4642 |
4606 // The layout should be visible at this time. if not, then this is assumed |
4643 // The layout should be visible at this time. if not, then this is assumed |
4607 // as effect to an background application and ignored. |
4644 // as effect to an background application and ignored. |
4608 if (aToLayout->Effect()) |
4645 |
4609 { |
4646 if (aToLayout->Effect() |
|
4647 && !(aToLayout->Effect()->EffectFlags() & KHuiFadeEffectFlag )) |
|
4648 { |
|
4649 // If the exit effect took a screesnhot (above), then the layout is freezed to show the screenshot. |
|
4650 // Layout may not be unfrozen before EndFullScreen, or flicker will occur. |
4610 // effect on a layout must be an application start effect. |
4651 // effect on a layout must be an application start effect. |
4611 // External content visual is not used for that. |
4652 // External content visual is not used for that. |
4612 __ALFFXLOGSTRING2("CAlfBridge::HandleGfxEventL - Found effect on layout 0x%x. Removing effect 0x%x", aToLayout, aToLayout->Effect()); |
4653 __ALFFXLOGSTRING2("CAlfBridge::HandleGfxEventL - Found effect on layout 0x%x. Removing effect 0x%x", aToLayout, aToLayout->Effect()); |
4613 aToLayout->SetEffect(NULL); |
4654 aToLayout->SetEffect(NULL); |
|
4655 aToLayout->SetFreezeState(EFalse); // Only if a screenshot was taken earlier then freeze state would be ETrue |
4614 } |
4656 } |
|
4657 |
4615 __ALFFXLOGSTRING2("CAlfBridge::HandleGfxEventL - Layout 0x%x is active: %d", aToLayout, !TBool(aToLayout->Flags() & EHuiVisualFlagInactive) ); |
4658 __ALFFXLOGSTRING2("CAlfBridge::HandleGfxEventL - Layout 0x%x is active: %d", aToLayout, !TBool(aToLayout->Flags() & EHuiVisualFlagInactive) ); |
4616 if (!(aToLayout->Flags() & EHuiVisualFlagInactive)) |
4659 if (!(aToLayout->Flags() & EHuiVisualFlagInactive)) |
4617 { |
4660 { |
4618 TInt index; |
4661 TInt index; |
4619 if (aToLayout->StoredRenderBuffer() && HasActiveEffect(aToLayout, index) && index != KErrNotFound) |
4662 if (aToLayout->StoredRenderBuffer() |
|
4663 && HasActiveEffect(aToLayout, index) |
|
4664 && index != KErrNotFound) |
4620 { |
4665 { |
4621 // a screenshot has been saved into the layout, and the layout was added to cleanupstack |
4666 // a screenshot has been saved into the layout, and the layout was added to cleanupstack |
4622 // for cleaning. SetupEffectLayoutContainerL will add the same layout |
4667 // for cleaning. SetupEffectLayoutContainerL will add the same layout |
4623 // to the cleanupstack, but double cleaning is not a good idea. Thus it is removed here. |
4668 // to the cleanupstack, but double cleaning is not a good idea. Thus it is removed here. |
4624 __ALFFXLOGSTRING1("CAlfBridge::HandleGfxEventL - Removing the layout 0x%x with screenshot from iEffectCleanupStack", aToLayout); |
4669 __ALFFXLOGSTRING1("CAlfBridge::HandleGfxEventL - Removing the layout 0x%x with screenshot from iEffectCleanupStack", aToLayout); |
4666 else |
4726 else |
4667 { |
4727 { |
4668 // add visuals to visual cleanupstack |
4728 // add visuals to visual cleanupstack |
4669 aToLayout->SetStoredRenderBufferModificationsEnabled(EFalse); |
4729 aToLayout->SetStoredRenderBufferModificationsEnabled(EFalse); |
4670 TInt index; |
4730 TInt index; |
4671 if (aToLayout->StoredRenderBuffer() && HasActiveEffect(aToLayout, index) && index != KErrNotFound) |
4731 if (aToLayout->StoredRenderBuffer() |
|
4732 && HasActiveEffect(aToLayout, index) |
|
4733 && index != KErrNotFound |
|
4734 && aEvent.iTwoPhaseEffect != CFullScreenEffectState::ESecondPartActive // effects second phase |
|
4735 ) |
4672 { |
4736 { |
4673 // a screenshot has been saved into the layout, and the layout was added to cleanupstack |
4737 // a screenshot has been saved into the layout, and the layout was added to cleanupstack |
4674 // for cleaning. SetupEffectLayoutContainerL will add the same layout |
4738 // for cleaning. SetupEffectLayoutContainerL will add the same layout |
4675 // to the cleanupstack, but double cleaning is not a good idea. Thus it is removed here. |
4739 // to the cleanupstack, but double cleaning is not a good idea. Thus it is removed here. |
4676 __ALFFXLOGSTRING1("CAlfBridge::HandleGfxEventL - Removing the layout 0x%x with screenshot from iEffectCleanupStack", aToLayout); |
4740 __ALFFXLOGSTRING1("CAlfBridge::HandleGfxEventL - Removing the layout 0x%x with screenshot from iEffectCleanupStack", aToLayout); |
4677 iEffectCleanupStack.Remove(index); |
4741 iEffectCleanupStack.Remove(index); |
4678 } |
4742 } |
4679 layoutEffectable = SetupEffectLayoutContainerL(aEvent.iHandle,aToLayout, ETrue, EFalse, aEvent.iCanDestroyOrHideImmediately); |
4743 if (aEvent.iTwoPhaseEffect == CFullScreenEffectState::ESecondPartActive || aEvent.iSetupDone) |
|
4744 { |
|
4745 // two phase effect, setup has been made with the first part of the effect. |
|
4746 // Only changing the effect is required. |
|
4747 layoutEffectable = ETrue; |
|
4748 } |
|
4749 else |
|
4750 { |
|
4751 layoutEffectable = SetupEffectLayoutContainerL(aEvent.iHandle,aToLayout, ETrue, EFalse, aEvent.iCanDestroyOrHideImmediately); |
|
4752 } |
4680 aEvent.iSetupDone = layoutEffectable; |
4753 aEvent.iSetupDone = layoutEffectable; |
4681 aToLayout->SetStoredRenderBufferModificationsEnabled(ETrue); |
4754 aToLayout->SetStoredRenderBufferModificationsEnabled(ETrue); |
4682 } |
4755 } |
4683 |
4756 |
4684 if (layoutEffectable) |
4757 if (layoutEffectable) |
4688 if (activeEffectGroup != KErrNotFound) |
4761 if (activeEffectGroup != KErrNotFound) |
4689 { |
4762 { |
4690 engine->AddEffectToGroup(activeEffectGroup); |
4763 engine->AddEffectToGroup(activeEffectGroup); |
4691 } |
4764 } |
4692 __ALFFXLOGSTRING1("CAlfBridge::HandleGfxEventL - Active effect group: %d", activeEffectGroup); |
4765 __ALFFXLOGSTRING1("CAlfBridge::HandleGfxEventL - Active effect group: %d", activeEffectGroup); |
4693 effectFlags = KHuiFxDelayRunUntilFirstFrameHasBeenDrawn; |
4766 effectFlags = KHuiFxDelayRunUntilFirstFrameHasBeenDrawn; |
4694 if (FxmlHasOpaqueHint(iHuiEnv->EffectsEngine(), *aEvent.iEffectName)) |
4767 if (FxmlHasOpaqueHint(iHuiEnv->EffectsEngine(), *aEvent.iEffectName) || |
|
4768 aEvent.iTwoPhaseEffect == CFullScreenEffectState::ESecondPartActive) |
4695 { |
4769 { |
4696 // Performance improvement, but this would be better to be a special hint param in the fxml |
|
4697 effectFlags |= KHuiFxOpaqueHint; |
4770 effectFlags |= KHuiFxOpaqueHint; |
|
4771 } |
|
4772 if (iSecondaryFullScreenEffectData) |
|
4773 { |
|
4774 iSecondaryFullScreenEffectData->iSetupDone = ETrue; |
4698 } |
4775 } |
4699 |
4776 |
4700 if (aEvent.iRect != TRect()) |
4777 if (aEvent.iRect != TRect()) |
4701 { |
4778 { |
4702 TRAP( err, engine->LoadGroupEffectL( *aEvent.iEffectName, effect, aToLayout->Effectable(), activeEffectGroup, &aEvent.iRect, this, aEvent.iHandle, effectFlags )); |
4779 TRAP( err, engine->LoadGroupEffectL( *aEvent.iEffectName, effect, aToLayout->Effectable(), activeEffectGroup, &aEvent.iRect, this, aEvent.iHandle, effectFlags )); |
4912 |
4996 |
4913 __ALFFXLOGSTRING("HandleGfxEffectsL - END: ongoing"); |
4997 __ALFFXLOGSTRING("HandleGfxEffectsL - END: ongoing"); |
4914 |
4998 |
4915 // Client expects completion to be signalled with this handle. |
4999 // Client expects completion to be signalled with this handle. |
4916 iFullScreenEffectData->iCompletionHandle = stream.ReadInt32L(); |
5000 iFullScreenEffectData->iCompletionHandle = stream.ReadInt32L(); |
|
5001 if (iSecondaryFullScreenEffectData) |
|
5002 { |
|
5003 // Two phase effect path has been chosen. First part is now ongoing, and second part will be |
|
5004 // triggered after that. Client has now notified, that its screen is ready. We may trigger the |
|
5005 // second effect as soon as the first part finishes. |
|
5006 __ALFFXLOGSTRING("CAlfBridge::HandleGfxEffectsL - Trigger second part. when 1st part done."); |
|
5007 iSecondaryFullScreenEffectData->iCompletionHandle = iFullScreenEffectData->iCompletionHandle; |
|
5008 } |
4917 |
5009 |
4918 stream.Release(); |
5010 stream.Release(); |
4919 return ; |
5011 return ; |
4920 } |
5012 } |
4921 } |
5013 } |
4922 else // MAlfGfxEffectPlugin::EEndFullscreen |
5014 else // MAlfGfxEffectPlugin::EEndFullscreen |
4923 { |
5015 { |
4924 // End fullscreen signal received. We proceed only if there is really |
5016 // End fullscreen signal received. We proceed only if there is really |
4925 // effect ongoing and "end fullscreen" hasn't already been processed. |
5017 // effect ongoing and "end fullscreen" hasn't already been processed. |
4926 |
5018 |
4927 if ( !iFullScreenEffectData || iFullScreenEffectData->iEndFullScreen ) |
5019 if ( !iFullScreenEffectData |
4928 { |
5020 || iFullScreenEffectData->State() == EFinalEffectActive |
4929 __ALFFXLOGSTRING("CAlfBridge::HandleGfxEffectsL - END: fx ready"); |
5021 || iFullScreenEffectData->State() == EEndFullscreenReceived) |
|
5022 { |
|
5023 if (iFullScreenEffectData) |
|
5024 __ALFFXLOGSTRING1("CAlfBridge::HandleGfxEffectsL - END: fx ready, state %d ", iFullScreenEffectData->State()); |
|
5025 stream.Release(); |
4930 return; |
5026 return; |
4931 } |
5027 } |
4932 // Load the whole structure. If timeout was triggered then request effect name |
5028 CFullScreenEffectState* fxData = new (ELeave) CFullScreenEffectState; |
4933 // is updated. |
5029 CleanupStack::PushL( fxData ); |
4934 CFullScreenEffectState* fxData = new (ELeave) CFullScreenEffectState; |
5030 fxData->ConstructL( KErrUnknown, stream ); |
4935 CleanupStack::PushL( fxData ); |
5031 |
4936 fxData->ConstructL( action, stream ); |
5032 TBool timeout = fxData->iTimeout; |
4937 iFullScreenEffectData->iTimeoutTriggered = fxData->iTimeoutTriggered; |
5033 // could the application be ready? |
4938 if (fxData->iTimeoutTriggered) |
5034 TBool applicationExists = FindControlGroupByFullScreenToEffect() != NULL ? ETrue : EFalse; |
4939 { |
5035 |
4940 delete iFullScreenEffectData->iEffectName; |
5036 // It may be, that application exited already and it was moved already to effect group |
4941 iFullScreenEffectData->iEffectName = NULL; |
5037 if (iFullScreenEffectData->iEffectType == CFullScreenEffectState::EExitEffect && !applicationExists ) |
4942 iFullScreenEffectData->iEffectName = fxData->iEffectName->AllocL(); |
5038 { |
|
5039 applicationExists = FindLayoutByEffectHandle(fxData->iHandle) != NULL ? ETrue : EFalse; |
|
5040 } |
4943 |
5041 |
4944 } |
5042 TBool longAppStartTimeout = fxData->iLongAppStartTimeout; |
4945 CleanupStack::PopAndDestroy( fxData ); |
5043 |
4946 fxData = NULL; |
5044 if (iFullScreenEffectData && |
4947 |
5045 !iSecondaryFullScreenEffectData && // second part has not been requested yet |
4948 __ALFFXLOGSTRING("HandleGfxEffectsL - process end"); |
5046 longAppStartTimeout && // this is indeed timeout for app start effect |
4949 iFullScreenEffectData->iEndFullScreen = ETrue; |
5047 iFullScreenEffectData->iTwoPhaseEffect == CFullScreenEffectState::EOnlyOnePart && // second part has not been activated. note, that iSecondaryFullScreenEffectData would be NULL in this case |
4950 |
5048 (iFullScreenEffectData->State() == EWaitEndFullScreen |
4951 #ifdef USE_APPLICATION_ENDFULLSCREEN_TIMEOUT |
5049 || iFullScreenEffectData->State() == EWaitingWindowGroup)) |
4952 if (iFullScreenEffectData->iDrawingCompleteTimer) |
5050 { |
4953 { |
5051 // Load the whole structure. If timeout was triggered then request effect name to be |
4954 iFullScreenEffectData->iDrawingCompleteTimer->Cancel(); |
5052 // updated. |
4955 } |
5053 UpdateSecondaryEffectL(*fxData); |
4956 #endif |
5054 iFullScreenEffectData->iLongAppStartTimeout = fxData->iLongAppStartTimeout; |
4957 stream.Release(); |
5055 iFullScreenEffectData->iTwoPhaseEffect = CFullScreenEffectState::EFirstPartActive; |
|
5056 iFullScreenEffectData->iOperation = MAlfGfxEffectPlugin::EEndFullscreen; |
|
5057 } |
|
5058 |
|
5059 __ALFFXLOGSTRING4("HandleGfxEffectsL - iTwoPhaseEffect %d, Setup done: %d, Timeout: %d, long app start timeout: %d", iFullScreenEffectData->iTwoPhaseEffect,iFullScreenEffectData->iSetupDone, timeout,longAppStartTimeout); |
|
5060 if (!fxData->iLongAppStartTimeout) // endfullscreen originating from the application |
|
5061 { |
|
5062 if (iFullScreenEffectData->State() == EWaitingWindowGroup) |
|
5063 { |
|
5064 iFullScreenEffectData->SetState(EEndFullScreenReceivedWaitingWindowGroup); |
|
5065 } |
|
5066 else |
|
5067 { |
|
5068 iFullScreenEffectData->SetState(EEndFullscreenReceived); |
|
5069 } |
|
5070 |
|
5071 if (iSecondaryFullScreenEffectData) |
|
5072 { |
|
5073 iSecondaryFullScreenEffectData->SetState(EEndFullscreenReceived); |
|
5074 } |
|
5075 |
|
5076 } |
|
5077 CleanupStack::PopAndDestroy( fxData ); |
|
5078 fxData = NULL; |
|
5079 |
|
5080 __ALFFXLOGSTRING4("CAlfBridge::HandleGfxEffectsL - Regular timeout: %d, Slow start timeout: %d, Effect setup: %d, State: %d", |
|
5081 timeout, |
|
5082 longAppStartTimeout, |
|
5083 iFullScreenEffectData->iSetupDone, |
|
5084 iFullScreenEffectData->State()); |
|
5085 |
|
5086 stream.Release();// We should respect normal timeouts. |
|
5087 if (iFullScreenEffectData->iTwoPhaseEffect > CFullScreenEffectState::EOnlyOnePart |
|
5088 && iFullScreenEffectData->iSetupDone && timeout && longAppStartTimeout) // timeout = endfullscreen was requested or it was normal endfullscreen timeout, longAppStartTime = |
|
5089 { |
|
5090 // If this is two phased effect, it can be started only by application request of endfullscreen (!timeout) |
|
5091 // or screen drawn (triggered from |
|
5092 __ALFFXLOGSTRING("HandleGfxEffectsL - Two phase effect. Waiting second part to start. Skip this event."); |
|
5093 return; |
|
5094 } |
|
5095 |
|
5096 // If client triggered EndFullScreen has been received, and still we haven't seen sign of the application, we know |
|
5097 // things have gone wrong and will not go right. Clean up the mess. |
|
5098 if (iFullScreenEffectData->State() == EEndFullscreenReceived && !applicationExists && !timeout) |
|
5099 { |
|
5100 HandleGfxStopEvent(ETrue); |
|
5101 return; |
|
5102 } |
4958 } |
5103 } |
4959 |
5104 |
4960 CFullScreenEffectState* fxData = iFullScreenEffectData; |
5105 CFullScreenEffectState* fxData = iFullScreenEffectData; |
4961 fxData->iOperation = operation; |
5106 fxData->iOperation = operation; |
4962 fxData->iWaitingWindowGroup = EFalse; |
|
4963 |
5107 |
4964 __ALFFXLOGSTRING3("CAlfBridge::HandleGfxEffectsL - Operation: %d, handle: %d, type: %d", operation, fxData->iHandle, fxData->iType); |
5108 __ALFFXLOGSTRING3("CAlfBridge::HandleGfxEffectsL - Operation: %d, handle: %d, type: %d", operation, fxData->iHandle, fxData->iType); |
4965 __ALFFXLOGSTRING2("CAlfBridge::HandleGfxEffectsL - towg: %d, fromwg: %d", fxData->iToWg, fxData->iFromWg); |
5109 __ALFFXLOGSTRING2("CAlfBridge::HandleGfxEffectsL - towg: %d, fromwg: %d", fxData->iToWg, fxData->iFromWg); |
4966 |
5110 |
4967 CHuiControlGroup* toGroup = NULL; |
5111 CHuiControlGroup* toGroup = NULL; |
5028 iHuiEnv->ContinueRefresh(); |
5177 iHuiEnv->ContinueRefresh(); |
5029 |
5178 |
5030 __ALFFXLOGSTRING("CAlfBridge::HandleGfxEffectsL - END"); |
5179 __ALFFXLOGSTRING("CAlfBridge::HandleGfxEffectsL - END"); |
5031 } |
5180 } |
5032 |
5181 |
|
5182 TBool CAlfBridge::UpdateSecondaryEffectL(const CFullScreenEffectState& aState) |
|
5183 { |
|
5184 |
|
5185 __ALFFXLOGSTRING1("CAlfBridge::UpdateSecondaryEffectL - appstart timeout triggered: %d", aState.iLongAppStartTimeout); |
|
5186 if (aState.iLongAppStartTimeout) // only application start effects can trigger this timeout |
|
5187 { |
|
5188 // clone the primary startup effect for later usage |
|
5189 delete iSecondaryFullScreenEffectData; |
|
5190 iSecondaryFullScreenEffectData = new (ELeave) CFullScreenEffectState; |
|
5191 iSecondaryFullScreenEffectData->ConstructL(*iFullScreenEffectData); |
|
5192 iSecondaryFullScreenEffectData->iLongAppStartTimeout = EFalse; |
|
5193 |
|
5194 delete iFullScreenEffectData->iEffectName; |
|
5195 iFullScreenEffectData->iEffectName = NULL; |
|
5196 iFullScreenEffectData->iEffectName = aState.iEffectName->AllocL(); |
|
5197 } |
|
5198 __ALFFXLOGSTRING("CAlfBridge::UpdateSecondaryEffectL <<" ); |
|
5199 return EFalse; |
|
5200 } |
|
5201 |
5033 TBool CAlfBridge::GfxTriggerEffectWhenFullScreenDrawn(CHuiControlGroup* aToGroup) |
5202 TBool CAlfBridge::GfxTriggerEffectWhenFullScreenDrawn(CHuiControlGroup* aToGroup) |
5034 { |
5203 { |
5035 if (!aToGroup || (aToGroup && aToGroup->Count() == 0)) |
5204 if (!aToGroup || (aToGroup && aToGroup->Count() == 0)) |
5036 { |
5205 { |
5037 return EFalse; |
5206 return EFalse; |
5038 } |
5207 } |
5039 iTempRegion.Clear(); |
5208 iTempRegion.Clear(); |
5040 |
5209 |
5041 CAlfScreen* screen = iAlfScreens[0]; |
5210 CAlfScreen* screen = iAlfScreens[0]; |
5042 TRect fullscreen = TRect(TPoint(0,0), screen->Size()); |
5211 TRect fullscreen = TRect(TPoint(0,0), screen->Size()); |
5043 TBool fullscreenCovered(EFalse); |
5212 TBool fullscreenCovered(EFalse); |
5044 TInt dummy = 0; |
5213 TInt dummy = 0; |
5051 return EFalse; |
5220 return EFalse; |
5052 } |
5221 } |
5053 TBool opaque = ETrue; // in app start case the layout is propably not opaque. Fake it. |
5222 TBool opaque = ETrue; // in app start case the layout is propably not opaque. Fake it. |
5054 IsFullScreenDrawnRecursive(toLayout, *aToGroup, control, fullscreenCovered, fullscreen, screen, dummy, opaque, iAlfScreens[0]->iDisplay->Orientation()); |
5223 IsFullScreenDrawnRecursive(toLayout, *aToGroup, control, fullscreenCovered, fullscreen, screen, dummy, opaque, iAlfScreens[0]->iDisplay->Orientation()); |
5055 fullscreenCovered = IsRectCoveredByRegion(fullscreen, iTempRegion); |
5224 fullscreenCovered = IsRectCoveredByRegion(fullscreen, iTempRegion); |
|
5225 // alf content check is relavant only for alf apps |
|
5226 if (!fullscreenCovered && aToGroup->iAlfApp) |
|
5227 { |
|
5228 TInt clientGroupId = FindClientWindowGroupId(0, *aToGroup); |
|
5229 if (clientGroupId != KErrNotFound) |
|
5230 { |
|
5231 fullscreenCovered = HasActiveAlfContent(clientGroupId); |
|
5232 } |
|
5233 } |
|
5234 |
5056 __ALFFXLOGSTRING1("CAlfBridge::GfxTriggerEffectWhenFullScreenDrawn - Covered: %d", fullscreenCovered); |
5235 __ALFFXLOGSTRING1("CAlfBridge::GfxTriggerEffectWhenFullScreenDrawn - Covered: %d", fullscreenCovered); |
5057 if (fullscreenCovered) |
5236 if (fullscreenCovered) |
5058 { |
5237 { |
5059 GfxTriggerEndFullScreen(iFullScreenEffectData); |
5238 GfxTriggerEndFullScreen(iFullScreenEffectData); |
5060 return ETrue; |
5239 return ETrue; |
5458 RecursiveStoreRenderBufferL(aCanvasVisual); |
5637 RecursiveStoreRenderBufferL(aCanvasVisual); |
5459 } |
5638 } |
5460 |
5639 |
5461 // clear out old effect if this visual has one |
5640 // clear out old effect if this visual has one |
5462 __ALFFXLOGSTRING2("HandleGfxControlEffectsL - loading effect %S on visual 0x%x", aEvent.iEffectName, aCanvasVisual ); |
5641 __ALFFXLOGSTRING2("HandleGfxControlEffectsL - loading effect %S on visual 0x%x", aEvent.iEffectName, aCanvasVisual ); |
5463 __ALFFXLOGSTRING1("HandleGfxControlEffectsL - loading control effect, handle %d", aEvent.iHandle ); |
5642 __ALFFXLOGSTRING2("HandleGfxControlEffectsL - loading control effect, handle %d, Action: %d", aEvent.iHandle, aEvent.iAction ); |
5464 if (aCanvasVisual->Effect()) |
5643 if (aCanvasVisual->Effect()) |
5465 { |
5644 { |
5466 __ALFFXLOGSTRING1("HandleGfxControlEffectsL - 0x%x has active effect. Requesting removal.", aCanvasVisual); |
5645 __ALFFXLOGSTRING1("HandleGfxControlEffectsL - 0x%x has active effect. Requesting removal.", aCanvasVisual); |
5467 // another effect coming to already effected visual. E.g. close options menu, while opening effect still ongoing |
5646 // another effect coming to already effected visual. E.g. close options menu, while opening effect still ongoing |
5468 RemoveTemporaryPresenterVisual(aCanvasVisual); |
5647 RemoveTemporaryPresenterVisual(aCanvasVisual); |
5469 } |
5648 } |
5470 TBool layoutEffectable(EFalse); |
5649 TBool layoutEffectable(EFalse); |
5471 if (aEvent.iAction == KGfxControlDisappearAction) |
5650 if (aEvent.iAction == KGfxControlDisappearAction) |
5472 { // TODO: revise |
5651 { |
5473 // The control stays visible because the inactive flag is not set |
5652 if (aCanvasVisual->Flags() & EHuiVisualFlagInactive) |
5474 // if the window is reserved. |
5653 { |
5475 /*if (aCanvasVisual->iOpacity.Target() == 0.0f) |
5654 __ALFFXLOGSTRING1("HandleGfxControlEffectsL - 0x%x is inactive. Skipping effect.", aCanvasVisual); |
5476 { |
5655 return; |
5477 // this visual was hidden, before the effect arrived. sounds like trouble. |
5656 } |
5478 // Lets make it visible again, and ask it to be hidden in the end of the effect |
|
5479 // this enables at least the notes disappear effects |
|
5480 aCanvasVisual->iOpacity.Set(KAlfVisualDefaultOpacity); |
|
5481 // visual->SetFlag(EHuiVisualFlagShouldBeHidden); |
|
5482 }*/ |
|
5483 layoutEffectable = SetupEffectLayoutContainerL(aEvent.iHandle, aCanvasVisual, EFalse, ETrue, EFalse); |
5657 layoutEffectable = SetupEffectLayoutContainerL(aEvent.iHandle, aCanvasVisual, EFalse, ETrue, EFalse); |
5484 } |
5658 } |
5485 else |
5659 else |
5486 { |
5660 { |
5487 layoutEffectable = SetupEffectLayoutContainerL(aEvent.iHandle, aCanvasVisual, EFalse, EFalse, EFalse); |
5661 layoutEffectable = SetupEffectLayoutContainerL(aEvent.iHandle, aCanvasVisual, EFalse, EFalse, EFalse); |
5826 // If there are already other handles in the queue, the handler will not |
6000 // If there are already other handles in the queue, the handler will not |
5827 // be called for this handle, but all handles that have been left hanging |
6001 // be called for this handle, but all handles that have been left hanging |
5828 // around will be cleared when HandleGfxStopEffectsL is called |
6002 // around will be cleared when HandleGfxStopEffectsL is called |
5829 |
6003 |
5830 // iFinishedCleanupStackEffects.Append(aHandle); |
6004 // iFinishedCleanupStackEffects.Append(aHandle); |
|
6005 |
|
6006 // check if the first part of application start effect finished |
|
6007 if (iFullScreenEffectData |
|
6008 && iFullScreenEffectData->iHandle == aHandle |
|
6009 && iFullScreenEffectData->iLongAppStartTimeout && iSecondaryFullScreenEffectData) |
|
6010 { |
|
6011 delete iFullScreenEffectData; |
|
6012 iFullScreenEffectData = iSecondaryFullScreenEffectData; |
|
6013 iSecondaryFullScreenEffectData = NULL; |
|
6014 iFullScreenEffectData->iTwoPhaseEffect = CFullScreenEffectState::ESecondPartActive; |
|
6015 if (iFullScreenEffectData->State() == EEndFullscreenReceived) |
|
6016 { |
|
6017 // Client notified of the EndFullScreen during the effect. Trigger the end part immediately. |
|
6018 __ALFFXLOGSTRING("CAlfBridge::AlfGfxEffectEndCallBack - End was received. Trigger second part."); |
|
6019 iFullScreenEffectData->SetState(ESecondPhaseSetupActive); // effect setup will be skipped in HandleGfxEvent |
|
6020 GfxTriggerEndFullScreen(iFullScreenEffectData); |
|
6021 iFullScreenEffectData->SetState(EFinalEffectActive); |
|
6022 // skip cleanup. It will be run, when this effect finishes |
|
6023 return; |
|
6024 } |
|
6025 else |
|
6026 { |
|
6027 iFullScreenEffectData->SetState(EWaitEndFullScreen); |
|
6028 } |
|
6029 |
|
6030 iFullScreenEffectData->iEffectType = CFullScreenEffectState::EStartEffect; |
|
6031 |
|
6032 CHuiControlGroup* toGroup = FindControlGroupByFullScreenToEffect(); |
|
6033 GfxTriggerEffectWhenFullScreenDrawn(toGroup); |
|
6034 return; |
|
6035 } |
|
6036 |
5831 if (!iEffectEndTimer->IsActive()) |
6037 if (!iEffectEndTimer->IsActive()) |
5832 { |
6038 { |
5833 TRAP_IGNORE(iEffectEndTimer->AddFinishedHandleL(aHandle)); |
6039 TRAP_IGNORE(iEffectEndTimer->AddFinishedHandleL(aHandle)); |
5834 iEffectEndTimer->Start(KEffectCleanupDelayInMs * 1000); |
6040 iEffectEndTimer->Start(KEffectCleanupDelayInMs * 1000); |
5835 } |
6041 } |