idlehomescreen/xmluirendering/uiengine/src/xnuiengineimpl.cpp
changeset 2 08c6ee43b396
parent 1 5315654608de
child 4 4d54b72983ae
equal deleted inserted replaced
1:5315654608de 2:08c6ee43b396
    50 #include "xneditmode.h"
    50 #include "xneditmode.h"
    51 #include "xnhittest.h"
    51 #include "xnhittest.h"
    52 #include "xnnode.h"
    52 #include "xnnode.h"
    53 #include "xnpanic.h"
    53 #include "xnpanic.h"
    54 #include "xneffectmanager.h"
    54 #include "xneffectmanager.h"
       
    55 #include "xneditor.h"
       
    56 #include "xnbackgroundmanager.h"
    55 
    57 
    56 #ifdef _XN_PERFORMANCE_TEST_
    58 #ifdef _XN_PERFORMANCE_TEST_
    57 #include "xntimemon.h"
    59 #include "xntimemon.h"
    58 #endif
    60 #endif
    59 
    61 
  7777 
  7779 
  7778     nameValue->SetStringValueL( CXnDomPropertyValue::EString, aTriggerName );
  7780     nameValue->SetStringValueL( CXnDomPropertyValue::EString, aTriggerName );
  7779 
  7781 
  7780     CXnProperty* name = CXnProperty::NewL(
  7782     CXnProperty* name = CXnProperty::NewL(
  7781         XnPropertyNames::action::trigger::KName,
  7783         XnPropertyNames::action::trigger::KName,
  7782         nameValue, aUiEngine.ODT()->DomDocument().StringPool() );
  7784         nameValue, *aUiEngine.ODT()->DomDocument().StringPool() );
  7783 
  7785 
  7784     CleanupStack::Pop( nameValue );
  7786     CleanupStack::Pop( nameValue );
  7785 
  7787 
  7786     CleanupStack::PushL( name );
  7788     CleanupStack::PushL( name );
  7787 
  7789 
  7836 // Build trigger node for screen device change event
  7838 // Build trigger node for screen device change event
  7837 // -----------------------------------------------------------------------------
  7839 // -----------------------------------------------------------------------------
  7838 //
  7840 //
  7839 static CXnNode* BuildScreenDeviceChangeTriggerNodeLC( CXnUiEngine& aUiEngine )
  7841 static CXnNode* BuildScreenDeviceChangeTriggerNodeLC( CXnUiEngine& aUiEngine )
  7840     {
  7842     {
  7841     CXnDomStringPool& sp( aUiEngine.ODT()->DomDocument().StringPool() );
  7843     CXnDomStringPool* sp( aUiEngine.ODT()->DomDocument().StringPool() );
  7842 
  7844 
  7843     CXnNode* node = CXnNode::NewL();
  7845     CXnNode* node = CXnNode::NewL();
  7844     CleanupStack::PushL( node );
  7846     CleanupStack::PushL( node );
  7845 
  7847 
  7846     CXnType* type = CXnType::NewL( XnPropertyNames::action::KTrigger );
  7848     CXnType* type = CXnType::NewL( XnPropertyNames::action::KTrigger );
  7857 
  7859 
  7858     nameValue->SetStringValueL( CXnDomPropertyValue::EString,
  7860     nameValue->SetStringValueL( CXnDomPropertyValue::EString,
  7859         XnPropertyNames::action::trigger::name::KScreenDeviceChange );
  7861         XnPropertyNames::action::trigger::name::KScreenDeviceChange );
  7860 
  7862 
  7861     CXnProperty* name = CXnProperty::NewL(
  7863     CXnProperty* name = CXnProperty::NewL(
  7862         XnPropertyNames::action::trigger::KName, nameValue, sp );
  7864         XnPropertyNames::action::trigger::KName, nameValue, *sp );
  7863     CleanupStack::Pop( nameValue );
  7865     CleanupStack::Pop( nameValue );
  7864     CleanupStack::PushL( name );
  7866     CleanupStack::PushL( name );
  7865 
  7867 
  7866     node->SetPropertyL( name );
  7868     node->SetPropertyL( name );
  7867     CleanupStack::Pop( name );
  7869     CleanupStack::Pop( name );
  7883         }
  7885         }
  7884 
  7886 
  7885     reasonValue->SetStringValueL( CXnDomPropertyValue::EString, *reasonString );
  7887     reasonValue->SetStringValueL( CXnDomPropertyValue::EString, *reasonString );
  7886 
  7888 
  7887     CXnProperty* reason = CXnProperty::NewL( XnPropertyNames::action::trigger::
  7889     CXnProperty* reason = CXnProperty::NewL( XnPropertyNames::action::trigger::
  7888         name::uidefinitionmodification::KReason, reasonValue, sp );
  7890         name::uidefinitionmodification::KReason, reasonValue, *sp );
  7889 
  7891 
  7890     CleanupStack::Pop( reasonValue );
  7892     CleanupStack::Pop( reasonValue );
  7891 
  7893 
  7892     CleanupStack::PushL( reason );
  7894     CleanupStack::PushL( reason );
  7893 
  7895 
  8932             }
  8934             }
  8933 
  8935 
  8934         // Update client rect
  8936         // Update client rect
  8935         SetClientRectL( iAppUiAdapter.ClientRect(), EFalse );
  8937         SetClientRectL( iAppUiAdapter.ClientRect(), EFalse );
  8936 
  8938 
       
  8939         // Update background rect
       
  8940         // Bg rect is always screen size.
       
  8941         TRect bgRect;
       
  8942         AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, bgRect );
       
  8943         Editor()->BgManager().SetRect( bgRect );
       
  8944 
  8937         iEditMode->HandleScreenDeviceChangedL();
  8945         iEditMode->HandleScreenDeviceChangedL();
  8938         
  8946         
  8939         // Force relayout
  8947         // Force relayout
  8940         DisableRenderUiLC();
  8948         DisableRenderUiLC();
  8941         
  8949         
  9371         
  9379         
  9372         UpdateInternalUnits( iHorizontalUnitInPixels, iVerticalUnitInPixels,
  9380         UpdateInternalUnits( iHorizontalUnitInPixels, iVerticalUnitInPixels,
  9373             iClientRect );
  9381             iClientRect );
  9374         
  9382         
  9375         iAppUiAdapter.ViewAdapter().BgControl().SetRect( aRect );
  9383         iAppUiAdapter.ViewAdapter().BgControl().SetRect( aRect );
  9376         
  9384 
  9377         if ( aDrawNow )
  9385         if ( aDrawNow )
  9378             {
  9386             {
  9379             RootNode()->SetDirtyL();
  9387             RootNode()->SetDirtyL();
  9380             iUiEngine->RenderUIL();
  9388             iUiEngine->RenderUIL();
  9381             }
  9389             }
  9505 // -----------------------------------------------------------------------------
  9513 // -----------------------------------------------------------------------------
  9506 //
  9514 //
  9507 void CXnUiEngineImpl::PositionStylusPopupL( CXnNode& aNode,
  9515 void CXnUiEngineImpl::PositionStylusPopupL( CXnNode& aNode,
  9508     CXnNode& aReference, const TPoint& aPosition )
  9516     CXnNode& aReference, const TPoint& aPosition )
  9509     {
  9517     {
  9510     CXnDomStringPool& sp( aNode.DomNode()->StringPool() );
  9518     CXnDomStringPool* sp( aNode.DomNode()->StringPool() );
  9511     TXnDirtyRegion* dirtyRegion = FindDirtyRegionL( *iCurrentView );
  9519     TXnDirtyRegion* dirtyRegion = FindDirtyRegionL( *iCurrentView );
  9512     RRegion region;
  9520     RRegion region;
  9513     region.Copy( dirtyRegion->iRegion );    
  9521     region.Copy( dirtyRegion->iRegion );    
  9514     CleanupClosePushL( region );
  9522     CleanupClosePushL( region );
  9515 
  9523 
  9516     // Set initial position to (0, 0) to calculate popup metrics
  9524     // Set initial position to (0, 0) to calculate popup metrics
  9517     CXnProperty* top = CXnProperty::NewL(
  9525     CXnProperty* top = CXnProperty::NewL(
  9518         XnPropertyNames::style::common::KTop, 0,
  9526         XnPropertyNames::style::common::KTop, 0,
  9519         CXnDomPropertyValue::EPx, sp );
  9527         CXnDomPropertyValue::EPx, *sp );
  9520     CleanupStack::PushL( top );
  9528     CleanupStack::PushL( top );
  9521     aNode.SetPropertyL( top );
  9529     aNode.SetPropertyL( top );
  9522     CleanupStack::Pop( top );
  9530     CleanupStack::Pop( top );
  9523     top = NULL;
  9531     top = NULL;
  9524     CXnProperty* left = CXnProperty::NewL(
  9532     CXnProperty* left = CXnProperty::NewL(
  9525         XnPropertyNames::style::common::KLeft, 0,
  9533         XnPropertyNames::style::common::KLeft, 0,
  9526         CXnDomPropertyValue::EPx, sp );
  9534         CXnDomPropertyValue::EPx, *sp );
  9527     CleanupStack::PushL( left );
  9535     CleanupStack::PushL( left );
  9528     aNode.SetPropertyL( left );
  9536     aNode.SetPropertyL( left );
  9529     CleanupStack::Pop( left );
  9537     CleanupStack::Pop( left );
  9530     left = NULL;
  9538     left = NULL;
  9531 
  9539 
  9532     // Make it visible
  9540     // Make it visible
  9533     CXnProperty* display = CXnProperty::NewL(
  9541     CXnProperty* display = CXnProperty::NewL(
  9534         XnPropertyNames::style::common::KDisplay,
  9542         XnPropertyNames::style::common::KDisplay,
  9535         XnPropertyNames::style::common::display::KBlock,
  9543         XnPropertyNames::style::common::display::KBlock,
  9536         CXnDomPropertyValue::EString, sp );
  9544         CXnDomPropertyValue::EString, *sp );
  9537     CleanupStack::PushL( display );
  9545     CleanupStack::PushL( display );
  9538     aNode.SetPropertyL( display );
  9546     aNode.SetPropertyL( display );
  9539     CleanupStack::Pop( display );
  9547     CleanupStack::Pop( display );
  9540 
  9548 
  9541     if ( !aNode.IsLaidOut() || !aReference.IsLaidOut() )
  9549     if ( !aNode.IsLaidOut() || !aReference.IsLaidOut() )
  9715         }
  9723         }
  9716 
  9724 
  9717     // Set positions
  9725     // Set positions
  9718     top = CXnProperty::NewL(
  9726     top = CXnProperty::NewL(
  9719         XnPropertyNames::style::common::KTop, tl.iY,
  9727         XnPropertyNames::style::common::KTop, tl.iY,
  9720         CXnDomPropertyValue::EPx, sp );
  9728         CXnDomPropertyValue::EPx, *sp );
  9721     CleanupStack::PushL( top );
  9729     CleanupStack::PushL( top );
  9722     aNode.SetPropertyL( top );
  9730     aNode.SetPropertyL( top );
  9723     CleanupStack::Pop( top );
  9731     CleanupStack::Pop( top );
  9724     left = CXnProperty::NewL(
  9732     left = CXnProperty::NewL(
  9725         XnPropertyNames::style::common::KLeft, tl.iX,
  9733         XnPropertyNames::style::common::KLeft, tl.iX,
  9726         CXnDomPropertyValue::EPx, sp );
  9734         CXnDomPropertyValue::EPx, *sp );
  9727     CleanupStack::PushL( left );
  9735     CleanupStack::PushL( left );
  9728     aNode.SetPropertyL( left );
  9736     aNode.SetPropertyL( left );
  9729     CleanupStack::Pop( left );
  9737     CleanupStack::Pop( left );
  9730 
  9738 
  9731     // Copy stored region back
  9739     // Copy stored region back