From a6b5c3a0e3b8291118f88d2b63682b19a5aac309 Mon Sep 17 00:00:00 2001 From: "moon87.park" Date: Tue, 25 Apr 2017 15:28:41 +0900 Subject: [PATCH] [Attach panel] Initial implement C# attach-panel API Change-Id: I84587c7545c813fe5b8b4255ba2601b6b775359a --- .../Interop/Interop.AttachPanel.cs | 15 +- .../Interop/Interop.Libraries.cs | 4 +- .../Tizen.Applications.AttachPanel.csproj | 11 +- ...izen.Applications.AttachPanel.project.lock.json | 13 +- .../Tizen.Applications.AttachPanel/AttachPanel.cs | 173 +++++++++++++++++++++ .../AttachPanelManager.cs | 67 ++++++++ .../ContentCategory.cs | 57 +++++++ .../Tizen.Applications.AttachPanel/EventType.cs | 25 +++ .../ResultEventArgs.cs | 32 ++++ .../StateEventArgs.cs | 28 ++++ .../Tizen.Applications.AttachPanel/StateType.cs | 21 +++ .../Tizen.Applications.AttachPanel.cs | 49 ------ 12 files changed, 432 insertions(+), 63 deletions(-) create mode 100755 src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel/AttachPanel.cs create mode 100755 src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel/AttachPanelManager.cs create mode 100755 src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel/ContentCategory.cs create mode 100755 src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel/EventType.cs create mode 100755 src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel/ResultEventArgs.cs create mode 100755 src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel/StateEventArgs.cs create mode 100755 src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel/StateType.cs delete mode 100755 src/Tizen.Applications.AttachPanel/Tizen.Applications/Tizen.Applications.AttachPanel.cs diff --git a/src/Tizen.Applications.AttachPanel/Interop/Interop.AttachPanel.cs b/src/Tizen.Applications.AttachPanel/Interop/Interop.AttachPanel.cs index 6d746fe..3718191 100755 --- a/src/Tizen.Applications.AttachPanel/Interop/Interop.AttachPanel.cs +++ b/src/Tizen.Applications.AttachPanel/Interop/Interop.AttachPanel.cs @@ -1,6 +1,6 @@ using System; using System.Runtime.InteropServices; -using Tizen; +using Tizen.Applications; internal static partial class Interop { @@ -12,8 +12,17 @@ internal static partial class Interop InvalidParameter = Tizen.Internals.Errors.ErrorCode.InvalidParameter, OutOfMemory = Tizen.Internals.Errors.ErrorCode.OutOfMemory, PermissionDenied = Tizen.Internals.Errors.ErrorCode.PermissionDenied, + AlreadyExists = -0x02850000 | 0x01, + NotInitialized = -0x02850000 | 0x02, + UnsupportedContentCategory = -0x02850000 | 0x03, + AlreadyDestroyed = -0x02850000 | 0x05, } + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void AttachPanelEventCallback(IntPtr attachPanel, int eventType, IntPtr eventInfo, IntPtr userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + internal delegate void AttachPanelResultCallback(IntPtr attachPanel, int category, IntPtr result, int resultCode, IntPtr userData); + [DllImport(Libraries.AttachPanel, EntryPoint = "attach_panel_create")] internal static extern ErrorCode CreateAttachPanel(IntPtr conform, ref IntPtr attach_panel); @@ -30,13 +39,13 @@ internal static partial class Interop internal static extern ErrorCode SetExtraData(IntPtr attach_panel, int content_category, IntPtr extraData); [DllImport(Libraries.AttachPanel, EntryPoint = "attach_panel_set_result_cb")] - internal static extern ErrorCode SetResultCb(IntPtr attach_panel, IntPtr result_cb, IntPtr userData); + internal static extern ErrorCode SetResultCb(IntPtr attach_panel, AttachPanelResultCallback callback, IntPtr userData); [DllImport(Libraries.AttachPanel, EntryPoint = "attach_panel_unset_result_cb")] internal static extern ErrorCode UnsetResultCb(IntPtr attach_panel); [DllImport(Libraries.AttachPanel, EntryPoint = "attach_panel_set_event_cb")] - internal static extern ErrorCode SetEventCb(IntPtr attach_panel, IntPtr event_cb, IntPtr userData); + internal static extern ErrorCode SetEventCb(IntPtr attach_panel, AttachPanelEventCallback callback, IntPtr userData); [DllImport(Libraries.AttachPanel, EntryPoint = "attach_panel_unset_event_cb")] internal static extern ErrorCode UnsetEventCb(IntPtr attach_panel); diff --git a/src/Tizen.Applications.AttachPanel/Interop/Interop.Libraries.cs b/src/Tizen.Applications.AttachPanel/Interop/Interop.Libraries.cs index 7e83aa4..4b4049b 100755 --- a/src/Tizen.Applications.AttachPanel/Interop/Interop.Libraries.cs +++ b/src/Tizen.Applications.AttachPanel/Interop/Interop.Libraries.cs @@ -2,6 +2,6 @@ internal static partial class Interop { internal static partial class Libraries { - public const string AttachPanel = "libattach-panel.so.0"; + public const string AttachPanel = "libattach-panel.so.0.1.0"; } -} \ No newline at end of file +} diff --git a/src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel.csproj b/src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel.csproj index d9bd227..c875bba 100755 --- a/src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel.csproj +++ b/src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel.csproj @@ -48,10 +48,15 @@ - + + + + + + + -