267 // a fade that does not belong to the theme may be in use. |
268 // a fade that does not belong to the theme may be in use. |
268 // --------------------------------------------------------------------------- |
269 // --------------------------------------------------------------------------- |
269 void CAlfBridge::RegisterFadeEffectL() |
270 void CAlfBridge::RegisterFadeEffectL() |
270 { |
271 { |
271 // TODO: RND, REMOVE MMC DRIVE-F, WHEN NOT REQUIRED FOR TESTING |
272 // TODO: RND, REMOVE MMC DRIVE-F, WHEN NOT REQUIRED FOR TESTING |
|
273 #ifdef USE_ALTERNATIVE_EFFECTS_FROM_MMC |
272 _LIT(KDrivePrefence,"FZC"); |
274 _LIT(KDrivePrefence,"FZC"); |
|
275 #else |
|
276 _LIT(KDrivePrefence,"Z"); |
|
277 #endif |
273 // Force register fade effect. Try first MMC, then ROM. |
278 // Force register fade effect. Try first MMC, then ROM. |
274 CHuiFxEngine* engine = iHuiEnv->EffectsEngine(); |
279 CHuiFxEngine* engine = iHuiEnv->EffectsEngine(); |
275 RFs& fs = CHuiStatic::FsSession(); |
280 RFs& fs = CHuiStatic::FsSession(); |
276 if (fs.Handle() && engine) |
281 if (fs.Handle() && engine) |
277 { |
282 { |
458 } |
463 } |
459 } |
464 } |
460 while(node); |
465 while(node); |
461 return NULL; |
466 return NULL; |
462 } |
467 } |
463 |
468 |
|
469 // --------------------------------------------------------------------------- |
|
470 // FindChainedGroup |
|
471 // --------------------------------------------------------------------------- |
|
472 // |
|
473 TUint32 CAlfBridge::FindChainedGroup( |
|
474 TUint32 aTreeNodeId) |
|
475 { |
|
476 THashMapIter<TUint32, TChainData> iter(iWindowChainsArray); |
|
477 TChainData const * data = 0; |
|
478 do |
|
479 { |
|
480 data = iter.NextValue(); |
|
481 if (data && data->iParent == aTreeNodeId) |
|
482 { |
|
483 TUint32 chainedTo = FindChainedGroup(data->iChainee); |
|
484 if (!chainedTo) |
|
485 { |
|
486 return data->iChainee; |
|
487 } |
|
488 else |
|
489 { |
|
490 return chainedTo; |
|
491 } |
|
492 } |
|
493 } |
|
494 while(data); |
|
495 return NULL; |
|
496 } |
|
497 |
|
498 // --------------------------------------------------------------------------- |
|
499 // IsChainedGroup |
|
500 // --------------------------------------------------------------------------- |
|
501 // |
|
502 TBool CAlfBridge::IsChainedGroup( |
|
503 TUint32 aTreeNodeId) |
|
504 { |
|
505 THashMapIter<TUint32, TChainData> iter(iWindowChainsArray); |
|
506 TChainData const * data = 0; |
|
507 do |
|
508 { |
|
509 data = iter.NextValue(); |
|
510 if (data && data->iChainee == aTreeNodeId) |
|
511 { |
|
512 return ETrue; |
|
513 } |
|
514 } |
|
515 while(data); |
|
516 return EFalse; |
|
517 } |
|
518 |
464 // --------------------------------------------------------------------------- |
519 // --------------------------------------------------------------------------- |
465 // --------------------------------------------------------------------------- |
520 // --------------------------------------------------------------------------- |
466 // |
521 // |
467 CHuiControlGroup* CAlfBridge::FindControlGroup(TInt aWindowGroupNodeId, TInt aScreenNumber ) |
522 CHuiControlGroup* CAlfBridge::FindControlGroup(TInt aWindowGroupNodeId, TInt aScreenNumber ) |
468 { |
523 { |
478 |
533 |
479 // --------------------------------------------------------------------------- |
534 // --------------------------------------------------------------------------- |
480 // FindClientWindowGroupId |
535 // FindClientWindowGroupId |
481 // --------------------------------------------------------------------------- |
536 // --------------------------------------------------------------------------- |
482 // |
537 // |
483 TInt CAlfBridge::FindClientWindowGroupId( TInt aScreenNumber, CHuiControlGroup& aControlGroup ) |
538 TInt CAlfBridge::FindClientWindowGroupId(CHuiControlGroup& aControlGroup ) |
484 { |
539 { |
485 for (TInt i=0; i<iAlfScreens[aScreenNumber]->iControlGroups.Count();i++) |
540 for (TInt i=0; i<iAlfScreens[0]->iControlGroups.Count();i++) |
486 { |
541 { |
487 if( iAlfScreens[aScreenNumber]->iControlGroups[i].iControlGroup == &aControlGroup ) |
542 if( iAlfScreens[0]->iControlGroups[i].iControlGroup == &aControlGroup ) |
488 { |
543 { |
489 return iAlfScreens[aScreenNumber]->iControlGroups[i].iClientWindowGroupId; |
544 return iAlfScreens[0]->iControlGroups[i].iClientWindowGroupId; |
490 } |
545 } |
491 } |
546 } |
492 return KErrNotFound; |
547 return KErrNotFound; |
493 } |
548 } |
494 |
549 |
495 // --------------------------------------------------------------------------- |
550 // --------------------------------------------------------------------------- |
496 // FindWindowGroupNodeId |
551 // FindWindowGroupNodeId |
497 // --------------------------------------------------------------------------- |
552 // --------------------------------------------------------------------------- |
498 // |
553 // |
499 TInt CAlfBridge::FindWindowGroupNodeId( TInt aScreenNumber, CHuiControlGroup& aControlGroup ) const |
554 TInt CAlfBridge::FindWindowGroupNodeId(CHuiControlGroup& aControlGroup ) const |
500 { |
555 { |
501 for (TInt i=0; i<iAlfScreens[aScreenNumber]->iControlGroups.Count();i++) |
556 for (TInt i=0; i<iAlfScreens[0]->iControlGroups.Count();i++) |
502 { |
557 { |
503 if( iAlfScreens[aScreenNumber]->iControlGroups[i].iControlGroup == &aControlGroup ) |
558 if( iAlfScreens[0]->iControlGroups[i].iControlGroup == &aControlGroup ) |
504 { |
559 { |
505 return iAlfScreens[aScreenNumber]->iControlGroups[i].iWindowGroupNodeId; |
560 return iAlfScreens[0]->iControlGroups[i].iWindowGroupNodeId; |
506 } |
561 } |
507 } |
562 } |
508 return KErrNotFound; |
563 return KErrNotFound; |
509 } |
564 } |
510 |
565 |
571 return groupEntry.iControlGroup; |
626 return groupEntry.iControlGroup; |
572 } |
627 } |
573 } |
628 } |
574 } |
629 } |
575 return NULL; |
630 return NULL; |
|
631 } |
|
632 |
|
633 // --------------------------------------------------------------------------- |
|
634 // FindControlGroupBySecureId |
|
635 // May return multiple groups |
|
636 // --------------------------------------------------------------------------- |
|
637 // |
|
638 void CAlfBridge::FindControlGroupBySecureId( TInt aSecureId, RPointerArray<CHuiControlGroup>& aGroupList) |
|
639 { |
|
640 if ( aSecureId == 0 ) |
|
641 { |
|
642 return; |
|
643 } |
|
644 |
|
645 for ( TInt i = 0; i < iAlfScreens[0]->iControlGroups.Count(); i++ ) |
|
646 { |
|
647 TAlfControlGroupEntry& groupEntry = iAlfScreens[0]->iControlGroups[i]; |
|
648 if ( groupEntry.iSecureId == aSecureId ) |
|
649 { |
|
650 aGroupList.Append(groupEntry.iControlGroup); |
|
651 } |
|
652 } |
576 } |
653 } |
577 |
654 |
578 // --------------------------------------------------------------------------- |
655 // --------------------------------------------------------------------------- |
579 // FindControlGroupByFullScreenToEffect |
656 // FindControlGroupByFullScreenToEffect |
580 // --------------------------------------------------------------------------- |
657 // --------------------------------------------------------------------------- |
1087 TBool lSyncDone(EFalse); |
1164 TBool lSyncDone(EFalse); |
1088 if (lSyncAlfAppAndAlfEventGroup && i< (aRoster.Count()-1) ) |
1165 if (lSyncAlfAppAndAlfEventGroup && i< (aRoster.Count()-1) ) |
1089 { |
1166 { |
1090 lSyncDone = ETrue; |
1167 lSyncDone = ETrue; |
1091 CHuiControlGroup &lGroup = aRoster.ControlGroup(i+1); |
1168 CHuiControlGroup &lGroup = aRoster.ControlGroup(i+1); |
1092 TInt clientWindowGroupId = FindClientWindowGroupId( aScreenNumber, lGroup ); |
1169 TInt clientWindowGroupId = FindClientWindowGroupId(lGroup ); |
1093 iAppUi->AdjustWindowGroupPositionL(clientWindowGroupId,CAlfAppServer::EBehindOfParent); |
1170 iAppUi->AdjustWindowGroupPositionL(clientWindowGroupId,CAlfAppServer::EBehindOfParent); |
1094 } |
1171 } |
1095 if(!lSyncDone && aGroup.iAlfApp && aRoster.ControlGroup(i-1).ResourceId() != iAlfWindowGroupNodeId ) |
1172 if(!lSyncDone && aGroup.iAlfApp && aRoster.ControlGroup(i-1).ResourceId() != iAlfWindowGroupNodeId ) |
1096 { |
1173 { |
1097 |
1174 |
1098 CHuiControlGroup &lGroup = aRoster.ControlGroup(i); |
1175 CHuiControlGroup &lGroup = aRoster.ControlGroup(i); |
1099 TInt clientWindowGroupId = FindClientWindowGroupId( aScreenNumber, lGroup ); |
1176 TInt clientWindowGroupId = FindClientWindowGroupId(lGroup ); |
1100 iAppUi->AdjustWindowGroupPositionL(clientWindowGroupId,CAlfAppServer::EBehindOfParent); |
1177 iAppUi->AdjustWindowGroupPositionL(clientWindowGroupId,CAlfAppServer::EBehindOfParent); |
1101 } |
1178 } |
1102 break; |
1179 break; |
1103 } |
1180 } |
1104 |
1181 |
1628 HandleLayoutVisualVisibility( layout, controlgroup, control, |
1709 HandleLayoutVisualVisibility( layout, controlgroup, control, |
1629 fullscreenCovered, fullscreen, screen, |
1710 fullscreenCovered, fullscreen, screen, |
1630 subTreeCovered, hasLayers, IsVisualOpaque(*layout) ); |
1711 subTreeCovered, hasLayers, IsVisualOpaque(*layout) ); |
1631 } |
1712 } |
1632 |
1713 |
1633 |
1714 if ( hasLayers && iActivated ) |
1634 TBool hasFadeEffectsInVisualTree = (layout->CanvasFlags() & EHuiCanvasFlagExternalFadeExistsInsideVisualTree); |
1715 { |
1635 |
1716 HandleLayerVisibility( layout, controlgroup, control, hasActiveVisualsInVisualTree ); |
|
1717 } |
|
1718 |
|
1719 TBool isLayoutActive = !(layout->Flags() & EHuiVisualFlagInactive); |
|
1720 |
|
1721 // we need to set /clear inactive flags before we evaluate the fade effect, |
|
1722 // otherwise the fade effect will be removed without a reason in |
|
1723 // some use cases |
|
1724 if (isLayoutActive && (fullscreenCovered || (!hasActiveVisualsInVisualTree && !IsOpaqueEffect(layout->Effect())))) |
|
1725 { |
|
1726 // don't inactivate alf event wg if alf client is visible |
|
1727 if( !( alfClientWindowGroupVisible && (controlgroup.ResourceId() == iAlfWindowGroupNodeId)) ) |
|
1728 // Setting also the root visual (layout) as inactive, if it had none |
|
1729 // active children. This is because otherwise the Inactive checks won't |
|
1730 // work correctly within RosterImpl ScanDirty & ClearChanged phases. |
|
1731 // If root visual is having an opaque effect, it must remain active |
|
1732 { |
|
1733 layout->SetFlag(EHuiVisualFlagInactive); |
|
1734 } |
|
1735 } |
|
1736 else if(!isLayoutActive && !fullscreenCovered && (hasActiveVisualsInVisualTree || IsOpaqueEffect(layout->Effect())) || |
|
1737 (alfClientWindowGroupVisible && (controlgroup.ResourceId() == iAlfWindowGroupNodeId)) ) |
|
1738 { |
|
1739 layout->ClearFlag(EHuiVisualFlagInactive); |
|
1740 layout->SetPos(fullscreen.iTl); |
|
1741 layout->SetSize(fullscreen.Size()); |
|
1742 |
|
1743 // New visible window group may have received effect just before appearing to the screen. |
|
1744 // start the effect if this is the case. |
|
1745 if(iFSFxData && iFSFxData->iToSecureId == controlgroup.SecureId() ) |
|
1746 { |
|
1747 TInt windowGroupId = FindClientWindowGroupId(controlgroup); |
|
1748 |
|
1749 if (iFSFxData->iToWg == windowGroupId && iFSFxData->State() == EWaitEndFullScreen && |
|
1750 iFSFxData->iTwoPhaseEffect <= CFullScreenEffectState::ESecondPartActive) |
|
1751 { |
|
1752 GfxTriggerEffectWhenFullScreenDrawn(&controlgroup); |
|
1753 } |
|
1754 } |
|
1755 } |
|
1756 |
|
1757 // If root visuals effect is marked as opaque, then add whole screen area as covered. |
|
1758 if (!fullscreenCovered) |
|
1759 { |
|
1760 fullscreenCovered = IsOpaqueEffect(layout->Effect()); |
|
1761 } |
|
1762 |
|
1763 |
1636 // if native alf app is found visible and the client it self is not covering whole screen, we can assume that alf content |
1764 // if native alf app is found visible and the client it self is not covering whole screen, we can assume that alf content |
1637 // fills the rest. |
1765 // fills the rest. |
1638 // this is for embedded native alf application cases. Otherwise chained window groups tend to |
1766 // this is for embedded native alf application cases. Otherwise chained window groups tend to |
1639 // flicker from time to time |
1767 // flicker from time to time |
1640 // also if alfcontent is not hided below avkon content the fading effect would reveal alfconent |
1768 // also if alfcontent is not hided below avkon content the fading effect would reveal alfconent |
1647 iTempRegion.Tidy(); |
1775 iTempRegion.Tidy(); |
1648 fullscreenCovered = ETrue; |
1776 fullscreenCovered = ETrue; |
1649 alfClientWindowGroupVisible = ETrue; |
1777 alfClientWindowGroupVisible = ETrue; |
1650 } |
1778 } |
1651 } |
1779 } |
1652 |
|
1653 // If root visuals effect is marked as opaque, then add whole screen area as covered. |
|
1654 if (!fullscreenCovered) |
|
1655 { |
|
1656 fullscreenCovered = IsOpaqueEffect(layout->Effect()); |
|
1657 } |
|
1658 |
|
1659 if ( hasLayers && iActivated ) |
|
1660 { |
|
1661 HandleLayerVisibility( layout, controlgroup, control, hasActiveVisualsInVisualTree ); |
|
1662 } |
|
1663 |
|
1664 TBool isLayoutActive = !(layout->Flags() & EHuiVisualFlagInactive); |
|
1665 |
|
1666 // we need to set /clear inactive flags before we evaluate the fade effect, |
|
1667 // otherwise the fade effect will be removed without a reason in |
|
1668 // some use cases |
|
1669 if (isLayoutActive && !hasActiveVisualsInVisualTree && !IsOpaqueEffect(layout->Effect())) |
|
1670 { |
|
1671 // Setting also the root visual (layout) as inactive, if it had none |
|
1672 // active children. This is because otherwise the Inactive checks won't |
|
1673 // work correctly within RosterImpl ScanDirty & ClearChanged phases. |
|
1674 // If root visual is having an opaque effect, it must remain active |
|
1675 layout->SetFlag(EHuiVisualFlagInactive); |
|
1676 } |
|
1677 else if(!isLayoutActive && (hasActiveVisualsInVisualTree || IsOpaqueEffect(layout->Effect()))) |
|
1678 { |
|
1679 layout->ClearFlag(EHuiVisualFlagInactive); |
|
1680 layout->SetPos(fullscreen.iTl); |
|
1681 layout->SetSize(fullscreen.Size()); |
|
1682 } |
|
1683 |
|
1684 |
1780 |
|
1781 TBool hasFadeEffectsInVisualTree = (layout->CanvasFlags() & EHuiCanvasFlagExternalFadeExistsInsideVisualTree); |
|
1782 |
1685 // If we layout is active setup the fade effects. Also if it is inactive, but has been |
1783 // If we layout is active setup the fade effects. Also if it is inactive, but has been |
1686 // flagged as containing fade effect, then run the setup as well so that effects which |
1784 // flagged as containing fade effect, then run the setup as well so that effects which |
1687 // are no more needed get removed. |
1785 // are no more needed get removed. |
1688 if (hasActiveVisualsInVisualTree || (!hasActiveVisualsInVisualTree && hasFadeEffectsInVisualTree)) |
1786 if (hasActiveVisualsInVisualTree || (!hasActiveVisualsInVisualTree && hasFadeEffectsInVisualTree)) |
1689 { |
1787 { |
2666 void CAlfBridge::HandleNewWindowL( TAlfBridgerData& aData ) |
2762 void CAlfBridge::HandleNewWindowL( TAlfBridgerData& aData ) |
2667 { |
2763 { |
2668 TInt windowGroupNodeId = aData.iInt1; |
2764 TInt windowGroupNodeId = aData.iInt1; |
2669 TInt windowNodeId = aData.iInt2; |
2765 TInt windowNodeId = aData.iInt2; |
2670 TAlfWindowAttributes* windowAttributes = (TAlfWindowAttributes*) (*iHost)->GetVarDataL( (TInt)aData.iPtr ); |
2766 TAlfWindowAttributes* windowAttributes = (TAlfWindowAttributes*) (*iHost)->GetVarDataL( (TInt)aData.iPtr ); |
2671 TInt screenNumber = windowAttributes->iScreenNumber; |
|
2672 __ALFLOGSTRING1("CAlfBridge::HandleNewWindowL: new window %d!",windowNodeId); |
2767 __ALFLOGSTRING1("CAlfBridge::HandleNewWindowL: new window %d!",windowNodeId); |
2673 |
2768 |
2674 switch (windowAttributes->iWindowNodeType) |
2769 switch (windowAttributes->iWindowNodeType) |
2675 { |
2770 { |
2676 case EAlfWinTreeNodeGroup: |
2771 case EAlfWinTreeNodeGroup: |
2677 { |
2772 { |
2678 CHuiControlGroup& controlGroup = CreateControlGroupL( |
2773 CHuiControlGroup& controlGroup = CreateControlGroupL( |
2679 windowGroupNodeId, |
2774 windowGroupNodeId, |
2680 windowAttributes->iClientHandle, |
2775 windowAttributes->iClientHandle, |
2681 windowAttributes->iSecureId, |
2776 windowAttributes->iSecureId, |
2682 screenNumber); |
2777 0 // Only one screen for avkon content supported |
|
2778 ); |
2683 |
2779 |
2684 // We just received notification for our own window group creation, store its node id for doing |
2780 // We just received notification for our own window group creation, store its node id for doing |
2685 // faster lookups later... |
2781 // faster lookups later... |
2686 if (windowAttributes->iClientHandle == iAlfWindowGroupId) |
2782 if (windowAttributes->iClientHandle == iAlfWindowGroupId) |
2687 { |
2783 { |
2693 case EAlfWinTreeNodeRoot: // TODO: Root window receives drawing commands too |
2789 case EAlfWinTreeNodeRoot: // TODO: Root window receives drawing commands too |
2694 case EAlfWinTreeNodeAnim: |
2790 case EAlfWinTreeNodeAnim: |
2695 case EAlfWinTreeNodeSprite: |
2791 case EAlfWinTreeNodeSprite: |
2696 case EAlfWinTreeNodeTextCursor: |
2792 case EAlfWinTreeNodeTextCursor: |
2697 { |
2793 { |
2698 CHuiControlGroup* controlGroup = FindControlGroup(windowGroupNodeId,screenNumber); |
2794 CHuiControlGroup* controlGroup = FindControlGroup(windowGroupNodeId); |
2699 // Floating sprites only require own group. Normal sprites should behave as normal visuals. |
2795 // Floating sprites only require own group. Normal sprites should behave as normal visuals. |
2700 if (!controlGroup && windowAttributes->iWindowNodeType == EAlfWinTreeNodeSprite ) |
2796 if (!controlGroup && windowAttributes->iWindowNodeType == EAlfWinTreeNodeSprite ) |
2701 { |
2797 { |
2702 controlGroup = iAlfScreens[screenNumber]->iFloatingSpriteControlGroup; |
2798 controlGroup = iAlfScreens[0]->iFloatingSpriteControlGroup; |
2703 } |
2799 } |
2704 |
2800 |
2705 if (controlGroup) |
2801 if (controlGroup) |
2706 { |
2802 { |
2707 CHuiControl& control = controlGroup->Control(0); |
2803 CHuiControl& control = controlGroup->Control(0); |
2858 { |
2954 { |
2859 TInt windowGroupNodeId = aData.iInt1; |
2955 TInt windowGroupNodeId = aData.iInt1; |
2860 TInt windowNodeId = aData.iInt2; |
2956 TInt windowNodeId = aData.iInt2; |
2861 |
2957 |
2862 TAlfWindowAttributes* windowAttributes = (TAlfWindowAttributes*) (*iHost)->GetVarDataL( (TInt)aData.iPtr ); |
2958 TAlfWindowAttributes* windowAttributes = (TAlfWindowAttributes*) (*iHost)->GetVarDataL( (TInt)aData.iPtr ); |
2863 TInt screenNumber = windowAttributes->iScreenNumber; |
2959 |
2864 |
|
2865 switch (windowAttributes->iWindowNodeType) |
2960 switch (windowAttributes->iWindowNodeType) |
2866 { |
2961 { |
2867 case EAlfWinTreeNodeGroup: |
2962 case EAlfWinTreeNodeGroup: |
2868 { |
2963 { |
2869 HandleVisualVisibility(0); |
2964 HandleVisualVisibility(0); |
2870 DeleteControlGroupL(windowGroupNodeId, screenNumber); |
2965 DeleteControlGroupL(windowGroupNodeId); |
2871 break; |
2966 break; |
2872 } |
2967 } |
2873 case EAlfWinTreeNodeClient: |
2968 case EAlfWinTreeNodeClient: |
2874 case EAlfWinTreeNodeRoot: |
2969 case EAlfWinTreeNodeRoot: |
2875 case EAlfWinTreeNodeAnim: |
2970 case EAlfWinTreeNodeAnim: |
2885 |
2980 |
2886 //just remove the visual |
2981 //just remove the visual |
2887 CHuiCanvasVisual* viz; |
2982 CHuiCanvasVisual* viz; |
2888 |
2983 |
2889 viz = (CHuiCanvasVisual*)FindVisual(windowNodeId); |
2984 viz = (CHuiCanvasVisual*)FindVisual(windowNodeId); |
2890 CHuiControlGroup* controlGroup = FindControlGroup( windowGroupNodeId, screenNumber ); |
2985 CHuiControlGroup* controlGroup = FindControlGroup( windowGroupNodeId); |
2891 // Sprite is in its own group, and can be deleted normally. |
2986 // Sprite is in its own group, and can be deleted normally. |
2892 if ( !controlGroup && windowAttributes->iWindowNodeType != EAlfWinTreeNodeSprite ) |
2987 if ( !controlGroup && windowAttributes->iWindowNodeType != EAlfWinTreeNodeSprite ) |
2893 { |
2988 { |
2894 __ALFLOGSTRING("CAlfBridge::HandleDestroyWindowL: group containing this visual has been destroyed."); |
2989 __ALFLOGSTRING("CAlfBridge::HandleDestroyWindowL: group containing this visual has been destroyed."); |
2895 // the group containing this visual has been destroyed. |
2990 // the group containing this visual has been destroyed. |
2925 break; |
3020 break; |
2926 } |
3021 } |
2927 } |
3022 } |
2928 // TODO: Toolkit does not support recycling (of visuals), |
3023 // TODO: Toolkit does not support recycling (of visuals), |
2929 // this is not in line with Nokia environmental policy... |
3024 // this is not in line with Nokia environmental policy... |
2930 iAlfScreens[screenNumber]->SetVisualTreeVisibilityChanged(ETrue); |
3025 iAlfScreens[0]->SetVisualTreeVisibilityChanged(ETrue); |
2931 } |
3026 } |
2932 |
3027 |
2933 // --------------------------------------------------------------------------- |
3028 // --------------------------------------------------------------------------- |
2934 // HandleSetWindowPosL |
3029 // HandleSetWindowPosL |
2935 // --------------------------------------------------------------------------- |
3030 // --------------------------------------------------------------------------- |
2936 // |
3031 // |
2937 void CAlfBridge::HandleSetWindowPosL( TAlfBridgerData& aData ) |
3032 void CAlfBridge::HandleSetWindowPosL( TAlfBridgerData& aData ) |
2938 { |
3033 { |
2939 TInt windowNodeId = aData.iInt2; |
3034 TInt windowNodeId = aData.iInt2; |
2940 TAlfWindowAttributes* windowAttributes = (TAlfWindowAttributes*) (*iHost)->GetVarDataL( (TInt)aData.iPtr ); |
3035 TAlfWindowAttributes* windowAttributes = (TAlfWindowAttributes*) (*iHost)->GetVarDataL( (TInt)aData.iPtr ); |
2941 TInt screenNumber = windowAttributes->iScreenNumber; |
|
2942 // fetch visual |
3036 // fetch visual |
2943 CHuiVisual* viz = FindVisual(windowNodeId); |
3037 CHuiVisual* viz = FindVisual(windowNodeId); |
2944 if (viz) |
3038 if (viz) |
2945 { |
3039 { |
2946 #ifdef HUI_DEBUG_TRACK_DRAWING |
3040 #ifdef HUI_DEBUG_TRACK_DRAWING |
3034 // |
3127 // |
3035 void CAlfBridge::HandleSetWindowOpacityL( TAlfBridgerData& aData ) |
3128 void CAlfBridge::HandleSetWindowOpacityL( TAlfBridgerData& aData ) |
3036 { |
3129 { |
3037 TInt windowNodeId = aData.iInt2; |
3130 TInt windowNodeId = aData.iInt2; |
3038 TAlfWindowAttributes* windowAttributes = (TAlfWindowAttributes*) (*iHost)->GetVarDataL( (TInt)aData.iPtr ); |
3131 TAlfWindowAttributes* windowAttributes = (TAlfWindowAttributes*) (*iHost)->GetVarDataL( (TInt)aData.iPtr ); |
3039 TInt screenNumber = windowAttributes->iScreenNumber; |
|
3040 // fetch visual |
3132 // fetch visual |
3041 CHuiVisual* viz = FindVisual(windowNodeId); |
3133 CHuiVisual* viz = FindVisual(windowNodeId); |
3042 if (viz) |
3134 if (viz) |
3043 { |
3135 { |
3044 #ifdef HUI_DEBUG_TRACK_DRAWING |
3136 #ifdef HUI_DEBUG_TRACK_DRAWING |
3045 if ( viz->Tracking() ) |
3137 if ( viz->Tracking() ) |
3046 { |
3138 { |
3047 RDebug::Print(_L("CAlfBridge::HandleSetWindowOpacityL - Tracked visual")); |
3139 RDebug::Print(_L("CAlfBridge::HandleSetWindowOpacityL - Tracked visual")); |
3048 } |
3140 } |
3049 #endif |
3141 #endif |
3050 viz->iOpacity.Set(windowAttributes->iOpacity, windowAttributes->iTransitionTime); |
3142 viz->iOpacity.Set(windowAttributes->iOpacity, windowAttributes->iTransitionTime); |
3051 iAlfScreens[screenNumber]->SetVisualTreeVisibilityChanged(ETrue); // TODO: Check if really changed |
3143 iAlfScreens[0]->SetVisualTreeVisibilityChanged(ETrue); // TODO: Check if really changed |
3052 } |
3144 } |
3053 else |
3145 else |
3054 { |
3146 { |
3055 __ALFLOGSTRING("CAlfBridge::HandleSetWindowOpacityL, EAlfDSSetWindowOpacity: Visual not found!"); |
3147 __ALFLOGSTRING("CAlfBridge::HandleSetWindowOpacityL, EAlfDSSetWindowOpacity: Visual not found!"); |
3056 } |
3148 } |
3057 } |
3149 } |
3140 void CAlfBridge::HandleSetWindowAreaL( TAlfBridgerData& aData ) |
3230 void CAlfBridge::HandleSetWindowAreaL( TAlfBridgerData& aData ) |
3141 { |
3231 { |
3142 TInt windowNodeId = aData.iInt2; |
3232 TInt windowNodeId = aData.iInt2; |
3143 TAny* ptr = (TAny*)(*iHost)->GetVarDataL( (TInt)aData.iPtr ); |
3233 TAny* ptr = (TAny*)(*iHost)->GetVarDataL( (TInt)aData.iPtr ); |
3144 |
3234 |
3145 TInt screenNumber = 0; |
|
3146 TPoint origin; |
3235 TPoint origin; |
3147 TInt count = 0; |
3236 TInt count = 0; |
3148 RRegion region; |
3237 RRegion region; |
3149 CleanupClosePushL( region ); |
3238 CleanupClosePushL( region ); |
3150 |
3239 |
3151 { |
3240 { |
3152 RMemReadStream str(ptr, 4*sizeof(TInt32)); |
3241 RMemReadStream str(ptr, 4*sizeof(TInt32)); |
3153 screenNumber = str.ReadInt32L(); |
3242 str.ReadInt32L(); // screen number, obsolete |
3154 origin.iX = str.ReadInt32L(); |
3243 origin.iX = str.ReadInt32L(); |
3155 origin.iY = str.ReadInt32L(); |
3244 origin.iY = str.ReadInt32L(); |
3156 count = str.ReadInt32L(); |
3245 count = str.ReadInt32L(); |
3157 str.Release(); |
3246 str.Release(); |
3158 } |
3247 } |
3225 { |
3313 { |
3226 __ALFLOGSTRING1("CAlfBridge::HandleReorderWindowL, EAlfDSReorder: WS window group going to: %d ",windowAttributes->iOrdinalPosition); |
3314 __ALFLOGSTRING1("CAlfBridge::HandleReorderWindowL, EAlfDSReorder: WS window group going to: %d ",windowAttributes->iOrdinalPosition); |
3227 } |
3315 } |
3228 #endif |
3316 #endif |
3229 |
3317 |
3230 CHuiControlGroup* controlGroup = FindControlGroup(windowGroupNodeId,screenNumber); |
3318 CHuiControlGroup* controlGroup = FindControlGroup(windowGroupNodeId); |
3231 |
3319 |
3232 if (!controlGroup) |
3320 if (!controlGroup) |
3233 { |
3321 { |
3234 User::Leave(KErrNotFound); |
3322 User::Leave(KErrNotFound); |
3235 } |
3323 } |
3236 ResolveAfterEffectAppearingApplicationL(controlGroup); // does nothing, if effect is not active on this control group |
3324 ResolveAfterEffectAppearingApplicationL(controlGroup); // does nothing, if effect is not active on this control group |
3237 // Window server nodes are in inverted Z-order, we switch it here. |
3325 // Window server nodes are in inverted Z-order, we switch it here. |
3238 iAlfScreens[screenNumber]->iDisplay->Roster().Hide(*controlGroup); |
3326 iAlfScreens[0]->iDisplay->Roster().Hide(*controlGroup); |
3239 TInt wsWindowGroupCount = 0; |
3327 TInt wsWindowGroupCount = 0; |
3240 for (TInt i=0; i<iAlfScreens[screenNumber]->iDisplay->Roster().Count();i++) |
3328 for (TInt i=0; i<iAlfScreens[0]->iDisplay->Roster().Count();i++) |
3241 { |
3329 { |
3242 if (iAlfScreens[screenNumber]->iDisplay->Roster().ControlGroup(i).Control(0).Role()==EHuiWindowGroupContainer) |
3330 if (iAlfScreens[0]->iDisplay->Roster().ControlGroup(i).Control(0).Role()==EHuiWindowGroupContainer) |
3243 { |
3331 { |
3244 wsWindowGroupCount++; |
3332 wsWindowGroupCount++; |
3245 } |
3333 } |
3246 } |
3334 } |
3247 ordinalPosition = wsWindowGroupCount - windowAttributes->iOrdinalPosition; |
3335 ordinalPosition = wsWindowGroupCount - windowAttributes->iOrdinalPosition; |
3255 if (ordinalPosition < -1) |
3343 if (ordinalPosition < -1) |
3256 { |
3344 { |
3257 ordinalPosition = -1; // show at top ? |
3345 ordinalPosition = -1; // show at top ? |
3258 } |
3346 } |
3259 |
3347 |
3260 if (iAlfScreens[screenNumber]->iDisplay && controlGroup) |
3348 if (iAlfScreens[0]->iDisplay && controlGroup) |
3261 { |
3349 { |
3262 ShowControlGroupL(iAlfScreens[screenNumber]->iDisplay->Roster(), *controlGroup, ordinalPosition, screenNumber); |
3350 ShowControlGroupL(iAlfScreens[0]->iDisplay->Roster(), *controlGroup, ordinalPosition); |
3263 } |
3351 } |
3264 else |
3352 else |
3265 { |
3353 { |
3266 __ALFLOGSTRING2("CAlfBridge::HandleReorderWindowL, EAlfDSReorder: Control group not found! Screen: %d, Id: %d ", screenNumber, windowNodeId ); |
3354 __ALFLOGSTRING1("CAlfBridge::HandleReorderWindowL, EAlfDSReorder: Control group not found! Id: %d ", windowNodeId ); |
3267 } |
3355 } |
3268 |
3356 |
3269 ReorderAlfControlGroupsL(screenNumber); |
3357 ReorderAlfControlGroupsL(); |
3270 break; |
3358 break; |
3271 } |
3359 } |
3272 case EAlfWinTreeNodeClient: |
3360 case EAlfWinTreeNodeClient: |
3273 case EAlfWinTreeNodeRoot: |
3361 case EAlfWinTreeNodeRoot: |
3274 case EAlfWinTreeNodeAnim: |
3362 case EAlfWinTreeNodeAnim: |
3339 || ( viz && viz->Flags() & EHuiVisualFlagDrawAfterOthers )/* THIS LINE IS HACK FOR DRAWING FLOATING SPRITES */ ) |
3426 || ( viz && viz->Flags() & EHuiVisualFlagDrawAfterOthers )/* THIS LINE IS HACK FOR DRAWING FLOATING SPRITES */ ) |
3340 { |
3427 { |
3341 #ifdef HUI_DEBUG_TRACK_DRAWING |
3428 #ifdef HUI_DEBUG_TRACK_DRAWING |
3342 TBool tracking( EFalse ); |
3429 TBool tracking( EFalse ); |
3343 CHuiControlGroup* controlGroup = FindControlGroup( windowGroupNodeId, screenNumber ); |
3430 CHuiControlGroup* controlGroup = FindControlGroup( windowGroupNodeId, screenNumber ); |
3344 CAlfScreen* screen = iAlfScreens[screenNumber]; |
3431 CAlfScreen* screen = iAlfScreens[0]; |
3345 |
3432 |
3346 //TInt clientWindowGroupId = FindClientWindowGroupId( screenNumber, *controlGroup ); |
3433 //TInt clientWindowGroupId = FindClientWindowGroupId( screenNumber, *controlGroup ); |
3347 // NOTE, THE FOLLOWING WServClientFileName MAY CAUSE DEADLOCK. |
3434 // NOTE, THE FOLLOWING WServClientFileName MAY CAUSE DEADLOCK. |
3348 // THIS DOES NOT HAPPEN IF HUI_DEBUG_TRACK_DRAWING IS NOT ENABLED (DEFAULT) |
3435 // THIS DOES NOT HAPPEN IF HUI_DEBUG_TRACK_DRAWING IS NOT ENABLED (DEFAULT) |
3349 TFileName processName;/* = iCommandDebug->WServClientFileName( clientWindowGroupId, CHuiStatic::WsSession() ); |
3436 TFileName processName;/* = iCommandDebug->WServClientFileName( clientWindowGroupId, CHuiStatic::WsSession() ); |
3423 break; |
3510 break; |
3424 } |
3511 } |
3425 } |
3512 } |
3426 else |
3513 else |
3427 { |
3514 { |
3428 __ALFLOGSTRING3("CAlfBridge::HandlePostCanvasBufferL, EAlfDSPostCanvasBuffer: Visual not found! Screen: %d, Id: %d, GroupId: %d ", screenNumber, windowNodeId, windowGroupNodeId ); |
3515 __ALFLOGSTRING2("CAlfBridge::HandlePostCanvasBufferL, EAlfDSPostCanvasBuffer: Visual not found! Id: %d, GroupId: %d ", windowNodeId, windowGroupNodeId ); |
3429 } |
3516 } |
|
3517 // Uncomment the following for tracking which application is doing drawing |
|
3518 //__ALFFXLOGSTRING1("CAlfBridge::HandlePostCanvasBufferL 0x%x", viz->Owner().ControlGroup()->SecureId()); |
3430 #ifdef USE_APPLICATION_ENDFULLSCREEN_TIMEOUT |
3519 #ifdef USE_APPLICATION_ENDFULLSCREEN_TIMEOUT |
3431 if (iFSFxData |
3520 if (iFSFxData |
3432 && iFSFxData->iEffectType != CFullScreenEffectState::ENotDefinedEffect |
3521 && iFSFxData->iEffectType != CFullScreenEffectState::ENotDefinedEffect |
3433 && ((iFSFxData->State() == EWaitEndFullScreen && iFSFxData->iTwoPhaseEffect <= CFullScreenEffectState::EFirstPartRunning))) |
3522 && ((iFSFxData->State() == EWaitEndFullScreen && iFSFxData->iTwoPhaseEffect <= CFullScreenEffectState::ESecondPartActive))) |
3434 { |
3523 { |
3435 CHuiControlGroup *to_group = NULL; |
3524 CHuiControlGroup *to_group = NULL; |
3436 if (iFSFxData->iEffectType == CFullScreenEffectState::EExitEffect) |
3525 if (iFSFxData->iEffectType == CFullScreenEffectState::EExitEffect) |
3437 { |
3526 { |
3438 to_group = FindControlGroupByFullScreenFromEffect(); |
3527 to_group = FindControlGroupByFullScreenFromEffect(); |
4332 } |
4418 } |
4333 |
4419 |
4334 return (didFadeEffectLoad || alreadyFaded); |
4420 return (didFadeEffectLoad || alreadyFaded); |
4335 } |
4421 } |
4336 |
4422 |
|
4423 // --------------------------------------------------------------------------- |
|
4424 // HandleGroupChained |
|
4425 // |
|
4426 // Chain information is used for redirecting effects to correct windowgroup |
|
4427 // --------------------------------------------------------------------------- |
|
4428 // |
|
4429 void CAlfBridge::HandleGroupChained( TAlfBridgerData& aData) |
|
4430 { |
|
4431 TInt parentId = aData.iInt1; |
|
4432 TInt chainedId = aData.iInt2; |
|
4433 |
|
4434 TChainData data(parentId, chainedId); |
|
4435 iWindowChainsArray.Insert(parentId,data); |
|
4436 __ALFFXLOGSTRING3("CAlfBridge::DoDispatchL, EAlfDSGroupChained %d chained to %d (host), iWindowChainsArray.Count() = %d", chainedId, parentId, iWindowChainsArray.Count()); |
|
4437 #ifdef _ALF_FXLOGGING |
|
4438 CHuiControlGroup* parent = FindControlGroup(parentId); |
|
4439 CHuiControlGroup* chained = FindControlGroup(chainedId); |
|
4440 |
|
4441 if (parent) |
|
4442 { |
|
4443 RDebug::Printf("CAlfBridge::DoDispatch - parent: 0x%x", parent->SecureId()); |
|
4444 } |
|
4445 if (chained) |
|
4446 { |
|
4447 RDebug::Printf("CAlfBridge::DoDispatch - chained: 0x%x", chained->SecureId()); |
|
4448 } |
|
4449 #endif |
|
4450 } |
|
4451 |
|
4452 // --------------------------------------------------------------------------- |
|
4453 // HandleGroupChainBroken |
|
4454 // --------------------------------------------------------------------------- |
|
4455 // |
|
4456 void CAlfBridge::HandleGroupChainBroken( TAlfBridgerData& aData) |
|
4457 { |
|
4458 TInt parentId = aData.iInt2; |
|
4459 iWindowChainsArray.Remove(parentId); |
|
4460 __ALFFXLOGSTRING2("CAlfBridge::DoDispatchL, EAlfDSGroupChainBroken - parent: %d, iWindowChainsArray.Count() = %d", parentId, iWindowChainsArray.Count()); |
|
4461 } |
4337 |
4462 |
4338 // --------------------------------------------------------------------------- |
4463 // --------------------------------------------------------------------------- |
4339 // HandleMoveWindowToNewGroupL |
4464 // HandleMoveWindowToNewGroupL |
4340 // --------------------------------------------------------------------------- |
4465 // --------------------------------------------------------------------------- |
4341 // |
4466 // |
4342 void CAlfBridge::HandleMoveWindowToNewGroupL( TAlfBridgerData& aData ) |
4467 void CAlfBridge::HandleMoveWindowToNewGroupL( TAlfBridgerData& aData ) |
4343 { |
4468 { |
4344 TInt windowNodeId = aData.iInt1; |
4469 TInt windowNodeId = aData.iInt1; |
4345 TInt screenNumber = aData.iInt2; |
|
4346 TInt newWindowGroupNodeId = (TInt)aData.iPtr; |
4470 TInt newWindowGroupNodeId = (TInt)aData.iPtr; |
4347 |
4471 |
4348 CHuiCanvasVisual* viz = (CHuiCanvasVisual*)FindVisual(windowNodeId); |
4472 CHuiCanvasVisual* viz = (CHuiCanvasVisual*)FindVisual(windowNodeId); |
4349 |
4473 |
4350 #ifdef _ALF_LOGGING |
4474 #ifdef _ALF_LOGGING |
4351 CHuiControlGroup* oldControlGroup = viz->Owner().ControlGroup(); |
4475 CHuiControlGroup* oldControlGroup = viz->Owner().ControlGroup(); |
4352 TInt oldWindowGroupId = 0; |
4476 TInt oldWindowGroupId = 0; |
4353 if ( oldControlGroup ) |
4477 if ( oldControlGroup ) |
4354 { |
4478 { |
4355 oldWindowGroupId = FindWindowGroupNodeId(screenNumber, *oldControlGroup ); |
4479 oldWindowGroupId = FindWindowGroupNodeId(*oldControlGroup ); |
4356 } |
4480 } |
4357 __ALFLOGSTRING3("CAlfBridge::HandleMoveWindowToNewGroupL moving nodeId 0x%x from group 0x%x to 0x%x ",windowNodeId, oldWindowGroupId, newWindowGroupNodeId ); |
4481 __ALFLOGSTRING3("CAlfBridge::HandleMoveWindowToNewGroupL moving nodeId 0x%x from group 0x%x to 0x%x ",windowNodeId, oldWindowGroupId, newWindowGroupNodeId ); |
4358 #endif |
4482 #endif |
4359 |
4483 |
4360 if (viz) |
4484 if (viz) |
4622 __ALFFXLOGSTRING("CAlfBridge::StoreLayoutIfRequiredByEffectL - Storing not required"); |
4746 __ALFFXLOGSTRING("CAlfBridge::StoreLayoutIfRequiredByEffectL - Storing not required"); |
4623 return ETrue; // no storing requred, no screenshot required => success |
4747 return ETrue; // no storing requred, no screenshot required => success |
4624 } |
4748 } |
4625 } |
4749 } |
4626 |
4750 |
4627 TBool CAlfBridge::HandleGfxEventL(CFullScreenEffectState& aEvent, CHuiLayout* aToLayout, CHuiLayout *aFromLayout) |
4751 // --------------------------------------------------------------------------- |
|
4752 // HandleGfxRedirection |
|
4753 // |
|
4754 // This effect might have been request for the host application, while the intent was to show it on the application started embedded. |
|
4755 // Embedded application has its _own_ windowgroup separate from the host application. Fullscreen effect are shown on a windowgroup level. |
|
4756 // e.g. Messaging -> New Message (editor), or Settings -> Themes (application) |
|
4757 // Wserv notifies us the window group chaining of applications. See HandleGroupChained and HandleGroupChainBroken for more details. This code |
|
4758 // will redirect the requested effect on correct windowgroup. |
|
4759 // |
|
4760 // NOTE! If embedded application effects are implemented, this will need revision |
|
4761 // --------------------------------------------------------------------------- |
|
4762 |
|
4763 void CAlfBridge::HandleGfxRedirection(CFullScreenEffectState& aEvent, CHuiLayout*& aToLayout) |
|
4764 { |
|
4765 TInt windowGroupNodeId = FindWindowGroupNodeId(*((*aToLayout).Owner().ControlGroup())); |
|
4766 CHuiControlGroup* chainedGroup = NULL; |
|
4767 |
|
4768 // check, if the effect is being asked for chained application. This propably indicates that there are two or more instances of it and |
|
4769 // effect was supposed to go to the single standalone instance |
|
4770 if (IsChainedGroup(windowGroupNodeId)) |
|
4771 { |
|
4772 RPointerArray<CHuiControlGroup> groupList; |
|
4773 FindControlGroupBySecureId(aEvent.iToSecureId, groupList); |
|
4774 TInt i = groupList.Count(); |
|
4775 TInt standaloneGroups = 0; |
|
4776 while(--i >= 0) |
|
4777 { |
|
4778 windowGroupNodeId = FindWindowGroupNodeId(*groupList[i]); |
|
4779 |
|
4780 if (!IsChainedGroup(windowGroupNodeId)) |
|
4781 { |
|
4782 // This is an educated guess, which will make the standalone version to have effect. |
|
4783 // Currently (tm) standard appstart effect is never requested for embbedded instances. |
|
4784 chainedGroup = groupList[i]; |
|
4785 standaloneGroups++; |
|
4786 __ALFFXLOGSTRING2("CAlfBridge::HandleGfxRedirection - Wg id: %d is NOT chained. Index: %d",windowGroupNodeId, i); |
|
4787 } |
|
4788 else |
|
4789 { |
|
4790 __ALFFXLOGSTRING2("CAlfBridge::HandleGfxRedirection - Wg id: %d IS chained. Index: %d", windowGroupNodeId, i); |
|
4791 } |
|
4792 } |
|
4793 groupList.Close(); |
|
4794 // If there are multiple standalone app groups (e.g. single application having multiple groups), effecting anything would be a guess. |
|
4795 if (standaloneGroups>1) |
|
4796 { |
|
4797 chainedGroup = NULL; |
|
4798 aEvent.iIsRedirected = ETrue; |
|
4799 if (iFSFXDataPart2) |
|
4800 { |
|
4801 iFSFXDataPart2->iIsRedirected = ETrue; |
|
4802 } |
|
4803 } |
|
4804 } |
|
4805 else |
|
4806 { |
|
4807 // Which group is chained to this group? |
|
4808 TUint32 chainedId = FindChainedGroup(windowGroupNodeId); |
|
4809 chainedGroup = FindControlGroup(chainedId); |
|
4810 } |
|
4811 |
|
4812 if (chainedGroup) |
|
4813 { |
|
4814 __ALFFXLOGSTRING2("CAlfBridge::HandleGfxEffects - Chained app found for this application. Transferring effect from 0x%x to 0x%x.", aToLayout->Owner().ControlGroup()->SecureId(), chainedGroup->SecureId()); |
|
4815 aToLayout = (CHuiLayout*)&chainedGroup->Control(0).Visual(0); |
|
4816 // we'll change the original effect request to point to this new group. Thus, if effect is |
|
4817 // canceled, it will be removed from the right place. |
|
4818 aEvent.iIsRedirected = ETrue; |
|
4819 aEvent.iToSecureId = chainedGroup->SecureId(); // Update the effect |
|
4820 aEvent.iToWg = FindClientWindowGroupId(*chainedGroup); |
|
4821 |
|
4822 if (iFSFXDataPart2) |
|
4823 { |
|
4824 iFSFXDataPart2->iIsRedirected = ETrue; |
|
4825 iFSFXDataPart2->iToSecureId = aEvent.iToSecureId; |
|
4826 iFSFXDataPart2->iToWg = aEvent.iToWg; |
|
4827 } |
|
4828 } |
|
4829 } |
|
4830 |
|
4831 // --------------------------------------------------------------------------- |
|
4832 // HandleGfxEventL |
|
4833 // |
|
4834 // --------------------------------------------------------------------------- |
|
4835 // |
|
4836 TBool CAlfBridge::HandleGfxEventL(CFullScreenEffectState& aEvent, CHuiLayout* aToLayout, CHuiLayout* /*aFromLayout */) |
4628 { |
4837 { |
4629 __ALFFXLOGSTRING3("CAlfBridge::HandleGfxEventL - To SecureUid: 0x%x, From SecureUid: 0x%x, effect %S", aEvent.iToSecureId, aEvent.iFromSecureId, aEvent.iEffectName); |
4838 __ALFFXLOGSTRING3("CAlfBridge::HandleGfxEventL - To SecureUid: 0x%x, From SecureUid: 0x%x, effect %S", aEvent.iToSecureId, aEvent.iFromSecureId, aEvent.iEffectName); |
4630 __ALFFXLOGSTRING4("CAlfBridge::HandleGfxEventL - To layout: 0x%x, From layout: 0x%x, Effect handle: %d, Action: %d", aToLayout, aFromLayout, aEvent.iHandle, aEvent.iAction); |
4839 __ALFFXLOGSTRING3("CAlfBridge::HandleGfxEventL - To layout: 0x%x Effect handle: %d, Action: %d", aToLayout, aEvent.iHandle, aEvent.iAction); |
4631 |
4840 |
|
4841 if (!aEvent.iIsRedirected) |
|
4842 { |
|
4843 HandleGfxRedirection(aEvent, aToLayout); |
|
4844 } |
|
4845 |
4632 TInt err = KErrNone; |
4846 TInt err = KErrNone; |
4633 TBool failed = EFalse; |
4847 TBool failed = EFalse; |
4634 |
4848 |
4635 // Check if there is an effects engine in HuiEnv |
4849 // Check if there is an effects engine in HuiEnv |
4636 CHuiFxEffect* effect = NULL; |
4850 CHuiFxEffect* effect = NULL; |
4762 aToLayout->iOpacity.Set(1.0f); |
4974 aToLayout->iOpacity.Set(1.0f); |
4763 } |
4975 } |
4764 |
4976 |
4765 if (aToLayout) |
4977 if (aToLayout) |
4766 { |
4978 { |
4767 // if this was timeout appstart effect, we need to take screenshot at this point. |
4979 |
4768 // It was not taken in the beginfullscreen |
4980 // However, if this is timeout, then we should be having update to date screenshot for the long app start effect usage |
4769 |
4981 // For the second part of the effect, screenshot must be update. Thus the transition may continue smoothly, where app_start_long.fxml finished. |
4770 if (aEvent.iLongAppStartTimeout) |
4982 if ((aEvent.iLongAppStartTimeout && !aToLayout->StoredRenderBuffer()) |
|
4983 || aEvent.iTwoPhaseEffect == CFullScreenEffectState::ESecondPartActive // update the screenshot, that the app_start effect can use the end result of app_start_long.fxml as input |
|
4984 ) |
4771 { |
4985 { |
4772 __ALFFXLOGSTRING1("CAlfBridge::HandleGfxEventL - taking screenshot for the timeout appstart effect. Handle: %d", aEvent.iHandle ); |
4986 __ALFFXLOGSTRING1("CAlfBridge::HandleGfxEventL - taking screenshot for the timeout appstart effect. Handle: %d", aEvent.iHandle ); |
4773 aToLayout->SetStoredRenderBufferModificationsEnabled(ETrue); |
4987 aToLayout->SetStoredRenderBufferModificationsEnabled(ETrue); |
4774 TBool neededStoredBuffers(EFalse); // dummy |
4988 TBool neededStoredBuffers(EFalse); // dummy |
4775 StoreLayoutIfRequiredByEffectL(aToLayout, aEvent, neededStoredBuffers); |
4989 StoreLayoutIfRequiredByEffectL(aToLayout, aEvent, neededStoredBuffers); |
4890 void CAlfBridge::FreezeLayoutUntilEffectDestroyedL(CHuiLayout* aLayout, TInt aHandle) |
5103 void CAlfBridge::FreezeLayoutUntilEffectDestroyedL(CHuiLayout* aLayout, TInt aHandle) |
4891 { |
5104 { |
4892 if (aLayout) |
5105 if (aLayout) |
4893 { |
5106 { |
4894 TRAPD(err, StoreRenderBufferStartL(aLayout)); |
5107 TRAPD(err, StoreRenderBufferStartL(aLayout)); |
4895 __ALFFXLOGSTRING2("CAlfBridge::FreezeLayoutUntilEffectDestroyed - StoreRenderBufferStartL call returned: %d for layout 0x%x", err, aLayout); |
5108 __ALFFXLOGSTRING3("CAlfBridge::FreezeLayoutUntilEffectDestroyed - Storing SecureId x%x, StoreRenderBufferStartL call returned: %d for layout 0x%x", aLayout->Owner().ControlGroup()->SecureId(), err, aLayout); |
4896 if (err == KErrNone) |
5109 if (err == KErrNone) |
4897 { |
5110 { |
4898 // Freeze only, if buffer was reserved succesfully |
5111 // Freeze only, if buffer was reserved succesfully |
4899 aLayout->SetFreezeState(ETrue); |
5112 aLayout->SetFreezeState(ETrue); |
4900 TBool itemsDestroyed; |
5113 if (!HasActiveEffect(aLayout)) |
4901 AddFxItemL(aHandle, aLayout, NULL, NULL, EFalse, itemsDestroyed, ETrue, EFalse); |
5114 { |
|
5115 TBool itemsDestroyed; |
|
5116 AddFxItemL(aHandle, aLayout, NULL, NULL, EFalse, itemsDestroyed, ETrue, EFalse); |
|
5117 } |
4902 iFSFxData->iAppStartScreenshotItemHandle = aHandle; |
5118 iFSFxData->iAppStartScreenshotItemHandle = aHandle; |
4903 } |
5119 } |
4904 } |
5120 } |
4905 } |
5121 } |
4906 |
5122 |
5294 TBool fullscreenCovered(EFalse); |
5511 TBool fullscreenCovered(EFalse); |
5295 TInt dummy = 0; |
5512 TInt dummy = 0; |
5296 |
5513 |
5297 CHuiControl& control = aToGroup->Control(0); |
5514 CHuiControl& control = aToGroup->Control(0); |
5298 CHuiLayout* toLayout = control.VisualCount() > 0 ? (CHuiLayout*)&control.Visual(0) : NULL; |
5515 CHuiLayout* toLayout = control.VisualCount() > 0 ? (CHuiLayout*)&control.Visual(0) : NULL; |
5299 if (!toLayout) |
5516 if (!toLayout || (toLayout->Flags() & EHuiVisualFlagInactive )) |
5300 { |
5517 { |
5301 // no point starting effect, if the layout is still inactive. |
5518 // no point starting effect, if the layout is still inactive. |
|
5519 __ALFFXLOGSTRING1("CAlfBridge::GfxTriggerEffectWhenFullScreenDrawn - Do not trigger. Layout 0x%x inactive or not found.", toLayout); |
5302 return EFalse; |
5520 return EFalse; |
5303 } |
5521 } |
5304 TBool opaque = ETrue; // in app start case the layout is propably not opaque. Fake it. |
5522 TBool opaque = ETrue; // in app start case the layout is propably not opaque. Fake it. |
5305 IsFullScreenDrawnRecursive(toLayout, *aToGroup, control, fullscreenCovered, fullscreen, screen, dummy, opaque, iAlfScreens[0]->iDisplay->Orientation()); |
5523 IsFullScreenDrawnRecursive(toLayout, *aToGroup, control, fullscreenCovered, fullscreen, screen, dummy, opaque, iAlfScreens[0]->iDisplay->Orientation()); |
5306 fullscreenCovered = IsRectCoveredByRegion(fullscreen, iTempRegion); |
5524 fullscreenCovered = IsRectCoveredByRegion(fullscreen, iTempRegion); |
5307 // alf content check is relavant only for alf apps |
5525 // alf content check is relavant only for alf apps |
5308 if (!fullscreenCovered && aToGroup->iAlfApp) |
5526 if (!fullscreenCovered && aToGroup->iAlfApp) |
5309 { |
5527 { |
5310 TInt clientGroupId = FindClientWindowGroupId(0, *aToGroup); |
5528 TInt clientGroupId = FindClientWindowGroupId(*aToGroup); |
5311 if (clientGroupId != KErrNotFound) |
5529 if (clientGroupId != KErrNotFound) |
5312 { |
5530 { |
5313 fullscreenCovered = HasActiveAlfContent(clientGroupId); |
5531 fullscreenCovered = HasActiveAlfContent(clientGroupId); |
5314 } |
5532 } |
5315 } |
5533 } |