Playing Flash movies in-image

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
58 messages Options
123
Reply | Threaded
Open this post in threaded view
|

Re: Extended Clipboard

Bert Freudenberg

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 -



Reply | Threaded
Open this post in threaded view
|

Re: Extended Clipboard

Juan Vuletich-4
Bert Freudenberg wrote:

>  
>>> 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 -
>  

Not here. I get TIFF. Googled a bit, searched into preferences, could
not find a way to modify that. It could be a Safari issue, or most
likely an OS X issue, as the same happens to me in Firefox and Chrome.
FWIW, I'm using Safari 5.0.3 (5533.19.4) on OS X 10.5.8.

Anyway, the TIFF reader is working here and solves the issue for good.
Now I just need to get permission to publish it.

Cheers,
Juan Vuletich

Reply | Threaded
Open this post in threaded view
|

Re: Extended Clipboard

Bert Freudenberg

On 17.01.2011, at 20:18, Juan Vuletich wrote:

> Bert Freudenberg wrote:
>>  
>>>> 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 -
>>  
>
> Not here. I get TIFF. Googled a bit, searched into preferences, could not find a way to modify that. It could be a Safari issue, or most likely an OS X issue, as the same happens to me in Firefox and Chrome. FWIW, I'm using Safari 5.0.3 (5533.19.4) on OS X 10.5.8.

I'm on Snow Leopard (OS X 10.6.6) and there the format is PNG.

> Anyway, the TIFF reader is working here and solves the issue for good. Now I just need to get permission to publish it.
>
> Cheers,
> Juan Vuletich

Great! :)

- Bert -



Reply | Threaded
Open this post in threaded view
|

Re: Extended Clipboard

Casey Ransberger-2
Ah, yeah that probably explains it. Apple moved to PNG for a number of things in 10.6.

On Jan 17, 2011, at 11:46 AM, Bert Freudenberg <[hidden email]> wrote:

>
> On 17.01.2011, at 20:18, Juan Vuletich wrote:
>
>> Bert Freudenberg wrote:
>>>
>>>>> 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 -
>>>
>>
>> Not here. I get TIFF. Googled a bit, searched into preferences, could not find a way to modify that. It could be a Safari issue, or most likely an OS X issue, as the same happens to me in Firefox and Chrome. FWIW, I'm using Safari 5.0.3 (5533.19.4) on OS X 10.5.8.
>
> I'm on Snow Leopard (OS X 10.6.6) and there the format is PNG.
>
>> Anyway, the TIFF reader is working here and solves the issue for good. Now I just need to get permission to publish it.
>>
>> Cheers,
>> Juan Vuletich
>
> Great! :)
>
> - Bert -
>
>
>

Reply | Threaded
Open this post in threaded view
|

[OT] OS X Screenshot (was: Re: [squeak-dev] Extended Clipboard)

Tobias Pape
In reply to this post by Juan Vuletich-4
Hi,

>>
>> 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 -
>>  
>
> Not here. I get TIFF. Googled a bit, searched into preferences, could not find a way to modify that. It could be a Safari issue, or most likely an OS X issue, as the same happens to me in Firefox and Chrome. FWIW, I'm using Safari 5.0.3 (5533.19.4) on OS X 10.5.8.


FWIW, OS X _has_ such a preference. The default seems to be PNG on OS 10.6 (and 10.5, iirc)
(see: http://www.switchingtomac.com/tutorials/how-to-change-the-screenshot-file-format-in-os-x/
 and http://secrets.blacktree.com/edit?id=2233 for possible formats)

So Long,
        -Tobias
Reply | Threaded
Open this post in threaded view
|

Re: Extended Clipboard

johnmci
In reply to this post by Casey Ransberger-2
TIFF is what os-x gives in lots of cases.
For Sophie we just then ran the Sophie image read/write logic and converted the TIFF into something usable.

On 2011-01-17, at 12:23 PM, Casey Ransberger wrote:

> Ah, yeah that probably explains it. Apple moved to PNG for a number of things in 10.6.
>
> On Jan 17, 2011, at 11:46 AM, Bert Freudenberg <[hidden email]> wrote:
>
>>
>> On 17.01.2011, at 20:18, Juan Vuletich wrote:
>>
>>> Bert Freudenberg wrote:
>>>>
>>>>>> 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 -
>>>>
>>>
>>> Not here. I get TIFF. Googled a bit, searched into preferences, could not find a way to modify that. It could be a Safari issue, or most likely an OS X issue, as the same happens to me in Firefox and Chrome. FWIW, I'm using Safari 5.0.3 (5533.19.4) on OS X 10.5.8.
>>
>> I'm on Snow Leopard (OS X 10.6.6) and there the format is PNG.
>>
>>> Anyway, the TIFF reader is working here and solves the issue for good. Now I just need to get permission to publish it.
>>>
>>> Cheers,
>>> Juan Vuletich
>>
>> Great! :)
>>
>> - Bert -
>>
>>
>>
>

--
===========================================================================
John M. McIntosh <[hidden email]>   Twitter:  squeaker68882
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
===========================================================================





Reply | Threaded
Open this post in threaded view
|

Re: [OT] OS X Screenshot

Juan Vuletich-4
In reply to this post by Tobias Pape
Tobias Pape wrote:

> Hi,
>
>  
>>> 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 -
>>>  
>>>      
>> Not here. I get TIFF. Googled a bit, searched into preferences, could not find a way to modify that. It could be a Safari issue, or most likely an OS X issue, as the same happens to me in Firefox and Chrome. FWIW, I'm using Safari 5.0.3 (5533.19.4) on OS X 10.5.8.
>>    
>
>
> FWIW, OS X _has_ such a preference. The default seems to be PNG on OS 10.6 (and 10.5, iirc)
> (see: http://www.switchingtomac.com/tutorials/how-to-change-the-screenshot-file-format-in-os-x/
>  and http://secrets.blacktree.com/edit?id=2233 for possible formats)
>
> So Long,
> -Tobias
>  

Not quite. The link already says it: "how to change the _screenshot_
file format". That's what already is PNG by default in 10.5.8. The
problem is the clipboard format for almost any other app but
"screenshot" (being TIFF in 10.5.8).

Cheers,
Juan Vuletich

Reply | Threaded
Open this post in threaded view
|

Re: Extended Clipboard

Juan Vuletich-4
In reply to this post by johnmci
John M McIntosh wrote:
> TIFF is what os-x gives in lots of cases.
> For Sophie we just then ran the Sophie image read/write logic and converted the TIFF into something usable.
>  

Yes, thanks, I already looked at Sophie.

BTW, I believe that Sophie is under BSD license, but it seems Etoys
includes code derived from it, and claims to be in MIT / Apache. How was
this handled? Is it OK to assume that code from Sophie can be published
under MIT?

Cheers,
Juan Vuletich

Reply | Threaded
Open this post in threaded view
|

license (was: Extended Clipboard)

Jecel Assumpcao Jr
Juan,

> BTW, I believe that Sophie is under BSD license, but it seems Etoys
> includes code derived from it, and claims to be in MIT / Apache. How was
> this handled? Is it OK to assume that code from Sophie can be published
> under MIT?

As far as I know, the "modified BSD" and "MIT" licenses are equivalent.

-- Jecel


Reply | Threaded
Open this post in threaded view
|

Re: license (was: Extended Clipboard)

Levente Uzonyi-2
In reply to this post by Juan Vuletich-4
On Tue, 18 Jan 2011, Jecel Assumpcao Jr. wrote:

> Juan,
>
>> BTW, I believe that Sophie is under BSD license, but it seems Etoys
>> includes code derived from it, and claims to be in MIT / Apache. How was
>> this handled? Is it OK to assume that code from Sophie can be published
>> under MIT?
>
> As far as I know, the "modified BSD" and "MIT" licenses are equivalent.

It's the 2-clause BSD license that's (probably) compatible with the "MIT"
license. The MIT license doesn't include the non-endorsement clause which
Sophie has:

"Neither the name of the University of Southern California, Los Angeles
nor the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission."

So Sophie's license (3-clause BSD) is clearly not compatible with the MIT
license.


Levente

>
> -- Jecel
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Extended Clipboard

Juan Vuletich-4
In reply to this post by Bert Freudenberg
Bert Freudenberg wrote:
>
> 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 -
>  

I found a solution for this. The trick is to always store something in
the OS clipboard when doing 'copy'. If the object to be stored in the
clipboard is not supported by the OS clipboard, then store and id. The
id is a string that includes the class name and hash. So, the method to
read the clipboard becomes:

Clipboard >> retrieveObject
    "Answer whatever was last stored in the clipboard"
    | stringOrNil |
    "If the OS clipboard has the id for our contents, or the same
characters, then answer the richer Smalltalk object."
    stringOrNil := self retrieveStringFromOS.
    stringOrNil = (self stringOrIdFor: contents)
        ifTrue: [ ^contents ].

    "If we have the ExtendedClipboardInterface, try to get an RTF or Form"
    Smalltalk at: #ExtendedClipboardInterface ifPresent: [
:clipboardInterface |
        clipboardInterface current retrieveText ifNotNil: [ :text | ^text ].
        clipboardInterface current retrieveForm ifNotNil: [ :form |
^form ]].

    "Otherwise answer the string brought by ExtendedClipboardInterface
or by clipboard primitives"
    ^stringOrNil

And you get whatever was last copied into the clipboard, regardless of
being copied from Squeak or from other application, without losing the
ability to store Smalltalk objects in the Squeak clipboard.

(RTF support is not yet done)

Cheers,
Juan Vuletich

Reply | Threaded
Open this post in threaded view
|

Re: Extended Clipboard

Bert Freudenberg

On 19.01.2011, at 16:31, Juan Vuletich wrote:

> Bert Freudenberg wrote:
>>
>> 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 -
>>  
>
> I found a solution for this. The trick is to always store something in the OS clipboard when doing 'copy'. If the object to be stored in the clipboard is not supported by the OS clipboard, then store and id. The id is a string that includes the class name and hash. So, the method to read the clipboard becomes:
>
> Clipboard >> retrieveObject
>   "Answer whatever was last stored in the clipboard"
>   | stringOrNil |
>   "If the OS clipboard has the id for our contents, or the same characters, then answer the richer Smalltalk object."
>   stringOrNil := self retrieveStringFromOS.
>   stringOrNil = (self stringOrIdFor: contents)
>       ifTrue: [ ^contents ].
>
>   "If we have the ExtendedClipboardInterface, try to get an RTF or Form"
>   Smalltalk at: #ExtendedClipboardInterface ifPresent: [ :clipboardInterface |
>       clipboardInterface current retrieveText ifNotNil: [ :text | ^text ].
>       clipboardInterface current retrieveForm ifNotNil: [ :form | ^form ]].
>
>   "Otherwise answer the string brought by ExtendedClipboardInterface or by clipboard primitives"
>   ^stringOrNil
>
> And you get whatever was last copied into the clipboard, regardless of being copied from Squeak or from other application, without losing the ability to store Smalltalk objects in the Squeak clipboard.
>
> (RTF support is not yet done)
>
> Cheers,
> Juan Vuletich

This is better than our current solution but not perfect yet. E.g. when copying a morph we put a bitmap in the OS clipboard and the morph in the Morphic clipboard. When pasting, how do we know we should prefer the Morphic clipboard over the OS bitmap? Is it possible to store a text id and a bitmap at the same time?

- Bert -



Reply | Threaded
Open this post in threaded view
|

Re: Extended Clipboard

Juan Vuletich-4
Bert Freudenberg wrote:

> On 19.01.2011, at 16:31, Juan Vuletich wrote:
>
>  
>> Bert Freudenberg wrote:
>>    
>>> 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 -
>>>  
>>>      
>> I found a solution for this. The trick is to always store something in the OS clipboard when doing 'copy'. If the object to be stored in the clipboard is not supported by the OS clipboard, then store and id. The id is a string that includes the class name and hash. So, the method to read the clipboard becomes:
>>
>> Clipboard >> retrieveObject
>>   "Answer whatever was last stored in the clipboard"
>>   | stringOrNil |
>>   "If the OS clipboard has the id for our contents, or the same characters, then answer the richer Smalltalk object."
>>   stringOrNil := self retrieveStringFromOS.
>>   stringOrNil = (self stringOrIdFor: contents)
>>       ifTrue: [ ^contents ].
>>
>>   "If we have the ExtendedClipboardInterface, try to get an RTF or Form"
>>   Smalltalk at: #ExtendedClipboardInterface ifPresent: [ :clipboardInterface |
>>       clipboardInterface current retrieveText ifNotNil: [ :text | ^text ].
>>       clipboardInterface current retrieveForm ifNotNil: [ :form | ^form ]].
>>
>>   "Otherwise answer the string brought by ExtendedClipboardInterface or by clipboard primitives"
>>   ^stringOrNil
>>
>> And you get whatever was last copied into the clipboard, regardless of being copied from Squeak or from other application, without losing the ability to store Smalltalk objects in the Squeak clipboard.
>>
>> (RTF support is not yet done)
>>
>> Cheers,
>> Juan Vuletich
>>    
>
> This is better than our current solution but not perfect yet. E.g. when copying a morph we put a bitmap in the OS clipboard and the morph in the Morphic clipboard. When pasting, how do we know we should prefer the Morphic clipboard over the OS bitmap? Is it possible to store a text id and a bitmap at the same time?
>
> - Bert -
>  

Yes, it can be done. That's why you usually send #clearClipboard prior
to storing suff. I haven't done this yet because I haven't implemented
copy Morph to OS clipboard.

Cheers,
Juan Vuletich

Reply | Threaded
Open this post in threaded view
|

Re: Extended Clipboard

Juan Vuletich-4
Juan Vuletich wrote:

> Bert Freudenberg wrote:
>> On 19.01.2011, at 16:31, Juan Vuletich wrote:
>>
>>  
>>> Bert Freudenberg wrote:
>>>    
>>>> 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 -
>>>>  
>>>>      
>>> I found a solution for this. The trick is to always store something
>>> in the OS clipboard when doing 'copy'. If the object to be stored in
>>> the clipboard is not supported by the OS clipboard, then store and
>>> id. The id is a string that includes the class name and hash. So,
>>> the method to read the clipboard becomes:
>>>
>>> Clipboard >> retrieveObject
>>>   "Answer whatever was last stored in the clipboard"
>>>   | stringOrNil |
>>>   "If the OS clipboard has the id for our contents, or the same
>>> characters, then answer the richer Smalltalk object."
>>>   stringOrNil := self retrieveStringFromOS.
>>>   stringOrNil = (self stringOrIdFor: contents)
>>>       ifTrue: [ ^contents ].
>>>
>>>   "If we have the ExtendedClipboardInterface, try to get an RTF or
>>> Form"
>>>   Smalltalk at: #ExtendedClipboardInterface ifPresent: [
>>> :clipboardInterface |
>>>       clipboardInterface current retrieveText ifNotNil: [ :text |
>>> ^text ].
>>>       clipboardInterface current retrieveForm ifNotNil: [ :form |
>>> ^form ]].
>>>
>>>   "Otherwise answer the string brought by ExtendedClipboardInterface
>>> or by clipboard primitives"
>>>   ^stringOrNil
>>>
>>> And you get whatever was last copied into the clipboard, regardless
>>> of being copied from Squeak or from other application, without
>>> losing the ability to store Smalltalk objects in the Squeak clipboard.
>>>
>>> (RTF support is not yet done)
>>>
>>> Cheers,
>>> Juan Vuletich
>>>    
>>
>> This is better than our current solution but not perfect yet. E.g.
>> when copying a morph we put a bitmap in the OS clipboard and the
>> morph in the Morphic clipboard. When pasting, how do we know we
>> should prefer the Morphic clipboard over the OS bitmap? Is it
>> possible to store a text id and a bitmap at the same time?
>> - Bert -
>>  
>
> Yes, it can be done. That's why you usually send #clearClipboard prior
> to storing suff. I haven't done this yet because I haven't implemented
> copy Morph to OS clipboard.
>
> Cheers,
> Juan Vuletich

Done. Works great here. Using a new content type 'cuis-id', to be sure
apps using clipboard will get real content (i.e. the Form) and not the
id. Fallback to using regular primitives if no ExtendedClipboard.

Cheers,
Juan Vuletich

Reply | Threaded
Open this post in threaded view
|

Re: Extended Clipboard

Darius Clarke
Hi Juan, 

I'm not sure where to find the Extended Clipboard code, including methods such as #retrieveStringFromOS. 

Could you point me in the right direction?

Cheers,
Darius


Reply | Threaded
Open this post in threaded view
|

Re: Extended Clipboard

Juan Vuletich-4
Darius Clarke wrote:
> Hi Juan,
>
> I'm not sure where to find the Extended Clipboard code, including
> methods such as #retrieveStringFromOS.
>
> Could you point me in the right direction?
>
> Cheers,
> Darius

Hi Darius,

I haven't published my implementation of Extended Clipboard (yet). That
Clipboard >> retrieveObject method is just to explain my idea to fix
Bert's problem in the Etoys Extended Clipboard.

Cheers,
Juan Vuletich

Reply | Threaded
Open this post in threaded view
|

Re: Extended Clipboard

Bert Freudenberg
In reply to this post by Juan Vuletich-4

On 19.01.2011, at 20:36, Juan Vuletich wrote:

> Juan Vuletich wrote:
>> Bert Freudenberg wrote:
>>> On 19.01.2011, at 16:31, Juan Vuletich wrote:
>>>
>>>
>>>> Bert Freudenberg wrote:
>>>>  
>>>>> 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 -
>>>>>      
>>>> I found a solution for this. The trick is to always store something in the OS clipboard when doing 'copy'.
>
> Done. Works great here. Using a new content type 'cuis-id', to be sure apps using clipboard will get real content (i.e. the Form) and not the id. Fallback to using regular primitives if no ExtendedClipboard.
>
> Cheers,
> Juan Vuletich

Great! :)

Hehe, we could even serialize the Morph and paste it into another running image, with all attached scripts still working ... The code is all there, basically like saving a Morph in a file. And in Etoys we can already send objects to other OLPC machines.

- Bert -


Reply | Threaded
Open this post in threaded view
|

Re: Extended Clipboard

Juan Vuletich-4
Bert Freudenberg wrote:

> On 19.01.2011, at 20:36, Juan Vuletich wrote:
>
>  
>> Juan Vuletich wrote:
>>    
>>> Bert Freudenberg wrote:
>>>      
>>>> On 19.01.2011, at 16:31, Juan Vuletich wrote:
>>>>
>>>>
>>>>        
>>>>> Bert Freudenberg wrote:
>>>>>  
>>>>>          
>>>>>> 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 -
>>>>>>      
>>>>>>            
>>>>> I found a solution for this. The trick is to always store something in the OS clipboard when doing 'copy'.
>>>>>          
>> Done. Works great here. Using a new content type 'cuis-id', to be sure apps using clipboard will get real content (i.e. the Form) and not the id. Fallback to using regular primitives if no ExtendedClipboard.
>>
>> Cheers,
>> Juan Vuletich
>>    
>
> Great! :)
>
> Hehe, we could even serialize the Morph and paste it into another running image, with all attached scripts still working ... The code is all there, basically like saving a Morph in a file. And in Etoys we can already send objects to other OLPC machines.
>
> - Bert -

If you'll pay the price for serialization on 'copy', maybe store just
the resulting bytes and not a copy of the morph in the internal
clipboard contents. Then you can recreate a copy of the object by
deserialization on 'paste' even if local to the image. That would make
the 'remote paste' less bug-prone and use less memory.

Cheers,
Juan Vuletich

123