From 8fb97ef445f89cfe03b46a2da89adc2048d1cbae Mon Sep 17 00:00:00 2001 From: maulik-cn Date: Mon, 5 Jan 2026 11:40:13 +0530 Subject: [PATCH] Add .NET Android bindings project for SciChart library --- .gitignore | 5 + samples/README.md | 1 + .../Additions/AboutAdditions.txt | 48 ++++ .../Additions/AxisPropertyHelperAdapters.cs | 15 ++ ...aseDataDistributionCalculatorExtensions.cs | 42 ++++ ...DistributionCalculatorInvokerExtensions.cs | 220 ++++++++++++++++++ .../BaseGridDataSeries3DExtensions.cs | 12 + .../BaseGridDataSeries3DInvokerExtensions.cs | 25 ++ ...mapDataDistributionCalculatorExtensions.cs | 18 ++ ...DistributionCalculatorInvokerExtensions.cs | 71 ++++++ .../ChartModifierCollectionBaseAdapters.cs | 9 + .../Additions/ChartModifierCoreAdapters.cs | 12 + .../Additions/DataSeriesExtensions.cs | 13 ++ .../Additions/DataSeriesInvokerExtensions.cs | 35 +++ .../Additions/ISciListSizeAdapters.cs | 38 +++ .../Additions/IViewVisibilityAdapters.cs | 131 +++++++++++ .../Additions/ObservableCollectionGenerics.cs | 29 +++ .../PieDonutRenderableSeriesListenerStub.cs | 10 + .../Additions/PointsMeshOpacity.cs | 14 ++ .../RenderContextBaseCanvasTexture.cs | 22 ++ .../StackedSeriesCollectionAdapters.cs | 9 + .../Additions/StackedSeriesTooltipAdapters.cs | 10 + .../UniformHeatmapDataSeriesExplicit.cs | 9 + .../Additions/VectorStringAdapters.cs | 11 + .../Additions/XDataSeriesInvokerExtensions.cs | 35 +++ .../README.md | 186 +++++++++++++++ .../SciChart.csproj | 9 + .../Transforms/EnumFields.xml | 14 ++ .../Transforms/EnumMethods.xml | 13 ++ .../Transforms/Metadata.xml | 139 +++++++++++ 30 files changed, 1205 insertions(+) create mode 100644 samples/scichart-dotnet-android-bindings/Additions/AboutAdditions.txt create mode 100644 samples/scichart-dotnet-android-bindings/Additions/AxisPropertyHelperAdapters.cs create mode 100644 samples/scichart-dotnet-android-bindings/Additions/BaseDataDistributionCalculatorExtensions.cs create mode 100644 samples/scichart-dotnet-android-bindings/Additions/BaseDataDistributionCalculatorInvokerExtensions.cs create mode 100644 samples/scichart-dotnet-android-bindings/Additions/BaseGridDataSeries3DExtensions.cs create mode 100644 samples/scichart-dotnet-android-bindings/Additions/BaseGridDataSeries3DInvokerExtensions.cs create mode 100644 samples/scichart-dotnet-android-bindings/Additions/BaseHeatmapDataDistributionCalculatorExtensions.cs create mode 100644 samples/scichart-dotnet-android-bindings/Additions/BaseHeatmapDataDistributionCalculatorInvokerExtensions.cs create mode 100644 samples/scichart-dotnet-android-bindings/Additions/ChartModifierCollectionBaseAdapters.cs create mode 100644 samples/scichart-dotnet-android-bindings/Additions/ChartModifierCoreAdapters.cs create mode 100644 samples/scichart-dotnet-android-bindings/Additions/DataSeriesExtensions.cs create mode 100644 samples/scichart-dotnet-android-bindings/Additions/DataSeriesInvokerExtensions.cs create mode 100644 samples/scichart-dotnet-android-bindings/Additions/ISciListSizeAdapters.cs create mode 100644 samples/scichart-dotnet-android-bindings/Additions/IViewVisibilityAdapters.cs create mode 100644 samples/scichart-dotnet-android-bindings/Additions/ObservableCollectionGenerics.cs create mode 100644 samples/scichart-dotnet-android-bindings/Additions/PieDonutRenderableSeriesListenerStub.cs create mode 100644 samples/scichart-dotnet-android-bindings/Additions/PointsMeshOpacity.cs create mode 100644 samples/scichart-dotnet-android-bindings/Additions/RenderContextBaseCanvasTexture.cs create mode 100644 samples/scichart-dotnet-android-bindings/Additions/StackedSeriesCollectionAdapters.cs create mode 100644 samples/scichart-dotnet-android-bindings/Additions/StackedSeriesTooltipAdapters.cs create mode 100644 samples/scichart-dotnet-android-bindings/Additions/UniformHeatmapDataSeriesExplicit.cs create mode 100644 samples/scichart-dotnet-android-bindings/Additions/VectorStringAdapters.cs create mode 100644 samples/scichart-dotnet-android-bindings/Additions/XDataSeriesInvokerExtensions.cs create mode 100644 samples/scichart-dotnet-android-bindings/README.md create mode 100644 samples/scichart-dotnet-android-bindings/SciChart.csproj create mode 100644 samples/scichart-dotnet-android-bindings/Transforms/EnumFields.xml create mode 100644 samples/scichart-dotnet-android-bindings/Transforms/EnumMethods.xml create mode 100644 samples/scichart-dotnet-android-bindings/Transforms/Metadata.xml diff --git a/.gitignore b/.gitignore index 8159618..7c50ff4 100644 --- a/.gitignore +++ b/.gitignore @@ -14,4 +14,9 @@ _exported_templates !/build +/samples/scichart-dotnet-android-bindings/.idea/ +/samples/scichart-dotnet-android-bindings/bin/ +/samples/scichart-dotnet-android-bindings/obj/ +/samples/scichart-dotnet-android-bindings/*.aar + **/local.properties \ No newline at end of file diff --git a/samples/README.md b/samples/README.md index 031b61f..068976f 100644 --- a/samples/README.md +++ b/samples/README.md @@ -6,3 +6,4 @@ Examples and Tutorials used in documentation for [SciChart.Android](https://www. - [Documentation Samples Sandbox](sandbox) - [SciChart Android Native Tutorials](tutorials-native) - [SciChart Android Xamarin Tutorials](tutorials-xamarin) +- [SciChart .NET Android Bindings Project](scichart-dotnet-android-bindings) \ No newline at end of file diff --git a/samples/scichart-dotnet-android-bindings/Additions/AboutAdditions.txt b/samples/scichart-dotnet-android-bindings/Additions/AboutAdditions.txt new file mode 100644 index 0000000..2775bd3 --- /dev/null +++ b/samples/scichart-dotnet-android-bindings/Additions/AboutAdditions.txt @@ -0,0 +1,48 @@ +Additions allow you to add arbitrary C# to the generated classes +before they are compiled. This can be helpful for providing convenience +methods or adding pure C# classes. + +== Adding Methods to Generated Classes == + +Let's say the library being bound has a Rectangle class with a constructor +that takes an x and y position, and a width and length size. It will look like +this: + +public partial class Rectangle +{ + public Rectangle (int x, int y, int width, int height) + { + // JNI bindings + } +} + +Imagine we want to add a constructor to this class that takes a Point and +Size structure instead of 4 ints. We can add a new file called Rectangle.cs +with a partial class containing our new method: + +public partial class Rectangle +{ + public Rectangle (Point location, Size size) : + this (location.X, location.Y, size.Width, size.Height) + { + } +} + +At compile time, the additions class will be added to the generated class +and the final assembly will a Rectangle class with both constructors. + + +== Adding C# Classes == + +Another thing that can be done is adding fully C# managed classes to the +generated library. In the above example, let's assume that there isn't a +Point class available in Java or our library. The one we create doesn't need +to interact with Java, so we'll create it like a normal class in C#. + +By adding a Point.cs file with this class, it will end up in the binding library: + +public class Point +{ + public int X { get; set; } + public int Y { get; set; } +} \ No newline at end of file diff --git a/samples/scichart-dotnet-android-bindings/Additions/AxisPropertyHelperAdapters.cs b/samples/scichart-dotnet-android-bindings/Additions/AxisPropertyHelperAdapters.cs new file mode 100644 index 0000000..770d955 --- /dev/null +++ b/samples/scichart-dotnet-android-bindings/Additions/AxisPropertyHelperAdapters.cs @@ -0,0 +1,15 @@ +using Com.Scichart.Charting3d.Visuals.Axes; + +namespace Com.Scichart.Charting3d.Utility.PropertyHelpers { + public partial class AxisPropertyHelper { + protected override void Attach(global::Java.Lang.Object? target) + { + Attach(target as IAxis3D); + } + + protected override void Detach(global::Java.Lang.Object? target) + { + Detach(target as IAxis3D); + } + } +} diff --git a/samples/scichart-dotnet-android-bindings/Additions/BaseDataDistributionCalculatorExtensions.cs b/samples/scichart-dotnet-android-bindings/Additions/BaseDataDistributionCalculatorExtensions.cs new file mode 100644 index 0000000..36706ba --- /dev/null +++ b/samples/scichart-dotnet-android-bindings/Additions/BaseDataDistributionCalculatorExtensions.cs @@ -0,0 +1,42 @@ +using Android.Runtime; + +namespace Com.Scichart.Charting.Model.Datadistributioncalculator { + public abstract partial class BaseDataDistributionCalculator { + [Register("onAppendValue", "(Lcom/scichart/data/model/ISciList;Ljava/lang/Comparable;Z)V", "GetOnAppendValue_Lcom_scichart_data_model_ISciList_Ljava_lang_Comparable_ZHandler")] + public abstract void OnAppendValue(global::Com.Scichart.Data.Model.ISciList? values, global::Java.Lang.Object? newValue, bool acceptUnsortedData); + + [Register("onAppendValues", "(Lcom/scichart/data/model/ISciList;ILcom/scichart/core/model/IValues;Z)V", "GetOnAppendValues_Lcom_scichart_data_model_ISciList_ILcom_scichart_core_model_IValues_ZHandler")] + public abstract void OnAppendValues(global::Com.Scichart.Data.Model.ISciList? values, int countBeforeAppending, global::Com.Scichart.Core.Model.IValues? newValues, bool acceptUnsortedData); + + [Register("onAppendValues", "(Lcom/scichart/data/model/ISciList;ILjava/lang/Iterable;Z)V", "GetOnAppendValues_Lcom_scichart_data_model_ISciList_ILjava_lang_Iterable_ZHandler")] + public abstract void OnAppendValues(global::Com.Scichart.Data.Model.ISciList? values, int countBeforeAppending, global::Java.Lang.IIterable? newValues, bool acceptUnsortedData); + + [Register("onAppendValues", "(Lcom/scichart/data/model/ISciList;I[Ljava/lang/Comparable;Z)V", "GetOnAppendValues_Lcom_scichart_data_model_ISciList_IarrayLjava_lang_Comparable_ZHandler")] + public abstract void OnAppendValues(global::Com.Scichart.Data.Model.ISciList? values, int countBeforeAppending, global::Java.Lang.Object[]? newValues, bool acceptUnsortedData); + + [Register("onInsertValue", "(Lcom/scichart/data/model/ISciList;ILjava/lang/Comparable;Z)V", "GetOnInsertValue_Lcom_scichart_data_model_ISciList_ILjava_lang_Comparable_ZHandler")] + public abstract void OnInsertValue(global::Com.Scichart.Data.Model.ISciList? values, int indexWhereInserted, global::Java.Lang.Object? newValue, bool acceptUnsortedData); + + [Register("onInsertValues", "(Lcom/scichart/data/model/ISciList;IILcom/scichart/core/model/IValues;Z)V", "GetOnInsertValues_Lcom_scichart_data_model_ISciList_IILcom_scichart_core_model_IValues_ZHandler")] + public abstract void OnInsertValues(global::Com.Scichart.Data.Model.ISciList? values, int indexWhereInserted, int insertedCount, global::Com.Scichart.Core.Model.IValues? newValues, bool acceptUnsortedData); + + [Register("onInsertValues", "(Lcom/scichart/data/model/ISciList;IILjava/lang/Iterable;Z)V", "GetOnInsertValues_Lcom_scichart_data_model_ISciList_IILjava_lang_Iterable_ZHandler")] + public abstract void OnInsertValues(global::Com.Scichart.Data.Model.ISciList? values, int indexWhereInserted, int insertedCount, global::Java.Lang.IIterable? newValues, bool acceptUnsortedData); + + [Register("onInsertValues", "(Lcom/scichart/data/model/ISciList;II[Ljava/lang/Comparable;Z)V", "GetOnInsertValues_Lcom_scichart_data_model_ISciList_IIarrayLjava_lang_Comparable_ZHandler")] + public abstract void OnInsertValues(global::Com.Scichart.Data.Model.ISciList? values, int indexWhereInserted, int insertedCount, global::Java.Lang.Object[]? newValues, bool acceptUnsortedData); + + [Register("onUpdateValue", "(Lcom/scichart/data/model/ISciList;ILjava/lang/Comparable;Z)V", "GetOnUpdateValue_Lcom_scichart_data_model_ISciList_ILjava_lang_Comparable_ZHandler")] + public abstract void OnUpdateValue(global::Com.Scichart.Data.Model.ISciList? values, int indexWhereUpdate, global::Java.Lang.Object? newValue, bool acceptUnsortedData); + + [Register("onUpdateValues", "(Lcom/scichart/data/model/ISciList;IILcom/scichart/core/model/IValues;Z)V", "GetOnUpdateValues_Lcom_scichart_data_model_ISciList_IILcom_scichart_core_model_IValues_ZHandler")] + public abstract void OnUpdateValues(global::Com.Scichart.Data.Model.ISciList? values, int indexWhereUpdate, int updatedCount, global::Com.Scichart.Core.Model.IValues? newValues, bool acceptUnsortedData); + + [Register("onUpdateValues", "(Lcom/scichart/data/model/ISciList;IILjava/lang/Iterable;Z)V", "GetOnUpdateValues_Lcom_scichart_data_model_ISciList_IILjava_lang_Iterable_ZHandler")] + public abstract void OnUpdateValues(global::Com.Scichart.Data.Model.ISciList? values, int indexWhereUpdate, int updatedCount, global::Java.Lang.IIterable? newValues, bool acceptUnsortedData); + + [Register("onUpdateValues", "(Lcom/scichart/data/model/ISciList;II[Ljava/lang/Comparable;Z)V", "GetOnUpdateValues_Lcom_scichart_data_model_ISciList_IIarrayLjava_lang_Comparable_ZHandler")] + public abstract void OnUpdateValues(global::Com.Scichart.Data.Model.ISciList? values, int indexWhereUpdate, int updatedCount, global::Java.Lang.Object[]? newValues, bool acceptUnsortedData); + } +} + diff --git a/samples/scichart-dotnet-android-bindings/Additions/BaseDataDistributionCalculatorInvokerExtensions.cs b/samples/scichart-dotnet-android-bindings/Additions/BaseDataDistributionCalculatorInvokerExtensions.cs new file mode 100644 index 0000000..eec32a7 --- /dev/null +++ b/samples/scichart-dotnet-android-bindings/Additions/BaseDataDistributionCalculatorInvokerExtensions.cs @@ -0,0 +1,220 @@ +using System; +using Android.Runtime; +using Java.Interop; + +namespace Com.Scichart.Charting.Model.Datadistributioncalculator { + internal partial class BaseDataDistributionCalculatorInvoker { + public override unsafe void OnAppendValue(global::Com.Scichart.Data.Model.ISciList? values, global::Java.Lang.Object? newValue, bool acceptUnsortedData) + { + const string __id = "onAppendValue.(Lcom/scichart/data/model/ISciList;Ljava/lang/Comparable;Z)V"; + try { + JniArgumentValue* __args = stackalloc JniArgumentValue[3]; + __args[0] = new JniArgumentValue((values == null) ? IntPtr.Zero : ((global::Java.Lang.Object)values).Handle); + __args[1] = new JniArgumentValue((newValue == null) ? IntPtr.Zero : ((global::Java.Lang.Object)newValue).Handle); + __args[2] = new JniArgumentValue(acceptUnsortedData); + _members.InstanceMethods.InvokeAbstractVoidMethod(__id, this, __args); + } finally { + global::System.GC.KeepAlive(values); + global::System.GC.KeepAlive(newValue); + } + } + + public override unsafe void OnAppendValues(global::Com.Scichart.Data.Model.ISciList? values, int countBeforeAppending, global::Com.Scichart.Core.Model.IValues? newValues, bool acceptUnsortedData) + { + const string __id = "onAppendValues.(Lcom/scichart/data/model/ISciList;ILcom/scichart/core/model/IValues;Z)V"; + try { + JniArgumentValue* __args = stackalloc JniArgumentValue[4]; + __args[0] = new JniArgumentValue((values == null) ? IntPtr.Zero : ((global::Java.Lang.Object)values).Handle); + __args[1] = new JniArgumentValue(countBeforeAppending); + __args[2] = new JniArgumentValue((newValues == null) ? IntPtr.Zero : ((global::Java.Lang.Object)newValues).Handle); + __args[3] = new JniArgumentValue(acceptUnsortedData); + _members.InstanceMethods.InvokeAbstractVoidMethod(__id, this, __args); + } finally { + global::System.GC.KeepAlive(values); + global::System.GC.KeepAlive(newValues); + } + } + + public override unsafe void OnAppendValues(global::Com.Scichart.Data.Model.ISciList? values, int countBeforeAppending, global::Java.Lang.IIterable? newValues, bool acceptUnsortedData) + { + const string __id = "onAppendValues.(Lcom/scichart/data/model/ISciList;ILjava/lang/Iterable;Z)V"; + try { + JniArgumentValue* __args = stackalloc JniArgumentValue[4]; + __args[0] = new JniArgumentValue((values == null) ? IntPtr.Zero : ((global::Java.Lang.Object)values).Handle); + __args[1] = new JniArgumentValue(countBeforeAppending); + __args[2] = new JniArgumentValue((newValues == null) ? IntPtr.Zero : ((global::Java.Lang.Object)newValues).Handle); + __args[3] = new JniArgumentValue(acceptUnsortedData); + _members.InstanceMethods.InvokeAbstractVoidMethod(__id, this, __args); + } finally { + global::System.GC.KeepAlive(values); + global::System.GC.KeepAlive(newValues); + } + } + + public override unsafe void OnAppendValues(global::Com.Scichart.Data.Model.ISciList? values, int countBeforeAppending, global::Java.Lang.Object[]? newValues, bool acceptUnsortedData) + { + const string __id = "onAppendValues.(Lcom/scichart/data/model/ISciList;I[Ljava/lang/Comparable;Z)V"; + IntPtr native_newValues = JNIEnv.NewArray(newValues); + try { + JniArgumentValue* __args = stackalloc JniArgumentValue[4]; + __args[0] = new JniArgumentValue((values == null) ? IntPtr.Zero : ((global::Java.Lang.Object)values).Handle); + __args[1] = new JniArgumentValue(countBeforeAppending); + __args[2] = new JniArgumentValue(native_newValues); + __args[3] = new JniArgumentValue(acceptUnsortedData); + _members.InstanceMethods.InvokeAbstractVoidMethod(__id, this, __args); + } finally { + if (newValues != null) { + JNIEnv.CopyArray(native_newValues, newValues); + JNIEnv.DeleteLocalRef(native_newValues); + } + global::System.GC.KeepAlive(values); + global::System.GC.KeepAlive(newValues); + } + } + + public override unsafe void OnInsertValue(global::Com.Scichart.Data.Model.ISciList? values, int indexWhereInserted, global::Java.Lang.Object? newValue, bool acceptUnsortedData) + { + const string __id = "onInsertValue.(Lcom/scichart/data/model/ISciList;ILjava/lang/Comparable;Z)V"; + try { + JniArgumentValue* __args = stackalloc JniArgumentValue[4]; + __args[0] = new JniArgumentValue((values == null) ? IntPtr.Zero : ((global::Java.Lang.Object)values).Handle); + __args[1] = new JniArgumentValue(indexWhereInserted); + __args[2] = new JniArgumentValue((newValue == null) ? IntPtr.Zero : ((global::Java.Lang.Object)newValue).Handle); + __args[3] = new JniArgumentValue(acceptUnsortedData); + _members.InstanceMethods.InvokeAbstractVoidMethod(__id, this, __args); + } finally { + global::System.GC.KeepAlive(values); + global::System.GC.KeepAlive(newValue); + } + } + + public override unsafe void OnInsertValues(global::Com.Scichart.Data.Model.ISciList? values, int indexWhereInserted, int insertedCount, global::Com.Scichart.Core.Model.IValues? newValues, bool acceptUnsortedData) + { + const string __id = "onInsertValues.(Lcom/scichart/data/model/ISciList;IILcom/scichart/core/model/IValues;Z)V"; + try { + JniArgumentValue* __args = stackalloc JniArgumentValue[5]; + __args[0] = new JniArgumentValue((values == null) ? IntPtr.Zero : ((global::Java.Lang.Object)values).Handle); + __args[1] = new JniArgumentValue(indexWhereInserted); + __args[2] = new JniArgumentValue(insertedCount); + __args[3] = new JniArgumentValue((newValues == null) ? IntPtr.Zero : ((global::Java.Lang.Object)newValues).Handle); + __args[4] = new JniArgumentValue(acceptUnsortedData); + _members.InstanceMethods.InvokeAbstractVoidMethod(__id, this, __args); + } finally { + global::System.GC.KeepAlive(values); + global::System.GC.KeepAlive(newValues); + } + } + + public override unsafe void OnInsertValues(global::Com.Scichart.Data.Model.ISciList? values, int indexWhereInserted, int insertedCount, global::Java.Lang.IIterable? newValues, bool acceptUnsortedData) + { + const string __id = "onInsertValues.(Lcom/scichart/data/model/ISciList;IILjava/lang/Iterable;Z)V"; + try { + JniArgumentValue* __args = stackalloc JniArgumentValue[5]; + __args[0] = new JniArgumentValue((values == null) ? IntPtr.Zero : ((global::Java.Lang.Object)values).Handle); + __args[1] = new JniArgumentValue(indexWhereInserted); + __args[2] = new JniArgumentValue(insertedCount); + __args[3] = new JniArgumentValue((newValues == null) ? IntPtr.Zero : ((global::Java.Lang.Object)newValues).Handle); + __args[4] = new JniArgumentValue(acceptUnsortedData); + _members.InstanceMethods.InvokeAbstractVoidMethod(__id, this, __args); + } finally { + global::System.GC.KeepAlive(values); + global::System.GC.KeepAlive(newValues); + } + } + + public override unsafe void OnInsertValues(global::Com.Scichart.Data.Model.ISciList? values, int indexWhereInserted, int insertedCount, global::Java.Lang.Object[]? newValues, bool acceptUnsortedData) + { + const string __id = "onInsertValues.(Lcom/scichart/data/model/ISciList;II[Ljava/lang/Comparable;Z)V"; + IntPtr native_newValues = JNIEnv.NewArray(newValues); + try { + JniArgumentValue* __args = stackalloc JniArgumentValue[5]; + __args[0] = new JniArgumentValue((values == null) ? IntPtr.Zero : ((global::Java.Lang.Object)values).Handle); + __args[1] = new JniArgumentValue(indexWhereInserted); + __args[2] = new JniArgumentValue(insertedCount); + __args[3] = new JniArgumentValue(native_newValues); + __args[4] = new JniArgumentValue(acceptUnsortedData); + _members.InstanceMethods.InvokeAbstractVoidMethod(__id, this, __args); + } finally { + if (newValues != null) { + JNIEnv.CopyArray(native_newValues, newValues); + JNIEnv.DeleteLocalRef(native_newValues); + } + global::System.GC.KeepAlive(values); + global::System.GC.KeepAlive(newValues); + } + } + + public override unsafe void OnUpdateValue(global::Com.Scichart.Data.Model.ISciList? values, int indexWhereUpdate, global::Java.Lang.Object? newValue, bool acceptUnsortedData) + { + const string __id = "onUpdateValue.(Lcom/scichart/data/model/ISciList;ILjava/lang/Comparable;Z)V"; + try { + JniArgumentValue* __args = stackalloc JniArgumentValue[4]; + __args[0] = new JniArgumentValue((values == null) ? IntPtr.Zero : ((global::Java.Lang.Object)values).Handle); + __args[1] = new JniArgumentValue(indexWhereUpdate); + __args[2] = new JniArgumentValue((newValue == null) ? IntPtr.Zero : ((global::Java.Lang.Object)newValue).Handle); + __args[3] = new JniArgumentValue(acceptUnsortedData); + _members.InstanceMethods.InvokeAbstractVoidMethod(__id, this, __args); + } finally { + global::System.GC.KeepAlive(values); + global::System.GC.KeepAlive(newValue); + } + } + + public override unsafe void OnUpdateValues(global::Com.Scichart.Data.Model.ISciList? values, int indexWhereUpdate, int updatedCount, global::Com.Scichart.Core.Model.IValues? newValues, bool acceptUnsortedData) + { + const string __id = "onUpdateValues.(Lcom/scichart/data/model/ISciList;IILcom/scichart/core/model/IValues;Z)V"; + try { + JniArgumentValue* __args = stackalloc JniArgumentValue[5]; + __args[0] = new JniArgumentValue((values == null) ? IntPtr.Zero : ((global::Java.Lang.Object)values).Handle); + __args[1] = new JniArgumentValue(indexWhereUpdate); + __args[2] = new JniArgumentValue(updatedCount); + __args[3] = new JniArgumentValue((newValues == null) ? IntPtr.Zero : ((global::Java.Lang.Object)newValues).Handle); + __args[4] = new JniArgumentValue(acceptUnsortedData); + _members.InstanceMethods.InvokeAbstractVoidMethod(__id, this, __args); + } finally { + global::System.GC.KeepAlive(values); + global::System.GC.KeepAlive(newValues); + } + } + + public override unsafe void OnUpdateValues(global::Com.Scichart.Data.Model.ISciList? values, int indexWhereUpdate, int updatedCount, global::Java.Lang.IIterable? newValues, bool acceptUnsortedData) + { + const string __id = "onUpdateValues.(Lcom/scichart/data/model/ISciList;IILjava/lang/Iterable;Z)V"; + try { + JniArgumentValue* __args = stackalloc JniArgumentValue[5]; + __args[0] = new JniArgumentValue((values == null) ? IntPtr.Zero : ((global::Java.Lang.Object)values).Handle); + __args[1] = new JniArgumentValue(indexWhereUpdate); + __args[2] = new JniArgumentValue(updatedCount); + __args[3] = new JniArgumentValue((newValues == null) ? IntPtr.Zero : ((global::Java.Lang.Object)newValues).Handle); + __args[4] = new JniArgumentValue(acceptUnsortedData); + _members.InstanceMethods.InvokeAbstractVoidMethod(__id, this, __args); + } finally { + global::System.GC.KeepAlive(values); + global::System.GC.KeepAlive(newValues); + } + } + + public override unsafe void OnUpdateValues(global::Com.Scichart.Data.Model.ISciList? values, int indexWhereUpdate, int updatedCount, global::Java.Lang.Object[]? newValues, bool acceptUnsortedData) + { + const string __id = "onUpdateValues.(Lcom/scichart/data/model/ISciList;II[Ljava/lang/Comparable;Z)V"; + IntPtr native_newValues = JNIEnv.NewArray(newValues); + try { + JniArgumentValue* __args = stackalloc JniArgumentValue[5]; + __args[0] = new JniArgumentValue((values == null) ? IntPtr.Zero : ((global::Java.Lang.Object)values).Handle); + __args[1] = new JniArgumentValue(indexWhereUpdate); + __args[2] = new JniArgumentValue(updatedCount); + __args[3] = new JniArgumentValue(native_newValues); + __args[4] = new JniArgumentValue(acceptUnsortedData); + _members.InstanceMethods.InvokeAbstractVoidMethod(__id, this, __args); + } finally { + if (newValues != null) { + JNIEnv.CopyArray(native_newValues, newValues); + JNIEnv.DeleteLocalRef(native_newValues); + } + global::System.GC.KeepAlive(values); + global::System.GC.KeepAlive(newValues); + } + } + } +} + diff --git a/samples/scichart-dotnet-android-bindings/Additions/BaseGridDataSeries3DExtensions.cs b/samples/scichart-dotnet-android-bindings/Additions/BaseGridDataSeries3DExtensions.cs new file mode 100644 index 0000000..cf0c89c --- /dev/null +++ b/samples/scichart-dotnet-android-bindings/Additions/BaseGridDataSeries3DExtensions.cs @@ -0,0 +1,12 @@ +using Android.Runtime; + +namespace Com.Scichart.Charting3d.Model.DataSeries.Grid { + public abstract partial class BaseGridDataSeries3D { + [Register("getXValueAt", "(I)Ljava/lang/Comparable;", "GetGetXValueAt_IHandler")] + public abstract global::Java.Lang.Object? GetXValueAt(int xIndex); + + [Register("getZValueAt", "(I)Ljava/lang/Comparable;", "GetGetZValueAt_IHandler")] + public abstract global::Java.Lang.Object? GetZValueAt(int zIndex); + } +} + diff --git a/samples/scichart-dotnet-android-bindings/Additions/BaseGridDataSeries3DInvokerExtensions.cs b/samples/scichart-dotnet-android-bindings/Additions/BaseGridDataSeries3DInvokerExtensions.cs new file mode 100644 index 0000000..1ade7c6 --- /dev/null +++ b/samples/scichart-dotnet-android-bindings/Additions/BaseGridDataSeries3DInvokerExtensions.cs @@ -0,0 +1,25 @@ +using System; +using Android.Runtime; +using Java.Interop; + +namespace Com.Scichart.Charting3d.Model.DataSeries.Grid { + internal partial class BaseGridDataSeries3DInvoker { + public override unsafe global::Java.Lang.Object? GetXValueAt(int xIndex) + { + const string __id = "getXValueAt.(I)Ljava/lang/Comparable;"; + JniArgumentValue* __args = stackalloc JniArgumentValue[1]; + __args[0] = new JniArgumentValue(xIndex); + var __rm = _members.InstanceMethods.InvokeAbstractObjectMethod(__id, this, __args); + return global::Java.Lang.Object.GetObject(__rm.Handle, JniHandleOwnership.TransferLocalRef); + } + + public override unsafe global::Java.Lang.Object? GetZValueAt(int zIndex) + { + const string __id = "getZValueAt.(I)Ljava/lang/Comparable;"; + JniArgumentValue* __args = stackalloc JniArgumentValue[1]; + __args[0] = new JniArgumentValue(zIndex); + var __rm = _members.InstanceMethods.InvokeAbstractObjectMethod(__id, this, __args); + return global::Java.Lang.Object.GetObject(__rm.Handle, JniHandleOwnership.TransferLocalRef); + } + } +} diff --git a/samples/scichart-dotnet-android-bindings/Additions/BaseHeatmapDataDistributionCalculatorExtensions.cs b/samples/scichart-dotnet-android-bindings/Additions/BaseHeatmapDataDistributionCalculatorExtensions.cs new file mode 100644 index 0000000..79a33a1 --- /dev/null +++ b/samples/scichart-dotnet-android-bindings/Additions/BaseHeatmapDataDistributionCalculatorExtensions.cs @@ -0,0 +1,18 @@ +using Android.Runtime; + +namespace Com.Scichart.Charting.Model.Datadistributioncalculator { + public abstract partial class BaseHeatmapDataDistributionCalculator { + [Register("onUpdateXValue", "(Lcom/scichart/data/model/ISciList;ILjava/lang/Comparable;Z)V", "GetOnUpdateXValue_Lcom_scichart_data_model_ISciList_ILjava_lang_Comparable_ZHandler")] + public abstract void OnUpdateXValue(global::Com.Scichart.Data.Model.ISciList? values, int indexWhereUpdate, global::Java.Lang.Object? newValue, bool acceptUnsortedData); + + [Register("onUpdateXValues", "(Lcom/scichart/data/model/ISciList;ILcom/scichart/core/model/IValues;Z)V", "GetOnUpdateXValues_Lcom_scichart_data_model_ISciList_ILcom_scichart_core_model_IValues_ZHandler")] + public abstract void OnUpdateXValues(global::Com.Scichart.Data.Model.ISciList? values, int indexWhereUpdate, global::Com.Scichart.Core.Model.IValues? newValues, bool acceptUnsortedData); + + [Register("onUpdateYValue", "(Lcom/scichart/data/model/ISciList;ILjava/lang/Comparable;Z)V", "GetOnUpdateYValue_Lcom_scichart_data_model_ISciList_ILjava_lang_Comparable_ZHandler")] + public abstract void OnUpdateYValue(global::Com.Scichart.Data.Model.ISciList? values, int indexWhereUpdate, global::Java.Lang.Object? newValue, bool acceptUnsortedData); + + [Register("onUpdateYValues", "(Lcom/scichart/data/model/ISciList;ILcom/scichart/core/model/IValues;Z)V", "GetOnUpdateYValues_Lcom_scichart_data_model_ISciList_ILcom_scichart_core_model_IValues_ZHandler")] + public abstract void OnUpdateYValues(global::Com.Scichart.Data.Model.ISciList? values, int indexWhereUpdate, global::Com.Scichart.Core.Model.IValues? newValues, bool acceptUnsortedData); + } +} + diff --git a/samples/scichart-dotnet-android-bindings/Additions/BaseHeatmapDataDistributionCalculatorInvokerExtensions.cs b/samples/scichart-dotnet-android-bindings/Additions/BaseHeatmapDataDistributionCalculatorInvokerExtensions.cs new file mode 100644 index 0000000..448aeae --- /dev/null +++ b/samples/scichart-dotnet-android-bindings/Additions/BaseHeatmapDataDistributionCalculatorInvokerExtensions.cs @@ -0,0 +1,71 @@ +using System; +using Java.Interop; + +namespace Com.Scichart.Charting.Model.Datadistributioncalculator { + internal partial class BaseHeatmapDataDistributionCalculatorInvoker { + public override unsafe void OnUpdateXValue(global::Com.Scichart.Data.Model.ISciList? values, int indexWhereUpdate, global::Java.Lang.Object? newValue, bool acceptUnsortedData) + { + const string __id = "onUpdateXValue.(Lcom/scichart/data/model/ISciList;ILjava/lang/Comparable;Z)V"; + try { + JniArgumentValue* __args = stackalloc JniArgumentValue[4]; + __args[0] = new JniArgumentValue((values == null) ? IntPtr.Zero : ((global::Java.Lang.Object)values).Handle); + __args[1] = new JniArgumentValue(indexWhereUpdate); + __args[2] = new JniArgumentValue((newValue == null) ? IntPtr.Zero : ((global::Java.Lang.Object)newValue).Handle); + __args[3] = new JniArgumentValue(acceptUnsortedData); + _members.InstanceMethods.InvokeAbstractVoidMethod(__id, this, __args); + } finally { + global::System.GC.KeepAlive(values); + global::System.GC.KeepAlive(newValue); + } + } + + public override unsafe void OnUpdateXValues(global::Com.Scichart.Data.Model.ISciList? values, int indexWhereUpdate, global::Com.Scichart.Core.Model.IValues? newValues, bool acceptUnsortedData) + { + const string __id = "onUpdateXValues.(Lcom/scichart/data/model/ISciList;ILcom/scichart/core/model/IValues;Z)V"; + try { + JniArgumentValue* __args = stackalloc JniArgumentValue[4]; + __args[0] = new JniArgumentValue((values == null) ? IntPtr.Zero : ((global::Java.Lang.Object)values).Handle); + __args[1] = new JniArgumentValue(indexWhereUpdate); + __args[2] = new JniArgumentValue((newValues == null) ? IntPtr.Zero : ((global::Java.Lang.Object)newValues).Handle); + __args[3] = new JniArgumentValue(acceptUnsortedData); + _members.InstanceMethods.InvokeAbstractVoidMethod(__id, this, __args); + } finally { + global::System.GC.KeepAlive(values); + global::System.GC.KeepAlive(newValues); + } + } + + public override unsafe void OnUpdateYValue(global::Com.Scichart.Data.Model.ISciList? values, int indexWhereUpdate, global::Java.Lang.Object? newValue, bool acceptUnsortedData) + { + const string __id = "onUpdateYValue.(Lcom/scichart/data/model/ISciList;ILjava/lang/Comparable;Z)V"; + try { + JniArgumentValue* __args = stackalloc JniArgumentValue[4]; + __args[0] = new JniArgumentValue((values == null) ? IntPtr.Zero : ((global::Java.Lang.Object)values).Handle); + __args[1] = new JniArgumentValue(indexWhereUpdate); + __args[2] = new JniArgumentValue((newValue == null) ? IntPtr.Zero : ((global::Java.Lang.Object)newValue).Handle); + __args[3] = new JniArgumentValue(acceptUnsortedData); + _members.InstanceMethods.InvokeAbstractVoidMethod(__id, this, __args); + } finally { + global::System.GC.KeepAlive(values); + global::System.GC.KeepAlive(newValue); + } + } + + public override unsafe void OnUpdateYValues(global::Com.Scichart.Data.Model.ISciList? values, int indexWhereUpdate, global::Com.Scichart.Core.Model.IValues? newValues, bool acceptUnsortedData) + { + const string __id = "onUpdateYValues.(Lcom/scichart/data/model/ISciList;ILcom/scichart/core/model/IValues;Z)V"; + try { + JniArgumentValue* __args = stackalloc JniArgumentValue[4]; + __args[0] = new JniArgumentValue((values == null) ? IntPtr.Zero : ((global::Java.Lang.Object)values).Handle); + __args[1] = new JniArgumentValue(indexWhereUpdate); + __args[2] = new JniArgumentValue((newValues == null) ? IntPtr.Zero : ((global::Java.Lang.Object)newValues).Handle); + __args[3] = new JniArgumentValue(acceptUnsortedData); + _members.InstanceMethods.InvokeAbstractVoidMethod(__id, this, __args); + } finally { + global::System.GC.KeepAlive(values); + global::System.GC.KeepAlive(newValues); + } + } + } +} + diff --git a/samples/scichart-dotnet-android-bindings/Additions/ChartModifierCollectionBaseAdapters.cs b/samples/scichart-dotnet-android-bindings/Additions/ChartModifierCollectionBaseAdapters.cs new file mode 100644 index 0000000..9c74b37 --- /dev/null +++ b/samples/scichart-dotnet-android-bindings/Additions/ChartModifierCollectionBaseAdapters.cs @@ -0,0 +1,9 @@ +using Com.Scichart.Core.Observable; + +namespace Com.Scichart.Charting.Model { + public abstract partial class ChartModifierCollectionBase { + public virtual void OnCollectionChanged(int propertyId, CollectionChangedEventArgs? args) + { + } + } +} diff --git a/samples/scichart-dotnet-android-bindings/Additions/ChartModifierCoreAdapters.cs b/samples/scichart-dotnet-android-bindings/Additions/ChartModifierCoreAdapters.cs new file mode 100644 index 0000000..5f2eada --- /dev/null +++ b/samples/scichart-dotnet-android-bindings/Additions/ChartModifierCoreAdapters.cs @@ -0,0 +1,12 @@ +namespace Com.Scichart.Charting.Modifiers { + public partial class ChartModifierCore : IChartModifierCore, Com.Scichart.Core.Utility.Touch.IReceiveMotionEvents { + bool IChartModifierCore.IsEnabled { + get => IsEnabled; + set => SetIsEnabledInternal(value); + } + + bool Com.Scichart.Core.Utility.Touch.IReceiveMotionEvents.IsEnabled => IsEnabled; + + bool Com.Scichart.Core.Utility.Touch.IReceiveMotionEvents.ReceiveHandledEvents => ReceiveHandledEvents; + } +} diff --git a/samples/scichart-dotnet-android-bindings/Additions/DataSeriesExtensions.cs b/samples/scichart-dotnet-android-bindings/Additions/DataSeriesExtensions.cs new file mode 100644 index 0000000..0b38ae2 --- /dev/null +++ b/samples/scichart-dotnet-android-bindings/Additions/DataSeriesExtensions.cs @@ -0,0 +1,13 @@ +using Android.Runtime; +using Java.Interop; + +namespace Com.Scichart.Charting.Model.DataSeries { + public abstract partial class DataSeries { + [Register("getWindowedYRange", "(Lcom/scichart/charting/numerics/coordinateCalculators/ICoordinateCalculator;Z)Lcom/scichart/data/model/IRange;", "GetGetWindowedYRange_Lcom_scichart_charting_numerics_coordinateCalculators_ICoordinateCalculator_ZHandler")] + public abstract global::Com.Scichart.Data.Model.IRange? GetWindowedYRange(global::Com.Scichart.Charting.Numerics.CoordinateCalculators.ICoordinateCalculator? xCoordCalc, bool getPositiveRange); + + [Register("getWindowedYRange", "(Lcom/scichart/data/model/IndexRange;Z)Lcom/scichart/data/model/IRange;", "GetGetWindowedYRange_Lcom_scichart_data_model_IndexRange_ZHandler")] + public abstract global::Com.Scichart.Data.Model.IRange? GetWindowedYRange(global::Com.Scichart.Data.Model.IndexRange? xIndexRange, bool getPositiveRange); + } +} + diff --git a/samples/scichart-dotnet-android-bindings/Additions/DataSeriesInvokerExtensions.cs b/samples/scichart-dotnet-android-bindings/Additions/DataSeriesInvokerExtensions.cs new file mode 100644 index 0000000..1f3fb0d --- /dev/null +++ b/samples/scichart-dotnet-android-bindings/Additions/DataSeriesInvokerExtensions.cs @@ -0,0 +1,35 @@ +using System; +using Android.Runtime; +using Java.Interop; + +namespace Com.Scichart.Charting.Model.DataSeries { + internal partial class DataSeriesInvoker { + public override unsafe global::Com.Scichart.Data.Model.IRange? GetWindowedYRange(global::Com.Scichart.Charting.Numerics.CoordinateCalculators.ICoordinateCalculator? xCoordCalc, bool getPositiveRange) + { + const string __id = "getWindowedYRange.(Lcom/scichart/charting/numerics/coordinateCalculators/ICoordinateCalculator;Z)Lcom/scichart/data/model/IRange;"; + try { + JniArgumentValue* __args = stackalloc JniArgumentValue[2]; + __args[0] = new JniArgumentValue((xCoordCalc == null) ? IntPtr.Zero : ((global::Java.Lang.Object)xCoordCalc).Handle); + __args[1] = new JniArgumentValue(getPositiveRange); + var __rm = _members.InstanceMethods.InvokeAbstractObjectMethod(__id, this, __args); + return global::Java.Lang.Object.GetObject(__rm.Handle, JniHandleOwnership.TransferLocalRef); + } finally { + global::System.GC.KeepAlive(xCoordCalc); + } + } + + public override unsafe global::Com.Scichart.Data.Model.IRange? GetWindowedYRange(global::Com.Scichart.Data.Model.IndexRange? xIndexRange, bool getPositiveRange) + { + const string __id = "getWindowedYRange.(Lcom/scichart/data/model/IndexRange;Z)Lcom/scichart/data/model/IRange;"; + try { + JniArgumentValue* __args = stackalloc JniArgumentValue[2]; + __args[0] = new JniArgumentValue((xIndexRange == null) ? IntPtr.Zero : ((global::Java.Lang.Object)xIndexRange).Handle); + __args[1] = new JniArgumentValue(getPositiveRange); + var __rm = _members.InstanceMethods.InvokeAbstractObjectMethod(__id, this, __args); + return global::Java.Lang.Object.GetObject(__rm.Handle, JniHandleOwnership.TransferLocalRef); + } finally { + global::System.GC.KeepAlive(xIndexRange); + } + } + } +} diff --git a/samples/scichart-dotnet-android-bindings/Additions/ISciListSizeAdapters.cs b/samples/scichart-dotnet-android-bindings/Additions/ISciListSizeAdapters.cs new file mode 100644 index 0000000..7c0910b --- /dev/null +++ b/samples/scichart-dotnet-android-bindings/Additions/ISciListSizeAdapters.cs @@ -0,0 +1,38 @@ +namespace Com.Scichart.Data.Model { + public partial interface ISciList { + new int Size(); + } + + public partial interface ISciListByte { + new int Size(); + } + + public partial interface ISciListShort { + new int Size(); + } + + public partial interface ISciListInteger { + new int Size(); + } + + public partial interface ISciListLong { + new int Size(); + } + + public partial interface ISciListFloat { + new int Size(); + } + + public partial interface ISciListDouble { + new int Size(); + } + + public partial interface ISciListDate { + new int Size(); + } + + public partial interface ISmartList { + new int Size(); + } +} + diff --git a/samples/scichart-dotnet-android-bindings/Additions/IViewVisibilityAdapters.cs b/samples/scichart-dotnet-android-bindings/Additions/IViewVisibilityAdapters.cs new file mode 100644 index 0000000..6c3f5cc --- /dev/null +++ b/samples/scichart-dotnet-android-bindings/Additions/IViewVisibilityAdapters.cs @@ -0,0 +1,131 @@ +using Android.Views; +using Com.Scichart.Core.Framework; + +namespace Com.Scichart.Charting.Visuals.Layout { + public partial class CanvasViewContainer : IView { + int IView.Visibility { + get => (int)Visibility; + set => Visibility = (ViewStates)value; + } + } + + public partial class FrameViewContainer : IView { + int IView.Visibility { + get => (int)Visibility; + set => Visibility = (ViewStates)value; + } + } + + public partial class LinearViewContainer : IView { + int IView.Visibility { + get => (int)Visibility; + set => Visibility = (ViewStates)value; + } + } +} + +namespace Com.Scichart.Drawing.Canvas { + public partial class RenderSurface : IView { + int IView.Visibility { + get => (int)Visibility; + set => Visibility = (ViewStates)value; + } + } +} + +namespace Com.Scichart.Drawing.Opengl { + public partial class RenderSurfaceGL : IView { + int IView.Visibility { + get => (int)Visibility; + set => Visibility = (ViewStates)value; + } + } + + public partial class GLTextureView : IView { + int IView.Visibility { + get => (int)Visibility; + set => Visibility = (ViewStates)value; + } + } +} + +namespace Com.Scichart.Charting.Visuals.Annotations { + public partial class AdornerLayer : IView { + int IView.Visibility { + get => (int)Visibility; + set => Visibility = (ViewStates)value; + } + } + + public partial class AnnotationSurface : IView { + int IView.Visibility { + get => (int)Visibility; + set => Visibility = (ViewStates)value; + } + } +} + +namespace Com.Scichart.Charting.Visuals { + public abstract partial class SciChartSurfaceBase : IView { + int IView.Visibility { + get => (int)Visibility; + set => Visibility = (ViewStates)value; + } + } + + public partial class SciChartSurface : IView { + int IView.Visibility { + get => (int)Visibility; + set => Visibility = (ViewStates)value; + } + } + + public partial class SciPieChartSurface : IView { + int IView.Visibility { + get => (int)Visibility; + set => Visibility = (ViewStates)value; + } + } + + public partial class RenderableSeriesArea : IView { + int IView.Visibility { + get => (int)Visibility; + set => Visibility = (ViewStates)value; + } + } + + public partial class ChartModifierSurface : IView { + int IView.Visibility { + get => (int)Visibility; + set => Visibility = (ViewStates)value; + } + } +} + +namespace Com.Scichart.Charting.Visuals.Axes { + public partial class AxisModifierSurface : IView { + int IView.Visibility { + get => (int)Visibility; + set => Visibility = (ViewStates)value; + } + } +} + +namespace Com.Scichart.Charting.Modifiers.Behaviors { + public abstract partial class TooltipContainerBase : IView { + int IView.Visibility { + get => (int)Visibility; + set => Visibility = (ViewStates)value; + } + } +} + +namespace Com.Scichart.Charting3d.Visuals { + public abstract partial class SciChartSurface3D : IView { + int IView.Visibility { + get => (int)Visibility; + set => Visibility = (ViewStates)value; + } + } +} + diff --git a/samples/scichart-dotnet-android-bindings/Additions/ObservableCollectionGenerics.cs b/samples/scichart-dotnet-android-bindings/Additions/ObservableCollectionGenerics.cs new file mode 100644 index 0000000..4cd483f --- /dev/null +++ b/samples/scichart-dotnet-android-bindings/Additions/ObservableCollectionGenerics.cs @@ -0,0 +1,29 @@ +using System.Collections; +using Android.Runtime; + +namespace Com.Scichart.Core.Observable { + [Register (".dummy", DoNotGenerateAcw = true)] + public class ObservableCollection : ObservableCollection { + public ObservableCollection() { + } + + public ObservableCollection(int capacity) : base(capacity) { + } + + public ObservableCollection(ICollection? collection) : base(collection) { + } + + protected ObservableCollection(System.IntPtr javaReference, JniHandleOwnership transfer) : base(javaReference, transfer) { + } + } + + [Register (".dummy", DoNotGenerateAcw = true)] + public class CollectionChangedEventArgs : CollectionChangedEventArgs { + public CollectionChangedEventArgs() { + } + + protected CollectionChangedEventArgs(System.IntPtr javaReference, JniHandleOwnership transfer) : base(javaReference, transfer) { + } + } +} + diff --git a/samples/scichart-dotnet-android-bindings/Additions/PieDonutRenderableSeriesListenerStub.cs b/samples/scichart-dotnet-android-bindings/Additions/PieDonutRenderableSeriesListenerStub.cs new file mode 100644 index 0000000..8a00455 --- /dev/null +++ b/samples/scichart-dotnet-android-bindings/Additions/PieDonutRenderableSeriesListenerStub.cs @@ -0,0 +1,10 @@ +using Android.Runtime; + +namespace Com.Scichart.Charting.Visuals.RenderableSeries { + public sealed class InvalidatePieRenderableSeriesLayoutListener : Java.Lang.Object { + public InvalidatePieRenderableSeriesLayoutListener(IntPtr handle, JniHandleOwnership transfer) + : base(handle, transfer) + { + } + } +} diff --git a/samples/scichart-dotnet-android-bindings/Additions/PointsMeshOpacity.cs b/samples/scichart-dotnet-android-bindings/Additions/PointsMeshOpacity.cs new file mode 100644 index 0000000..afae31f --- /dev/null +++ b/samples/scichart-dotnet-android-bindings/Additions/PointsMeshOpacity.cs @@ -0,0 +1,14 @@ +namespace Com.Scichart.Charting3d.Visuals.Primitives.Mesh { + public partial class PointsMesh { + public virtual void SetOpacity(float opacity) => Opacity = opacity; + } + + public partial class PointsPixelsMesh { + public virtual void SetOpacity(float opacity) => Opacity = opacity; + } + + public partial class PointsInstancesMesh { + public virtual void SetOpacity(float opacity) => Opacity = opacity; + } +} + diff --git a/samples/scichart-dotnet-android-bindings/Additions/RenderContextBaseCanvasTexture.cs b/samples/scichart-dotnet-android-bindings/Additions/RenderContextBaseCanvasTexture.cs new file mode 100644 index 0000000..a7cd5cb --- /dev/null +++ b/samples/scichart-dotnet-android-bindings/Additions/RenderContextBaseCanvasTexture.cs @@ -0,0 +1,22 @@ +using System; +using Android.Runtime; +using Java.Interop; + +namespace Com.Scichart.Drawing.Common { + public abstract partial class RenderContextBase { + [Register("drawCanvasTexture", "(Lcom/scichart/drawing/common/ICanvasTexture2D;Lcom/scichart/core/common/Action1;)V", "GetDrawCanvasTexture_Lcom_scichart_drawing_common_ICanvasTexture2D_Lcom_scichart_core_common_Action1_Handler")] + public unsafe virtual void DrawCanvasTexture(global::Com.Scichart.Drawing.Common.ICanvasTexture2D? texture, global::Com.Scichart.Core.Common.IAction1? drawCallback) + { + const string __id = "drawCanvasTexture.(Lcom/scichart/drawing/common/ICanvasTexture2D;Lcom/scichart/core/common/Action1;)V"; + try { + JniArgumentValue* __args = stackalloc JniArgumentValue[2]; + __args[0] = new JniArgumentValue((texture == null) ? IntPtr.Zero : ((global::Java.Lang.Object)texture).Handle); + __args[1] = new JniArgumentValue((drawCallback == null) ? IntPtr.Zero : ((global::Java.Lang.Object)drawCallback).Handle); + _members.InstanceMethods.InvokeVirtualVoidMethod(__id, this, __args); + } finally { + global::System.GC.KeepAlive(texture); + global::System.GC.KeepAlive(drawCallback); + } + } + } +} diff --git a/samples/scichart-dotnet-android-bindings/Additions/StackedSeriesCollectionAdapters.cs b/samples/scichart-dotnet-android-bindings/Additions/StackedSeriesCollectionAdapters.cs new file mode 100644 index 0000000..6014fa9 --- /dev/null +++ b/samples/scichart-dotnet-android-bindings/Additions/StackedSeriesCollectionAdapters.cs @@ -0,0 +1,9 @@ +using Com.Scichart.Data.Model; + +namespace Com.Scichart.Charting.Visuals.RenderableSeries { + public abstract partial class StackedSeriesCollectionBase { + public virtual void GetCategoryXRange(IRange? categoryXRange) + { + } + } +} diff --git a/samples/scichart-dotnet-android-bindings/Additions/StackedSeriesTooltipAdapters.cs b/samples/scichart-dotnet-android-bindings/Additions/StackedSeriesTooltipAdapters.cs new file mode 100644 index 0000000..c2816f7 --- /dev/null +++ b/samples/scichart-dotnet-android-bindings/Additions/StackedSeriesTooltipAdapters.cs @@ -0,0 +1,10 @@ +using Android.Graphics; +using Com.Scichart.Core.Common; + +namespace Com.Scichart.Charting.Visuals.RenderableSeries.Tooltips { + public abstract partial class StackedSeriesTooltipBase { + public virtual void UpdateTooltip(IAction2? updateAction, PointF? xyCoordinate) + { + } + } +} diff --git a/samples/scichart-dotnet-android-bindings/Additions/UniformHeatmapDataSeriesExplicit.cs b/samples/scichart-dotnet-android-bindings/Additions/UniformHeatmapDataSeriesExplicit.cs new file mode 100644 index 0000000..d31c8b3 --- /dev/null +++ b/samples/scichart-dotnet-android-bindings/Additions/UniformHeatmapDataSeriesExplicit.cs @@ -0,0 +1,9 @@ +namespace Com.Scichart.Charting.Model.DataSeries { + public partial class UniformHeatmapDataSeries { + void IUniformHeatmapDataSeries.SetStartX(global::Java.Lang.Object? value) => StartX = value; + void IUniformHeatmapDataSeries.SetStartY(global::Java.Lang.Object? value) => StartY = value; + void IUniformHeatmapDataSeries.SetStepX(global::Java.Lang.Object? value) => StepX = value; + void IUniformHeatmapDataSeries.SetStepY(global::Java.Lang.Object? value) => StepY = value; + } +} + diff --git a/samples/scichart-dotnet-android-bindings/Additions/VectorStringAdapters.cs b/samples/scichart-dotnet-android-bindings/Additions/VectorStringAdapters.cs new file mode 100644 index 0000000..47e99d4 --- /dev/null +++ b/samples/scichart-dotnet-android-bindings/Additions/VectorStringAdapters.cs @@ -0,0 +1,11 @@ +using Java.Lang; + +namespace Com.Scichart.Charting3d.Interop { + public partial class Vectorstr { + public override global::Java.Lang.Object? Get(int index) => GetString(index); + } + + public partial class Vectorwstr { + public override global::Java.Lang.Object? Get(int index) => GetString(index); + } +} diff --git a/samples/scichart-dotnet-android-bindings/Additions/XDataSeriesInvokerExtensions.cs b/samples/scichart-dotnet-android-bindings/Additions/XDataSeriesInvokerExtensions.cs new file mode 100644 index 0000000..4ed05e4 --- /dev/null +++ b/samples/scichart-dotnet-android-bindings/Additions/XDataSeriesInvokerExtensions.cs @@ -0,0 +1,35 @@ +using System; +using Android.Runtime; +using Java.Interop; + +namespace Com.Scichart.Charting.Model.DataSeries { + internal partial class XDataSeriesInvoker { + public override unsafe global::Com.Scichart.Data.Model.IRange? GetWindowedYRange(global::Com.Scichart.Charting.Numerics.CoordinateCalculators.ICoordinateCalculator? xCoordCalc, bool getPositiveRange) + { + const string __id = "getWindowedYRange.(Lcom/scichart/charting/numerics/coordinateCalculators/ICoordinateCalculator;Z)Lcom/scichart/data/model/IRange;"; + try { + JniArgumentValue* __args = stackalloc JniArgumentValue[2]; + __args[0] = new JniArgumentValue((xCoordCalc == null) ? IntPtr.Zero : ((global::Java.Lang.Object)xCoordCalc).Handle); + __args[1] = new JniArgumentValue(getPositiveRange); + var __rm = _members.InstanceMethods.InvokeAbstractObjectMethod(__id, this, __args); + return global::Java.Lang.Object.GetObject(__rm.Handle, JniHandleOwnership.TransferLocalRef); + } finally { + global::System.GC.KeepAlive(xCoordCalc); + } + } + + public override unsafe global::Com.Scichart.Data.Model.IRange? GetWindowedYRange(global::Com.Scichart.Data.Model.IndexRange? xIndexRange, bool getPositiveRange) + { + const string __id = "getWindowedYRange.(Lcom/scichart/data/model/IndexRange;Z)Lcom/scichart/data/model/IRange;"; + try { + JniArgumentValue* __args = stackalloc JniArgumentValue[2]; + __args[0] = new JniArgumentValue((xIndexRange == null) ? IntPtr.Zero : ((global::Java.Lang.Object)xIndexRange).Handle); + __args[1] = new JniArgumentValue(getPositiveRange); + var __rm = _members.InstanceMethods.InvokeAbstractObjectMethod(__id, this, __args); + return global::Java.Lang.Object.GetObject(__rm.Handle, JniHandleOwnership.TransferLocalRef); + } finally { + global::System.GC.KeepAlive(xIndexRange); + } + } + } +} diff --git a/samples/scichart-dotnet-android-bindings/README.md b/samples/scichart-dotnet-android-bindings/README.md new file mode 100644 index 0000000..cfd0b01 --- /dev/null +++ b/samples/scichart-dotnet-android-bindings/README.md @@ -0,0 +1,186 @@ +# SciChart .NET Android Binding Library + +This project provides a .NET Android binding for the SciChart Android charting library, enabling you to use SciChart's powerful charting capabilities in your .NET MAUI, Xamarin.Android, or .NET Android applications. + +## Project Overview + +This binding library wraps the SciChart Android Java libraries (provided as `.aar` files) and exposes them as C# APIs for use in .NET Android applications. The project includes custom transformations and additions to handle binding generator gaps and provide a more idiomatic .NET API surface. + +### Target Framework + +- **Target Framework:** `net8.0-android` +- **Minimum Android API Level:** API 21 (Android 5.0) + +### SciChart Libraries Included + +The binding wraps the following SciChart Android libraries: + +1. `charting-release.aar` - Core 2D charting functionality +2. `charting3d-release.aar` - 3D charting functionality +3. `core-release.aar` - Core framework components +4. `data-release.aar` - Data handling and series +5. `drawing-release.aar` - Drawing and rendering components +6. `extensions-release.aar` - 2D chart extensions and utilities +7. `extensions3d-release.aar` - 3D chart extensions and utilities + +## Prerequisites + +Before building this project, ensure you have: + +1. **.NET SDK 8.0 or later** - Required for `net8.0-android` target framework +2. **Android workload for .NET** - Install using: `dotnet workload install android` +3. **Android SDK** - Required for Android development tools +4. **Java JDK** - Required for Java interop and binding generation +5. **SciChart .aar files** - The 7 `.aar` files listed above + +## Setup Instructions + +### Step 1: Add the Required .aar Files + +Place all 7 SciChart `.aar` files in the **root directory** of the project (the same directory where `SciChart.csproj` is located): + +``` +SciChart/ +├── SciChart.csproj +├── charting-release.aar ← Place here +├── charting3d-release.aar ← Place here +├── core-release.aar ← Place here +├── data-release.aar ← Place here +├── drawing-release.aar ← Place here +├── extensions-release.aar ← Place here +├── extensions3d-release.aar ← Place here +├── Additions/ +├── Transforms/ +└── ... +``` + +**Important:** The .NET Android binding SDK automatically detects `.aar` files placed in the project root directory. No explicit configuration in the `.csproj` file is needed. + +### Step 2: Verify Project Structure + +Ensure your project structure includes: + +- `SciChart.csproj` - The project file +- `Transforms/Metadata.xml` - Metadata transformations for binding customization +- `Transforms/EnumFields.xml` - Enum field mappings (if present) +- `Transforms/EnumMethods.xml` - Enum method mappings (if present) +- `Additions/` folder - Contains C# partial classes and extensions for binding fixes + +## Building the Project + +### Build in Debug Configuration + +To build the project in Debug mode: + +```bash +dotnet build -c Debug +``` + +### Build in Release Configuration + +To build the project in Release mode: + +```bash +dotnet build -c Release +``` + +### Clean Build + +If you need to perform a clean build (removes all build artifacts first): + +```bash +dotnet clean -c Debug +dotnet build -c Debug +``` + +Or for Release: + +```bash +dotnet clean -c Release +dotnet build -c Release +``` + +## Build Output + +After a successful build, the output files will be located in the following directories: + +### Debug Build Output + +**Location:** `bin/Debug/net8.0-android/` + +**Files Generated:** +- `SciChart.dll` - The compiled binding library (main output) +- `SciChart.pdb` - Debug symbols for debugging +- `SciChart.xml` - XML documentation (if available) +- All 7 `.aar` files (copied from project root) + +### Release Build Output + +**Location:** `bin/Release/net8.0-android/` + +**Files Generated:** +- `SciChart.dll` - The compiled binding library (main output) +- `SciChart.pdb` - Release symbols +- `SciChart.xml` - XML documentation (if available) +- All 7 `.aar` files (copied from project root) + +## Using the Binding Library + +To use this binding library in your .NET Android application: + +1. **Add a project reference** to this binding project in your application's `.csproj`: + ```xml + + ``` + +2. **Or reference the compiled DLL** directly: + ```xml + + path/to/bin/Debug/net8.0-android/SciChart.dll + + ``` + +3. The `.aar` files will be automatically included when you reference the binding library. + +## Project Structure + +### Additions/ + +The `Additions/` folder contains C# partial classes and extensions that supplement the generated bindings. These files address binding generator limitations and provide: + +- Interface adapters for Xamarin.Android compatibility +- Extension methods for improved API ergonomics +- Partial class implementations for missing or problematic generated code +- Generic collection helpers +- Type adapters for data series and calculators + +See `ChangesSummary.md` for detailed information about what each addition file addresses. + +### Transforms/ + +The `Transforms/` folder contains XML metadata files that customize the binding generation: + +- **Metadata.xml** - Main metadata transformations that: + - Relax abstract/final modifiers where needed + - Map Java types to .NET types + - Rename methods/properties for .NET conventions + - Adjust method signatures for compatibility + +- **EnumFields.xml** - Enum field mappings (if present) +- **EnumMethods.xml** - Enum method mappings (if present) + +## Troubleshooting + +### Build Errors + +If you encounter build errors: + +1. **Verify .aar files are present** - Ensure all 7 `.aar` files are in the project root directory +2. **Clean and rebuild** - Try `dotnet clean` followed by `dotnet build` +3. **Check .NET SDK version** - Ensure you're using .NET SDK 8.0 or later +4. **Verify Android SDK** - Ensure Android SDK is properly installed and configured + +### Common Issues + +- **Missing .aar files**: The build will fail if any of the required `.aar` files are missing from the project root +- **Binding errors**: If new binding errors appear after updating SciChart libraries, you may need to update `Transforms/Metadata.xml` or add new files to `Additions/` diff --git a/samples/scichart-dotnet-android-bindings/SciChart.csproj b/samples/scichart-dotnet-android-bindings/SciChart.csproj new file mode 100644 index 0000000..3676f6a --- /dev/null +++ b/samples/scichart-dotnet-android-bindings/SciChart.csproj @@ -0,0 +1,9 @@ + + + net8.0-android + 21 + SciChart_Charting + enable + enable + + \ No newline at end of file diff --git a/samples/scichart-dotnet-android-bindings/Transforms/EnumFields.xml b/samples/scichart-dotnet-android-bindings/Transforms/EnumFields.xml new file mode 100644 index 0000000..2295995 --- /dev/null +++ b/samples/scichart-dotnet-android-bindings/Transforms/EnumFields.xml @@ -0,0 +1,14 @@ + + + \ No newline at end of file diff --git a/samples/scichart-dotnet-android-bindings/Transforms/EnumMethods.xml b/samples/scichart-dotnet-android-bindings/Transforms/EnumMethods.xml new file mode 100644 index 0000000..49216c6 --- /dev/null +++ b/samples/scichart-dotnet-android-bindings/Transforms/EnumMethods.xml @@ -0,0 +1,13 @@ + + + \ No newline at end of file diff --git a/samples/scichart-dotnet-android-bindings/Transforms/Metadata.xml b/samples/scichart-dotnet-android-bindings/Transforms/Metadata.xml new file mode 100644 index 0000000..366df35 --- /dev/null +++ b/samples/scichart-dotnet-android-bindings/Transforms/Metadata.xml @@ -0,0 +1,139 @@ + + + false + false + false + false + false + false + + false + false + + false + false + + + LayoutParameters + Android.Views.ViewGroup.LayoutParams + LayoutParameters + Android.Views.ViewGroup.LayoutParams + + + false + false + + + false + false + false + + + false + false + false + + false + false + + + LayoutParameters + LayoutParameters + LayoutParameters + LayoutParameters + + Java.Lang.Object + string + GetString + Java.Lang.Object + Java.Lang.Object + string + GetString + Java.Lang.Object + Java.Lang.Object + Java.Lang.Object + + + false + false + false + + + false + false + false + false + false + false + + false + false + false + false + + + false + false + + false + false + + + false + false + + + false + false + false + + + false + false + + + StartX + StartX + StartY + StartY + StepX + StepX + StepY + StepY + + + false + false + false + false + false + false + false + false + false + false + false + false + false + false + false + Java.Lang.Object + Java.Lang.Object + Com.Scichart.Core.Common.IAction2 + Android.Graphics.PointF + Com.Scichart.Core.Common.IAction2 + Android.Graphics.PointF + Com.Scichart.Core.Common.IAction2 + Android.Graphics.PointF + Com.Scichart.Core.Common.IAction2 + Android.Graphics.PointF + Com.Scichart.Data.Model.IRange + Com.Scichart.Data.Model.IRange + Com.Scichart.Data.Model.IRange + false + + SetIsEnabledInternal + SetReceiveHandledEventsInternal + Java.Lang.Object + +