X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Fdevel-api%2Flayouting%2Fflex-node.cpp;h=aa46e6f4115c85ed71738c9d9f2a69a9a6749fd4;hp=f13549cf57b103db0bb79fed52dca21cb7004821;hb=cabf76b631c0365a1e8f396b91ee54faa4994880;hpb=37d747586c7385a57c2376b708795c46d607f14d diff --git a/dali-toolkit/devel-api/layouting/flex-node.cpp b/dali-toolkit/devel-api/layouting/flex-node.cpp index f13549c..aa46e6f 100644 --- a/dali-toolkit/devel-api/layouting/flex-node.cpp +++ b/dali-toolkit/devel-api/layouting/flex-node.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,7 +26,7 @@ #include #if defined(DEBUG_ENABLED) -static Debug::Filter* gLogFilter = Debug::Filter::New( Debug::NoLogging, false, "LOG_FLEX" ); +static Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_FLEX"); #endif namespace Dali @@ -35,264 +35,338 @@ namespace Toolkit { namespace Flex { - namespace { // Common callback function that is registered when AddChild is called. // Calls MeasureNode which in turns calls the actual callback passed in AddChild not the common callback. YGSize MeasureChild(YGNodeRef child, float width, YGMeasureMode measureModeWidth, float height, YGMeasureMode measureModeHeight) { - DALI_LOG_INFO( gLogFilter, Debug::General, "MeasureChild\n" ); + DALI_LOG_INFO(gLogFilter, Debug::General, "MeasureChild\n"); // Get the Node from the YGNodeRef - Toolkit::Flex::Node* childNode = static_cast(YGNodeGetContext(child)); + Toolkit::Flex::Node* childNode = static_cast(YGNodeGetContext(child)); - YGSize childSize{ 1, 1 }; // Initialise variable. + YGSize childSize{1, 1}; // Initialise variable. - DALI_ASSERT_DEBUG( childNode ); + DALI_ASSERT_DEBUG(childNode); // Call measure function assigned to this Node - Toolkit::Flex::SizeTuple nodeSize = childNode->MeasureNode( width, measureModeWidth, height, measureModeHeight ); - childSize.width = nodeSize.width; - childSize.height = nodeSize.height; - DALI_LOG_INFO( gLogFilter, Debug::General, "MeasureChild, childNode valid %f,%f\n", childSize.width, childSize.height ); + Toolkit::Flex::SizeTuple nodeSize = childNode->MeasureNode(width, measureModeWidth, height, measureModeHeight); + childSize.width = nodeSize.width; + childSize.height = nodeSize.height; + DALI_LOG_INFO(gLogFilter, Debug::General, "MeasureChild, childNode valid %f,%f\n", childSize.width, childSize.height); return childSize; } -} // unamed namespace +} // namespace struct Node; using NodePtr = std::unique_ptr; -using FlexNodeVector = std::vector< NodePtr>; +using FlexNodeVector = std::vector; struct Node::Impl { - YGNodeRef mYogaNode; - MeasureCallback mMeasureCallback; - WeakHandle< Dali::Actor > mActor; - FlexNodeVector mChildNodes; + YGNodeRef mYogaNode; + MeasureCallback mMeasureCallback; + WeakHandle mActor; + FlexNodeVector mChildNodes; }; -Node::Node() : mImpl( new Impl ) +Node::Node() +: mImpl(new Impl) { mImpl->mYogaNode = YGNodeNew(); - YGNodeSetContext( mImpl->mYogaNode, this ); + YGNodeSetContext(mImpl->mYogaNode, this); mImpl->mMeasureCallback = NULL; - DALI_LOG_INFO( gLogFilter, Debug::General, "Node() Context [%p] set to mYogaNode[%p]\n", this, mImpl->mYogaNode ); + DALI_LOG_INFO(gLogFilter, Debug::General, "Node() Context [%p] set to mYogaNode[%p]\n", this, mImpl->mYogaNode); // Set default style - YGNodeStyleSetFlexDirection( mImpl->mYogaNode, YGFlexDirectionColumn ); - YGNodeStyleSetFlexWrap( mImpl->mYogaNode, YGWrapNoWrap ); - YGNodeStyleSetJustifyContent( mImpl->mYogaNode, YGJustifyFlexStart ); - YGNodeStyleSetAlignContent( mImpl->mYogaNode, YGAlignFlexStart ); - YGNodeStyleSetAlignItems( mImpl->mYogaNode, YGAlignFlexStart ); + YGNodeStyleSetFlexDirection(mImpl->mYogaNode, YGFlexDirectionColumn); + YGNodeStyleSetFlexWrap(mImpl->mYogaNode, YGWrapNoWrap); + YGNodeStyleSetJustifyContent(mImpl->mYogaNode, YGJustifyFlexStart); + YGNodeStyleSetAlignContent(mImpl->mYogaNode, YGAlignFlexStart); + YGNodeStyleSetAlignItems(mImpl->mYogaNode, YGAlignFlexStart); } Node::~Node() { - DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Destructor() >> \n"); - if( mImpl->mYogaNode ) + DALI_LOG_INFO(gLogFilter, Debug::Verbose, "Destructor() >> \n"); + if(mImpl->mYogaNode) { - YGNodeFreeRecursive( mImpl->mYogaNode ); + YGNodeFreeRecursive(mImpl->mYogaNode); mImpl->mYogaNode = nullptr; } - DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Destructor() <<\n"); + DALI_LOG_INFO(gLogFilter, Debug::Verbose, "Destructor() <<\n"); } -void Node::AddChild( Actor child, Extents margin, MeasureCallback measureFunction, int index ) +Node* Node::AddChild(Actor child, Extents margin, MeasureCallback measureFunction, int index) { - if( child ) + if(child) { - DALI_LOG_INFO( gLogFilter, Debug::Verbose, "AddChild[%s] to node[%p] at index:%d\n", child.GetName().c_str(), mImpl->mYogaNode, index ); + DALI_LOG_INFO(gLogFilter, Debug::Verbose, "AddChild[%s] to node[%p] at index:%d\n", child.GetProperty(Dali::Actor::Property::NAME).c_str(), mImpl->mYogaNode, index); - NodePtr childNode( new Node() ); + NodePtr childNode(new Node()); // Store measure function passed in so can call it when the MeasureChild function is called. childNode->mImpl->mMeasureCallback = measureFunction; childNode->mImpl->mActor = child; - Vector2 minumumSize = child.GetMinimumSize(); - Vector2 maximumSize = child.GetMaximumSize(); + Vector2 minumumSize = child.GetProperty(Actor::Property::MINIMUM_SIZE); + Vector2 maximumSize = child.GetProperty(Actor::Property::MAXIMUM_SIZE); + + YGNodeStyleSetMaxWidth(childNode->mImpl->mYogaNode, maximumSize.width); + YGNodeStyleSetMaxHeight(childNode->mImpl->mYogaNode, maximumSize.height); + YGNodeStyleSetMinWidth(childNode->mImpl->mYogaNode, minumumSize.width); + YGNodeStyleSetMinHeight(childNode->mImpl->mYogaNode, minumumSize.height); - YGNodeStyleSetMaxWidth( childNode->mImpl->mYogaNode, maximumSize.width ); - YGNodeStyleSetMaxHeight( childNode->mImpl->mYogaNode, maximumSize.height ); - YGNodeStyleSetMinWidth( childNode->mImpl->mYogaNode, minumumSize.width ); - YGNodeStyleSetMinHeight( childNode->mImpl->mYogaNode, minumumSize.height ); + YGNodeStyleSetMargin(childNode->mImpl->mYogaNode, YGEdgeLeft, margin.start); + YGNodeStyleSetMargin(childNode->mImpl->mYogaNode, YGEdgeTop, margin.top); + YGNodeStyleSetMargin(childNode->mImpl->mYogaNode, YGEdgeRight, margin.end); + YGNodeStyleSetMargin(childNode->mImpl->mYogaNode, YGEdgeBottom, margin.bottom); - YGNodeStyleSetMargin( childNode->mImpl->mYogaNode, YGEdgeLeft, margin.start ); - YGNodeStyleSetMargin( childNode->mImpl->mYogaNode, YGEdgeTop, margin.top ); - YGNodeStyleSetMargin( childNode->mImpl->mYogaNode, YGEdgeRight, margin.end ); - YGNodeStyleSetMargin( childNode->mImpl->mYogaNode, YGEdgeBottom, margin.bottom ); + YGNodeSetMeasureFunc(childNode->mImpl->mYogaNode, &MeasureChild); - YGNodeSetMeasureFunc( childNode->mImpl->mYogaNode, &MeasureChild ); + YGNodeInsertChild(mImpl->mYogaNode, childNode->mImpl->mYogaNode, index); - YGNodeInsertChild( mImpl->mYogaNode, childNode->mImpl->mYogaNode, index ); + Node* result = childNode.get(); + mImpl->mChildNodes.emplace_back(std::move(childNode)); - mImpl->mChildNodes.emplace_back( std::move(childNode) ); + return result; + ; } + return nullptr; } -void Node::RemoveChild( Actor child ) +void Node::RemoveChild(Actor child) { - DALI_LOG_INFO( gLogFilter, Debug::Verbose, "RemoveChild child:[%s] from internal nodeCount[%d] childCount[%d]\n", child.GetName().c_str(), YGNodeGetChildCount( mImpl->mYogaNode ), mImpl->mChildNodes.size() ); + DALI_LOG_INFO(gLogFilter, Debug::Verbose, "RemoveChild child:[%s] from internal nodeCount[%d] childCount[%d]\n", child.GetProperty(Dali::Actor::Property::NAME).c_str(), YGNodeGetChildCount(mImpl->mYogaNode), mImpl->mChildNodes.size()); - auto iterator = std::find_if( mImpl->mChildNodes.begin(),mImpl->mChildNodes.end(), - [&child]( NodePtr& childNode ){ return childNode->mImpl->mActor.GetHandle() == child;}); + auto iterator = std::find_if(mImpl->mChildNodes.begin(), mImpl->mChildNodes.end(), [&child](NodePtr& childNode) { return childNode->mImpl->mActor.GetHandle() == child; }); - if( iterator != mImpl->mChildNodes.end() ) + if(iterator != mImpl->mChildNodes.end()) { - YGNodeRemoveChild( mImpl->mYogaNode, (*iterator)->mImpl->mYogaNode ); - mImpl->mChildNodes.erase(iterator); + YGNodeRemoveChild(mImpl->mYogaNode, (*iterator)->mImpl->mYogaNode); + mImpl->mChildNodes.erase(iterator); } - DALI_LOG_INFO( gLogFilter, Debug::Verbose, "RemoveChild internal nodeCount[%d] childCount[%d]\n", YGNodeGetChildCount( mImpl->mYogaNode ), mImpl->mChildNodes.size() ); + DALI_LOG_INFO(gLogFilter, Debug::Verbose, "RemoveChild internal nodeCount[%d] childCount[%d]\n", YGNodeGetChildCount(mImpl->mYogaNode), mImpl->mChildNodes.size()); } -SizeTuple Node::MeasureNode( float width, int widthMode, float height, int heightMode) +SizeTuple Node::MeasureNode(float width, int widthMode, float height, int heightMode) { - DALI_LOG_INFO( gLogFilter, Debug::Verbose, "MeasureNode\n" ); + DALI_LOG_INFO(gLogFilter, Debug::Verbose, "MeasureNode\n"); // Execute callback registered with AddChild - Toolkit::Flex::SizeTuple nodeSize{8,8}; // Default size set to 8,8 to aid bug detection. - if( mImpl->mMeasureCallback && mImpl->mActor.GetHandle() ) + Toolkit::Flex::SizeTuple nodeSize{8, 8}; // Default size set to 8,8 to aid bug detection. + if(mImpl->mMeasureCallback && mImpl->mActor.GetHandle()) { - DALI_LOG_INFO( gLogFilter, Debug::Verbose, "MeasureNode MeasureCallback executing on %s\n", mImpl->mActor.GetHandle().GetName().c_str() ); - nodeSize = mImpl->mMeasureCallback( mImpl->mActor.GetHandle(), width, widthMode, height, heightMode ); + DALI_LOG_INFO(gLogFilter, Debug::Verbose, "MeasureNode MeasureCallback executing on %s\n", mImpl->mActor.GetHandle().GetProperty< std::string >( Dali::Actor::Property::NAME ).c_str()); + mImpl->mMeasureCallback(mImpl->mActor.GetHandle(), width, widthMode, height, heightMode, &nodeSize); } - DALI_LOG_INFO( gLogFilter, Debug::Verbose, "MeasureNode nodeSize width:%f height:%f\n", nodeSize.width, nodeSize.height ); + DALI_LOG_INFO(gLogFilter, Debug::Verbose, "MeasureNode nodeSize width:%f height:%f\n", nodeSize.width, nodeSize.height); return nodeSize; } void Node::CalculateLayout(float availableWidth, float availableHeight, bool isRTL) { - DALI_LOG_INFO( gLogFilter, Debug::General, "CalculateLayout availableSize(%f,%f)\n", availableWidth, availableHeight ); - YGNodeCalculateLayout( mImpl->mYogaNode, availableWidth, availableHeight, isRTL ? YGDirectionRTL : YGDirectionLTR ); + DALI_LOG_INFO(gLogFilter, Debug::General, "CalculateLayout availableSize(%f,%f)\n", availableWidth, availableHeight); + YGNodeCalculateLayout(mImpl->mYogaNode, availableWidth, availableHeight, isRTL ? YGDirectionRTL : YGDirectionLTR); } -Dali::Vector4 Node::GetNodeFrame( int index ) const +Dali::Vector4 Node::GetNodeFrame(int index) const { - DALI_LOG_INFO( gLogFilter, Debug::Verbose, "GetNodeFrame[%d]\n", index ); - YGNodeRef childNode = YGNodeGetChild( mImpl->mYogaNode, index ); - Dali::Vector4 frame = Vector4::ZERO; + DALI_LOG_INFO(gLogFilter, Debug::Verbose, "GetNodeFrame[%d]\n", index); + YGNodeRef childNode = YGNodeGetChild(mImpl->mYogaNode, index); + Dali::Vector4 frame = Vector4::ZERO; if(childNode) { - frame.x = YGNodeLayoutGetLeft( childNode ); - frame.y = YGNodeLayoutGetTop( childNode ); - frame.z = frame.x + YGNodeLayoutGetWidth( childNode ); - frame.w = frame.y + YGNodeLayoutGetHeight( childNode ); - DALI_LOG_INFO( gLogFilter, Debug::Verbose, "GetNodeFrame Node index[%d] child ptr[%p] GetYogaNodeFrame left:%f top:%f right:%f bottom:%f\n", - index, childNode, frame.x , frame.y, frame.z, frame.w); + frame.x = YGNodeLayoutGetLeft(childNode); + frame.y = YGNodeLayoutGetTop(childNode); + frame.z = frame.x + YGNodeLayoutGetWidth(childNode); + frame.w = frame.y + YGNodeLayoutGetHeight(childNode); + DALI_LOG_INFO(gLogFilter, Debug::Verbose, "GetNodeFrame Node index[%d] child ptr[%p] GetYogaNodeFrame left:%f top:%f right:%f bottom:%f\n", index, childNode, frame.x, frame.y, frame.z, frame.w); } else { - frame.x = YGNodeLayoutGetLeft( mImpl->mYogaNode ); - frame.y = YGNodeLayoutGetTop( mImpl->mYogaNode ); - frame.z = frame.x + YGNodeLayoutGetWidth( mImpl->mYogaNode ); - frame.w = frame.y + YGNodeLayoutGetHeight( mImpl->mYogaNode ); - DALI_LOG_INFO( gLogFilter, Debug::Verbose, "GetNodeFrame Root index[%d] root ptr[%p] GetYogaNodeFrame left:%f top:%f right:%f bottom:%f\n", - index, mImpl->mYogaNode, frame.x , frame.y, frame.z, frame.w); + frame.x = YGNodeLayoutGetLeft(mImpl->mYogaNode); + frame.y = YGNodeLayoutGetTop(mImpl->mYogaNode); + frame.z = frame.x + YGNodeLayoutGetWidth(mImpl->mYogaNode); + frame.w = frame.y + YGNodeLayoutGetHeight(mImpl->mYogaNode); + DALI_LOG_INFO(gLogFilter, Debug::Verbose, "GetNodeFrame Root index[%d] root ptr[%p] GetYogaNodeFrame left:%f top:%f right:%f bottom:%f\n", index, mImpl->mYogaNode, frame.x, frame.y, frame.z, frame.w); } return frame; } -void Node::SetFlexDirection( Dali::Toolkit::Flex::FlexDirection flexDirection ) +void Node::SetFlexDirection(Dali::Toolkit::Flex::FlexDirection flexDirection) { - DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Set flex direction[%d]\n", flexDirection ); + DALI_LOG_INFO(gLogFilter, Debug::Verbose, "Set flex direction[%d]\n", flexDirection); - YGNodeStyleSetFlexDirection( mImpl->mYogaNode, static_cast(flexDirection) ); + YGNodeStyleSetFlexDirection(mImpl->mYogaNode, static_cast(flexDirection)); } Dali::Toolkit::Flex::FlexDirection Node::GetFlexDirection() const { - return static_cast(YGNodeStyleGetFlexDirection( mImpl->mYogaNode )); + return static_cast(YGNodeStyleGetFlexDirection(mImpl->mYogaNode)); } -void Node::SetFlexJustification( Dali::Toolkit::Flex::Justification flexJustification ) +void Node::SetFlexJustification(Dali::Toolkit::Flex::Justification flexJustification) { - DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Set flex justification[%d]\n", flexJustification ) + DALI_LOG_INFO(gLogFilter, Debug::Verbose, "Set flex justification[%d]\n", flexJustification) - YGNodeStyleSetJustifyContent( mImpl->mYogaNode, static_cast(flexJustification) ); + YGNodeStyleSetJustifyContent(mImpl->mYogaNode, static_cast(flexJustification)); } Dali::Toolkit::Flex::Justification Node::GetFlexJustification() const { - return static_cast(YGNodeStyleGetJustifyContent( mImpl->mYogaNode )); + return static_cast(YGNodeStyleGetJustifyContent(mImpl->mYogaNode)); } Dali::Toolkit::Flex::WrapType Node::GetFlexWrap() const { - return static_cast(YGNodeStyleGetFlexWrap( mImpl->mYogaNode )); + return static_cast(YGNodeStyleGetFlexWrap(mImpl->mYogaNode)); } -void Node::SetFlexAlignment(Dali::Toolkit::Flex::Alignment flexAlignment ) +void Node::SetFlexAlignment(Dali::Toolkit::Flex::Alignment flexAlignment) { - DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Set flex alignment[%d]\n", flexAlignment ) + DALI_LOG_INFO(gLogFilter, Debug::Verbose, "Set flex alignment[%d]\n", flexAlignment) - YGNodeStyleSetAlignContent( mImpl->mYogaNode , static_cast(flexAlignment) ); + YGNodeStyleSetAlignContent(mImpl->mYogaNode, static_cast(flexAlignment)); } Dali::Toolkit::Flex::Alignment Node::GetFlexAlignment() const { - return static_cast(YGNodeStyleGetAlignContent( mImpl->mYogaNode )); + return static_cast(YGNodeStyleGetAlignContent(mImpl->mYogaNode)); } -void Node::SetFlexItemsAlignment(Dali::Toolkit::Flex::Alignment flexAlignment ) +void Node::SetFlexItemsAlignment(Dali::Toolkit::Flex::Alignment flexAlignment) { - DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Set flex items alignment[%d] on mYogaNode[%p]\n", flexAlignment, mImpl->mYogaNode ) + DALI_LOG_INFO(gLogFilter, Debug::Verbose, "Set flex items alignment[%d] on mYogaNode[%p]\n", flexAlignment, mImpl->mYogaNode) - YGNodeStyleSetAlignItems( mImpl->mYogaNode, static_cast(flexAlignment) ); + YGNodeStyleSetAlignItems(mImpl->mYogaNode, static_cast(flexAlignment)); } Dali::Toolkit::Flex::Alignment Node::GetFlexItemsAlignment() const { - return static_cast( YGNodeStyleGetAlignItems( mImpl->mYogaNode )); + return static_cast(YGNodeStyleGetAlignItems(mImpl->mYogaNode)); +} + +void Node::SetFlexAlignmentSelf(Dali::Toolkit::Flex::Alignment flexAlignmentSelf) +{ + DALI_LOG_INFO(gLogFilter, Debug::Verbose, "Set flex alignment self [%d] on mYogaNode[%p]\n", flexAlignmentSelf, mImpl->mYogaNode) + + YGNodeStyleSetAlignSelf(mImpl->mYogaNode, static_cast(flexAlignmentSelf)); +} + +Dali::Toolkit::Flex::Alignment Node::GetFlexAlignmentSelf() const +{ + return static_cast(YGNodeStyleGetAlignSelf(mImpl->mYogaNode)); +} + +void Node::SetFlexPositionType(Dali::Toolkit::Flex::PositionType flexPositionType) +{ + DALI_LOG_INFO(gLogFilter, Debug::Verbose, "Set flex position type [%d] on mYogaNode[%p]\n", flexPositionType, mImpl->mYogaNode) + + YGNodeStyleSetPositionType(mImpl->mYogaNode, static_cast(flexPositionType)); +} + +Dali::Toolkit::Flex::PositionType Node::GetFlexPositionType() const +{ + return static_cast(YGNodeStyleGetPositionType(mImpl->mYogaNode)); +} + +void Node::SetFlexAspectRatio(float flexAspectRatio) +{ + DALI_LOG_INFO(gLogFilter, Debug::Verbose, "Set flex aspect ratio [%d] on mYogaNode[%p]\n", flexAspectRatio, mImpl->mYogaNode) + + YGNodeStyleSetAspectRatio(mImpl->mYogaNode, static_cast(flexAspectRatio)); +} + +float Node::GetFlexAspectRatio() const +{ + return static_cast(YGNodeStyleGetAspectRatio(mImpl->mYogaNode)); +} + +void Node::SetFlexBasis(float flexBasis) +{ + DALI_LOG_INFO(gLogFilter, Debug::Verbose, "Set flex basis [%d] on mYogaNode[%p]\n", flexBasis, mImpl->mYogaNode) + + YGNodeStyleSetFlexBasis(mImpl->mYogaNode, static_cast(flexBasis)); +} + +float Node::GetFlexBasis() const +{ + return static_cast(YGNodeStyleGetFlexBasis(mImpl->mYogaNode).value); +} + +void Node::SetFlexShrink(float flexShrink) +{ + DALI_LOG_INFO(gLogFilter, Debug::Verbose, "Set flex shrink [%d] on mYogaNode[%p]\n", flexShrink, mImpl->mYogaNode) + + YGNodeStyleSetFlexShrink(mImpl->mYogaNode, static_cast(flexShrink)); +} + +float Node::GetFlexShrink() const +{ + return static_cast(YGNodeStyleGetFlexShrink(mImpl->mYogaNode)); +} + +void Node::SetFlexGrow(float flexGrow) +{ + DALI_LOG_INFO(gLogFilter, Debug::Verbose, "Set flex grow [%d] on mYogaNode[%p]\n", flexGrow, mImpl->mYogaNode) + + YGNodeStyleSetFlexGrow(mImpl->mYogaNode, static_cast(flexGrow)); +} + +float Node::GetFlexGrow() const +{ + return static_cast(YGNodeStyleGetFlexGrow(mImpl->mYogaNode)); } float Node::GetFlexWidth() const { - float flexWidth = YGNodeLayoutGetWidth( mImpl->mYogaNode ); - DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Get flex mYogaNode[%p] width[%f]\n", mImpl->mYogaNode, flexWidth) + float flexWidth = YGNodeLayoutGetWidth(mImpl->mYogaNode); + DALI_LOG_INFO(gLogFilter, Debug::Verbose, "Get flex mYogaNode[%p] width[%f]\n", mImpl->mYogaNode, flexWidth) return flexWidth; } float Node::GetFlexHeight() const { - float flexHeight = YGNodeLayoutGetHeight( mImpl->mYogaNode ); - DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Get flex mYogaNode[%p] height[%f]\n", mImpl->mYogaNode, flexHeight) + float flexHeight = YGNodeLayoutGetHeight(mImpl->mYogaNode); + DALI_LOG_INFO(gLogFilter, Debug::Verbose, "Get flex mYogaNode[%p] height[%f]\n", mImpl->mYogaNode, flexHeight) return flexHeight; } -void Node::SetMargin( Extents margin ) +void Node::SetMargin(Extents margin) { - DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Set flex margin\n") + DALI_LOG_INFO(gLogFilter, Debug::Verbose, "Set flex margin\n") - YGNodeStyleSetMargin( mImpl->mYogaNode, YGEdgeLeft, margin.start ); - YGNodeStyleSetMargin( mImpl->mYogaNode, YGEdgeTop, margin.top ); - YGNodeStyleSetMargin( mImpl->mYogaNode, YGEdgeRight, margin.end ); - YGNodeStyleSetMargin( mImpl->mYogaNode, YGEdgeBottom, margin.bottom ); + YGNodeStyleSetMargin(mImpl->mYogaNode, YGEdgeLeft, margin.start); + YGNodeStyleSetMargin(mImpl->mYogaNode, YGEdgeTop, margin.top); + YGNodeStyleSetMargin(mImpl->mYogaNode, YGEdgeRight, margin.end); + YGNodeStyleSetMargin(mImpl->mYogaNode, YGEdgeBottom, margin.bottom); } -void Node::SetPadding( Extents padding ) +void Node::SetPadding(Extents padding) { - DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Set padding\n") + DALI_LOG_INFO(gLogFilter, Debug::Verbose, "Set padding\n") - YGNodeStyleSetPadding( mImpl->mYogaNode, YGEdgeLeft, padding.start ); - YGNodeStyleSetPadding( mImpl->mYogaNode, YGEdgeTop, padding.top ); - YGNodeStyleSetPadding( mImpl->mYogaNode, YGEdgeRight, padding.end ); - YGNodeStyleSetPadding( mImpl->mYogaNode, YGEdgeBottom, padding.bottom ); + YGNodeStyleSetPadding(mImpl->mYogaNode, YGEdgeLeft, padding.start); + YGNodeStyleSetPadding(mImpl->mYogaNode, YGEdgeTop, padding.top); + YGNodeStyleSetPadding(mImpl->mYogaNode, YGEdgeRight, padding.end); + YGNodeStyleSetPadding(mImpl->mYogaNode, YGEdgeBottom, padding.bottom); } -void Node::SetFlexWrap( Dali::Toolkit::Flex::WrapType wrapType ) +void Node::SetFlexWrap(Dali::Toolkit::Flex::WrapType wrapType) { - DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Set flex wrap[%d] on mYogaNode[%p]\n", wrapType, mImpl->mYogaNode ) + DALI_LOG_INFO(gLogFilter, Debug::Verbose, "Set flex wrap[%d] on mYogaNode[%p]\n", wrapType, mImpl->mYogaNode) - YGNodeStyleSetFlexWrap( mImpl->mYogaNode, static_cast(wrapType) ); + YGNodeStyleSetFlexWrap(mImpl->mYogaNode, static_cast(wrapType)); } -} // Flex +} // namespace Flex } // namespace Toolkit } // namespace Dali