Skip to content

Commit

Permalink
[NUI] Refractor ImfManager to InputMethodContext (Samsung#229)
Browse files Browse the repository at this point in the history
Here are some changes:
1.Refractor ImfManager as a normal class
2.Rename ImfManager to InputMethodContext
3.ImfEvent -> EventType
4.ImfEventData -> EventData
5.ImfCallbackData -> CallbackData
  • Loading branch information
elishateng authored and dongsug-song committed Apr 27, 2018
1 parent 90ea6bd commit 8d2af23
Show file tree
Hide file tree
Showing 9 changed files with 1,682 additions and 232 deletions.
6 changes: 3 additions & 3 deletions src/Tizen.NUI/src/internal/ActivatedSignalType.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright(c) 2017 Samsung Electronics Co., Ltd.
* Copyright(c) 2018 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.
Expand Down Expand Up @@ -177,9 +177,9 @@ public void Disconnect(System.Delegate func)
/// </summary>
/// <param name="arg">The first value to pass to callbacks</param>
/// <since_tizen> 4 </since_tizen>
public void Emit(ImfManager arg)
public void Emit(InputMethodContext arg)
{
NDalicManualPINVOKE.ActivatedSignalType_Emit(swigCPtr, ImfManager.getCPtr(arg));
NDalicManualPINVOKE.ActivatedSignalType_Emit(swigCPtr, InputMethodContext.getCPtr(arg));
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright(c) 2017 Samsung Electronics Co., Ltd.
* Copyright(c) 2018 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.
Expand All @@ -20,7 +20,7 @@

namespace Tizen.NUI
{
internal class ImfEventSignalType : global::System.IDisposable
internal class KeyboardEventSignalType : global::System.IDisposable
{
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
/// <summary>
Expand All @@ -29,13 +29,13 @@ internal class ImfEventSignalType : global::System.IDisposable
/// <since_tizen> 3 </since_tizen>
protected bool swigCMemOwn;

internal ImfEventSignalType(global::System.IntPtr cPtr, bool cMemoryOwn)
internal KeyboardEventSignalType(global::System.IntPtr cPtr, bool cMemoryOwn)
{
swigCMemOwn = cMemoryOwn;
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
}

internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ImfEventSignalType obj)
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(KeyboardEventSignalType obj)
{
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
}
Expand All @@ -52,7 +52,7 @@ internal ImfEventSignalType(global::System.IntPtr cPtr, bool cMemoryOwn)
/// Dispose
/// </summary>
/// <since_tizen> 3 </since_tizen>
~ImfEventSignalType()
~KeyboardEventSignalType()
{
if (!isDisposeQueued)
{
Expand Down Expand Up @@ -112,7 +112,7 @@ protected virtual void Dispose(DisposeTypes type)
if (swigCMemOwn)
{
swigCMemOwn = false;
NDalicManualPINVOKE.delete_ImfEventSignalType(swigCPtr);
NDalicManualPINVOKE.delete_KeyboardEventSignalType(swigCPtr);
}
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
}
Expand All @@ -127,7 +127,7 @@ protected virtual void Dispose(DisposeTypes type)
/// <since_tizen> 3 </since_tizen>
public bool Empty()
{
bool ret = NDalicManualPINVOKE.ImfEventSignalType_Empty(swigCPtr);
bool ret = NDalicManualPINVOKE.KeyboardEventSignalType_Empty(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
Expand All @@ -139,7 +139,7 @@ public bool Empty()
/// <since_tizen> 3 </since_tizen>
public uint GetConnectionCount()
{
uint ret = NDalicManualPINVOKE.ImfEventSignalType_GetConnectionCount(swigCPtr);
uint ret = NDalicManualPINVOKE.KeyboardEventSignalType_GetConnectionCount(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
Expand All @@ -153,7 +153,7 @@ public void Connect(System.Delegate func)
{
System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate<System.Delegate>(func);
{
NDalicManualPINVOKE.ImfEventSignalType_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
NDalicManualPINVOKE.KeyboardEventSignalType_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
}
Expand All @@ -167,7 +167,7 @@ public void Disconnect(System.Delegate func)
{
System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate<System.Delegate>(func);
{
NDalicManualPINVOKE.ImfEventSignalType_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
NDalicManualPINVOKE.KeyboardEventSignalType_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
}
Expand All @@ -179,9 +179,9 @@ public void Disconnect(System.Delegate func)
/// <param name="arg2">The second value to pass to callbacks</param>
/// <returns>The value returned by the last callback, or a default constructed value if no callbacks are connected</returns>
/// <since_tizen> 4 </since_tizen>
public ImfManager.ImfCallbackData Emit(ImfManager arg1, ImfManager.ImfEventData arg2)
public InputMethodContext.CallbackData Emit(InputMethodContext arg1, InputMethodContext.EventData arg2)
{
ImfManager.ImfCallbackData ret = new ImfManager.ImfCallbackData(NDalicManualPINVOKE.ImfEventSignalType_Emit(swigCPtr, ImfManager.getCPtr(arg1), ImfManager.ImfEventData.getCPtr(arg2)), true);
InputMethodContext.CallbackData ret = new InputMethodContext.CallbackData(NDalicManualPINVOKE.KeyboardEventSignalType_Emit(swigCPtr, InputMethodContext.getCPtr(arg1), InputMethodContext.EventData.getCPtr(arg2)), true);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
Expand All @@ -190,7 +190,7 @@ public ImfManager.ImfCallbackData Emit(ImfManager arg1, ImfManager.ImfEventData
/// The contructor.
/// </summary>
/// <since_tizen> 3 </since_tizen>
public ImfEventSignalType() : this(NDalicManualPINVOKE.new_ImfEventSignalType(), true)
public KeyboardEventSignalType() : this(NDalicManualPINVOKE.new_KeyboardEventSignalType(), true)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
Expand Down
4 changes: 2 additions & 2 deletions src/Tizen.NUI/src/internal/KeyboardTypeSignalType.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright(c) 2017 Samsung Electronics Co., Ltd.
* Copyright(c) 2018 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.
Expand Down Expand Up @@ -179,7 +179,7 @@ public void Disconnect(System.Delegate func)
/// </summary>
/// <param name="arg">The member function to connect</param>
/// <since_tizen> 4 </since_tizen>
public void Emit(ImfManager.KeyboardType arg)
public void Emit(InputMethodContext.KeyboardType arg)
{
NDalicManualPINVOKE.KeyboardTypeSignalType_Emit(swigCPtr, (int)arg);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
Expand Down
Loading

0 comments on commit 8d2af23

Please sign in to comment.