From 805619c7b64c771141ff63d2f75883d04896fba1 Mon Sep 17 00:00:00 2001 From: sfernandez Date: Mon, 20 Mar 2023 11:50:18 -0700 Subject: [PATCH] Updated to NoesisGUI 3.2.0 version --- Src/Noesis/Core/Src/Core/Events.cs | 1 + Src/Noesis/Core/Src/Core/Extend.cs | 280 ++++++++- Src/Noesis/Core/Src/Core/ExtendBoxing.cs | 10 +- Src/Noesis/Core/Src/Core/ExtendImports.cs | 14 + Src/Noesis/Core/Src/Core/ExtendProps.cs | 20 +- Src/Noesis/Core/Src/Core/HitTest.cs | 1 + Src/Noesis/Core/Src/Core/NoesisGUI.cs | 24 + Src/Noesis/Core/Src/Core/RenderDevice.cs | 111 +++- Src/Noesis/Core/Src/Core/RendererNoesis.cs | 2 +- Src/Noesis/Core/Src/Core/UriHelper.cs | 4 +- Src/Noesis/Core/Src/Core/View.cs | 41 +- .../Core/Src/Proxies/BaseComponentExtend.cs | 22 +- .../Src/Proxies/BaseFreezableCollection.cs | 24 +- .../Core/Src/Proxies/CompositeTransform3D.cs | 10 - .../Src/Proxies/DependencyObjectExtend.cs | 48 +- .../Src/Proxies/DependencyPropertyExtend.cs | 8 +- Src/Noesis/Core/Src/Proxies/DrawingContext.cs | 4 + Src/Noesis/Core/Src/Proxies/Ellipse.cs | 4 + Src/Noesis/Core/Src/Proxies/FontCapitals.cs | 29 + .../Core/Src/Proxies/FontEastAsianLanguage.cs | 32 + .../Core/Src/Proxies/FontEastAsianWidths.cs | 28 + Src/Noesis/Core/Src/Proxies/FontFraction.cs | 25 + .../Core/Src/Proxies/FontNumeralAlignment.cs | 25 + .../Core/Src/Proxies/FontNumeralStyle.cs | 25 + Src/Noesis/Core/Src/Proxies/FontVariants.cs | 28 + Src/Noesis/Core/Src/Proxies/FormattedText.cs | 65 ++- .../Src/Proxies/FrameworkElementExtend.cs | 4 + Src/Noesis/Core/Src/Proxies/Geometry.cs | 51 ++ .../Core/Src/Proxies/HitTest3DResult.cs | 77 +++ Src/Noesis/Core/Src/Proxies/Inline.cs | 25 + Src/Noesis/Core/Src/Proxies/Line.cs | 4 + .../Core/Src/Proxies/MatrixTransform3D.cs | 10 - Src/Noesis/Core/Src/Proxies/NoesisGUI_.cs | 54 +- .../Core/Src/Proxies/NoesisGUI_PINVOKE.cs | 395 +++++++++++-- Src/Noesis/Core/Src/Proxies/PasswordBox.cs | 17 + Src/Noesis/Core/Src/Proxies/Path.cs | 4 + Src/Noesis/Core/Src/Proxies/Pen.cs | 51 -- Src/Noesis/Core/Src/Proxies/Rectangle.cs | 4 + Src/Noesis/Core/Src/Proxies/RiveControl.cs | 117 ++++ Src/Noesis/Core/Src/Proxies/RiveInput.cs | 76 +++ .../Core/Src/Proxies/RiveInputCollection.cs | 41 ++ .../Core/Src/Proxies/RiveSourceInputType.cs | 25 + Src/Noesis/Core/Src/Proxies/Shape.cs | 8 +- Src/Noesis/Core/Src/Proxies/TextBlock.cs | 4 + Src/Noesis/Core/Src/Proxies/TextBox.cs | 4 + Src/Noesis/Core/Src/Proxies/TextElement.cs | 4 + Src/Noesis/Core/Src/Proxies/Transform3D.cs | 16 +- Src/Noesis/Core/Src/Proxies/Typography.cs | 547 ++++++++++++++++++ Src/Noesis/Core/Src/Proxies/UIElement.cs | 6 +- .../Core/Src/Proxies/VisualTreeHelper.cs | 72 ++- .../Extensions/Noesis.GUI.Extensions.csproj | 6 +- .../Extensions/Src/InteractivityBehaviors.cs | 208 +++++++ Src/Noesis/Extensions/Src/RichText.cs | 146 +++-- Src/Noesis/Extensions/Src/Rive.cs | 125 ++++ Src/Noesis/Extensions/Src/Text.cs | 32 + Src/Noesis/Extensions/Src/Unreal.cs | 39 +- .../Src/Interactivity/AttachableCollection.cs | 2 +- .../Src/Interactivity/AttachableObject.cs | 22 +- .../Interactivity/BackgroundEffectBehavior.cs | 223 +++++++ .../Src/Interactivity/ConditionBehavior.cs | 12 +- .../Interactivity/MouseDragElementBehavior.cs | 11 +- .../Src/Interactivity/RiveTriggerAction.cs | 42 ++ .../TranslateZoomRotateBehavior.cs | 27 +- .../Core/Src/Localization/RichText.cs | 306 +++++----- .../D3D11/Src/RenderContextD3D11.cs | 2 + .../D3D12/Src/RenderContextD3D12.cs | 4 + .../EGL/Src/RenderContextEGL.cs | 12 + .../GLX/Src/RenderContextGLX.cs | 5 + .../NSGL/Src/RenderContextNSGL.cs | 5 + .../WGL/Src/RenderContextWGL.cs | 11 +- THIRD_PARTY.txt | 212 ++----- 71 files changed, 3306 insertions(+), 647 deletions(-) create mode 100644 Src/Noesis/Core/Src/Proxies/FontCapitals.cs create mode 100644 Src/Noesis/Core/Src/Proxies/FontEastAsianLanguage.cs create mode 100644 Src/Noesis/Core/Src/Proxies/FontEastAsianWidths.cs create mode 100644 Src/Noesis/Core/Src/Proxies/FontFraction.cs create mode 100644 Src/Noesis/Core/Src/Proxies/FontNumeralAlignment.cs create mode 100644 Src/Noesis/Core/Src/Proxies/FontNumeralStyle.cs create mode 100644 Src/Noesis/Core/Src/Proxies/FontVariants.cs create mode 100644 Src/Noesis/Core/Src/Proxies/HitTest3DResult.cs create mode 100644 Src/Noesis/Core/Src/Proxies/RiveControl.cs create mode 100644 Src/Noesis/Core/Src/Proxies/RiveInput.cs create mode 100644 Src/Noesis/Core/Src/Proxies/RiveInputCollection.cs create mode 100644 Src/Noesis/Core/Src/Proxies/RiveSourceInputType.cs create mode 100644 Src/Noesis/Core/Src/Proxies/Typography.cs create mode 100644 Src/Noesis/Extensions/Src/Rive.cs create mode 100644 Src/NoesisApp/Core/Src/Interactivity/BackgroundEffectBehavior.cs create mode 100644 Src/NoesisApp/Core/Src/Interactivity/RiveTriggerAction.cs diff --git a/Src/Noesis/Core/Src/Core/Events.cs b/Src/Noesis/Core/Src/Core/Events.cs index 58496c3..7a4a96b 100644 --- a/Src/Noesis/Core/Src/Core/Events.cs +++ b/Src/Noesis/Core/Src/Core/Events.cs @@ -741,6 +741,7 @@ static EventManager() RegisterCLREvent("IsMouseDirectlyOverChanged", typeof(DependencyPropertyChangedEventHandler), DependencyPropertyChangedEventArgs.InvokeHandler); RegisterCLREvent("IsKeyboardFocusedChanged", typeof(DependencyPropertyChangedEventHandler), DependencyPropertyChangedEventArgs.InvokeHandler); RegisterCLREvent("IsKeyboardFocusWithinChanged", typeof(DependencyPropertyChangedEventHandler), DependencyPropertyChangedEventArgs.InvokeHandler); + RegisterCLREvent("LayoutUpdated", typeof(EventHandler), EventArgs.InvokeHandler); // FrameworkElement RegisterRoutedEvent(FrameworkElement.LoadedEvent, typeof(RoutedEventHandler), RoutedEventArgs.InvokeHandler); diff --git a/Src/Noesis/Core/Src/Core/Extend.cs b/Src/Noesis/Core/Src/Core/Extend.cs index c2740b7..13d2cc6 100644 --- a/Src/Noesis/Core/Src/Core/Extend.cs +++ b/Src/Noesis/Core/Src/Core/Extend.cs @@ -122,6 +122,7 @@ public static void RegisterCallbacks() _uiElementRender, _frameworkElementConnectEvent, + _frameworkElementConnectField, _frameworkElementMeasure, _frameworkElementArrange, _frameworkElementApplyTemplate, @@ -133,6 +134,8 @@ public static void RegisterCallbacks() _freezableClone, + _shapeGetGeometry, + _commandCanExecute, _commandExecute, @@ -145,11 +148,15 @@ public static void RegisterCallbacks() _listGet, _listSet, _listAdd, + _listInsert, _listIndexOf, + _listRemoveAt, + _listClear, _dictionaryFind, _dictionarySet, _dictionaryAdd, + _dictionaryRemove, _listIndexerTryGet, _listIndexerTrySet, @@ -224,6 +231,8 @@ public static void RegisterCallbacks() _getPropertyValue_Bool, _getPropertyValue_Float, _getPropertyValue_Double, + _getPropertyValue_Int64, + _getPropertyValue_UInt64, _getPropertyValue_Int, _getPropertyValue_UInt, _getPropertyValue_Short, @@ -246,6 +255,8 @@ public static void RegisterCallbacks() _setPropertyValue_Bool, _setPropertyValue_Float, _setPropertyValue_Double, + _setPropertyValue_Int64, + _setPropertyValue_UInt64, _setPropertyValue_Int, _setPropertyValue_UInt, _setPropertyValue_Short, @@ -280,14 +291,15 @@ public static void UnregisterCallbacks() null, null, null, null, null, - null, null, null, null, + null, null, null, null, null, null, null, null, null, + null, null, null, null, null, null, null, - null, null, null, null, null, - null, null, null, + null, null, null, null, null, null, null, null, + null, null, null, null, null, null, null, null, null, @@ -296,8 +308,8 @@ public static void UnregisterCallbacks() null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, - null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, - null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, + null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, + null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null); } @@ -396,8 +408,9 @@ public NativeTypeIndexerInfo(NativeTypeKind kind, System.Type type, Func } //////////////////////////////////////////////////////////////////////////////////////////////// - static Dictionary _nativeTypes = new Dictionary(512); - static Dictionary _managedTypes = new Dictionary(512); + const int TypesCapacity = 650; + static Dictionary _nativeTypes = new Dictionary(TypesCapacity); + static Dictionary _managedTypes = new Dictionary(TypesCapacity); #endregion @@ -445,7 +458,7 @@ public static IntPtr GetNativeType(Type type) IntPtr nativeType; if (!_managedTypes.TryGetValue(type, out nativeType)) { - throw new InvalidOperationException("Native type is not registered: " + type.Name); + throw new InvalidOperationException($"Native type is not registered for '{type.Name}'"); } return nativeType; } @@ -463,7 +476,8 @@ public static NativeTypeInfo GetNativeTypeInfo(IntPtr nativeType) return GetNativeTypeInfo(baseType); } - throw new InvalidOperationException("Native type is not registered"); + string typeName = StringFromNativeUtf8(Noesis_GetTypeName(nativeType)); + throw new InvalidOperationException($"Native type '{typeName}' is not registered"); } return info; } @@ -540,7 +554,6 @@ public static object Initialize(object instance) //////////////////////////////////////////////////////////////////////////////////////////////// public static void RegisterNativeTypes() { - const int TypesCapacity = 600; IntPtr[] types = new IntPtr[TypesCapacity]; for (int t = 0; t < TypesCapacity; ++t) types[t] = IntPtr.Zero; @@ -573,6 +586,9 @@ public static void RegisterNativeTypes() AddNativeType(types[i++], new NativeTypeInfo(NativeTypeKind.Basic, typeof(KeyTime))); AddNativeType(types[i++], new NativeTypeInfo(NativeTypeKind.Basic, typeof(TimeSpan))); AddNativeType(types[i++], new NativeTypeInfo(NativeTypeKind.Basic, typeof(VirtualizationCacheLength))); + AddNativeType(types[i++], new NativeTypeInfo(NativeTypeKind.Basic, typeof(Matrix))); + AddNativeType(types[i++], new NativeTypeInfo(NativeTypeKind.Basic, typeof(Matrix3D))); + AddNativeType(types[i++], new NativeTypeInfo(NativeTypeKind.Basic, typeof(Matrix4))); AddNativeType(types[i++], new NativeTypeInfo(NativeTypeKind.Basic, typeof(bool?))); AddNativeType(types[i++], new NativeTypeInfo(NativeTypeKind.Basic, typeof(float?))); @@ -676,6 +692,9 @@ public static void RegisterNativeTypes() AddNativeType(types[i++], new NativeTypeInfo(NativeTypeKind.Boxed, typeof(Boxed))); AddNativeType(types[i++], new NativeTypeInfo(NativeTypeKind.Boxed, typeof(Boxed))); AddNativeType(types[i++], new NativeTypeInfo(NativeTypeKind.Boxed, typeof(Boxed))); + AddNativeType(types[i++], new NativeTypeInfo(NativeTypeKind.Basic, typeof(Boxed))); + AddNativeType(types[i++], new NativeTypeInfo(NativeTypeKind.Basic, typeof(Boxed))); + AddNativeType(types[i++], new NativeTypeInfo(NativeTypeKind.Basic, typeof(Boxed))); AddNativeType(types[i++], new NativeTypeInfo(NativeTypeKind.Boxed, typeof(Boxed))); AddNativeType(types[i++], new NativeTypeInfo(NativeTypeKind.Boxed, typeof(Boxed))); @@ -1132,6 +1151,10 @@ public static void RegisterNativeTypes() AddNativeType(types[i++], new NativeTypeComponentInfo(NativeTypeKind.Component, typeof(ListView), ListView.CreateProxy)); AddNativeType(types[i++], new NativeTypeComponentInfo(NativeTypeKind.Component, typeof(ListViewItem), ListViewItem.CreateProxy)); + AddNativeType(types[i++], new NativeTypeComponentInfo(NativeTypeKind.Component, typeof(RiveInput), RiveInput.CreateProxy)); + AddNativeType(types[i++], new NativeTypeComponentInfo(NativeTypeKind.Component, typeof(RiveInputCollection), RiveInputCollection.CreateProxy)); + AddNativeType(types[i++], new NativeTypeComponentInfo(NativeTypeKind.Component, typeof(RiveControl), RiveControl.CreateProxy)); + _managedTypes[typeof(NativeRenderDevice)] = types[i]; AddNativeType(types[i++], new NativeTypeComponentInfo(NativeTypeKind.Component, typeof(RenderDevice), NativeRenderDevice.CreateProxy)); _managedTypes[typeof(NativeRenderTarget)] = types[i]; @@ -1240,14 +1263,15 @@ private enum ExtendTypeOverrides Visual_GetChild = 8, UIElement_OnRender = 16, FrameworkElement_ConnectEvent = 32, - FrameworkElement_Measure = 64, - FrameworkElement_Arrange = 128, - FrameworkElement_ApplyTemplate = 256, - ItemsControl_GetContainer = 512, - ItemsControl_IsContainer = 1024, - Adorner_GetTransform = 2048, - Freezable_Clone = 4096, - Animation_GetValueCore = 8192 + FrameworkElement_ConnectField = 64, + FrameworkElement_Measure = 128, + FrameworkElement_Arrange = 256, + FrameworkElement_ApplyTemplate = 512, + ItemsControl_GetContainer = 1024, + ItemsControl_IsContainer = 2048, + Adorner_GetTransform = 4096, + Freezable_Clone = 8192, + Animation_GetValueCore = 16384 } private struct ExtendPropertyData @@ -1581,8 +1605,11 @@ private static ExtendTypeData CreateNativeTypeData(System.Type type, IntPtr nati if (typeof(FrameworkElement).GetTypeInfo().IsAssignableFrom(type.GetTypeInfo())) { - MethodInfo connectMethod = FindMethod(type, "ConnectEvent", new Type[] { typeof(object), typeof(string), typeof(string) }); - if (IsOverride(connectMethod)) overrides |= ExtendTypeOverrides.FrameworkElement_ConnectEvent; + MethodInfo eventMethod = FindMethod(type, "ConnectEvent", new Type[] { typeof(object), typeof(string), typeof(string) }); + if (IsOverride(eventMethod)) overrides |= ExtendTypeOverrides.FrameworkElement_ConnectEvent; + + MethodInfo fieldMethod = FindMethod(type, "ConnectField", new Type[] { typeof(object), typeof(string) }); + if (IsOverride(fieldMethod)) overrides |= ExtendTypeOverrides.FrameworkElement_ConnectField; MethodInfo measureMethod = FindMethod(type, "MeasureOverride", new Type[] { typeof(Size) }); if (IsOverride(measureMethod)) overrides |= ExtendTypeOverrides.FrameworkElement_Measure; @@ -2177,6 +2204,30 @@ private static bool FrameworkElementConnectEvent(IntPtr cPtr, return false; } + //////////////////////////////////////////////////////////////////////////////////////////////// + private delegate void Callback_FrameworkElementConnectField(IntPtr cPtr, + IntPtr cPtrSourceType, IntPtr cPtrSource, string fieldName); + private static Callback_FrameworkElementConnectField _frameworkElementConnectField = FrameworkElementConnectField; + + [MonoPInvokeCallback(typeof(Callback_FrameworkElementConnectField))] + private static void FrameworkElementConnectField(IntPtr cPtr, + IntPtr cPtrSourceType, IntPtr cPtrSource, string fieldName) + { + try + { + FrameworkElement element = (FrameworkElement)GetExtendInstance(cPtr); + if (element != null) + { + object source = GetProxy(cPtrSourceType, cPtrSource, false); + element.ConnectField(source, fieldName); + } + } + catch (Exception e) + { + Error.UnhandledException(e); + } + } + //////////////////////////////////////////////////////////////////////////////////////////////// private delegate void Callback_FrameworkElementMeasure(IntPtr cPtr, ref Size availableSize, ref Size desiredSize, FrameworkElement.LayoutBaseCallback callback); @@ -2358,6 +2409,27 @@ private static void FreezableClone(IntPtr cPtrType, IntPtr cPtrClone, IntPtr cPt } } + //////////////////////////////////////////////////////////////////////////////////////////////// + private delegate IntPtr Callback_ShapeGetGeometry(IntPtr cPtr); + private static Callback_ShapeGetGeometry _shapeGetGeometry = ShapeGetGeometry; + + [MonoPInvokeCallback(typeof(Callback_ShapeGetGeometry))] + private static IntPtr ShapeGetGeometry(IntPtr cPtr) + { + try + { + var shape = (Shape)GetExtendInstance(cPtr); + Geometry geometry = shape.DefiningGeometry; + HandleRef geometryPtr = GetInstanceHandle(geometry); + return geometryPtr.Handle; + } + catch (Exception e) + { + Error.UnhandledException(e); + return IntPtr.Zero; + } + } + //////////////////////////////////////////////////////////////////////////////////////////////// private delegate bool Callback_CommandCanExecute(IntPtr cPtr, IntPtr paramType, IntPtr paramPtr); @@ -2714,6 +2786,27 @@ private static uint ListAdd(IntPtr cPtr, IntPtr itemType, IntPtr item) } } + //////////////////////////////////////////////////////////////////////////////////////////////// + private delegate void Callback_ListInsert(IntPtr cPtr, uint index, IntPtr itemType, IntPtr item); + private static Callback_ListInsert _listInsert = ListInsert; + + [MonoPInvokeCallback(typeof(Callback_ListInsert))] + private static void ListInsert(IntPtr cPtr, uint index, IntPtr itemType, IntPtr item) + { + try + { + var list = (System.Collections.IList)GetExtendInstance(cPtr); + if (list != null) + { + list.Insert((int)index, GetProxy(itemType, item, false)); + } + } + catch (Exception e) + { + Error.UnhandledException(e); + } + } + //////////////////////////////////////////////////////////////////////////////////////////////// private delegate int Callback_ListIndexOf(IntPtr cPtr, IntPtr itemType, IntPtr item); private static Callback_ListIndexOf _listIndexOf = ListIndexOf; @@ -2733,6 +2826,48 @@ private static int ListIndexOf(IntPtr cPtr, IntPtr itemType, IntPtr item) } } + //////////////////////////////////////////////////////////////////////////////////////////////// + private delegate void Callback_ListRemoveAt(IntPtr cPtr, uint index); + private static Callback_ListRemoveAt _listRemoveAt = ListRemoveAt; + + [MonoPInvokeCallback(typeof(Callback_ListRemoveAt))] + private static void ListRemoveAt(IntPtr cPtr, uint index) + { + try + { + var list = (System.Collections.IList)GetExtendInstance(cPtr); + if (list != null) + { + list.RemoveAt((int)index); + } + } + catch (Exception e) + { + Error.UnhandledException(e); + } + } + + //////////////////////////////////////////////////////////////////////////////////////////////// + private delegate void Callback_ListClear(IntPtr cPtr); + private static Callback_ListClear _listClear = ListClear; + + [MonoPInvokeCallback(typeof(Callback_ListClear))] + private static void ListClear(IntPtr cPtr) + { + try + { + var list = (System.Collections.IList)GetExtendInstance(cPtr); + if (list != null) + { + list.Clear(); + } + } + catch (Exception e) + { + Error.UnhandledException(e); + } + } + //////////////////////////////////////////////////////////////////////////////////////////////// private delegate bool Callback_DictionaryFind(IntPtr cPtr, string key, ref IntPtr item); private static Callback_DictionaryFind _dictionaryFind = DictionaryFind; @@ -2802,6 +2937,27 @@ private static void DictionaryAdd(IntPtr cPtr, string key, IntPtr itemType, IntP } } + //////////////////////////////////////////////////////////////////////////////////////////////// + private delegate void Callback_DictionaryRemove(IntPtr cPtr, string key); + private static Callback_DictionaryRemove _dictionaryRemove = DictionaryRemove; + + [MonoPInvokeCallback(typeof(Callback_DictionaryRemove))] + private static void DictionaryRemove(IntPtr cPtr, string key) + { + try + { + var dictionary = (System.Collections.IDictionary)GetExtendInstance(cPtr); + if (dictionary != null) + { + dictionary.Remove(key); + } + } + catch (Exception e) + { + Error.UnhandledException(e); + } + } + //////////////////////////////////////////////////////////////////////////////////////////////// private delegate bool Callback_ListIndexerTryGet(IntPtr cPtrType, IntPtr cPtr, uint index, ref IntPtr item); private static Callback_ListIndexerTryGet _listIndexerTryGet = ListIndexerTryGet; @@ -4295,6 +4451,8 @@ private enum NativePropertyType Bool, Float, Double, + Long, + ULong, Int, UInt, Short, @@ -4312,6 +4470,8 @@ private enum NativePropertyType NullableBool, NullableFloat, NullableDouble, + NullableLong, + NullableULong, NullableInt, NullableUInt, NullableShort, @@ -4624,6 +4784,46 @@ private static double GetPropertyValue_Double(IntPtr nativeType, int propertyInd } } + private delegate long Callback_GetPropertyValue_Int64(IntPtr nativeType, int propertyIndex, + IntPtr cPtr, [MarshalAs(UnmanagedType.U1)]ref bool isNull); + private static Callback_GetPropertyValue_Int64 _getPropertyValue_Int64 = GetPropertyValue_Int64; + + [MonoPInvokeCallback(typeof(Callback_GetPropertyValue_Int64))] + private static long GetPropertyValue_Int64(IntPtr nativeType, int propertyIndex, + IntPtr cPtr, ref bool isNull) + { + try + { + return GetPropertyValueNullable(GetProperty(nativeType, propertyIndex), + GetExtendInstance(cPtr), out isNull); + } + catch (Exception e) + { + Error.UnhandledException(e); + return 0; + } + } + + private delegate ulong Callback_GetPropertyValue_UInt64(IntPtr nativeType, int propertyIndex, + IntPtr cPtr, [MarshalAs(UnmanagedType.U1)]ref bool isNull); + private static Callback_GetPropertyValue_UInt64 _getPropertyValue_UInt64 = GetPropertyValue_UInt64; + + [MonoPInvokeCallback(typeof(Callback_GetPropertyValue_UInt64))] + private static ulong GetPropertyValue_UInt64(IntPtr nativeType, int propertyIndex, + IntPtr cPtr, ref bool isNull) + { + try + { + return GetPropertyValueNullable(GetProperty(nativeType, propertyIndex), + GetExtendInstance(cPtr), out isNull); + } + catch (Exception e) + { + Error.UnhandledException(e); + return 0; + } + } + private delegate int Callback_GetPropertyValue_Int(IntPtr nativeType, int propertyIndex, IntPtr cPtr, [MarshalAs(UnmanagedType.U1)]ref bool isNull); private static Callback_GetPropertyValue_Int _getPropertyValue_Int = GetPropertyValue_Int; @@ -5059,6 +5259,46 @@ private static void SetPropertyValue_Double(IntPtr nativeType, int propertyIndex } } + private delegate void Callback_SetPropertyValue_Int64(IntPtr nativeType, int propertyIndex, + IntPtr cPtr, long val, + [MarshalAs(UnmanagedType.U1)] bool isNull); + private static Callback_SetPropertyValue_Int64 _setPropertyValue_Int64 = SetPropertyValue_Int64; + + [MonoPInvokeCallback(typeof(Callback_SetPropertyValue_Int64))] + private static void SetPropertyValue_Int64(IntPtr nativeType, int propertyIndex, + IntPtr cPtr, long val, bool isNull) + { + try + { + SetPropertyValueNullable(GetProperty(nativeType, propertyIndex), + GetExtendInstance(cPtr), val, isNull); + } + catch (Exception e) + { + Error.UnhandledException(e); + } + } + + private delegate void Callback_SetPropertyValue_UInt64(IntPtr nativeType, int propertyIndex, + IntPtr cPtr, ulong val, + [MarshalAs(UnmanagedType.U1)] bool isNull); + private static Callback_SetPropertyValue_UInt64 _setPropertyValue_UInt64 = SetPropertyValue_UInt64; + + [MonoPInvokeCallback(typeof(Callback_SetPropertyValue_UInt64))] + private static void SetPropertyValue_UInt64(IntPtr nativeType, int propertyIndex, + IntPtr cPtr, ulong val, bool isNull) + { + try + { + SetPropertyValueNullable(GetProperty(nativeType, propertyIndex), + GetExtendInstance(cPtr), val, isNull); + } + catch (Exception e) + { + Error.UnhandledException(e); + } + } + private delegate void Callback_SetPropertyValue_Int(IntPtr nativeType, int propertyIndex, IntPtr cPtr, int val, [MarshalAs(UnmanagedType.U1)] bool isNull); diff --git a/Src/Noesis/Core/Src/Core/ExtendBoxing.cs b/Src/Noesis/Core/Src/Core/ExtendBoxing.cs index f6f1ef0..6c51a08 100644 --- a/Src/Noesis/Core/Src/Core/ExtendBoxing.cs +++ b/Src/Noesis/Core/Src/Core/ExtendBoxing.cs @@ -47,6 +47,9 @@ private static Dictionary CreateBoxFunctions() boxFunctions[typeof(Noesis.KeyTime)] = (val) => NoesisGUI_.Box_KeyTime((Noesis.KeyTime)val); boxFunctions[typeof(System.TimeSpan)] = (val) => NoesisGUI_.Box_TimeSpan((System.TimeSpan)val); boxFunctions[typeof(Noesis.VirtualizationCacheLength)] = (val) => NoesisGUI_.Box_VirtualizationCacheLength((Noesis.VirtualizationCacheLength)val); + boxFunctions[typeof(Noesis.Matrix)] = (val) => NoesisGUI_.Box_Matrix((Noesis.Matrix)val); + boxFunctions[typeof(Noesis.Matrix3D)] = (val) => NoesisGUI_.Box_Matrix3D((Noesis.Matrix3D)val); + boxFunctions[typeof(Noesis.Matrix4)] = (val) => NoesisGUI_.Box_Matrix4((Noesis.Matrix4)val); boxFunctions[typeof(Noesis.AlignmentX)] = (val) => NoesisGUI_.Box_AlignmentX((Noesis.AlignmentX)val); boxFunctions[typeof(Noesis.AlignmentY)] = (val) => NoesisGUI_.Box_AlignmentY((Noesis.AlignmentY)val); boxFunctions[typeof(Noesis.AutoToolTipPlacement)] = (val) => NoesisGUI_.Box_AutoToolTipPlacement((Noesis.AutoToolTipPlacement)val); @@ -120,7 +123,7 @@ public static IntPtr Box(object val) else if (val.GetType().GetTypeInfo().IsEnum) { IntPtr nativeType = EnsureNativeType(val.GetType()); - int enumValue = (int)Convert.ToInt64(val); + ulong enumValue = Convert.ToUInt64(val); return RegisterPendingRelease(NoesisGUI_.Box_CustomEnum(nativeType, enumValue)); } else if (val is Type) @@ -171,6 +174,9 @@ private static Dictionary CreateUnboxFunctions() unboxFunctions[typeof(Boxed)] = (cPtr) => NoesisGUI_.Unbox_KeyTime(cPtr); unboxFunctions[typeof(Boxed)] = (cPtr) => NoesisGUI_.Unbox_TimeSpan(cPtr); unboxFunctions[typeof(Boxed)] = (cPtr) => NoesisGUI_.Unbox_VirtualizationCacheLength(cPtr); + unboxFunctions[typeof(Boxed)] = (cPtr) => NoesisGUI_.Unbox_Matrix(cPtr); + unboxFunctions[typeof(Boxed)] = (cPtr) => NoesisGUI_.Unbox_Matrix3D(cPtr); + unboxFunctions[typeof(Boxed)] = (cPtr) => NoesisGUI_.Unbox_Matrix4(cPtr); unboxFunctions[typeof(Boxed)] = (cPtr) => NoesisGUI_.Unbox_AlignmentX(cPtr); unboxFunctions[typeof(Boxed)] = (cPtr) => NoesisGUI_.Unbox_AlignmentY(cPtr); unboxFunctions[typeof(Boxed)] = (cPtr) => NoesisGUI_.Unbox_AutoToolTipPlacement(cPtr); @@ -244,7 +250,7 @@ public static object Unbox(IntPtr cPtr, bool ownMemory, NativeTypeInfo info) } else if (info.Type == typeof(Boxed)) { - int enumValue = 0; + ulong enumValue = 0; IntPtr enumType = NoesisGUI_.Unbox_CustomEnum(cPtr, ref enumValue); NativeTypeInfo enumTypeInfo = GetNativeTypeInfo(enumType); value = Enum.ToObject(enumTypeInfo.Type, enumValue); diff --git a/Src/Noesis/Core/Src/Core/ExtendImports.cs b/Src/Noesis/Core/Src/Core/ExtendImports.cs index 0ec4c23..a899f70 100644 --- a/Src/Noesis/Core/Src/Core/ExtendImports.cs +++ b/Src/Noesis/Core/Src/Core/ExtendImports.cs @@ -9,6 +9,10 @@ internal partial class Extend [DllImport(Library.Name)] private static extern int Noesis_GetNativeTypes(IntPtr[] types, int capacity); + //////////////////////////////////////////////////////////////////////////////////////////////// + [DllImport(Library.Name)] + private static extern IntPtr Noesis_GetTypeName(IntPtr type); + //////////////////////////////////////////////////////////////////////////////////////////////// [DllImport(Library.Name)] private static extern IntPtr Noesis_RegisterEnumType([MarshalAs(UnmanagedType.LPStr)]string typeName, @@ -56,6 +60,7 @@ static extern void Noesis_RegisterReflectionCallbacks( Callback_VisualGetChild callback_VisualGetChild, Callback_UIElementRender callback_UIElementRender, Callback_FrameworkElementConnectEvent callback_FrameworkElementConnectEvent, + Callback_FrameworkElementConnectField callback_FrameworkElementConnectField, Callback_FrameworkElementMeasure callback_FrameworkElementMeasure, Callback_FrameworkElementArrange callback_FrameworkElementArrange, Callback_FrameworkElementApplyTemplate callback_FrameworkElementApplyTemplate, @@ -63,6 +68,7 @@ static extern void Noesis_RegisterReflectionCallbacks( Callback_ItemsControlIsContainer callback_ItemsControlIsContainer, Callback_AdornerGetTransform callback_AdornerGetTransform, Callback_FreezableClone callback_FreezableClone, + Callback_ShapeGetGeometry callback_ShapeGetGeometry, Callback_CommandCanExecute callback_CommandCanExecute, Callback_CommandExecute callback_CommandExecute, Callback_ConverterConvert callback_ConverterConvert, @@ -73,10 +79,14 @@ static extern void Noesis_RegisterReflectionCallbacks( Callback_ListGet callback_ListGet, Callback_ListSet callback_ListSet, Callback_ListAdd callback_ListAdd, + Callback_ListInsert callback_ListInsert, Callback_ListIndexOf callback_ListIndexOf, + Callback_ListRemoveAt callback_ListRemoveAt, + Callback_ListClear callback_ListClear, Callback_DictionaryFind callback_DictionaryFind, Callback_DictionarySet callback_DictionarySet, Callback_DictionaryAdd callback_DictionaryAdd, + Callback_DictionaryRemove callback_DictionaryRemove, Callback_ListIndexerTryGet callback_ListIndexerTryGet, Callback_ListIndexerTrySet callback_ListIndexerTrySet, Callback_DictionaryIndexerTryGet callback_DictionaryIndexerTryGet, @@ -142,6 +152,8 @@ static extern void Noesis_RegisterReflectionCallbacks( Callback_GetPropertyValue_Bool callback_GetPropertyValue_Bool, Callback_GetPropertyValue_Float callback_GetPropertyValue_Float, Callback_GetPropertyValue_Double callback_GetPropertyValue_Double, + Callback_GetPropertyValue_Int64 callback_GetPropertyValue_Int64, + Callback_GetPropertyValue_UInt64 callback_GetPropertyValue_UInt64, Callback_GetPropertyValue_Int callback_GetPropertyValue_Int, Callback_GetPropertyValue_UInt callback_GetPropertyValue_UInt, Callback_GetPropertyValue_Short callback_GetPropertyValue_Short, @@ -163,6 +175,8 @@ static extern void Noesis_RegisterReflectionCallbacks( Callback_SetPropertyValue_Bool callback_SetPropertyValue_Bool, Callback_SetPropertyValue_Float callback_SetPropertyValue_Float, Callback_SetPropertyValue_Double callback_SetPropertyValue_Double, + Callback_SetPropertyValue_Int64 callback_SetPropertyValue_Int64, + Callback_SetPropertyValue_UInt64 callback_SetPropertyValue_UInt64, Callback_SetPropertyValue_Int callback_SetPropertyValue_Int, Callback_SetPropertyValue_UInt callback_SetPropertyValue_UInt, Callback_SetPropertyValue_Short callback_SetPropertyValue_Short, diff --git a/Src/Noesis/Core/Src/Core/ExtendProps.cs b/Src/Noesis/Core/Src/Core/ExtendProps.cs index 8e3e3ef..a174e00 100644 --- a/Src/Noesis/Core/Src/Core/ExtendProps.cs +++ b/Src/Noesis/Core/Src/Core/ExtendProps.cs @@ -507,8 +507,8 @@ private static Dictionary AddPropertyFunctions() addPropFunctions[typeof(long)] = (info, p, usePropertyInfo) => { - AddPropertyAccessor(info, p, (v) => (int)v, (v) => (long)v, usePropertyInfo); - return CreatePropertyData(p, NativePropertyType.Int); + AddPropertyAccessor(info, p, usePropertyInfo); + return CreatePropertyData(p, NativePropertyType.Long); }; addPropFunctions[typeof(uint)] = (info, p, usePropertyInfo) => @@ -519,8 +519,8 @@ private static Dictionary AddPropertyFunctions() addPropFunctions[typeof(ulong)] = (info, p, usePropertyInfo) => { - AddPropertyAccessor(info, p, (v) => (uint)v, (v) => (ulong)v, usePropertyInfo); - return CreatePropertyData(p, NativePropertyType.UInt); + AddPropertyAccessor(info, p, usePropertyInfo); + return CreatePropertyData(p, NativePropertyType.ULong); }; addPropFunctions[typeof(char)] = (info, p, usePropertyInfo) => @@ -646,8 +646,8 @@ private static Dictionary AddPropertyFunctions() addPropFunctions[typeof(long?)] = (info, p, usePropertyInfo) => { - AddPropertyAccessorNullable(info, p, (v) => (int?)v, (v) => (long?)v, usePropertyInfo); - return CreatePropertyData(p, NativePropertyType.NullableInt); + AddPropertyAccessorNullable(info, p, usePropertyInfo); + return CreatePropertyData(p, NativePropertyType.NullableLong); }; addPropFunctions[typeof(uint?)] = (info, p, usePropertyInfo) => @@ -658,8 +658,8 @@ private static Dictionary AddPropertyFunctions() addPropFunctions[typeof(ulong?)] = (info, p, usePropertyInfo) => { - AddPropertyAccessorNullable(info, p, (v) => (uint?)v, (v) => (ulong?)v, usePropertyInfo); - return CreatePropertyData(p, NativePropertyType.NullableUInt); + AddPropertyAccessorNullable(info, p, usePropertyInfo); + return CreatePropertyData(p, NativePropertyType.NullableULong); }; addPropFunctions[typeof(char?)] = (info, p, usePropertyInfo) => @@ -788,8 +788,8 @@ private static ExtendPropertyData AddProperty(NativeTypePropsInfo info, Property if (p.PropertyType.GetTypeInfo().IsEnum) { - AddPropertyAccessor(info, p, - (v) => (int)Convert.ToInt64(v), + AddPropertyAccessor(info, p, + (v) => Convert.ToUInt64(v), (v) => Enum.ToObject(p.PropertyType, v), true); diff --git a/Src/Noesis/Core/Src/Core/HitTest.cs b/Src/Noesis/Core/Src/Core/HitTest.cs index 7123799..3de2204 100644 --- a/Src/Noesis/Core/Src/Core/HitTest.cs +++ b/Src/Noesis/Core/Src/Core/HitTest.cs @@ -7,6 +7,7 @@ namespace Noesis { public delegate HitTestFilterBehavior HitTestFilterCallback(Visual target); public delegate HitTestResultBehavior HitTestResultCallback(HitTestResult hit); + public delegate HitTestResultBehavior HitTest3DResultCallback(HitTest3DResult hit); /// /// This is the base class for packing together parameters for a hit test pass. diff --git a/Src/Noesis/Core/Src/Core/NoesisGUI.cs b/Src/Noesis/Core/Src/Core/NoesisGUI.cs index 3d1b69d..c0a8926 100644 --- a/Src/Noesis/Core/Src/Core/NoesisGUI.cs +++ b/Src/Noesis/Core/Src/Core/NoesisGUI.cs @@ -38,6 +38,24 @@ public static string GetBuildVersion() return Extend.StringFromNativeUtf8(version); } + /// + /// Disables Hot Reload feature. It is enabled by default and takes a bit of extra memory + /// Must be invoked before Noesis.GUI.Init() + /// + public static void DisableHotReload() + { + Noesis_DisableHotReload(); + } + + /// + /// If sockets are already initialized before Noesis, use this function to avoid double init + /// Must be invoked before Noesis.GUI.Init() + /// + public static void DisableSocketInit() + { + Noesis_DisableSocketInit(); + } + /// /// Disables all connections from the remote Inspector tool. /// Must be invoked before Noesis.GUI.Init() @@ -537,6 +555,12 @@ private static void OnLoadAssembly(IntPtr assemblyPtr) [DllImport(Library.Name)] static extern IntPtr Noesis_GetBuildVersion(); + [DllImport(Library.Name)] + static extern void Noesis_DisableHotReload(); + + [DllImport(Library.Name)] + static extern void Noesis_DisableSocketInit(); + [DllImport(Library.Name)] static extern void Noesis_DisableInspector(); diff --git a/Src/Noesis/Core/Src/Core/RenderDevice.cs b/Src/Noesis/Core/Src/Core/RenderDevice.cs index 7d81676..c5f620e 100644 --- a/Src/Noesis/Core/Src/Core/RenderDevice.cs +++ b/Src/Noesis/Core/Src/Core/RenderDevice.cs @@ -583,6 +583,18 @@ public abstract RenderTarget CreateRenderTarget(string label, uint width, uint h /// public abstract void SetRenderTarget(RenderTarget surface); + /// + /// Indicates that until the next call to EndTile(), all drawing commands will only update + /// the contents of the render target defined by the extension of the given tile. This is a + /// good place to enable scissoring and apply optimizations for tile-based GPU architectures. + /// + public abstract void BeginTile(RenderTarget surface, Tile tile); + + /// + /// Completes rendering to the tile specified by BeginTile(). + /// + public abstract void EndTile(RenderTarget surface); + /// /// Resolves multisample render target. /// @@ -656,6 +668,8 @@ static RenderDevice() _createRenderTarget, _cloneRenderTarget, _setRenderTarget, + _beginTile, + _endTile, _resolveRenderTarget, _createTexture, _updateTexture, @@ -774,6 +788,48 @@ private static void SetRenderTarget(IntPtr cPtr, IntPtr surfacePtr) } } + private delegate void Callback_BeginTile(IntPtr cPtr, IntPtr surface, ref Tile tile); + private static Callback_BeginTile _beginTile = BeginTile; + + [MonoPInvokeCallback(typeof(Callback_BeginTile))] + private static void BeginTile(IntPtr cPtr, IntPtr surfacePtr, ref Tile tile) + { + try + { + RenderDevice device = (RenderDevice)Noesis.Extend.GetExtendInstance(cPtr); + if (device != null) + { + RenderTarget surface = (RenderTarget)Noesis.Extend.GetExtendInstance(surfacePtr); + device.BeginTile(surface, tile); + } + } + catch (Exception e) + { + Error.UnhandledException(e); + } + } + + private delegate void Callback_EndTile(IntPtr cPtr, IntPtr surface); + private static Callback_EndTile _endTile = EndTile; + + [MonoPInvokeCallback(typeof(Callback_EndTile))] + private static void EndTile(IntPtr cPtr, IntPtr surfacePtr) + { + try + { + RenderDevice device = (RenderDevice)Noesis.Extend.GetExtendInstance(cPtr); + if (device != null) + { + RenderTarget surface = (RenderTarget)Noesis.Extend.GetExtendInstance(surfacePtr); + device.EndTile(surface); + } + } + catch (Exception e) + { + Error.UnhandledException(e); + } + } + private delegate void Callback_ResolveRenderTarget(IntPtr cPtr, IntPtr surface, [In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 3)] Tile[] tiles, int numTiles); private static Callback_ResolveRenderTarget _resolveRenderTarget = ResolveRenderTarget; @@ -1039,6 +1095,8 @@ static extern uint Noesis_RenderDevice_SetCallbacks( Callback_CreateRenderTarget createRenderTarget, Callback_CloneRenderTarget cloneRenderTarget, Callback_SetRenderTarget setRenderTarget, + Callback_BeginTile beginTile, + Callback_EndTile endTile, Callback_ResolveRenderTarget resolveRenderTarget, Callback_CreateTexture createTexture, Callback_UpdateTexture updateTexture, @@ -1142,6 +1200,26 @@ public override void SetRenderTarget(RenderTarget surface) Noesis_RenderDevice_SetRenderTarget(swigCPtr, BaseComponent.getCPtr(surface)); } + public override void BeginTile(RenderTarget surface, Tile tile) + { + if (surface == null) + { + throw new ArgumentNullException("surface"); + } + + Noesis_RenderDevice_BeginTile(swigCPtr, BaseComponent.getCPtr(surface), ref tile); + } + + public override void EndTile(RenderTarget surface) + { + if (surface == null) + { + throw new ArgumentNullException("surface"); + } + + Noesis_RenderDevice_EndTile(swigCPtr, BaseComponent.getCPtr(surface)); + } + public override void ResolveRenderTarget(RenderTarget surface, Tile[] tiles) { if (surface == null) @@ -1264,6 +1342,13 @@ static extern IntPtr Noesis_RenderDevice_CreateRenderTarget(HandleRef device, [DllImport(Library.Name)] static extern void Noesis_RenderDevice_SetRenderTarget(HandleRef device, HandleRef surface); + [DllImport(Library.Name)] + static extern void Noesis_RenderDevice_BeginTile(HandleRef device, HandleRef surface, + [In] ref Tile tile); + + [DllImport(Library.Name)] + static extern void Noesis_RenderDevice_EndTile(HandleRef device, HandleRef surface); + [DllImport(Library.Name)] static extern void Noesis_RenderDevice_ResolveRenderTarget(HandleRef device, HandleRef surface, [In, Out] Tile[] tiles, int numTiles); @@ -1374,16 +1459,38 @@ public static IntPtr GetTextureNativePointer(Texture texture) return Noesis_RenderDeviceD3D11_GetTextureNativePointer(BaseComponent.getCPtr(texture)); } + /// + /// Enables the hardware scissor rectangle + /// + public void EnableScissorRect() + { + Noesis_RenderDeviceD3D11_EnableScissorRect(swigCPtr); + } + + /// + /// Disables the hardware scissor rectangle + /// + public void DisableScissorRect() + { + Noesis_RenderDeviceD3D11_DisableScissorRect(swigCPtr); + } + #region Imports [DllImport(Library.Name)] - static extern IntPtr Noesis_RenderDeviceD3D11_Create(IntPtr deviceContext, bool sRGB); + private static extern IntPtr Noesis_RenderDeviceD3D11_Create(IntPtr deviceContext, bool sRGB); [DllImport(Library.Name)] - static extern IntPtr Noesis_RenderDeviceD3D11_WrapTexture(IntPtr nativePointer, + private static extern IntPtr Noesis_RenderDeviceD3D11_WrapTexture(IntPtr nativePointer, int width, int height, int numMipMaps, bool isInverted, bool hasAlpha); [DllImport(Library.Name)] private static extern IntPtr Noesis_RenderDeviceD3D11_GetTextureNativePointer(HandleRef texture); + + [DllImport(Library.Name)] + private static extern void Noesis_RenderDeviceD3D11_EnableScissorRect(HandleRef device); + + [DllImport(Library.Name)] + private static extern void Noesis_RenderDeviceD3D11_DisableScissorRect(HandleRef device); #endregion } diff --git a/Src/Noesis/Core/Src/Core/RendererNoesis.cs b/Src/Noesis/Core/Src/Core/RendererNoesis.cs index fb97440..8d7e408 100644 --- a/Src/Noesis/Core/Src/Core/RendererNoesis.cs +++ b/Src/Noesis/Core/Src/Core/RendererNoesis.cs @@ -77,7 +77,7 @@ internal Renderer(IntPtr cPtr, bool ownMemory): base(cPtr, ownMemory) return new Renderer(cPtr, cMemoryOwn); } - private HandleRef CPtr { get { return BaseComponent.getCPtr(this); } } + internal HandleRef CPtr { get { return BaseComponent.getCPtr(this); } } #endregion #region Imports diff --git a/Src/Noesis/Core/Src/Core/UriHelper.cs b/Src/Noesis/Core/Src/Core/UriHelper.cs index 167cc62..3ac59a6 100644 --- a/Src/Noesis/Core/Src/Core/UriHelper.cs +++ b/Src/Noesis/Core/Src/Core/UriHelper.cs @@ -61,9 +61,7 @@ private static Uri GetAbsoluteUri(Uri uri, out bool isRootPath) return uri; } - Uri uri_ = new Uri(uri.OriginalString, UriKind.RelativeOrAbsolute); - isRootPath = uri.OriginalString.StartsWith("\\") || uri.OriginalString.StartsWith("/"); - + isRootPath = false; return new Uri(new Uri("file://"), uri); } } diff --git a/Src/Noesis/Core/Src/Core/View.cs b/Src/Noesis/Core/Src/Core/View.cs index 7d4adb2..b909eff 100644 --- a/Src/Noesis/Core/Src/Core/View.cs +++ b/Src/Noesis/Core/Src/Core/View.cs @@ -250,6 +250,15 @@ public bool Scroll(float value) return Noesis_View_Scroll(CPtr, value); } + /// + /// Notifies the View to scroll vertically. Value typically ranges from -1 to 1. + /// Raises the event on the element under the specified x,y. + /// + public bool Scroll(int x, int y, float value) + { + return Noesis_View_ScrollPos(CPtr, x, y, value); + } + /// /// Notifies the View to scroll horizontally. Value typically ranges from -1 to 1. /// @@ -257,6 +266,15 @@ public bool HScroll(float value) { return Noesis_View_HScroll(CPtr, value); } + + /// + /// Notifies the View to scroll horizontally. Value typically ranges from -1 to 1. + /// Raises the event on the element under the specified x,y. + /// + public bool HScroll(int x, int y, float value) + { + return Noesis_View_HScrollPos(CPtr, x, y, value); + } #endregion #region Touch input events @@ -619,9 +637,15 @@ protected override IntPtr CreateCPtr(Type type, out bool registerExtend) [DllImport(Library.Name)] static extern bool Noesis_View_Scroll(HandleRef view, float value); + [DllImport(Library.Name)] + static extern bool Noesis_View_ScrollPos(HandleRef view, int x, int y, float value); + [DllImport(Library.Name)] static extern bool Noesis_View_HScroll(HandleRef view, float value); + [DllImport(Library.Name)] + static extern bool Noesis_View_HScrollPos(HandleRef view, int x, int y, float value); + [DllImport(Library.Name)] static extern bool Noesis_View_TouchMove(HandleRef view, int x, int y, ulong touchId); @@ -709,7 +733,22 @@ public enum RenderFlags /// /// Enables subpixel rendering compatible with LCD displays /// - LCD = 32 + LCD = 32, + + /// + /// Displays glyph atlas as a small overlay for debugging purposes + /// + ShowGlyphs = 64, + + /// + /// Displays ramp atlas as a small overlay for debugging purposes + /// + ShowRamps = 128, + + /// + /// Enables testing against the content of the depth buffer + /// + DepthTesting = 256 }; /// diff --git a/Src/Noesis/Core/Src/Proxies/BaseComponentExtend.cs b/Src/Noesis/Core/Src/Proxies/BaseComponentExtend.cs index f1a2e12..5f5444b 100644 --- a/Src/Noesis/Core/Src/Proxies/BaseComponentExtend.cs +++ b/Src/Noesis/Core/Src/Proxies/BaseComponentExtend.cs @@ -3,7 +3,6 @@ namespace Noesis { - public partial class BaseComponent { protected BaseComponent() @@ -53,19 +52,22 @@ private void Init(IntPtr cPtr, bool cMemoryOwn, bool registerExtend) } } + public void Dispose() + { + ForceRelease(this, swigCPtr.Handle); + GC.SuppressFinalize(this); + } + internal static void ForceRelease(object instance, IntPtr cPtr) { - lock (instance) + BaseComponent component = instance as BaseComponent; + if (component != null) { - BaseComponent component = instance as BaseComponent; - if (component != null) - { - component.swigCPtr = new HandleRef(null, IntPtr.Zero); - Noesis.Extend.RemoveProxy(cPtr); - } - - Release(cPtr); + component.swigCPtr = new HandleRef(null, IntPtr.Zero); + Noesis.Extend.RemoveProxy(cPtr); } + + Release(cPtr); } private void ReleaseProxy(IntPtr cPtr) diff --git a/Src/Noesis/Core/Src/Proxies/BaseFreezableCollection.cs b/Src/Noesis/Core/Src/Proxies/BaseFreezableCollection.cs index 39ddf76..00855d2 100644 --- a/Src/Noesis/Core/Src/Proxies/BaseFreezableCollection.cs +++ b/Src/Noesis/Core/Src/Proxies/BaseFreezableCollection.cs @@ -165,14 +165,6 @@ public void CopyTo(Array array, int arrayIndex) { } } - public void RemoveAt(int index) { - NoesisGUI_PINVOKE.BaseFreezableCollection_RemoveAt(swigCPtr, index); - } - - public void Clear() { - NoesisGUI_PINVOKE.BaseFreezableCollection_Clear(swigCPtr); - } - private void Set(int index, object item) { NoesisGUI_PINVOKE.BaseFreezableCollection_Set(swigCPtr, index, Noesis.Extend.GetInstanceHandle(item)); } @@ -182,11 +174,23 @@ public int Add(object item) { return ret; } + public void Insert(int index, object item) { + NoesisGUI_PINVOKE.BaseFreezableCollection_Insert(swigCPtr, index, Noesis.Extend.GetInstanceHandle(item)); + } + public int IndexOf(object item) { int ret = NoesisGUI_PINVOKE.BaseFreezableCollection_IndexOf(swigCPtr, Noesis.Extend.GetInstanceHandle(item)); return ret; } + public void RemoveAt(int index) { + NoesisGUI_PINVOKE.BaseFreezableCollection_RemoveAt(swigCPtr, index); + } + + public void Clear() { + NoesisGUI_PINVOKE.BaseFreezableCollection_Clear(swigCPtr); + } + public int Count { get { int ret = NoesisGUI_PINVOKE.BaseFreezableCollection_Count_get(swigCPtr); @@ -194,10 +198,6 @@ public int Count { } } - public void Insert(int index, object item) { - NoesisGUI_PINVOKE.BaseFreezableCollection_Insert(swigCPtr, index, Noesis.Extend.GetInstanceHandle(item)); - } - public bool Contains(object item) { bool ret = NoesisGUI_PINVOKE.BaseFreezableCollection_Contains(swigCPtr, Noesis.Extend.GetInstanceHandle(item)); return ret; diff --git a/Src/Noesis/Core/Src/Proxies/CompositeTransform3D.cs b/Src/Noesis/Core/Src/Proxies/CompositeTransform3D.cs index 469f2b9..65909f7 100644 --- a/Src/Noesis/Core/Src/Proxies/CompositeTransform3D.cs +++ b/Src/Noesis/Core/Src/Proxies/CompositeTransform3D.cs @@ -45,16 +45,6 @@ public static Matrix3D ConstructTransform3DMatrix(float centerX, float centerY, } } - public override Matrix3D GetTransform() { - IntPtr ret = NoesisGUI_PINVOKE.CompositeTransform3D_GetTransform(swigCPtr); - if (ret != IntPtr.Zero) { - return Marshal.PtrToStructure(ret); - } - else { - return Matrix3D.Identity; - } - } - public static DependencyProperty CenterXProperty { get { IntPtr cPtr = NoesisGUI_PINVOKE.CompositeTransform3D_CenterXProperty_get(); diff --git a/Src/Noesis/Core/Src/Proxies/DependencyObjectExtend.cs b/Src/Noesis/Core/Src/Proxies/DependencyObjectExtend.cs index 79b9bd5..545b738 100644 --- a/Src/Noesis/Core/Src/Proxies/DependencyObjectExtend.cs +++ b/Src/Noesis/Core/Src/Proxies/DependencyObjectExtend.cs @@ -21,8 +21,8 @@ public object GetValue(DependencyProperty dp) GetDelegate getDelegate; if (dpType.GetTypeInfo().IsEnum) { - _getFunctions.TryGetValue(typeof(int), out getDelegate); - int value = (int)getDelegate(swigCPtr.Handle, DependencyProperty.getCPtr(dp).Handle); + _getFunctions.TryGetValue(typeof(ulong), out getDelegate); + ulong value = (ulong)getDelegate(swigCPtr.Handle, DependencyProperty.getCPtr(dp).Handle); return Enum.ToObject(dpType, value); } else if (_getFunctions.TryGetValue(dpType, out getDelegate)) @@ -49,8 +49,8 @@ public void SetValue(DependencyProperty dp, object value) SetDelegate setDelegate; if (dpType.GetTypeInfo().IsEnum) { - _setFunctions.TryGetValue(typeof(int), out setDelegate); - setDelegate(swigCPtr.Handle, DependencyProperty.getCPtr(dp).Handle, (int)Convert.ToInt64(value)); + _setFunctions.TryGetValue(typeof(ulong), out setDelegate); + setDelegate(swigCPtr.Handle, DependencyProperty.getCPtr(dp).Handle, Convert.ToUInt64(value)); } else if (_setFunctions.TryGetValue(dpType, out setDelegate)) { @@ -109,7 +109,7 @@ private static Dictionary CreateGetFunctions() { CheckProperty(cPtr, dp, "get"); bool isNull; - return (long)Noesis_DependencyGet_Int(cPtr, dp, false, out isNull); + return Noesis_DependencyGet_Int64(cPtr, dp, false, out isNull); }; getFunctions[typeof(uint)] = (cPtr, dp) => { @@ -121,7 +121,7 @@ private static Dictionary CreateGetFunctions() { CheckProperty(cPtr, dp, "get"); bool isNull; - return (ulong)Noesis_DependencyGet_UInt(cPtr, dp, false, out isNull); + return Noesis_DependencyGet_UInt64(cPtr, dp, false, out isNull); }; getFunctions[typeof(char)] = (cPtr, dp) => { @@ -276,8 +276,8 @@ private static Dictionary CreateGetFunctions() { CheckProperty(cPtr, dp, "get"); bool isNull; - int val = Noesis_DependencyGet_Int(cPtr, dp, true, out isNull); - return isNull ? null : (long?)(long)val; + long val = Noesis_DependencyGet_Int64(cPtr, dp, true, out isNull); + return isNull ? null : (long?)val; }; getFunctions[typeof(uint?)] = (cPtr, dp) => { @@ -290,8 +290,8 @@ private static Dictionary CreateGetFunctions() { CheckProperty(cPtr, dp, "get"); bool isNull; - uint val = Noesis_DependencyGet_UInt(cPtr, dp, true, out isNull); - return isNull ? null : (ulong?)(ulong)val; + ulong val = Noesis_DependencyGet_UInt64(cPtr, dp, true, out isNull); + return isNull ? null : (ulong?)val; }; getFunctions[typeof(char?)] = (cPtr, dp) => { @@ -445,7 +445,7 @@ private static Dictionary CreateSetFunctions() setFunctions[typeof(long)] = (cPtr, dp, value) => { CheckProperty(cPtr, dp, "set"); - Noesis_DependencySet_Int(cPtr, dp, (int)(long)value, false, false); + Noesis_DependencySet_Int64(cPtr, dp, (long)value, false, false); }; setFunctions[typeof(uint)] = (cPtr, dp, value) => { @@ -455,7 +455,7 @@ private static Dictionary CreateSetFunctions() setFunctions[typeof(ulong)] = (cPtr, dp, value) => { CheckProperty(cPtr, dp, "set"); - Noesis_DependencySet_UInt(cPtr, dp, (uint)(ulong)value, false, false); + Noesis_DependencySet_UInt64(cPtr, dp, (ulong)value, false, false); }; setFunctions[typeof(char)] = (cPtr, dp, value) => { @@ -617,11 +617,11 @@ private static Dictionary CreateSetFunctions() CheckProperty(cPtr, dp, "set"); if (value == null) { - Noesis_DependencySet_Int(cPtr, dp, default(int), true, true); + Noesis_DependencySet_Int64(cPtr, dp, default(long), true, true); } else { - Noesis_DependencySet_Int(cPtr, dp, (int)(long)value, true, false); + Noesis_DependencySet_Int64(cPtr, dp, (long)value, true, false); } }; setFunctions[typeof(uint?)] = (cPtr, dp, value) => @@ -641,11 +641,11 @@ private static Dictionary CreateSetFunctions() CheckProperty(cPtr, dp, "set"); if (value == null) { - Noesis_DependencySet_UInt(cPtr, dp, default(uint), true, true); + Noesis_DependencySet_UInt64(cPtr, dp, default(ulong), true, true); } else { - Noesis_DependencySet_UInt(cPtr, dp, (uint)(ulong)value, true, false); + Noesis_DependencySet_UInt64(cPtr, dp, (ulong)value, true, false); } }; setFunctions[typeof(char?)] = (cPtr, dp, value) => @@ -990,6 +990,14 @@ private static extern float Noesis_DependencyGet_Float(IntPtr dependencyObject, private static extern double Noesis_DependencyGet_Double(IntPtr dependencyObject, IntPtr dependencyProperty, bool isNullable, [MarshalAs(UnmanagedType.U1)]out bool isNull); + [DllImport(Library.Name)] + private static extern long Noesis_DependencyGet_Int64(IntPtr dependencyObject, IntPtr dependencyProperty, + bool isNullable, [MarshalAs(UnmanagedType.U1)] out bool isNull); + + [DllImport(Library.Name)] + private static extern ulong Noesis_DependencyGet_UInt64(IntPtr dependencyObject, IntPtr dependencyProperty, + bool isNullable, [MarshalAs(UnmanagedType.U1)] out bool isNull); + [DllImport(Library.Name)] private static extern int Noesis_DependencyGet_Int(IntPtr dependencyObject, IntPtr dependencyProperty, bool isNullable, [MarshalAs(UnmanagedType.U1)]out bool isNull); @@ -1071,6 +1079,14 @@ private static extern void Noesis_DependencySet_Float(IntPtr dependencyObject, I private static extern void Noesis_DependencySet_Double(IntPtr dependencyObject, IntPtr dependencyProperty, double val, bool isNullable, bool isNull); + [DllImport(Library.Name)] + private static extern void Noesis_DependencySet_Int64(IntPtr dependencyObject, IntPtr dependencyProperty, + long val, bool isNullable, bool isNull); + + [DllImport(Library.Name)] + private static extern void Noesis_DependencySet_UInt64(IntPtr dependencyObject, IntPtr dependencyProperty, + ulong val, bool isNullable, bool isNull); + [DllImport(Library.Name)] private static extern void Noesis_DependencySet_Int(IntPtr dependencyObject, IntPtr dependencyProperty, int val, bool isNullable, bool isNull); diff --git a/Src/Noesis/Core/Src/Proxies/DependencyPropertyExtend.cs b/Src/Noesis/Core/Src/Proxies/DependencyPropertyExtend.cs index cec3261..87d3e06 100644 --- a/Src/Noesis/Core/Src/Proxies/DependencyPropertyExtend.cs +++ b/Src/Noesis/Core/Src/Proxies/DependencyPropertyExtend.cs @@ -214,7 +214,7 @@ private static bool IsValidType(object value, Type type) return false; } } - else if (!type.IsInstanceOfType(value) && (!type.IsEnum || !(value.GetType() == IntType))) + else if (!type.IsInstanceOfType(value) && (!type.IsEnum || !(value.GetType() == EnumType))) { return false; } @@ -222,7 +222,7 @@ private static bool IsValidType(object value, Type type) } private static Type NullableType = typeof(Nullable<>); - private static Type IntType = typeof(int); + private static Type EnumType = typeof(ulong); private Type OriginalPropertyType { get; set; } @@ -244,15 +244,11 @@ private static Dictionary CreateValidTypes() Dictionary validTypes = new Dictionary(13); validTypes[typeof(decimal)] = typeof(double); - validTypes[typeof(long)] = typeof(int); - validTypes[typeof(ulong)] = typeof(uint); validTypes[typeof(char)] = typeof(uint); validTypes[typeof(sbyte)] = typeof(short); validTypes[typeof(byte)] = typeof(ushort); validTypes[typeof(decimal?)] = typeof(double?); - validTypes[typeof(long?)] = typeof(int?); - validTypes[typeof(ulong?)] = typeof(uint?); validTypes[typeof(char?)] = typeof(uint?); validTypes[typeof(sbyte?)] = typeof(short?); validTypes[typeof(byte?)] = typeof(ushort?); diff --git a/Src/Noesis/Core/Src/Proxies/DrawingContext.cs b/Src/Noesis/Core/Src/Proxies/DrawingContext.cs index f6ad1a1..734aa27 100644 --- a/Src/Noesis/Core/Src/Proxies/DrawingContext.cs +++ b/Src/Noesis/Core/Src/Proxies/DrawingContext.cs @@ -75,6 +75,10 @@ public void PushTransform(Transform transform) { NoesisGUI_PINVOKE.DrawingContext_PushTransform(swigCPtr, Transform.getCPtr(transform)); } + public void PushBlendingMode(BlendingMode mode) { + NoesisGUI_PINVOKE.DrawingContext_PushBlendingMode(swigCPtr, (int)mode); + } + } } diff --git a/Src/Noesis/Core/Src/Proxies/Ellipse.cs b/Src/Noesis/Core/Src/Proxies/Ellipse.cs index e2f0dea..6a09df5 100644 --- a/Src/Noesis/Core/Src/Proxies/Ellipse.cs +++ b/Src/Noesis/Core/Src/Proxies/Ellipse.cs @@ -27,6 +27,10 @@ internal static HandleRef getCPtr(Ellipse obj) { return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; } + internal protected override Geometry DefiningGeometry { + get { return new EllipseGeometry(); } + } + public Ellipse() { } diff --git a/Src/Noesis/Core/Src/Proxies/FontCapitals.cs b/Src/Noesis/Core/Src/Proxies/FontCapitals.cs new file mode 100644 index 0000000..6ac36b1 --- /dev/null +++ b/Src/Noesis/Core/Src/Proxies/FontCapitals.cs @@ -0,0 +1,29 @@ +//------------------------------------------------------------------------------ +// +// +// 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 enum FontCapitals { + Normal, + AllSmallCaps, + SmallCaps, + AllPetiteCaps, + PetiteCaps, + Unicase, + Titling +} + +} + diff --git a/Src/Noesis/Core/Src/Proxies/FontEastAsianLanguage.cs b/Src/Noesis/Core/Src/Proxies/FontEastAsianLanguage.cs new file mode 100644 index 0000000..0e82f1b --- /dev/null +++ b/Src/Noesis/Core/Src/Proxies/FontEastAsianLanguage.cs @@ -0,0 +1,32 @@ +//------------------------------------------------------------------------------ +// +// +// 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 enum FontEastAsianLanguage { + Normal, + Jis78, + Jis83, + Jis90, + Jis04, + HojoKanji, + NlcKanji, + Simplified, + Traditional, + TraditionalNames +} + +} + diff --git a/Src/Noesis/Core/Src/Proxies/FontEastAsianWidths.cs b/Src/Noesis/Core/Src/Proxies/FontEastAsianWidths.cs new file mode 100644 index 0000000..805507a --- /dev/null +++ b/Src/Noesis/Core/Src/Proxies/FontEastAsianWidths.cs @@ -0,0 +1,28 @@ +//------------------------------------------------------------------------------ +// +// +// 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 enum FontEastAsianWidths { + Normal, + Proportional, + Full, + Half, + Third, + Quarter +} + +} + diff --git a/Src/Noesis/Core/Src/Proxies/FontFraction.cs b/Src/Noesis/Core/Src/Proxies/FontFraction.cs new file mode 100644 index 0000000..824bf8a --- /dev/null +++ b/Src/Noesis/Core/Src/Proxies/FontFraction.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// +// +// 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 enum FontFraction { + Normal, + Slashed, + Stacked +} + +} + diff --git a/Src/Noesis/Core/Src/Proxies/FontNumeralAlignment.cs b/Src/Noesis/Core/Src/Proxies/FontNumeralAlignment.cs new file mode 100644 index 0000000..512949d --- /dev/null +++ b/Src/Noesis/Core/Src/Proxies/FontNumeralAlignment.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// +// +// 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 enum FontNumeralAlignment { + Normal, + Proportional, + Tabular +} + +} + diff --git a/Src/Noesis/Core/Src/Proxies/FontNumeralStyle.cs b/Src/Noesis/Core/Src/Proxies/FontNumeralStyle.cs new file mode 100644 index 0000000..2e5c2b0 --- /dev/null +++ b/Src/Noesis/Core/Src/Proxies/FontNumeralStyle.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// +// +// 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 enum FontNumeralStyle { + Normal, + Lining, + OldStyle +} + +} + diff --git a/Src/Noesis/Core/Src/Proxies/FontVariants.cs b/Src/Noesis/Core/Src/Proxies/FontVariants.cs new file mode 100644 index 0000000..310344e --- /dev/null +++ b/Src/Noesis/Core/Src/Proxies/FontVariants.cs @@ -0,0 +1,28 @@ +//------------------------------------------------------------------------------ +// +// +// 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 enum FontVariants { + Normal, + Superscript, + Subscript, + Ordinal, + Inferior, + Ruby +} + +} + diff --git a/Src/Noesis/Core/Src/Proxies/FormattedText.cs b/Src/Noesis/Core/Src/Proxies/FormattedText.cs index 0a76423..2045d66 100644 --- a/Src/Noesis/Core/Src/Proxies/FormattedText.cs +++ b/Src/Noesis/Core/Src/Proxies/FormattedText.cs @@ -54,15 +54,57 @@ public FormattedText() { protected override IntPtr CreateCPtr(Type type, out bool registerExtend) { registerExtend = false; - return NoesisGUI_PINVOKE.new_FormattedText(); + return NoesisGUI_PINVOKE.new_FormattedText__SWIG_0(); } - public void BuildTextRuns(string text, InlineCollection inlines, FontFamily fontFamily, FontWeight fontWeight, FontStretch fontStretch, FontStyle fontStyle, float fontSize, float strokeThickness, Brush background, Brush foreground, Brush stroke, TextDecorations textDecorations, int charSpacing) { - NoesisGUI_PINVOKE.FormattedText_BuildTextRuns(swigCPtr, text != null ? text : string.Empty, InlineCollection.getCPtr(inlines), FontFamily.getCPtr(fontFamily), (int)fontWeight, (int)fontStretch, (int)fontStyle, fontSize, strokeThickness, Brush.getCPtr(background), Brush.getCPtr(foreground), Brush.getCPtr(stroke), (int)textDecorations, charSpacing); + public FormattedText(string text, FontFamily fontFamily, float fontSize, Brush foreground, FlowDirection flowDirection, float maxWidth, float maxHeight, float lineHeight, TextAlignment textAlignment, TextTrimming textTrimming) : this(NoesisGUI_PINVOKE.new_FormattedText__SWIG_1(text != null ? text : string.Empty, FontFamily.getCPtr(fontFamily), fontSize, Brush.getCPtr(foreground), (int)flowDirection, maxWidth, maxHeight, lineHeight, (int)textAlignment, (int)textTrimming), true) { } - public Size Measure(TextAlignment alignment, TextWrapping wrapping, TextTrimming trimming, float maxWidth, float maxHeight, float lineHeight, LineStackingStrategy lineStacking) { - IntPtr ret = NoesisGUI_PINVOKE.FormattedText_Measure(swigCPtr, (int)alignment, (int)wrapping, (int)trimming, maxWidth, maxHeight, lineHeight, (int)lineStacking); + public FormattedText(string text, FontFamily fontFamily, float fontSize, Brush foreground, FlowDirection flowDirection, float maxWidth, float maxHeight, float lineHeight, TextAlignment textAlignment) : this(NoesisGUI_PINVOKE.new_FormattedText__SWIG_2(text != null ? text : string.Empty, FontFamily.getCPtr(fontFamily), fontSize, Brush.getCPtr(foreground), (int)flowDirection, maxWidth, maxHeight, lineHeight, (int)textAlignment), true) { + } + + public FormattedText(string text, FontFamily fontFamily, float fontSize, Brush foreground, FlowDirection flowDirection, float maxWidth, float maxHeight, float lineHeight) : this(NoesisGUI_PINVOKE.new_FormattedText__SWIG_3(text != null ? text : string.Empty, FontFamily.getCPtr(fontFamily), fontSize, Brush.getCPtr(foreground), (int)flowDirection, maxWidth, maxHeight, lineHeight), true) { + } + + public FormattedText(string text, FontFamily fontFamily, float fontSize, Brush foreground, FlowDirection flowDirection, float maxWidth, float maxHeight) : this(NoesisGUI_PINVOKE.new_FormattedText__SWIG_4(text != null ? text : string.Empty, FontFamily.getCPtr(fontFamily), fontSize, Brush.getCPtr(foreground), (int)flowDirection, maxWidth, maxHeight), true) { + } + + public FormattedText(string text, FontFamily fontFamily, float fontSize, Brush foreground, FlowDirection flowDirection, float maxWidth) : this(NoesisGUI_PINVOKE.new_FormattedText__SWIG_5(text != null ? text : string.Empty, FontFamily.getCPtr(fontFamily), fontSize, Brush.getCPtr(foreground), (int)flowDirection, maxWidth), true) { + } + + public FormattedText(string text, FontFamily fontFamily, float fontSize, Brush foreground, FlowDirection flowDirection) : this(NoesisGUI_PINVOKE.new_FormattedText__SWIG_6(text != null ? text : string.Empty, FontFamily.getCPtr(fontFamily), fontSize, Brush.getCPtr(foreground), (int)flowDirection), true) { + } + + public FormattedText(string text, FontFamily fontFamily, float fontSize, Brush foreground) : this(NoesisGUI_PINVOKE.new_FormattedText__SWIG_7(text != null ? text : string.Empty, FontFamily.getCPtr(fontFamily), fontSize, Brush.getCPtr(foreground)), true) { + } + + public FormattedText(string text, FontFamily fontFamily, FontWeight weight, FontStretch stretch, FontStyle style, float fontSize, Brush foreground, FlowDirection flowDirection, float maxWidth, float maxHeight, float lineHeight, TextAlignment textAlignment, TextTrimming textTrimming) : this(NoesisGUI_PINVOKE.new_FormattedText__SWIG_8(text != null ? text : string.Empty, FontFamily.getCPtr(fontFamily), (int)weight, (int)stretch, (int)style, fontSize, Brush.getCPtr(foreground), (int)flowDirection, maxWidth, maxHeight, lineHeight, (int)textAlignment, (int)textTrimming), true) { + } + + public FormattedText(string text, FontFamily fontFamily, FontWeight weight, FontStretch stretch, FontStyle style, float fontSize, Brush foreground, FlowDirection flowDirection, float maxWidth, float maxHeight, float lineHeight, TextAlignment textAlignment) : this(NoesisGUI_PINVOKE.new_FormattedText__SWIG_9(text != null ? text : string.Empty, FontFamily.getCPtr(fontFamily), (int)weight, (int)stretch, (int)style, fontSize, Brush.getCPtr(foreground), (int)flowDirection, maxWidth, maxHeight, lineHeight, (int)textAlignment), true) { + } + + public FormattedText(string text, FontFamily fontFamily, FontWeight weight, FontStretch stretch, FontStyle style, float fontSize, Brush foreground, FlowDirection flowDirection, float maxWidth, float maxHeight, float lineHeight) : this(NoesisGUI_PINVOKE.new_FormattedText__SWIG_10(text != null ? text : string.Empty, FontFamily.getCPtr(fontFamily), (int)weight, (int)stretch, (int)style, fontSize, Brush.getCPtr(foreground), (int)flowDirection, maxWidth, maxHeight, lineHeight), true) { + } + + public FormattedText(string text, FontFamily fontFamily, FontWeight weight, FontStretch stretch, FontStyle style, float fontSize, Brush foreground, FlowDirection flowDirection, float maxWidth, float maxHeight) : this(NoesisGUI_PINVOKE.new_FormattedText__SWIG_11(text != null ? text : string.Empty, FontFamily.getCPtr(fontFamily), (int)weight, (int)stretch, (int)style, fontSize, Brush.getCPtr(foreground), (int)flowDirection, maxWidth, maxHeight), true) { + } + + public FormattedText(string text, FontFamily fontFamily, FontWeight weight, FontStretch stretch, FontStyle style, float fontSize, Brush foreground, FlowDirection flowDirection, float maxWidth) : this(NoesisGUI_PINVOKE.new_FormattedText__SWIG_12(text != null ? text : string.Empty, FontFamily.getCPtr(fontFamily), (int)weight, (int)stretch, (int)style, fontSize, Brush.getCPtr(foreground), (int)flowDirection, maxWidth), true) { + } + + public FormattedText(string text, FontFamily fontFamily, FontWeight weight, FontStretch stretch, FontStyle style, float fontSize, Brush foreground, FlowDirection flowDirection) : this(NoesisGUI_PINVOKE.new_FormattedText__SWIG_13(text != null ? text : string.Empty, FontFamily.getCPtr(fontFamily), (int)weight, (int)stretch, (int)style, fontSize, Brush.getCPtr(foreground), (int)flowDirection), true) { + } + + public FormattedText(string text, FontFamily fontFamily, FontWeight weight, FontStretch stretch, FontStyle style, float fontSize, Brush foreground) : this(NoesisGUI_PINVOKE.new_FormattedText__SWIG_14(text != null ? text : string.Empty, FontFamily.getCPtr(fontFamily), (int)weight, (int)stretch, (int)style, fontSize, Brush.getCPtr(foreground)), true) { + } + + public void BuildTextRuns(string text, InlineCollection inlines, FontFamily fontFamily, FontWeight fontWeight, FontStretch fontStretch, FontStyle fontStyle, float fontSize, float strokeThickness, Brush background, Brush foreground, Brush stroke, FlowDirection flowDirection, TextDecorations textDecorations, int charSpacing) { + NoesisGUI_PINVOKE.FormattedText_BuildTextRuns(swigCPtr, text != null ? text : string.Empty, InlineCollection.getCPtr(inlines), FontFamily.getCPtr(fontFamily), (int)fontWeight, (int)fontStretch, (int)fontStyle, fontSize, strokeThickness, Brush.getCPtr(background), Brush.getCPtr(foreground), Brush.getCPtr(stroke), (int)flowDirection, (int)textDecorations, charSpacing); + } + + public Size Measure(TextAlignment alignment, TextWrapping wrapping, TextTrimming trimming, float maxWidth, float maxHeight, float lineHeight, LineStackingStrategy lineStacking, FlowDirection flowDirection) { + IntPtr ret = NoesisGUI_PINVOKE.FormattedText_Measure(swigCPtr, (int)alignment, (int)wrapping, (int)trimming, maxWidth, maxHeight, lineHeight, (int)lineStacking, (int)flowDirection); if (ret != IntPtr.Zero) { return Marshal.PtrToStructure(ret); } @@ -71,8 +113,8 @@ public Size Measure(TextAlignment alignment, TextWrapping wrapping, TextTrimming } } - public void Layout(TextAlignment alignment, TextWrapping wrapping, TextTrimming trimming, float maxWidth, float maxHeight, float lineHeight, LineStackingStrategy lineStacking) { - NoesisGUI_PINVOKE.FormattedText_Layout(swigCPtr, (int)alignment, (int)wrapping, (int)trimming, maxWidth, maxHeight, lineHeight, (int)lineStacking); + public void Layout(TextAlignment alignment, TextWrapping wrapping, TextTrimming trimming, float maxWidth, float maxHeight, Thickness padding, float lineHeight, LineStackingStrategy lineStacking, FlowDirection flowDirection, bool discardNonVisibleGlyphs) { + NoesisGUI_PINVOKE.FormattedText_Layout(swigCPtr, (int)alignment, (int)wrapping, (int)trimming, maxWidth, maxHeight, ref padding, lineHeight, (int)lineStacking, (int)flowDirection, discardNonVisibleGlyphs); } public void GetGlyphPosition(uint chIndex, bool afterChar, ref float x, ref float y) { @@ -84,6 +126,15 @@ public uint HitTest(float x, float y, ref bool isInside, ref bool isTrailing) { return ret; } + public bool IsInitialized() { + bool ret = NoesisGUI_PINVOKE.FormattedText_IsInitialized(swigCPtr); + return ret; + } + + public void Init() { + NoesisGUI_PINVOKE.FormattedText_Init(swigCPtr); + } + public bool IsEmpty { get { bool ret = NoesisGUI_PINVOKE.FormattedText_IsEmpty_get(swigCPtr); diff --git a/Src/Noesis/Core/Src/Proxies/FrameworkElementExtend.cs b/Src/Noesis/Core/Src/Proxies/FrameworkElementExtend.cs index 6a4f133..0c04d27 100644 --- a/Src/Noesis/Core/Src/Proxies/FrameworkElementExtend.cs +++ b/Src/Noesis/Core/Src/Proxies/FrameworkElementExtend.cs @@ -56,6 +56,10 @@ internal protected virtual bool ConnectEvent(object source, string eventName, st return false; } + internal protected virtual void ConnectField(object source, string fieldName) + { + } + public virtual void OnApplyTemplate() { } diff --git a/Src/Noesis/Core/Src/Proxies/Geometry.cs b/Src/Noesis/Core/Src/Proxies/Geometry.cs index a5c2e51..3b615ee 100644 --- a/Src/Noesis/Core/Src/Proxies/Geometry.cs +++ b/Src/Noesis/Core/Src/Proxies/Geometry.cs @@ -76,6 +76,27 @@ public static DependencyProperty TransformProperty { } } + public static DependencyProperty TrimStartProperty { + get { + IntPtr cPtr = NoesisGUI_PINVOKE.Geometry_TrimStartProperty_get(); + return (DependencyProperty)Noesis.Extend.GetProxy(cPtr, false); + } + } + + public static DependencyProperty TrimEndProperty { + get { + IntPtr cPtr = NoesisGUI_PINVOKE.Geometry_TrimEndProperty_get(); + return (DependencyProperty)Noesis.Extend.GetProxy(cPtr, false); + } + } + + public static DependencyProperty TrimOffsetProperty { + get { + IntPtr cPtr = NoesisGUI_PINVOKE.Geometry_TrimOffsetProperty_get(); + return (DependencyProperty)Noesis.Extend.GetProxy(cPtr, false); + } + } + public Transform Transform { set { NoesisGUI_PINVOKE.Geometry_Transform_set(swigCPtr, Transform.getCPtr(value)); @@ -86,6 +107,36 @@ public Transform Transform { } } + public float TrimStart { + set { + NoesisGUI_PINVOKE.Geometry_TrimStart_set(swigCPtr, value); + } + get { + float ret = NoesisGUI_PINVOKE.Geometry_TrimStart_get(swigCPtr); + return ret; + } + } + + public float TrimEnd { + set { + NoesisGUI_PINVOKE.Geometry_TrimEnd_set(swigCPtr, value); + } + get { + float ret = NoesisGUI_PINVOKE.Geometry_TrimEnd_get(swigCPtr); + return ret; + } + } + + public float TrimOffset { + set { + NoesisGUI_PINVOKE.Geometry_TrimOffset_set(swigCPtr, value); + } + get { + float ret = NoesisGUI_PINVOKE.Geometry_TrimOffset_get(swigCPtr); + return ret; + } + } + private void GetBoundsHelper(out Rect bounds) { NoesisGUI_PINVOKE.Geometry_GetBoundsHelper(swigCPtr, out bounds); } diff --git a/Src/Noesis/Core/Src/Proxies/HitTest3DResult.cs b/Src/Noesis/Core/Src/Proxies/HitTest3DResult.cs new file mode 100644 index 0000000..06e5564 --- /dev/null +++ b/Src/Noesis/Core/Src/Proxies/HitTest3DResult.cs @@ -0,0 +1,77 @@ +//------------------------------------------------------------------------------ +// +// +// 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 class HitTest3DResult : IDisposable { + private HandleRef swigCPtr; + protected bool swigCMemOwn; + + internal HitTest3DResult(IntPtr cPtr, bool cMemoryOwn) { + swigCMemOwn = cMemoryOwn; + swigCPtr = new HandleRef(this, cPtr); + } + + internal static HandleRef getCPtr(HitTest3DResult obj) { + return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; + } + + ~HitTest3DResult() { + Dispose(); + } + + public virtual void Dispose() { + lock(this) { + if (swigCPtr.Handle != IntPtr.Zero) { + if (swigCMemOwn) { + swigCMemOwn = false; + NoesisGUI_PINVOKE.delete_HitTest3DResult(swigCPtr); + } + swigCPtr = new HandleRef(null, IntPtr.Zero); + } + GC.SuppressFinalize(this); + } + } + + public DependencyObject VisualHit { + get { return GetVisualHit(); } + } + + public Point3D WorldPos { + get { return GetWorldPos(); } + } + + public HitTest3DResult() : this(NoesisGUI_PINVOKE.new_HitTest3DResult(), true) { + } + + private DependencyObject GetVisualHit() { + IntPtr cPtr = NoesisGUI_PINVOKE.HitTest3DResult_GetVisualHit(swigCPtr); + return (DependencyObject)Noesis.Extend.GetProxy(cPtr, false); + } + + private Point3D GetWorldPos() { + IntPtr ret = NoesisGUI_PINVOKE.HitTest3DResult_GetWorldPos(swigCPtr); + if (ret != IntPtr.Zero) { + return Marshal.PtrToStructure(ret); + } + else { + return new Point3D(); + } + } + +} + +} + diff --git a/Src/Noesis/Core/Src/Proxies/Inline.cs b/Src/Noesis/Core/Src/Proxies/Inline.cs index 086f332..657e6f4 100644 --- a/Src/Noesis/Core/Src/Proxies/Inline.cs +++ b/Src/Noesis/Core/Src/Proxies/Inline.cs @@ -27,6 +27,15 @@ internal static HandleRef getCPtr(Inline obj) { return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; } + public new FlowDirection FlowDirection { + set { + SetFlowDirection(value); + } + get { + return GetFlowDirection(); + } + } + public Inline() { } @@ -35,6 +44,22 @@ protected override IntPtr CreateCPtr(Type type, out bool registerExtend) { return NoesisGUI_PINVOKE.new_Inline(); } + private FlowDirection GetFlowDirection() { + FlowDirection ret = (FlowDirection)NoesisGUI_PINVOKE.Inline_GetFlowDirection(swigCPtr); + return ret; + } + + private void SetFlowDirection(FlowDirection flowDirection) { + NoesisGUI_PINVOKE.Inline_SetFlowDirection(swigCPtr, (int)flowDirection); + } + + public new static DependencyProperty FlowDirectionProperty { + get { + IntPtr cPtr = NoesisGUI_PINVOKE.Inline_FlowDirectionProperty_get(); + return (DependencyProperty)Noesis.Extend.GetProxy(cPtr, false); + } + } + public static DependencyProperty TextDecorationsProperty { get { IntPtr cPtr = NoesisGUI_PINVOKE.Inline_TextDecorationsProperty_get(); diff --git a/Src/Noesis/Core/Src/Proxies/Line.cs b/Src/Noesis/Core/Src/Proxies/Line.cs index 20f195d..725ebb1 100644 --- a/Src/Noesis/Core/Src/Proxies/Line.cs +++ b/Src/Noesis/Core/Src/Proxies/Line.cs @@ -27,6 +27,10 @@ internal static HandleRef getCPtr(Line obj) { return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; } + internal protected override Geometry DefiningGeometry { + get { return new LineGeometry(); } + } + public Line() { } diff --git a/Src/Noesis/Core/Src/Proxies/MatrixTransform3D.cs b/Src/Noesis/Core/Src/Proxies/MatrixTransform3D.cs index b648f87..5959dfa 100644 --- a/Src/Noesis/Core/Src/Proxies/MatrixTransform3D.cs +++ b/Src/Noesis/Core/Src/Proxies/MatrixTransform3D.cs @@ -38,16 +38,6 @@ protected override IntPtr CreateCPtr(Type type, out bool registerExtend) { public MatrixTransform3D(Matrix3D matrix) : this(NoesisGUI_PINVOKE.new_MatrixTransform3D__SWIG_1(ref matrix), true) { } - public override Matrix3D GetTransform() { - IntPtr ret = NoesisGUI_PINVOKE.MatrixTransform3D_GetTransform(swigCPtr); - if (ret != IntPtr.Zero) { - return Marshal.PtrToStructure(ret); - } - else { - return Matrix3D.Identity; - } - } - public static DependencyProperty MatrixProperty { get { IntPtr cPtr = NoesisGUI_PINVOKE.MatrixTransform3D_MatrixProperty_get(); diff --git a/Src/Noesis/Core/Src/Proxies/NoesisGUI_.cs b/Src/Noesis/Core/Src/Proxies/NoesisGUI_.cs index 310c51d..69d0748 100644 --- a/Src/Noesis/Core/Src/Proxies/NoesisGUI_.cs +++ b/Src/Noesis/Core/Src/Proxies/NoesisGUI_.cs @@ -420,6 +420,31 @@ public static IntPtr Box_Color(Color val) { return ret; } + public static IntPtr Matrix_GetStaticType() { + IntPtr ret = NoesisGUI_PINVOKE.Matrix_GetStaticType(); + return ret; + } + + public static IntPtr Boxed_Matrix_GetStaticType() { + IntPtr ret = NoesisGUI_PINVOKE.Boxed_Matrix_GetStaticType(); + return ret; + } + + public static Matrix Unbox_Matrix(IntPtr val) { + IntPtr ret = NoesisGUI_PINVOKE.Unbox_Matrix(val); + if (ret != IntPtr.Zero) { + return Marshal.PtrToStructure(ret); + } + else { + return Matrix.Identity; + } + } + + public static IntPtr Box_Matrix(Matrix val) { + IntPtr ret = NoesisGUI_PINVOKE.Box_Matrix(ref val); + return ret; + } + public static IntPtr Vector4_GetStaticType() { IntPtr ret = NoesisGUI_PINVOKE.Vector4_GetStaticType(); return ret; @@ -470,6 +495,31 @@ public static IntPtr Box_Matrix4(Matrix4 val) { return ret; } + public static IntPtr Matrix3D_GetStaticType() { + IntPtr ret = NoesisGUI_PINVOKE.Matrix3D_GetStaticType(); + return ret; + } + + public static IntPtr Boxed_Matrix3D_GetStaticType() { + IntPtr ret = NoesisGUI_PINVOKE.Boxed_Matrix3D_GetStaticType(); + return ret; + } + + public static Matrix3D Unbox_Matrix3D(IntPtr val) { + IntPtr ret = NoesisGUI_PINVOKE.Unbox_Matrix3D(val); + if (ret != IntPtr.Zero) { + return Marshal.PtrToStructure(ret); + } + else { + return Matrix3D.Identity; + } + } + + public static IntPtr Box_Matrix3D(Matrix3D val) { + IntPtr ret = NoesisGUI_PINVOKE.Box_Matrix3D(ref val); + return ret; + } + public static IntPtr NullableBool_GetStaticType() { IntPtr ret = NoesisGUI_PINVOKE.NullableBool_GetStaticType(); return ret; @@ -1075,12 +1125,12 @@ public static IntPtr Box_DragAction(DragAction val) { return ret; } - public static IntPtr Box_CustomEnum(IntPtr type, int val) { + public static IntPtr Box_CustomEnum(IntPtr type, ulong val) { IntPtr ret = NoesisGUI_PINVOKE.Box_CustomEnum(type, val); return ret; } - public static IntPtr Unbox_CustomEnum(IntPtr val, ref int enumVal) { + public static IntPtr Unbox_CustomEnum(IntPtr val, ref ulong enumVal) { IntPtr ret = NoesisGUI_PINVOKE.Unbox_CustomEnum(val, ref enumVal); return ret; } diff --git a/Src/Noesis/Core/Src/Proxies/NoesisGUI_PINVOKE.cs b/Src/Noesis/Core/Src/Proxies/NoesisGUI_PINVOKE.cs index 0f41fd9..1573f0b 100644 --- a/Src/Noesis/Core/Src/Proxies/NoesisGUI_PINVOKE.cs +++ b/Src/Noesis/Core/Src/Proxies/NoesisGUI_PINVOKE.cs @@ -727,6 +727,18 @@ internal class NoesisGUI_PINVOKE { [DllImport(Library.Name)] public static extern IntPtr Box_Color(ref Color jarg1); + [DllImport(Library.Name)] + public static extern IntPtr Matrix_GetStaticType(); + + [DllImport(Library.Name)] + public static extern IntPtr Boxed_Matrix_GetStaticType(); + + [DllImport(Library.Name)] + public static extern IntPtr Unbox_Matrix(IntPtr jarg1); + + [DllImport(Library.Name)] + public static extern IntPtr Box_Matrix(ref Matrix jarg1); + [DllImport(Library.Name)] public static extern IntPtr Vector4_GetStaticType(); @@ -751,6 +763,18 @@ internal class NoesisGUI_PINVOKE { [DllImport(Library.Name)] public static extern IntPtr Box_Matrix4(ref Matrix4 jarg1); + [DllImport(Library.Name)] + public static extern IntPtr Matrix3D_GetStaticType(); + + [DllImport(Library.Name)] + public static extern IntPtr Boxed_Matrix3D_GetStaticType(); + + [DllImport(Library.Name)] + public static extern IntPtr Unbox_Matrix3D(IntPtr jarg1); + + [DllImport(Library.Name)] + public static extern IntPtr Box_Matrix3D(ref Matrix3D jarg1); + [DllImport(Library.Name)] public static extern IntPtr NullableBool_GetStaticType(); @@ -1314,10 +1338,10 @@ internal class NoesisGUI_PINVOKE { public static extern IntPtr Box_DragAction(int jarg1); [DllImport(Library.Name)] - public static extern IntPtr Box_CustomEnum(IntPtr jarg1, int jarg2); + public static extern IntPtr Box_CustomEnum(IntPtr jarg1, ulong jarg2); [DllImport(Library.Name)] - public static extern IntPtr Unbox_CustomEnum(IntPtr jarg1, ref int jarg2); + public static extern IntPtr Unbox_CustomEnum(IntPtr jarg1, ref ulong jarg2); [DllImport(Library.Name)] public static extern void FontProvider_RegisterFontHelper(HandleRef jarg1, [MarshalAs(UnmanagedType.LPWStr)]string jarg2, [MarshalAs(UnmanagedType.LPWStr)]string jarg3); @@ -1362,25 +1386,25 @@ internal class NoesisGUI_PINVOKE { public static extern IntPtr BaseUICollection_Get(HandleRef jarg1, int jarg2); [DllImport(Library.Name)] - public static extern void BaseFreezableCollection_RemoveAt(HandleRef jarg1, int jarg2); + public static extern void BaseFreezableCollection_Set(HandleRef jarg1, int jarg2, HandleRef jarg3); [DllImport(Library.Name)] - public static extern void BaseFreezableCollection_Clear(HandleRef jarg1); + public static extern int BaseFreezableCollection_Add(HandleRef jarg1, HandleRef jarg2); [DllImport(Library.Name)] - public static extern void BaseFreezableCollection_Set(HandleRef jarg1, int jarg2, HandleRef jarg3); + public static extern void BaseFreezableCollection_Insert(HandleRef jarg1, int jarg2, HandleRef jarg3); [DllImport(Library.Name)] - public static extern int BaseFreezableCollection_Add(HandleRef jarg1, HandleRef jarg2); + public static extern int BaseFreezableCollection_IndexOf(HandleRef jarg1, HandleRef jarg2); [DllImport(Library.Name)] - public static extern int BaseFreezableCollection_IndexOf(HandleRef jarg1, HandleRef jarg2); + public static extern void BaseFreezableCollection_RemoveAt(HandleRef jarg1, int jarg2); [DllImport(Library.Name)] - public static extern int BaseFreezableCollection_Count_get(HandleRef jarg1); + public static extern void BaseFreezableCollection_Clear(HandleRef jarg1); [DllImport(Library.Name)] - public static extern void BaseFreezableCollection_Insert(HandleRef jarg1, int jarg2, HandleRef jarg3); + public static extern int BaseFreezableCollection_Count_get(HandleRef jarg1); [DllImport(Library.Name)] [return: MarshalAs(UnmanagedType.U1)] @@ -1510,9 +1534,6 @@ internal class NoesisGUI_PINVOKE { [DllImport(Library.Name)] public static extern int BitmapSource_GetFormat(HandleRef jarg1); - [DllImport(Library.Name)] - public static extern void BitmapSource_CopyPixels(HandleRef jarg1, HandleRef jarg2, uint jarg3, int jarg4, int jarg5); - [DllImport(Library.Name)] public static extern float BitmapSource_DpiX_get(HandleRef jarg1); @@ -2581,15 +2602,6 @@ internal class NoesisGUI_PINVOKE { [DllImport(Library.Name)] public static extern IntPtr Pen_ThicknessProperty_get(); - [DllImport(Library.Name)] - public static extern IntPtr Pen_TrimStartProperty_get(); - - [DllImport(Library.Name)] - public static extern IntPtr Pen_TrimEndProperty_get(); - - [DllImport(Library.Name)] - public static extern IntPtr Pen_TrimOffsetProperty_get(); - [DllImport(Library.Name)] public static extern void Pen_Brush_set(HandleRef jarg1, HandleRef jarg2); @@ -2639,25 +2651,7 @@ internal class NoesisGUI_PINVOKE { public static extern float Pen_Thickness_get(HandleRef jarg1); [DllImport(Library.Name)] - public static extern void Pen_TrimStart_set(HandleRef jarg1, float jarg2); - - [DllImport(Library.Name)] - public static extern float Pen_TrimStart_get(HandleRef jarg1); - - [DllImport(Library.Name)] - public static extern void Pen_TrimEnd_set(HandleRef jarg1, float jarg2); - - [DllImport(Library.Name)] - public static extern float Pen_TrimEnd_get(HandleRef jarg1); - - [DllImport(Library.Name)] - public static extern void Pen_TrimOffset_set(HandleRef jarg1, float jarg2); - - [DllImport(Library.Name)] - public static extern float Pen_TrimOffset_get(HandleRef jarg1); - - [DllImport(Library.Name)] - public static extern IntPtr Transform3D_GetTransform(HandleRef jarg1); + public static extern void Transform3D_GetTransformHelper(HandleRef jarg1, out Matrix3D jarg2); [DllImport(Library.Name)] public static extern IntPtr new_CompositeTransform3D(); @@ -2665,9 +2659,6 @@ internal class NoesisGUI_PINVOKE { [DllImport(Library.Name)] public static extern IntPtr CompositeTransform3D_ConstructTransform3DMatrix(float jarg1, float jarg2, float jarg3, float jarg4, float jarg5, float jarg6, float jarg7, float jarg8, float jarg9, float jarg10, float jarg11, float jarg12); - [DllImport(Library.Name)] - public static extern IntPtr CompositeTransform3D_GetTransform(HandleRef jarg1); - [DllImport(Library.Name)] public static extern IntPtr CompositeTransform3D_CenterXProperty_get(); @@ -2782,9 +2773,6 @@ internal class NoesisGUI_PINVOKE { [DllImport(Library.Name)] public static extern IntPtr new_MatrixTransform3D__SWIG_1(ref Matrix3D jarg1); - [DllImport(Library.Name)] - public static extern IntPtr MatrixTransform3D_GetTransform(HandleRef jarg1); - [DllImport(Library.Name)] public static extern IntPtr MatrixTransform3D_MatrixProperty_get(); @@ -2884,12 +2872,39 @@ internal class NoesisGUI_PINVOKE { [DllImport(Library.Name)] public static extern IntPtr Geometry_TransformProperty_get(); + [DllImport(Library.Name)] + public static extern IntPtr Geometry_TrimStartProperty_get(); + + [DllImport(Library.Name)] + public static extern IntPtr Geometry_TrimEndProperty_get(); + + [DllImport(Library.Name)] + public static extern IntPtr Geometry_TrimOffsetProperty_get(); + [DllImport(Library.Name)] public static extern void Geometry_Transform_set(HandleRef jarg1, HandleRef jarg2); [DllImport(Library.Name)] public static extern IntPtr Geometry_Transform_get(HandleRef jarg1); + [DllImport(Library.Name)] + public static extern void Geometry_TrimStart_set(HandleRef jarg1, float jarg2); + + [DllImport(Library.Name)] + public static extern float Geometry_TrimStart_get(HandleRef jarg1); + + [DllImport(Library.Name)] + public static extern void Geometry_TrimEnd_set(HandleRef jarg1, float jarg2); + + [DllImport(Library.Name)] + public static extern float Geometry_TrimEnd_get(HandleRef jarg1); + + [DllImport(Library.Name)] + public static extern void Geometry_TrimOffset_set(HandleRef jarg1, float jarg2); + + [DllImport(Library.Name)] + public static extern float Geometry_TrimOffset_get(HandleRef jarg1); + [DllImport(Library.Name)] public static extern void Geometry_GetBoundsHelper(HandleRef jarg1, out Rect jarg2); @@ -3425,6 +3440,9 @@ internal class NoesisGUI_PINVOKE { [DllImport(Library.Name)] public static extern void DrawingContext_PushTransform(HandleRef jarg1, HandleRef jarg2); + [DllImport(Library.Name)] + public static extern void DrawingContext_PushBlendingMode(HandleRef jarg1, int jarg2); + [DllImport(Library.Name)] public static extern IntPtr new_FontFamily__SWIG_0(); @@ -3476,6 +3494,18 @@ internal class NoesisGUI_PINVOKE { [DllImport(Library.Name)] public static extern void delete_HitTestResult(HandleRef jarg1); + [DllImport(Library.Name)] + public static extern IntPtr new_HitTest3DResult(); + + [DllImport(Library.Name)] + public static extern IntPtr HitTest3DResult_GetVisualHit(HandleRef jarg1); + + [DllImport(Library.Name)] + public static extern IntPtr HitTest3DResult_GetWorldPos(HandleRef jarg1); + + [DllImport(Library.Name)] + public static extern void delete_HitTest3DResult(HandleRef jarg1); + [DllImport(Library.Name)] [return: MarshalAs(UnmanagedType.U1)] public static extern bool Visual_IsAncestorOf(HandleRef jarg1, HandleRef jarg2); @@ -3556,6 +3586,9 @@ internal class NoesisGUI_PINVOKE { [DllImport(Library.Name)] public static extern IntPtr VisualTreeHelper_HitTestHelper(HandleRef jarg1, ref Point jarg2); + [DllImport(Library.Name)] + public static extern IntPtr VisualTreeHelper_HitTest3DHelper(HandleRef jarg1, ref Point3D jarg2, ref Point3D jarg3); + [DllImport(Library.Name)] public static extern IntPtr VisualCollection_Create(HandleRef jarg1); @@ -5443,6 +5476,135 @@ internal class NoesisGUI_PINVOKE { [DllImport(Library.Name)] public static extern IntPtr FrameworkElement_FindTreeElement(HandleRef jarg1); + [DllImport(Library.Name)] + public static extern IntPtr Typography_AnnotationAlternatesProperty_get(); + + [DllImport(Library.Name)] + public static extern IntPtr Typography_CapitalsProperty_get(); + + [DllImport(Library.Name)] + public static extern IntPtr Typography_CapitalSpacingProperty_get(); + + [DllImport(Library.Name)] + public static extern IntPtr Typography_CaseSensitiveFormsProperty_get(); + + [DllImport(Library.Name)] + public static extern IntPtr Typography_ContextualAlternatesProperty_get(); + + [DllImport(Library.Name)] + public static extern IntPtr Typography_ContextualLigaturesProperty_get(); + + [DllImport(Library.Name)] + public static extern IntPtr Typography_ContextualSwashesProperty_get(); + + [DllImport(Library.Name)] + public static extern IntPtr Typography_DiscretionaryLigaturesProperty_get(); + + [DllImport(Library.Name)] + public static extern IntPtr Typography_EastAsianExpertFormsProperty_get(); + + [DllImport(Library.Name)] + public static extern IntPtr Typography_EastAsianLanguageProperty_get(); + + [DllImport(Library.Name)] + public static extern IntPtr Typography_EastAsianWidthsProperty_get(); + + [DllImport(Library.Name)] + public static extern IntPtr Typography_FractionProperty_get(); + + [DllImport(Library.Name)] + public static extern IntPtr Typography_HistoricalFormsProperty_get(); + + [DllImport(Library.Name)] + public static extern IntPtr Typography_HistoricalLigaturesProperty_get(); + + [DllImport(Library.Name)] + public static extern IntPtr Typography_KerningProperty_get(); + + [DllImport(Library.Name)] + public static extern IntPtr Typography_MathematicalGreekProperty_get(); + + [DllImport(Library.Name)] + public static extern IntPtr Typography_NumeralAlignmentProperty_get(); + + [DllImport(Library.Name)] + public static extern IntPtr Typography_NumeralStyleProperty_get(); + + [DllImport(Library.Name)] + public static extern IntPtr Typography_SlashedZeroProperty_get(); + + [DllImport(Library.Name)] + public static extern IntPtr Typography_StandardLigaturesProperty_get(); + + [DllImport(Library.Name)] + public static extern IntPtr Typography_StandardSwashesProperty_get(); + + [DllImport(Library.Name)] + public static extern IntPtr Typography_StylisticAlternatesProperty_get(); + + [DllImport(Library.Name)] + public static extern IntPtr Typography_StylisticSet1Property_get(); + + [DllImport(Library.Name)] + public static extern IntPtr Typography_StylisticSet2Property_get(); + + [DllImport(Library.Name)] + public static extern IntPtr Typography_StylisticSet3Property_get(); + + [DllImport(Library.Name)] + public static extern IntPtr Typography_StylisticSet4Property_get(); + + [DllImport(Library.Name)] + public static extern IntPtr Typography_StylisticSet5Property_get(); + + [DllImport(Library.Name)] + public static extern IntPtr Typography_StylisticSet6Property_get(); + + [DllImport(Library.Name)] + public static extern IntPtr Typography_StylisticSet7Property_get(); + + [DllImport(Library.Name)] + public static extern IntPtr Typography_StylisticSet8Property_get(); + + [DllImport(Library.Name)] + public static extern IntPtr Typography_StylisticSet9Property_get(); + + [DllImport(Library.Name)] + public static extern IntPtr Typography_StylisticSet10Property_get(); + + [DllImport(Library.Name)] + public static extern IntPtr Typography_StylisticSet11Property_get(); + + [DllImport(Library.Name)] + public static extern IntPtr Typography_StylisticSet12Property_get(); + + [DllImport(Library.Name)] + public static extern IntPtr Typography_StylisticSet13Property_get(); + + [DllImport(Library.Name)] + public static extern IntPtr Typography_StylisticSet14Property_get(); + + [DllImport(Library.Name)] + public static extern IntPtr Typography_StylisticSet15Property_get(); + + [DllImport(Library.Name)] + public static extern IntPtr Typography_StylisticSet16Property_get(); + + [DllImport(Library.Name)] + public static extern IntPtr Typography_StylisticSet17Property_get(); + + [DllImport(Library.Name)] + public static extern IntPtr Typography_StylisticSet18Property_get(); + + [DllImport(Library.Name)] + public static extern IntPtr Typography_StylisticSet19Property_get(); + + [DllImport(Library.Name)] + public static extern IntPtr Typography_StylisticSet20Property_get(); + + [DllImport(Library.Name)] + public static extern IntPtr Typography_VariantsProperty_get(); + [DllImport(Library.Name)] public static extern IntPtr TextElement_GetFontFamily(HandleRef jarg1); @@ -5587,6 +5749,15 @@ internal class NoesisGUI_PINVOKE { [DllImport(Library.Name)] public static extern IntPtr new_Inline(); + [DllImport(Library.Name)] + public static extern int Inline_GetFlowDirection(HandleRef jarg1); + + [DllImport(Library.Name)] + public static extern void Inline_SetFlowDirection(HandleRef jarg1, int jarg2); + + [DllImport(Library.Name)] + public static extern IntPtr Inline_FlowDirectionProperty_get(); + [DllImport(Library.Name)] public static extern IntPtr Inline_TextDecorationsProperty_get(); @@ -8094,16 +8265,58 @@ internal class NoesisGUI_PINVOKE { public static extern bool Expander_IsExpanded_get(HandleRef jarg1); [DllImport(Library.Name)] - public static extern IntPtr new_FormattedText(); + public static extern IntPtr new_FormattedText__SWIG_0(); + + [DllImport(Library.Name)] + public static extern IntPtr new_FormattedText__SWIG_1([MarshalAs(UnmanagedType.LPWStr)]string jarg1, HandleRef jarg2, float jarg3, HandleRef jarg4, int jarg5, float jarg6, float jarg7, float jarg8, int jarg9, int jarg10); + + [DllImport(Library.Name)] + public static extern IntPtr new_FormattedText__SWIG_2([MarshalAs(UnmanagedType.LPWStr)]string jarg1, HandleRef jarg2, float jarg3, HandleRef jarg4, int jarg5, float jarg6, float jarg7, float jarg8, int jarg9); + + [DllImport(Library.Name)] + public static extern IntPtr new_FormattedText__SWIG_3([MarshalAs(UnmanagedType.LPWStr)]string jarg1, HandleRef jarg2, float jarg3, HandleRef jarg4, int jarg5, float jarg6, float jarg7, float jarg8); + + [DllImport(Library.Name)] + public static extern IntPtr new_FormattedText__SWIG_4([MarshalAs(UnmanagedType.LPWStr)]string jarg1, HandleRef jarg2, float jarg3, HandleRef jarg4, int jarg5, float jarg6, float jarg7); + + [DllImport(Library.Name)] + public static extern IntPtr new_FormattedText__SWIG_5([MarshalAs(UnmanagedType.LPWStr)]string jarg1, HandleRef jarg2, float jarg3, HandleRef jarg4, int jarg5, float jarg6); + + [DllImport(Library.Name)] + public static extern IntPtr new_FormattedText__SWIG_6([MarshalAs(UnmanagedType.LPWStr)]string jarg1, HandleRef jarg2, float jarg3, HandleRef jarg4, int jarg5); + + [DllImport(Library.Name)] + public static extern IntPtr new_FormattedText__SWIG_7([MarshalAs(UnmanagedType.LPWStr)]string jarg1, HandleRef jarg2, float jarg3, HandleRef jarg4); + + [DllImport(Library.Name)] + public static extern IntPtr new_FormattedText__SWIG_8([MarshalAs(UnmanagedType.LPWStr)]string jarg1, HandleRef jarg2, int jarg3, int jarg4, int jarg5, float jarg6, HandleRef jarg7, int jarg8, float jarg9, float jarg10, float jarg11, int jarg12, int jarg13); + + [DllImport(Library.Name)] + public static extern IntPtr new_FormattedText__SWIG_9([MarshalAs(UnmanagedType.LPWStr)]string jarg1, HandleRef jarg2, int jarg3, int jarg4, int jarg5, float jarg6, HandleRef jarg7, int jarg8, float jarg9, float jarg10, float jarg11, int jarg12); [DllImport(Library.Name)] - public static extern void FormattedText_BuildTextRuns(HandleRef jarg1, [MarshalAs(UnmanagedType.LPWStr)]string jarg2, HandleRef jarg3, HandleRef jarg4, int jarg5, int jarg6, int jarg7, float jarg8, float jarg9, HandleRef jarg10, HandleRef jarg11, HandleRef jarg12, int jarg13, int jarg14); + public static extern IntPtr new_FormattedText__SWIG_10([MarshalAs(UnmanagedType.LPWStr)]string jarg1, HandleRef jarg2, int jarg3, int jarg4, int jarg5, float jarg6, HandleRef jarg7, int jarg8, float jarg9, float jarg10, float jarg11); [DllImport(Library.Name)] - public static extern IntPtr FormattedText_Measure(HandleRef jarg1, int jarg2, int jarg3, int jarg4, float jarg5, float jarg6, float jarg7, int jarg8); + public static extern IntPtr new_FormattedText__SWIG_11([MarshalAs(UnmanagedType.LPWStr)]string jarg1, HandleRef jarg2, int jarg3, int jarg4, int jarg5, float jarg6, HandleRef jarg7, int jarg8, float jarg9, float jarg10); [DllImport(Library.Name)] - public static extern void FormattedText_Layout(HandleRef jarg1, int jarg2, int jarg3, int jarg4, float jarg5, float jarg6, float jarg7, int jarg8); + public static extern IntPtr new_FormattedText__SWIG_12([MarshalAs(UnmanagedType.LPWStr)]string jarg1, HandleRef jarg2, int jarg3, int jarg4, int jarg5, float jarg6, HandleRef jarg7, int jarg8, float jarg9); + + [DllImport(Library.Name)] + public static extern IntPtr new_FormattedText__SWIG_13([MarshalAs(UnmanagedType.LPWStr)]string jarg1, HandleRef jarg2, int jarg3, int jarg4, int jarg5, float jarg6, HandleRef jarg7, int jarg8); + + [DllImport(Library.Name)] + public static extern IntPtr new_FormattedText__SWIG_14([MarshalAs(UnmanagedType.LPWStr)]string jarg1, HandleRef jarg2, int jarg3, int jarg4, int jarg5, float jarg6, HandleRef jarg7); + + [DllImport(Library.Name)] + public static extern void FormattedText_BuildTextRuns(HandleRef jarg1, [MarshalAs(UnmanagedType.LPWStr)]string jarg2, HandleRef jarg3, HandleRef jarg4, int jarg5, int jarg6, int jarg7, float jarg8, float jarg9, HandleRef jarg10, HandleRef jarg11, HandleRef jarg12, int jarg13, int jarg14, int jarg15); + + [DllImport(Library.Name)] + public static extern IntPtr FormattedText_Measure(HandleRef jarg1, int jarg2, int jarg3, int jarg4, float jarg5, float jarg6, float jarg7, int jarg8, int jarg9); + + [DllImport(Library.Name)] + public static extern void FormattedText_Layout(HandleRef jarg1, int jarg2, int jarg3, int jarg4, float jarg5, float jarg6, ref Thickness jarg7, float jarg8, int jarg9, int jarg10, bool jarg11); [DllImport(Library.Name)] public static extern void FormattedText_GetGlyphPosition(HandleRef jarg1, uint jarg2, bool jarg3, ref float jarg4, ref float jarg5); @@ -8111,6 +8324,13 @@ internal class NoesisGUI_PINVOKE { [DllImport(Library.Name)] public static extern uint FormattedText_HitTest(HandleRef jarg1, float jarg2, float jarg3, ref bool jarg4, ref bool jarg5); + [DllImport(Library.Name)] + [return: MarshalAs(UnmanagedType.U1)] + public static extern bool FormattedText_IsInitialized(HandleRef jarg1); + + [DllImport(Library.Name)] + public static extern void FormattedText_Init(HandleRef jarg1); + [DllImport(Library.Name)] [return: MarshalAs(UnmanagedType.U1)] public static extern bool FormattedText_IsEmpty_get(HandleRef jarg1); @@ -8834,6 +9054,9 @@ internal class NoesisGUI_PINVOKE { [DllImport(Library.Name)] public static extern IntPtr PasswordBox_SelectionOpacityProperty_get(); + [DllImport(Library.Name)] + public static extern IntPtr PasswordBox_ShowLastCharacterDurationProperty_get(); + [DllImport(Library.Name)] public static extern IntPtr PasswordBox_PasswordChangedEvent_get(); @@ -8879,6 +9102,12 @@ internal class NoesisGUI_PINVOKE { [DllImport(Library.Name)] public static extern IntPtr PasswordBox_Placeholder_get(HandleRef jarg1); + [DllImport(Library.Name)] + public static extern void PasswordBox_ShowLastCharacterDuration_set(HandleRef jarg1, int jarg2); + + [DllImport(Library.Name)] + public static extern int PasswordBox_ShowLastCharacterDuration_get(HandleRef jarg1); + [DllImport(Library.Name)] public static extern IntPtr new_Popup(); @@ -13285,6 +13514,72 @@ internal class NoesisGUI_PINVOKE { [DllImport(Library.Name)] public static extern IntPtr new_ListViewItem(); + + [DllImport(Library.Name)] + public static extern IntPtr new_RiveInput(); + + [DllImport(Library.Name)] + public static extern IntPtr RiveInput_InputNameProperty_get(); + + [DllImport(Library.Name)] + public static extern IntPtr RiveInput_InputValueProperty_get(); + + [DllImport(Library.Name)] + public static extern void RiveInput_InputName_set(HandleRef jarg1, [MarshalAs(UnmanagedType.LPWStr)]string jarg2); + + [DllImport(Library.Name)] + public static extern IntPtr RiveInput_InputName_get(HandleRef jarg1); + + [DllImport(Library.Name)] + public static extern void RiveInput_InputValue_set(HandleRef jarg1, HandleRef jarg2); + + [DllImport(Library.Name)] + public static extern IntPtr RiveInput_InputValue_get(HandleRef jarg1); + + [DllImport(Library.Name)] + public static extern IntPtr new_RiveInputCollection(); + + [DllImport(Library.Name)] + public static extern IntPtr new_RiveControl(); + + [DllImport(Library.Name)] + public static extern void RiveControl_SetInputValue(HandleRef jarg1, [MarshalAs(UnmanagedType.LPWStr)]string jarg2, HandleRef jarg3); + + [DllImport(Library.Name)] + public static extern void RiveControl_FireInputTrigger(HandleRef jarg1, [MarshalAs(UnmanagedType.LPWStr)]string jarg2); + + [DllImport(Library.Name)] + public static extern uint RiveControl_GetSourceInputCount(HandleRef jarg1); + + [DllImport(Library.Name)] + public static extern IntPtr RiveControl_GetSourceInput(HandleRef jarg1, uint jarg2, out RiveSourceInputType jarg3); + + [DllImport(Library.Name)] + public static extern IntPtr RiveControl_SourceProperty_get(); + + [DllImport(Library.Name)] + public static extern IntPtr RiveControl_StateProperty_get(); + + [DllImport(Library.Name)] + public static extern IntPtr RiveControl_StretchProperty_get(); + + [DllImport(Library.Name)] + public static extern void RiveControl_Source_set(HandleRef jarg1, [MarshalAs(UnmanagedType.LPWStr)]string jarg2); + + [DllImport(Library.Name)] + public static extern IntPtr RiveControl_Source_get(HandleRef jarg1); + + [DllImport(Library.Name)] + public static extern IntPtr RiveControl_State_get(HandleRef jarg1); + + [DllImport(Library.Name)] + public static extern void RiveControl_Stretch_set(HandleRef jarg1, int jarg2); + + [DllImport(Library.Name)] + public static extern int RiveControl_Stretch_get(HandleRef jarg1); + + [DllImport(Library.Name)] + public static extern IntPtr RiveControl_Inputs_get(HandleRef jarg1); } } diff --git a/Src/Noesis/Core/Src/Proxies/PasswordBox.cs b/Src/Noesis/Core/Src/Proxies/PasswordBox.cs index e48dd94..e1c3010 100644 --- a/Src/Noesis/Core/Src/Proxies/PasswordBox.cs +++ b/Src/Noesis/Core/Src/Proxies/PasswordBox.cs @@ -102,6 +102,13 @@ public static DependencyProperty SelectionOpacityProperty { } } + public static DependencyProperty ShowLastCharacterDurationProperty { + get { + IntPtr cPtr = NoesisGUI_PINVOKE.PasswordBox_ShowLastCharacterDurationProperty_get(); + return (DependencyProperty)Noesis.Extend.GetProxy(cPtr, false); + } + } + public static RoutedEvent PasswordChangedEvent { get { IntPtr cPtr = NoesisGUI_PINVOKE.PasswordBox_PasswordChangedEvent_get(); @@ -181,6 +188,16 @@ public string Placeholder { } } + public int ShowLastCharacterDuration { + set { + NoesisGUI_PINVOKE.PasswordBox_ShowLastCharacterDuration_set(swigCPtr, value); + } + get { + int ret = NoesisGUI_PINVOKE.PasswordBox_ShowLastCharacterDuration_get(swigCPtr); + return ret; + } + } + internal new static IntPtr Extend(string typeName) { return NoesisGUI_PINVOKE.Extend_PasswordBox(Marshal.StringToHGlobalAnsi(typeName)); } diff --git a/Src/Noesis/Core/Src/Proxies/Path.cs b/Src/Noesis/Core/Src/Proxies/Path.cs index 28e5d02..85d7a12 100644 --- a/Src/Noesis/Core/Src/Proxies/Path.cs +++ b/Src/Noesis/Core/Src/Proxies/Path.cs @@ -27,6 +27,10 @@ internal static HandleRef getCPtr(Path obj) { return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; } + internal protected override Geometry DefiningGeometry { + get { return Data; } + } + public Path() { } diff --git a/Src/Noesis/Core/Src/Proxies/Pen.cs b/Src/Noesis/Core/Src/Proxies/Pen.cs index 7331e27..37cb8ac 100644 --- a/Src/Noesis/Core/Src/Proxies/Pen.cs +++ b/Src/Noesis/Core/Src/Proxies/Pen.cs @@ -91,27 +91,6 @@ public static DependencyProperty ThicknessProperty { } } - public static DependencyProperty TrimStartProperty { - get { - IntPtr cPtr = NoesisGUI_PINVOKE.Pen_TrimStartProperty_get(); - return (DependencyProperty)Noesis.Extend.GetProxy(cPtr, false); - } - } - - public static DependencyProperty TrimEndProperty { - get { - IntPtr cPtr = NoesisGUI_PINVOKE.Pen_TrimEndProperty_get(); - return (DependencyProperty)Noesis.Extend.GetProxy(cPtr, false); - } - } - - public static DependencyProperty TrimOffsetProperty { - get { - IntPtr cPtr = NoesisGUI_PINVOKE.Pen_TrimOffsetProperty_get(); - return (DependencyProperty)Noesis.Extend.GetProxy(cPtr, false); - } - } - public Brush Brush { set { NoesisGUI_PINVOKE.Pen_Brush_set(swigCPtr, Brush.getCPtr(value)); @@ -192,36 +171,6 @@ public float Thickness { } } - public float TrimStart { - set { - NoesisGUI_PINVOKE.Pen_TrimStart_set(swigCPtr, value); - } - get { - float ret = NoesisGUI_PINVOKE.Pen_TrimStart_get(swigCPtr); - return ret; - } - } - - public float TrimEnd { - set { - NoesisGUI_PINVOKE.Pen_TrimEnd_set(swigCPtr, value); - } - get { - float ret = NoesisGUI_PINVOKE.Pen_TrimEnd_get(swigCPtr); - return ret; - } - } - - public float TrimOffset { - set { - NoesisGUI_PINVOKE.Pen_TrimOffset_set(swigCPtr, value); - } - get { - float ret = NoesisGUI_PINVOKE.Pen_TrimOffset_get(swigCPtr); - return ret; - } - } - } } diff --git a/Src/Noesis/Core/Src/Proxies/Rectangle.cs b/Src/Noesis/Core/Src/Proxies/Rectangle.cs index 886c831..2dd593e 100644 --- a/Src/Noesis/Core/Src/Proxies/Rectangle.cs +++ b/Src/Noesis/Core/Src/Proxies/Rectangle.cs @@ -27,6 +27,10 @@ internal static HandleRef getCPtr(Rectangle obj) { return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; } + internal protected override Geometry DefiningGeometry { + get { return new RectangleGeometry(); } + } + public Rectangle() { } diff --git a/Src/Noesis/Core/Src/Proxies/RiveControl.cs b/Src/Noesis/Core/Src/Proxies/RiveControl.cs new file mode 100644 index 0000000..0eba8a9 --- /dev/null +++ b/Src/Noesis/Core/Src/Proxies/RiveControl.cs @@ -0,0 +1,117 @@ +//------------------------------------------------------------------------------ +// +// +// 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 class RiveControl : FrameworkElement { + internal new static RiveControl CreateProxy(IntPtr cPtr, bool cMemoryOwn) { + return new RiveControl(cPtr, cMemoryOwn); + } + + internal RiveControl(IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn) { + } + + internal static HandleRef getCPtr(RiveControl obj) { + return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; + } + + public RiveControl() { + } + + protected override IntPtr CreateCPtr(Type type, out bool registerExtend) { + registerExtend = false; + return NoesisGUI_PINVOKE.new_RiveControl(); + } + + public void SetInputValue(string name, object value) { + NoesisGUI_PINVOKE.RiveControl_SetInputValue(swigCPtr, name != null ? name : string.Empty, Noesis.Extend.GetInstanceHandle(value)); + } + + public void FireInputTrigger(string name) { + NoesisGUI_PINVOKE.RiveControl_FireInputTrigger(swigCPtr, name != null ? name : string.Empty); + } + + public uint GetSourceInputCount() { + uint ret = NoesisGUI_PINVOKE.RiveControl_GetSourceInputCount(swigCPtr); + return ret; + } + + public string GetSourceInput(uint index, out RiveSourceInputType type) { + IntPtr strPtr = NoesisGUI_PINVOKE.RiveControl_GetSourceInput(swigCPtr, index, out type); + string str = Noesis.Extend.StringFromNativeUtf8(strPtr); + return str; + } + + public static DependencyProperty SourceProperty { + get { + IntPtr cPtr = NoesisGUI_PINVOKE.RiveControl_SourceProperty_get(); + return (DependencyProperty)Noesis.Extend.GetProxy(cPtr, false); + } + } + + public static DependencyProperty StateProperty { + get { + IntPtr cPtr = NoesisGUI_PINVOKE.RiveControl_StateProperty_get(); + return (DependencyProperty)Noesis.Extend.GetProxy(cPtr, false); + } + } + + public static DependencyProperty StretchProperty { + get { + IntPtr cPtr = NoesisGUI_PINVOKE.RiveControl_StretchProperty_get(); + return (DependencyProperty)Noesis.Extend.GetProxy(cPtr, false); + } + } + + public Uri Source { + set { + NoesisGUI_PINVOKE.RiveControl_Source_set(swigCPtr, value != null ? value.OriginalString : string.Empty); + } + get { + IntPtr uriPtr = NoesisGUI_PINVOKE.RiveControl_Source_get(swigCPtr); + string uri = Noesis.Extend.StringFromNativeUtf8(uriPtr); + return new Uri(uri, UriKind.RelativeOrAbsolute); + } + } + + public string State { + get { + IntPtr strPtr = NoesisGUI_PINVOKE.RiveControl_State_get(swigCPtr); + string str = Noesis.Extend.StringFromNativeUtf8(strPtr); + return str; + } + } + + public Stretch Stretch { + set { + NoesisGUI_PINVOKE.RiveControl_Stretch_set(swigCPtr, (int)value); + } + get { + Stretch ret = (Stretch)NoesisGUI_PINVOKE.RiveControl_Stretch_get(swigCPtr); + return ret; + } + } + + public RiveInputCollection Inputs { + get { + IntPtr cPtr = NoesisGUI_PINVOKE.RiveControl_Inputs_get(swigCPtr); + return (RiveInputCollection)Noesis.Extend.GetProxy(cPtr, false); + } + } + +} + +} + diff --git a/Src/Noesis/Core/Src/Proxies/RiveInput.cs b/Src/Noesis/Core/Src/Proxies/RiveInput.cs new file mode 100644 index 0000000..d2b9599 --- /dev/null +++ b/Src/Noesis/Core/Src/Proxies/RiveInput.cs @@ -0,0 +1,76 @@ +//------------------------------------------------------------------------------ +// +// +// 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 class RiveInput : Animatable { + internal new static RiveInput CreateProxy(IntPtr cPtr, bool cMemoryOwn) { + return new RiveInput(cPtr, cMemoryOwn); + } + + internal RiveInput(IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn) { + } + + internal static HandleRef getCPtr(RiveInput obj) { + return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; + } + + public RiveInput() { + } + + protected override IntPtr CreateCPtr(Type type, out bool registerExtend) { + registerExtend = false; + return NoesisGUI_PINVOKE.new_RiveInput(); + } + + public static DependencyProperty InputNameProperty { + get { + IntPtr cPtr = NoesisGUI_PINVOKE.RiveInput_InputNameProperty_get(); + return (DependencyProperty)Noesis.Extend.GetProxy(cPtr, false); + } + } + + public static DependencyProperty InputValueProperty { + get { + IntPtr cPtr = NoesisGUI_PINVOKE.RiveInput_InputValueProperty_get(); + return (DependencyProperty)Noesis.Extend.GetProxy(cPtr, false); + } + } + + public string InputName { + set { + NoesisGUI_PINVOKE.RiveInput_InputName_set(swigCPtr, value != null ? value : string.Empty); + } + get { + IntPtr strPtr = NoesisGUI_PINVOKE.RiveInput_InputName_get(swigCPtr); + string str = Noesis.Extend.StringFromNativeUtf8(strPtr); + return str; + } + } + + public object InputValue { + set { + NoesisGUI_PINVOKE.RiveInput_InputValue_set(swigCPtr, Noesis.Extend.GetInstanceHandle(value)); + } + get { + IntPtr cPtr = NoesisGUI_PINVOKE.RiveInput_InputValue_get(swigCPtr); + return Noesis.Extend.GetProxy(cPtr, false); + } + } + +} + +} + diff --git a/Src/Noesis/Core/Src/Proxies/RiveInputCollection.cs b/Src/Noesis/Core/Src/Proxies/RiveInputCollection.cs new file mode 100644 index 0000000..7e5ddd9 --- /dev/null +++ b/Src/Noesis/Core/Src/Proxies/RiveInputCollection.cs @@ -0,0 +1,41 @@ +//------------------------------------------------------------------------------ +// +// +// 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 class RiveInputCollection : UICollection { + internal new static RiveInputCollection CreateProxy(IntPtr cPtr, bool cMemoryOwn) { + return new RiveInputCollection(cPtr, cMemoryOwn); + } + + internal RiveInputCollection(IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn) { + } + + internal static HandleRef getCPtr(RiveInputCollection obj) { + return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; + } + + public RiveInputCollection() { + } + + protected override IntPtr CreateCPtr(Type type, out bool registerExtend) { + registerExtend = false; + return NoesisGUI_PINVOKE.new_RiveInputCollection(); + } + +} + +} + diff --git a/Src/Noesis/Core/Src/Proxies/RiveSourceInputType.cs b/Src/Noesis/Core/Src/Proxies/RiveSourceInputType.cs new file mode 100644 index 0000000..6fa8cc0 --- /dev/null +++ b/Src/Noesis/Core/Src/Proxies/RiveSourceInputType.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// +// +// 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 enum RiveSourceInputType { + Bool, + Number, + Trigger +} + +} + diff --git a/Src/Noesis/Core/Src/Proxies/Shape.cs b/Src/Noesis/Core/Src/Proxies/Shape.cs index 2860363..2ce1040 100644 --- a/Src/Noesis/Core/Src/Proxies/Shape.cs +++ b/Src/Noesis/Core/Src/Proxies/Shape.cs @@ -15,11 +15,7 @@ namespace Noesis { -public class Shape : FrameworkElement { - internal new static Shape CreateProxy(IntPtr cPtr, bool cMemoryOwn) { - return new Shape(cPtr, cMemoryOwn); - } - +public abstract class Shape : FrameworkElement { internal Shape(IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn) { } @@ -30,6 +26,8 @@ internal static HandleRef getCPtr(Shape obj) { protected Shape() { } + internal protected abstract Geometry DefiningGeometry { get; } + public static DependencyProperty FillProperty { get { IntPtr cPtr = NoesisGUI_PINVOKE.Shape_FillProperty_get(); diff --git a/Src/Noesis/Core/Src/Proxies/TextBlock.cs b/Src/Noesis/Core/Src/Proxies/TextBlock.cs index a79d6d5..af660e2 100644 --- a/Src/Noesis/Core/Src/Proxies/TextBlock.cs +++ b/Src/Noesis/Core/Src/Proxies/TextBlock.cs @@ -27,6 +27,10 @@ internal static HandleRef getCPtr(TextBlock obj) { return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; } + public Typography Typography { + get { return new Typography(this); } + } + public override string ToString() { return ToStringHelper(); } diff --git a/Src/Noesis/Core/Src/Proxies/TextBox.cs b/Src/Noesis/Core/Src/Proxies/TextBox.cs index c9d81cf..6883ca6 100644 --- a/Src/Noesis/Core/Src/Proxies/TextBox.cs +++ b/Src/Noesis/Core/Src/Proxies/TextBox.cs @@ -27,6 +27,10 @@ internal static HandleRef getCPtr(TextBox obj) { return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; } + public Typography Typography { + get { return new Typography(this); } + } + public TextBox() { } diff --git a/Src/Noesis/Core/Src/Proxies/TextElement.cs b/Src/Noesis/Core/Src/Proxies/TextElement.cs index 3a7fed1..11594cf 100644 --- a/Src/Noesis/Core/Src/Proxies/TextElement.cs +++ b/Src/Noesis/Core/Src/Proxies/TextElement.cs @@ -27,6 +27,10 @@ internal static HandleRef getCPtr(TextElement obj) { return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; } + public Typography Typography { + get { return new Typography(this); } + } + public static FontFamily GetFontFamily(DependencyObject element) { if (element == null) throw new ArgumentNullException("element"); { diff --git a/Src/Noesis/Core/Src/Proxies/Transform3D.cs b/Src/Noesis/Core/Src/Proxies/Transform3D.cs index dea30c7..10ab2c2 100644 --- a/Src/Noesis/Core/Src/Proxies/Transform3D.cs +++ b/Src/Noesis/Core/Src/Proxies/Transform3D.cs @@ -30,16 +30,18 @@ internal static HandleRef getCPtr(Transform3D obj) { protected Transform3D() { } - public virtual Matrix3D GetTransform() { - IntPtr ret = NoesisGUI_PINVOKE.Transform3D_GetTransform(swigCPtr); - if (ret != IntPtr.Zero) { - return Marshal.PtrToStructure(ret); - } - else { - return Matrix3D.Identity; + public Matrix3D Value { + get { + Matrix3D value; + GetTransformHelper(out value); + return value; } } + public void GetTransformHelper(out Matrix3D transform) { + NoesisGUI_PINVOKE.Transform3D_GetTransformHelper(swigCPtr, out transform); + } + } } diff --git a/Src/Noesis/Core/Src/Proxies/Typography.cs b/Src/Noesis/Core/Src/Proxies/Typography.cs new file mode 100644 index 0000000..ede55e8 --- /dev/null +++ b/Src/Noesis/Core/Src/Proxies/Typography.cs @@ -0,0 +1,547 @@ +//------------------------------------------------------------------------------ +// +// +// 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 struct Typography { + + #region Private members + private DependencyObject _owner; + + internal Typography(DependencyObject owner) { + _owner = owner; + } + #endregion + + int AnnotationAlternates { + get { return (int)_owner.GetValue(AnnotationAlternatesProperty); } + set { _owner.SetValue(AnnotationAlternatesProperty, value); } + } + + FontCapitals Capitals { + get { return (FontCapitals)_owner.GetValue(CapitalsProperty); } + set { _owner.SetValue(CapitalsProperty, value); } + } + + bool CapitalSpacing { + get { return (bool)_owner.GetValue(CapitalSpacingProperty); } + set { _owner.SetValue(CapitalSpacingProperty, value); } + } + + bool CaseSensitiveForms { + get { return (bool)_owner.GetValue(CaseSensitiveFormsProperty); } + set { _owner.SetValue(CaseSensitiveFormsProperty, value); } + } + + bool ContextualAlternates { + get { return (bool)_owner.GetValue(ContextualAlternatesProperty); } + set { _owner.SetValue(ContextualAlternatesProperty, value); } + } + + bool ContextualLigatures { + get { return (bool)_owner.GetValue(ContextualLigaturesProperty); } + set { _owner.SetValue(ContextualLigaturesProperty, value); } + } + + int ContextualSwashes { + get { return (int)_owner.GetValue(ContextualSwashesProperty); } + set { _owner.SetValue(ContextualSwashesProperty, value); } + } + + bool DiscretionaryLigatures { + get { return (bool)_owner.GetValue(DiscretionaryLigaturesProperty); } + set { _owner.SetValue(DiscretionaryLigaturesProperty, value); } + } + + bool EastAsianExpertForms { + get { return (bool)_owner.GetValue(EastAsianExpertFormsProperty); } + set { _owner.SetValue(EastAsianExpertFormsProperty, value); } + } + + FontEastAsianLanguage EastAsianLanguage { + get { return (FontEastAsianLanguage)_owner.GetValue(EastAsianLanguageProperty); } + set { _owner.SetValue(EastAsianLanguageProperty, value); } + } + + FontEastAsianWidths EastAsianWidths { + get { return (FontEastAsianWidths)_owner.GetValue(EastAsianWidthsProperty); } + set { _owner.SetValue(EastAsianWidthsProperty, value); } + } + + FontFraction Fraction { + get { return (FontFraction)_owner.GetValue(FractionProperty); } + set { _owner.SetValue(FractionProperty, value); } + } + + bool HistoricalForms { + get { return (bool)_owner.GetValue(HistoricalFormsProperty); } + set { _owner.SetValue(HistoricalFormsProperty, value); } + } + + bool HistoricalLigatures { + get { return (bool)_owner.GetValue(HistoricalLigaturesProperty); } + set { _owner.SetValue(HistoricalLigaturesProperty, value); } + } + + bool Kerning { + get { return (bool)_owner.GetValue(KerningProperty); } + set { _owner.SetValue(KerningProperty, value); } + } + + bool MathematicalGreek { + get { return (bool)_owner.GetValue(MathematicalGreekProperty); } + set { _owner.SetValue(MathematicalGreekProperty, value); } + } + + FontNumeralAlignment NumeralAlignment { + get { return (FontNumeralAlignment)_owner.GetValue(NumeralAlignmentProperty); } + set { _owner.SetValue(NumeralAlignmentProperty, value); } + } + + FontNumeralStyle NumeralStyle { + get { return (FontNumeralStyle)_owner.GetValue(NumeralStyleProperty); } + set { _owner.SetValue(NumeralStyleProperty, value); } + } + + bool SlashedZero { + get { return (bool)_owner.GetValue(SlashedZeroProperty); } + set { _owner.SetValue(SlashedZeroProperty, value); } + } + + bool StandardLigatures { + get { return (bool)_owner.GetValue(StandardLigaturesProperty); } + set { _owner.SetValue(StandardLigaturesProperty, value); } + } + + int StandardSwashes { + get { return (int)_owner.GetValue(StandardSwashesProperty); } + set { _owner.SetValue(StandardSwashesProperty, value); } + } + + int StylisticAlternates { + get { return (int)_owner.GetValue(StylisticAlternatesProperty); } + set { _owner.SetValue(StylisticAlternatesProperty, value); } + } + + bool StylisticSet1 { + get { return (bool)_owner.GetValue(StylisticSet1Property); } + set { _owner.SetValue(StylisticSet1Property, value); } + } + + bool StylisticSet2 { + get { return (bool)_owner.GetValue(StylisticSet2Property); } + set { _owner.SetValue(StylisticSet2Property, value); } + } + + bool StylisticSet3 { + get { return (bool)_owner.GetValue(StylisticSet3Property); } + set { _owner.SetValue(StylisticSet3Property, value); } + } + + bool StylisticSet4 { + get { return (bool)_owner.GetValue(StylisticSet4Property); } + set { _owner.SetValue(StylisticSet4Property, value); } + } + + bool StylisticSet5 { + get { return (bool)_owner.GetValue(StylisticSet5Property); } + set { _owner.SetValue(StylisticSet5Property, value); } + } + + bool StylisticSet6 { + get { return (bool)_owner.GetValue(StylisticSet6Property); } + set { _owner.SetValue(StylisticSet6Property, value); } + } + + bool StylisticSet7 { + get { return (bool)_owner.GetValue(StylisticSet7Property); } + set { _owner.SetValue(StylisticSet7Property, value); } + } + + bool StylisticSet8 { + get { return (bool)_owner.GetValue(StylisticSet8Property); } + set { _owner.SetValue(StylisticSet8Property, value); } + } + + bool StylisticSet9 { + get { return (bool)_owner.GetValue(StylisticSet9Property); } + set { _owner.SetValue(StylisticSet9Property, value); } + } + + bool StylisticSet10 { + get { return (bool)_owner.GetValue(StylisticSet10Property); } + set { _owner.SetValue(StylisticSet10Property, value); } + } + + bool StylisticSet11 { + get { return (bool)_owner.GetValue(StylisticSet11Property); } + set { _owner.SetValue(StylisticSet11Property, value); } + } + + bool StylisticSet12 { + get { return (bool)_owner.GetValue(StylisticSet12Property); } + set { _owner.SetValue(StylisticSet12Property, value); } + } + + bool StylisticSet13 { + get { return (bool)_owner.GetValue(StylisticSet13Property); } + set { _owner.SetValue(StylisticSet13Property, value); } + } + + bool StylisticSet14 { + get { return (bool)_owner.GetValue(StylisticSet14Property); } + set { _owner.SetValue(StylisticSet14Property, value); } + } + + bool StylisticSet15 { + get { return (bool)_owner.GetValue(StylisticSet15Property); } + set { _owner.SetValue(StylisticSet15Property, value); } + } + + bool StylisticSet16 { + get { return (bool)_owner.GetValue(StylisticSet16Property); } + set { _owner.SetValue(StylisticSet16Property, value); } + } + + bool StylisticSet17 { + get { return (bool)_owner.GetValue(StylisticSet17Property); } + set { _owner.SetValue(StylisticSet17Property, value); } + } + + bool StylisticSet18 { + get { return (bool)_owner.GetValue(StylisticSet18Property); } + set { _owner.SetValue(StylisticSet18Property, value); } + } + + bool StylisticSet19 { + get { return (bool)_owner.GetValue(StylisticSet19Property); } + set { _owner.SetValue(StylisticSet19Property, value); } + } + + bool StylisticSet20 { + get { return (bool)_owner.GetValue(StylisticSet20Property); } + set { _owner.SetValue(StylisticSet20Property, value); } + } + + FontVariants Variants { + get { return (FontVariants)_owner.GetValue(VariantsProperty); } + set { _owner.SetValue(VariantsProperty, value); } + } + + public static DependencyProperty AnnotationAlternatesProperty { + get { + IntPtr cPtr = NoesisGUI_PINVOKE.Typography_AnnotationAlternatesProperty_get(); + return (DependencyProperty)Noesis.Extend.GetProxy(cPtr, false); + } + } + + public static DependencyProperty CapitalsProperty { + get { + IntPtr cPtr = NoesisGUI_PINVOKE.Typography_CapitalsProperty_get(); + return (DependencyProperty)Noesis.Extend.GetProxy(cPtr, false); + } + } + + public static DependencyProperty CapitalSpacingProperty { + get { + IntPtr cPtr = NoesisGUI_PINVOKE.Typography_CapitalSpacingProperty_get(); + return (DependencyProperty)Noesis.Extend.GetProxy(cPtr, false); + } + } + + public static DependencyProperty CaseSensitiveFormsProperty { + get { + IntPtr cPtr = NoesisGUI_PINVOKE.Typography_CaseSensitiveFormsProperty_get(); + return (DependencyProperty)Noesis.Extend.GetProxy(cPtr, false); + } + } + + public static DependencyProperty ContextualAlternatesProperty { + get { + IntPtr cPtr = NoesisGUI_PINVOKE.Typography_ContextualAlternatesProperty_get(); + return (DependencyProperty)Noesis.Extend.GetProxy(cPtr, false); + } + } + + public static DependencyProperty ContextualLigaturesProperty { + get { + IntPtr cPtr = NoesisGUI_PINVOKE.Typography_ContextualLigaturesProperty_get(); + return (DependencyProperty)Noesis.Extend.GetProxy(cPtr, false); + } + } + + public static DependencyProperty ContextualSwashesProperty { + get { + IntPtr cPtr = NoesisGUI_PINVOKE.Typography_ContextualSwashesProperty_get(); + return (DependencyProperty)Noesis.Extend.GetProxy(cPtr, false); + } + } + + public static DependencyProperty DiscretionaryLigaturesProperty { + get { + IntPtr cPtr = NoesisGUI_PINVOKE.Typography_DiscretionaryLigaturesProperty_get(); + return (DependencyProperty)Noesis.Extend.GetProxy(cPtr, false); + } + } + + public static DependencyProperty EastAsianExpertFormsProperty { + get { + IntPtr cPtr = NoesisGUI_PINVOKE.Typography_EastAsianExpertFormsProperty_get(); + return (DependencyProperty)Noesis.Extend.GetProxy(cPtr, false); + } + } + + public static DependencyProperty EastAsianLanguageProperty { + get { + IntPtr cPtr = NoesisGUI_PINVOKE.Typography_EastAsianLanguageProperty_get(); + return (DependencyProperty)Noesis.Extend.GetProxy(cPtr, false); + } + } + + public static DependencyProperty EastAsianWidthsProperty { + get { + IntPtr cPtr = NoesisGUI_PINVOKE.Typography_EastAsianWidthsProperty_get(); + return (DependencyProperty)Noesis.Extend.GetProxy(cPtr, false); + } + } + + public static DependencyProperty FractionProperty { + get { + IntPtr cPtr = NoesisGUI_PINVOKE.Typography_FractionProperty_get(); + return (DependencyProperty)Noesis.Extend.GetProxy(cPtr, false); + } + } + + public static DependencyProperty HistoricalFormsProperty { + get { + IntPtr cPtr = NoesisGUI_PINVOKE.Typography_HistoricalFormsProperty_get(); + return (DependencyProperty)Noesis.Extend.GetProxy(cPtr, false); + } + } + + public static DependencyProperty HistoricalLigaturesProperty { + get { + IntPtr cPtr = NoesisGUI_PINVOKE.Typography_HistoricalLigaturesProperty_get(); + return (DependencyProperty)Noesis.Extend.GetProxy(cPtr, false); + } + } + + public static DependencyProperty KerningProperty { + get { + IntPtr cPtr = NoesisGUI_PINVOKE.Typography_KerningProperty_get(); + return (DependencyProperty)Noesis.Extend.GetProxy(cPtr, false); + } + } + + public static DependencyProperty MathematicalGreekProperty { + get { + IntPtr cPtr = NoesisGUI_PINVOKE.Typography_MathematicalGreekProperty_get(); + return (DependencyProperty)Noesis.Extend.GetProxy(cPtr, false); + } + } + + public static DependencyProperty NumeralAlignmentProperty { + get { + IntPtr cPtr = NoesisGUI_PINVOKE.Typography_NumeralAlignmentProperty_get(); + return (DependencyProperty)Noesis.Extend.GetProxy(cPtr, false); + } + } + + public static DependencyProperty NumeralStyleProperty { + get { + IntPtr cPtr = NoesisGUI_PINVOKE.Typography_NumeralStyleProperty_get(); + return (DependencyProperty)Noesis.Extend.GetProxy(cPtr, false); + } + } + + public static DependencyProperty SlashedZeroProperty { + get { + IntPtr cPtr = NoesisGUI_PINVOKE.Typography_SlashedZeroProperty_get(); + return (DependencyProperty)Noesis.Extend.GetProxy(cPtr, false); + } + } + + public static DependencyProperty StandardLigaturesProperty { + get { + IntPtr cPtr = NoesisGUI_PINVOKE.Typography_StandardLigaturesProperty_get(); + return (DependencyProperty)Noesis.Extend.GetProxy(cPtr, false); + } + } + + public static DependencyProperty StandardSwashesProperty { + get { + IntPtr cPtr = NoesisGUI_PINVOKE.Typography_StandardSwashesProperty_get(); + return (DependencyProperty)Noesis.Extend.GetProxy(cPtr, false); + } + } + + public static DependencyProperty StylisticAlternatesProperty { + get { + IntPtr cPtr = NoesisGUI_PINVOKE.Typography_StylisticAlternatesProperty_get(); + return (DependencyProperty)Noesis.Extend.GetProxy(cPtr, false); + } + } + + public static DependencyProperty StylisticSet1Property { + get { + IntPtr cPtr = NoesisGUI_PINVOKE.Typography_StylisticSet1Property_get(); + return (DependencyProperty)Noesis.Extend.GetProxy(cPtr, false); + } + } + + public static DependencyProperty StylisticSet2Property { + get { + IntPtr cPtr = NoesisGUI_PINVOKE.Typography_StylisticSet2Property_get(); + return (DependencyProperty)Noesis.Extend.GetProxy(cPtr, false); + } + } + + public static DependencyProperty StylisticSet3Property { + get { + IntPtr cPtr = NoesisGUI_PINVOKE.Typography_StylisticSet3Property_get(); + return (DependencyProperty)Noesis.Extend.GetProxy(cPtr, false); + } + } + + public static DependencyProperty StylisticSet4Property { + get { + IntPtr cPtr = NoesisGUI_PINVOKE.Typography_StylisticSet4Property_get(); + return (DependencyProperty)Noesis.Extend.GetProxy(cPtr, false); + } + } + + public static DependencyProperty StylisticSet5Property { + get { + IntPtr cPtr = NoesisGUI_PINVOKE.Typography_StylisticSet5Property_get(); + return (DependencyProperty)Noesis.Extend.GetProxy(cPtr, false); + } + } + + public static DependencyProperty StylisticSet6Property { + get { + IntPtr cPtr = NoesisGUI_PINVOKE.Typography_StylisticSet6Property_get(); + return (DependencyProperty)Noesis.Extend.GetProxy(cPtr, false); + } + } + + public static DependencyProperty StylisticSet7Property { + get { + IntPtr cPtr = NoesisGUI_PINVOKE.Typography_StylisticSet7Property_get(); + return (DependencyProperty)Noesis.Extend.GetProxy(cPtr, false); + } + } + + public static DependencyProperty StylisticSet8Property { + get { + IntPtr cPtr = NoesisGUI_PINVOKE.Typography_StylisticSet8Property_get(); + return (DependencyProperty)Noesis.Extend.GetProxy(cPtr, false); + } + } + + public static DependencyProperty StylisticSet9Property { + get { + IntPtr cPtr = NoesisGUI_PINVOKE.Typography_StylisticSet9Property_get(); + return (DependencyProperty)Noesis.Extend.GetProxy(cPtr, false); + } + } + + public static DependencyProperty StylisticSet10Property { + get { + IntPtr cPtr = NoesisGUI_PINVOKE.Typography_StylisticSet10Property_get(); + return (DependencyProperty)Noesis.Extend.GetProxy(cPtr, false); + } + } + + public static DependencyProperty StylisticSet11Property { + get { + IntPtr cPtr = NoesisGUI_PINVOKE.Typography_StylisticSet11Property_get(); + return (DependencyProperty)Noesis.Extend.GetProxy(cPtr, false); + } + } + + public static DependencyProperty StylisticSet12Property { + get { + IntPtr cPtr = NoesisGUI_PINVOKE.Typography_StylisticSet12Property_get(); + return (DependencyProperty)Noesis.Extend.GetProxy(cPtr, false); + } + } + + public static DependencyProperty StylisticSet13Property { + get { + IntPtr cPtr = NoesisGUI_PINVOKE.Typography_StylisticSet13Property_get(); + return (DependencyProperty)Noesis.Extend.GetProxy(cPtr, false); + } + } + + public static DependencyProperty StylisticSet14Property { + get { + IntPtr cPtr = NoesisGUI_PINVOKE.Typography_StylisticSet14Property_get(); + return (DependencyProperty)Noesis.Extend.GetProxy(cPtr, false); + } + } + + public static DependencyProperty StylisticSet15Property { + get { + IntPtr cPtr = NoesisGUI_PINVOKE.Typography_StylisticSet15Property_get(); + return (DependencyProperty)Noesis.Extend.GetProxy(cPtr, false); + } + } + + public static DependencyProperty StylisticSet16Property { + get { + IntPtr cPtr = NoesisGUI_PINVOKE.Typography_StylisticSet16Property_get(); + return (DependencyProperty)Noesis.Extend.GetProxy(cPtr, false); + } + } + + public static DependencyProperty StylisticSet17Property { + get { + IntPtr cPtr = NoesisGUI_PINVOKE.Typography_StylisticSet17Property_get(); + return (DependencyProperty)Noesis.Extend.GetProxy(cPtr, false); + } + } + + public static DependencyProperty StylisticSet18Property { + get { + IntPtr cPtr = NoesisGUI_PINVOKE.Typography_StylisticSet18Property_get(); + return (DependencyProperty)Noesis.Extend.GetProxy(cPtr, false); + } + } + + public static DependencyProperty StylisticSet19Property { + get { + IntPtr cPtr = NoesisGUI_PINVOKE.Typography_StylisticSet19Property_get(); + return (DependencyProperty)Noesis.Extend.GetProxy(cPtr, false); + } + } + + public static DependencyProperty StylisticSet20Property { + get { + IntPtr cPtr = NoesisGUI_PINVOKE.Typography_StylisticSet20Property_get(); + return (DependencyProperty)Noesis.Extend.GetProxy(cPtr, false); + } + } + + public static DependencyProperty VariantsProperty { + get { + IntPtr cPtr = NoesisGUI_PINVOKE.Typography_VariantsProperty_get(); + return (DependencyProperty)Noesis.Extend.GetProxy(cPtr, false); + } + } + +} + +} + diff --git a/Src/Noesis/Core/Src/Proxies/UIElement.cs b/Src/Noesis/Core/Src/Proxies/UIElement.cs index a8e832f..aea7a8d 100644 --- a/Src/Noesis/Core/Src/Proxies/UIElement.cs +++ b/Src/Noesis/Core/Src/Proxies/UIElement.cs @@ -713,12 +713,12 @@ public event DependencyPropertyChangedEventHandler IsKeyboardFocusWithinChanged } } - public event EventHandler LayoutChanged { + public event EventHandler LayoutUpdated { add { - AddEventHandler("LayoutChanged", value); + AddEventHandler("LayoutUpdated", value); } remove { - RemoveEventHandler("LayoutChanged", value); + RemoveEventHandler("LayoutUpdated", value); } } #endregion diff --git a/Src/Noesis/Core/Src/Proxies/VisualTreeHelper.cs b/Src/Noesis/Core/Src/Proxies/VisualTreeHelper.cs index f1539b0..81ba108 100644 --- a/Src/Noesis/Core/Src/Proxies/VisualTreeHelper.cs +++ b/Src/Noesis/Core/Src/Proxies/VisualTreeHelper.cs @@ -53,10 +53,25 @@ public static void HitTest(Visual reference, HitTestFilterCallback filterCallbac HitTestCallbackHelper(reference, pointParams.HitPoint, callbacksId, _hitTestFilter, _hitTestResult); _hitTestCallbacks.Remove(callbacksId); } + + public static HitTest3DResult HitTest3D(Visual reference, Point3D point, Vector3D direction) { + if (reference == null) throw new ArgumentNullException("reference"); + return HitTest3DHelper(reference, point, new Point3D(direction.X, direction.Y, direction.Z)); + } + + public static void HitTest3D(Visual reference, Point3D point, Vector3D direction, HitTestFilterCallback filterCallback, HitTest3DResultCallback resultCallback) { + if (reference == null) throw new ArgumentNullException("reference"); + HitTest3DCallbackInfo info = new HitTest3DCallbackInfo { Filter = filterCallback, Result = resultCallback }; + int callbacksId = info.GetHashCode(); + _hitTest3DCallbacks[callbacksId] = info; + HitTest3DCallbackHelper(reference, point, direction, callbacksId, _hitTest3DFilter, _hitTest3DResult); + _hitTest3DCallbacks.Remove(callbacksId); + } #region HitTest callbacks private delegate HitTestFilterBehavior Callback_HitTestFilter(int callbacksId, IntPtr targetPtr); private static Callback_HitTestFilter _hitTestFilter = OnHitTestFilter; + private static Callback_HitTestFilter _hitTest3DFilter = OnHitTest3DFilter; [MonoPInvokeCallback(typeof(Callback_HitTestFilter))] private static HitTestFilterBehavior OnHitTestFilter(int callbacksId, IntPtr targetPtr) { @@ -71,14 +86,28 @@ private static HitTestFilterBehavior OnHitTestFilter(int callbacksId, IntPtr tar } } + [MonoPInvokeCallback(typeof(Callback_HitTestFilter))] + private static HitTestFilterBehavior OnHitTest3DFilter(int callbacksId, IntPtr targetPtr) { + try { + HitTest3DCallbackInfo info = _hitTest3DCallbacks[callbacksId]; + return info.Filter((Visual)Extend.GetProxy(targetPtr, false)); + } + catch (Exception e) + { + Noesis.Error.UnhandledException(e); + return HitTestFilterBehavior.Stop; + } + } + private delegate HitTestResultBehavior Callback_HitTestResult(int callbacksId, IntPtr hitPtr); private static Callback_HitTestResult _hitTestResult = OnHitTestResult; + private static Callback_HitTestResult _hitTest3DResult = OnHitTest3DResult; [MonoPInvokeCallback(typeof(Callback_HitTestResult))] private static HitTestResultBehavior OnHitTestResult(int callbacksId, IntPtr hitPtr) { try { HitTestCallbackInfo info = _hitTestCallbacks[callbacksId]; - return info.Result(new HitTestResult(hitPtr, true)); + return info.Result(new HitTestResult(hitPtr, false)); } catch (Exception e) { @@ -87,19 +116,45 @@ private static HitTestResultBehavior OnHitTestResult(int callbacksId, IntPtr hit } } - private static void HitTestCallbackHelper(Visual reference, Point point, int callbacksId, Callback_HitTestFilter filter, Callback_HitTestResult result) { - VisualTreeHelper_HitTestCallback(Visual.getCPtr(reference), ref point, callbacksId, filter, result); + [MonoPInvokeCallback(typeof(Callback_HitTestResult))] + private static HitTestResultBehavior OnHitTest3DResult(int callbacksId, IntPtr hitPtr) { + try { + HitTest3DCallbackInfo info = _hitTest3DCallbacks[callbacksId]; + return info.Result(new HitTest3DResult(hitPtr, false)); + } + catch (Exception e) + { + Noesis.Error.UnhandledException(e); + return HitTestResultBehavior.Stop; + } } - [DllImport(Library.Name)] - private static extern void VisualTreeHelper_HitTestCallback(HandleRef reference, ref Point point, int callbacksId, Callback_HitTestFilter filter, Callback_HitTestResult result); - private struct HitTestCallbackInfo { public HitTestFilterCallback Filter { get; set; } public HitTestResultCallback Result { get; set; } } + private struct HitTest3DCallbackInfo { + public HitTestFilterCallback Filter { get; set; } + public HitTest3DResultCallback Result { get; set; } + } + private static Dictionary _hitTestCallbacks = new Dictionary(); + private static Dictionary _hitTest3DCallbacks = new Dictionary(); + + private static void HitTestCallbackHelper(Visual reference, Point point, int callbacksId, Callback_HitTestFilter filter, Callback_HitTestResult result) { + VisualTreeHelper_HitTestCallback(Visual.getCPtr(reference), ref point, callbacksId, filter, result); + } + + private static void HitTest3DCallbackHelper(Visual reference, Point3D point, Vector3D direction, int callbacksId, Callback_HitTestFilter filter, Callback_HitTestResult result) { + VisualTreeHelper_HitTest3DCallback(Visual.getCPtr(reference), ref point, ref direction, callbacksId, filter, result); + } + + [DllImport(Library.Name)] + private static extern void VisualTreeHelper_HitTestCallback(HandleRef reference, ref Point point, int callbacksId, Callback_HitTestFilter filter, Callback_HitTestResult result); + + [DllImport(Library.Name)] + private static extern void VisualTreeHelper_HitTest3DCallback(HandleRef reference, ref Point3D point, ref Vector3D direction, int callbacksId, Callback_HitTestFilter filter, Callback_HitTestResult result); #endregion public static Rect GetContentBounds(Visual visual) { @@ -203,6 +258,11 @@ private static HitTestResult HitTestHelper(Visual reference, Point point) { return ret; } + private static HitTest3DResult HitTest3DHelper(Visual reference, Point3D point, Point3D direction) { + HitTest3DResult ret = new HitTest3DResult(NoesisGUI_PINVOKE.VisualTreeHelper_HitTest3DHelper(Visual.getCPtr(reference), ref point, ref direction), true); + return ret; + } + } } diff --git a/Src/Noesis/Extensions/Noesis.GUI.Extensions.csproj b/Src/Noesis/Extensions/Noesis.GUI.Extensions.csproj index e1e7c13..35a26dc 100644 --- a/Src/Noesis/Extensions/Noesis.GUI.Extensions.csproj +++ b/Src/Noesis/Extensions/Noesis.GUI.Extensions.csproj @@ -2,9 +2,9 @@ net45;netcoreapp3.1;net5.0-windows - 3.0.11 - 3.0.11.11185 - 3.0.11.11185 + 3.0.19 + 3.0.19.12270 + 3.0.19.12270 Noesis Technologies Extends Blend with new attached properties and types that expose features included in NoesisGUI. Copyright (c) 2013 Noesis Technologies S.L. diff --git a/Src/Noesis/Extensions/Src/InteractivityBehaviors.cs b/Src/Noesis/Extensions/Src/InteractivityBehaviors.cs index 2f25ca9..a9f8008 100644 --- a/Src/Noesis/Extensions/Src/InteractivityBehaviors.cs +++ b/Src/Noesis/Extensions/Src/InteractivityBehaviors.cs @@ -7,6 +7,13 @@ using System.Collections; using System.Collections.ObjectModel; using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Markup; +using System.Windows.Media; +using System.Windows.Media.Effects; +using System.Windows.Shapes; using Microsoft.Xaml.Behaviors; namespace NoesisGUIExtensions @@ -112,4 +119,205 @@ public SortedCollection SortedItems private static readonly DependencyProperty SortedItemsProperty = SortedItemsPropertyKey.DependencyProperty; } #endregion + + #region Background Effect Behavior + /// + /// Applies an effect to the contents beneath the associated object. + /// + /// This behavior can be attached to a Panel, Border or Shape element to fill its background with + /// the contents of the specified source element that are just beneath, and post-processed with the + /// desired effect. + /// + /// It is normally used to blur the background that is just below a panel. + /// + /// Usage: + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + [ContentProperty("Effect")] + public class BackgroundEffectBehavior : Behavior + { + #region Source property + public UIElement Source + { + get { return (UIElement)GetValue(SourceProperty); } + set { SetValue(SourceProperty, value); } + } + + public static readonly DependencyProperty SourceProperty = DependencyProperty.Register( + "Source", typeof(UIElement), typeof(BackgroundEffectBehavior), new PropertyMetadata(null)); + #endregion + + #region Effect property + public Effect Effect + { + get { return (Effect)GetValue(EffectProperty); } + set { SetValue(EffectProperty, value); } + } + + public static readonly DependencyProperty EffectProperty = DependencyProperty.Register( + "Effect", typeof(Effect), typeof(BackgroundEffectBehavior), new PropertyMetadata(null)); + #endregion + + #region Behavior methods + protected override void OnAttached() + { + AssociatedObject.Loaded += OnElementLoaded; + AssociatedObject.Unloaded += OnElementUnloaded; + AssociatedObject.LayoutUpdated += OnElementUpdated; + } + + protected override void OnDetaching() + { + AssociatedObject.Loaded -= OnElementLoaded; + AssociatedObject.Unloaded -= OnElementUnloaded; + AssociatedObject.LayoutUpdated -= OnElementUpdated; + } + + private void OnElementLoaded(object sender, RoutedEventArgs e) + { + DependencyProperty targetProperty = null; + if (AssociatedObject is Border) + { + targetProperty = Border.BackgroundProperty; + } + else if (AssociatedObject is Panel) + { + targetProperty = Panel.BackgroundProperty; + } + else if (AssociatedObject is Shape) + { + targetProperty = Shape.FillProperty; + } + + if (targetProperty != null) + { + VisualBrush brush = new VisualBrush(); + AssociatedObject.SetValue(targetProperty, brush); + + _adorner = new EffectAdorner(AssociatedObject, this, brush); + + AdornerLayer adorners = AdornerLayer.GetAdornerLayer(AssociatedObject); + adorners.Add(_adorner); + } + } + + private void OnElementUnloaded(object sender, RoutedEventArgs e) + { + if (_adorner != null) + { + AdornerLayer adorners = AdornerLayer.GetAdornerLayer(AssociatedObject); + adorners.Remove(_adorner); + + _adorner = null; + } + } + + private void OnElementUpdated(object sender, EventArgs e) + { + if (_adorner != null) + { + AdornerLayer adorners = AdornerLayer.GetAdornerLayer(AssociatedObject); + adorners.Update(AssociatedObject); + } + } + + private EffectAdorner _adorner; + #endregion + + #region Adorner + private class EffectAdorner : Adorner + { + public EffectAdorner(FrameworkElement adornedElement, BackgroundEffectBehavior behavior, + VisualBrush targetBrush) : base(adornedElement) + { + _targetBrush = targetBrush; + _desiredTransform = new MatrixTransform(); + + VisualBrush brush = new VisualBrush { ViewboxUnits = BrushMappingMode.Absolute }; + BindingOperations.SetBinding(brush, VisualBrush.VisualProperty, + new Binding("Source") { Source = behavior }); + + Border border = new Border { Background = brush }; + BindingOperations.SetBinding(border, UIElement.EffectProperty, + new Binding("Effect") { Source = behavior }); + + _child = border; + AddVisualChild(_child); + + _targetBrush.Visual = border; + _targetBrush.ViewboxUnits = BrushMappingMode.Absolute; + + Opacity = 0.0f; + IsHitTestVisible = false; + } + + protected override int VisualChildrenCount + { + get => 1; + } + + protected override Visual GetVisualChild(int index) + { + return _child; + } + + protected override Size MeasureOverride(Size constraint) + { + UIElement adornedElement = AdornedElement; + Size adornedSize = adornedElement.RenderSize; + Size finalSize = adornedSize; + + VisualBrush sourceBrush = (VisualBrush)_child.Background; + Visual source = sourceBrush.Visual; + if (source != null) + { + GeneralTransform mtx = adornedElement.TransformToVisual(source); + Point offset = mtx.Transform(new Point(0, 0)); + Rect bounds = mtx.TransformBounds(new Rect(adornedSize)); + finalSize.Width = bounds.Width; + finalSize.Height = bounds.Height; + + sourceBrush.Viewbox = new Rect(offset, finalSize); + _targetBrush.Viewbox = new Rect(finalSize); + } + + _child.Measure(finalSize); + return finalSize; + } + + protected override Size ArrangeOverride(Size finalSize) + { + finalSize = DesiredSize; + _child.Arrange(new Rect(finalSize)); + return finalSize; + } + + public override GeneralTransform GetDesiredTransform(GeneralTransform transform) + { + Point offset = transform.Transform(new Point(0, 0)); + _desiredTransform.Matrix = new Matrix(1.0f, 0.0f, 0.0f, 1.0f, offset.X, offset.Y); + return _desiredTransform; + } + + private Border _child; + private VisualBrush _targetBrush; + private MatrixTransform _desiredTransform; + } + #endregion + } + #endregion } diff --git a/Src/Noesis/Extensions/Src/RichText.cs b/Src/Noesis/Extensions/Src/RichText.cs index 054dbf6..d920b7f 100644 --- a/Src/Noesis/Extensions/Src/RichText.cs +++ b/Src/Noesis/Extensions/Src/RichText.cs @@ -14,67 +14,93 @@ namespace NoesisGUIExtensions /// Adds a *Text* attached property for TextBlock which formats /// BBCode into Inlines. /// - /// Default supported BBCode tags, with their Inline output: - /// - /// * *b*: Bold - /// - /// * *i*: Italic - /// - /// * *u*: Underline - /// - /// * *size*: Span with FontSize set to the parameter value - /// - /// * *font*: Span with FontFamily set to the parameter value - /// - /// * *color*: Span with Foreground set to the parameter value - /// - /// * *style*: Span with the Style property set to the resource key provided by the parameter value - /// - /// * *img*: Image contained in an InlineUIContainer - /// - /// * *bind*: Run containing a Binding with the Path property set to the tag contents. This tag - /// has an optional "format" parameter which can be used to modify the StringFormat property - /// of the Binding. - /// - /// - /// Usage: - /// - /// - /// - /// - /// - /// /// Usage: - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// Usage: - /// - /// - /// - /// - /// - /// - /// - /// + /// + /// + /// + /// + /// + /// + /// Default supported BBCode tags, with their Inline output: + /// + /// * *b*: Bold, + /// `"[b]bold.[/b]"` + /// + /// + /// * *i*: Italic, + /// `"[i]italic.[/i]"` + /// + /// + /// * *u*: Underline, + /// `"[u]underline.[/u]"` + /// + /// + /// * *size*: Span with FontSize set to the parameter value, + /// `"[size=60]size 60 text.[/size]"` + /// + /// + /// * *font*: Span with FontFamily set to the parameter value, + /// `"[font='#PT Root UI']PT Root UI font.[/]"` + /// + /// + /// * *color*: Span with Foreground set to the parameter value (a color name, or ARBG hex), + /// `"[color=Red]red.[/color][color=#FF0000FF]blue.[/color]"` + /// + /// + /// * *url*: Hyperlink with NavigateUri set to the parameter value, + /// `"[url='https://www.noesisengine.com/']NoesisEngine.com[/url]"` + /// + /// + /// * *br*: A LineBreak, + /// `"Line one.[br/]Line two."` + /// + /// + /// * *img*: Image contained in an InlineUIContainer, + /// `"[img height=80]disk.png[/img]"` + /// + /// + /// * *style*: Span with the Style property set to the resource key provided by the parameter value, + /// `"[style='Header1']Styled text.[/style]"` + /// + /// + /// Usage: + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// * *bind*: Run containing a Binding with the Path property set to the tag contents. This tag + /// has an optional "format" parameter which can be used to modify the StringFormat property + /// of the Binding, + /// `"[bind format='{0:0}']Path[/bind]"` + /// + /// + /// Usage: + /// + /// + /// + /// + /// + /// + /// + /// /// public static class RichText { diff --git a/Src/Noesis/Extensions/Src/Rive.cs b/Src/Noesis/Extensions/Src/Rive.cs new file mode 100644 index 0000000..a758f73 --- /dev/null +++ b/Src/Noesis/Extensions/Src/Rive.cs @@ -0,0 +1,125 @@ +using System; +using System.Windows; +using System.Windows.Markup; +using System.Windows.Media; +using System.Windows.Media.Animation; +using Microsoft.Xaml.Behaviors; + +namespace NoesisGUIExtensions +{ + /// + /// Renders a Rive scene. + /// + /// The scene can contain inputs (bool and float) to control the state machine and animations. + /// + /// Usage: + /// + /// + /// + /// + /// + /// + [ContentProperty("Inputs")] + public class RiveControl : FrameworkElement + { + #region Source property + public static Uri GetSource(DependencyObject element) + { + if (element == null) throw new ArgumentNullException("element"); + return (Uri)element.GetValue(SourceProperty); + } + public static void SetSource(DependencyObject element, Uri value) + { + if (element == null) throw new ArgumentNullException("element"); + element.SetValue(SourceProperty, value); + } + + public Uri Source + { + get { return (Uri)GetValue(SourceProperty); } + set { SetValue(SourceProperty, value); } + } + + public static readonly DependencyProperty SourceProperty = DependencyProperty.RegisterAttached( + "Source", typeof(Uri), typeof(RiveControl), new PropertyMetadata(null)); + #endregion + + #region Stretch property + public Stretch Stretch + { + get { return (Stretch)GetValue(StretchProperty); } + set { SetValue(StretchProperty, value); } + } + + public static readonly DependencyProperty StretchProperty = DependencyProperty.Register( + "Stretch", typeof(Stretch), typeof(RiveControl), new PropertyMetadata(null)); + #endregion + + #region State property + public string State { get; private set; } + #endregion + + #region Inputs property + public RiveInputCollection Inputs { get; } = new RiveInputCollection(); + #endregion + + protected override void OnRender(DrawingContext context) + { + SolidColorBrush brush = Brushes.CornflowerBlue.Clone(); + brush.Opacity = 0.8; + context.DrawRectangle(brush, null, new Rect(RenderSize)); + } + } + + public class RiveInput : Animatable + { + #region InputName property + public string InputName + { + get { return (string)GetValue(InputNameProperty); } + set { SetValue(InputNameProperty, value); } + } + + public static readonly DependencyProperty InputNameProperty = DependencyProperty.Register( + "InputName", typeof(string), typeof(RiveInput), new PropertyMetadata(string.Empty)); + #endregion + + #region InputValue property + public object InputValue + { + get { return (object)GetValue(InputValueProperty); } + set { SetValue(InputValueProperty, value); } + } + + public static readonly DependencyProperty InputValueProperty = DependencyProperty.Register( + "InputValue", typeof(object), typeof(RiveInput), new PropertyMetadata(null)); + #endregion + + protected override Freezable CreateInstanceCore() + { + return new RiveInput(); + } + } + + public class RiveInputCollection : FreezableCollection + { + } + + public class RiveTriggerAction : TargetedTriggerAction + { + #region TriggerName property + public string TriggerName + { + get { return (string)GetValue(TriggerNameProperty); } + set { SetValue(TriggerNameProperty, value); } + } + + public static readonly DependencyProperty TriggerNameProperty = DependencyProperty.Register( + "TriggerName", typeof(string), typeof(RiveTriggerAction), new PropertyMetadata(string.Empty)); + #endregion + + protected override void Invoke(object parameter) + { + } + } +} diff --git a/Src/Noesis/Extensions/Src/Text.cs b/Src/Noesis/Extensions/Src/Text.cs index 4eb0e63..3f41174 100644 --- a/Src/Noesis/Extensions/Src/Text.cs +++ b/Src/Noesis/Extensions/Src/Text.cs @@ -162,5 +162,37 @@ public static uint GetPasswordLength(PasswordBox element) } #endregion + + /// + /// Specifies the duration in milliseconds that the last character typed in a PasswordBox + /// remains visible before it is converted into the corresponding *PasswordChar* + /// + /// Usage: + /// + /// + /// + /// + /// + /// + #region ShowLastCharacterDuration attached property + + public static readonly DependencyProperty ShowLastCharacterDurationProperty = + DependencyProperty.RegisterAttached("ShowLastCharacterDuration", typeof(int), typeof(Text), + new PropertyMetadata(0)); + + public static int GetShowLastCharacterDuration(DependencyObject obj) + { + return (int)obj.GetValue(ShowLastCharacterDurationProperty); + } + + public static void SetShowLastCharacterDuration(DependencyObject obj, int value) + { + obj.SetValue(ShowLastCharacterDurationProperty, value); + } + + #endregion } } diff --git a/Src/Noesis/Extensions/Src/Unreal.cs b/Src/Noesis/Extensions/Src/Unreal.cs index 4e298fd..f48f923 100644 --- a/Src/Noesis/Extensions/Src/Unreal.cs +++ b/Src/Noesis/Extensions/Src/Unreal.cs @@ -4,8 +4,12 @@ //////////////////////////////////////////////////////////////////////////////////////////////////// using System; +using System.Collections.ObjectModel; +using System.Reflection; using System.Windows; using System.Windows.Markup; +using System.Windows.Media; +using System.Windows.Media.Imaging; using Microsoft.Xaml.Behaviors; namespace NoesisGUIExtensions @@ -144,7 +148,7 @@ public enum InputActionType /// /// /// - /// + /// /// public class InputActionTrigger : TriggerBase { @@ -184,4 +188,37 @@ public bool Consume public static readonly DependencyProperty ConsumeProperty = DependencyProperty.Register( "Consume", typeof(bool), typeof(InputActionTrigger), new PropertyMetadata(false)); } + + /// + /// Image source that captures backbuffer of the Unreal 3D scene + /// + /// Usage: + /// + /// + /// + /// + /// + /// + /// + /// + /// + public class BackgroundImage : BitmapFrame + { + public BackgroundImage() + { + typeof(BitmapSource).GetField("_useVirtuals", + BindingFlags.Instance | BindingFlags.NonPublic).SetValue(this, true); + } + + public override Uri BaseUri { get; set; } + public override BitmapSource Thumbnail => null; + public override BitmapDecoder Decoder => null; + public override ReadOnlyCollection ColorContexts => null; + public override InPlaceBitmapMetadataWriter CreateInPlaceBitmapMetadataWriter() { return null; } + protected override Freezable CreateInstanceCore() { return new BackgroundImage(); } + } } diff --git a/Src/NoesisApp/Core/Src/Interactivity/AttachableCollection.cs b/Src/NoesisApp/Core/Src/Interactivity/AttachableCollection.cs index 4481526..a3d0894 100644 --- a/Src/NoesisApp/Core/Src/Interactivity/AttachableCollection.cs +++ b/Src/NoesisApp/Core/Src/Interactivity/AttachableCollection.cs @@ -55,7 +55,7 @@ public void Attach(DependencyObject associatedObject) public void Detach() { - if (AssociatedObject != null) + if (_associatedObject != IntPtr.Zero) { OnDetaching(); diff --git a/Src/NoesisApp/Core/Src/Interactivity/AttachableObject.cs b/Src/NoesisApp/Core/Src/Interactivity/AttachableObject.cs index 065376a..7b2b285 100644 --- a/Src/NoesisApp/Core/Src/Interactivity/AttachableObject.cs +++ b/Src/NoesisApp/Core/Src/Interactivity/AttachableObject.cs @@ -53,14 +53,10 @@ public void Attach(DependencyObject associatedObject) associatedObject.GetType(), GetType())); } + associatedObject.Destroyed += OnAssociatedObjectDestroyed; _associatedObject = GetPtr(associatedObject); _view = GetPtr(View.Find(this)); - BindingOperations.SetBinding(this, AttachmentProperty, new Binding("Visibility") - { - RelativeSource = new RelativeSource { AncestorType = typeof(UIElement) } - }); - InitObject(); OnAttached(); @@ -69,7 +65,7 @@ public void Attach(DependencyObject associatedObject) public void Detach() { - if (AssociatedObject != null) + if (_associatedObject != IntPtr.Zero) { OnDetaching(); @@ -100,19 +96,9 @@ public View View get { return (View)GetProxy(_view); } } - // We use a binding to get notified when the associated object is disconnected from the tree - // and is going to be destroyed, so we can properly detach from it - private static readonly DependencyProperty AttachmentProperty = DependencyProperty.Register( - ".Attachment", typeof(Visibility), typeof(AttachableObject), - new PropertyMetadata(Detached, OnAttachmentChanged)); - - private static void OnAttachmentChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) + private void OnAssociatedObjectDestroyed(IntPtr d) { - if ((Visibility)e.NewValue == Detached) - { - AttachableObject attachable = (AttachableObject)d; - attachable.Detach(); - } + Detach(); } private const Visibility Detached = (Visibility)(-1); diff --git a/Src/NoesisApp/Core/Src/Interactivity/BackgroundEffectBehavior.cs b/Src/NoesisApp/Core/Src/Interactivity/BackgroundEffectBehavior.cs new file mode 100644 index 0000000..b172d0c --- /dev/null +++ b/Src/NoesisApp/Core/Src/Interactivity/BackgroundEffectBehavior.cs @@ -0,0 +1,223 @@ +using Noesis; +using NoesisApp; + +namespace NoesisGUIExtensions +{ + /// + /// Applies an effect to the contents beneath the associated object. + /// + /// This behavior can be attached to a Panel, Border or Shape element to fill its background with + /// the contents of the specified source element that are just beneath, and post-processed with the + /// desired effect. + /// + /// It is normally used to blur the background that is just below a panel. + /// + /// Usage: + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + [ContentProperty("Effect")] + public class BackgroundEffectBehavior : Behavior + { + #region Source property + public UIElement Source + { + get { return (UIElement)GetValue(SourceProperty); } + set { SetValue(SourceProperty, value); } + } + + public static readonly DependencyProperty SourceProperty = DependencyProperty.Register( + "Source", typeof(UIElement), typeof(BackgroundEffectBehavior), new PropertyMetadata(null)); + #endregion + + #region Effect property + public Effect Effect + { + get { return (Effect)GetValue(EffectProperty); } + set { SetValue(EffectProperty, value); } + } + + public static readonly DependencyProperty EffectProperty = DependencyProperty.Register( + "Effect", typeof(Effect), typeof(BackgroundEffectBehavior), new PropertyMetadata(null)); + #endregion + + #region Behavior methods + protected override void OnAttached() + { + FrameworkElement element = AssociatedObject; + if (element != null) + { + element.Loaded += OnElementLoaded; + element.Unloaded += OnElementUnloaded; + element.LayoutUpdated += OnElementUpdated; + } + } + + protected override void OnDetaching() + { + FrameworkElement element = AssociatedObject; + if (element != null) + { + element.Loaded -= OnElementLoaded; + element.Unloaded -= OnElementUnloaded; + element.LayoutUpdated -= OnElementUpdated; + } + } + + private void OnElementLoaded(object sender, RoutedEventArgs e) + { + FrameworkElement element = AssociatedObject; + DependencyProperty targetProperty = null; + if (element is Border) + { + targetProperty = Border.BackgroundProperty; + } + else if (element is Panel) + { + targetProperty = Panel.BackgroundProperty; + } + else if (element is Shape) + { + targetProperty = Shape.FillProperty; + } + + if (targetProperty != null) + { + VisualBrush brush = new VisualBrush(); + element.SetValue(targetProperty, brush); + + _adorner = new EffectAdorner(element, this, brush); + + AdornerLayer adorners = AdornerLayer.GetAdornerLayer(element); + adorners.Add(_adorner); + } + } + + private void OnElementUnloaded(object sender, RoutedEventArgs e) + { + if (_adorner != null) + { + AdornerLayer adorners = AdornerLayer.GetAdornerLayer(AssociatedObject); + adorners.Remove(_adorner); + + _adorner = null; + } + } + + private void OnElementUpdated(object sender, EventArgs e) + { + if (_adorner != null) + { + AdornerLayer adorners = AdornerLayer.GetAdornerLayer(AssociatedObject); + adorners.Update(AssociatedObject); + } + } + + private EffectAdorner _adorner; + #endregion + + #region Adorner + private class EffectAdorner : Adorner + { + public EffectAdorner(FrameworkElement adornedElement, BackgroundEffectBehavior behavior, + VisualBrush targetBrush) : base(adornedElement) + { + _targetBrush = targetBrush; + + VisualBrush brush = new VisualBrush { ViewboxUnits = BrushMappingMode.Absolute }; + BindingOperations.SetBinding(brush, VisualBrush.VisualProperty, + new Binding("Source") { Source = behavior }); + + Border border = new Border { Background = brush }; + BindingOperations.SetBinding(border, UIElement.EffectProperty, + new Binding("Effect") { Source = behavior }); + + _child = border; + AddVisualChild(_child); + + _targetBrush.Visual = border; + _targetBrush.ViewboxUnits = BrushMappingMode.Absolute; + + Opacity = 0.0f; + IsHitTestVisible = false; + } + +#if UNITY_5_3_OR_NEWER + internal +#endif + protected override int VisualChildrenCount + { + get => 1; + } + +#if UNITY_5_3_OR_NEWER + internal +#endif + protected override Visual GetVisualChild(int index) + { + return _child; + } + +#if UNITY_5_3_OR_NEWER + internal +#endif + protected override Size MeasureOverride(Size constraint) + { + UIElement adornedElement = AdornedElement; + Size adornedSize = adornedElement.RenderSize; + Size finalSize = adornedSize; + + VisualBrush sourceBrush = (VisualBrush)_child.Background; + Visual source = sourceBrush.Visual; + if (source != null) + { + Matrix4 mtx = adornedElement.TransformToVisual(source); + Point offset = mtx[3].XY + new Point(-1.5f, 1.5f); + Rect bounds = mtx.TransformBounds(new Rect(adornedSize)); + finalSize.Width = bounds.Width; + finalSize.Height = bounds.Height; + + sourceBrush.Viewbox = new Rect(offset, finalSize); + _targetBrush.Viewbox = new Rect(finalSize); + } + + _child.Measure(finalSize); + return finalSize; + } + +#if UNITY_5_3_OR_NEWER + internal +#endif + protected override Size ArrangeOverride(Size finalSize) + { + finalSize = DesiredSize; + _child.Arrange(new Rect(finalSize)); + return finalSize; + } + + public override Matrix4 GetDesiredTransform(Matrix4 transform) + { + Matrix4 t = Matrix4.Identity; + t[3] = new Vector4(transform[3].XY, 0.0f, 1.0f); + return t; + } + + private Border _child; + private VisualBrush _targetBrush; + } + #endregion + } +} diff --git a/Src/NoesisApp/Core/Src/Interactivity/ConditionBehavior.cs b/Src/NoesisApp/Core/Src/Interactivity/ConditionBehavior.cs index 4f9441e..0a7d646 100644 --- a/Src/NoesisApp/Core/Src/Interactivity/ConditionBehavior.cs +++ b/Src/NoesisApp/Core/Src/Interactivity/ConditionBehavior.cs @@ -30,12 +30,20 @@ public ICondition Condition protected override void OnAttached() { - AssociatedObject.PreviewInvoke += OnPreviewInvoke; + TriggerBase trigger = AssociatedObject; + if (trigger != null) + { + trigger.PreviewInvoke += OnPreviewInvoke; + } } protected override void OnDetaching() { - AssociatedObject.PreviewInvoke -= OnPreviewInvoke; + TriggerBase trigger = AssociatedObject; + if (trigger != null) + { + trigger.PreviewInvoke -= OnPreviewInvoke; + } } private void OnPreviewInvoke(object sender, PreviewInvokeEventArgs e) diff --git a/Src/NoesisApp/Core/Src/Interactivity/MouseDragElementBehavior.cs b/Src/NoesisApp/Core/Src/Interactivity/MouseDragElementBehavior.cs index 76eb241..4dae34e 100644 --- a/Src/NoesisApp/Core/Src/Interactivity/MouseDragElementBehavior.cs +++ b/Src/NoesisApp/Core/Src/Interactivity/MouseDragElementBehavior.cs @@ -104,11 +104,14 @@ protected override void OnAttached() protected override void OnDetaching() { - FrameworkElement associatedObject = AssociatedObject; - _transform = null; - associatedObject.RenderTransform = null; - associatedObject.MouseLeftButtonDown -= OnMouseLeftButtonDown; + + FrameworkElement associatedObject = AssociatedObject; + if (associatedObject != null) + { + associatedObject.RenderTransform = null; + associatedObject.MouseLeftButtonDown -= OnMouseLeftButtonDown; + } } private void OnMouseLeftButtonDown(object sender, MouseEventArgs e) diff --git a/Src/NoesisApp/Core/Src/Interactivity/RiveTriggerAction.cs b/Src/NoesisApp/Core/Src/Interactivity/RiveTriggerAction.cs new file mode 100644 index 0000000..f0de0f2 --- /dev/null +++ b/Src/NoesisApp/Core/Src/Interactivity/RiveTriggerAction.cs @@ -0,0 +1,42 @@ +using System; + +namespace NoesisGUIExtensions +{ + /// + /// An action that will fire a trigger in a RiveControl. + /// + public class RiveTriggerAction : NoesisApp.TargetedTriggerAction + { + /// + /// Gets or sets the name of the trigger in the Rive scene + /// + public string TriggerName + { + get { return (string)GetValue(TriggerNameProperty); } + set { SetValue(TriggerNameProperty, value); } + } + + public static readonly Noesis.DependencyProperty TriggerNameProperty = Noesis.DependencyProperty.Register( + "TriggerName", typeof(string), typeof(RiveTriggerAction), + new Noesis.PropertyMetadata(string.Empty)); + + public new RiveTriggerAction Clone() + { + return (RiveTriggerAction)base.Clone(); + } + + public new RiveTriggerAction CloneCurrentValue() + { + return (RiveTriggerAction)base.CloneCurrentValue(); + } + + protected override void Invoke(object parameter) + { + Noesis.RiveControl rive = Target; + if (rive != null) + { + rive.FireInputTrigger(TriggerName); + } + } + } +} diff --git a/Src/NoesisApp/Core/Src/Interactivity/TranslateZoomRotateBehavior.cs b/Src/NoesisApp/Core/Src/Interactivity/TranslateZoomRotateBehavior.cs index 70cfef2..32c3f7d 100644 --- a/Src/NoesisApp/Core/Src/Interactivity/TranslateZoomRotateBehavior.cs +++ b/Src/NoesisApp/Core/Src/Interactivity/TranslateZoomRotateBehavior.cs @@ -136,21 +136,24 @@ protected override void OnAttached() protected override void OnDetaching() { - FrameworkElement associatedObject = AssociatedObject; - _scale = null; _rotate = null; _translate = null; - associatedObject.RenderTransform = null; - associatedObject.RenderTransformOrigin = new Point(0.0f, 0.0f); - - associatedObject.IsManipulationEnabled = false; - associatedObject.ManipulationStarting -= OnManipulationStarting; - associatedObject.ManipulationInertiaStarting -= OnManipulationInertia; - associatedObject.ManipulationDelta -= OnManipulationDelta; - associatedObject.MouseLeftButtonDown -= OnMouseDown; - associatedObject.MouseLeftButtonUp -= OnMouseUp; - associatedObject.MouseWheel -= OnMouseWheel; + + FrameworkElement associatedObject = AssociatedObject; + if (associatedObject != null) + { + associatedObject.RenderTransform = null; + associatedObject.RenderTransformOrigin = new Point(0.0f, 0.0f); + + associatedObject.IsManipulationEnabled = false; + associatedObject.ManipulationStarting -= OnManipulationStarting; + associatedObject.ManipulationInertiaStarting -= OnManipulationInertia; + associatedObject.ManipulationDelta -= OnManipulationDelta; + associatedObject.MouseLeftButtonDown -= OnMouseDown; + associatedObject.MouseLeftButtonUp -= OnMouseUp; + associatedObject.MouseWheel -= OnMouseWheel; + } } private void OnManipulationStarting(object sender, ManipulationStartingEventArgs e) diff --git a/Src/NoesisApp/Core/Src/Localization/RichText.cs b/Src/NoesisApp/Core/Src/Localization/RichText.cs index 78155eb..e09b995 100644 --- a/Src/NoesisApp/Core/Src/Localization/RichText.cs +++ b/Src/NoesisApp/Core/Src/Localization/RichText.cs @@ -9,68 +9,94 @@ namespace NoesisGUIExtensions /// Adds a *Text* attached property for TextBlock which formats /// BBCode into Inlines. /// - /// Default supported BBCode tags, with their Inline output: - /// - /// * *b*: Bold - /// - /// * *i*: Italic - /// - /// * *u*: Underline - /// - /// * *size*: Span with FontSize set to the parameter value - /// - /// * *font*: Span with FontFamily set to the parameter value - /// - /// * *color*: Span with Foreground set to the parameter value - /// - /// * *style*: Span with the Style property set to the resource key provided by the parameter value - /// - /// * *img*: Image contained in an InlineUIContainer - /// - /// * *bind*: Run containing a Binding with the Path property set to the tag contents. This tag - /// has an optional "format" parameter which can be used to modify the StringFormat property - /// of the Binding. - /// - /// - /// Usage: - /// - /// - /// - /// - /// - /// /// Usage: - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// Usage: - /// - /// - /// - /// - /// - /// - /// - /// - /// + /// + /// + /// + /// + /// + /// + /// Default supported BBCode tags, with their Inline output: + /// + /// * *b*: Bold, + /// `"[b]bold.[/b]"` + /// + /// + /// * *i*: Italic, + /// `"[i]italic.[/i]"` + /// + /// + /// * *u*: Underline, + /// `"[u]underline.[/u]"` + /// + /// + /// * *size*: Span with FontSize set to the parameter value, + /// `"[size=60]size 60 text.[/size]"` + /// + /// + /// * *font*: Span with FontFamily set to the parameter value, + /// `"[font='#PT Root UI']PT Root UI font.[/]"` + /// + /// + /// * *color*: Span with Foreground set to the parameter value (a color name, or ARBG hex), + /// `"[color=Red]red.[/color][color=#FF0000FF]blue.[/color]"` + /// + /// + /// * *url*: Hyperlink with NavigateUri set to the parameter value, + /// `"[url='https://www.noesisengine.com/']NoesisEngine.com[/url]"` + /// + /// + /// * *br*: A LineBreak, + /// `"Line one.[br/]Line two."` + /// + /// + /// * *img*: Image contained in an InlineUIContainer, + /// `"[img height=80]disk.png[/img]"` + /// + /// + /// * *style*: Span with the Style property set to the resource key provided by the parameter value, + /// `"[style='Header1']Styled text.[/style]"` + /// + /// + /// Usage: + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// * *bind*: Run containing a Binding with the Path property set to the tag contents. This tag + /// has an optional "format" parameter which can be used to modify the StringFormat property + /// of the Binding, + /// `"[bind format='{0:0}']Path[/bind]"` + /// + /// + /// Usage: + /// + /// + /// + /// + /// + /// + /// + /// + /// public static class RichText { /// @@ -101,9 +127,8 @@ private static void PropertyChangedCallback(DependencyObject obj, { InlineCollection collection = textBlock.Inlines; collection.Clear(); - - string newValue = (string)args.NewValue; - TryParse(newValue.AsSpan(), textBlock, collection, out _); + + TryParse((string)args.NewValue, 0, textBlock, collection, out _); } } @@ -336,47 +361,46 @@ static void TryCreateInlineForTag(string tagName, string content, Console.WriteLine("NOESIS: BBCode tag '%s' is not currently supported", tagName); } - private static void TryParse(ReadOnlySpan input, TextBlock parent, InlineCollection inlineCollection, out ReadOnlySpan output) + private static void TryParse(string input, int current, TextBlock parent, InlineCollection inlineCollection, out int output) { - if (input.Length == 0) + if (input.Length - current == 0) { - output = input; + output = current; return; } - while (input.Length > 0) + while (input.Length - current > 0) { - if (input[0] == '[') + if (input[current] == '[') { - if (input.Length > 1 && input[1] == '/') + if (input.Length - current > 1 && input[current + 1] == '/') { - output = input.Slice(1); + output = current + 1; return; } - ParseTag(input, parent, inlineCollection, out input); + ParseTag(input, current, parent, inlineCollection, out current); } else { - ParseText(input, inlineCollection, out input); + ParseText(input, current, inlineCollection, out current); } } - output = input; + output = current; } - private static void ParseText(in ReadOnlySpan input, InlineCollection inlineCollection, out ReadOnlySpan output) + private static void ParseText(string input, int begin, InlineCollection inlineCollection, out int output) { StringBuilder stringBuilder = new StringBuilder(); - - int begin = 0; - int current = 0; + + int current = begin; for (; current < input.Length; current++) { if (input[current] == '\\') { if (current - 1 > begin) { - stringBuilder.Append(input.Slice(begin, current - begin).ToString()); + stringBuilder.Append(input.Substring(begin, current - begin)); } ++current; begin = current; @@ -384,7 +408,7 @@ private static void ParseText(in ReadOnlySpan input, InlineCollection inli else if (input[current] == ']') { Console.WriteLine("NOESIS: BBCode contains a malformed closing bracket"); - output = ReadOnlySpan.Empty; + output = input.Length; return; } else if (input[current] == '[') @@ -395,20 +419,19 @@ private static void ParseText(in ReadOnlySpan input, InlineCollection inli if (current != begin) { - stringBuilder.Append(input.Slice(begin, current - begin).ToString()); + stringBuilder.Append(input.Substring(begin, current - begin)); } inlineCollection.Add(new Run(stringBuilder.ToString())); - output = input.Slice(current); + output = current; } - private static bool TryParseContent(in ReadOnlySpan input, out string content, out ReadOnlySpan output) + private static bool TryParseContent(string input, int begin, out string content, out int output) { StringBuilder stringBuilder = new StringBuilder(); - - int begin = 0; - int current = 0; + + int current = begin; bool useQuotationMarks = false; bool singleQuotes = false; @@ -424,7 +447,7 @@ private static bool TryParseContent(in ReadOnlySpan input, out string cont { if (input[current] == '\\') { - stringBuilder.Append(input.Slice(begin, current - begin).ToString()); + stringBuilder.Append(input.Substring(begin, current - begin)); ++current; begin = current; } @@ -434,17 +457,18 @@ private static bool TryParseContent(in ReadOnlySpan input, out string cont { if (current - 1 > begin) { - stringBuilder.Append(input.Slice(begin, current - begin).ToString()); + stringBuilder.Append(input.Substring(begin, current - begin)); } content = stringBuilder.ToString(); - output = input.Slice(current + 1); + output = current + 1; return true; } if (input[current] == '[' || input[current] == ']') { Console.WriteLine("NOESIS: BBCode parameter value is missing a closing quotation mark"); content = string.Empty; - output = ReadOnlySpan.Empty; + output = input.Length; + return false; } } else if (input[current] == '[' || input[current] == ']') @@ -455,34 +479,32 @@ private static bool TryParseContent(in ReadOnlySpan input, out string cont if (current != begin) { - stringBuilder.Append(input.Slice(begin, current - begin).ToString()); + stringBuilder.Append(input.Substring(begin, current - begin)); } content = stringBuilder.ToString(); - output = input.Slice(current); + output = current; return true; } - private static void ParseName(in ReadOnlySpan input, out string name, out ReadOnlySpan output) + private static void ParseName(string input, int begin, out string name, out int output) { - int current = 0; - for (; current < input.Length; current++) + for (int current = begin; current < input.Length; current++) { if (!char.IsLetter(input[current])) { - name = input.Slice(0, current).ToString().ToLowerInvariant(); - output = input.Slice(current); + name = input.Substring(begin, current - begin).ToLowerInvariant(); + output = current; return; } } - name = String.Empty; - output = ReadOnlySpan.Empty; ; + name = string.Empty; + output = input.Length; } - private static void ParseKeyValuePair(ReadOnlySpan input, List parameters, out ReadOnlySpan output) + private static void ParseKeyValuePair(string input, int current, List parameters, out int output) { - int current = 0; while (char.IsWhiteSpace(input[current]) && current < input.Length - 1) { ++current; @@ -490,30 +512,30 @@ private static void ParseKeyValuePair(ReadOnlySpan input, List if (current == input.Length - 1 || !char.IsLetter(input[current])) { - output = input.Slice(current); + output = current; return; } - input = input.Slice(current); - ParseName(input, out string key, out input); + ParseName(input, current, out string key, out current); if (key == null) { Console.WriteLine("NOESIS: A parameter for BBCode tag key is malformed"); - output = ReadOnlySpan.Empty; + output = input.Length; return; } - if (input.Length == 0 || input[0] != '=') + if (input.Length - current == 0 || input[current] != '=') { Console.WriteLine("NOESIS: A parameter for BBCode tag key '{0}' is malformed (missing '=')", key); - output = ReadOnlySpan.Empty; + output = input.Length; + return; } - if (!TryParseContent(input.Slice(1), out string value, out output)) + if (!TryParseContent(input, current + 1, out string value, out output)) { Console.WriteLine("NOESIS: A parameter for BBCode tag key '{0}' is malformed", key); - output = ReadOnlySpan.Empty; + output = input.Length; return; } @@ -524,24 +546,25 @@ private static void ParseKeyValuePair(ReadOnlySpan input, List }); } - private static void ParseTag(ReadOnlySpan input, TextBlock parent, InlineCollection inlineCollection, out ReadOnlySpan output) + private static void ParseTag(string input, int current, TextBlock parent, InlineCollection inlineCollection, out int output) { - ParseName(input.Slice(1), out string tagName, out input); + int begin = current; + ParseName(input, current + 1, out string tagName, out current); if (string.IsNullOrEmpty(tagName)) { Console.WriteLine("NOESIS: A BBCode tag is malformed (contains no name)"); - output = ReadOnlySpan.Empty; + output = input.Length; return; } List parameters = new List(); - if (input[0] == '=') + if (input[current] == '=') { - if (!TryParseContent(input.Slice(1), out string value, out input)) + if (!TryParseContent(input, current + 1, out string value, out current)) { - output = ReadOnlySpan.Empty; + output = input.Length; return; } @@ -549,34 +572,39 @@ private static void ParseTag(ReadOnlySpan input, TextBlock parent, InlineC } else { - while (input[0] == ' ') + while (input[current] == ' ') { - ParseKeyValuePair(input, parameters, out input); + ParseKeyValuePair(input, current, parameters, out current); + if (current == input.Length) + { + output = input.Length; + return; + } } } - if (input.Length > 1 && input[0] == '/' && input[1] == ']') + if (input.Length - current > 1 && input[current] == '/' && input[current + 1] == ']') { TryCreateInlineForTag(tagName, "", parameters, inlineCollection); if (input.Length == 2) { - output = ReadOnlySpan.Empty; + output = input.Length; } else { - output = input.Slice(2); + output = current + 2; } return; } - if (input[0] != ']' || input.Length < 5) // 5 allows for the necessary brackets and forward slash for a minimal closing bracket + if (input[current] != ']' || input.Length - current < 5) // 5 allows for the necessary brackets and forward slash for a minimal closing bracket { Console.WriteLine("NOESIS: BBCode tag '{0}' has a malformed closing tag", tagName); - output = ReadOnlySpan.Empty; + output = input.Length; return; } - input = input.Slice(1); + current += 1; InlineCollection newCollection = TryCreateSpanForTag(tagName, parameters, parent, inlineCollection); @@ -584,62 +612,62 @@ private static void ParseTag(ReadOnlySpan input, TextBlock parent, InlineC if (newCollection != null) { inlineCollection = newCollection; - TryParse(input, parent, inlineCollection, out input); + TryParse(input, current, parent, inlineCollection, out current); } else { - if (!TryParseContent(input, out string value, out input)) + if (!TryParseContent(input, current, out string value, out current)) { - output = ReadOnlySpan.Empty; + output = input.Length; return; } - input = input.Slice(1); + current += 1; TryCreateInlineForTag(tagName, value, parameters, inlineCollection); } - if (input.Length < 2) + if (input.Length - current < 2) { Console.WriteLine("NOESIS: BBCode tag '{0}' is missing a closing tag", tagName); - output = input; + output = current; return; } - if (input[0] != '/') + if (input[current] != '/') { Console.WriteLine("NOESIS: BBCode tag '{0}' is missing a closing tag", tagName); - output = ReadOnlySpan.Empty; + output = input.Length; return; } - ParseName(input.Slice(1), out string closingTagName, out input); + ParseName(input, current + 1, out string closingTagName, out current); if (closingTagName != tagName) { Console.WriteLine("NOESIS: BBCode tag opening name '{0}' does not match closing tag name '{0}'", tagName, closingTagName); - output = ReadOnlySpan.Empty; + output = input.Length; return; } - if (input[0] != ']') + if (input[current] != ']') { Console.WriteLine("NOESIS: BBCode tag '{0}' has a malformed closing tag", tagName); - output = ReadOnlySpan.Empty; + output = input.Length; return; } - if (input.Length == 1) + if (input.Length - current == 1) { - output = ReadOnlySpan.Empty; + output = input.Length; } else { - output = input.Slice(1); + output = current + 1; } } - #endregion +#endregion } } diff --git a/Src/NoesisApp/RenderContexts/D3D11/Src/RenderContextD3D11.cs b/Src/NoesisApp/RenderContexts/D3D11/Src/RenderContextD3D11.cs index 3d84039..d65ad0e 100644 --- a/Src/NoesisApp/RenderContexts/D3D11/Src/RenderContextD3D11.cs +++ b/Src/NoesisApp/RenderContexts/D3D11/Src/RenderContextD3D11.cs @@ -103,6 +103,8 @@ public override void SetDefaultRenderTarget(int width, int height, bool doClearC _dev.ImmediateContext.ClearDepthStencilView(_depthStencil, DepthStencilClearFlags.Stencil, 0.0f, 0); _dev.ImmediateContext.OutputMerger.SetRenderTargets(_depthStencil, _renderTarget); _dev.ImmediateContext.Rasterizer.SetViewport(_viewport); + + _device.DisableScissorRect(); } public override ImageCapture CaptureRenderTarget(RenderTarget surface) diff --git a/Src/NoesisApp/RenderContexts/D3D12/Src/RenderContextD3D12.cs b/Src/NoesisApp/RenderContexts/D3D12/Src/RenderContextD3D12.cs index 7ce367b..db7044b 100644 --- a/Src/NoesisApp/RenderContexts/D3D12/Src/RenderContextD3D12.cs +++ b/Src/NoesisApp/RenderContexts/D3D12/Src/RenderContextD3D12.cs @@ -39,6 +39,7 @@ public override RenderDevice Device private const int FrameCount = 2; private SharpDX.Direct3D12.Viewport[] _viewport = new SharpDX.Direct3D12.Viewport[1]; + private SharpDX.Mathematics.Interop.RawRectangle _scissorRect; private SharpDX.Direct3D12.Resource _stencilBuffer; private SharpDX.Direct3D12.Resource[] _backBuffers = new SharpDX.Direct3D12.Resource[FrameCount]; private SharpDX.Direct3D12.Resource[] _backBuffersAA = new SharpDX.Direct3D12.Resource[FrameCount]; @@ -310,6 +311,8 @@ void CreateBuffers() _viewport[0].Height = desc.Height; _viewport[0].MinDepth = 0.0f; _viewport[0].MaxDepth = 1.0f; + + _scissorRect = new SharpDX.Mathematics.Interop.RawRectangle(0, 0, (int)desc.Width, (int)desc.Height); } void CreateCommandList() @@ -380,6 +383,7 @@ public override void SetDefaultRenderTarget(int width, int height, bool doClearC _commands.ClearDepthStencilView(dsv, SharpDX.Direct3D12.ClearFlags.FlagsStencil, 0.0f, 0, 0, null); _commands.SetRenderTargets(1, rtv, dsv); _commands.SetViewports(1, _viewport ); + _commands.SetScissorRectangles(_scissorRect); } public override ImageCapture CaptureRenderTarget(RenderTarget surface) diff --git a/Src/NoesisApp/RenderContexts/EGL/Src/RenderContextEGL.cs b/Src/NoesisApp/RenderContexts/EGL/Src/RenderContextEGL.cs index 1b1648c..fba6878 100644 --- a/Src/NoesisApp/RenderContexts/EGL/Src/RenderContextEGL.cs +++ b/Src/NoesisApp/RenderContexts/EGL/Src/RenderContextEGL.cs @@ -135,6 +135,7 @@ public override void SetDefaultRenderTarget(int width, int height, bool doClearC glBindFramebuffer(GL_FRAMEBUFFER, 0); glViewport(0, 0, width, height); + glDisable(GL_SCISSOR_TEST); glClearStencil(0); uint mask = GL_STENCIL_BUFFER_BIT; @@ -259,6 +260,7 @@ static RenderContextEGL() glClear = AndroidImports.glClear; glColorMask = AndroidImports.glColorMask; glClearColor = AndroidImports.glClearColor; + glDisable = AndroidImports.glDisable; glGetIntegerv = AndroidImports.glGetIntegerv; glPixelStorei = AndroidImports.glPixelStorei; glReadPixels = AndroidImports.glReadPixels; @@ -284,6 +286,7 @@ static RenderContextEGL() glClear = LinuxImports.glClear; glColorMask = LinuxImports.glColorMask; glClearColor = LinuxImports.glClearColor; + glDisable = LinuxImports.glDisable; glGetIntegerv = LinuxImports.glGetIntegerv; glPixelStorei = LinuxImports.glPixelStorei; glReadPixels = LinuxImports.glReadPixels; @@ -331,6 +334,7 @@ static RenderContextEGL() private const uint GL_FRAMEBUFFER = 0x8D40; private const uint GL_STENCIL_BUFFER_BIT = 0x00000400; private const uint GL_COLOR_BUFFER_BIT = 0x00004000; + private const uint GL_SCISSOR_TEST = 0x00000C11; private const uint GL_VIEWPORT = 0x00000BA2; private const uint GL_PACK_ALIGNMENT = 0x00000D05; private const uint GL_UNSIGNED_BYTE = 0x00001401; @@ -355,6 +359,7 @@ static RenderContextEGL() private delegate void GLClearFn(uint s); private delegate void GLColorMaskFn(bool r, bool g, bool b, bool a); private delegate void GLClearColorFn(float r, float g, float b, float a); + private delegate void GLDisableFn(uint cap); private delegate void GLGetIntegervFn(uint pname, int[] param); private delegate void GLPixelStoreiFn(uint pname, int param); private delegate void GLReadPixelsFn(int x, int y, int width, int height, uint format, uint type, byte[] pixels); @@ -378,6 +383,7 @@ static RenderContextEGL() private static GLClearFn glClear; private static GLColorMaskFn glColorMask; private static GLClearColorFn glClearColor; + private static GLDisableFn glDisable; private static GLGetIntegervFn glGetIntegerv; private static GLPixelStoreiFn glPixelStorei; private static GLReadPixelsFn glReadPixels; @@ -441,6 +447,9 @@ private static class AndroidImports [DllImport("libGLESv2.so")] public static extern void glClearColor(float r, float g, float b, float a); + [DllImport("libGLESv2.so")] + public static extern void glDisable(uint cap); + [DllImport("libGLESv2.so")] public static extern void glGetIntegerv(uint pname, int[] param); @@ -511,6 +520,9 @@ private static class LinuxImports [DllImport("libGLESv2.so.2")] public static extern void glClearColor(float r, float g, float b, float a); + [DllImport("libGLESv2.so.2")] + public static extern void glDisable(uint cap); + [DllImport("libGLESv2.so.2")] public static extern void glGetIntegerv(uint pname, int[] param); diff --git a/Src/NoesisApp/RenderContexts/GLX/Src/RenderContextGLX.cs b/Src/NoesisApp/RenderContexts/GLX/Src/RenderContextGLX.cs index 112fc53..5ad52a6 100644 --- a/Src/NoesisApp/RenderContexts/GLX/Src/RenderContextGLX.cs +++ b/Src/NoesisApp/RenderContexts/GLX/Src/RenderContextGLX.cs @@ -175,6 +175,7 @@ public override void SetDefaultRenderTarget(int width, int height, bool doClearC glBindFramebuffer(GL_FRAMEBUFFER, 0); glViewport(0, 0, width, height); + glDisable(GL_SCISSOR_TEST); glClearStencil(0); uint mask = GL_STENCIL_BUFFER_BIT; @@ -314,6 +315,7 @@ public static TDelegate GetProcAddress(string name) where TDelegate : private const uint GL_FRAMEBUFFER = 0x8D40; private const uint GL_STENCIL_BUFFER_BIT = 0x00000400; private const uint GL_COLOR_BUFFER_BIT = 0x00004000; + private const uint GL_SCISSOR_TEST = 0x00000C11; private const uint GL_VIEWPORT = 0x00000BA2; private const uint GL_PACK_ALIGNMENT = 0x00000D05; private const uint GL_UNSIGNED_BYTE = 0x00001401; @@ -337,6 +339,9 @@ public static TDelegate GetProcAddress(string name) where TDelegate : [DllImport("libGL.so.1")] static extern void glClearColor(float r, float g, float b, float a); + [DllImport("libGL.so.1")] + public static extern void glDisable(uint cap); + [DllImport("libGL.so.1")] public static extern void glGetIntegerv(uint pname, int[] param); diff --git a/Src/NoesisApp/RenderContexts/NSGL/Src/RenderContextNSGL.cs b/Src/NoesisApp/RenderContexts/NSGL/Src/RenderContextNSGL.cs index 81526d2..10c6649 100644 --- a/Src/NoesisApp/RenderContexts/NSGL/Src/RenderContextNSGL.cs +++ b/Src/NoesisApp/RenderContexts/NSGL/Src/RenderContextNSGL.cs @@ -83,6 +83,7 @@ public override void SetDefaultRenderTarget(int width, int height, bool doClearC glBindFramebuffer(GL_FRAMEBUFFER, 0); glViewport(0, 0, width, height); + glDisable(GL_SCISSOR_TEST); glClearStencil(0); uint mask = GL_STENCIL_BUFFER_BIT; @@ -151,6 +152,7 @@ public override void Resize() private const uint GL_FRAMEBUFFER = 0x8D40; private const uint GL_STENCIL_BUFFER_BIT = 0x00000400; private const uint GL_COLOR_BUFFER_BIT = 0x00004000; + private const uint GL_SCISSOR_TEST = 0x00000C11; private const uint GL_VIEWPORT = 0x00000BA2; private const uint GL_PACK_ALIGNMENT = 0x00000D05; private const uint GL_UNSIGNED_BYTE = 0x00001401; @@ -176,6 +178,9 @@ public override void Resize() [DllImport(LibraryName)] static extern void glClearColor(float r, float g, float b, float a); + [DllImport(LibraryName)] + public static extern void glDisable(uint cap); + [DllImport(LibraryName)] public static extern void glGetIntegerv(uint pname, int[] param); diff --git a/Src/NoesisApp/RenderContexts/WGL/Src/RenderContextWGL.cs b/Src/NoesisApp/RenderContexts/WGL/Src/RenderContextWGL.cs index 8514d39..31ee4c3 100644 --- a/Src/NoesisApp/RenderContexts/WGL/Src/RenderContextWGL.cs +++ b/Src/NoesisApp/RenderContexts/WGL/Src/RenderContextWGL.cs @@ -164,6 +164,7 @@ public override void SetDefaultRenderTarget(int width, int height, bool doClearC glBindFramebuffer(GL_FRAMEBUFFER, 0); glViewport(0, 0, width, height); + glDisable(GL_SCISSOR_TEST); glClearStencil(0); uint mask = GL_STENCIL_BUFFER_BIT; @@ -324,6 +325,7 @@ public struct PIXELFORMATDESCRIPTOR private const uint GL_FRAMEBUFFER = 0x8D40; private const uint GL_STENCIL_BUFFER_BIT = 0x00000400; private const uint GL_COLOR_BUFFER_BIT = 0x00004000; + private const uint GL_SCISSOR_TEST = 0x00000C11; private const uint GL_VIEWPORT = 0x00000BA2; private const uint GL_PACK_ALIGNMENT = 0x00000D05; private const uint GL_UNSIGNED_BYTE = 0x00001401; @@ -359,13 +361,16 @@ public struct PIXELFORMATDESCRIPTOR static extern void glClearColor(float r, float g, float b, float a); [DllImport(OpenGLLibraryName)] - public static extern void glGetIntegerv(uint pname, int[] param); + static extern void glDisable(uint cap); [DllImport(OpenGLLibraryName)] - public static extern void glPixelStorei(uint pname, int param); + static extern void glGetIntegerv(uint pname, int[] param); [DllImport(OpenGLLibraryName)] - public static extern void glReadPixels(int x, int y, int width, int height, + static extern void glPixelStorei(uint pname, int param); + + [DllImport(OpenGLLibraryName)] + static extern void glReadPixels(int x, int y, int width, int height, uint format, uint type, byte[] pixels); } } diff --git a/THIRD_PARTY.txt b/THIRD_PARTY.txt index c974a13..963306e 100644 --- a/THIRD_PARTY.txt +++ b/THIRD_PARTY.txt @@ -114,176 +114,48 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. For more information, please refer to ----------------------------------------------------------------------------------- -FreeType / FreeType License -https://www.freetype.org/ ------------------------------------------------------------------------------------ - - The FreeType Project LICENSE - ---------------------------- - - 2006-Jan-27 - - Copyright 1996-2002, 2006 by - David Turner, Robert Wilhelm, and Werner Lemberg - - - -Introduction -============ - - The FreeType Project is distributed in several archive packages; - some of them may contain, in addition to the FreeType font engine, - various tools and contributions which rely on, or relate to, the - FreeType Project. - - This license applies to all files found in such packages, and - which do not fall under their own explicit license. The license - affects thus the FreeType font engine, the test programs, - documentation and makefiles, at the very least. - - This license was inspired by the BSD, Artistic, and IJG - (Independent JPEG Group) licenses, which all encourage inclusion - and use of free software in commercial and freeware products - alike. As a consequence, its main points are that: - - o We don't promise that this software works. However, we will be - interested in any kind of bug reports. (`as is' distribution) - - o You can use this software for whatever you want, in parts or - full form, without having to pay us. (`royalty-free' usage) - - o You may not pretend that you wrote this software. If you use - it, or only parts of it, in a program, you must acknowledge - somewhere in your documentation that you have used the - FreeType code. (`credits') - - We specifically permit and encourage the inclusion of this - software, with or without modifications, in commercial products. - We disclaim all warranties covering The FreeType Project and - assume no liability related to The FreeType Project. - - - Finally, many people asked us for a preferred form for a - credit/disclaimer to use in compliance with this license. We thus - encourage you to use the following text: - - """ - Portions of this software are copyright © The FreeType - Project (www.freetype.org). All rights reserved. - """ - - Please replace with the value from the FreeType version you - actually use. - - -Legal Terms -=========== - -0. Definitions --------------- - - Throughout this license, the terms `package', `FreeType Project', - and `FreeType archive' refer to the set of files originally - distributed by the authors (David Turner, Robert Wilhelm, and - Werner Lemberg) as the `FreeType Project', be they named as alpha, - beta or final release. - - `You' refers to the licensee, or person using the project, where - `using' is a generic term including compiling the project's source - code as well as linking it to form a `program' or `executable'. - This program is referred to as `a program using the FreeType - engine'. - - This license applies to all files distributed in the original - FreeType Project, including all source code, binaries and - documentation, unless otherwise stated in the file in its - original, unmodified form as distributed in the original archive. - If you are unsure whether or not a particular file is covered by - this license, you must contact us to verify this. - - The FreeType Project is copyright (C) 1996-2000 by David Turner, - Robert Wilhelm, and Werner Lemberg. All rights reserved except as - specified below. - -1. No Warranty --------------- - - THE FREETYPE PROJECT IS PROVIDED `AS IS' WITHOUT WARRANTY OF ANY - KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE. IN NO EVENT WILL ANY OF THE AUTHORS OR COPYRIGHT HOLDERS - BE LIABLE FOR ANY DAMAGES CAUSED BY THE USE OR THE INABILITY TO - USE, OF THE FREETYPE PROJECT. - -2. Redistribution ------------------ - - This license grants a worldwide, royalty-free, perpetual and - irrevocable right and license to use, execute, perform, compile, - display, copy, create derivative works of, distribute and - sublicense the FreeType Project (in both source and object code - forms) and derivative works thereof for any purpose; and to - authorize others to exercise some or all of the rights granted - herein, subject to the following conditions: - - o Redistribution of source code must retain this license file - (`FTL.TXT') unaltered; any additions, deletions or changes to - the original files must be clearly indicated in accompanying - documentation. The copyright notices of the unaltered, - original files must be preserved in all copies of source - files. - - o Redistribution in binary form must provide a disclaimer that - states that the software is based in part of the work of the - FreeType Team, in the distribution documentation. We also - encourage you to put an URL to the FreeType web page in your - documentation, though this isn't mandatory. - - These conditions apply to any software derived from or based on - the FreeType Project, not just the unmodified files. If you use - our work, you must acknowledge us. However, no fee need be paid - to us. - -3. Advertising --------------- - - Neither the FreeType authors and contributors nor you shall use - the name of the other for commercial, advertising, or promotional - purposes without specific prior written permission. - - We suggest, but do not require, that you use one or more of the - following phrases to refer to this software in your documentation - or advertising materials: `FreeType Project', `FreeType Engine', - `FreeType library', or `FreeType Distribution'. - - As you have not signed this license, you are not required to - accept it. However, as the FreeType Project is copyrighted - material, only this license, or another one contracted with the - authors, grants you the right to use, distribute, and modify it. - Therefore, by using, distributing, or modifying the FreeType - Project, you indicate that you understand and accept all the terms - of this license. - -4. Contacts ------------ - - There are two mailing lists related to FreeType: - - o freetype@nongnu.org - - Discusses general use and applications of FreeType, as well as - future and wanted additions to the library and distribution. - If you are looking for support, start in this list if you - haven't found anything to help you in the documentation. - - o freetype-devel@nongnu.org - - Discusses bugs, as well as engine internals, design issues, - specific licenses, porting, etc. - - Our home page can be found at - - https://www.freetype.org +HarfBuzz / "Old MIT" license +https://github.com/harfbuzz/harfbuzz +----------------------------------------------------------------------------------- + +HarfBuzz is licensed under the so-called "Old MIT" license. Details follow. +For parts of HarfBuzz that are licensed under different licenses see individual +files names COPYING in subdirectories where applicable. + +Copyright © 2010,2011,2012,2013,2014,2015,2016,2017,2018,2019,2020 Google, Inc. +Copyright © 2018,2019,2020 Ebrahim Byagowi +Copyright © 2019,2020 Facebook, Inc. +Copyright © 2012 Mozilla Foundation +Copyright © 2011 Codethink Limited +Copyright © 2008,2010 Nokia Corporation and/or its subsidiary(-ies) +Copyright © 2009 Keith Stribley +Copyright © 2009 Martin Hosken and SIL International +Copyright © 2007 Chris Wilson +Copyright © 2005,2006,2020,2021 Behdad Esfahbod +Copyright © 2005 David Turner +Copyright © 2004,2007,2008,2009,2010 Red Hat, Inc. +Copyright © 1998-2004 David Turner and Werner Lemberg + +For full copyright notices consult the individual files in the package. + + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. ----------------------------------------------------------------------------------- FastLZ / MIT License