Skip to content

Commit

Permalink
rename csharp code
Browse files Browse the repository at this point in the history
Summary: new name

Reviewed By: splhack

Differential Revision: D4247106

fbshipit-source-id: 6e1097de104f3a011c78ae65b33e57865b007711
  • Loading branch information
Emil Sjolander authored and Facebook Github Bot committed Dec 2, 2016
1 parent 4bbf358 commit f7cc614
Show file tree
Hide file tree
Showing 56 changed files with 506 additions and 512 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ script:
- buck test //:CSSLayout
- buck test //java:java
- buck test //YogaKit:YogaKit --config cxx.default_platform=iphonesimulator-x86_64 --config cxx.cflags=-DTRAVIS_CI
- sh csharp/tests/Facebook.CSSLayout/test_macos.sh
- sh csharp/tests/Facebook.Yoga/test_macos.sh
- buck run //benchmark:benchmark
- git checkout HEAD^
- buck run //benchmark:benchmark
4 changes: 2 additions & 2 deletions csharp/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@

csharp_library(
name = 'csslibnet46',
dll_name = 'Facebook.CSSLayout.dll',
dll_name = 'Facebook.Yoga.dll',
framework_ver = 'net46',
srcs = glob(['**/*.cs']),
)

csharp_library(
name = 'csslibnet45',
dll_name = 'Facebook.CSSLayout.dll',
dll_name = 'Facebook.Yoga.dll',
framework_ver = 'net45',
srcs = glob(['**/*.cs']),
)
4 changes: 2 additions & 2 deletions csharp/Facebook.CSSLayout.sln → csharp/Facebook.Yoga.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CSSLayout", "CSSLayout\CSSLayout.vcxproj", "{0446C86B-F47B-4C46-B673-C7AE0CFF35D5}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Yoga", "Yoga\Yoga.vcxproj", "{0446C86B-F47B-4C46-B673-C7AE0CFF35D5}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Facebook.CSSLayout", "Facebook.CSSLayout\Facebook.CSSLayout.xproj", "{75BB7605-E54B-4EDE-8F5A-FF1F24464236}"
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Facebook.Yoga", "Facebook.Yoga\Facebook.Yoga.xproj", "{75BB7605-E54B-4EDE-8F5A-FF1F24464236}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">
<ProjectGuid>75bb7605-e54b-4ede-8f5a-ff1f24464236</ProjectGuid>
<RootNamespace>Facebook.CSSLayout</RootNamespace>
<RootNamespace>Facebook.Yoga</RootNamespace>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
* of patent rights can be found in the PATENTS file in the same directory.
*/

namespace Facebook.CSSLayout
namespace Facebook.Yoga
{
public delegate long MeasureFunction(
CSSNode node,
YogaNode node,
float width,
YogaMeasureMode widthMode,
float height,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* of patent rights can be found in the PATENTS file in the same directory.
*/

namespace Facebook.CSSLayout
namespace Facebook.Yoga
{
public class MeasureOutput
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@
using System;
using System.Runtime.InteropServices;

namespace Facebook.CSSLayout
namespace Facebook.Yoga
{
internal static class Native
{
#if UNITY_IOS && !UNITY_EDITOR
private const string DllName = "__Internal";
#else
private const string DllName = "CSSLayout";
private const string DllName = "yoga";
#endif

[DllImport(DllName)]
public static extern void CSSInteropSetLogger(
[MarshalAs(UnmanagedType.FunctionPtr)] CSSLogger.Func func);
public static extern void YGInteropSetLogger(
[MarshalAs(UnmanagedType.FunctionPtr)] YogaLogger.Func func);

[DllImport(DllName)]
public static extern IntPtr CSSNodeNew();
Expand Down Expand Up @@ -94,11 +94,11 @@ public static extern void CSSNodeCalculateLayout(IntPtr node,
[DllImport(DllName)]
public static extern void CSSNodeSetMeasureFunc(
IntPtr node,
[MarshalAs(UnmanagedType.FunctionPtr)] CSSMeasureFunc measureFunc);
[MarshalAs(UnmanagedType.FunctionPtr)] YogaMeasureFunc measureFunc);

[DllImport(DllName)]
[return: MarshalAs(UnmanagedType.FunctionPtr)]
public static extern CSSMeasureFunc CSSNodeGetMeasureFunc(IntPtr node);
public static extern YogaMeasureFunc CSSNodeGetMeasureFunc(IntPtr node);

[DllImport(DllName)]
public static extern void CSSNodeSetHasNewLayout(IntPtr node, [MarshalAs(UnmanagedType.I1)] bool hasNewLayout);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// associated with an assembly.
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Facebook, Inc.")]
[assembly: AssemblyProduct("Facebook.CSSLayout")]
[assembly: AssemblyProduct("Facebook.Yoga")]
[assembly: AssemblyTrademark("Copyright (c) 2014-present, Facebook, Inc.")]

// Setting ComVisible to false makes the types in this assembly not visible
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* of patent rights can be found in the PATENTS file in the same directory.
*/

namespace Facebook.CSSLayout
namespace Facebook.Yoga
{
public class Spacing
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* of patent rights can be found in the PATENTS file in the same directory.
*/

namespace Facebook.CSSLayout
namespace Facebook.Yoga
{
public enum YogaAlign
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* of patent rights can be found in the PATENTS file in the same directory.
*/

namespace Facebook.CSSLayout
namespace Facebook.Yoga
{
public static class YogaConstants
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* of patent rights can be found in the PATENTS file in the same directory.
*/

namespace Facebook.CSSLayout
namespace Facebook.Yoga
{
public enum YogaDimension
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* of patent rights can be found in the PATENTS file in the same directory.
*/

namespace Facebook.CSSLayout
namespace Facebook.Yoga
{
public enum YogaDirection
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* of patent rights can be found in the PATENTS file in the same directory.
*/

namespace Facebook.CSSLayout
namespace Facebook.Yoga
{
public enum YogaEdge
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* of patent rights can be found in the PATENTS file in the same directory.
*/

namespace Facebook.CSSLayout
namespace Facebook.Yoga
{
public enum YogaExperimentalFeature
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* of patent rights can be found in the PATENTS file in the same directory.
*/

namespace Facebook.CSSLayout
namespace Facebook.Yoga
{
public enum YogaFlexDirection
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* of patent rights can be found in the PATENTS file in the same directory.
*/

namespace Facebook.CSSLayout
namespace Facebook.Yoga
{
public enum YogaJustify
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* of patent rights can be found in the PATENTS file in the same directory.
*/

namespace Facebook.CSSLayout
namespace Facebook.Yoga
{
public enum YogaLogLevel
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
using System;
using System.Runtime.InteropServices;

namespace Facebook.CSSLayout
namespace Facebook.Yoga
{
internal static class CSSLogger
internal static class YogaLogger
{
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void Func(YogaLogLevel level, string message);
Expand All @@ -37,7 +37,7 @@ public static void Initialize()
throw new InvalidOperationException(message);
}
};
Native.CSSInteropSetLogger(_managedLogger);
Native.YGInteropSetLogger(_managedLogger);
_initialized = true;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
using System;
using System.Runtime.InteropServices;

namespace Facebook.CSSLayout
namespace Facebook.Yoga
{
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate CSSSize CSSMeasureFunc(
public delegate YogaSize YogaMeasureFunc(
IntPtr node,
float width,
YogaMeasureMode widthMode,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* of patent rights can be found in the PATENTS file in the same directory.
*/

namespace Facebook.CSSLayout
namespace Facebook.Yoga
{
public enum YogaMeasureMode
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@

using System;

namespace Facebook.CSSLayout
namespace Facebook.Yoga
{
public partial class CSSNode
public partial class YogaNode
{
public static CSSNode Create(
public static YogaNode Create(
YogaDirection? styleDirection = null,
YogaFlexDirection? flexDirection = null,
YogaJustify? justifyContent = null,
Expand All @@ -31,15 +31,14 @@ public static CSSNode Create(
Spacing margin = null,
Spacing padding = null,
Spacing border = null,
float? width = null,
float? height = null,
float? maxWidth = null,
float? maxHeight = null,
float? minWidth = null,
float? minHeight = null,
float? aspectRatio = null)
float? Width = null,
float? Height = null,
float? MaxWidth = null,
float? MaxHeight = null,
float? MinWidth = null,
float? MinHeight = null)
{
CSSNode node = new CSSNode();
YogaNode node = new YogaNode();

if (styleDirection.HasValue)
{
Expand Down Expand Up @@ -198,39 +197,34 @@ public static CSSNode Create(
}
}

if (width.HasValue)
if (Width.HasValue)
{
node.Width = width.Value;
node.Width = Width.Value;
}

if (height.HasValue)
if (Height.HasValue)
{
node.Height = height.Value;
node.Height = Height.Value;
}

if (minWidth.HasValue)
if (MinWidth.HasValue)
{
node.MinWidth = minWidth.Value;
node.MinWidth = MinWidth.Value;
}

if (minHeight.HasValue)
if (MinHeight.HasValue)
{
node.MinHeight = minHeight.Value;
node.MinHeight = MinHeight.Value;
}

if (maxWidth.HasValue)
if (MaxWidth.HasValue)
{
node.MaxWidth = maxWidth.Value;
node.MaxWidth = MaxWidth.Value;
}

if (maxHeight.HasValue)
if (MaxHeight.HasValue)
{
node.MaxHeight = maxHeight.Value;
}

if (aspectRatio.HasValue)
{
node.AspectRatio = aspectRatio.Value;
node.MaxHeight = MaxHeight.Value;
}

return node;
Expand Down
Loading

0 comments on commit f7cc614

Please sign in to comment.