Add basic Xamarin.iOS support #280
1
.gitignore
vendored
1
.gitignore
vendored
@@ -8,4 +8,3 @@
|
|||||||
|
|
||||||
|
|||||||
# Visual studio code
|
# Visual studio code
|
||||||
.vscode
|
.vscode
|
||||||
libyoga.a
|
|
||||||
|
2
csharp/.gitignore
vendored
2
csharp/.gitignore
vendored
@@ -268,3 +268,5 @@ paket-files/
|
|||||||
# Python Tools for Visual Studio (PTVS)
|
# Python Tools for Visual Studio (PTVS)
|
||||||
__pycache__/
|
__pycache__/
|
||||||
*.pyc
|
*.pyc
|
||||||
|
|
||||||
|
libyoga.a
|
||||||
|
@@ -14,21 +14,18 @@ namespace Facebook.Yoga
|
|||||||
{
|
{
|
||||||
internal static class YogaLogger
|
internal static class YogaLogger
|
||||||
{
|
{
|
||||||
#if !__IOS__
|
|
||||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||||
public delegate void Func(YogaLogLevel level, string message);
|
public delegate void Func(YogaLogLevel level, string message);
|
||||||
#endif
|
|
||||||
private static bool _initialized;
|
private static bool _initialized;
|
||||||
#if !__IOS__
|
|
||||||
private static Func _managedLogger = null;
|
private static Func _managedLogger = null;
|
||||||
|
|
||||||
public static Func Logger = null;
|
public static Func Logger = null;
|
||||||
#endif
|
|
||||||
public static void Initialize()
|
public static void Initialize()
|
||||||
{
|
{
|
||||||
if (!_initialized)
|
if (!_initialized)
|
||||||
{
|
{
|
||||||
#if !__IOS__
|
|
||||||
_managedLogger = (level, message) => {
|
_managedLogger = (level, message) => {
|
||||||
if (Logger != null)
|
if (Logger != null)
|
||||||
{
|
{
|
||||||
@@ -41,7 +38,6 @@ namespace Facebook.Yoga
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
Native.YGInteropSetLogger(_managedLogger);
|
Native.YGInteropSetLogger(_managedLogger);
|
||||||
#endif
|
|
||||||
_initialized = true;
|
_initialized = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -540,7 +540,7 @@ namespace Facebook.Yoga
|
|||||||
long output = _measureFunction(this, width, widthMode, height, heightMode);
|
long output = _measureFunction(this, width, widthMode, height, heightMode);
|
||||||
return new YogaSize { width = MeasureOutput.GetWidth(output), height = MeasureOutput.GetHeight(output) };
|
return new YogaSize { width = MeasureOutput.GetWidth(output), height = MeasureOutput.GetHeight(output) };
|
||||||
}
|
}
|
||||||
#if !__IOS__
|
|
||||||
public string Print(YogaPrintOptions options =
|
public string Print(YogaPrintOptions options =
|
||||||
YogaPrintOptions.Layout|YogaPrintOptions.Style|YogaPrintOptions.Children)
|
YogaPrintOptions.Layout|YogaPrintOptions.Style|YogaPrintOptions.Children)
|
||||||
{
|
{
|
||||||
@@ -551,7 +551,7 @@ namespace Facebook.Yoga
|
|||||||
YogaLogger.Logger = orig;
|
YogaLogger.Logger = orig;
|
||||||
return sb.ToString();
|
return sb.ToString();
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
public IEnumerator<YogaNode> GetEnumerator()
|
public IEnumerator<YogaNode> GetEnumerator()
|
||||||
{
|
{
|
||||||
return _children != null ? ((IEnumerable<YogaNode>)_children).GetEnumerator() :
|
return _children != null ? ((IEnumerable<YogaNode>)_children).GetEnumerator() :
|
||||||
|
@@ -4,7 +4,7 @@
|
|||||||
<CompileDependsOn>CopyInNativeLib;$(CompileDependsOn)</CompileDependsOn>
|
<CompileDependsOn>CopyInNativeLib;$(CompileDependsOn)</CompileDependsOn>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<!-- The # and , in this path does not play nice with the binding project logic, so make a copy -->
|
<!-- The # and , in this path does not play nice with the binding project logic, so make a copy -->
|
||||||
<Target Name="CopyInNativeLib" Inputs="..\..\buck-out\get\csharp\yoganet-ios\libyoga.a" Outputs="$(ProjectDir)libyoga.a">
|
<Target Name="CopyInNativeLib" Inputs="..\..\buck-out\gen\csharp\yoganet-ios\libyoga.a" Outputs="$(ProjectDir)libyoga.a">
|
||||||
<Copy SourceFiles="..\..\buck-out\get\csharp\yoganet-ios\libyoga.a" DestinationFiles="$(ProjectDir)/libyoga.a" />
|
<Copy SourceFiles="..\..\buck-out\gen\csharp\yoganet-ios\libyoga.a" DestinationFiles="$(ProjectDir)/libyoga.a" />
|
||||||
</Target>
|
</Target>
|
||||||
</Project>
|
</Project>
|
Reference in New Issue
Block a user
Move to csharp/.gitignore