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

[NUI] Add multi-mimetype feature for Drag and Drop #6294

Merged
merged 3 commits into from
Sep 11, 2024

Conversation

taehyub
Copy link
Contributor

@taehyub taehyub commented Aug 28, 2024

Contents

  • Allow to set multi-mimetypes for source client
  • Target client receive source's mimetypes from source client when Enter, Move, Leave
  • Target client can set mimetype to receive
  • Refactoring code for readability

Dependency

[dali-adaptor]

[dali-csharp-binder]

@TizenAPI-Bot
Copy link
Collaborator

Public API Changed

Please follow the ACR process for the changed API below.

Added: 15, Removed: 0, Changed: 0

Added

+ /// <since_tizen>none</since_tizen
+ Tizen.NUI.DragAndDrop/DragAndDropDragInfoEventHandler

+ /// <since_tizen>none</since_tizen
+ System.IAsyncResult Tizen.NUI.DragAndDrop/DragAndDropDragInfoEventHandler::BeginInvoke(Tizen.NUI.BaseComponents.View,Tizen.NUI.DragInfoEvent,System.AsyncCallback,System.Object)

+ /// <since_tizen>none</since_tizen
+ System.Void Tizen.NUI.DragAndDrop/DragAndDropDragInfoEventHandler::.ctor(System.Object,System.IntPtr)

+ /// <since_tizen>none</since_tizen
+ System.Void Tizen.NUI.DragAndDrop/DragAndDropDragInfoEventHandler::EndInvoke(System.IAsyncResult)

+ /// <since_tizen>none</since_tizen
+ System.Void Tizen.NUI.DragAndDrop/DragAndDropDragInfoEventHandler::Invoke(Tizen.NUI.BaseComponents.View,Tizen.NUI.DragInfoEvent)

+ /// <since_tizen>none</since_tizen
+ Tizen.NUI.DragAndDrop/DragAndDropWindowDragInfoEventHandler

+ /// <since_tizen>none</since_tizen
+ System.IAsyncResult Tizen.NUI.DragAndDrop/DragAndDropWindowDragInfoEventHandler::BeginInvoke(Tizen.NUI.Window,Tizen.NUI.DragInfoEvent,System.AsyncCallback,System.Object)

+ /// <since_tizen>none</since_tizen
+ System.Void Tizen.NUI.DragAndDrop/DragAndDropWindowDragInfoEventHandler::.ctor(System.Object,System.IntPtr)

+ /// <since_tizen>none</since_tizen
+ System.Void Tizen.NUI.DragAndDrop/DragAndDropWindowDragInfoEventHandler::EndInvoke(System.IAsyncResult)

+ /// <since_tizen>none</since_tizen
+ System.Void Tizen.NUI.DragAndDrop/DragAndDropWindowDragInfoEventHandler::Invoke(Tizen.NUI.Window,Tizen.NUI.DragInfoEvent)

+ /// <since_tizen>none</since_tizen
+ Tizen.NUI.DragAndDrop/DragAndDropWindowEventHandler

+ /// <since_tizen>none</since_tizen
+ System.IAsyncResult Tizen.NUI.DragAndDrop/DragAndDropWindowEventHandler::BeginInvoke(Tizen.NUI.Window,Tizen.NUI.DragEvent,System.AsyncCallback,System.Object)

+ /// <since_tizen>none</since_tizen
+ System.Void Tizen.NUI.DragAndDrop/DragAndDropWindowEventHandler::.ctor(System.Object,System.IntPtr)

+ /// <since_tizen>none</since_tizen
+ System.Void Tizen.NUI.DragAndDrop/DragAndDropWindowEventHandler::EndInvoke(System.IAsyncResult)

+ /// <since_tizen>none</since_tizen
+ System.Void Tizen.NUI.DragAndDrop/DragAndDropWindowEventHandler::Invoke(Tizen.NUI.Window,Tizen.NUI.DragEvent)

Internal API Changed

Added: 11, Removed: 5, Changed: 0

Added

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ System.Void Tizen.NUI.DragAndDrop::AddListener(Tizen.NUI.BaseComponents.View,System.String,Tizen.NUI.DragAndDrop/DragAndDropDragInfoEventHandler)

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ System.Void Tizen.NUI.DragAndDrop::AddListener(Tizen.NUI.Window,System.String,Tizen.NUI.DragAndDrop/DragAndDropWindowDragInfoEventHandler)

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ System.Void Tizen.NUI.DragAndDrop::StartDragAndDrop(Tizen.NUI.BaseComponents.View,Tizen.NUI.BaseComponents.View,Tizen.NUI.DragInfo,Tizen.NUI.DragAndDrop/SourceEventHandler)

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ Tizen.NUI.DragInfo

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ System.String Tizen.NUI.DragInfo::Data()

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ System.String[] Tizen.NUI.DragInfo::MimeTypes()

+ /// <since_tizen>10</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ Tizen.NUI.DragInfoEvent

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ System.String Tizen.NUI.DragInfoEvent::Data()

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ System.String[] Tizen.NUI.DragInfoEvent::MimeTypes()

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ Tizen.NUI.DragType Tizen.NUI.DragInfoEvent::DragType()

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ Tizen.NUI.Position Tizen.NUI.DragInfoEvent::Position()

Removed

- /// <since_tizen>none</since_tizen
- [EditorBrowsable(EditorBrowsableState.Never)]
- Tizen.NUI.DragAndDrop/DragAndDropWindowEventHandler

- /// <since_tizen>none</since_tizen
- [EditorBrowsable(EditorBrowsableState.Never)]
- System.IAsyncResult Tizen.NUI.DragAndDrop/DragAndDropWindowEventHandler::BeginInvoke(Tizen.NUI.Window,Tizen.NUI.DragEvent,System.AsyncCallback,System.Object)

- /// <since_tizen>none</since_tizen
- [EditorBrowsable(EditorBrowsableState.Never)]
- System.Void Tizen.NUI.DragAndDrop/DragAndDropWindowEventHandler::.ctor(System.Object,System.IntPtr)

- /// <since_tizen>none</since_tizen
- [EditorBrowsable(EditorBrowsableState.Never)]
- System.Void Tizen.NUI.DragAndDrop/DragAndDropWindowEventHandler::EndInvoke(System.IAsyncResult)

- /// <since_tizen>none</since_tizen
- [EditorBrowsable(EditorBrowsableState.Never)]
- System.Void Tizen.NUI.DragAndDrop/DragAndDropWindowEventHandler::Invoke(Tizen.NUI.Window,Tizen.NUI.DragEvent)

Contents
- Allow to set multi-mimetypes for source client (use DragInfo)
- Target client receive source's mimetypes from source client when Enter, Move, Leave
- Target client can set mimetype to receive - Refactoring code for readability
- Refactoring codes for readability
@TizenAPI-Bot
Copy link
Collaborator

Public API Changed

Please follow the ACR process for the changed API below.

Added: 15, Removed: 0, Changed: 0

Added

+ /// <since_tizen>none</since_tizen
+ Tizen.NUI.DragAndDrop/DragAndDropDragInfoEventHandler

+ /// <since_tizen>none</since_tizen
+ System.IAsyncResult Tizen.NUI.DragAndDrop/DragAndDropDragInfoEventHandler::BeginInvoke(Tizen.NUI.BaseComponents.View,Tizen.NUI.DragInfoEvent,System.AsyncCallback,System.Object)

+ /// <since_tizen>none</since_tizen
+ System.Void Tizen.NUI.DragAndDrop/DragAndDropDragInfoEventHandler::.ctor(System.Object,System.IntPtr)

+ /// <since_tizen>none</since_tizen
+ System.Void Tizen.NUI.DragAndDrop/DragAndDropDragInfoEventHandler::EndInvoke(System.IAsyncResult)

+ /// <since_tizen>none</since_tizen
+ System.Void Tizen.NUI.DragAndDrop/DragAndDropDragInfoEventHandler::Invoke(Tizen.NUI.BaseComponents.View,Tizen.NUI.DragInfoEvent)

+ /// <since_tizen>none</since_tizen
+ Tizen.NUI.DragAndDrop/DragAndDropWindowDragInfoEventHandler

+ /// <since_tizen>none</since_tizen
+ System.IAsyncResult Tizen.NUI.DragAndDrop/DragAndDropWindowDragInfoEventHandler::BeginInvoke(Tizen.NUI.Window,Tizen.NUI.DragInfoEvent,System.AsyncCallback,System.Object)

+ /// <since_tizen>none</since_tizen
+ System.Void Tizen.NUI.DragAndDrop/DragAndDropWindowDragInfoEventHandler::.ctor(System.Object,System.IntPtr)

+ /// <since_tizen>none</since_tizen
+ System.Void Tizen.NUI.DragAndDrop/DragAndDropWindowDragInfoEventHandler::EndInvoke(System.IAsyncResult)

+ /// <since_tizen>none</since_tizen
+ System.Void Tizen.NUI.DragAndDrop/DragAndDropWindowDragInfoEventHandler::Invoke(Tizen.NUI.Window,Tizen.NUI.DragInfoEvent)

+ /// <since_tizen>none</since_tizen
+ Tizen.NUI.DragAndDrop/DragAndDropWindowEventHandler

+ /// <since_tizen>none</since_tizen
+ System.IAsyncResult Tizen.NUI.DragAndDrop/DragAndDropWindowEventHandler::BeginInvoke(Tizen.NUI.Window,Tizen.NUI.DragEvent,System.AsyncCallback,System.Object)

+ /// <since_tizen>none</since_tizen
+ System.Void Tizen.NUI.DragAndDrop/DragAndDropWindowEventHandler::.ctor(System.Object,System.IntPtr)

+ /// <since_tizen>none</since_tizen
+ System.Void Tizen.NUI.DragAndDrop/DragAndDropWindowEventHandler::EndInvoke(System.IAsyncResult)

+ /// <since_tizen>none</since_tizen
+ System.Void Tizen.NUI.DragAndDrop/DragAndDropWindowEventHandler::Invoke(Tizen.NUI.Window,Tizen.NUI.DragEvent)

Internal API Changed

Added: 11, Removed: 5, Changed: 0

Added

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ System.Void Tizen.NUI.DragAndDrop::AddListener(Tizen.NUI.BaseComponents.View,System.String,Tizen.NUI.DragAndDrop/DragAndDropDragInfoEventHandler)

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ System.Void Tizen.NUI.DragAndDrop::AddListener(Tizen.NUI.Window,System.String,Tizen.NUI.DragAndDrop/DragAndDropWindowDragInfoEventHandler)

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ System.Void Tizen.NUI.DragAndDrop::StartDragAndDrop(Tizen.NUI.BaseComponents.View,Tizen.NUI.BaseComponents.View,Tizen.NUI.DragInfo,Tizen.NUI.DragAndDrop/SourceEventHandler)

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ Tizen.NUI.DragInfo

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ System.String Tizen.NUI.DragInfo::Data()

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ System.String[] Tizen.NUI.DragInfo::MimeTypes()

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ Tizen.NUI.DragInfoEvent

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ System.String Tizen.NUI.DragInfoEvent::Data()

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ System.String[] Tizen.NUI.DragInfoEvent::MimeTypes()

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ Tizen.NUI.DragType Tizen.NUI.DragInfoEvent::DragType()

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ Tizen.NUI.Position Tizen.NUI.DragInfoEvent::Position()

Removed

- /// <since_tizen>none</since_tizen
- [EditorBrowsable(EditorBrowsableState.Never)]
- Tizen.NUI.DragAndDrop/DragAndDropWindowEventHandler

- /// <since_tizen>none</since_tizen
- [EditorBrowsable(EditorBrowsableState.Never)]
- System.IAsyncResult Tizen.NUI.DragAndDrop/DragAndDropWindowEventHandler::BeginInvoke(Tizen.NUI.Window,Tizen.NUI.DragEvent,System.AsyncCallback,System.Object)

- /// <since_tizen>none</since_tizen
- [EditorBrowsable(EditorBrowsableState.Never)]
- System.Void Tizen.NUI.DragAndDrop/DragAndDropWindowEventHandler::.ctor(System.Object,System.IntPtr)

- /// <since_tizen>none</since_tizen
- [EditorBrowsable(EditorBrowsableState.Never)]
- System.Void Tizen.NUI.DragAndDrop/DragAndDropWindowEventHandler::EndInvoke(System.IAsyncResult)

- /// <since_tizen>none</since_tizen
- [EditorBrowsable(EditorBrowsableState.Never)]
- System.Void Tizen.NUI.DragAndDrop/DragAndDropWindowEventHandler::Invoke(Tizen.NUI.Window,Tizen.NUI.DragEvent)

Copy link
Contributor

@myroot myroot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

data는 하나인데, mime type만 여러개인 것은 논리적으로 말이 안됩니다.

/// <summary>
/// The mime types of drag data
/// </summary>
public string [] MimeTypes { get; set; }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MimeTypes이 여러개인 이유는 Data가 여러개 이기 때문 아닌가요?
데이터는 하나 인데 MimeType이 여러개인게 말이 되는 건가요?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Drag And Drop에서 MimeTypes은 Source에서 Target으로 전달하고자하는 Type List 정보를 제공합니다.
위 MimeType List를 통해서 Target에서는 Source에서 제공하는 MimeType의 정보를 알 수 있습니다.

{
if (initDrag)
{
Tizen.Log.Fatal("NUI", "Start Drag And Drop Initializing...");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이 상황은 불가능한 상황으로 보입니다.

일단, UI API이기 때문에 UI thread에서만 동작해야 하기 때문에 단일 thread에서 동작하는 코드이고
initDrag 속성은 어쨋든 이 메소드가 끝나면 false로 설정됩니다. 그리고 이 메소드가 끝나기 전까지 이 메소드는 ui thread를 놓지 않기 때문에 그 어떤 새로운 StartDragAndDrop이 시작될 수 없습니다.

결론은 불필요한 체크이거나 뭔가를 오해하고 체크하는 것 같습니다.

// Suppress warning : This struct will be used data of callback, so override equals and operator does not necessary.
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1815: Override equals and operator equals on value types")]
[EditorBrowsable(EditorBrowsableState.Never)]
public struct DragInfo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이름이 엄청 모호한데, 저 바로 위에 DragData가 있음에도 여기 또 거의 동일한 DragData가 또 있는게 참 이상합니다.

아래 리뷰 의견과 같이 MimeType은 Data와 쌍을 이루어야 합니다.
그래서 반드시 MimeType을 여러개 넣는다고 한다면 Data도 여러개 있어야 합니다.
따라서 그것을 위해서 별도의 타입을 만들지 말고 DragData를 배열로 전달하는 편이 좋을 듯합니다.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Multi Mimetype을 지원하면서 기존 ACR된 API와 겹치지 않도록 하기위해서 새로운 Struct 추가를 고려하고 기존 API는 Deprecated 방안을 생각했었는데요 말씀하신 대로 하면 현재 구조에서도 확장이 가능할 것 으로 보입니다. 감사합니다 👍

InternalDragAndDropEventHandler cb = (navtiveDragEvent) =>
{
DragType type = (DragType)Interop.DragAndDrop.GetAction(navtiveDragEvent);
DragEvent event_ = new DragEvent();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

변수명에 _ suffix를 붙이는 것은 어떤 의미로 하신걸까요?
변수명 마지막에 _붙이는 것은 구글의 c++ style가이드에서 멤버 변수에 대해 _ suffix를 붙이는 스타일이 있기 ㄴ한데,
여기는 멤버 변수도 아닌데 _가 붙어 있어서 매우 사람을 혼란스럽게 하는 것 같습니다.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

기존에 동일 이름의 변수가 있어서 구분하면서 사용하였는데요, 이번 패치에서 이름이 바뀌면서 필요가 없어진것 으로 보입니다 😄다음 패치에서 반영할 수 있도록 하겠습니다!

@@ -256,40 +415,107 @@ public void RemoveListener(View targetView, DragAndDropEventHandler _)
[EditorBrowsable(EditorBrowsableState.Never)]
public void AddListener(Window targetWindow, DragAndDropWindowEventHandler callback)
{
InternalDragAndDropEventHandler cb = (dragEvent) =>
InternalDragAndDropEventHandler cb = (navtiveDragEvent) =>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

navtiveDragEvent 오타가 있는 것 같습니다

@myroot
Copy link
Contributor

myroot commented Aug 29, 2024

wl2의 데이터 전달과 관련된 코드

static void
data_source_send(void *data, struct wl_data_source *source, const char *mime_type, int32_t fd)
{
   Ecore_Wl2_Input *input;
   Ecore_Wl2_Event_Data_Source_Send *ev;

   input = data;
   if (!input) return;

   ev = calloc(1, sizeof(Ecore_Wl2_Event_Data_Source_Send));
   if (!ev) return;

   ev->fd = fd;
   ev->type = strdup(mime_type);
   ev->seat = input->id;
   if (source == input->data.selection.source)
     ev->serial = input->data.selection.serial;
   //TIZEN_ONLY(20230725): workaround for multiple selection set
   else if (source == input->data.drag.source)
     ev->serial = input->data.drag.serial;
   else
     {
        if (input->data.selection.serial)
          ev->serial = input->data.selection.serial;
        else
          ev->serial = input->data.drag.serial;
     }
   //
   ev->display = input->display;
   ev->display->refs++;

   ecore_event_add(ECORE_WL2_EVENT_DATA_SOURCE_SEND, ev,
                   data_source_send_free, NULL);
}

Comment on lines 73 to 76
/// <summary>
/// The mime types of drag data
/// </summary>
public string [] MimeTypes { get; set; }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이번 PR을 통해서 다양한 MimeType을 동시에 추가할 수 있게 되어 좋은것 같습니다 👍
관련해서 한 가지 궁금한 점이 있는데 DragInfo을 별도로 추가하신 이유가 하위 호환성때문일까요?
만약 그렇다면, 사용성 측면의 관점에서 새로운 struct를 추가하기보다는 기존 DragData 안으로 해당 type을 추가하는게 좀 더 좋은 구조일 것 같습니다.
이렇게 추가 후에 기존의 MimeType가 필요하지 않는 상황이라면 deprecated 하는게 좋을 듯 합니다.

Suggested change
/// <summary>
/// The mime types of drag data
/// </summary>
public string [] MimeTypes { get; set; }
public struct DragData
{
/// <summary>
/// The mime type of drag data
/// </summary>
public string MimeType { get; set; }
/// <summary>
/// The mime types of drag data
/// </summary>
public string [] MimeTypes { get; set; }

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

추가로 이러한 구조로 갔을때 data 역시 여러 값을 처리할 수 있으면 좋을것 같은데
이 부분에 대해서는 어떻게 생각하시나요?
안드로이드의 ClipData 부분을 참고하면 도움이 될 것 같습니다.
https://developer.android.com/reference/android/content/ClipData

안드로이드에서는 ClipData 안에 여러 ClipItem들과 mimeType으로 구성되어 있어서
여러 데이터를 동시에 받아서 처리할 수 있는 구조로 되어있는 것 같습니다.
관련해서 저희도 비슷한 구조로 변경되면 좋을 것 같은데 어떻게 생각하시나요?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tscholb, @myroot
좋은 제안 주셔서 감사합니다. Drag and Drop 리펙토링시 기존호환성을 깨지않고 어떻게 변경을 할지 고민이 많았었는데요 제안해주신 방법대로 구현하면 기존 호환성을 유지하면서 개선할 수 있을 것 으로 보입니다 😄

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@taehyub
추가로 MimeTypes와 대응되는 data를 Dictionary로 변경하면
데이터 관리 측면에서 도움이 될 것 같은데 어떻게 생각하시나요?

클린코드 관점 중 의도 명확성 및 코드 간결성 관점에서 기존에 있는 라이브러리를 활용하는게 좀 더 좋을것 같아 의견 드립니다.
Dictionary 설명과 간단한 적용 예시에 대해서 아래 링크 추가드립니다.

Dictionary 설명:
https://learn.microsoft.com/ko-kr/dotnet/api/system.collections.generic.dictionary-2?view=net-8.0

Suggested change
/// <summary>
/// The mime types of drag data
/// </summary>
public string [] MimeTypes { get; set; }
Dictionary<string, string> dataMap = new Dictionary<string, string>();
dataMap.Add("mimeType1","mimeData1");
dataMap.Add("mimeType2","mimeData2");

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tscholb
좋은 의견 입니다. MimeType과 대응되는 Data를 Dictionary로 묶는 다면 코드의 응집도가 높아질 것 같네요^^

Copy link
Contributor Author

@taehyub taehyub Sep 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

public struct DragData
{
    /// <summary>
    /// The mime type of drag data
    /// </summary>
    public string MimeType { get; set; }
    /// <summary>
    /// The drag data to send
    /// </summary>
    public string Data { get; set; }

    /// <summary>
    /// The mime types and drag data set
    /// </summary>
    public Dictionary<string, string> DataMap;
}

위와 같이 기존 DragInfo Structure를 새로 만들어서 구분하지 않고 기존 DragData에 DataMap Dictionary를 적용하여 코드의 응집도와 가독성 및 사용성을 높이는 작업을 하였습니다 😄

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

깔끔하게 정리되어서 보기 좋은것 같습니다 😊
말씀하신대로 가독성과 사용성 측면에서 개선되어 보기 편하네요 👍

/// <param name="mimeType">The mime type for target view</param>
/// <param name="callback">The callback function to get drag event when the drag source enters, moves, leaves and drops on the drop target</param>
[EditorBrowsable(EditorBrowsableState.Never)]
public void AddListener(View targetView, string mimeType, DragAndDropDragInfoEventHandler callback)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AddListener를 통해서 여러 type에 대한 callback을 등록해두면 drop 할때마다 target에서 각 type에 대한 ecore_wl2_offer_receive가 호출되는 형태를 의도하신게 맞나요?

동일한 offer에 대해서 ecore_wl2_offer_receive가 동시에 여러번 호출 되면 E20이 ECORE_WL2_EVENT_OFFER_DATA_READY event를 제대로 보내주지 못하는 걸로 알고있는데 동작 테스트가 된건지 궁금합니다.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

현재는 target당 하나의 mimetype을 등록을 고려하고있는데요. 패치량이 많아서 target 기준 multi mimetype은 다음 패치에서 고려하고 있습니다. 말씀하신 내용은 E20 Window 담당자와 확인하였을때 동일 offer에서 ecore_wl2_offer_receive를 여러번 호출하는 것이 Spec상 가능하다고해서요 검토해볼 예정입니다.

Comment on lines 280 to 311
InternalDragAndDropEventHandler cb = (navtiveDragEvent) =>
{
DragType type = (DragType)Interop.DragAndDrop.GetAction(navtiveDragEvent);
DragEvent event_ = new DragEvent();
global::System.IntPtr cPtr = Interop.DragAndDrop.GetPosition(navtiveDragEvent);
event_.Position = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, true);

if (type == DragType.Enter)
{
event_.DragType = type;
event_.MimeType = Interop.DragAndDrop.GetMimeType(navtiveDragEvent);
callback(targetView, event_);
}
else if (type == DragType.Leave)
{
event_.DragType = type;
callback(targetView, event_);
}
else if (type == DragType.Move)
{
event_.DragType = type;
event_.MimeType = Interop.DragAndDrop.GetMimeType(navtiveDragEvent);
callback(targetView, event_);
}
else if (type == DragType.Drop)
{
event_.DragType = type;
event_.MimeType = Interop.DragAndDrop.GetMimeType(navtiveDragEvent);
event_.Data = Interop.DragAndDrop.GetData(navtiveDragEvent);
callback(targetView, event_);
}
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

위 AddListener하는 부분의 코드가 여러번 비슷하게 중첩되는 것 같습니다.
혹시 이 부분을 이렇게 구현하신 이유가 있을까요?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tscholb
기존 구현에서는 Target의 타입이 많지 않고 Single MimeType만 처리하면 되다보니 크게 중첩되는 부분이 없었는데, 이번 패치를 통해 MimeType이 multi로 확장됨에 따라 비슷하게 중첩되는 것 같습니다. 별도의 함수로 분리해보는 것도 좋을 것 같은데 어떻게 생각하시나요?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

히스토리에 대해 잘 설명해주셔서 감사합니다 👍

동작 상 문제가 없다면 함수를 추출하여 중복코드를 줄이는 것이 좋을 것 같습니다.
클린코드 관점으로 보았을 때 코드 길이를 최소화하고 별도의 함수로 추출하는 것이 유지 보수성과 가독성 측면에서 도움이 될 것 같습니다.
아래 코드처럼 별도의 함수로 빼는건 어떠신가요?

Suggested change
InternalDragAndDropEventHandler cb = (navtiveDragEvent) =>
{
DragType type = (DragType)Interop.DragAndDrop.GetAction(navtiveDragEvent);
DragEvent event_ = new DragEvent();
global::System.IntPtr cPtr = Interop.DragAndDrop.GetPosition(navtiveDragEvent);
event_.Position = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, true);
if (type == DragType.Enter)
{
event_.DragType = type;
event_.MimeType = Interop.DragAndDrop.GetMimeType(navtiveDragEvent);
callback(targetView, event_);
}
else if (type == DragType.Leave)
{
event_.DragType = type;
callback(targetView, event_);
}
else if (type == DragType.Move)
{
event_.DragType = type;
event_.MimeType = Interop.DragAndDrop.GetMimeType(navtiveDragEvent);
callback(targetView, event_);
}
else if (type == DragType.Drop)
{
event_.DragType = type;
event_.MimeType = Interop.DragAndDrop.GetMimeType(navtiveDragEvent);
event_.Data = Interop.DragAndDrop.GetData(navtiveDragEvent);
callback(targetView, event_);
}
};
InternalDragAndDropEventHandler cb = (navtiveDragEvent) => DragAndDropCallback(arg1,arg2,...);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

좋은 제안 감사합니다 😄
이번 패치로 인해 중첩되는 내용을 람다 함수의 인자로 줄수 있는 함수로 Method Extratcion한다면 코드가 훨씬 간결할 것으로 보이네요.
수정 후에 다시 코멘트 드리겠습니다 👍

Copy link
Contributor Author

@taehyub taehyub Sep 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

InternalDragAndDropEventHandler cb = (navtiveDragEvent) => ProcessDragEventTargetCallback(navtiveDragEvent, targetView, callback);

중복이 보이는 코드의 람다형식의 메소드로 추출해서 가독성을 높였습니다. 함수 라인이 크게 줄었고 보기가 좋네요 😄

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

확실히 라인이 많이 줄어들어 중복코드가 줄어든 것 같습니다.
빠르게 수정해주셔서 감사합니다🙏

Copy link
Contributor

@tscholb tscholb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 💯

@TizenAPI-Bot
Copy link
Collaborator

Public API Changed

Please follow the ACR process for the changed API below.
Added: 9, Removed: 0, Changed: 213

Internal API Changed

Added: 26, Removed: 5, Changed: 3

Added

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ System.Single Tizen.NUI.BaseComponents.AnimatedImageView::FrameSpeedFactor()

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ System.Single Tizen.NUI.BaseComponents.LottieAnimationView::FrameSpeedFactor()

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ System.Void Tizen.NUI.DragAndDrop::AddListener(Tizen.NUI.BaseComponents.View,System.String,Tizen.NUI.DragAndDrop/DragAndDropEventHandler)

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ System.Void Tizen.NUI.DragAndDrop::AddListener(Tizen.NUI.Window,System.String,Tizen.NUI.DragAndDrop/DragAndDropWindowEventHandler)

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ System.Boolean Tizen.NUI.FrameUpdateCallbackInterface::BakeOrientation(System.UInt32,Tizen.NUI.Rotation)

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ System.Boolean Tizen.NUI.FrameUpdateCallbackInterface::GetOrientation(System.UInt32,Tizen.NUI.Rotation)

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ System.Boolean Tizen.NUI.FrameUpdateCallbackInterface::SetOrientation(System.UInt32,Tizen.NUI.Rotation)

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ System.Void Tizen.NUI.FrameUpdateCallbackInterface::ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef)

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ static System.Int32 Tizen.NUI.ImageVisualProperty::FrameSpeedFactor

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ System.Single Tizen.NUI.Visuals.AnimatedImageVisual::FrameSpeedFactor()

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ Tizen.NUI.WindowBlurInfo Tizen.NUI.Window::BlurInfo()

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ Tizen.NUI.WindowBlurInfo

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ System.Int32 Tizen.NUI.WindowBlurInfo::BackgroundCornerRadius()

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ System.Int32 Tizen.NUI.WindowBlurInfo::BlurRadius()

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ Tizen.NUI.WindowBlurType Tizen.NUI.WindowBlurInfo::BlurType()

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ System.Void Tizen.NUI.WindowBlurInfo::.ctor(Tizen.NUI.WindowBlurType,System.Int32,System.Int32)

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ System.Void Tizen.NUI.WindowBlurInfo::.ctor(Tizen.NUI.WindowBlurType,System.Int32)

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ Tizen.NUI.WindowBlurType

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ static Tizen.NUI.WindowBlurType Tizen.NUI.WindowBlurType::Background

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ static Tizen.NUI.WindowBlurType Tizen.NUI.WindowBlurType::None

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ Tizen.NUI.WindowSystem.Shell.ScreensaverService

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ System.Void Tizen.NUI.WindowSystem.Shell.ScreensaverService::.ctor(Tizen.NUI.WindowSystem.Shell.TizenShell,Tizen.Common.IWindowProvider)

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ System.Void Tizen.NUI.WindowSystem.Shell.ScreensaverService::.ctor(Tizen.NUI.WindowSystem.Shell.TizenShell,Tizen.NUI.Window)

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ System.Void Tizen.NUI.WindowSystem.Shell.ScreensaverService::Dispose()

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ System.Void Tizen.NUI.WindowSystem.Shell.ScreensaverService::Dispose(System.Boolean)

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ System.Void Tizen.NUI.WindowSystem.Shell.ScreensaverService::Finalize()

Removed

- /// <since_tizen>none</since_tizen
- [EditorBrowsable(EditorBrowsableState.Never)]
- Tizen.NUI.DragAndDrop/DragAndDropWindowEventHandler

- /// <since_tizen>none</since_tizen
- [EditorBrowsable(EditorBrowsableState.Never)]
- System.IAsyncResult Tizen.NUI.DragAndDrop/DragAndDropWindowEventHandler::BeginInvoke(Tizen.NUI.Window,Tizen.NUI.DragEvent,System.AsyncCallback,System.Object)

- /// <since_tizen>none</since_tizen
- [EditorBrowsable(EditorBrowsableState.Never)]
- System.Void Tizen.NUI.DragAndDrop/DragAndDropWindowEventHandler::.ctor(System.Object,System.IntPtr)

- /// <since_tizen>none</since_tizen
- [EditorBrowsable(EditorBrowsableState.Never)]
- System.Void Tizen.NUI.DragAndDrop/DragAndDropWindowEventHandler::EndInvoke(System.IAsyncResult)

- /// <since_tizen>none</since_tizen
- [EditorBrowsable(EditorBrowsableState.Never)]
- System.Void Tizen.NUI.DragAndDrop/DragAndDropWindowEventHandler::Invoke(Tizen.NUI.Window,Tizen.NUI.DragEvent)

Changed

/// <since_tizen>none</since_tizen
- [Obsolete]
[EditorBrowsable(EditorBrowsableState.Never)]
static Tizen.NUI.NativeImageQueue/ColorFormat Tizen.NUI.NativeImageQueue/ColorFormat::RGB888

/// <since_tizen>none</since_tizen
- [Obsolete]
[EditorBrowsable(EditorBrowsableState.Never)]
static Tizen.NUI.NativeImageQueue/ColorFormat Tizen.NUI.NativeImageQueue/ColorFormat::RGBA8888

/// <since_tizen>none</since_tizen
- [Obsolete]
[EditorBrowsable(EditorBrowsableState.Never)]
static Tizen.NUI.NativeImageQueue/ColorFormat Tizen.NUI.NativeImageQueue/ColorFormat::RGBX8888

@taehyub taehyub self-assigned this Sep 10, 2024
Copy link
Contributor

@tscholb tscholb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 💯

string [] mimeTypes;
string [] dataSet;

if (string.IsNullOrEmpty(dragData.MimeType))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (string.IsNullOrEmpty(dragData.MimeType))
if (string.IsNullOrEmpty(dragData.MimeType) && dragData.DataMap != null)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

좋은 의견 감사합니다 😄

Comment on lines 351 to 356
InternalDragAndDropEventHandler cb = (navtiveDragEvent) => ProcessDragEventWindowCallback(navtiveDragEvent, targetWindow, callback);

targetWindowEventDictionary.Add(targetWindow, cb);

if (!Interop.DragAndDrop.WindowAddListener(SwigCPtr, Window.getCPtr(targetWindow), "*/*",
new global::System.Runtime.InteropServices.HandleRef(this, Marshal.GetFunctionPointerForDelegate<Delegate>(cb))))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
InternalDragAndDropEventHandler cb = (navtiveDragEvent) => ProcessDragEventWindowCallback(navtiveDragEvent, targetWindow, callback);
targetWindowEventDictionary.Add(targetWindow, cb);
if (!Interop.DragAndDrop.WindowAddListener(SwigCPtr, Window.getCPtr(targetWindow), "*/*",
new global::System.Runtime.InteropServices.HandleRef(this, Marshal.GetFunctionPointerForDelegate<Delegate>(cb))))
AddListener(targetWindow, "*/*", callback);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이렇게 기존 함수를 통해서 중복 코드를 없애면 코드가 훨씬 간결해지고 가독성이 올라가는 것 같습니다 😄

@TizenAPI-Bot
Copy link
Collaborator

Public API Changed

Please follow the ACR process for the changed API below.
Added: 9, Removed: 0, Changed: 213

Internal API Changed

Added: 26, Removed: 5, Changed: 3

Added

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ System.Single Tizen.NUI.BaseComponents.AnimatedImageView::FrameSpeedFactor()

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ System.Single Tizen.NUI.BaseComponents.LottieAnimationView::FrameSpeedFactor()

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ System.Void Tizen.NUI.DragAndDrop::AddListener(Tizen.NUI.BaseComponents.View,System.String,Tizen.NUI.DragAndDrop/DragAndDropEventHandler)

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ System.Void Tizen.NUI.DragAndDrop::AddListener(Tizen.NUI.Window,System.String,Tizen.NUI.DragAndDrop/DragAndDropWindowEventHandler)

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ System.Boolean Tizen.NUI.FrameUpdateCallbackInterface::BakeOrientation(System.UInt32,Tizen.NUI.Rotation)

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ System.Boolean Tizen.NUI.FrameUpdateCallbackInterface::GetOrientation(System.UInt32,Tizen.NUI.Rotation)

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ System.Boolean Tizen.NUI.FrameUpdateCallbackInterface::SetOrientation(System.UInt32,Tizen.NUI.Rotation)

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ System.Void Tizen.NUI.FrameUpdateCallbackInterface::ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef)

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ static System.Int32 Tizen.NUI.ImageVisualProperty::FrameSpeedFactor

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ System.Single Tizen.NUI.Visuals.AnimatedImageVisual::FrameSpeedFactor()

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ Tizen.NUI.WindowBlurInfo Tizen.NUI.Window::BlurInfo()

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ Tizen.NUI.WindowBlurInfo

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ System.Int32 Tizen.NUI.WindowBlurInfo::BackgroundCornerRadius()

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ System.Int32 Tizen.NUI.WindowBlurInfo::BlurRadius()

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ Tizen.NUI.WindowBlurType Tizen.NUI.WindowBlurInfo::BlurType()

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ System.Void Tizen.NUI.WindowBlurInfo::.ctor(Tizen.NUI.WindowBlurType,System.Int32,System.Int32)

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ System.Void Tizen.NUI.WindowBlurInfo::.ctor(Tizen.NUI.WindowBlurType,System.Int32)

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ Tizen.NUI.WindowBlurType

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ static Tizen.NUI.WindowBlurType Tizen.NUI.WindowBlurType::Background

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ static Tizen.NUI.WindowBlurType Tizen.NUI.WindowBlurType::None

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ Tizen.NUI.WindowSystem.Shell.ScreensaverService

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ System.Void Tizen.NUI.WindowSystem.Shell.ScreensaverService::.ctor(Tizen.NUI.WindowSystem.Shell.TizenShell,Tizen.Common.IWindowProvider)

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ System.Void Tizen.NUI.WindowSystem.Shell.ScreensaverService::.ctor(Tizen.NUI.WindowSystem.Shell.TizenShell,Tizen.NUI.Window)

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ System.Void Tizen.NUI.WindowSystem.Shell.ScreensaverService::Dispose()

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ System.Void Tizen.NUI.WindowSystem.Shell.ScreensaverService::Dispose(System.Boolean)

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ System.Void Tizen.NUI.WindowSystem.Shell.ScreensaverService::Finalize()

Removed

- /// <since_tizen>none</since_tizen
- [EditorBrowsable(EditorBrowsableState.Never)]
- Tizen.NUI.DragAndDrop/DragAndDropWindowEventHandler

- /// <since_tizen>none</since_tizen
- [EditorBrowsable(EditorBrowsableState.Never)]
- System.IAsyncResult Tizen.NUI.DragAndDrop/DragAndDropWindowEventHandler::BeginInvoke(Tizen.NUI.Window,Tizen.NUI.DragEvent,System.AsyncCallback,System.Object)

- /// <since_tizen>none</since_tizen
- [EditorBrowsable(EditorBrowsableState.Never)]
- System.Void Tizen.NUI.DragAndDrop/DragAndDropWindowEventHandler::.ctor(System.Object,System.IntPtr)

- /// <since_tizen>none</since_tizen
- [EditorBrowsable(EditorBrowsableState.Never)]
- System.Void Tizen.NUI.DragAndDrop/DragAndDropWindowEventHandler::EndInvoke(System.IAsyncResult)

- /// <since_tizen>none</since_tizen
- [EditorBrowsable(EditorBrowsableState.Never)]
- System.Void Tizen.NUI.DragAndDrop/DragAndDropWindowEventHandler::Invoke(Tizen.NUI.Window,Tizen.NUI.DragEvent)

Changed

/// <since_tizen>none</since_tizen
- [Obsolete]
[EditorBrowsable(EditorBrowsableState.Never)]
static Tizen.NUI.NativeImageQueue/ColorFormat Tizen.NUI.NativeImageQueue/ColorFormat::RGB888

/// <since_tizen>none</since_tizen
- [Obsolete]
[EditorBrowsable(EditorBrowsableState.Never)]
static Tizen.NUI.NativeImageQueue/ColorFormat Tizen.NUI.NativeImageQueue/ColorFormat::RGBA8888

/// <since_tizen>none</since_tizen
- [Obsolete]
[EditorBrowsable(EditorBrowsableState.Never)]
static Tizen.NUI.NativeImageQueue/ColorFormat Tizen.NUI.NativeImageQueue/ColorFormat::RGBX8888

Copy link
Contributor

@hinohie hinohie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please squase 3 commit + Add hidden mark, so we can avoid anoying ACR

[EditorBrowsable(EditorBrowsableState.Never)]
public delegate void DragAndDropWindowEventHandler(Window targetWindow, DragEvent dragEvent);
private delegate void InternalDragAndDropEventHandler(global::System.IntPtr dragEvent);
public delegate void DragAndDropEventHandler(View targetView, DragEvent navtiveDragEvent);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public delegate void DragAndDropEventHandler(View targetView, DragEvent navtiveDragEvent);
[EditorBrowsable(EditorBrowsableState.Never)]
public delegate void DragAndDropEventHandler(View targetView, DragEvent navtiveDragEvent);

Copy link
Contributor Author

@taehyub taehyub Sep 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

감사합니다. ACR 안되도록 추가완료하였습니다 😄

public delegate void DragAndDropWindowEventHandler(Window targetWindow, DragEvent dragEvent);
private delegate void InternalDragAndDropEventHandler(global::System.IntPtr dragEvent);
public delegate void DragAndDropEventHandler(View targetView, DragEvent navtiveDragEvent);
public delegate void DragAndDropWindowEventHandler(Window targetWindow, DragEvent navtiveDragEvent);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public delegate void DragAndDropWindowEventHandler(Window targetWindow, DragEvent navtiveDragEvent);
[EditorBrowsable(EditorBrowsableState.Never)]
public delegate void DragAndDropWindowEventHandler(Window targetWindow, DragEvent navtiveDragEvent);

/// <summary>
/// The mime types and drag data set
/// </summary>
public Dictionary<string, string> DataMap;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public Dictionary<string, string> DataMap;
[EditorBrowsable(EditorBrowsableState.Never)]
public Dictionary<string, string> DataMap;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

감사합니다. ACR 안되도록 추가완료하였습니다 👍

/// <summary>
/// The mime types of drag object
/// </summary>
public string [] MimeTypes { get; set; }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public string [] MimeTypes { get; set; }
[EditorBrowsable(EditorBrowsableState.Never)]
public string [] MimeTypes { get; set; }

@TizenAPI-Bot
Copy link
Collaborator

Public API Changed

Please follow the ACR process for the changed API below.

Added: 5, Removed: 0, Changed: 0

Added

+ /// <since_tizen>none</since_tizen
+ Tizen.NUI.DragAndDrop/DragAndDropWindowEventHandler

+ /// <since_tizen>none</since_tizen
+ System.IAsyncResult Tizen.NUI.DragAndDrop/DragAndDropWindowEventHandler::BeginInvoke(Tizen.NUI.Window,Tizen.NUI.DragEvent,System.AsyncCallback,System.Object)

+ /// <since_tizen>none</since_tizen
+ System.Void Tizen.NUI.DragAndDrop/DragAndDropWindowEventHandler::.ctor(System.Object,System.IntPtr)

+ /// <since_tizen>none</since_tizen
+ System.Void Tizen.NUI.DragAndDrop/DragAndDropWindowEventHandler::EndInvoke(System.IAsyncResult)

+ /// <since_tizen>none</since_tizen
+ System.Void Tizen.NUI.DragAndDrop/DragAndDropWindowEventHandler::Invoke(Tizen.NUI.Window,Tizen.NUI.DragEvent)

Internal API Changed

Added: 4, Removed: 5, Changed: 0

Added

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ System.Void Tizen.NUI.DragAndDrop::AddListener(Tizen.NUI.BaseComponents.View,System.String,Tizen.NUI.DragAndDrop/DragAndDropEventHandler)

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ System.Void Tizen.NUI.DragAndDrop::AddListener(Tizen.NUI.Window,System.String,Tizen.NUI.DragAndDrop/DragAndDropWindowEventHandler)

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ System.Collections.Generic.Dictionary`2<System.String,System.String> Tizen.NUI.DragData::DataMap

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ System.String[] Tizen.NUI.DragEvent::MimeTypes()

Removed

- /// <since_tizen>none</since_tizen
- [EditorBrowsable(EditorBrowsableState.Never)]
- Tizen.NUI.DragAndDrop/DragAndDropWindowEventHandler

- /// <since_tizen>none</since_tizen
- [EditorBrowsable(EditorBrowsableState.Never)]
- System.IAsyncResult Tizen.NUI.DragAndDrop/DragAndDropWindowEventHandler::BeginInvoke(Tizen.NUI.Window,Tizen.NUI.DragEvent,System.AsyncCallback,System.Object)

- /// <since_tizen>none</since_tizen
- [EditorBrowsable(EditorBrowsableState.Never)]
- System.Void Tizen.NUI.DragAndDrop/DragAndDropWindowEventHandler::.ctor(System.Object,System.IntPtr)

- /// <since_tizen>none</since_tizen
- [EditorBrowsable(EditorBrowsableState.Never)]
- System.Void Tizen.NUI.DragAndDrop/DragAndDropWindowEventHandler::EndInvoke(System.IAsyncResult)

- /// <since_tizen>none</since_tizen
- [EditorBrowsable(EditorBrowsableState.Never)]
- System.Void Tizen.NUI.DragAndDrop/DragAndDropWindowEventHandler::Invoke(Tizen.NUI.Window,Tizen.NUI.DragEvent)

@taehyub
Copy link
Contributor Author

taehyub commented Sep 11, 2024

@myroot , @tscholb , @wonrst , @hinohie
좋은 리뷰 주셔서 감사합니다.
모든 구현이 완료되어 머지하도록 하겠습니다 😄

@TizenAPI-Bot
Copy link
Collaborator

Public API Changed

Please follow the ACR process for the changed API below.

Added: 0, Removed: 5, Changed: 0

Removed

- /// <since_tizen>none</since_tizen
- Tizen.NUI.DragAndDrop/DragAndDropEventHandler

- /// <since_tizen>none</since_tizen
- System.IAsyncResult Tizen.NUI.DragAndDrop/DragAndDropEventHandler::BeginInvoke(Tizen.NUI.BaseComponents.View,Tizen.NUI.DragEvent,System.AsyncCallback,System.Object)

- /// <since_tizen>none</since_tizen
- System.Void Tizen.NUI.DragAndDrop/DragAndDropEventHandler::.ctor(System.Object,System.IntPtr)

- /// <since_tizen>none</since_tizen
- System.Void Tizen.NUI.DragAndDrop/DragAndDropEventHandler::EndInvoke(System.IAsyncResult)

- /// <since_tizen>none</since_tizen
- System.Void Tizen.NUI.DragAndDrop/DragAndDropEventHandler::Invoke(Tizen.NUI.BaseComponents.View,Tizen.NUI.DragEvent)

Internal API Changed

Added: 9, Removed: 0, Changed: 0

Added

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ System.Void Tizen.NUI.DragAndDrop::AddListener(Tizen.NUI.BaseComponents.View,System.String,Tizen.NUI.DragAndDrop/DragAndDropEventHandler)

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ System.Void Tizen.NUI.DragAndDrop::AddListener(Tizen.NUI.Window,System.String,Tizen.NUI.DragAndDrop/DragAndDropWindowEventHandler)

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ System.Collections.Generic.Dictionary`2<System.String,System.String> Tizen.NUI.DragData::DataMap

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ System.String[] Tizen.NUI.DragEvent::MimeTypes()

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ Tizen.NUI.DragAndDrop/DragAndDropEventHandler

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ System.IAsyncResult Tizen.NUI.DragAndDrop/DragAndDropEventHandler::BeginInvoke(Tizen.NUI.BaseComponents.View,Tizen.NUI.DragEvent,System.AsyncCallback,System.Object)

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ System.Void Tizen.NUI.DragAndDrop/DragAndDropEventHandler::.ctor(System.Object,System.IntPtr)

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ System.Void Tizen.NUI.DragAndDrop/DragAndDropEventHandler::EndInvoke(System.IAsyncResult)

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ System.Void Tizen.NUI.DragAndDrop/DragAndDropEventHandler::Invoke(Tizen.NUI.BaseComponents.View,Tizen.NUI.DragEvent)

@TizenAPI-Bot
Copy link
Collaborator

Internal API Changed

Added: 4, Removed: 0, Changed: 0

Added

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ System.Void Tizen.NUI.DragAndDrop::AddListener(Tizen.NUI.BaseComponents.View,System.String,Tizen.NUI.DragAndDrop/DragAndDropEventHandler)

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ System.Void Tizen.NUI.DragAndDrop::AddListener(Tizen.NUI.Window,System.String,Tizen.NUI.DragAndDrop/DragAndDropWindowEventHandler)

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ System.Collections.Generic.Dictionary`2<System.String,System.String> Tizen.NUI.DragData::DataMap

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ System.String[] Tizen.NUI.DragEvent::MimeTypes()

@taehyub taehyub merged commit b59a776 into Samsung:DevelNUI Sep 11, 2024
3 checks passed
taehyub added a commit to taehyub/TizenFX that referenced this pull request Sep 11, 2024
* [NUI] Add multi-mimetype feature for Drag and Drop
Contents
- Allow to set multi-mimetypes for source client (use DragInfo)
- Target client receive source's mimetypes from source client when Enter, Move, Leave
- Target client can set mimetype to receive - Refactoring code for readability
- Refactoring codes for readability

* Refactoring data structure and duplicated codes

* Apply clean code for Drag and Drop
taehyub added a commit that referenced this pull request Sep 11, 2024
* [NUI] Add multi-mimetype feature for Drag and Drop
Contents
- Allow to set multi-mimetypes for source client (use DragInfo)
- Target client receive source's mimetypes from source client when Enter, Move, Leave
- Target client can set mimetype to receive - Refactoring code for readability
- Refactoring codes for readability

* Refactoring data structure and duplicated codes

* Apply clean code for Drag and Drop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants