Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Rebase master -> DevelNUI #6458

Merged
merged 5 commits into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ TizenFX API, which allows you to access platform-specific features not covered b

| Branch | API Level | Target Framework | API Reference | Platform | myget.org | nuget.org |
|--------|:---------:|------------------|---------------|-------------------|-----------|------------|
|master | 12 | net6.0-tizen9.0 | [Link](https://samsung.github.io/TizenFX/master/) | Tizen vNext | [![api12_myget](https://img.shields.io/tizen.myget/dotnet/vpre/Tizen.NET.API12.svg)](https://tizen.myget.org/feed/dotnet/package/nuget/Tizen.NET) | |
|API11 | 11 | net6.0-tizen8.0 | [Link](https://samsung.github.io/TizenFX/API11/) | Tizen 8.0 | [![api11_myget](https://img.shields.io/tizen.myget/dotnet/vpre/Tizen.NET.API11.svg)](https://tizen.myget.org/feed/dotnet/package/nuget/Tizen.NET) | ![api11_nuget](https://img.shields.io/nuget/v/Tizen.NET.API11.svg)
|master | 13 | | [Link](https://samsung.github.io/TizenFX/master/) | Tizen vNext | [![api12_myget](https://img.shields.io/tizen.myget/dotnet/vpre/Tizen.NET.API12.svg)](https://tizen.myget.org/feed/dotnet/package/nuget/Tizen.NET) | |
|API12 | 12 | net6.0-tizen9.0 | [Link](https://samsung.github.io/TizenFX/API12/) | Tizen 9.0 | [![api12_myget](https://img.shields.io/tizen.myget/dotnet/vpre/Tizen.NET.API12.svg)](https://tizen.myget.org/feed/dotnet/package/nuget/Tizen.NET) | [![api12_nuget](https://img.shields.io/nuget/v/Tizen.NET.API12.svg)](https://www.nuget.org/packages/Tizen.NET/) |
|API11 | 11 | net6.0-tizen8.0 | [Link](https://samsung.github.io/TizenFX/API11/) | Tizen 8.0 | [![api11_myget](https://img.shields.io/tizen.myget/dotnet/vpre/Tizen.NET.API11.svg)](https://tizen.myget.org/feed/dotnet/package/nuget/Tizen.NET) | [![api11_nuget](https://img.shields.io/nuget/v/Tizen.NET.API11.svg)](https://www.nuget.org/packages/Tizen.NET/) |
|API10 | 10 | tizen10.0 | [Link](https://samsung.github.io/TizenFX/API10/) | Tizen 7.0 | [![api10_myget](https://img.shields.io/tizen.myget/dotnet/vpre/Tizen.NET.API10.svg)](https://tizen.myget.org/feed/dotnet/package/nuget/Tizen.NET) | [![api10_nuget](https://img.shields.io/nuget/v/Tizen.NET.API10.svg)](https://www.nuget.org/packages/Tizen.NET/) |
|API9 | 9 | tizen90 | [Link](https://samsung.github.io/TizenFX/API9/) | Tizen 6.5 | [![api9_myget](https://img.shields.io/tizen.myget/dotnet/vpre/Tizen.NET.API9.svg)](https://tizen.myget.org/feed/dotnet/package/nuget/Tizen.NET) | [![api9_nuget](https://img.shields.io/nuget/v/Tizen.NET.API9.svg)](https://www.nuget.org/packages/Tizen.NET/) |
|API8 | 8 | tizen80 | [Link](https://samsung.github.io/TizenFX/API8/) | Tizen 6.0 | [![api8_myget](https://img.shields.io/tizen.myget/dotnet/vpre/Tizen.NET.API8.svg)](https://tizen.myget.org/feed/dotnet/package/nuget/Tizen.NET) | [![api8_nuget](https://img.shields.io/nuget/v/Tizen.NET.API8.svg)](https://www.nuget.org/packages/Tizen.NET/) |
Expand All @@ -20,21 +21,21 @@ TizenFX API, which allows you to access platform-specific features not covered b
|API4 | 4 | tizen40 | [Link](https://samsung.github.io/TizenFX/API4/) | Tizen 4.0 | [![api4_myget](https://img.shields.io/tizen.myget/dotnet/vpre/Tizen.NET.API4.svg)](https://tizen.myget.org/feed/dotnet/package/nuget/Tizen.NET) | [![api4_nuget](https://img.shields.io/nuget/v/Tizen.NET.API4.svg)](https://www.nuget.org/packages/Tizen.NET/) |

### master
The __master__ branch is the main development branch for the Tizen .NET __API Level 12__.
The __master__ branch is the main development branch for the Tizen .NET __API Level 13__.

The following NuGet packages will be published to [Tizen MyGet Gallery](https://tizen.myget.org/gallery/dotnet) and [Github Packages Registry](https://github.com/orgs/Samsung/packages?tab=packages&q=Tizen.NET) every day if there are any changes. (Nightly Build)

> - MyGet Feed : ```https://tizen.myget.org/F/dotnet/api/v3/index.json```
> - GitHub Packages Feed : ```https://nuget.pkg.github.com/Samsung/index.json```
> - GitHub Packages only supports authentication using a personal access token (classic). For more information, see [Working with the NuGet registry](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-nuget-registry) and [Managing your personal access tokens](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens)

* Tizen.NET 12.0.0.#####
* Tizen.NET.API12 12.0.0.#####
* Tizen.NET.Internals 12.0.0.#####
* Tizen.NET 13.0.0.#####
* Tizen.NET.API13 13.0.0.#####
* Tizen.NET.Internals 13.0.0.#####

And, This branch is pushed to the [tizen branch](https://git.tizen.org/cgit/platform/core/csapi/tizenfx/?h=tizen) in the tizen gerrit and submitted for the next Tizen platform.

### API4 ~ API11 branches
### API4 ~ API12 branches
The __API#__ branches are the release branch for Tizen .NET __API Level #__.

These release branches were __FROZEN__. No new public APIs can be added to these branches, only bug fixes and internal APIs can be added.
Expand All @@ -56,6 +57,7 @@ For more information, please see [Using Tizen.NET.Sdk as SDK-style](https://deve
### Minimum required versions of Tizen.NET.Sdk and Visual Studio
| API Level | Target Framework | Tizen.NET.Sdk | Visual Studio |
|:---------:|------------------|---------------|-------------------|
| API13 | net6.0-tizen9.0 | [Tizen .NET Workloads](https://github.com/samsung/Tizen.NET) | 2022 |
| API12 | net6.0-tizen9.0 | [Tizen .NET Workloads](https://github.com/samsung/Tizen.NET) | 2022 |
| API11 | net6.0-tizen8.0 | [Tizen .NET Workloads](https://github.com/samsung/Tizen.NET) | 2022 |
| API10 | tizen10.0 | 1.1.9 | 2019 |
Expand Down Expand Up @@ -95,4 +97,5 @@ You can download the latest binaries with TizenFX from the link below :
| Tizen 6.5 | http://download.tizen.org/snapshots/TIZEN/Tizen-6.5/Tizen-6.5-Unified/latest/ |
| Tizen 7.0 | http://download.tizen.org/snapshots/TIZEN/Tizen-7.0/Tizen-7.0-Unified/latest/ |
| Tizen 8.0 | http://download.tizen.org/snapshots/TIZEN/Tizen-8.0/Tizen-8.0-Unified/latest/ |
| Tizen 9.0 | http://download.tizen.org/snapshots/TIZEN/Tizen/Tizen-Unified/latest |
| Tizen 9.0 | http://download.tizen.org/snapshots/TIZEN/Tizen-9.0/Tizen-9.0-Unified/latest/ |
| Tizen 10.0 | http://download.tizen.org/snapshots/TIZEN/Tizen/Tizen-Unified/latest |
19 changes: 11 additions & 8 deletions src/Tizen.NUI.Gadget/Tizen.NUI/NUIGadgetAssembly.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,30 +47,33 @@ public class NUIGadgetAssembly
private readonly string _assemblyPath;
private WeakReference _assemblyRef;
private Assembly _assembly = null;
private bool _loaded = false;

internal NUIGadgetAssembly(string assemblyPath) { _assemblyPath = assemblyPath; }

internal void Load()
{
lock (_assemblyLock)
{
if (_assembly != null)
if (_loaded)
{
return;
}

Log.Warn("Load(): " + _assemblyPath + " ++");
NUIGadgetAssemblyLoadContext context = new NUIGadgetAssemblyLoadContext();
_assemblyRef = new WeakReference(context);
using (FileStream stream = new FileStream(_assemblyPath, FileMode.Open, FileAccess.Read))
{
_assembly = context.LoadFromStream(stream);
}
string directoryPath = SystemIO.Path.GetDirectoryName(_assemblyPath);
string fileName = SystemIO.Path.GetFileNameWithoutExtension(_assemblyPath);
string nativeImagePath = directoryPath + "/.native_image/" + fileName + ".ni.dll";
Log.Debug("NativeImagePath=" + nativeImagePath + ", AssemblyPath=" + _assemblyPath);
_assembly = context.LoadFromNativeImagePath(nativeImagePath, _assemblyPath);
Log.Warn("Load(): " + _assemblyPath + " --");
_loaded = true;
}
}

internal bool IsLoaded { get { return _assembly != null; } }
internal bool IsLoaded { get { return _loaded; } }

internal NUIGadget CreateInstance(string className)
{
Expand All @@ -90,7 +93,7 @@ internal void Unload()
{
lock (_assemblyLock)
{
if (_assembly == null)
if (!_loaded)
{
return;
}
Expand All @@ -101,7 +104,7 @@ internal void Unload()
(_assemblyRef.Target as NUIGadgetAssemblyLoadContext).Unload();
}

_assembly = null;
_loaded = false;
Log.Warn("Unload(): " + _assemblyPath + " --");
}
}
Expand Down
17 changes: 11 additions & 6 deletions src/Tizen.NUI.Gadget/Tizen.NUI/NUIGadgetInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ public string ResourcePath
}

/// <summary>
/// Gets the allowed resource path of the gadget.
/// Gets the gadget resource path of the gadget.
/// </summary>
/// <since_tizen> 12 </since_tizen>
public string AllowedResourcePath
public string GadgetResourcePath
{
get; private set;
}
Expand Down Expand Up @@ -196,11 +196,16 @@ int callback(string key, string value, IntPtr userData)
Log.Warn("Failed to destroy package info. error = " + errorCode);
}

info.ResourcePath = SystemIO.Path.GetDirectoryName(Application.Current.ApplicationInfo.ExecutablePath) + "/";
info.AllowedResourcePath = SystemIO.Path.GetDirectoryName(Application.Current.DirectoryInfo.Resource) + "/mount/allowed/" + info.ResourceType + "/";
if (!Directory.Exists(info.AllowedResourcePath))
info.ResourcePath = SystemIO.Path.GetDirectoryName(Application.Current.ApplicationInfo.ExecutablePath) + "/.res_mount/";
if (!Directory.Exists(info.ResourcePath))
{
info.AllowedResourcePath = SystemIO.Path.GetDirectoryName(Application.Current.DirectoryInfo.Resource) + "/mount/allowed/";
info.ResourcePath = SystemIO.Path.GetDirectoryName(Application.Current.ApplicationInfo.ExecutablePath) + "/";
}

info.GadgetResourcePath = info.ResourcePath + info.ResourceType + "/";
if (!Directory.Exists(info.GadgetResourcePath))
{
info.GadgetResourcePath = info.ResourcePath;
}
return info;
}
Expand Down
6 changes: 3 additions & 3 deletions src/Tizen.NUI.Gadget/Tizen.NUI/NUIGadgetManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -243,10 +243,10 @@ private static void Load(NUIGadgetInfo info, bool useDefaultContext)
{
if (info.NUIGadgetAssembly == null || !info.NUIGadgetAssembly.IsLoaded)
{
Log.Warn("NUIGadgetAssembly.Load(): " + info.AllowedResourcePath + info.ExecutableFile + " ++");
info.NUIGadgetAssembly = new NUIGadgetAssembly(info.AllowedResourcePath + info.ExecutableFile);
Log.Warn("NUIGadgetAssembly.Load(): " + info.GadgetResourcePath + info.ExecutableFile + " ++");
info.NUIGadgetAssembly = new NUIGadgetAssembly(info.GadgetResourcePath + info.ExecutableFile);
info.NUIGadgetAssembly.Load();
Log.Warn("NUIGadgetAssembly.Load(): " + info.AllowedResourcePath + info.ExecutableFile + " --");
Log.Warn("NUIGadgetAssembly.Load(): " + info.GadgetResourcePath + info.ExecutableFile + " --");
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
using System;
using System.Runtime.InteropServices;
using System.Collections.Generic;
using System.Text;

namespace Tizen.NUI.WindowSystem
{
internal static partial class Interop
{
internal static class InputGesture
{
const string lib = "libcapi-ui-efl-util.so.0";

internal static string LogTag = "Tizen.NUI.WindowSystem";

[DllImport(lib, EntryPoint = "efl_util_gesture_initialize")]
internal static extern IntPtr Initialize();

[DllImport(lib, EntryPoint = "efl_util_gesture_deinitialize")]
internal static extern ErrorCode Deinitialize(IntPtr gestureHandler);

[DllImport(lib, EntryPoint = "efl_util_gesture_edge_swipe_new")]
internal static extern IntPtr EdgeSwipeNew(IntPtr gestureHandler, int fingers, int edge);

[DllImport(lib, EntryPoint = "efl_util_gesture_edge_swipe_free")]
internal static extern ErrorCode EdgeSwipeFree(IntPtr gestureHandler, IntPtr gestureData);

[DllImport(lib, EntryPoint = "efl_util_gesture_edge_swipe_size_set")]
internal static extern ErrorCode EdgeSwipeSizeSet(IntPtr gestureData, int edgeSize, int startPoint, int endPoint);

[DllImport(lib, EntryPoint = "efl_util_gesture_edge_drag_new")]
internal static extern IntPtr EdgeDragNew(IntPtr gestureHandler, int fingers, int edge);

[DllImport(lib, EntryPoint = "efl_util_gesture_edge_drag_free")]
internal static extern ErrorCode EdgeDragFree(IntPtr gestureHandler, IntPtr gestureData);

[DllImport(lib, EntryPoint = "efl_util_gesture_edge_drag_size_set")]
internal static extern ErrorCode EdgeDragSizeSet(IntPtr gestureData, int edgeSize, int startPoint, int endPoint);

[DllImport(lib, EntryPoint = "efl_util_gesture_tap_new")]
internal static extern IntPtr TapNew(IntPtr gestureHandler, int fingers, int repeats);

[DllImport(lib, EntryPoint = "efl_util_gesture_tap_free")]
internal static extern ErrorCode TapFree(IntPtr gestureHandler, IntPtr gestureData);

[DllImport(lib, EntryPoint = "efl_util_gesture_palm_cover_new")]
internal static extern IntPtr PalmCoverNew(IntPtr gestureHandler);

[DllImport(lib, EntryPoint = "efl_util_gesture_palm_cover_free")]
internal static extern ErrorCode PalmCoverFree(IntPtr gestureHandler, IntPtr gestureData);

[DllImport(lib, EntryPoint = "efl_util_gesture_grab")]
internal static extern ErrorCode GestureGrab(IntPtr gestureHandler, IntPtr gestureData);

[DllImport(lib, EntryPoint = "efl_util_gesture_ungrab")]
internal static extern ErrorCode GestureUngrab(IntPtr gestureHandler, IntPtr gestureData);

[DllImport(lib, EntryPoint = "efl_util_gesture_edge_swipe_cb_set")]
internal static extern ErrorCode SetEdgeSwipeCb(IntPtr gestureHandler, EdgeSwipeCb cbFunc, IntPtr usergestureData);

[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate void EdgeSwipeCb(IntPtr usergestureData, int mode, int fingers, int sx, int sy, int edge);

[DllImport(lib, EntryPoint = "efl_util_gesture_edge_drag_cb_set")]
internal static extern ErrorCode SetEdgeDragCb(IntPtr gestureHandler, EdgeDragCb cbFunc, IntPtr usergestureData);

[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate void EdgeDragCb(IntPtr usergestureData, int mode, int fingers, int cx, int cy, int edge);

[DllImport(lib, EntryPoint = "efl_util_gesture_tap_cb_set")]
internal static extern ErrorCode SetTapCb(IntPtr gestureHandler, TapCb cbFunc, IntPtr usergestureData);

[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate void TapCb(IntPtr usergestureData, int mode, int fingers, int repeats);

[DllImport(lib, EntryPoint = "efl_util_gesture_palm_cover_cb_set")]
internal static extern ErrorCode SetPalmCoverCb(IntPtr gestureHandler, PalmCoverCb cbFunc, IntPtr usergestureData);

[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate void PalmCoverCb(IntPtr usergestureData, int mode, int duration, int cx, int cy, int size, double pressure);

internal enum ErrorCode
{
None = Tizen.Internals.Errors.ErrorCode.None, // Successful
OutOfMemory = Tizen.Internals.Errors.ErrorCode.OutOfMemory, // Out of memory
InvalidParameter = Tizen.Internals.Errors.ErrorCode.InvalidParameter, // Invalid parameter
InvalidOperation = Tizen.Internals.Errors.ErrorCode.InvalidOperation, // Invalid operation
PermissionDenied = Tizen.Internals.Errors.ErrorCode.PermissionDenied, // Permission denied
NotSupported = Tizen.Internals.Errors.ErrorCode.NotSupported, // NOT supported
};
}
}
}
58 changes: 58 additions & 0 deletions src/Tizen.NUI.WindowSystem/src/public/EdgeDragEventArgs.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*
* 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;

namespace Tizen.NUI.WindowSystem
{
/// <summary>
/// This class contains the data related to the EdgeDrag event.
/// </summary>
/// This class is need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public class EdgeDragEventArgs : EventArgs
{
internal EdgeDragEventArgs(int mode, int fingers, int cx, int cy, int edge)
{
Mode = mode;
Fingers = fingers;
Cx = cx;
Cy = cy;
Edge = edge;
}
/// <summary>
/// Mode
/// </summary>
public int Mode{ get; internal set; }
/// <summary>
/// Fingers
/// </summary>
public int Fingers{ get; internal set;}
/// <summary>
/// Cx
/// </summary>
public int Cx{ get; internal set;}
/// <summary>
/// Cy
/// </summary>
public int Cy{ get; internal set;}
/// <summary>
/// Edge
/// </summary>
public int Edge{ get; internal set;}
}
}
58 changes: 58 additions & 0 deletions src/Tizen.NUI.WindowSystem/src/public/EdgeSwipeEventArgs.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*
* 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;

namespace Tizen.NUI.WindowSystem
{
/// <summary>
/// This class contains the data related to the EdgeSwipe event.
/// </summary>
/// This class is need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public class EdgeSwipeEventArgs : EventArgs
{
internal EdgeSwipeEventArgs(int mode, int fingers, int sx, int sy, int edge)
{
Mode = mode;
Fingers = fingers;
Sx = sx;
Sy = sy;
Edge = edge;
}
/// <summary>
/// Mode
/// </summary>
public int Mode{ get; internal set; }
/// <summary>
/// Fingers
/// </summary>
public int Fingers{ get; internal set;}
/// <summary>
/// Sx
/// </summary>
public int Sx{ get; internal set;}
/// <summary>
/// Sy
/// </summary>
public int Sy{ get; internal set;}
/// <summary>
/// Edge
/// </summary>
public int Edge{ get; internal set;}
}
}
Loading
Loading