// Unity C# reference source
// Copyright (c) Unity Technologies. For terms of use, see
// https://unity3d.com/legal/licenses/Unity_Reference_Only_License

/******************************************************************************/
//
//                             DO NOT MODIFY
//          This file has been generated by the UIElementsGenerator tool
//              See ShorthandApplicatorGenerator class for details
//
/******************************************************************************/
namespace UnityEngine.UIElements.StyleSheets
{
    internal static partial class ShorthandApplicator
    {
        public static void ApplyBorderColor(StylePropertyReader reader, ComputedStyle computedStyle)
        {
            StyleColor borderTopColor;
            StyleColor borderRightColor;
            StyleColor borderBottomColor;
            StyleColor borderLeftColor;

            CompileBoxAreaNoKeyword(reader, out borderTopColor, out borderRightColor, out borderBottomColor, out borderLeftColor);

            computedStyle.nonInheritedData.borderTopColor = borderTopColor;
            computedStyle.nonInheritedData.borderRightColor = borderRightColor;
            computedStyle.nonInheritedData.borderBottomColor = borderBottomColor;
            computedStyle.nonInheritedData.borderLeftColor = borderLeftColor;
        }

        public static void ApplyBorderRadius(StylePropertyReader reader, ComputedStyle computedStyle)
        {
            StyleLength borderTopLeftRadius;
            StyleLength borderTopRightRadius;
            StyleLength borderBottomRightRadius;
            StyleLength borderBottomLeftRadius;

            CompileBoxAreaNoKeyword(reader, out borderTopLeftRadius, out borderTopRightRadius, out borderBottomRightRadius, out borderBottomLeftRadius);

            computedStyle.nonInheritedData.borderTopLeftRadius = borderTopLeftRadius;
            computedStyle.nonInheritedData.borderTopRightRadius = borderTopRightRadius;
            computedStyle.nonInheritedData.borderBottomRightRadius = borderBottomRightRadius;
            computedStyle.nonInheritedData.borderBottomLeftRadius = borderBottomLeftRadius;
        }

        public static void ApplyBorderWidth(StylePropertyReader reader, ComputedStyle computedStyle)
        {
            StyleFloat borderTopWidth;
            StyleFloat borderRightWidth;
            StyleFloat borderBottomWidth;
            StyleFloat borderLeftWidth;

            CompileBoxAreaNoKeyword(reader, out borderTopWidth, out borderRightWidth, out borderBottomWidth, out borderLeftWidth);

            computedStyle.nonInheritedData.borderTopWidth = borderTopWidth;
            computedStyle.nonInheritedData.borderRightWidth = borderRightWidth;
            computedStyle.nonInheritedData.borderBottomWidth = borderBottomWidth;
            computedStyle.nonInheritedData.borderLeftWidth = borderLeftWidth;
        }

        public static void ApplyFlex(StylePropertyReader reader, ComputedStyle computedStyle)
        {
            StyleFloat flexGrow;
            StyleFloat flexShrink;
            StyleLength flexBasis;

            CompileFlexShorthand(reader, out flexGrow, out flexShrink, out flexBasis);

            computedStyle.nonInheritedData.flexGrow = flexGrow;
            computedStyle.nonInheritedData.flexShrink = flexShrink;
            computedStyle.nonInheritedData.flexBasis = flexBasis;
        }

        public static void ApplyMargin(StylePropertyReader reader, ComputedStyle computedStyle)
        {
            StyleLength marginTop;
            StyleLength marginRight;
            StyleLength marginBottom;
            StyleLength marginLeft;

            CompileBoxArea(reader, out marginTop, out marginRight, out marginBottom, out marginLeft);

            computedStyle.nonInheritedData.marginTop = marginTop;
            computedStyle.nonInheritedData.marginRight = marginRight;
            computedStyle.nonInheritedData.marginBottom = marginBottom;
            computedStyle.nonInheritedData.marginLeft = marginLeft;
        }

        public static void ApplyPadding(StylePropertyReader reader, ComputedStyle computedStyle)
        {
            StyleLength paddingTop;
            StyleLength paddingRight;
            StyleLength paddingBottom;
            StyleLength paddingLeft;

            CompileBoxAreaNoKeyword(reader, out paddingTop, out paddingRight, out paddingBottom, out paddingLeft);

            computedStyle.nonInheritedData.paddingTop = paddingTop;
            computedStyle.nonInheritedData.paddingRight = paddingRight;
            computedStyle.nonInheritedData.paddingBottom = paddingBottom;
            computedStyle.nonInheritedData.paddingLeft = paddingLeft;
        }
    }
}
