From 19a11e5854f33d3ea8d2763cf21ee4952bff2f87 Mon Sep 17 00:00:00 2001 From: "joogab.yun" Date: Wed, 23 Oct 2024 15:54:52 +0900 Subject: [PATCH] PenWave --- .../Properties/AssemblyInfo.cs | 4 + .../Tizen.NUI.PenWave.csproj | 17 + src/Tizen.NUI.PenWave/Tizen.NUI.PenWave.sln | 79 ++++ .../src/public/Common/PWConstants.cs | 25 ++ .../src/public/Components/IToolPickerView.cs | 31 ++ .../src/public/Components/ToolPickerView.cs | 116 ++++++ .../src/public/Contents/Image.cs | 47 +++ .../src/public/Contents/Note.cs | 42 ++ .../src/public/Contents/Page.cs | 32 ++ .../src/public/PWCanvasView.cs | 150 +++++++ src/Tizen.NUI.PenWave/src/public/PWEngine.cs | 387 ++++++++++++++++++ .../src/public/Tools/ITool.cs | 40 ++ .../src/public/Tools/Icon.cs | 72 ++++ .../src/public/Tools/Pencil/BrushIcon.cs | 122 ++++++ .../src/public/Tools/Pencil/ColorIcon.cs | 61 +++ .../src/public/Tools/Pencil/PenInk.cs | 108 +++++ .../src/public/Tools/Pencil/PencilTool.cs | 217 ++++++++++ .../src/public/Tools/Pencil/SizeIcon.cs | 53 +++ .../src/public/Tools/Select/SelectTool.cs | 40 ++ .../src/public/Tools/ToolManager.cs | 93 +++++ .../Tizen.NUI.PenWave.Sample.csproj | 42 ++ .../Tizen.NUI.PenWave.Sample.sln | 97 +++++ .../shared/res/Tizen.NUI.PenWave.Sample.png | Bin 0 -> 2711 bytes .../src/PenWaveSample.cs | 106 +++++ .../tizen-manifest.xml | 16 + .../2f6b85a4-af3f-499f-b246-4977ffa9e82a.png | Bin 0 -> 3653 bytes .../415a22d6-aaf8-41b0-9255-fb4ece7e2ae9.png | Bin 0 -> 3653 bytes .../7175d419-b55a-4f39-a366-fb1d21513816.png | Bin 0 -> 3653 bytes .../7463530e-1798-4c45-a6ea-4fbf296d6737.png | Bin 0 -> 3653 bytes .../965b17c3-5398-4315-8210-8d1300849050.png | Bin 0 -> 3653 bytes .../9887a5e3-0e30-4562-b1e9-1b24e6df593c.png | Bin 0 -> 3653 bytes .../a1192eb1-9e6d-4a3c-8018-bcfd903ee8ca.png | Bin 0 -> 3653 bytes .../b053d936-b242-4096-9fa1-13020001a1c1.png | Bin 0 -> 3653 bytes 33 files changed, 1997 insertions(+) create mode 100755 src/Tizen.NUI.PenWave/Properties/AssemblyInfo.cs create mode 100755 src/Tizen.NUI.PenWave/Tizen.NUI.PenWave.csproj create mode 100755 src/Tizen.NUI.PenWave/Tizen.NUI.PenWave.sln create mode 100644 src/Tizen.NUI.PenWave/src/public/Common/PWConstants.cs create mode 100644 src/Tizen.NUI.PenWave/src/public/Components/IToolPickerView.cs create mode 100644 src/Tizen.NUI.PenWave/src/public/Components/ToolPickerView.cs create mode 100644 src/Tizen.NUI.PenWave/src/public/Contents/Image.cs create mode 100644 src/Tizen.NUI.PenWave/src/public/Contents/Note.cs create mode 100644 src/Tizen.NUI.PenWave/src/public/Contents/Page.cs create mode 100644 src/Tizen.NUI.PenWave/src/public/PWCanvasView.cs create mode 100644 src/Tizen.NUI.PenWave/src/public/PWEngine.cs create mode 100644 src/Tizen.NUI.PenWave/src/public/Tools/ITool.cs create mode 100644 src/Tizen.NUI.PenWave/src/public/Tools/Icon.cs create mode 100644 src/Tizen.NUI.PenWave/src/public/Tools/Pencil/BrushIcon.cs create mode 100644 src/Tizen.NUI.PenWave/src/public/Tools/Pencil/ColorIcon.cs create mode 100644 src/Tizen.NUI.PenWave/src/public/Tools/Pencil/PenInk.cs create mode 100644 src/Tizen.NUI.PenWave/src/public/Tools/Pencil/PencilTool.cs create mode 100644 src/Tizen.NUI.PenWave/src/public/Tools/Pencil/SizeIcon.cs create mode 100644 src/Tizen.NUI.PenWave/src/public/Tools/Select/SelectTool.cs create mode 100644 src/Tizen.NUI.PenWave/src/public/Tools/ToolManager.cs create mode 100644 test/Tizen.NUI.PenWave.Sample/Tizen.NUI.PenWave.Sample.csproj create mode 100755 test/Tizen.NUI.PenWave.Sample/Tizen.NUI.PenWave.Sample.sln create mode 100644 test/Tizen.NUI.PenWave.Sample/shared/res/Tizen.NUI.PenWave.Sample.png create mode 100644 test/Tizen.NUI.PenWave.Sample/src/PenWaveSample.cs create mode 100755 test/Tizen.NUI.PenWave.Sample/tizen-manifest.xml create mode 100644 test/Tizen.NUI.PenWave.Sample/tmp/thumbnails/2f6b85a4-af3f-499f-b246-4977ffa9e82a.png create mode 100644 test/Tizen.NUI.PenWave.Sample/tmp/thumbnails/415a22d6-aaf8-41b0-9255-fb4ece7e2ae9.png create mode 100644 test/Tizen.NUI.PenWave.Sample/tmp/thumbnails/7175d419-b55a-4f39-a366-fb1d21513816.png create mode 100644 test/Tizen.NUI.PenWave.Sample/tmp/thumbnails/7463530e-1798-4c45-a6ea-4fbf296d6737.png create mode 100644 test/Tizen.NUI.PenWave.Sample/tmp/thumbnails/965b17c3-5398-4315-8210-8d1300849050.png create mode 100644 test/Tizen.NUI.PenWave.Sample/tmp/thumbnails/9887a5e3-0e30-4562-b1e9-1b24e6df593c.png create mode 100644 test/Tizen.NUI.PenWave.Sample/tmp/thumbnails/a1192eb1-9e6d-4a3c-8018-bcfd903ee8ca.png create mode 100644 test/Tizen.NUI.PenWave.Sample/tmp/thumbnails/b053d936-b242-4096-9fa1-13020001a1c1.png diff --git a/src/Tizen.NUI.PenWave/Properties/AssemblyInfo.cs b/src/Tizen.NUI.PenWave/Properties/AssemblyInfo.cs new file mode 100755 index 00000000000..58d444169cb --- /dev/null +++ b/src/Tizen.NUI.PenWave/Properties/AssemblyInfo.cs @@ -0,0 +1,4 @@ +using Tizen.NUI; + +// Xamarin.Forms.Loader.dll Xamarin.Forms.Xaml.XamlLoader.Load(object, string), kzu@microsoft.com +[assembly: XmlnsDefinition("http://tizen.org/Tizen.NUI/2018/XAML", "Tizen.NUI.PenWave")] diff --git a/src/Tizen.NUI.PenWave/Tizen.NUI.PenWave.csproj b/src/Tizen.NUI.PenWave/Tizen.NUI.PenWave.csproj new file mode 100755 index 00000000000..4d078cb95e2 --- /dev/null +++ b/src/Tizen.NUI.PenWave/Tizen.NUI.PenWave.csproj @@ -0,0 +1,17 @@ + + + + net6.0 + $(NoWarn);CS0618;CA1054;CA1056 + + + + + + + + + + + + diff --git a/src/Tizen.NUI.PenWave/Tizen.NUI.PenWave.sln b/src/Tizen.NUI.PenWave/Tizen.NUI.PenWave.sln new file mode 100755 index 00000000000..ce4854b735a --- /dev/null +++ b/src/Tizen.NUI.PenWave/Tizen.NUI.PenWave.sln @@ -0,0 +1,79 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.31515.178 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.NUI.PenWave", "Tizen.NUI.PenWave.csproj", "{F6CEE887-775A-4623-8BF8-DCA18C363D62}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.NUI", "..\Tizen.NUI\Tizen.NUI.csproj", "{F9DAA9C3-593D-467E-B02C-FFF51F1BC8CD}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Applications.Common", "..\Tizen.Applications.Common\Tizen.Applications.Common.csproj", "{CE90CD24-82F7-45A3-96B2-2E3C97D25C30}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.System.SystemSettings", "..\Tizen.System.SystemSettings\Tizen.System.SystemSettings.csproj", "{D726EEB8-6382-4BA3-BE0C-D9E61B5D8374}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\Tizen\Tizen.csproj", "{6D5FFD69-6DCC-4953-85E9-C23AC18B190E}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.System.Information", "..\Tizen.System.Information\Tizen.System.Information.csproj", "{A951EAFE-D191-4F45-9AEF-7D97C382A747}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\Tizen.Log\Tizen.Log.csproj", "{E1E30AEC-AD46-4E53-B9B1-780A68B59963}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Applications.ComponentBased", "..\Tizen.Applications.ComponentBased\Tizen.Applications.ComponentBased.csproj", "{70341AA2-1324-4215-9DB8-BFB13389D932}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Applications.ThemeManager", "..\Tizen.Applications.ThemeManager\Tizen.Applications.ThemeManager.csproj", "{F6A776BF-6743-4C1D-A8AF-F3E9F8CEFA0A}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Tracer", "..\Tizen.Tracer\Tizen.Tracer.csproj", "{6DABE78F-1816-4F2E-8966-F909173194C8}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {F6CEE887-775A-4623-8BF8-DCA18C363D62}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F6CEE887-775A-4623-8BF8-DCA18C363D62}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F6CEE887-775A-4623-8BF8-DCA18C363D62}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F6CEE887-775A-4623-8BF8-DCA18C363D62}.Release|Any CPU.Build.0 = Release|Any CPU + {F9DAA9C3-593D-467E-B02C-FFF51F1BC8CD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F9DAA9C3-593D-467E-B02C-FFF51F1BC8CD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F9DAA9C3-593D-467E-B02C-FFF51F1BC8CD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F9DAA9C3-593D-467E-B02C-FFF51F1BC8CD}.Release|Any CPU.Build.0 = Release|Any CPU + {CE90CD24-82F7-45A3-96B2-2E3C97D25C30}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CE90CD24-82F7-45A3-96B2-2E3C97D25C30}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CE90CD24-82F7-45A3-96B2-2E3C97D25C30}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CE90CD24-82F7-45A3-96B2-2E3C97D25C30}.Release|Any CPU.Build.0 = Release|Any CPU + {D726EEB8-6382-4BA3-BE0C-D9E61B5D8374}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D726EEB8-6382-4BA3-BE0C-D9E61B5D8374}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D726EEB8-6382-4BA3-BE0C-D9E61B5D8374}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D726EEB8-6382-4BA3-BE0C-D9E61B5D8374}.Release|Any CPU.Build.0 = Release|Any CPU + {6D5FFD69-6DCC-4953-85E9-C23AC18B190E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6D5FFD69-6DCC-4953-85E9-C23AC18B190E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6D5FFD69-6DCC-4953-85E9-C23AC18B190E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6D5FFD69-6DCC-4953-85E9-C23AC18B190E}.Release|Any CPU.Build.0 = Release|Any CPU + {A951EAFE-D191-4F45-9AEF-7D97C382A747}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A951EAFE-D191-4F45-9AEF-7D97C382A747}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A951EAFE-D191-4F45-9AEF-7D97C382A747}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A951EAFE-D191-4F45-9AEF-7D97C382A747}.Release|Any CPU.Build.0 = Release|Any CPU + {E1E30AEC-AD46-4E53-B9B1-780A68B59963}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E1E30AEC-AD46-4E53-B9B1-780A68B59963}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E1E30AEC-AD46-4E53-B9B1-780A68B59963}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E1E30AEC-AD46-4E53-B9B1-780A68B59963}.Release|Any CPU.Build.0 = Release|Any CPU + {70341AA2-1324-4215-9DB8-BFB13389D932}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {70341AA2-1324-4215-9DB8-BFB13389D932}.Debug|Any CPU.Build.0 = Debug|Any CPU + {70341AA2-1324-4215-9DB8-BFB13389D932}.Release|Any CPU.ActiveCfg = Release|Any CPU + {70341AA2-1324-4215-9DB8-BFB13389D932}.Release|Any CPU.Build.0 = Release|Any CPU + {F6A776BF-6743-4C1D-A8AF-F3E9F8CEFA0A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F6A776BF-6743-4C1D-A8AF-F3E9F8CEFA0A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F6A776BF-6743-4C1D-A8AF-F3E9F8CEFA0A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F6A776BF-6743-4C1D-A8AF-F3E9F8CEFA0A}.Release|Any CPU.Build.0 = Release|Any CPU + {6DABE78F-1816-4F2E-8966-F909173194C8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6DABE78F-1816-4F2E-8966-F909173194C8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6DABE78F-1816-4F2E-8966-F909173194C8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6DABE78F-1816-4F2E-8966-F909173194C8}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {83C85CFB-3AB8-403A-9F6D-CC2783C6C559} + EndGlobalSection +EndGlobal diff --git a/src/Tizen.NUI.PenWave/src/public/Common/PWConstants.cs b/src/Tizen.NUI.PenWave/src/public/Common/PWConstants.cs new file mode 100644 index 00000000000..fac4abca101 --- /dev/null +++ b/src/Tizen.NUI.PenWave/src/public/Common/PWConstants.cs @@ -0,0 +1,25 @@ + // Copyright (c) 2019 Samsung Electronics Co., Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System; +using System.ComponentModel; +using System.Diagnostics.CodeAnalysis; + +namespace Tizen.NUI.PenWave +{ + internal struct FrameworkInformation + { + public readonly static string ResourcePath = "/usr/share/dotnet.tizen/framework/res/"; + } +} \ No newline at end of file diff --git a/src/Tizen.NUI.PenWave/src/public/Components/IToolPickerView.cs b/src/Tizen.NUI.PenWave/src/public/Components/IToolPickerView.cs new file mode 100644 index 00000000000..797d53abe95 --- /dev/null +++ b/src/Tizen.NUI.PenWave/src/public/Components/IToolPickerView.cs @@ -0,0 +1,31 @@ +/* + * Copyright(c) 2024 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +using Tizen.NUI; +using Tizen.NUI.BaseComponents; + +namespace Tizen.NUI.PenWave +{ + + public interface IToolPickerView + { + public void AddCustomToolIcon(View view); + public void RemoveCustomToolIcon(View view); + public void ShowTool(ITool.ToolType type); + public void HideTool(ITool.ToolType type); + } +} \ No newline at end of file diff --git a/src/Tizen.NUI.PenWave/src/public/Components/ToolPickerView.cs b/src/Tizen.NUI.PenWave/src/public/Components/ToolPickerView.cs new file mode 100644 index 00000000000..49829043b55 --- /dev/null +++ b/src/Tizen.NUI.PenWave/src/public/Components/ToolPickerView.cs @@ -0,0 +1,116 @@ +/* + * Copyright(c) 2024 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +using System; +using System.ComponentModel; +using System.Collections.Generic; +using Tizen.NUI; +using Tizen.NUI.BaseComponents; + +namespace Tizen.NUI.PenWave +{ + public class ToolPickerView : View, IToolPickerView + { + private ToolManager mToolManager; + private View mRootView; + private Dictionary mToolIcons; + // private List mCustomIcons; + + public ToolPickerView(ToolManager toolManager, View rootView = null) + { + if (toolManager == null) + { + return; + } + mToolManager = toolManager; + mRootView = rootView; + mToolIcons = new Dictionary(); + // mCustomIcons = new List(); + mToolManager.ToolChanged += OnToolChanged; + + InitialDefaultUI(); + } + + private void InitialDefaultUI() + { + if (mRootView == null) + { + mRootView = new View() + { + CornerRadius = new Vector4(10, 10, 10, 10), + BackgroundImage = FrameworkInformation.ResourcePath + "images/" + "light" + "/toolbox_bg.png", + WidthSpecification = LayoutParamPolicies.WrapContent, + HeightSpecification = LayoutParamPolicies.WrapContent, + Layout = new GridLayout() + { + Columns = 1, + RowSpacing = 4, + Padding = new Extents(16, 16, 16, 16) + }, + }; + } + this.Add(mRootView); + UpdateUI(); + } + + public void ShowTool(ITool.ToolType type) + { + View toolView; + if (mToolIcons.TryGetValue(type, out toolView)) + { + mRootView.Add(toolView); + } + } + + public void HideTool(ITool.ToolType type) + { + View toolView; + if (mToolIcons.TryGetValue(type, out toolView)) + { + mRootView.Remove(toolView); + } + } + + public void AddCustomToolIcon(View view) + { + mRootView.Add(view); + } + + public void RemoveCustomToolIcon(View view) + { + mRootView.Remove(view); + } + + private void UpdateUI() + { + foreach (ITool tool in mToolManager.Tools.Values) { + View toolView = tool.GetUI(); + if (mToolIcons.TryAdd(tool.Type, toolView)) + { + mRootView.Add(toolView); + } + } + } + + private void OnToolChanged(ITool.ToolType toolType, int type) + { + // UpdateUI(); + } + + + } +} \ No newline at end of file diff --git a/src/Tizen.NUI.PenWave/src/public/Contents/Image.cs b/src/Tizen.NUI.PenWave/src/public/Contents/Image.cs new file mode 100644 index 00000000000..5a28bfbbb5e --- /dev/null +++ b/src/Tizen.NUI.PenWave/src/public/Contents/Image.cs @@ -0,0 +1,47 @@ +/* + * Copyright(c) 2024 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +using System; +using System.ComponentModel; +using System.Collections.Generic; +using Tizen.NUI; +using Tizen.NUI.BaseComponents; + +namespace Tizen.NUI.PenWave +{ + public class Image + { + public string Url {get; set;} + public Position2D Position {get; set;} + public Size2D Size {get; set;} + + public void Move(float x, float y) + { + + } + + public void Resize(float width, float height) + { + + } + + public void Scale(float scale) + { + + } + + } +} \ No newline at end of file diff --git a/src/Tizen.NUI.PenWave/src/public/Contents/Note.cs b/src/Tizen.NUI.PenWave/src/public/Contents/Note.cs new file mode 100644 index 00000000000..2775eeee9ee --- /dev/null +++ b/src/Tizen.NUI.PenWave/src/public/Contents/Note.cs @@ -0,0 +1,42 @@ +/* + * Copyright(c) 2024 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +using System; +using System.ComponentModel; +using System.Collections.Generic; +using Tizen.NUI; +using Tizen.NUI.BaseComponents; + +namespace Tizen.NUI.PenWave +{ + public class Note + { + public Position2D Position {get; set;} + public Size2D Size {get; set;} + public Color BackgroundColor {get; set;} + + public void ClearNote() + { + + } + + public void HandleInput() + { + + } + } +} \ No newline at end of file diff --git a/src/Tizen.NUI.PenWave/src/public/Contents/Page.cs b/src/Tizen.NUI.PenWave/src/public/Contents/Page.cs new file mode 100644 index 00000000000..b06f00d2793 --- /dev/null +++ b/src/Tizen.NUI.PenWave/src/public/Contents/Page.cs @@ -0,0 +1,32 @@ +/* + * Copyright(c) 2024 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +using System; +using System.ComponentModel; +using System.Collections.Generic; +using Tizen.NUI; +using Tizen.NUI.BaseComponents; + +namespace Tizen.NUI.PenWave +{ + public class Page + { + public int PageNumber {get; set;} + public List Notes {get; set;} + public List Images {get; set;} + } +} \ No newline at end of file diff --git a/src/Tizen.NUI.PenWave/src/public/PWCanvasView.cs b/src/Tizen.NUI.PenWave/src/public/PWCanvasView.cs new file mode 100644 index 00000000000..0b60c2665be --- /dev/null +++ b/src/Tizen.NUI.PenWave/src/public/PWCanvasView.cs @@ -0,0 +1,150 @@ +/* + * Copyright(c) 2024 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +using System; +using System.ComponentModel; +using System.Collections.Generic; +using Tizen.NUI; +using Tizen.NUI.BaseComponents; + +namespace Tizen.NUI.PenWave +{ + public class PWCanvasView : DirectRenderingGLView + { + public uint ID {get; set;} + public ToolManager ToolManager {get; private set;} + public List Pages {get; set;} + public Color BackgroundColor {get; set;} + public Size2D Size {get; set;} + public Position2D position {get; set;} + + private PropertyNotification propertyNotification; + + private readonly string FontPath = FrameworkInformation.ResourcePath + "fonts/font.ttf"; + private readonly string[] TexturePaths = { + FrameworkInformation.ResourcePath + "images/textures/brush_acrylic.png", + FrameworkInformation.ResourcePath + "images/textures/brush_sponge.png", + FrameworkInformation.ResourcePath + "images/textures/dot_brush.png", + FrameworkInformation.ResourcePath + "images/textures/highlighter.png", + FrameworkInformation.ResourcePath + "images/textures/soft_brush.png" + }; + + public PWCanvasView() : base(DirectRenderingGLView.ColorFormat.RGBA8888, DirectRenderingGLView.BackendMode.UnsafeDirectRendering) + { + ID = PWEngine.CreateCanvas(-1, -1); + InitialCanvasView(); + } + + public PWCanvasView(string backgroundPath) : base(DirectRenderingGLView.ColorFormat.RGBA8888, DirectRenderingGLView.BackendMode.UnsafeDirectRendering) + { + ID = PWEngine.CreateCanvasWithBackgroundImage(backgroundPath); + InitialCanvasView(); + } + + private void InitialCanvasView() + { + PWEngine.SetCurrentCanvas(ID); + PWEngine.SetResourcePath(FrameworkInformation.ResourcePath + "images/"); + PWEngine.SetFontPath(FontPath); + PWEngine.SetTexturePaths(TexturePaths, TexturePaths.Length); + + this.ToolManager = new ToolManager(this); + this.WidthResizePolicy = ResizePolicyType.FillToParent; + this.HeightResizePolicy = ResizePolicyType.FillToParent; + this.SetGraphicsConfig(false, false, 0, GLESVersion.Version20); + this.RenderingMode = GLRenderingMode.Continuous; + this.RegisterGLCallbacks(PWEngine.InitializeGL, OnRender, PWEngine.TerminateGL); + + propertyNotification = this.AddPropertyNotification("size", PropertyCondition.Step(1.0f)); + propertyNotification.Notified += (object source, PropertyNotification.NotifyEventArgs args) => + { + Tizen.NUI.BaseComponents.View target = args.PropertyNotification.GetTarget() as Tizen.NUI.BaseComponents.View; + if (target != null) + { + PWEngine.UpdateGLWindowSize((int)target.SizeWidth, (int)target.SizeHeight); + PWEngine.RenderFullyReDraw(); + } + }; + // this.TouchEvent += OnTouchEvent; + } + + + // private bool OnTouchEvent(object source, View.TouchEventArgs e) + // { + // ToolManager.HandleInput(e.Touch); + // return false; + // } + + private int OnRender(in DirectRenderingGLView.RenderCallbackInput input) + { + return PWEngine.RenderFrameGL(); + } + + + public void AddPage() + { + + } + + public void SetCurrentPage(int pageIndex) + { + + } + + public void ClearCanvas() + { + + } + + public void TakeScreenShot(float x, float y, float width, float height) + { + + } + + public void ToggleGrid(int densityType) + { + + } + + public void DoOperation(int operitionType) + { + //Undo, Redo, ResetUndo, ResetRedo + } + + public void Export(int exportType, string filePath) + { + + } + + public void HandleInput(Touch touch) + { + ToolManager.HandleInput(touch); + } + + protected override void Dispose(DisposeTypes type) + { + if(disposed) + { + return; + } + + PWEngine.TerminateGL(); + + base.Dispose(type); + } + } +} \ No newline at end of file diff --git a/src/Tizen.NUI.PenWave/src/public/PWEngine.cs b/src/Tizen.NUI.PenWave/src/public/PWEngine.cs new file mode 100644 index 00000000000..95ecb69850f --- /dev/null +++ b/src/Tizen.NUI.PenWave/src/public/PWEngine.cs @@ -0,0 +1,387 @@ +using System; +using System.Text; +using System.Runtime.InteropServices; + +using Tizen.NUI; +using Tizen.NUI.BaseComponents; +using System.ComponentModel; +using System.Net.Http.Headers; +using System.Data; + +namespace Tizen.NUI.PenWave +{ + + public class PWEngineDelegates + { + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + public delegate void ThumbnailSavedDelegate(); + + static public ThumbnailSavedDelegate mSwapThumbnailsDelegate = null; + } + + + public static class PWEngine + { + + public enum BrushType + { + Stroke, + VarStroke, + DotBrush, + SprayBrush, + DashedLine, + Highlighter, + VarStrokeInc, + SoftBrush, + SharpBrush + } + + public const string Lib = "libhand-drawing-engine.so"; + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "InitializeGL")] + public static extern void InitializeGL(); + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "RenderFrameGL")] + public static extern int RenderFrameGL(); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "RenderFullyReDraw")] + public static extern void RenderFullyReDraw(); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "TerminateGL")] + public static extern void TerminateGL(); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "UpdateGLWindowSize")] + public static extern void UpdateGLWindowSize(int w, int h); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "UpdateGLWindowOrientation")] + public static extern void UpdateGLWindowOrientation(int angle); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "BeginShapeDraw")] + public static extern uint BeginShapeDraw(float x, float y, uint time = 1); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "DrawShape")] + public static extern int DrawShape(uint shapeID, float x, float y, uint time = 1); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "EndShapeDraw")] + public static extern int EndShapeDraw(uint shapeID, uint time = 1); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "StopErasing")] + public static extern void StopErasing(); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "EraseShape")] + [return:MarshalAs(UnmanagedType.I1)] + public static extern bool EraseShape(int x, int y, float radius, [MarshalAs(UnmanagedType.I1)] bool partial); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "AddRectanglePath")] + public static extern uint AddRectanglePath(float xStart, float yStart, float x, float y, bool finished); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "AddArcPath")] + public static extern uint AddArcPath(float xCenter, float yCenter, float radius, float x, float y, bool finished); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "ResizeShapePath")] + public static extern int ResizeShapePath(uint shapeID, float x, float y); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "FinishShapePath")] + public static extern int FinishShapePath(uint shapeID); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "CanvasZoomBegin")] + public static extern bool CanvasZoomBegin(); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "CanvasZoom")] + public static extern bool CanvasZoom(float x, float y, float zoom, float dx, float dy); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "CanvasZoomEnd")] + public static extern bool CanvasZoomEnd(); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "CanvasGetZoomValue")] + public static extern int CanvasGetZoomValue(); + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "CanvasSetZoomValue")] + public static extern float CanvasSetZoomValue(float zoomValue); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "CanvasMoveBegin")] + public static extern bool CanvasMoveBegin(); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "CanvasMove")] + public static extern bool CanvasMove(int x, int y); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "CanvasMoveEnd")] + public static extern bool CanvasMoveEnd(); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "CanvasSetColor")] + public static extern void CanvasSetColor([MarshalAs(UnmanagedType.LPStr)] string hexColor, float a); + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "CanvasSetSize")] + public static extern void CanvasSetSize(int width, int height); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "SetResourcePath")] + public static extern void SetResourcePath([MarshalAs(UnmanagedType.LPStr)] string resourcePath); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "SetFontPath")] + public static extern void SetFontPath([MarshalAs(UnmanagedType.LPStr)] string fontPath); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "SetTexturePaths")] + public static extern void SetTexturePaths([MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPStr)] string[] texturePaths, int textureCount); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "SetStrokeSize")] + public static extern void SetStrokeSize(float val); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "SetStrokeColor")] + public static extern void SetStrokeColor([MarshalAs(UnmanagedType.LPStr)] string hexColor, float a); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "SetStrokeType")] + public static extern void SetStrokeType(int brushId); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "SetBrushTexture")] + public static extern void SetBrushTexture(int textureId); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "SetBrushDistance")] + public static extern void SetBrushDistance(float distance); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "SetDashArray")] + public static extern void SetDashArray([MarshalAs(UnmanagedType.LPStr)] string dashArray); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "SetLineAngle")] + public static extern void SetLineAngle(float angle); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "GetBrushSize")] + public static extern float GetBrushSize(); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "GetBrushColor")] + public static extern float GetBrushColor([MarshalAs(UnmanagedType.LPStr)] StringBuilder hex); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "GetBrushType")] + public static extern int GetBrushType(); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "GetBrushTexture")] + public static extern int GetBrushTexture(); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "GetBrushDistance")] + public static extern float GetBrushDistance(); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "GetLineAngle")] + public static extern float GetLineAngle(); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "GetShapeCount")] + public static extern int GetShapeCount(); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "CreateCanvas")] + public static extern uint CreateCanvas(int canvasWidth, int canvasHeight); + + // #if PICTURE + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "CreateCanvasWithBackgroundImage")] + public static extern uint CreateCanvasWithBackgroundImage([MarshalAs(UnmanagedType.LPStr)] string path); + // #endif + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "SetCurrentCanvas")] + public static extern void SetCurrentCanvas(uint canvasID); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "ClearCurrentCanvas")] + public static extern void ClearCurrentCanvas(); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "StartSelectingArea")] + public static extern void StartSelectingArea(float x, float y); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "ResizeSelectedArea")] + public static extern void ResizeSelectedArea(float x, float y); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "InsideSelectedArea")] + [return:MarshalAs(UnmanagedType.I1)] + public static extern bool InsideSelectedArea(float x, float y); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "GetSelectionDimensions")] + [return:MarshalAs(UnmanagedType.I1)] + public static extern bool GetSelectionDimensions(ref float x, ref float y, ref float width, ref float height); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "TouchedDrawable")] + public static extern int TouchedDrawable(float x, float y); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "SelectDrawable")] + public static extern int SelectDrawable(float x, float y); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "SelectDrawables")] + public static extern int SelectDrawables(); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "DragSelectedDrawables")] + public static extern void DragSelectedDrawables(float x, float y); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "EndDraging")] + public static extern void EndDraging(); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "StartRotating")] + [return:MarshalAs(UnmanagedType.I1)] + public static extern bool StartRotating(float x, float y); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "RotateSelected")] + [return:MarshalAs(UnmanagedType.I1)] + public static extern bool RotateSelected(float x, float y); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "EndRotating")] + [return:MarshalAs(UnmanagedType.I1)] + public static extern bool EndRotating(float x, float y); + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "StartSelectionScale")] + public static extern void StartSelectionScale(bool anchorLeft, bool anchorRight, bool anchorTop, bool anchorBottom, ref float anchorX, ref float anchorY); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "ScaleSelection")] + public static extern void ScaleSelection(float scaleFactorX, float scaleFactorY); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "EndSelectionScale")] + public static extern void EndSelectionScale(float scaleFactorX, float scaleFactorY); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "DropSelectedDrawables")] + public static extern void DropSelectedDrawables(); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "SelectedAreaZoom")] + public static extern void SelectedAreaZoom(float x, float y, float zoom); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "SaveCanvas")] + [return:MarshalAs(UnmanagedType.I1)] + public static extern bool SaveCanvas(uint canvasID, [MarshalAs(UnmanagedType.LPStr)] string path); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "LoadCanvas")] + [return:MarshalAs(UnmanagedType.I1)] + public static extern bool LoadCanvas(uint canvasID, [MarshalAs(UnmanagedType.LPStr)] string path); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "TakeScreenshot")] + public static extern void TakeScreenshot(uint canvasID, [MarshalAs(UnmanagedType.LPStr)] string path, int x, int y, int width, int height, [MarshalAs(UnmanagedType.FunctionPtr)] PWEngineDelegates.ThumbnailSavedDelegate thumbSaved); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "ToggleGrid")] + public static extern void ToggleGrid(int densityType); + + // #if CHART + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "ToggleChartGrid")] + public static extern void ToggleChartGrid(int densityType); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "GetChartGridDensity")] + public static extern int GetChartGridDensity(); + // #endif + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "Dump")] + public static extern void Dump(); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "Copy")] + [return:MarshalAs(UnmanagedType.I1)] + public static extern bool Copy(); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "Paste")] + public static extern int Paste(float x, float y); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "Cut")] + [return:MarshalAs(UnmanagedType.I1)] + public static extern bool Cut(); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "Remove")] + [return:MarshalAs(UnmanagedType.I1)] + public static extern bool Remove(); + + // #if CHART + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "AddChart")] + public static extern void AddChart(int chartType, [MarshalAs(UnmanagedType.LPStr)] string path); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "ChangeMode")] + public static extern void ChangeMode(int mode); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "ChartPosition")] + public static extern void ChartPosition(ref float x, ref float y); + // #endif + + // #if PICTURE + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "AddPicture")] + public static extern void AddPicture([MarshalAs(UnmanagedType.LPStr)] string path); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "SetCanvasBackground")] + public static extern void SetCanvasBackground([MarshalAs(UnmanagedType.LPStr)] string path, float x, float y, float width, float height); + // #endif + + // #if TEXT + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "AddText")] + public static extern void AddText([MarshalAs(UnmanagedType.LPStr)] string text, float x, float y, float size); + // #endif + // #if NOTES + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "AddNote")] + public static extern uint AddNote(float x, float y, float w, float h); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "RemoveNote")] + public static extern void RemoveNote(uint noteID); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "ClearNote")] + public static extern void ClearNote(); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "DragNote")] + public static extern bool DragNote(float x, float y); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "EndNoteDragging")] + public static extern bool EndNoteDragging(); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "SetNoteColor")] + public static extern void SetNoteColor([MarshalAs(UnmanagedType.LPStr)] string hexColor, float a); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "SetActiveNote")] + public static extern void SetActiveNote(uint noteID); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "TouchedNote")] + public static extern uint TouchedNote(float x, float y); + // #endif + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "Undo")] + [return:MarshalAs(UnmanagedType.I1)] + public static extern bool Undo(); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "Redo")] + [return:MarshalAs(UnmanagedType.I1)] + public static extern bool Redo(); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "ResetUndo")] + public static extern void ResetUndo(); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "ResetRedo")] + public static extern void ResetRedo(); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "GetConfigurationCount")] + public static extern int GetConfigurationCount(); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "GetAllConfigurations", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr GetAllConfigurations(); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "GetConfiguration", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr GetConfiguration([MarshalAs(UnmanagedType.LPStr)] string key); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "SetConfigurationInt", CallingConvention = CallingConvention.Cdecl)] + [return:MarshalAs(UnmanagedType.I1)] + public static extern bool SetConfigurationInt([MarshalAs(UnmanagedType.LPStr)] string key, int value); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "SetConfigurationFloat", CallingConvention = CallingConvention.Cdecl)] + [return:MarshalAs(UnmanagedType.I1)] + public static extern bool SetConfigurationFloat([MarshalAs(UnmanagedType.LPStr)] string key, float value); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "SetConfigurationString", CallingConvention = CallingConvention.Cdecl)] + [return:MarshalAs(UnmanagedType.I1)] + public static extern bool SetConfigurationString([MarshalAs(UnmanagedType.LPStr)] string key, [MarshalAs(UnmanagedType.LPStr)] string value); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "SetConfigurationBool", CallingConvention = CallingConvention.Cdecl)] + [return:MarshalAs(UnmanagedType.I1)] + public static extern bool SetConfigurationBool([MarshalAs(UnmanagedType.LPStr)] string key, [MarshalAs(UnmanagedType.I1)] bool value); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "SaveProfiler")] + [return:MarshalAs(UnmanagedType.I1)] + public static extern bool SaveProfiler([MarshalAs(UnmanagedType.LPStr)] string path); + + [global::System.Runtime.InteropServices.DllImport(Lib, EntryPoint = "ResetProfiler")] + public static extern void ResetProfiler(); + + //Wrappers for Marshalled APIS + // public static void GetConfigurations(out ConfigParameter[] configParameters, out int count) + // { + // IntPtr configArrayPtr = GetAllConfigurations(); + // int engineConfigCount = GetConfigurationCount(); + // count = engineConfigCount; + + // ConfigParameter[] configArray = new ConfigParameter[count]; + + // for (int i = 0; i < count; i++) + // { + // configArray[i] = Marshal.PtrToStructure(configArrayPtr); + // configArrayPtr += Marshal.SizeOf(); + // } + + // configParameters = configArray; + // } + } +} diff --git a/src/Tizen.NUI.PenWave/src/public/Tools/ITool.cs b/src/Tizen.NUI.PenWave/src/public/Tools/ITool.cs new file mode 100644 index 00000000000..0dad44efce6 --- /dev/null +++ b/src/Tizen.NUI.PenWave/src/public/Tools/ITool.cs @@ -0,0 +1,40 @@ +/* + * Copyright(c) 2024 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +using Tizen.NUI; +using Tizen.NUI.BaseComponents; + +namespace Tizen.NUI.PenWave +{ + + public interface ITool + { + + public enum ToolType + { + Pencil, + Eraser, + Select, + Scale, + } + + public ToolType Type {get;} + public bool Activate {get; set;} + public void HandleInput(Touch touch); + public View GetUI(); + } +} \ No newline at end of file diff --git a/src/Tizen.NUI.PenWave/src/public/Tools/Icon.cs b/src/Tizen.NUI.PenWave/src/public/Tools/Icon.cs new file mode 100644 index 00000000000..a4f3c5d5921 --- /dev/null +++ b/src/Tizen.NUI.PenWave/src/public/Tools/Icon.cs @@ -0,0 +1,72 @@ +/* + * Copyright(c) 2024 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +using System; +using System.ComponentModel; +using System.Collections.Generic; +using Tizen.NUI; +using Tizen.NUI.BaseComponents; + +namespace Tizen.NUI.PenWave +{ + public abstract class Icon : View + { + protected ImageView mImgView; + protected ImageView mBorder; + + private int mDefaultSize = 48; + + public Icon() + { + Layout = new LinearLayout() + { + HorizontalAlignment = HorizontalAlignment.Center, + VerticalAlignment = VerticalAlignment.Center, + }; + this.Size2D = new Size2D(mDefaultSize, mDefaultSize); + } + + protected void InitializeIcon(string baseResourceUrl, Color color) + { + mImgView = new ImageView + { + Size2D = new Size2D(mDefaultSize, mDefaultSize), + Color = color, + ResourceUrl = baseResourceUrl + }; + this.Add(mImgView); + + mBorder = new ImageView + { + Size2D = new Size2D(mDefaultSize, mDefaultSize), + }; + } + + + public virtual void OnStateChanged() + { + mBorder.ResourceUrl = $"{FrameworkInformation.ResourcePath}images/light/color_icon_selected.png"; + } + + public virtual bool IconClick(object sender, View.TouchEventArgs args) + { + return args.Touch.GetState(0) == PointStateType.Down; + } + } +} + + diff --git a/src/Tizen.NUI.PenWave/src/public/Tools/Pencil/BrushIcon.cs b/src/Tizen.NUI.PenWave/src/public/Tools/Pencil/BrushIcon.cs new file mode 100644 index 00000000000..b3dd61d1cdd --- /dev/null +++ b/src/Tizen.NUI.PenWave/src/public/Tools/Pencil/BrushIcon.cs @@ -0,0 +1,122 @@ +/* + * Copyright(c) 2024 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +using System; +using System.ComponentModel; +using System.Collections.Generic; +using Tizen.NUI; +using Tizen.NUI.BaseComponents; + +namespace Tizen.NUI.PenWave +{ + public class BrushIcon : Icon + { + private PWEngine.BrushType mBrushType; + + private static readonly Dictionary IconMap = new Dictionary + { + { PWEngine.BrushType.Stroke, "icon_pencil" }, + { PWEngine.BrushType.VarStroke, "icon_varstroke_dec" }, + { PWEngine.BrushType.VarStrokeInc, "icon_varstroke_inc" }, + { PWEngine.BrushType.SprayBrush, "icon_spray" }, + { PWEngine.BrushType.DotBrush, "icon_dot" }, + { PWEngine.BrushType.DashedLine, "icon_dashed_line" }, + { PWEngine.BrushType.Highlighter, "icon_highlighter" }, + { PWEngine.BrushType.SoftBrush, "icon_soft_brush" }, + { PWEngine.BrushType.SharpBrush, "icon_sharp_brush" }, + }; + + private static readonly Dictionary BrushConfigs = new Dictionary + { + { PWEngine.BrushType.Stroke, () => PWEngine.SetStrokeType(0) }, + { PWEngine.BrushType.VarStroke, () => PWEngine.SetStrokeType(6) }, + { PWEngine.BrushType.VarStrokeInc, () => PWEngine.SetStrokeType(7) }, + { PWEngine.BrushType.SprayBrush, () => + { + PWEngine.SetStrokeType(1); + PWEngine.SetBrushTexture(0); + PWEngine.SetBrushDistance(3.0f); + } + }, + { PWEngine.BrushType.DotBrush, () => + { + PWEngine.SetStrokeType(1); + PWEngine.SetBrushTexture(1); + PWEngine.SetBrushDistance(2.0f); + } + }, + { PWEngine.BrushType.DashedLine, () => + { + PWEngine.SetStrokeType(5); + PWEngine.SetDashArray("1 3"); + } + }, + { PWEngine.BrushType.Highlighter, () => + { + PWEngine.SetStrokeType(1); + PWEngine.SetBrushTexture(3); + PWEngine.SetBrushDistance(0.25f); + } + }, + { PWEngine.BrushType.SoftBrush, () => + { + PWEngine.SetStrokeType(1); + PWEngine.SetBrushTexture(4); + PWEngine.SetBrushDistance(1.0f); + } + }, + { PWEngine.BrushType.SharpBrush, () => PWEngine.SetStrokeType(8) }, + }; + + private ImageView mImgView; + public BrushIcon(PWEngine.BrushType brushType) : base() + { + mBrushType = brushType; + + mImgView = new ImageView(); + mImgView.Size2D = new Size2D(48, 48); + + string url = $"{FrameworkInformation.ResourcePath}images/light/{GetIconUrl(brushType)}.png"; + + InitializeIcon(url, new Color("#17234d")); + this.TouchEvent += IconClick; + } + + private string GetIconUrl(PWEngine.BrushType brushType) + { + return IconMap.ContainsKey(brushType) ? IconMap[brushType] : string.Empty; + } + + + public PWEngine.BrushType GetBrushType() => mBrushType; + + + public bool IconClick(object sender, View.TouchEventArgs args) + { + if (base.IconClick(sender, args)) + { + if (BrushConfigs.ContainsKey(GetBrushType())) + { + BrushConfigs[GetBrushType()].Invoke(); + } + + } + return true; + } + + } +} \ No newline at end of file diff --git a/src/Tizen.NUI.PenWave/src/public/Tools/Pencil/ColorIcon.cs b/src/Tizen.NUI.PenWave/src/public/Tools/Pencil/ColorIcon.cs new file mode 100644 index 00000000000..a5d24e1571b --- /dev/null +++ b/src/Tizen.NUI.PenWave/src/public/Tools/Pencil/ColorIcon.cs @@ -0,0 +1,61 @@ +/* + * Copyright(c) 2024 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +using System; +using System.ComponentModel; +using System.Collections.Generic; +using Tizen.NUI; +using Tizen.NUI.BaseComponents; + +namespace Tizen.NUI.PenWave +{ + public class ColorIcon : Icon + { + private readonly string mColorHex; + private readonly Color mColor; + + public ColorIcon(Tizen.NUI.Color color) : base() + { + mColorHex = ToHex(color); + mColor = color; + + string url = $"{FrameworkInformation.ResourcePath}images/light/color_icon_base.png"; + + InitializeIcon(url, mColor); + this.TouchEvent += IconClick; + } + + public override bool IconClick(object sender, View.TouchEventArgs args) + { + if (base.IconClick(sender, args)) + { + PWEngine.SetStrokeColor(GetColorHex(), 1.0f); + } + return true; + } + + private string ToHex(Color color) + { + var red = (uint)(color.R * 255); + var green = (uint)(color.G * 255); + var blue = (uint)(color.B * 255); + return $"#{red:X2}{green:X2}{blue:X2}"; + } + + public string GetColorHex() => mColorHex; + } +} diff --git a/src/Tizen.NUI.PenWave/src/public/Tools/Pencil/PenInk.cs b/src/Tizen.NUI.PenWave/src/public/Tools/Pencil/PenInk.cs new file mode 100644 index 00000000000..29448e57791 --- /dev/null +++ b/src/Tizen.NUI.PenWave/src/public/Tools/Pencil/PenInk.cs @@ -0,0 +1,108 @@ +/* + * Copyright(c) 2024 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +using System; +using System.ComponentModel; +using System.Collections.Generic; +using System.Linq; +using Tizen.NUI; +using Tizen.NUI.BaseComponents; + +namespace Tizen.NUI.PenWave +{ + public class PenInk + { + public List Colors { get; private set; } + public List Sizes { get; private set; } + public List BrushTypes { get; private set; } + + private Color mCurrentColor; + private float mCurrentSize; + private PWEngine.BrushType mCurrentBrushType; + + private List InitializeDefaultColors() + { + return new List + { + new Color("#F7B32C"), + new Color("#FD5703"), + new Color("#DA1727"), + new Color("#FF00A8"), + new Color("#74BFB8"), + new Color("#4087C5"), + new Color("#070044"), + new Color("#0E0E0E"), + }; + } + + private List InitializeDefaultSizes() + { + return new List { 3.0f, 6.5f, 12.0f }; + } + + private List InitializeDefaultBrushTypes() + { + List brushTypes = new List(); + foreach (PWEngine.BrushType item in Enum.GetValues(typeof(PWEngine.BrushType))) + { + brushTypes.Add(item); + } + return brushTypes; + } + + public PenInk() + { + Colors = InitializeDefaultColors(); + Sizes = InitializeDefaultSizes(); + BrushTypes = InitializeDefaultBrushTypes(); + mCurrentColor = Colors.First(); + mCurrentSize = Sizes.First(); + mCurrentBrushType = BrushTypes.First(); + } + + public PenInk(List colors, List sizes, List brushTypes) + { + Colors = colors; + Sizes = sizes; + BrushTypes = BrushTypes; + + mCurrentColor = Colors.First(); + mCurrentSize = Sizes.First(); + mCurrentBrushType = BrushTypes.First(); + } + + public void SetCurrentColor(Color color) + { + mCurrentColor = color; + } + + public void SetCurrentSize(float size) + { + mCurrentSize = size; + } + + public void SetCurrentBrushType(PWEngine.BrushType brushType) + { + mCurrentBrushType = brushType; + } + + public Color GetCurrentColor() => mCurrentColor; + public float GetCurrentSize() => mCurrentSize; + public PWEngine.BrushType GetCurrentBrushType() => mCurrentBrushType; + + } +} \ No newline at end of file diff --git a/src/Tizen.NUI.PenWave/src/public/Tools/Pencil/PencilTool.cs b/src/Tizen.NUI.PenWave/src/public/Tools/Pencil/PencilTool.cs new file mode 100644 index 00000000000..2a45365c2a8 --- /dev/null +++ b/src/Tizen.NUI.PenWave/src/public/Tools/Pencil/PencilTool.cs @@ -0,0 +1,217 @@ +/* + * Copyright(c) 2024 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +using System; +using System.ComponentModel; +using System.Collections.Generic; +using Tizen.NUI; +using Tizen.NUI.BaseComponents; + +namespace Tizen.NUI.PenWave +{ + public class PencilTool : ITool + { + public ITool.ToolType Type => ITool.ToolType.Pencil; + private PenInk ink; + private bool mIsDrawing = false; + private uint mCurrentShapeId; + private uint mTouchTime; + private bool mActivate; + private View mRootView; + + public PencilTool() + { + ink = new PenInk(); + } + + public PencilTool(PenInk penInk) + { + ink = penInk ?? new PenInk(); + } + + + public bool Activate + { + get => mActivate; + set + { + mActivate = value; + if (!mActivate && mIsDrawing) + { + EndDrawing(); + } + } + } + + public void HandleInput(Touch touch) + { + if (!mActivate || touch == null || touch.GetPointCount() == 0) + { + return; + } + + uint pointStateIndex = 0; + mTouchTime = touch.GetTime(); + + List touchPositionList = new List(); + + for (uint i = 0; i < touch.GetPointCount(); ++i) + { + // 멀티 드로잉일 경우 고려할 것 + // if (AppModel.MultidrawActive && args.Touch.GetState(i) != PointStateType.Stationary) + // { + // pointStateIndex = i; + // } + touchPositionList.Add(touch.GetLocalPosition(i)); + } + + if (touch.GetPointCount() == 1) + { + Vector2 position = touchPositionList[(int)pointStateIndex]; + switch (touch.GetState(pointStateIndex)) + { + case PointStateType.Down: + { + PointStateDown(position, mTouchTime); + break; + } + case PointStateType.Motion: + { + PointStateMotion(position, (int)pointStateIndex, mTouchTime); + break; + } + case PointStateType.Up: + case PointStateType.Leave: + default : + { + PointStateUp(position, mTouchTime); + break; + } + } + } + } + + private void PointStateDown(Vector2 position, uint touchTime) + { + if (!mIsDrawing) + { + mIsDrawing = true; + mCurrentShapeId = PWEngine.BeginShapeDraw(position.X, position.Y, touchTime); + } + } + + private void PointStateUp(Vector2 position, uint touchTime) + { + if (mIsDrawing) + { + PWEngine.EndShapeDraw(mCurrentShapeId, touchTime); + mIsDrawing = false; + } + } + + private void PointStateMotion(Vector2 position, int index, uint touchTime) + { + if (mIsDrawing) + { + var result = (ErrorShapeAddPointsType)PWEngine.DrawShape(mCurrentShapeId, position.X, position.Y, touchTime); + if (result == ErrorShapeAddPointsType.overflowShape) + { + //End old shape + PWEngine.EndShapeDraw(mCurrentShapeId, touchTime); + + //Create new shape + mCurrentShapeId = PWEngine.BeginShapeDraw(position.X, position.Y, touchTime); + PWEngine.DrawShape(mCurrentShapeId, position.X, position.Y, touchTime); + } + else if (result == ErrorShapeAddPointsType.drawingCanceled) + { + EndDrawing(); + } + } + } + + private void EndDrawing() + { + PWEngine.EndShapeDraw(mCurrentShapeId, mTouchTime); + mIsDrawing = false; + } + + public virtual View GetUI() + { + if (mRootView == null) + { + CreateUI(); + } + return mRootView; + } + + private void CreateUI() + { + mRootView = new View() + { + WidthSpecification = LayoutParamPolicies.WrapContent, + HeightSpecification = LayoutParamPolicies.WrapContent, + Layout = new GridLayout() + { + Columns = 1, + RowSpacing = 4, + Padding = new Extents(16, 16, 16, 16) + } + }; + + AddIconsToView(mRootView, ink.Colors, color => new ColorIcon(color)); + AddIconsToView(mRootView, ink.Sizes, size => new SizeIcon(size)); + AddIconsToView(mRootView, ink.BrushTypes, brushType => new BrushIcon(brushType)); + } + + private void AddIconsToView(View rootView, IEnumerableitems, Func iconFactory) + { + var view = CreateIconView(); + foreach (var item in items) + { + view.Add(iconFactory(item)); + } + rootView.Add(view); + } + + + private View CreateIconView() + { + return new View + { + Layout = new GridLayout() + { + Columns = 4, + ColumnSpacing = 8, + RowSpacing = 8, + } + }; + } + } + + public enum ErrorShapeAddPointsType + { + noError, + overflowShape, + noCanvasSet, + noShapesInCanvas, + badIdShape, + drawableIsNotAShape, + drawableIsNotALine, + drawingCanceled + } +} \ No newline at end of file diff --git a/src/Tizen.NUI.PenWave/src/public/Tools/Pencil/SizeIcon.cs b/src/Tizen.NUI.PenWave/src/public/Tools/Pencil/SizeIcon.cs new file mode 100644 index 00000000000..2eb8e14b9f9 --- /dev/null +++ b/src/Tizen.NUI.PenWave/src/public/Tools/Pencil/SizeIcon.cs @@ -0,0 +1,53 @@ +/* + * Copyright(c) 2024 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +using System; +using System.ComponentModel; +using System.Collections.Generic; +using Tizen.NUI; +using Tizen.NUI.BaseComponents; + +namespace Tizen.NUI.PenWave +{ + public class SizeIcon : Icon + { + private readonly float mSize; + + public SizeIcon(float size) : base() + { + mSize = size; + + string url = $"{FrameworkInformation.ResourcePath}images/light/color_icon_base.png"; + + InitializeIcon(url, new Color("#17234d")); + mImgView.Size2D = new Size2D((int)(size * 1.5f), (int)(size * 1.5f)); + this.TouchEvent += IconClick; + } + + public bool IconClick(object sender, View.TouchEventArgs args) + { + if (base.IconClick(sender, args)) + { + PWEngine.SetStrokeSize(GetSize()); + + } + return true; + } + + public float GetSize() => mSize; + } +} diff --git a/src/Tizen.NUI.PenWave/src/public/Tools/Select/SelectTool.cs b/src/Tizen.NUI.PenWave/src/public/Tools/Select/SelectTool.cs new file mode 100644 index 00000000000..913fd7194fe --- /dev/null +++ b/src/Tizen.NUI.PenWave/src/public/Tools/Select/SelectTool.cs @@ -0,0 +1,40 @@ +/* + * Copyright(c) 2024 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +using System; +using System.ComponentModel; +using System.Collections.Generic; +using Tizen.NUI; +using Tizen.NUI.BaseComponents; + +namespace Tizen.NUI.PenWave +{ + // public class SelectTool : ITool + // { + // public ITool.ToolType Type => ITool.ToolType.Pencil; + + // public SelectTool() + // { + + // } + + // public ToolType Type {get;} + // public bool Activate {get; set;} + // public void HandleInput(Touch touch); + // public virtual View GetUI(); + // } +} diff --git a/src/Tizen.NUI.PenWave/src/public/Tools/ToolManager.cs b/src/Tizen.NUI.PenWave/src/public/Tools/ToolManager.cs new file mode 100644 index 00000000000..94925dfc9fa --- /dev/null +++ b/src/Tizen.NUI.PenWave/src/public/Tools/ToolManager.cs @@ -0,0 +1,93 @@ +/* + * Copyright(c) 2024 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +using System; +using System.ComponentModel; +using System.Collections.Generic; +using Tizen.NUI; +using Tizen.NUI.BaseComponents; + +namespace Tizen.NUI.PenWave +{ + public class ToolManager + { + public Dictionary Tools; + private ITool currentTool; + private PWCanvasView canvasView; + + public event Action ToolChanged; + + public ToolManager(PWCanvasView canvasView) + { + Tools = new Dictionary(); + this.canvasView = canvasView; + } + + public void RegisterTool(ITool tool) + { + if (Tools.ContainsKey(tool.Type)) + { + Tizen.Log.Error("NUI", $"Already register tool type {tool.Type}\n"); + } + else + { + Tools.Add(tool.Type, tool); + } + } + + public void UnregisterTool(ITool tool) + { + Tools.Remove(tool.Type); + } + + public void SelectTool(ITool.ToolType toolType) + { + // 현재 도구 비활성화 + if (currentTool != null) + { + currentTool.Activate = false; + } + + // 새 도구 활성화 + if (Tools.TryGetValue(toolType, out currentTool)) + { + currentTool.Activate = true; + ToolChanged?.Invoke(toolType, 0); + } + } + + public void HandleInput(Touch touch) + { + currentTool?.HandleInput(touch); + } + + public ITool.ToolType GetCurrentToolType() + { + return currentTool?.Type ?? ITool.ToolType.Pencil; // 기본값 펜슬 + } + + public ITool GetCurrentTool() + { + return currentTool; + } + + public PWCanvasView GetCurrentView() + { + return canvasView; + } + } +} \ No newline at end of file diff --git a/test/Tizen.NUI.PenWave.Sample/Tizen.NUI.PenWave.Sample.csproj b/test/Tizen.NUI.PenWave.Sample/Tizen.NUI.PenWave.Sample.csproj new file mode 100644 index 00000000000..ed2cbf0e29f --- /dev/null +++ b/test/Tizen.NUI.PenWave.Sample/Tizen.NUI.PenWave.Sample.csproj @@ -0,0 +1,42 @@ + + + Exe + net6.0 + PenWaveSample + + + + portable + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + True + + diff --git a/test/Tizen.NUI.PenWave.Sample/Tizen.NUI.PenWave.Sample.sln b/test/Tizen.NUI.PenWave.Sample/Tizen.NUI.PenWave.Sample.sln new file mode 100755 index 00000000000..fb060bf6767 --- /dev/null +++ b/test/Tizen.NUI.PenWave.Sample/Tizen.NUI.PenWave.Sample.sln @@ -0,0 +1,97 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.33214.272 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.NUI.PenWave.Sample", "Tizen.NUI.PenWave.Sample.csproj", "{3C6CE4CE-9D35-42C9-B23D-BBFFA96B3955}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\..\src\Tizen\Tizen.csproj", "{F4ADAF15-01AA-477E-A85A-BEB297E6B07E}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Applications.Common", "..\..\src\Tizen.Applications.Common\Tizen.Applications.Common.csproj", "{0B96B17C-DACA-4745-88B1-6CFC1825A510}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Applications.ComponentBased", "..\..\src\Tizen.Applications.ComponentBased\Tizen.Applications.ComponentBased.csproj", "{E117D074-C23D-41FD-A77D-2E9E6FF85676}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Applications.ThemeManager", "..\..\src\Tizen.Applications.ThemeManager\Tizen.Applications.ThemeManager.csproj", "{FB8B42D6-76CC-4836-8A80-58A816C6A17F}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.System.SystemSettings", "..\..\src\Tizen.System.SystemSettings\Tizen.System.SystemSettings.csproj", "{EC28F259-C790-4FA3-A834-00795E2A7E2F}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.System.Information", "..\..\src\Tizen.System.Information\Tizen.System.Information.csproj", "{02BEE3AD-99A6-44A5-89FC-D9F4132D9ECE}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.System.Feedback", "..\..\src\Tizen.System.Feedback\Tizen.System.Feedback.csproj", "{D422D03E-7E32-4230-8306-B16DFE27E95A}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Tracer", "..\..\src\Tizen.Tracer\Tizen.Tracer.csproj", "{A0AA9346-2025-4803-A168-3B39A367BB92}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\..\src\Tizen.Log\Tizen.Log.csproj", "{1E8250DB-92C3-44A5-8D57-3CFDE0C0021D}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.NUI", "..\..\src\Tizen.NUI\Tizen.NUI.csproj", "{29B426DA-FFDE-49D2-BD73-FE155F9502E8}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.NUI.Components", "..\..\src\Tizen.NUI.Components\Tizen.NUI.Components.csproj", "{2A669CBF-DFA8-4EA3-852D-3137493DE884}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.NUI.PenWave", "..\..\src\Tizen.NUI.PenWave\Tizen.NUI.PenWave.csproj", "{C5BFC65A-91D1-424E-BEC4-4A40329DA185}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {3C6CE4CE-9D35-42C9-B23D-BBFFA96B3955}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3C6CE4CE-9D35-42C9-B23D-BBFFA96B3955}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3C6CE4CE-9D35-42C9-B23D-BBFFA96B3955}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3C6CE4CE-9D35-42C9-B23D-BBFFA96B3955}.Release|Any CPU.Build.0 = Release|Any CPU + {F4ADAF15-01AA-477E-A85A-BEB297E6B07E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F4ADAF15-01AA-477E-A85A-BEB297E6B07E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F4ADAF15-01AA-477E-A85A-BEB297E6B07E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F4ADAF15-01AA-477E-A85A-BEB297E6B07E}.Release|Any CPU.Build.0 = Release|Any CPU + {0B96B17C-DACA-4745-88B1-6CFC1825A510}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0B96B17C-DACA-4745-88B1-6CFC1825A510}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0B96B17C-DACA-4745-88B1-6CFC1825A510}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0B96B17C-DACA-4745-88B1-6CFC1825A510}.Release|Any CPU.Build.0 = Release|Any CPU + {E117D074-C23D-41FD-A77D-2E9E6FF85676}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E117D074-C23D-41FD-A77D-2E9E6FF85676}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E117D074-C23D-41FD-A77D-2E9E6FF85676}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E117D074-C23D-41FD-A77D-2E9E6FF85676}.Release|Any CPU.Build.0 = Release|Any CPU + {FB8B42D6-76CC-4836-8A80-58A816C6A17F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FB8B42D6-76CC-4836-8A80-58A816C6A17F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FB8B42D6-76CC-4836-8A80-58A816C6A17F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FB8B42D6-76CC-4836-8A80-58A816C6A17F}.Release|Any CPU.Build.0 = Release|Any CPU + {EC28F259-C790-4FA3-A834-00795E2A7E2F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EC28F259-C790-4FA3-A834-00795E2A7E2F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EC28F259-C790-4FA3-A834-00795E2A7E2F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EC28F259-C790-4FA3-A834-00795E2A7E2F}.Release|Any CPU.Build.0 = Release|Any CPU + {02BEE3AD-99A6-44A5-89FC-D9F4132D9ECE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {02BEE3AD-99A6-44A5-89FC-D9F4132D9ECE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {02BEE3AD-99A6-44A5-89FC-D9F4132D9ECE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {02BEE3AD-99A6-44A5-89FC-D9F4132D9ECE}.Release|Any CPU.Build.0 = Release|Any CPU + {D422D03E-7E32-4230-8306-B16DFE27E95A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D422D03E-7E32-4230-8306-B16DFE27E95A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D422D03E-7E32-4230-8306-B16DFE27E95A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D422D03E-7E32-4230-8306-B16DFE27E95A}.Release|Any CPU.Build.0 = Release|Any CPU + {A0AA9346-2025-4803-A168-3B39A367BB92}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A0AA9346-2025-4803-A168-3B39A367BB92}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A0AA9346-2025-4803-A168-3B39A367BB92}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A0AA9346-2025-4803-A168-3B39A367BB92}.Release|Any CPU.Build.0 = Release|Any CPU + {1E8250DB-92C3-44A5-8D57-3CFDE0C0021D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1E8250DB-92C3-44A5-8D57-3CFDE0C0021D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1E8250DB-92C3-44A5-8D57-3CFDE0C0021D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1E8250DB-92C3-44A5-8D57-3CFDE0C0021D}.Release|Any CPU.Build.0 = Release|Any CPU + {29B426DA-FFDE-49D2-BD73-FE155F9502E8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {29B426DA-FFDE-49D2-BD73-FE155F9502E8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {29B426DA-FFDE-49D2-BD73-FE155F9502E8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {29B426DA-FFDE-49D2-BD73-FE155F9502E8}.Release|Any CPU.Build.0 = Release|Any CPU + {2A669CBF-DFA8-4EA3-852D-3137493DE884}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2A669CBF-DFA8-4EA3-852D-3137493DE884}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2A669CBF-DFA8-4EA3-852D-3137493DE884}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2A669CBF-DFA8-4EA3-852D-3137493DE884}.Release|Any CPU.Build.0 = Release|Any CPU + {C5BFC65A-91D1-424E-BEC4-4A40329DA185}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C5BFC65A-91D1-424E-BEC4-4A40329DA185}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C5BFC65A-91D1-424E-BEC4-4A40329DA185}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C5BFC65A-91D1-424E-BEC4-4A40329DA185}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {355D568D-D02A-490A-A6AC-FD6C7D97457A} + EndGlobalSection +EndGlobal diff --git a/test/Tizen.NUI.PenWave.Sample/shared/res/Tizen.NUI.PenWave.Sample.png b/test/Tizen.NUI.PenWave.Sample/shared/res/Tizen.NUI.PenWave.Sample.png new file mode 100644 index 0000000000000000000000000000000000000000..ef30093cdcab61f7ca53043c221ccd08f52c4990 GIT binary patch literal 2711 zcmaKtc~Dcy7RIm2FfQXDh`TZp5fwxTphDE=Lla3@1z}JGgdhqipb%tr1{emCAV@?J z1)_oq5_V*lRX~tM7FiXEvdF#J_dR);nyOdz{+L(Q-Cy@P{j0CLtE&#-tds5fwcFPM z0I(i|M!KrC_piQsm3n-f;!~=Y-Tr7-M*xU51b~EO0FbIf3CjQwX$An0F90BN0AS0F zye6090I+iStb-d$rBcacGPzu?P$-m2rBo^vi^Y6C{|iH!(9BF~VJ5dQWeQc<7_W4U z_nj+CXlC4QVu)p`#5c^0x9pNpUek<#+|T{JnZXe&9`>?*N+9o7VD>xC{T>dLDZN+> zo-YDLGG%Br{a!cQy9BHp=S$?OKU$ccMIcispM)fy#b9tHB#ii=7uqZAX=6Sz@ zswenfufT`z*j-f7ole%^qS%iDh1JmfN+FOZlgO0?LtJ793*XN2E`eej7)q5&EK>@l z3W-dKZ)f&=6%`I~KQ2q!W`(`qL_>?>*3Uw*Op*JZ6IM+VNfmQU>9s1_Y{#xm-d!tK*B%s~DUBB?AlMS0gZXb=6fHwMIkptac*{y|WzMr@H(%3dXwuX+R(LJF@+1F#5Bq94 z#1<*Cy4lZ%xDa0+UC+2xN3WmaU#);zJ`1yY*h^elXf-XqiE*=rrckL~PYN2R1^NA) zIfgX+HT}0{Mh{i=?yHEuDbb}mi><1FfH(Qxa6x>pi_H?rzp-S#B@j=d zz}3=AM|oE&Aj&9jY+0gEszR!1#CBFn8?$tj?^^{2fB5Ucs6tG~BOJzy3 zdN{RHg1RXIsf#TX3P(*1!qlIB1=ijc3E+R&g;pWqj3?onS#NB`AyOXm)mOc9kRe9$QrHsCO{j|@rFY>;bo#EqP^ARIL?sJ#}?EYCy zcIJ!AecAM$Z2STHYC7;;=)Tv)`1U9CQIBCQt0hnOK={2cH2Tm(6eX}!gF zYl`1LHbbYh%>0!Vb{Po$D9rxcx1I%NA2rryu8*_suI8BzR5DIe-mJ&l8`vw;V5qn) z`=*P!OrPI&&;K^TY5znovYU|->2pr*h~4_(zE!3#s^8lPtN+mI^VCS)ju~)mYaI6( zha5-moruus zxEYI%Ra}F07Dhd3Z6xfhXg=0a7{UH2n%uxO(%GQ}s$-AxN6sCM&A#d;(Ix4* zuS)-nf?X|ii?VXiZSpu8qg&NwT_4<_ozQE&XQ*rf)YAhG*K_w_2^=d{yu}9XYr4U> zy9HlYPG)NCGmpKKU-j?Yy1w93&nH^rKK~H68~gE@Ec%4Ome{<8q>VQtMl{@Cg=M?Q z2o8D4cDsVoZSQFqm`}T(9{6_PObI%h78s@-VRVT6(z98Ed2kK7YY<0u&F#J8g}kHP z9?;a-KO2!oMB@z0hZ6;<{mDc;d|hDCV+&(15=px;{7Cs|eqE&do;}zhn{lskpJ=j$ zr8%r;y#28DI5qzJwww(7;nloy_w`OYz=ozVZ8$NJ#?N#^VD}j4wCD-exuqSoTH36y z?XN$qzIfpYD?8Yg6QQFWCV;2TCioJN=9WcTd$B1?r*T_Dw`<6k;EOLab*eV6vUkg^ zAK3)YURh5emmPC`Tevs;yZL}u`F3xTXL>dsuGwH8lI(Hn_X|jeg;3uIOey*PL4CvU ziv2mosn1tK%{ECe5qO0)Nz+Y&EjF>nwG!BPs!i>-7&Hp)Y><4|rB-nR6COIUQCs^& zL0y@x%WzUL{``TVk1bJlNg9qirjq4Nsjz<{YQ2 zx?R2XG+*E}+hb+}S_hjo#GWQ{#h;I~BJFz_yJP2y< zNuS9JT+P_?mr-X6^0}otCHt$JB0V|439;)Sn;$ueufQ%t#CE*{&wf65VZPmcphF388% zCr@+N5Ifh9a^{PSYvyZ8#HVbC*XvkNK8!2*`DqPritCHK%#y-qOcNq8q?|sp{8d5t z-ww>AJ8l!n_FM`g^=SIyrf$;pT29_OgLHZ}ftYBW*Q{*^xEqyiCQDUOy^vL)dF!KpS{_3HJG3&;12OJ-HC}AVk?WTSoG*{|s?>%rg zPz8N$WYix#5s!SHYD@mn1h#LIWn@2aK+o{}Ld=OOBzenBHb92G_#ICvpX)RAB~4QV zzckJ?whg~S#wOG4w>fKf2p7*VVcxe6yc83t&hACmA5fAkgWCGL-7b>%p_J7gk4@8P z#!(WED5Dfbk2dkQIJDvPZ;L}7^SPYw$TvuHRVPt2^J$UfOxo7Wh*k(rk1--&Hd7qF zFcM`)Jv{!T5adQTev*;c;`8>6W%Uwd(=^SH}?xB!HIcz{{}b2D>u z6EkZQxP=?s5@BhEIDEv|%nV^>cE2?P_CG*K*yW%rG5-uK&L1JGf&Kq=zy*Z_MBw~F oZv4eqn3%y$;78oxM-diB5O9mXO&&GpqSOq4K{+AIPx&VO2fy6MqyPW_ literal 0 HcmV?d00001 diff --git a/test/Tizen.NUI.PenWave.Sample/src/PenWaveSample.cs b/test/Tizen.NUI.PenWave.Sample/src/PenWaveSample.cs new file mode 100644 index 00000000000..e3983a86495 --- /dev/null +++ b/test/Tizen.NUI.PenWave.Sample/src/PenWaveSample.cs @@ -0,0 +1,106 @@ +using System; +using System.ComponentModel; +using System.Collections.Generic; +using System.Linq; + +using Tizen.NUI; +using Tizen.NUI.BaseComponents; +using Tizen.NUI.PenWave; + +namespace PenWaveSample +{ + class Program : NUIApplication + { + public static Program app; + private Window mWindow; + private LongPressGestureDetector longPressGestureDetector; + private ToolPickerView mToolPickerView; + private PWCanvasView canvasView; + + public Program(ThemeOptions option, WindowData windowData) : base(option, windowData) + { + + } + + protected override void OnCreate() + { + base.OnCreate(); + InitializeView(); + } + + private void InitializeView() + { + mWindow = GetDefaultWindow(); + mWindow.BackgroundColor = Color.White; + canvasView = new PWCanvasView(); + mWindow.Add(canvasView); + + PencilTool pencilTool = new PencilTool(); + ToolManager toolManager = canvasView.ToolManager; + toolManager.RegisterTool(pencilTool); + + canvasView.ToolManager.SelectTool(pencilTool.Type); + + mToolPickerView = new ToolPickerView(toolManager); + // mToolPickerView.HideTool(pencilTool.Type); + mToolPickerView.Hide(); + mWindow.Add(mToolPickerView); + + + longPressGestureDetector = new LongPressGestureDetector(); + longPressGestureDetector.Attach(canvasView); + longPressGestureDetector.Detected += OnLongPressDetected; + + canvasView.TouchEvent += OnTouchEvent; + } + + private void OnWindowResized(object sender, Window.ResizedEventArgs args) + { + } + + + private bool OnTouchEvent(object sender, View.TouchEventArgs args) + { + if (args.Touch.GetState(0) == PointStateType.Down) + { + mToolPickerView.Hide(); + } + canvasView.HandleInput(args.Touch); + return false; + } + + private void HandleErase(Vector2 touchPosition, bool partial) + { + } + + private void HandleNotes() + { + } + + private void OnLongPressDetected(object sender, LongPressGestureDetector.DetectedEventArgs args) + { + if (args.LongPressGesture.State == Gesture.StateType.Started) + { + mToolPickerView.Show(); + } + } + + private void OnMouseTouch(object sender, Window.TouchEventArgs args) + { + } + + private void OnWheelEvent(object sender, Window.WheelEventArgs args) + { + } + + static void Main(string[] args) + { + WindowData newWindowData = new WindowData(); + newWindowData.FrontBufferRendering = true; + newWindowData.WindowMode = WindowMode.Opaque; + app = new Program(ThemeOptions.None, newWindowData); + app.Run(args); + app.Dispose(); + } + } +} diff --git a/test/Tizen.NUI.PenWave.Sample/tizen-manifest.xml b/test/Tizen.NUI.PenWave.Sample/tizen-manifest.xml new file mode 100755 index 00000000000..69311db5543 --- /dev/null +++ b/test/Tizen.NUI.PenWave.Sample/tizen-manifest.xml @@ -0,0 +1,16 @@ + + + + + + Tizen.NUI.PenWave.Sample.png + + + diff --git a/test/Tizen.NUI.PenWave.Sample/tmp/thumbnails/2f6b85a4-af3f-499f-b246-4977ffa9e82a.png b/test/Tizen.NUI.PenWave.Sample/tmp/thumbnails/2f6b85a4-af3f-499f-b246-4977ffa9e82a.png new file mode 100644 index 0000000000000000000000000000000000000000..6148b7b08cd589a04b010e7c9e5767c44ea5c9c9 GIT binary patch literal 3653 zcmeAS@N?(olHy`uVBq!ia0y~yUrCv zXK?&OhEPTjXB3Qvz-S1JhQMeDjE2By2#kinXb6mkz-S1JhQMeD49^f)&*&z>z{v6B QQ7*`Tp00i_>zopr0G{;~LI3~& literal 0 HcmV?d00001 diff --git a/test/Tizen.NUI.PenWave.Sample/tmp/thumbnails/415a22d6-aaf8-41b0-9255-fb4ece7e2ae9.png b/test/Tizen.NUI.PenWave.Sample/tmp/thumbnails/415a22d6-aaf8-41b0-9255-fb4ece7e2ae9.png new file mode 100644 index 0000000000000000000000000000000000000000..6148b7b08cd589a04b010e7c9e5767c44ea5c9c9 GIT binary patch literal 3653 zcmeAS@N?(olHy`uVBq!ia0y~yUrCv zXK?&OhEPTjXB3Qvz-S1JhQMeDjE2By2#kinXb6mkz-S1JhQMeD49^f)&*&z>z{v6B QQ7*`Tp00i_>zopr0G{;~LI3~& literal 0 HcmV?d00001 diff --git a/test/Tizen.NUI.PenWave.Sample/tmp/thumbnails/7175d419-b55a-4f39-a366-fb1d21513816.png b/test/Tizen.NUI.PenWave.Sample/tmp/thumbnails/7175d419-b55a-4f39-a366-fb1d21513816.png new file mode 100644 index 0000000000000000000000000000000000000000..6148b7b08cd589a04b010e7c9e5767c44ea5c9c9 GIT binary patch literal 3653 zcmeAS@N?(olHy`uVBq!ia0y~yUrCv zXK?&OhEPTjXB3Qvz-S1JhQMeDjE2By2#kinXb6mkz-S1JhQMeD49^f)&*&z>z{v6B QQ7*`Tp00i_>zopr0G{;~LI3~& literal 0 HcmV?d00001 diff --git a/test/Tizen.NUI.PenWave.Sample/tmp/thumbnails/7463530e-1798-4c45-a6ea-4fbf296d6737.png b/test/Tizen.NUI.PenWave.Sample/tmp/thumbnails/7463530e-1798-4c45-a6ea-4fbf296d6737.png new file mode 100644 index 0000000000000000000000000000000000000000..6148b7b08cd589a04b010e7c9e5767c44ea5c9c9 GIT binary patch literal 3653 zcmeAS@N?(olHy`uVBq!ia0y~yUrCv zXK?&OhEPTjXB3Qvz-S1JhQMeDjE2By2#kinXb6mkz-S1JhQMeD49^f)&*&z>z{v6B QQ7*`Tp00i_>zopr0G{;~LI3~& literal 0 HcmV?d00001 diff --git a/test/Tizen.NUI.PenWave.Sample/tmp/thumbnails/965b17c3-5398-4315-8210-8d1300849050.png b/test/Tizen.NUI.PenWave.Sample/tmp/thumbnails/965b17c3-5398-4315-8210-8d1300849050.png new file mode 100644 index 0000000000000000000000000000000000000000..6148b7b08cd589a04b010e7c9e5767c44ea5c9c9 GIT binary patch literal 3653 zcmeAS@N?(olHy`uVBq!ia0y~yUrCv zXK?&OhEPTjXB3Qvz-S1JhQMeDjE2By2#kinXb6mkz-S1JhQMeD49^f)&*&z>z{v6B QQ7*`Tp00i_>zopr0G{;~LI3~& literal 0 HcmV?d00001 diff --git a/test/Tizen.NUI.PenWave.Sample/tmp/thumbnails/9887a5e3-0e30-4562-b1e9-1b24e6df593c.png b/test/Tizen.NUI.PenWave.Sample/tmp/thumbnails/9887a5e3-0e30-4562-b1e9-1b24e6df593c.png new file mode 100644 index 0000000000000000000000000000000000000000..6148b7b08cd589a04b010e7c9e5767c44ea5c9c9 GIT binary patch literal 3653 zcmeAS@N?(olHy`uVBq!ia0y~yUrCv zXK?&OhEPTjXB3Qvz-S1JhQMeDjE2By2#kinXb6mkz-S1JhQMeD49^f)&*&z>z{v6B QQ7*`Tp00i_>zopr0G{;~LI3~& literal 0 HcmV?d00001 diff --git a/test/Tizen.NUI.PenWave.Sample/tmp/thumbnails/a1192eb1-9e6d-4a3c-8018-bcfd903ee8ca.png b/test/Tizen.NUI.PenWave.Sample/tmp/thumbnails/a1192eb1-9e6d-4a3c-8018-bcfd903ee8ca.png new file mode 100644 index 0000000000000000000000000000000000000000..6148b7b08cd589a04b010e7c9e5767c44ea5c9c9 GIT binary patch literal 3653 zcmeAS@N?(olHy`uVBq!ia0y~yUrCv zXK?&OhEPTjXB3Qvz-S1JhQMeDjE2By2#kinXb6mkz-S1JhQMeD49^f)&*&z>z{v6B QQ7*`Tp00i_>zopr0G{;~LI3~& literal 0 HcmV?d00001 diff --git a/test/Tizen.NUI.PenWave.Sample/tmp/thumbnails/b053d936-b242-4096-9fa1-13020001a1c1.png b/test/Tizen.NUI.PenWave.Sample/tmp/thumbnails/b053d936-b242-4096-9fa1-13020001a1c1.png new file mode 100644 index 0000000000000000000000000000000000000000..6148b7b08cd589a04b010e7c9e5767c44ea5c9c9 GIT binary patch literal 3653 zcmeAS@N?(olHy`uVBq!ia0y~yUrCv zXK?&OhEPTjXB3Qvz-S1JhQMeDjE2By2#kinXb6mkz-S1JhQMeD49^f)&*&z>z{v6B QQ7*`Tp00i_>zopr0G{;~LI3~& literal 0 HcmV?d00001