2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://www.apache.org/licenses/LICENSE-2.0/
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an ”AS IS” BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
18 * @file FUi_LayoutRelativeLayout.cpp
19 * @brief This is the implementation file for RelativeLayout class.
21 * This file contains the implementation of RelativeLayout class.
26 #include <FBaseResult.h>
27 #include "FUi_LayoutRelativeLayout.h"
28 #include "FUi_LayoutLayoutItemProxy.h"
29 #include "FUi_LayoutProxyList.h"
30 #include "FUi_LayoutLayoutItemInfo.h"
32 namespace Tizen { namespace Ui { namespace _Layout
36 RelativeLayout::RelativeLayout()
37 : __pTargetParent(reinterpret_cast <LayoutItemProxy*>(0xffff))
39 RelativeProxyList* pRelativeProxyList = new (std::nothrow) RelativeProxyList();
40 SysTryReturnVoidResult(NID_UI, pRelativeProxyList, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory.");
41 SetItemList(pRelativeProxyList);
43 pRelativeProxyList->SetRelativeLayout(this);
46 RelativeLayout::~RelativeLayout()
51 RelativeLayout::CreateRelativeLayoutN()
53 RelativeLayout* pLayout = new (std::nothrow) RelativeLayout();
54 SysTryReturn(NID_UI, pLayout != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Relative layout core allocation failure.");
55 if (GetLastResult() != E_SUCCESS)
65 RelativeLayout::SetRelation(LayoutItem& item, const RelativeLayoutEdge itemEdge, LayoutItem* pTarget,
66 const RelativeLayoutEdge targetEdge)
68 ProxyList* pProxyList = GetProxyList();
69 SysAssertf(pProxyList != null, "ProxyList is invalid.");
71 ProxyListNode* pSourceNode = pProxyList->GetNode(item);
72 ProxyListNode* pTargetNode = pProxyList->GetNode(*pTarget);
73 LayoutItemProxy* pContainerProxy = GetContainerProxy();
75 if (pContainerProxy == null)
77 return E_INVALID_STATE;
80 if (pSourceNode == null ||
81 (pTarget != null && pTarget != pContainerProxy->GetItem() && pTargetNode == null))
86 if (itemEdge == EDGE_ALL)
91 if (itemEdge == EDGE_NONE)
93 for (int i = EDGE_LEFT; i < EDGE_ALL; i++)
95 UnsetRelation(item, static_cast <RelativeLayoutEdge>(i));
99 SetPartialUpdateFlag(true);
103 if (itemEdge == EDGE_HCENTER || itemEdge == EDGE_VCENTER)
105 if (pTarget != null || targetEdge != EDGE_NONE)
107 return E_INVALID_ARG;
111 // release to relation if exist relation
113 if (GetRelation(item, itemEdge, null) != null)
115 r = UnsetRelation(item, itemEdge);
122 int rollBackRefCount = 0;
123 RelativeItemInfo* pTargetItemInfo = null;
124 if (pTargetNode != null)
126 pTargetItemInfo = static_cast <RelativeItemInfo*>(pTargetNode->GetItemInfo());
127 if (pTargetItemInfo == null)
129 return E_INVALID_STATE;
131 rollBackRefCount = pTargetItemInfo->__refCount;
133 r = SetAlignment(*pSourceNode, itemEdge, pTargetNode, targetEdge);
139 if (pTargetItemInfo != null && IncreaseReferenceCount(*pSourceNode) != E_SUCCESS)
141 r = UnsetAlignment(*pSourceNode, itemEdge, null);
146 DecreaseReferenceCount(*pSourceNode, *pTargetNode);
147 pTargetItemInfo->__refCount = rollBackRefCount;
148 r = IncreaseReferenceCount(*pTargetNode);
154 ProxyListNode* pCurNode = pProxyList->GetFirstNode();
157 r = IncreaseReferenceCount(*pCurNode);
162 pCurNode = pProxyList->GetNextNode(*pCurNode);
168 SetUpdateState(true);
169 SetPartialUpdateFlag(true);
174 RelativeLayout::UnsetRelation(LayoutItem& item, const RelativeLayoutEdge itemEdge)
176 RelativeProxyList* pRelativeProxyList = GetRelativeProxyList();
177 SysTryReturn(NID_UI, pRelativeProxyList, E_INVALID_STATE, E_INVALID_STATE, "[E_INVALID_STATE] RelativeProxyList is invalid.");
179 ProxyListNode* pItemNode = pRelativeProxyList->GetNode(item);
180 if (pItemNode == null)
182 return E_INVALID_ARG;
185 if (itemEdge == EDGE_NONE || itemEdge == EDGE_ALL)
187 return E_INVALID_ARG;
191 ProxyListNode* pTargetNode = null;
192 LayoutItemProxy* pTargetProxy = null;
193 r = UnsetAlignment(*pItemNode, itemEdge, &pTargetProxy);
198 if (pTargetProxy != null)
200 pTargetNode = pRelativeProxyList->GetNode(*(pTargetProxy->GetItem()));
201 if (pTargetNode == null)
203 return E_INVALID_STATE;
207 if (pTargetNode == null)
209 SetUpdateState(true);
210 SetPartialUpdateFlag(true);
215 // Refcount of all nodes is set to 0.
216 DecreaseReferenceCount(*pItemNode, *pTargetNode);
218 // find another node to refer to pTargetNode.
219 ProxyListNode* pCurNode = pRelativeProxyList->GetFirstNode();
222 while (pCurNode != null)
224 for (int i = EDGE_LEFT; i <= EDGE_BOTTOM; i++)
226 LayoutItemProxy* pTargetProxy = GetAlignment(*pCurNode, static_cast <RelativeLayoutEdge>(i));
227 if (pTargetProxy != null && pTargetProxy != GetContainerProxy())
229 ProxyListNode* pCurTargetNode = pRelativeProxyList->GetNode(*(pTargetProxy->GetItem()));
230 if (pTargetNode == pCurTargetNode)
232 if (maxRefCount < pRelativeProxyList->GetReferenceCount(*pCurNode))
234 maxRefCount = pRelativeProxyList->GetReferenceCount(*pCurNode);
235 nodeIndex = pRelativeProxyList->GetIndex(*pCurNode);
240 pCurNode = pRelativeProxyList->GetNextNode(*pCurNode);
245 pCurNode = pRelativeProxyList->GetNode(nodeIndex);
246 IncreaseReference(*pTargetNode, *pCurNode);
249 // Nodes Recalculation
250 r = IncreaseReferenceCount(*pTargetNode);
256 SetUpdateState(true);
257 SetPartialUpdateFlag(true);
262 RelativeLayout::GetRelation(LayoutItem& item, const RelativeLayoutEdge itemEdge, RelativeLayoutEdge* pTargetEdge)
264 ProxyList* pProxyList = GetProxyList();
265 SysAssertf(pProxyList != null, "ProxyList is invalid.");
267 ProxyListNode* pNode = pProxyList->GetNode(item);
271 LayoutItemProxy* pItemProxy = GetAlignment(*pNode, itemEdge, pTargetEdge);
274 return pItemProxy->GetItem();
282 RelativeLayout::OnLayout(float width, float height, bool updateLayouting)
284 result r = E_SUCCESS;
285 ProxyList* pProxyList = GetProxyList();
286 SysAssertf(pProxyList != null, "ProxyList is invalid.");
288 LayoutItemProxy* pContainerProxy = GetContainerProxy();
289 if (pContainerProxy == null)
291 return E_INVALID_STATE;
294 LayoutRect windowRect = {0.0f, 0.0f, width, height};
295 LayoutRect clientRect;
296 pContainerProxy->ConvertWindowToClientBounds(windowRect, clientRect);
298 LayoutRect layoutRect = GetLayoutRect();
299 clientRect.x = layoutRect.x;
300 clientRect.y = layoutRect.y;
302 float correctionWidth = windowRect.w - clientRect.w;
303 float correctionHeight = windowRect.h - clientRect.h;
305 if (correctionWidth < 0.0f)
307 correctionWidth = 0.0f;
309 if (correctionHeight < 0.0f)
311 correctionHeight = 0.0f;
314 LayoutMatchMode widthMatchMode = pContainerProxy->GetItemWidthMatchMode();
315 LayoutMatchMode heightMatchMode = pContainerProxy->GetItemHeightMatchMode();
317 SetLayoutRect(clientRect);
319 float childrenMaxPosX = 0.0f;
320 float childrenMaxPosY = 0.0f;
321 LayoutRect childRect = {0.0f, 0.0f, 0.0f, 0.0f};
323 ProxyListNode* pCurNode = pProxyList->GetFirstNode();
325 while (pCurNode != null)
327 r = CalculatePosition(*pCurNode);
328 r = CalculateCenter(*pCurNode, r == E_SUCCESS);
334 LayoutItemProxy* pItemProxy = pCurNode->GetItemProxy();
335 if (pItemProxy == null)
337 return E_INVALID_STATE;
340 pItemProxy->GetItemWindowRect(childRect);
342 if (childrenMaxPosX < childRect.x + childRect.w)
344 childrenMaxPosX = childRect.x + childRect.w;
345 if (GetAlignment(*pCurNode, EDGE_RIGHT) != null)
347 ItemMargin margin = pItemProxy->GetItemMargin();
348 childrenMaxPosX += margin.right;
352 if (childrenMaxPosY < childRect.y + childRect.h)
354 childrenMaxPosY = childRect.y + childRect.h;
355 if (GetAlignment(*pCurNode, EDGE_BOTTOM) != null)
357 ItemMargin margin = pItemProxy->GetItemMargin();
358 childrenMaxPosY += margin.bottom;
362 pCurNode = pProxyList->GetNextNode(*pCurNode);
365 if (widthMatchMode == WRAP_CONTENT)
367 clientRect.w = childrenMaxPosX + correctionWidth;
371 clientRect.w += correctionWidth;
374 if (heightMatchMode == WRAP_CONTENT)
376 clientRect.h = childrenMaxPosY + correctionHeight;
380 clientRect.h += correctionHeight;
383 SetLayoutRect(clientRect);
384 LayoutRect containerRect;
385 pContainerProxy->GetItemWindowRect(containerRect);
386 clientRect.x = containerRect.x;
387 clientRect.y = containerRect.y;
388 if (windowRect.w != clientRect.w || windowRect.h != clientRect.h)
392 pContainerProxy->SetItemWindowRect(clientRect);
395 pCurNode = pProxyList->GetFirstNode();
398 r = CalculatePosition(*pCurNode);
399 r = CalculateCenter(*pCurNode, r == E_SUCCESS);
400 pCurNode = pProxyList->GetNextNode(*pCurNode);
408 RelativeLayout::IncreaseReferenceCount(ProxyListNode& node)
410 ProxyList* pProxyList = GetProxyList();
411 SysAssertf(pProxyList != null, "ProxyList is invalid.");
413 ProxyListNode* pTargetNode = null;
414 result r = E_SUCCESS;
415 for (int i = EDGE_LEFT; i < EDGE_ALL; i++)
417 LayoutItemProxy* pProxy = GetAlignment(node, static_cast <RelativeLayoutEdge>(i));
418 if (pProxy == null || pProxy == GetContainerProxy())
422 pTargetNode = pProxyList->GetNode(*(pProxy->GetItem()));
423 if (pTargetNode != null)
425 r = IncreaseReference(*pTargetNode, node);
428 r = IncreaseReferenceCount(*pTargetNode);
440 // Order of nodes is recalculate
441 return AlignItemNodeMaxRefMove();
445 RelativeLayout::DecreaseReferenceCount(ProxyListNode& node, ProxyListNode& pTargetNode)
447 ProxyListNode* pTargetTargetNode = null;
448 for (int i = EDGE_LEFT; i <= EDGE_BOTTOM; i++)
450 pTargetTargetNode = GetTargetNode(pTargetNode, static_cast <RelativeLayoutEdge>(i));
451 if (pTargetTargetNode != null)
453 DecreaseReferenceCount(pTargetNode, *pTargetTargetNode);
456 //if (pTargetNode != null)
458 SetZeroReference(pTargetNode, node);
463 RelativeLayout::AlignItemNodeMaxRefMove()
465 result r = E_SUCCESS;
467 RelativeProxyList* pRelativeProxyList = GetRelativeProxyList();
468 SysTryReturn(NID_UI, pRelativeProxyList, E_INVALID_STATE, E_INVALID_STATE, "[E_INVALID_STATE] RelativeProxyList is invalid.");
470 ProxyListNode* pCurNode = pRelativeProxyList->GetFirstNode();
471 ProxyListNode* pNextNode = pCurNode;
474 while (pCurNode != null)
476 pNextNode = pRelativeProxyList->GetNextNode(*pCurNode);
477 maxRefCount = pRelativeProxyList->GetReferenceCount(*pCurNode);
479 if (pNextNode != null && maxRefCount < pRelativeProxyList->GetReferenceCount(*pNextNode))
481 ProxyListNode* pMoveNode = pNextNode;
482 if (pRelativeProxyList->DetachNode(*pMoveNode) != E_SUCCESS)
487 maxRefCount = pRelativeProxyList->GetReferenceCount(*pMoveNode);
489 pCurNode = pRelativeProxyList->GetFirstNode();
490 while (pRelativeProxyList->GetReferenceCount(*pCurNode) >= maxRefCount)
492 pCurNode = pRelativeProxyList->GetNextNode(*pCurNode);
494 pRelativeProxyList->InsertIntoLeft(*pCurNode, *pMoveNode);
499 pCurNode = pRelativeProxyList->GetNextNode(*pCurNode);
507 RelativeLayout::DeleteTargetInfo(ProxyListNode& targetNode, ProxyListNode& deleteNode)
509 RelativeItemInfo* pItemInfo = static_cast <RelativeItemInfo*>(targetNode.GetItemInfo());
510 if (pItemInfo == null)
512 return E_INVALID_STATE;
514 for (int i = EDGE_LEFT; i < EDGE_ALL; i++)
516 if (pItemInfo->__pTarget[i] == deleteNode.GetItemProxy())
518 UnsetRelation(*(targetNode.GetItemProxy()->GetItem()), static_cast <RelativeLayoutEdge>(i));
525 RelativeLayout::CalculatePosition(ProxyListNode& curNode)
527 RelativeItemInfo* pCurItemInfo = null;
528 LayoutItemProxy* pCurProxy = null;
529 ItemMargin curItemMargin = {0.0f, 0.0f, 0.0f, 0.0f};
530 LayoutRect curItemRect = {0.0f, 0.0f, 0.0f, 0.0f};
531 LayoutPoint targetPosition = {0.0f, 0.0f};
534 pCurItemInfo = static_cast <RelativeItemInfo*>(curNode.GetItemInfo());
535 pCurProxy = curNode.GetItemProxy();
537 if (pCurItemInfo == null || pCurProxy == null)
539 return E_INVALID_STATE;
542 curItemRect = pCurProxy->GetItemBaseRect();
543 GetItemMargin(*(pCurProxy->GetItem()), curItemMargin);
545 r = pCurProxy->Measure(curItemRect.w, curItemRect.h);
550 pCurProxy->GetMeasuredSize(curItemRect.w, curItemRect.h);
552 if (pCurItemInfo->__pTarget[EDGE_LEFT] != null)
554 r = GetTargetPosition(pCurItemInfo->__pTarget[EDGE_LEFT], pCurItemInfo->__targetEdge[EDGE_LEFT], targetPosition);
559 curItemRect.x = targetPosition.x + curItemMargin.left;
562 if (pCurItemInfo->__pTarget[EDGE_TOP] != null)
564 r = GetTargetPosition(pCurItemInfo->__pTarget[EDGE_TOP], pCurItemInfo->__targetEdge[EDGE_TOP], targetPosition);
569 curItemRect.y = targetPosition.y + curItemMargin.top;
572 if (pCurItemInfo->__pTarget[EDGE_RIGHT] != null)
574 r = GetTargetPosition(pCurItemInfo->__pTarget[EDGE_RIGHT], pCurItemInfo->__targetEdge[EDGE_RIGHT], targetPosition);
580 if (pCurItemInfo->__pTarget[EDGE_LEFT] != null)
582 curItemRect.w = targetPosition.x - curItemRect.x - curItemMargin.right;
584 curItemRect.x = targetPosition.x - curItemMargin.right - curItemRect.w;
587 if (pCurItemInfo->__pTarget[EDGE_BOTTOM] != null)
589 r = GetTargetPosition(pCurItemInfo->__pTarget[EDGE_BOTTOM], pCurItemInfo->__targetEdge[EDGE_BOTTOM], targetPosition);
595 if (pCurItemInfo->__pTarget[EDGE_TOP] != null)
597 curItemRect.h = targetPosition.y - curItemRect.y - curItemMargin.bottom;
599 curItemRect.y = targetPosition.y - curItemMargin.bottom - curItemRect.h;
602 r = pCurProxy->Measure(curItemRect.w, curItemRect.h);
607 pCurProxy->GetMeasuredSize(curItemRect.w, curItemRect.h);
609 r = pCurProxy->SetItemWindowRect(curItemRect);
619 RelativeLayout::CalculateCenter(ProxyListNode& curNode, bool calcPosition)
621 LayoutRect targetRect;
622 RelativeItemInfo* pCurItemInfo = null;
623 LayoutItemProxy* pCurProxy = null;
624 LayoutRect curItemRect = {0.0f, 0.0f, 0.0f, 0.0f};
627 pCurItemInfo = static_cast <RelativeItemInfo*>(curNode.GetItemInfo());
628 pCurProxy = curNode.GetItemProxy();
630 if (pCurItemInfo == null || pCurProxy == null)
632 return E_INVALID_STATE;
635 if (pCurItemInfo->__pTarget[EDGE_HCENTER] == null && pCurItemInfo->__pTarget[EDGE_VCENTER] == null)
642 pCurProxy->GetItemWindowRect(curItemRect);
646 curItemRect = pCurProxy->GetItemBaseRect();
649 r = pCurProxy->Measure(curItemRect.w, curItemRect.h);
654 pCurProxy->GetMeasuredSize(curItemRect.w, curItemRect.h);
656 if (pCurItemInfo->__pTarget[EDGE_HCENTER] == __pTargetParent)
658 targetRect = GetLayoutRect();
659 float targetWidth = targetRect.w;
660 float margin = ((targetWidth - curItemRect.w) / 2);
661 curItemRect.x = margin + targetRect.x;
664 if (pCurItemInfo->__pTarget[EDGE_VCENTER] == __pTargetParent)
666 targetRect = GetLayoutRect();
667 float targetHeight = targetRect.h;
668 float margin = ((targetHeight - curItemRect.h) / 2);
669 curItemRect.y = margin + targetRect.y;
672 r = pCurProxy->Measure(curItemRect.w, curItemRect.h);
677 pCurProxy->GetMeasuredSize(curItemRect.w, curItemRect.h);
679 r = pCurProxy->SetItemWindowRect(curItemRect);
689 RelativeLayout::CheckTargetEdge(const RelativeLayoutEdge sourceEdge, const RelativeLayoutEdge targetEdge) const
691 if (sourceEdge & 0x1)
693 if (targetEdge & 0x1)
702 else if (!(sourceEdge & 0x1))
704 if (targetEdge & 0x1)
718 RelativeLayout::SetAlignment(ProxyListNode& sourceNode, const RelativeLayoutEdge sourceEdge, ProxyListNode* pTargetNode, const RelativeLayoutEdge targetEdge)
720 RelativeLayoutEdge realTargetEdge = targetEdge;
721 if (realTargetEdge == EDGE_NONE)
723 realTargetEdge = sourceEdge;
726 if (!CheckTargetEdge(sourceEdge, realTargetEdge))
728 return E_INVALID_ARG;
731 RelativeItemInfo* pSourceItemInfo = static_cast <RelativeItemInfo*>(sourceNode.GetItemInfo());
733 if (pSourceItemInfo == null || pSourceItemInfo->__targetEdge[sourceEdge] != EDGE_NONE || pSourceItemInfo->__pTarget[sourceEdge] != null)
735 return E_INVALID_STATE;
738 LayoutItemProxy* pTargetProxy = null;
739 if (pTargetNode == null)
741 pTargetProxy = const_cast <LayoutItemProxy*>(__pTargetParent);
745 pTargetProxy = pTargetNode->GetItemProxy();
747 if (pTargetProxy == null)
749 return E_INVALID_ARG;
752 pSourceItemInfo->__targetEdge[sourceEdge] = realTargetEdge;
753 pSourceItemInfo->__pTarget[sourceEdge] = pTargetProxy;
759 RelativeLayout::UnsetAlignment(ProxyListNode& sourceNode, const RelativeLayoutEdge sourceEdge, LayoutItemProxy** ppTargetProxy)
761 RelativeItemInfo* pSourceItemInfo = static_cast <RelativeItemInfo*>(sourceNode.GetItemInfo());
763 if (pSourceItemInfo == null)
765 return E_INVALID_STATE;
768 if (sourceEdge != EDGE_NONE)
770 pSourceItemInfo->__targetEdge[sourceEdge] = EDGE_NONE;
771 if (pSourceItemInfo->__pTarget[sourceEdge] != null)
773 if (ppTargetProxy != null)
775 if (pSourceItemInfo->__pTarget[sourceEdge] != __pTargetParent)
777 *ppTargetProxy = pSourceItemInfo->__pTarget[sourceEdge];
781 *ppTargetProxy = null;
784 pSourceItemInfo->__pTarget[sourceEdge] = null;
788 return E_INVALID_STATE;
797 RelativeLayout::GetAlignment(ProxyListNode& sourceNode, const RelativeLayoutEdge sourceEdge, RelativeLayoutEdge* pTargetEdge)
799 SysTryReturn(NID_UI, sourceEdge >= EDGE_NONE, null, E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] Argument is out of range.");
800 SysTryReturn(NID_UI, sourceEdge <= EDGE_VCENTER, null, E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] Argument is out of range.");
801 RelativeItemInfo* pSourceItemInfo = static_cast <RelativeItemInfo*>(sourceNode.GetItemInfo());
803 SysTryReturn(NID_UI, pSourceItemInfo, null, E_INVALID_STATE, "[E_INVALID_STATE] RelativeItemInfo is invalid.");
805 if (pTargetEdge != null)
807 *pTargetEdge = pSourceItemInfo->__targetEdge[sourceEdge];
810 if (pSourceItemInfo->__pTarget[sourceEdge] != __pTargetParent)
812 return pSourceItemInfo->__pTarget[sourceEdge];
816 return GetContainerProxy();
821 RelativeLayout::IncreaseReference(ProxyListNode& targetNode, ProxyListNode& sourceNode)
823 ProxyList* pProxyList = GetProxyList();
824 SysAssertf(pProxyList != null, "ProxyList is invalid.");
826 RelativeItemInfo* pTargetItemInfo = static_cast <RelativeItemInfo*>(targetNode.GetItemInfo());
827 RelativeItemInfo* pSourceItemInfo = static_cast <RelativeItemInfo*>(sourceNode.GetItemInfo());
829 if (pTargetItemInfo == null || pSourceItemInfo == null)
831 return E_INVALID_STATE;
834 int refCount = pSourceItemInfo->__refCount + 1;
836 if (refCount > pProxyList->GetNodeCount() - 1)
838 return E_INVALID_STATE;
841 if (refCount > pTargetItemInfo->__refCount)
843 pTargetItemInfo->__refCount = refCount;
849 RelativeLayout::GetTargetNode(ProxyListNode& node, RelativeLayoutEdge sourceEdge)
851 ProxyList* pProxyList = GetProxyList();
852 SysAssertf(pProxyList != null, "ProxyList is invalid.");
854 LayoutItemProxy* pProxy = GetAlignment(node, sourceEdge);
855 if (pProxy == null || pProxy == GetContainerProxy())
859 return pProxyList->GetNode(*(pProxy->GetItem()));
863 RelativeLayout::SetZeroReference(ProxyListNode& node, ProxyListNode& baseNode)
865 RelativeItemInfo* pTargetItemInfo = static_cast <RelativeItemInfo*>(node.GetItemInfo());
866 if (pTargetItemInfo == null)
868 return E_INVALID_STATE;
871 pTargetItemInfo->__refCount = 0;
877 RelativeLayout::GetTargetPosition(LayoutItemProxy* pTargetProxy, const RelativeLayoutEdge targetEdge, LayoutPoint& targetPoint) const
879 if (pTargetProxy == null)
881 return E_INVALID_ARG;
884 LayoutRect targetRect;
885 if (pTargetProxy == __pTargetParent)
887 targetRect = GetLayoutRect();
891 pTargetProxy->GetItemWindowRect(targetRect);
897 targetPoint.x = targetRect.x;
901 targetPoint.y = targetRect.y;
905 targetPoint.x = targetRect.x + targetRect.w;
909 targetPoint.y = targetRect.y + targetRect.h;
920 RelativeLayout::GetRelativeProxyList(void)
922 return static_cast <RelativeProxyList*>(GetProxyList());
925 }}} // Tizen::Ui::_Layout