Skip to content

Commit

Permalink
Updated to NoesisGUI 3.1.6 version
Browse files Browse the repository at this point in the history
  • Loading branch information
s-fernandez-v committed Nov 21, 2022
1 parent 16dffb8 commit 742dccb
Show file tree
Hide file tree
Showing 61 changed files with 3,988 additions and 394 deletions.
451 changes: 445 additions & 6 deletions Src/Noesis/Core/Src/Core/Extend.cs

Large diffs are not rendered by default.

15 changes: 15 additions & 0 deletions Src/Noesis/Core/Src/Core/ExtendImports.cs
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,21 @@ static extern void Noesis_RegisterReflectionCallbacks(
Callback_ScrollInfoSetVerticalOffset callback_ScrollInfoSetVerticalOffset,
Callback_ScrollInfoMakeVisible callback_ScrollInfoMakeVisible,
Callback_MarkupExtensionProvideValue callback_MarkupExtensionProvideValue,
Callback_AnimationTimelineGetType callback_AnimationTimelineGetType,
Callback_AnimationTimelineGetValue callback_AnimationTimelineGetValue,
Callback_BooleanAnimationGetValue callback_BooleanAnimationGetValue,
Callback_Int16AnimationGetValue callback_Int16AnimationGetValue,
Callback_Int32AnimationGetValue callback_Int32AnimationGetValue,
Callback_Int64AnimationGetValue callback_Int64AnimationGetValue,
Callback_DoubleAnimationGetValue callback_DoubleAnimationGetValue,
Callback_ColorAnimationGetValue callback_ColorAnimationGetValue,
Callback_PointAnimationGetValue callback_PointAnimationGetValue,
Callback_RectAnimationGetValue callback_RectAnimationGetValue,
Callback_SizeAnimationGetValue callback_SizeAnimationGetValue,
Callback_ThicknessAnimationGetValue callback_ThicknessAnimationGetValue,
Callback_ObjectAnimationGetValue callback_ObjectAnimationGetValue,
Callback_StringAnimationGetValue callback_StringAnimationGetValue,
Callback_MatrixAnimationGetValue callback_MatrixAnimationGetValue,
Callback_GetPropertyValue_Bool callback_GetPropertyValue_Bool,
Callback_GetPropertyValue_Float callback_GetPropertyValue_Float,
Callback_GetPropertyValue_Double callback_GetPropertyValue_Double,
Expand Down
30 changes: 6 additions & 24 deletions Src/Noesis/Core/Src/Proxies/AnimationTimeline.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@
namespace Noesis
{

public class AnimationTimeline : Timeline {
internal new static AnimationTimeline CreateProxy(IntPtr cPtr, bool cMemoryOwn) {
return new AnimationTimeline(cPtr, cMemoryOwn);
}

public abstract class AnimationTimeline : Timeline {
internal AnimationTimeline(IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn) {
}

Expand All @@ -30,10 +26,9 @@ internal static HandleRef getCPtr(AnimationTimeline obj) {
protected AnimationTimeline() {
}

public object GetCurrentValue(object defaultOriginValue, object defaultDestinationValue, AnimationClock animationClock) {
IntPtr cPtr = GetCurrentValueHelper(defaultOriginValue, defaultDestinationValue, animationClock);
return Noesis.Extend.GetProxy(cPtr, true);
}
public abstract Type TargetPropertyType { get; }

public abstract object GetCurrentValue(object defaultOriginValue, object defaultDestinationValue, AnimationClock animationClock);

internal bool IsValidTarget(DependencyProperty dp) {
return dp.PropertyType.IsAssignableFrom(TargetPropertyType) || TargetPropertyType == typeof(object);
Expand All @@ -53,17 +48,6 @@ public static DependencyProperty IsCumulativeProperty {
}
}

public Type TargetPropertyType {
get {
IntPtr cPtr = NoesisGUI_PINVOKE.AnimationTimeline_TargetPropertyType_get(swigCPtr);
if (cPtr != IntPtr.Zero) {
Noesis.Extend.NativeTypeInfo info = Noesis.Extend.GetNativeTypeInfo(cPtr);
return info.Type;
}
return null;
}
}

public bool IsAdditive {
set {
NoesisGUI_PINVOKE.AnimationTimeline_IsAdditive_set(swigCPtr, value);
Expand All @@ -84,11 +68,9 @@ public bool IsCumulative {
}
}

private IntPtr GetCurrentValueHelper(object defValSrc, object defValDest, AnimationClock clock) {
IntPtr ret = NoesisGUI_PINVOKE.AnimationTimeline_GetCurrentValueHelper(swigCPtr, Noesis.Extend.GetInstanceHandle(defValSrc), Noesis.Extend.GetInstanceHandle(defValDest), AnimationClock.getCPtr(clock));
return ret;
internal new static IntPtr Extend(string typeName) {
return NoesisGUI_PINVOKE.Extend_AnimationTimeline(Marshal.StringToHGlobalAnsi(typeName));
}

}

}
Expand Down
53 changes: 0 additions & 53 deletions Src/Noesis/Core/Src/Proxies/BaseAnimation.cs

This file was deleted.

65 changes: 65 additions & 0 deletions Src/Noesis/Core/Src/Proxies/BooleanAnimationBase.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
//------------------------------------------------------------------------------
// <auto-generated />
//
// This file was automatically generated by SWIG (http://www.swig.org).
// Version 3.0.10
//
// Do not make changes to this file unless you know what you are doing--modify
// the SWIG interface file instead.
//------------------------------------------------------------------------------


using System;
using System.Runtime.InteropServices;

namespace Noesis
{

public abstract class BooleanAnimationBase : AnimationTimeline {
internal BooleanAnimationBase(IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn) {
}

internal static HandleRef getCPtr(BooleanAnimationBase obj) {
return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
}

protected BooleanAnimationBase() {
}

public sealed override Type TargetPropertyType {
get {
return typeof(bool);
}
}

public sealed override object GetCurrentValue(object defaultOriginValue, object defaultDestinationValue, AnimationClock animationClock) {
if (defaultOriginValue == null) {
throw new ArgumentNullException("defaultOriginValue");
}
if (defaultDestinationValue == null) {
throw new ArgumentNullException("defaultDestinationValue");
}
return GetCurrentValue((bool)defaultOriginValue, (bool)defaultDestinationValue, animationClock);
}

/// <summary>Gets the current value of the animation.</summary>
public bool GetCurrentValue(bool defaultOriginValue, bool defaultDestinationValue, AnimationClock animationClock) {
if (animationClock == null) {
throw new ArgumentNullException("animationClock");
}
if (animationClock.CurrentState == ClockState.Stopped) {
return defaultDestinationValue;
}
return GetCurrentValueCore(defaultOriginValue, defaultDestinationValue, animationClock);
}

/// <summary>Calculates a value that represents the current value of the property being animated, as determined by the host animation. </summary>
protected internal abstract bool GetCurrentValueCore(bool defaultOriginValue, bool defaultDestinationValue, AnimationClock animationClock);

internal new static IntPtr Extend(string typeName) {
return NoesisGUI_PINVOKE.Extend_BooleanAnimationBase(Marshal.StringToHGlobalAnsi(typeName));
}
}

}

11 changes: 10 additions & 1 deletion Src/Noesis/Core/Src/Proxies/BooleanAnimationUsingKeyFrames.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
namespace Noesis
{

public class BooleanAnimationUsingKeyFrames : AnimationTimeline {
public sealed class BooleanAnimationUsingKeyFrames : BooleanAnimationBase {
internal new static BooleanAnimationUsingKeyFrames CreateProxy(IntPtr cPtr, bool cMemoryOwn) {
return new BooleanAnimationUsingKeyFrames(cPtr, cMemoryOwn);
}
Expand All @@ -27,6 +27,10 @@ internal static HandleRef getCPtr(BooleanAnimationUsingKeyFrames obj) {
return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
}

protected internal override bool GetCurrentValueCore(bool defaultOriginValue, bool defaultDestinationValue, AnimationClock animationClock) {
return GetCurrentValueCoreHelper(defaultOriginValue, defaultDestinationValue, animationClock);
}

public BooleanAnimationUsingKeyFrames() {
}

Expand All @@ -42,6 +46,11 @@ public BooleanKeyFrameCollection KeyFrames {
}
}

private bool GetCurrentValueCoreHelper(bool src, bool dst, AnimationClock clock) {
bool ret = NoesisGUI_PINVOKE.BooleanAnimationUsingKeyFrames_GetCurrentValueCoreHelper(swigCPtr, src, dst, AnimationClock.getCPtr(clock));
return ret;
}

}

}
Expand Down
18 changes: 13 additions & 5 deletions Src/Noesis/Core/Src/Proxies/BrushShader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,15 @@ protected void SetPixelShader(IntPtr shader, Target target) {
}

#if UNITY_5_3_OR_NEWER
protected NoesisShader CreateShader() {
protected NoesisShader CreateShader(int numTextures) {
string name = GetType().Name.Replace("Brush", ".noesisbrush");
NoesisShader shader = NoesisShaderProvider.instance.GetShader(name);

if (shader != null) {
shader.brush_path = NoesisRenderer.CreatePixelShader((byte)Shader.Enum.Path_Pattern, shader.brush_path_bytecode);
shader.brush_path_aa = NoesisRenderer.CreatePixelShader((byte)Shader.Enum.Path_AA_Pattern, shader.brush_path_aa_bytecode);
shader.brush_sdf = NoesisRenderer.CreatePixelShader((byte)Shader.Enum.SDF_Pattern, shader.brush_sdf_bytecode);
shader.brush_opacity = NoesisRenderer.CreatePixelShader((byte)Shader.Enum.Opacity_Pattern, shader.brush_opacity_bytecode);
shader.brush_path = NoesisRenderer.CreatePixelShader((byte)Shader.Enum.Path_Pattern, numTextures, shader.brush_path_bytecode);
shader.brush_path_aa = NoesisRenderer.CreatePixelShader((byte)Shader.Enum.Path_AA_Pattern, numTextures, shader.brush_path_aa_bytecode);
shader.brush_sdf = NoesisRenderer.CreatePixelShader((byte)Shader.Enum.SDF_Pattern, numTextures, shader.brush_sdf_bytecode);
shader.brush_opacity = NoesisRenderer.CreatePixelShader((byte)Shader.Enum.Opacity_Pattern, numTextures, shader.brush_opacity_bytecode);
return shader;
}

Expand All @@ -84,12 +84,20 @@ protected void SetShader(NoesisShader shader) {
SetPixelShader(shader.brush_opacity, BrushShader.Target.Opacity);
}
}

protected void SetTexture(UnityEngine.Texture texture, uint index) {
NoesisGUI_PINVOKE.BrushShader_SetTexture(swigCPtr, Noesis.Extend.GetInstanceHandle(texture), index);
}
#endif

private void SetPixelShader(IntPtr value, int target) {
NoesisGUI_PINVOKE.BrushShader_SetPixelShader(swigCPtr, value, target);
}

protected void SetTexture(ImageSource texture, uint index) {
NoesisGUI_PINVOKE.BrushShader_SetTexture(swigCPtr, ImageSource.getCPtr(texture), index);
}

private void SetConstantBuffer(IntPtr buffer, uint size) {
NoesisGUI_PINVOKE.BrushShader_SetConstantBuffer(swigCPtr, buffer, size);
}
Expand Down
36 changes: 24 additions & 12 deletions Src/Noesis/Core/Src/Proxies/Clock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,25 +90,32 @@ private static void RaiseCompleted(IntPtr cPtr, IntPtr sender, IntPtr e) {

#endregion

public int CurrentIteration {
public int? CurrentIteration {
get {
int ret = NoesisGUI_PINVOKE.Clock_CurrentIteration_get(swigCPtr);
return ret;
}
return GetCurrentIteration();
}
}

public float CurrentProgress {
public float? CurrentProgress {
get {
float ret = NoesisGUI_PINVOKE.Clock_CurrentProgress_get(swigCPtr);
return ret;
}
return GetCurrentProgress();
}
}

public double CurrentTime {
public TimeSpan? CurrentTime {
get {
double ret = NoesisGUI_PINVOKE.Clock_CurrentTime_get(swigCPtr);
return ret;
}
return TimeSpan.FromSeconds(GetCurrentTime());
}
}

private int GetCurrentIteration() {
int ret = NoesisGUI_PINVOKE.Clock_GetCurrentIteration__SWIG_0(swigCPtr);
return ret;
}

public double GetCurrentTime() {
double ret = NoesisGUI_PINVOKE.Clock_GetCurrentTime__SWIG_0(swigCPtr);
return ret;
}

public ClockState CurrentState {
Expand Down Expand Up @@ -139,6 +146,11 @@ public Timeline Timeline {
}
}

private float GetCurrentProgress() {
float ret = NoesisGUI_PINVOKE.Clock_GetCurrentProgress(swigCPtr);
return ret;
}

}

}
Expand Down
Loading

0 comments on commit 742dccb

Please sign in to comment.