Kai-Uwe Behrmann wrote:

> Am 19.12.07, 12:07 -0800 schrieb Alvin:
>> Alvin wrote:
>> > But, more generically, how can I copy data from a FLTK app to some
>> > location on the computer using DnD mouse movements? I see this is
>> > fairly trivial when dealing with text, but what about raw data such as
>> > an image?
> 
> Write a temporary file and paste only its file name?
> 
> regards
> Kai-Uwe Behrmann
> --
> developing for colour management
> www.behrmann.name + www.oyranos.org

After giving it more thought, I guess what I'm thinking of is the FLTK app
would know something about where the Drop event occurred. For example, if
the drop event occurred in a directory. Then the FLTK app would use that
location to download and save the file to. I'm not sure if that is
possible?

For example, if you drag a jpeg file from one window (say Konqueror) to
another window (say Fire Fox), Fire Fox will display that image. So, which
window did the loading of the image: Konqueror or FireFox? I would say
Firefox. I believe that Konqueror would simply save the file path and
FireFox would use the file path to open the jpeg.

In fact, this is what my app does now. I drag an OGG or SVI video from
Konqueror and drop it on my app. The app then reads the URL from
FL::event_text() and uploads the OGG or SVI to the mp3 player.

Now I'm just trying to figure out how I can drag files off the device in a
generic way. If the device was a UMS device, the problem is trivial.
However, since it uses the MTP protocol, the location/window where I drop
the file will need to know how to use it, which doesn't help me.

If I can't figure something out, I will revert to a context menu
with "Download file" in it. I have a context menu for deleting a file on
the device.

But, ignore the fact that I'm using MTP and a mp3 player. Say you have a
Fl_Box with an image in it. You override the Fl_Box's handle() to do DnD
event handling. How would you drag the image from the Fl_Box onto your
Desktop? Fl::copy() seems like a good place to start. But, I'm not sure if
I would store a 300 MB video in the clipboard. And if I did, how would
Konqueror (or some other file manager) know what filename to save it as?
-- 
Alvin
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to