[squeak-dev] Extended Clipboard
Bert Freudenberg
bert at freudenbergs.de
Mon Jan 17 18:48:17 UTC 2011
On 17.01.2011, at 19:37, Juan Vuletich wrote:
> Bert Freudenberg wrote:
>> On 17.01.2011, at 17:32, Juan Vuletich wrote:
>>
>>
>>> Bert Freudenberg wrote:
>>>
>>>> On 30.12.2010, at 18:31, John M McIntosh wrote:
>>>>
>>>>
>>>>> Since you are in there, and dragging the FFI stuff about you might consider grabbing the clipboard stuff
>>>>> so that we can copy/paste graphics on windows/mac to/from squeak? I took a run at it a year back but I'm afraid the Windows community just couldn't care less so I couldn't get any testers or confirmation that it worked there. Today I'd suggest we just abandon them and let them sort it out later.
>>
>>
>>>>> I put the image & changes at ftp://ftp.smalltalkconsulting.com/experimental
>>>>>
>>>>> pharo.extendedClipboard.2.zip
>>>>>
>>>>>
>>>>> For image read/writing it uses SophieImageReadWriter which uses Quicktime's api to translate any supported media types into bitmaps. If that fails or is not available it just like SophieMovie grinds down a decsion tree to find a supported Squeak plugin or smalltalk code to decode the supplied mime-type.
>>>>> PS ya, I see currentMIMETypes := SophieBookEditor clipboardMimeTypes. but SophieBookEditor is not there and ExtendedClipboardMacInterface>>copyImageDataFromClipboard but is that used? or did I replace it with ExternalClipboard
>>>>>
>>>> We use the extended clipboard plugin in Etoys. Copying/pasting bitmaps or rich text between apps works nicely (on Mac and Unix anyway, Windows remains to be implemented).
>>>>
>>>> However, there is one major issue: When pasting, we have not found a way to determine which clipboard should take precedence - Squeak's text clipboard, Morphic's object clipboard, the system's string clipboard, or the extended Text/Bitmap/Etc. clipboard. In Sophie I guess you used the extended clipboard exclusively, but for Squeak it's not quite as clear-cut ...
>>>>
>>>> - Bert -
>>>>
>>> Hi Bert,
>>>
>>> I installed Etoys 4.1 on my Mac mini with Mac OS X 10.5.8. I was neither able to copy nor paste RTF from to Etoys. I tried both with AbiWord and TextEdit, and all I get is a String (without font styles, alignment or color). I also tried to paste a graphic (created with the Grab app) and I also failed (I get the previous String clipboard).
>>>
>>> In the first case, ExtendedClipboardInterface current readAvailableFormats answered an OrderedCollection(text/rtf text/utf8-unicode text/plain text/unicode), in the second case it answered an OrderedCollection(image/tiff).
>>>
>>> Besides, #readRTFClipboardData and #readTIFFClipboardData have no senders.
>>>
>>> What am I doing wrong?
>>>
>>> Thanks,
>>> Juan Vuletich
>>>
>>
>> Ah, I misremembered. Neither RTF nor TIFF reading is implemented. On Unix we get text/html as rich-text format, and that works. Now I remember something about a RichText Squeak reader somewhere, but can't place it ...
>>
>> Bitmap pasting works only if the format is PNG or JPG, which a lot of apps produce, but not all, apparently. For screenshots I use shift-control-command-4 which puts a PNG into the clipboard and that can be pasted fine.
>>
>> HTH,
>>
>> - Bert
>
> Everything makes sense now. Thank you.
>
> It seems that Grab, Preview, Safari, Firefox and Chrome export only TIFF to clipboard. I'm working on that. I hope to have news soon.
>
> Cheers,
> Juan Vuletich
Great! However, Safari works fine for me. E.g. I go to
http://squeakland.org/showcase/
then right-click on the girl holding the star, choose "Copy Image", switch to Etoys, Cmd-V, and get the image pasted fine ...
Possibly I changed the default format on my Mac at some point in the distant past? Hmm. But others are reporting it works for them ...
- Bert -
More information about the Squeak-dev
mailing list
|