I like this feature request. I think it would fit well as an sf::Event? For example, lets say you have a media player. It'd be nice to allow a user to drag a media file from the desktop and drop it into the media player instead of having to go through a file->open type of dialog.
Formally:
In which way is SFML limited?SFML does not have a way to know if something was dragged (such as a file) onto the running application window.
What use cases does the feature allow?Allowing the opening of media files for a media player, save game/project files in some sort of editor (such as a scene designer), or dropping links/images from elsewhere to be modified in app.
How can other users benefit from the change?Having a mechanism to interact with outside media makes sense for Simple and Fast
Multimedia Library. End user convenience is in the aforementioned part.
How would it be implemented? I don't know. I've never used this feature in a lower level language, so I don't know the underlying considerations necessary to make a good proposal here. Here's a rudimentary idea:
enum MetaType {File, Text, Unknown};
struct DragData
{
sf::String Text;
MetaType Type;
}
//....Somehow be given a DragData struct from SFML:
DragData data;
if (Data.Type == MetaType::File)
{
std::ifstream File(Data.Text.toAnsiString());
}
Then a window can have a function or event that can return a DragData. I honestly have no idea what types would fall into the "MetaData" enum (again, I'm not really educated with this aspect), or how a window would handle multiple files or "DragData" structs dropped into the window at once.
Anyway, aside from my terribly ignorant implementation idea, I think the overall suggestion may not be a bad one. Especially if SFML will support file systems (I believe this idea was thrown around in the forums somewhere too).