[Etoys] Clipboard between eToys and Sugar
bert at freudenbergs.de
Mon Apr 16 07:11:46 EDT 2007
On Apr 16, 2007, at 12:10 , Takashi Yamamiya wrote:
> I have been playing with the source code of Sugar last week. So I'm
> ready to go further. To break a barrier between eToys and another
> activities, I think it is necessary to make eToys' clipboard work with
> Sugar clipboard properly.
> Currently, only you can copy a string from eToys to others,
> but apparently that's too inconvenience.
I think there is a bug in Sugar's clipboard handling, because we
never get an XdndEnter event. Because of this, not even dropping
files works correctly in Sugar, whereas it works in normal X desktop.
> So my plan is:
> 1) Simple string
> Copy a string between eToys and another activity both way.
Should be simple, although we need to take care of character sets.
But apparently everyone is settling on utf-8.
Although we need to define the interaction with the image which
currently only handles url lists ...
> 2) Graphics image
> Copy an image between eToys and another activity both way.
> 3) Morph
> Copy a morph to another instance of etoy's image through the
> clipboard or export as a graphics to another activity.
We should handle both of these similarly ... when dragging a morph
into some other activity it might be just an image. We should also
provide strings for morph (working like the copy text halo menu).
> 4) Formatted text
> I think it is harder part than others. Using RTF???
I think it uses the text/richtext MIME standard.
Dragging some text from open office into Squeak produces these formats:
type 0 == 379 text/plain;charset=utf-8
type 1 == 220 UTF8_STRING
type 2 == 397 application/x-openoffice-embed-source-
xml;windows_formatname="Star Embed Source (XML)"
type 3 == 398 application/x-openoffice-objectdescriptor-
xml;windows_formatname="Star Object Descriptor (XML)"
type 4 == 399 text/richtext
type 5 == 400 text/html
(I compiled sqUnixXdnd with DEBUG_XDND enabled)
> 5) Drag and drop
> I guess most of them can be done just by using X11's clipboard. But if
> I realize to need dbus, I'll wait for Michael's dbus implementation.
As far as I know, dbus should not be necessary for clipboard
interaction. It will use the X11 clipboard and Xdnd protocols. We
still need to extend the VM for this, as currently it allows only
dropping files, it rejects everything else.
I know the Sophie developers have implemented this, but only for Mac
and Windows using FFI I think. IMHO this would be valuable to have on
We should discuss this with the other platform developers on the
> And more challenge would be UI issue. For example, we don't have an
> easy way to copy neither a simple text or a morph. But I could
> implement internal code without waiting the discussion.
That would be great. As I understand, the proper interaction will be
dragging text or objects into the frame. This means the Hand's
contents needs to be visually on top of the frame. The only way to
implement this properly would be to use the new large cursor support
- you can make the cursor be as large as the whole screen. IIUC the
Hand already has its own canvas onto which it renders its submorphs,
logically these are on a layer above the world. So the basics are
there already. I'm not sure if you want to tackle this or if we need
a Morphic guru to do it ...
Another issue is the dragging interaction - if there is some selected
text, dragging it should move it around. Dropping into the frame
should be the equivalent of "copy", but dropping it onto some other
place inside squeak should be "cut&paste", that is, delete it from
the original place and append to the target. There are some ideas
needed to make this work reasonably - for example, dropping some
selected text on a free space should create a new text morph, whereas
dropping into some other text should insert it. Also, if the original
text becomes empty, we might want to delete the morph in some cases -
maybe if it was a direct child of the World, but not if it was the
text pane of a browser.
- Bert -
More information about the etoys-dev