You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Clipboard should be using onlyIDataObject APIs, existing methods should be thin wrappers over IDataObject (right now it's only possible to set a data object, but not get one)
if IClipboard.GetDataObjectAsync is used when clipboard is owned by the current process, it should return the same object instance that was passed to IClipboard.SetDataObjectAsync, same with drag-n-drop
We need to provide access to "generic" named platform-specific formats, those should always be represented as byte arrays or streams
We need to provide access to known platform-independent formats (images, text, rich text, etc, see WPF format list), those should be always represented as relevant .NET types, it should not be possible to use byte arrays.
Where possible, we should be consistent with WPF with platform-independent formats
Proposal (draft)
platform-independent formats should be prefixed as "avalonia/"
if a platform-dependent format from a platform clipboard corresponds to a known platform-independent forma, it should not be listed and should be only reported as a platform-independent format
platform-independent formats should be auto-converted into (multiple) platform-specific formats, e. g. when avalonia/Text is used with X11, we should be reporting UTF8_STRING, COMPOUND_TEXT, TEXT, STRING, text/plain;charset=utf-8, text/plain to the underlying system, when any of those exist in the platform clipboard, they should be removed from the reported format list and be represented by avalonia/Text
if platform-independent format is not representable in the current platform, it should be serialized in some stable way and stored in net.avaloniaui.clipboard-formats/{name} platform format.
Questions
I'm not quite sure if hiding platform-specific formats is a good idea, need to check what WPF and Qt do
How would the API consumer specify if they want a Stream over a byte array for platform-specific formats? Should we always use streams?
What to do with platform-specific formats that can't be represented by a simple byte array? Win32 clipboard supports formats that are various win32 handles, macOS clipboard can have value dictionaries, can have multiple NSPasteboardItem instances in the same clipboard, etc
The text was updated successfully, but these errors were encountered:
Requirements
IDataObject
APIs, existing methods should be thin wrappers overIDataObject
(right now it's only possible to set a data object, but not get one)IClipboard.GetDataObjectAsync
is used when clipboard is owned by the current process, it should return the same object instance that was passed toIClipboard.SetDataObjectAsync
, same with drag-n-dropProposal (draft)
"avalonia/"
avalonia/Text
is used with X11, we should be reportingUTF8_STRING
,COMPOUND_TEXT
,TEXT
,STRING
,text/plain;charset=utf-8
,text/plain
to the underlying system, when any of those exist in the platform clipboard, they should be removed from the reported format list and be represented byavalonia/Text
net.avaloniaui.clipboard-formats/{name}
platform format.Questions
Stream
over a byte array for platform-specific formats? Should we always use streams?The text was updated successfully, but these errors were encountered: