8000 UX: move copies of UnoCore types by mortend · Pull Request #345 · fuse-open/uno · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

UX: move copies of UnoCore types #345

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions src/ux/markup/AtomicValueParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using Uno.UX.Markup.Types.UX;

namespace Uno.UX.Markup
{
Expand All @@ -11,24 +12,24 @@ public static Size ParseSize(string s, FileSourceInfo src)
{
s = s.Trim('f');

Uno.UX.Unit unit = Uno.UX.Unit.Unspecified;
Unit unit = Unit.Unspecified;
if (s.EndsWith("%"))
{
unit = Uno.UX.Unit.Percent;
unit = Unit.Percent;
s = s.Trim('%');
}
else if (s.EndsWith("px"))
{
unit = Uno.UX.Unit.Pixels;
unit = Unit.Pixels;
s = s.Substring(0, s.Length - 2);
}
else if (s.EndsWith("pt"))
{
unit = Uno.UX.Unit.Points;
unit = Unit.Points;
s = s.Substring(0, s.Length - 2);
}

var d = double.Parse(s, System.Globalization.CultureInfo.InvariantCulture);
var d = double.Parse(s, CultureInfo.InvariantCulture);

return new Size((float)(dynamic)d, unit.ToString(), src);
}
Expand All @@ -52,7 +53,7 @@ public static Size2 ParseSize2(string s, FileSourceInfo src)
public static Scalar<T> ParseFloat<T>(string s, FileSourceInfo src) where T : IFormattable
{
s = s.Trim('f');
var d = double.Parse(s, System.Globalization.CultureInfo.InvariantCulture);
var d = double.Parse(s, CultureInfo.InvariantCulture); 10000

return new Scalar<T>((T)(dynamic)d, src);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// This file was generated based on lib/UnoCore/Source/Uno/Float2.uno.
// WARNING: Changes might be lost if you edit this file directly.

namespace Uno
namespace Uno.UX.Markup.Types
{
public struct Float2
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// This file was generated based on lib/UnoCore/Source/Uno/Float3.uno.
// WARNING: Changes might be lost if you edit this file directly.

namespace Uno
namespace Uno.UX.Markup.Types
{
public struct Float3
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// This file was generated based on lib/UnoCore/Source/Uno/Float4.uno.
// WARNING: Changes might be lost if you edit this file directly.

namespace Uno
namespace Uno.UX.Markup.Types
{
public struct Float4
{
Expand Down
2 changes: 1 addition & 1 deletion src/ux/markup/Uno/Int2.cs → src/ux/markup/Types/Int2.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// This file was generated based on lib/UnoCore/Source/Uno/Int2.uno.
// WARNING: Changes might be lost if you edit this file directly.

namespace Uno
namespace Uno.UX.Markup.Types
{
public struct Int2
{
Expand Down
2 changes: 1 addition & 1 deletion src/ux/markup/Uno/Int3.cs → src/ux/markup/Types/Int3.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// This file was generated based on lib/UnoCore/Source/Uno/Int3.uno.
// WARNING: Changes might be lost if you edit this file directly.

namespace Uno
namespace Uno.UX.Markup.Types
{
public struct Int3
{
Expand Down
2 changes: 1 addition & 1 deletion src/ux/markup/Uno/Int4.cs → src/ux/markup/Types/Int4.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// This file was generated based on lib/UnoCore/Source/Uno/Int4.uno.
// WARNING: Changes might be lost if you edit this file directly.

namespace Uno
namespace Uno.UX.Markup.Types
{
public struct Int4
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// This file was generated based on lib/UnoCore/Source/Uno/UX/Size.uno.
// WARNING: Changes might be lost if you edit this file directly.

namespace Uno.UX
namespace Uno.UX.Markup.Types.UX
{
public enum Unit
{
Expand Down
14 changes: 7 additions & 7 deletions src/ux/markup/Uno.UX.Markup.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@
<Compile Include="InstanceType.cs" />
<Compile Include="Reflection\Reflection.cs" />
<Compile Include="TypeNameHelper.cs" />
<Compile Include="Uno\Float2.cs" />
<Compile Include="Uno\Float3.cs" />
<Compile Include="Uno\Float4.cs" />
<Compile Include="Uno\Int2.cs" />
<Compile Include="Uno\Int3.cs" />
<Compile Include="Uno\Int4.cs" />
<Compile Include="Uno\UX\Unit.cs" />
<Compile Include="Types\Float2.cs" />
<Compile Include="Types\Float3.cs" />
<Compile Include="Types\Float4.cs" />
<Compile Include="Types\Int2.cs" />
<Compile Include="Types\Int3.cs" />
<Compile Include="Types\Int4.cs" />
<Compile Include="Types\UX\Unit.cs" />
<Compile Include="UXIL\AtomicValueParser.cs" />
<Compile Include="UXIL\ClassNode.cs" />
<Compile Include="UXIL\ClassNode.IDataType.cs" />
Expand Down
13 changes: 7 additions & 6 deletions src/ux/markup/ValueMarshal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Globalization;
using System.Linq;
using Uno.UX.Markup;
using Uno.UX.Markup.Types;

namespace Uno.UX
{
Expand Down Expand Up @@ -100,12 +101,12 @@ public static bool IsIntegerType(this Type t)

public static bool IsVectorType(this Type t)
{
return t == typeof (Uno.Float2) ||
t == typeof (Uno.Float3) ||
t == typeof (Uno.Float4) ||
t == typeof (Uno.Int2) ||
t == typeof (Uno.Int3) ||
t == typeof (Uno.Int4);
return t == typeof (Float2) ||
t == typeof (Float3) ||
t == typeof (Float4) ||
t == typeof (Int2) ||
t == typeof (Int3) ||
t == typeof (Int4);
}

public static string Encode(object value, bool includeSuffixes = false)
Expand Down
0