equal
deleted
inserted
replaced
54 |
54 |
55 EXPORT_C void CHuiLayout::ConstructL() |
55 EXPORT_C void CHuiLayout::ConstructL() |
56 { |
56 { |
57 CHuiVisual::ConstructL(); |
57 CHuiVisual::ConstructL(); |
58 iHuiLayoutPrivateData = new (ELeave) THuiLayoutPrivateData; |
58 iHuiLayoutPrivateData = new (ELeave) THuiLayoutPrivateData; |
59 CHuiRenderPlugin& renderplugin = CHuiStatic::Renderer(); |
59 iHuiLayoutPrivateData->iGc = NULL; |
60 iHuiLayoutPrivateData->iGc = renderplugin.CreateCanvasGcL(); |
|
61 } |
60 } |
62 |
61 |
63 |
62 |
64 EXPORT_C CHuiLayout::~CHuiLayout() |
63 EXPORT_C CHuiLayout::~CHuiLayout() |
65 { |
64 { |
72 { |
71 { |
73 Remove(iHuiLayoutPrivateData->iChildren[i]); |
72 Remove(iHuiLayoutPrivateData->iChildren[i]); |
74 } |
73 } |
75 iHuiLayoutPrivateData->iChildren.Reset(); |
74 iHuiLayoutPrivateData->iChildren.Reset(); |
76 delete iHuiLayoutPrivateData->iGc; |
75 delete iHuiLayoutPrivateData->iGc; |
|
76 iHuiLayoutPrivateData->iGc = NULL; |
77 delete iHuiLayoutPrivateData; |
77 delete iHuiLayoutPrivateData; |
78 } |
78 } |
79 } |
79 } |
80 |
80 |
81 |
81 |
309 { |
309 { |
310 // Update the layout of all children. |
310 // Update the layout of all children. |
311 TInt count = Count(); |
311 TInt count = Count(); |
312 for(TInt i = 0; i < count; ++i) |
312 for(TInt i = 0; i < count; ++i) |
313 { |
313 { |
314 //Ignore inactive child visuals |
314 // size and positio changes must go also to inactive visuals |
315 if ( iHuiLayoutPrivateData->iChildren[i]->Flags() & EHuiVisualFlagInactive ) |
315 UpdateChildLayout(i, aTransitionTime); |
316 { |
|
317 continue; |
|
318 } |
|
319 UpdateChildLayout(i, aTransitionTime); |
|
320 } |
316 } |
321 |
317 |
322 CHuiVisual::UpdateChildrenLayout(aTransitionTime); |
318 CHuiVisual::UpdateChildrenLayout(aTransitionTime); |
323 |
319 |
324 // Report that the layout of this layout visual has been fully updated. |
320 // Report that the layout of this layout visual has been fully updated. |
685 |
681 |
686 // Clear the change flags of children as well. |
682 // Clear the change flags of children as well. |
687 TInt count = Count(); |
683 TInt count = Count(); |
688 for(TInt i = 0; i < count; ++i) |
684 for(TInt i = 0; i < count; ++i) |
689 { |
685 { |
690 if (Flags() & EHuiVisualFlagInactive) |
686 if (iHuiLayoutPrivateData->iChildren[i]->Flags() & EHuiVisualFlagInactive) |
691 { |
687 { |
692 // No need to clear inactive children |
688 // No need to clear inactive children |
693 continue; |
689 continue; |
694 } |
690 } |
695 iHuiLayoutPrivateData->iChildren[i]->ClearChanged(); |
691 iHuiLayoutPrivateData->iChildren[i]->ClearChanged(); |
1118 } |
1114 } |
1119 |
1115 |
1120 void CHuiLayout::DrawStoredBitmap(CHuiGc &aGc) const |
1116 void CHuiLayout::DrawStoredBitmap(CHuiGc &aGc) const |
1121 { |
1117 { |
1122 if (!Display()) return; |
1118 if (!Display()) return; |
|
1119 |
|
1120 if (!iHuiLayoutPrivateData->iGc) |
|
1121 { |
|
1122 CHuiRenderPlugin& renderplugin = CHuiStatic::Renderer(); |
|
1123 // deleted in destructor or CHuiCanvasVisual::FreeRenderBuffer when not needed anymore |
|
1124 iHuiLayoutPrivateData->iGc = renderplugin.CreateCanvasGcL(); |
|
1125 } |
1123 CHuiCanvasGc& gc = *iHuiLayoutPrivateData->iGc; |
1126 CHuiCanvasGc& gc = *iHuiLayoutPrivateData->iGc; |
1124 gc.SetGc(aGc); |
1127 gc.SetGc(aGc); |
1125 gc.SetDefaults(); |
1128 gc.SetDefaults(); |
1126 gc.PushTransformationMatrix(); |
1129 gc.PushTransformationMatrix(); |
1127 |
1130 |