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 (was: Playing Flash movies in-image)

Juan Vuletich-4
> 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 -

I'm interested on this and will most likely be able to help in January.
I'm currently on family holidays far from home, but will really pay
attention to this when back home in a few days.

Cheers,
Juan Vuletich

Reply | Threaded
Open this post in threaded view
|

Re: Extended Clipboard

Andreas.Raab
In reply to this post by Bert Freudenberg
On 12/31/2010 12:32 PM, Bert Freudenberg wrote:
> 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).

So where *is* that plugin? I've only pointed this out three times in the
past, but I can't seem to find any source code regarding this mythical
plugin. There is nothing in VMMaker, there is nothing in squeakvm.org,
so where is it?

Cheers,
   - Andreas

Reply | Threaded
Open this post in threaded view
|

Re: Extended Clipboard

EstebanLM
it is (was) a changeset inside unix source structure... it is integrated to VMMaker since 207.

Cheers,
Esteban

El 31/12/2010, a las 10:15a.m., Andreas Raab escribió:

> On 12/31/2010 12:32 PM, Bert Freudenberg wrote:
>> 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).
>
> So where *is* that plugin? I've only pointed this out three times in the past, but I can't seem to find any source code regarding this mythical plugin. There is nothing in VMMaker, there is nothing in squeakvm.org, so where is it?
>
> Cheers,
>  - Andreas
>


Reply | Threaded
Open this post in threaded view
|

Re: Extended Clipboard

Andreas.Raab
On 12/31/2010 2:34 PM, Esteban Lorenzano wrote:
> it is (was) a changeset inside unix source structure... it is integrated to VMMaker since 207.

Thanks. But oh boy. This is the kind of code that makes me want to just
break down and cry. Not a single comment. Not a single test. Not even
indented.

But enough of that. What exactly does "creating" a clipboard mean?
Opening the system default clipboard (then why is this called "creating"
a clipboard? and why is it necessary at all?) or really creating a new,
private clipboard (then where is the appropriate close/destroy method?
and why would we want to create a private clipboard - shouldn't we be
using the system default one to allow interactions with other apps?).
And what are the format strings supposed to be? Mime types?

Cheers,
   - Andreas

> El 31/12/2010, a las 10:15a.m., Andreas Raab escribió:
>
>> On 12/31/2010 12:32 PM, Bert Freudenberg wrote:
>>> 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).
>>
>> So where *is* that plugin? I've only pointed this out three times in the past, but I can't seem to find any source code regarding this mythical plugin. There is nothing in VMMaker, there is nothing in squeakvm.org, so where is it?
>>
>> Cheers,
>>   - Andreas
>>
>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Extended Clipboard

johnmci
The original code, change sets, sunits too. are in
platforms/Mac OS/plugins/ClipboardExtended

At some point the unix code *appeared*

The pharo.extendedClipboard.2.zip is about the 4th rewrite to tackle getting stuff from the clipboard. I note it uses FFI with windows and cheerfully allows
copy/paste of "Graphics" thingees on that platform.

On os-x it is a bit more complicated since microsoft office for example when you copy text data from a page it:
puts the text there as utf8, utf16, rtf, wordsomething, TIFF! (maybe jpeg too).    

In this case we actually see textual data and a screen shot of the page! But what to do?  In Sophie how we solved that was that we knew what the target
paste entity was, so we just decided if you were pasting into a graphics target then it was a graphics object, or if into a blank area it was graphics.  However
if it was a text area, then you wanted the text object.

Other issues like if you select a file and copy via the finder that results in a text object, (the file name),  graphic (the icon), and a URI & other constructs to indicate it's a file object...  MMm that was a bit tricky and we decided likely you wanted to paste the contents of the file.

On 2010-12-31, at 6:51 AM, Andreas Raab wrote:

> On 12/31/2010 2:34 PM, Esteban Lorenzano wrote:
>> it is (was) a changeset inside unix source structure... it is integrated to VMMaker since 207.
>
> Thanks. But oh boy. This is the kind of code that makes me want to just break down and cry. Not a single comment. Not a single test. Not even indented.
>
> But enough of that. What exactly does "creating" a clipboard mean? Opening the system default clipboard (then why is this called "creating" a clipboard? and why is it necessary at all?) or really creating a new, private clipboard (then where is the appropriate close/destroy method? and why would we want to create a private clipboard - shouldn't we be using the system default one to allow interactions with other apps?). And what are the format strings supposed to be? Mime types?
>
> Cheers,
>  - Andreas
>
>> El 31/12/2010, a las 10:15a.m., Andreas Raab escribió:
>>
>>> On 12/31/2010 12:32 PM, Bert Freudenberg wrote:
>>>> 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).
>>>
>>> So where *is* that plugin? I've only pointed this out three times in the past, but I can't seem to find any source code regarding this mythical plugin. There is nothing in VMMaker, there is nothing in squeakvm.org, so where is it?
>>>
>>> Cheers,
>>>  - Andreas
>>>
>>
>>
>>
>
>

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





Reply | Threaded
Open this post in threaded view
|

Re: Extended Clipboard

johnmci
Further to this
you should look at

iOS/plugins/clipboardExtended/sqMacExtendedClipboard.m

since that is a more mature version of the code created when I was doing the iOS  iphone & cocoa port

On 2010-12-31, at 10:02 AM, John M McIntosh wrote:

> The original code, change sets, sunits too. are in
> platforms/Mac OS/plugins/ClipboardExtended
>
> At some point the unix code *appeared*
>
> The pharo.extendedClipboard.2.zip is about the 4th rewrite to tackle getting stuff from the clipboard. I note it uses FFI with windows and cheerfully allows
> copy/paste of "Graphics" thingees on that platform.
>
> On os-x it is a bit more complicated since microsoft office for example when you copy text data from a page it:
> puts the text there as utf8, utf16, rtf, wordsomething, TIFF! (maybe jpeg too).    
>
> In this case we actually see textual data and a screen shot of the page! But what to do?  In Sophie how we solved that was that we knew what the target
> paste entity was, so we just decided if you were pasting into a graphics target then it was a graphics object, or if into a blank area it was graphics.  However
> if it was a text area, then you wanted the text object.
>
> Other issues like if you select a file and copy via the finder that results in a text object, (the file name),  graphic (the icon), and a URI & other constructs to indicate it's a file object...  MMm that was a bit tricky and we decided likely you wanted to paste the contents of the file.
>
> On 2010-12-31, at 6:51 AM, Andreas Raab wrote:
>
>> On 12/31/2010 2:34 PM, Esteban Lorenzano wrote:
>>> it is (was) a changeset inside unix source structure... it is integrated to VMMaker since 207.
>>
>> Thanks. But oh boy. This is the kind of code that makes me want to just break down and cry. Not a single comment. Not a single test. Not even indented.
>>
>> But enough of that. What exactly does "creating" a clipboard mean? Opening the system default clipboard (then why is this called "creating" a clipboard? and why is it necessary at all?) or really creating a new, private clipboard (then where is the appropriate close/destroy method? and why would we want to create a private clipboard - shouldn't we be using the system default one to allow interactions with other apps?). And what are the format strings supposed to be? Mime types?
>>
>> Cheers,
>> - Andreas
>>
>>> El 31/12/2010, a las 10:15a.m., Andreas Raab escribió:
>>>
>>>> On 12/31/2010 12:32 PM, Bert Freudenberg wrote:
>>>>> 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).
>>>>
>>>> So where *is* that plugin? I've only pointed this out three times in the past, but I can't seem to find any source code regarding this mythical plugin. There is nothing in VMMaker, there is nothing in squeakvm.org, so where is it?
>>>>
>>>> Cheers,
>>>> - Andreas
>>>>
>>>
>>>
>>>
>>
>>
>
> --
> ===========================================================================
> John M. McIntosh <[hidden email]>   Twitter:  squeaker68882
> Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
> ===========================================================================
>
>
>
>

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





Reply | Threaded
Open this post in threaded view
|

Re: Extended Clipboard

Andreas.Raab
In reply to this post by johnmci
Thanks for the info, but what about my questions? a) What does
"creating" a clipboard mean and b) what are the format strings?

Thanks,
   - Andreas

On 12/31/2010 7:02 PM, John M McIntosh wrote:

> The original code, change sets, sunits too. are in
> platforms/Mac OS/plugins/ClipboardExtended
>
> At some point the unix code *appeared*
>
> The pharo.extendedClipboard.2.zip is about the 4th rewrite to tackle getting stuff from the clipboard. I note it uses FFI with windows and cheerfully allows
> copy/paste of "Graphics" thingees on that platform.
>
> On os-x it is a bit more complicated since microsoft office for example when you copy text data from a page it:
> puts the text there as utf8, utf16, rtf, wordsomething, TIFF! (maybe jpeg too).
>
> In this case we actually see textual data and a screen shot of the page! But what to do?  In Sophie how we solved that was that we knew what the target
> paste entity was, so we just decided if you were pasting into a graphics target then it was a graphics object, or if into a blank area it was graphics.  However
> if it was a text area, then you wanted the text object.
>
> Other issues like if you select a file and copy via the finder that results in a text object, (the file name),  graphic (the icon), and a URI&  other constructs to indicate it's a file object...  MMm that was a bit tricky and we decided likely you wanted to paste the contents of the file.
>
> On 2010-12-31, at 6:51 AM, Andreas Raab wrote:
>
>> On 12/31/2010 2:34 PM, Esteban Lorenzano wrote:
>>> it is (was) a changeset inside unix source structure... it is integrated to VMMaker since 207.
>>
>> Thanks. But oh boy. This is the kind of code that makes me want to just break down and cry. Not a single comment. Not a single test. Not even indented.
>>
>> But enough of that. What exactly does "creating" a clipboard mean? Opening the system default clipboard (then why is this called "creating" a clipboard? and why is it necessary at all?) or really creating a new, private clipboard (then where is the appropriate close/destroy method? and why would we want to create a private clipboard - shouldn't we be using the system default one to allow interactions with other apps?). And what are the format strings supposed to be? Mime types?
>>
>> Cheers,
>>   - Andreas
>>
>>> El 31/12/2010, a las 10:15a.m., Andreas Raab escribió:
>>>
>>>> On 12/31/2010 12:32 PM, Bert Freudenberg wrote:
>>>>> 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).
>>>>
>>>> So where *is* that plugin? I've only pointed this out three times in the past, but I can't seem to find any source code regarding this mythical plugin. There is nothing in VMMaker, there is nothing in squeakvm.org, so where is it?
>>>>
>>>> Cheers,
>>>>   - Andreas
>>>>
>>>
>>>
>>>
>>
>>
>
> --
> ===========================================================================
> John M. McIntosh<[hidden email]>    Twitter:  squeaker68882
> Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
> ===========================================================================
>
>
>
>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Extended Clipboard

johnmci

On 2010-12-31, at 10:48 PM, Andreas Raab wrote:

> Thanks for the info, but what about my questions? a) What does "creating" a clipboard mean and b) what are the format strings?
>
> Thanks,
>  - Andreas

OS-X had the concept of creating an instance of a clipboard to managed data. However in this case you actually work with
a singleton of the common clipboard that is responsible for sharing data between processes.   So it's not technically correct to
say you are creating a clipboard in this use case.

The format strings are UTI identifiers

http://developer.apple.com/library/mac/#documentation/FileManagement/Conceptual/understanding_utis/understand_utis_conc/understand_utis_conc.html%23//apple_ref/doc/uid/TP40001319-CH202-CHDHIJDE

Also see  http://en.wikipedia.org/wiki/Uniform_Type_Identifier

Lurk in Sophie and other parts of Squeak, and/or via OS calls to OS-X are translation tables between

http://en.wikipedia.org/wiki/MIME_type

and evil File Extensions.  


However when we did the extended clipboard support for Sophie we decided not to build a plugin but do everything via FFI within the
concrete class that handles higher level clipboard usage.  For OS-X we then would endup invoking extended clipboard logic to do the right thing.
--
===========================================================================
John M. McIntosh <[hidden email]>   Twitter:  squeaker68882
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
===========================================================================





Reply | Threaded
Open this post in threaded view
|

Re: Playing Flash movies in-image

Sean P. DeNigris
Administrator
In reply to this post by johnmci
John M McIntosh wrote
Ok, well it is great that someone is attempting to drag that movie player out of sophie.
Since we must have re-written it 7 times over four years.
John, there are a bunch of semaphore critical blocks in the movie code.  Is this because Tweak scripts run in separate processes, or does it have something to do with the QuickTime API?  If all code was running in one process, could they be removed?

Thanks.
Sean
Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: Playing Flash movies in-image

Chris Cunnington
In reply to this post by Chris Cunnington
I'd imagine you're thinking about #ensureCloseSema in
QuickTimeAudio>>#openMovieFromURI:?
It's a rather conspicuous #critical: block.

If you remove that and then delete SophieQuickTimeMovieViaPlugin, then
the player you've created in Morphic will play find. I've done it.

Execute this in your image:

Smalltalk listLoadedModules

and tell me if  you see the QuickTime plugin? Hmmm...
QuickTime.framework, Carbon.framework, SurfacePlugin...nope, not here.
You'll see it listed in the Sophie Dev image, though.

I think the QuickTime plugin signals that Semaphore in #ensureCloseSema
for the sake of timing. All the QT plugin does is signal when a frame is
complete and ready to go.

In SqueakMovieMorph you set the frame rate automatically to 30 ms. It
seems to me the answer to your question depends on what kind of timing
mechanism you want for your movie player.

Sophie is a ****ing layered creation. It's extremely professional. I'd
be happy if you ripped everything out that you can to distill a simple
player, so that I can take that and compare it with Sophie to better
understand its onion skins.

Chris


Reply | Threaded
Open this post in threaded view
|

Re: Playing Flash movies in-image

johnmci
In reply to this post by Sean P. DeNigris
As for the quicktime plugin it provides two concepts.

(a) we get quicktime to write bits to a squeak surfaceplugin guy which means for for a 480x640 pixel move we don't move 36MB of memory around
every second. That can result in *better* fps and for the minor amount of code involved it's win win.

(b) we get quicktime to tell us when a frame is ready to be rendered to the display based on when quicktime has finished rendering the frame. That prevents tearing...  Plus if the compression algorithm is really smart it can so, oh don't need to alter the frame because this frame is the same as the last frame...

As for the semaphore, notes say...

"If you recall we added that a few years back when we had race conditions on the movie, is it open, is it closed?
Who's closing it, when's it opened..."

The situation is you open and preroll the movie, that is running as a tweak process, you tap stop, that is running as a tweak process. Lots of multi-threading going on.
So is the movie open or closed? Got a race condition? Oh yes...  Because of that complexity over the years we *managed, just managed* to convince the logic not to crash if the user tapped close at any random point in time during critical phases like when you assume you have an open viable movie, not a zombie...



On 2011-01-01, at 11:36 AM, Sean P. DeNigris wrote:

>
>
> John M McIntosh wrote:
>>
>> Ok, well it is great that someone is attempting to drag that movie player
>> out of sophie.
>> Since we must have re-written it 7 times over four years.
>>
>
> John, there are a bunch of semaphore critical blocks in the movie code.  Is
> this because Tweak scripts run in separate processes, or does it have
> something to do with the QuickTime API?  If all code was running in one
> process, could they be removed?
>
> Thanks.
> Sean
> --
> View this message in context: http://forum.world.st/Playing-Flash-movies-in-image-tp3167383p3170351.html
> Sent from the Squeak - Dev mailing list archive at Nabble.com.
>

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





Reply | Threaded
Open this post in threaded view
|

Re: Extended Clipboard

Bert Freudenberg
In reply to this post by Andreas.Raab

On 01.01.2011, at 07:48, Andreas Raab wrote:

> Thanks for the info, but what about my questions? a) What does "creating" a clipboard mean and b) what are the format strings?
>
> Thanks,
>  - Andreas

a) dunno. Here's the Unix implementation:

sqInt sqCreateClipboard( void )
{
  return 1;
}

b) platform-specific, can be anything. On Mac it is a "UTI" as John noted, on Unix it is a MIME type. There is a map between MIME types and UTIs because MIME is at least somewhat supported in Squeak.

Takashi did the Unix version. We needed one quickly for OLPC ...

Maybe have a look at the Mac and Unix-specific ExtendedClipboardInterface subclasses in the Etoys image. The Windows one is just a stub since we did not include the FFI stuff.

- Bert -


Reply | Threaded
Open this post in threaded view
|

Re: Extended Clipboard

Chris Cunnington
In reply to this post by Andreas.Raab
http://www.smalltalktelevision.com/cutpaste.png

It seems children using the OLPC understand this better than I do:
cutting & pasting an image to/from Etoys/Sophie.

Pressing Command+Control+Shift+3 I put an image of the desktop in the
clipboard. I can't see any other way to put an image in the clipboard.

Then it can be pasted into MSN Word or Sophie with a Menu drop down menu
saying Paste.

Apple doesn't allow anything but text to be cut/paste'd, it seems to me.
Etoys has the Menu selections Cut/Copy/Paste, but I can't see how to
select something or into what I'd put my desktop snapshot.

Chris

Reply | Threaded
Open this post in threaded view
|

Re: Extended Clipboard

johnmci
Ah, well it's because go to Microsoft office,  find a document, open,  find a word oh mm '"Squeak", select that do a COPY

back to squeak.  Paste.  
Seems innocent?
Well ok, yes the command key has to be translated into a request to run some sort of the smalltalk code, then it asked the clipboard logic, hey what do we have.
It says. Oh well, we've some XML here, RTF,  ASCII, UTF8 & UTF16, a bunch of Microsoft UTI/mime-types, and a TIFF?  Does anyone higher up know what to do?

Sophie team, oh mmm well we need the RTF to toss at our textual tree since we do want to preserve the fact it's a  BOLD Squeak we are pasting..  
Oh well mmm what about that TIFF? You know that in PhotoShop we get a PSD, JPEG, TIFF & UTF8?
Sophie team thinks hard... Fine if the target context is for graphics we ask for the TIFF, if not then it's textual data of some form into the text tree.

So back to Squeak, well do we want the UTF8, anyone know about RTF?  Should we use the TIFF?

Going the other way.

Tap COPY command key...
Squeak Ok so what the heck is the target we need to put on the clipboard, what widget is selected?

{Squeak programmers fill in blank and add intelligence here}

In Sophie, I can't remember, but we do have a target object selected (or none) as part of the architecture, so again a choice is made in what to do.


Oh and don't forget evil things,  like going to the OS-X Finder and select a file and do copy..
In Sophie, mmm we have a TIFF, ascii, utf8, utf16 item here, oh wait a special FileURL UTI, what should we do?  
Paste the file name, paste the file icon, or does the user actually want the contents of the file.   For that I think we choose the contents of the file.


On 2011-01-03, at 9:59 AM, Chris Cunnington wrote:

> http://www.smalltalktelevision.com/cutpaste.png
>
> It seems children using the OLPC understand this better than I do: cutting & pasting an image to/from Etoys/Sophie.
>
> Pressing Command+Control+Shift+3 I put an image of the desktop in the clipboard. I can't see any other way to put an image in the clipboard.
>
> Then it can be pasted into MSN Word or Sophie with a Menu drop down menu saying Paste.
>
> Apple doesn't allow anything but text to be cut/paste'd, it seems to me. Etoys has the Menu selections Cut/Copy/Paste, but I can't see how to select something or into what I'd put my desktop snapshot.
>
> Chris
>

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





Reply | Threaded
Open this post in threaded view
|

Re: Extended Clipboard

Bert Freudenberg
In reply to this post by Chris Cunnington

On 03.01.2011, at 18:59, Chris Cunnington wrote:

> http://www.smalltalktelevision.com/cutpaste.png
>
> It seems children using the OLPC understand this better than I do: cutting & pasting an image to/from Etoys/Sophie.
>
> Pressing Command+Control+Shift+3 I put an image of the desktop in the clipboard. I can't see any other way to put an image in the clipboard.

Get any image editing or previewing app and press Cmd-C.

Or ctrl-click an image in Safari and "copy image".

Etc.

> Then it can be pasted into MSN Word or Sophie with a Menu drop down menu saying Paste.
>
> Apple doesn't allow anything but text to be cut/paste'd, it seems to me.

Dead wrong.

> Etoys has the Menu selections Cut/Copy/Paste, but I can't see how to select something or into what I'd put my desktop snapshot.

Just press Cmd-V. Etoys doesn't support the Mac menu bar (yet).

You can also copy out of Etoys - bring up the halo for an object and press Cmd-C. Then press Cmd-V in, say, your email program:




The only real problem with the extended clipboard plugin, as I wrote previously, is that there is no notion of "the most recent copy". When pasting, you want to paste the thing that was copied last. But we have several clipboards to choose from that are all independent and not timestamped. E.g. when I pasted the car into Etoys I'd expect it to paste the object with all its scripts, and not just a bitmap. Yet the latter is what happens currently because we find the bitmap that we put into the system clipboard ourselves, but don't know we did.

- Bert -




PastedGraphic-1.png (806 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Extended Clipboard

johnmci

On 2011-01-03, at 11:11 AM, Bert Freudenberg wrote:
>
>
>> Then it can be pasted into MSN Word or Sophie with a Menu drop down menu saying Paste.
>>
>> Apple doesn't allow anything but text to be cut/paste'd, it seems to me.
>
> Dead wrong.

The grain of truth here is the original 1984 era clipboard logic that Squeak used only supported text copy/paste.  Perhaps it could have been upgraded
to oh say the 1986 logic that allowed for PICT graphics but Squeak never knew what to do with that.  

This was updated in the last decade to support copy/paste of UTF8 mostly because the Europeans hated losing their accented characters.
Oh and you usually get TIFF data so you need to turn that into something Squeak would like, non-trival.  See Sophie Image Read Write Abstract classes.

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





Reply | Threaded
Open this post in threaded view
|

Re: Extended Clipboard

Chris Cunnington
In reply to this post by Andreas.Raab
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:

> 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

Reply | Threaded
Open this post in threaded view
|

Re: Extended Clipboard

Bert Freudenberg

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 -



Reply | Threaded
Open this post in threaded view
|

Re: Extended Clipboard

Juan Vuletich-4
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

123