From 601d2484270930d9e52fe72057049906d716e112 Mon Sep 17 00:00:00 2001 From: "xb.teng" Date: Tue, 25 Jul 2017 23:31:46 +0800 Subject: [PATCH] [Tizen] Fix imfmanager issue and add an imfmanager sample Change-Id: I1beec6fcb7512568c3e5b4244eff7d8268bac4dc --- src/Tizen.NUI/src/public/ImfManager.cs | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/src/Tizen.NUI/src/public/ImfManager.cs b/src/Tizen.NUI/src/public/ImfManager.cs index 1868cc3..9304124 100755 --- a/src/Tizen.NUI/src/public/ImfManager.cs +++ b/src/Tizen.NUI/src/public/ImfManager.cs @@ -264,6 +264,11 @@ namespace Tizen.NUI private global::System.Runtime.InteropServices.HandleRef swigCPtr; protected bool swigCMemOwn; + internal IntPtr GetImfCallbackDataPtr() + { + return (IntPtr)swigCPtr; + } + internal ImfCallbackData(global::System.IntPtr cPtr, bool cMemoryOwn) { swigCMemOwn = cMemoryOwn; @@ -791,7 +796,7 @@ namespace Tizen.NUI } } - private delegate ImfCallbackData ImfManagerEventReceivedEventCallbackType(global::System.IntPtr imfManager, global::System.IntPtr imfEventData); + private delegate global::System.IntPtr ImfManagerEventReceivedEventCallbackType(global::System.IntPtr imfManager, global::System.IntPtr imfEventData); private ImfManagerEventReceivedEventCallbackType _imfManagerEventReceivedEventCallback; private event EventHandlerWithReturnType _imfManagerEventReceivedEventHandler; @@ -821,8 +826,10 @@ namespace Tizen.NUI } } - private ImfCallbackData OnImfManagerEventReceived(global::System.IntPtr imfManager, global::System.IntPtr imfEventData) + private global::System.IntPtr OnImfManagerEventReceived(global::System.IntPtr imfManager, global::System.IntPtr imfEventData) { + ImfCallbackData imfCallbackData = null; + ImfManagerEventReceivedEventArgs e = new ImfManagerEventReceivedEventArgs(); e.ImfManager = ImfManager.GetImfManagerFromPtr(imfManager); @@ -830,9 +837,16 @@ namespace Tizen.NUI if (_imfManagerEventReceivedEventHandler != null) { - return _imfManagerEventReceivedEventHandler(this, e); + imfCallbackData = _imfManagerEventReceivedEventHandler(this, e); + } + if (imfCallbackData != null) + { + return imfCallbackData.GetImfCallbackDataPtr(); + } + else + { + return new ImfCallbackData().GetImfCallbackDataPtr(); } - return null; } internal ImfEventSignalType EventReceivedSignal() -- 2.7.4