seandenigris / Pharo-Enhancements

MIT License
3 stars 1 forks source link

[GToolkit]: External Drag and Drop #31

Open seandenigris opened 2 years ago

seandenigris commented 2 years ago

What would the user want to do when e.g. a YouTube URL is dropped on the image? Two immediate default options jump out:

  1. inspect a YouTubeURL object representation, which makes the fewest assumptions, or
  2. a YouTubeVideo object, which would probably be more generally useful.

Then there are library/user specific handlers, like:

Due to the highly personal nature of workflows, it seems that a simple pragma-based registry, like used by FileServices, will not suffice. Perhaps a pluggable strategy is in order?

As a workaround for Gt's lack of DND support, what if we create a tiny platform-dependent helper app where one can paste/drop that communicates with the image e.g. via sockets?

Here's a little spike snippet:

object := 'https://youtu.be/A0TafHXszg' asUrl.
services := PeExternalDropServices itemsFor: object.
services size = 1 ifFalse: [ self error: 'not single service' ].
url := services first performServiceFor: object.

Finally, there is the related case when the same URL comes in via a different channel e.g. a One Note in the TPP inbox? Here we want to have the same underlying process, suggesting a layer beneath the DND.