Revision [323]

This is an old revision of clipboardReadIntoAt made by JohnMcIntosh on 2008-10-22 02:29:56.

 

sqInt clipboardReadIntoAt(sqInt count, sqInt byteArrayIndex, sqInt startIndex)


Parms:
count how many bytes are reserved for storing into the oop
byteArrayIndex oops data address
startIndex index into the byteArrayIndex

return: NONE, fake return of zero
From: Interpreter
Why:
To read text data from the text clipboard into Squeak. Note use the extended clipboard plugin from the Sophie team to read other types of data

Responsibility:
Read text data from the system clipboard and place that into the byteArrayIndex area.

MacIntosh
os-9/OSXCarbon
Use GetCurrentScrap, check the size of any text scrap, if present ensure we only copy upto the limit of count.

Cocoa:
TBD

iPhone

Unix
get current x11 scrap, compare size to count, memcpy the proper number of bytes

Windows
Same as for clipboardsize, get the UTF8 data, strip off the extra LFs

BUGS
startIndex is always passed as zero, I wonder why it is there?
some platforms return bytesMoved as the return value, but the return value is ignored.
Windows does not check count against bytesneeded therefore it can copy over the end of a smaller scrap leading perhaps to a page fault.

Under anything is possible we get the scrap size earlier to decide on how to get the scrap data, it's always possible the scrap could change between those two actions...

There are no comments on this page.
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki