Skip to content
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
36 changes: 18 additions & 18 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -81,24 +81,24 @@
/src/Tizen.Multimedia.Vision/ @hsgwon

# UI FW (NUI)
/src/Tizen.NUI.Components.Design/ @dongsug-song @bshsqa @rabbifor @hinohie
/src/Tizen.NUI.Components/ @dongsug-song @bshsqa @rabbifor @hinohie
/src/Tizen.NUI.Design/ @dongsug-song @bshsqa @rabbifor @hinohie
/src/Tizen.NUI.Extension/ @dongsug-song @bshsqa @rabbifor @hinohie
/src/Tizen.NUI.Physics2D/ @dongsug-song @bshsqa @rabbifor @hinohie
/src/Tizen.NUI.Scene3D/ @dongsug-song @bshsqa @rabbifor @hinohie
/src/Tizen.NUI.WindowSystem/ @dongsug-song @bshsqa @rabbifor @hinohie
/src/Tizen.NUI.XamlBuild/ @dongsug-song @bshsqa @rabbifor @hinohie
/src/Tizen.NUI/ @dongsug-song @bshsqa @rabbifor @hinohie
/test/NUITestSample/ @dongsug-song @bshsqa @rabbifor @hinohie
/test/NUITizenGallery/ @dongsug-song @bshsqa @rabbifor @hinohie
/test/Tizen.NUI.ComponentApplication/ @bshsqa @rabbifor @hinohie
/test/Tizen.NUI.Samples/ @dongsug-song @bshsqa @rabbifor @hinohie
/test/Tizen.NUI.SeamlessSamples/ @dongsug-song @bshsqa @rabbifor @hinohie
/test/Tizen.NUI.StyleGuide/ @dongsug-song @bshsqa @rabbifor @hinohie
/test/Tizen.NUI.Tests/ @dongsug-song @bshsqa @rabbifor @hinohie
/test/Tizen.NUI.WebViewTest/ @dongsug-song @bshsqa @rabbifor @hinohie
/test/Tizen.NUI.WindowSystem.Samples/ @dongsug-song @bshsqa @rabbifor @hinohie
/src/Tizen.NUI.Components.Design/ @dongsug-song @bshsqa @rabbitfor @JoogabYun
/src/Tizen.NUI.Components/ @dongsug-song @bshsqa @rabbitfor @JoogabYun
/src/Tizen.NUI.Design/ @dongsug-song @bshsqa @rabbitfor @JoogabYun
/src/Tizen.NUI.Extension/ @dongsug-song @bshsqa @rabbitfor @JoogabYun
/src/Tizen.NUI.Physics2D/ @dongsug-song @bshsqa @rabbitfor @JoogabYun
/src/Tizen.NUI.Scene3D/ @dongsug-song @bshsqa @rabbitfor @JoogabYun
/src/Tizen.NUI.WindowSystem/ @dongsug-song @bshsqa @rabbitfor @JoogabYun
/src/Tizen.NUI.XamlBuild/ @dongsug-song @bshsqa @rabbitfor @JoogabYun
/src/Tizen.NUI/ @dongsug-song @bshsqa @rabbitfor @JoogabYun
/test/NUITestSample/ @dongsug-song @bshsqa @rabbitfor @JoogabYun
/test/NUITizenGallery/ @dongsug-song @bshsqa @rabbitfor @JoogabYun
/test/Tizen.NUI.ComponentApplication/ @bshsqa @rabbitfor @JoogabYun
/test/Tizen.NUI.Samples/ @dongsug-song @bshsqa @rabbitfor @JoogabYun
/test/Tizen.NUI.SeamlessSamples/ @dongsug-song @bshsqa @rabbitfor @JoogabYun
/test/Tizen.NUI.StyleGuide/ @dongsug-song @bshsqa @rabbitfor @JoogabYun
/test/Tizen.NUI.Tests/ @dongsug-song @bshsqa @rabbitfor @JoogabYun
/test/Tizen.NUI.WebViewTest/ @dongsug-song @bshsqa @rabbitfor @JoogabYun
/test/Tizen.NUI.WindowSystem.Samples/ @dongsug-song @bshsqa @rabbitfor @JoogabYun

# NETWORK
/src/Tizen.Network.Bluetooth/ @dh79pyun @wootak-jung
Expand Down
8 changes: 5 additions & 3 deletions src/Tizen.NUI/src/internal/Interop/Interop.DragAndDrop.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,11 @@ internal enum DragType
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_DragEvent_GetPosition")]
public static extern global::System.IntPtr GetPosition(global::System.IntPtr dragAndDrop);

[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_DragEvent_GetMimeTypes")]
[return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)]
public static extern bool GetMimeTypes(global::System.IntPtr dragAndDrop, out global::System.IntPtr mimeTypes, out int count);
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_DragEvent_GetMimeTypeCount")]
public static extern int GetMimeTypeCount(global::System.IntPtr dragAndDrop);

[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_DragEvent_GetMimeType")]
public static extern string GetMimeType(global::System.IntPtr dragAndDrop, int index);

[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_DragEvent_GetData")]
public static extern string GetData(global::System.IntPtr dragAndDrop);
Expand Down
63 changes: 29 additions & 34 deletions src/Tizen.NUI/src/public/DragAndDrop/DragAndDrop.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,28 +61,33 @@ public class DragAndDrop : BaseHandle
private const int MinDragWindowWidth = 100;
private const int MinDragWindowHeight = 100;

private static string [] GetMimeTypes(IntPtr nativeDragEvent)
{
int count = Interop.DragAndDrop.GetMimeTypeCount(nativeDragEvent);
if (count <= 0)
{
return null;
}

string [] managedMimeTypes = new string[count];
for (int iterator = 0; iterator < count; iterator++)
{
managedMimeTypes[iterator] = Interop.DragAndDrop.GetMimeType(nativeDragEvent, iterator);
}

return managedMimeTypes;
}

private void ProcessDragEventTargetCallback(IntPtr nativeDragEvent, View targetView, DragAndDropEventHandler callback)
{
DragType type = (DragType)Interop.DragAndDrop.GetAction(nativeDragEvent);
DragEvent dragEvent = new DragEvent();
global::System.IntPtr cPtr = Interop.DragAndDrop.GetPosition(nativeDragEvent);
dragEvent.Position = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, true);

IntPtr nativeMimeTypes;
int count;
Interop.DragAndDrop.GetMimeTypes(nativeDragEvent, out nativeMimeTypes, out count);
if (count > 0)
string [] managedMimeTypes = GetMimeTypes(nativeDragEvent);
if (managedMimeTypes != null)
{
IntPtr [] nativeMimeTypesArrary = new IntPtr[count];
Marshal.Copy(nativeMimeTypes, nativeMimeTypesArrary, 0, count);

string [] managedMimeTypes = new string[count];

for (int iterator = 0; iterator < count; iterator++)
{
managedMimeTypes[iterator] = Marshal.PtrToStringAnsi(nativeMimeTypesArrary[iterator]);
}

dragEvent.MimeType = managedMimeTypes[0];
dragEvent.MimeTypes = managedMimeTypes;
}
Expand Down Expand Up @@ -117,21 +122,9 @@ private void ProcessDragEventWindowCallback(IntPtr nativeDragEvent, Window targe
global::System.IntPtr cPtr = Interop.DragAndDrop.GetPosition(nativeDragEvent);
dragEvent.Position = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);

IntPtr nativeMimeTypes;
int count;
Interop.DragAndDrop.GetMimeTypes(nativeDragEvent, out nativeMimeTypes, out count);
if (count > 0)
string [] managedMimeTypes = GetMimeTypes(nativeDragEvent);
if (managedMimeTypes != null)
{
IntPtr [] nativeMimeTypesArrary = new IntPtr[count];
Marshal.Copy(nativeMimeTypes, nativeMimeTypesArrary, 0, count);

string [] managedMimeTypes = new string[count];

for (int iterator = 0; iterator < count; iterator++)
{
managedMimeTypes[iterator] = Marshal.PtrToStringAnsi(nativeMimeTypesArrary[iterator]);
}

dragEvent.MimeType = managedMimeTypes[0];
dragEvent.MimeTypes = managedMimeTypes;
}
Expand Down Expand Up @@ -318,7 +311,8 @@ public void AddListener(View targetView, string mimeType, DragAndDropEventHandle
if (!Interop.DragAndDrop.AddListener(SwigCPtr, View.getCPtr(targetView), mimeType,
new global::System.Runtime.InteropServices.HandleRef(this, Marshal.GetFunctionPointerForDelegate<Delegate>(cb))))
{
throw new InvalidOperationException("Fail to AddListener for View");
targetEventDictionary.Remove(targetView);
throw new InvalidOperationException("Fail to AddListener for View");
}
}

Expand All @@ -336,12 +330,12 @@ public void RemoveListener(View targetView, DragAndDropEventHandler _)
}

InternalDragAndDropEventHandler cb = targetEventDictionary[targetView];
targetEventDictionary.Remove(targetView);
if (!Interop.DragAndDrop.RemoveListener(SwigCPtr, View.getCPtr(targetView),
new global::System.Runtime.InteropServices.HandleRef(this, Marshal.GetFunctionPointerForDelegate<Delegate>(cb))))
{
throw new InvalidOperationException("Fail to RemoveListener for View");
throw new InvalidOperationException("Fail to RemoveListener for View");
}
targetEventDictionary.Remove(targetView);
}

/// <summary>
Expand Down Expand Up @@ -371,7 +365,8 @@ public void AddListener(Window targetWindow, string mimeType, DragAndDropWindowE
if (!Interop.DragAndDrop.WindowAddListener(SwigCPtr, Window.getCPtr(targetWindow), mimeType,
new global::System.Runtime.InteropServices.HandleRef(this, Marshal.GetFunctionPointerForDelegate<Delegate>(cb))))
{
throw new InvalidOperationException("Fail to AddListener for Window");
targetWindowEventDictionary.Remove(targetWindow);
throw new InvalidOperationException("Fail to AddListener for Window");
}
}

Expand All @@ -389,12 +384,12 @@ public void RemoveListener(Window targetWindow, DragAndDropWindowEventHandler _)
}

InternalDragAndDropEventHandler cb = targetWindowEventDictionary[targetWindow];
targetWindowEventDictionary.Remove(targetWindow);
if (!Interop.DragAndDrop.WindowRemoveListener(SwigCPtr, Window.getCPtr(targetWindow),
new global::System.Runtime.InteropServices.HandleRef(this, Marshal.GetFunctionPointerForDelegate<Delegate>(cb))))
{
throw new InvalidOperationException("Fail to RemoveListener for Window");
throw new InvalidOperationException("Fail to RemoveListener for Window");
}
targetWindowEventDictionary.Remove(targetWindow);
}

/// <summary>
Expand Down
Loading