On Fri, Feb 27, 2004 at 01:23:16AM +1100, Tristan McLeay wrote:
> --- Thomas Leonard <tal00r@...> wrote: >
[ DnD saving with GTK 2.4 ]
> > Maybe once 2.4 comes out. The interface looks closer
> > to what we want, but
> > I don't think the API has everything we need (I
> > asked about this earlier).
> So what's missing? I assume the ability to drag a file
> into another program w/out saving it, what else?
By "interface", I mean the programming interface. We can make it look like
whatever we want. In the old GTK, it went like this:
App -> GTK: "Give me a filename."
[ GTK displays file selector ]
GTK -> App: "/home/fred/work"
That's no use for drag-and-drop. We can alter GTK, but we don't even know
whether the user is loading or saving. If the user drags to an application
there's no way to tell the application to save there.
We could tell the app to save to "/tmp/1234" and copy that file, except
- We don't know when the app finishes the save.
- The app will think the file is now called /tmp/1234.
The ROX-Lib API works like this:
App -> ROX-Lib: I want to save a file of type text/plain.
[ ROX-Lib displays savebox ]
ROX-Lib -> App: Please send the data to this stream.
App -> ROX-Lib: Finished.
ROX-Lib -> App: The file is now called "/home/fred/work"
Here, we can easily support drag-and-drop. The app just gets asked to save
to a stream leading to another application, and ROX-Lib never tells it to
update the filename.
Thomas Leonard http://rox.sourceforge.net
tal00r at ecs.soton.ac.uk tal197 at users.sourceforge.net
GPG: 9242 9807 C985 3C07 44A6 8B9A AE07 8280 59A5 3CC1