"I'm trying to play a flash movie (.flv - H.264, 320 x 216, Millions; AAC, Stereo, 22.050 kHz). I imported and played it successfully in OpenSophie, but before I attempt to port the code (which is Tweak-based) into Squeak, is there any currently existing code that can do this?"
No. In fact, I don't know how you could be playing a Flash movie in a Sophie image, because the Flash player there is so old that it only understands swf file animations. It couldn't play movies because that was still five years off.
As far as I can read the history, in the late 90s Squeakers explored existing multimedia, then they went crazy with originality. What they built is so pervasive it's hard to see it, because it changed the environment. Basically, this was a pre-Croquet/Etoys/Tweak period. They dropped Flash and never picked it up again, while creating insane graphics using the SurfacePlugin and scripting (which uses time stamped MessageSends in a queue to substitute single processes for multi-threading.) This era started with this memo:
http://tweakproject.org/ABOUT/FAQ/OriginalTweakMemo/
(I can't remember who wrote it. I don't think he's here anymore. :P)
How you're playing a Flash movie I can't imagine, because they'd dropped that technology over a decade ago and movies started being played in Flash successfully five, six years ago.
"I see what you mean. I got stuck even before this process - if you can't bring up halos, how do you even know which class/method to *start* with?"
Well, yea. That's been a problem. For sure. But I don't believe in anything unless I can see it. I can assure you I'll never want to EVER watch a filmed movie of Macbeth when this project is over. I've heard Orson Wells intone too many times.
I know that the SophieMovie hierarchy is the place to start. And learning more about Tweak is slowly showing me how that model is connected to the view. If you want to take something from Tweak and put it in Morphic, and you don't want to have start it from a Workspace, then you need to know how to convert a CPlayer into a Player. And so it goes...
Chris
Chris Cunnington-3 wrote:
I don't know how you could be playing a Flash movie in a Sophie image, because the Flash player there is so old that it only understands swf file animations. It couldn't play movies because that was still five years off.
I don't know either, but I'm watching it play :)
Chris Cunnington-3 wrote:
But I don't believe in anything unless I can see it. I can assure you I'll never want to EVER watch a filmed movie of Macbeth when this project is over. I've heard Orson Wells intone too many times.
I don't think it's a MacbethPlayer, I think it plays other movies too ;-)
Chris Cunnington-3 wrote:
If you want to take something from Tweak and put it in Morphic... you need to know how to convert a CPlayer into a Player.
I filed Sophie-Movie into trunk. I'll see what I can come up with.
Thanks. Sean
Sean P. DeNigris wrote:
I filed Sophie-Movie into trunk. I'll see what I can come up with.
Okay, here's a first stab - Mac-only (platform temporarily hardcoded). If you download: * FFI including Examples * SpdQT from http://www.squeaksource.com/SophieGoldDig
then you can evaluate the following: aURI := URI fromString: 'file:///path/to/aQuickTimeFile.flv'. manager := SophieResourceManagerFolderPackage new. resource := SophieResource basedOn: manager. resource fileURI: aURI. movie := QuickTimeMovie new. movie resource: resource. movie openMovieFromURI: aURI. "movie play." movie startMovieQT. "movie stopMovieQT." when you do #startMovieQT, you will hear the movie audio, but drawing has not been implemented, so you won't see anything. At least we're connected to the QT API :)
Sean
You'll note that there are a *lot* of SophieResourceManager subclasses.
It's goal in life was to provide a storage framework for resources and components of Sophie books. The concrete class are all about, is the book stored on the internet, on the local hard drive, is it a gzip file, a directory of files, a gzip file WITHOUT compression (aka OLPC support). Oh lots of choices and different trials were made over the years resulted in lots of subclasses...
Ya, so make the manager, then stuff a resource into it. You'll note it's not a MovieResource rather the SophieResource was really generic...
Sophie NEVER NEVER NEVER thought of a resource item being a file path. Great pains to ensure the proper UTF8 URI was used and at the point where we need the actual data bits, it gets translated into something the read/write underpinnings could digest. Fortunately Quicktime was very happy to digest URI for us. Mind there was *some* problems with quicktime on windows but I recall that Apple over time shipped some fixes.
As earlier mentioned the SophieResource is there to contain the meta-data for the movie so we avoid digging in the movie every time we need an answer, also it provided a translation layer as the different decoders had to be invoked to drag the data out to be cached within the resource's meta-data.
On 2010-12-29, at 1:32 PM, Sean P. DeNigris wrote:
Sean P. DeNigris wrote:
I filed Sophie-Movie into trunk. I'll see what I can come up with.
Okay, here's a first stab - Mac-only (platform temporarily hardcoded). If you download:
- FFI including Examples
- SpdQT from http://www.squeaksource.com/SophieGoldDig
then you can evaluate the following: aURI := URI fromString: 'file:///path/to/aQuickTimeFile.flv'. manager := SophieResourceManagerFolderPackage new. resource := SophieResource basedOn: manager. resource fileURI: aURI. movie := QuickTimeMovie new. movie resource: resource. movie openMovieFromURI: aURI. "movie play." movie startMovieQT. "movie stopMovieQT." when you do #startMovieQT, you will hear the movie audio, but drawing has not been implemented, so you won't see anything. At least we're connected to the QT API :)
Sean
-- View this message in context: http://forum.world.st/Playing-Flash-movies-in-image-tp3167383p3167639.html Sent from the Squeak - Dev mailing list archive at Nabble.com.
-- =========================================================================== John M. McIntosh johnmci@smalltalkconsulting.com Twitter: squeaker68882 Corporate Smalltalk Consulting Ltd. http://www.smalltalkconsulting.com ===========================================================================
John M McIntosh wrote:
Ya, so make the manager, then stuff a resource into it. You'll note it's not a MovieResource rather the SophieResource was really generic...
<snip> As earlier mentioned the SophieResource is there to contain the meta-data for the movie so we avoid digging in the movie every time we need an answer, also it provided a translation layer as the different decoders had to be invoked to drag the data out to be cached within the resource's meta-data.
Thanks for all the info John. I wasn't sure I got the intention of your post. Based on your earlier message, I was thinking that when I started cleaning up the port, I would replace SophieResource and the manager with a class specifically-designed to hold the meta-data you mentioned. Was this reiterating that or did I miss something?
Sean
On 2010-12-30, at 7:38 AM, Sean P. DeNigris wrote:
Thanks for all the info John. I wasn't sure I got the intention of your post. Based on your earlier message, I was thinking that when I started cleaning up the port, I would replace SophieResource and the manager with a class specifically-designed to hold the meta-data you mentioned. Was this reiterating that or did I miss something?
Sean
No that is correct, in the past people got hung up looking at SophieResourceManager and thinking they had to migrate that monster over.
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
Mmmm don't forget the file get/put dialogs for native file interface. We did both the Windows and the OS-X ones with proper UTF8 255 byte file name support.
-- =========================================================================== John M. McIntosh johnmci@smalltalkconsulting.com Twitter: squeaker68882 Corporate Smalltalk Consulting Ltd. http://www.smalltalkconsulting.com ===========================================================================
John, i put that in my todo list.
No that is correct, in the past people got hung up looking at SophieResourceManager and thinking they had to migrate that monster over.
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
Mmmm don't forget the file get/put dialogs for native file interface. We did both the Windows and the OS-X ones with proper UTF8 255 byte file name support.
--
John M. McIntosh johnmci@smalltalkconsulting.com Twitter: squeaker68882 Corporate Smalltalk Consulting Ltd. http://www.smalltalkconsulting.com ===========================================================================
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 -
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
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
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
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
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 johnmci@smalltalkconsulting.com Twitter: squeaker68882 Corporate Smalltalk Consulting Ltd. http://www.smalltalkconsulting.com ===========================================================================
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 johnmci@smalltalkconsulting.com Twitter: squeaker68882 Corporate Smalltalk Consulting Ltd. http://www.smalltalkconsulting.com ===========================================================================
-- =========================================================================== John M. McIntosh johnmci@smalltalkconsulting.com Twitter: squeaker68882 Corporate Smalltalk Consulting Ltd. http://www.smalltalkconsulting.com ===========================================================================
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. McIntoshjohnmci@smalltalkconsulting.com Twitter: squeaker68882 Corporate Smalltalk Consulting Ltd. http://www.smalltalkconsulting.com ===========================================================================
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/Concept...
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 johnmci@smalltalkconsulting.com Twitter: squeaker68882 Corporate Smalltalk Consulting Ltd. http://www.smalltalkconsulting.com ===========================================================================
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 -
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
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 -
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
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 -
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
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 -
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 bert@freudenbergs.de 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 -
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 bert@freudenbergs.de 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 johnmci@smalltalkconsulting.com Twitter: squeaker68882 Corporate Smalltalk Consulting Ltd. http://www.smalltalkconsulting.com ===========================================================================
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
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
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-fo... and http://secrets.blacktree.com/edit?id=2233 for possible formats)
So Long, -Tobias
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-fo... 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
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
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 -
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
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
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
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
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 -
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
On 12/29/2010 6:16 PM, Chris Cunnington wrote:
No. In fact, I don't know how you could be playing a Flash movie in a Sophie image, because the Flash player there is so old that it only understands swf file animations. It couldn't play movies because that was still five years off.
Because Sophie uses Quicktime for all its media needs. Quicktime supports Flash just fine.
As far as I can read the history, in the late 90s Squeakers explored existing multimedia, then they went crazy with originality. What they built is so pervasive it's hard to see it, because it changed the environment. Basically, this was a pre-Croquet/Etoys/Tweak period.
I wrote the Flash player for Disney projects and we used it there. The reason it was never updated was because Macromedia (which owned Flash at this point) changed their policy on releasing the SWF spec - in order to obtain the spec for SWF > 3.0 one had to agree to NOT write any player for SWF files; you were only allowed to use that documentation to CREATE output in SWF. So a complete no-go for us (I have not checked what recent policy is).
They dropped Flash and never picked it up again, while creating insane graphics using the SurfacePlugin and scripting (which uses time stamped MessageSends in a queue to substitute single processes for multi-threading.) This era started with this memo:
http://tweakproject.org/ABOUT/FAQ/OriginalTweakMemo/
(I can't remember who wrote it. I don't think he's here anymore. :P)
I wrote the memo, I own the site, and methinks I'm still around ...
Cheers, - Andreas
squeak-dev@lists.squeakfoundation.org