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

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

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

Use GetCurrentScrap, check the size of any text scrap, if present ensure we only copy upto the limit of count.

Use NSPasteboard
[[possibleData precomposedStringWithCanonicalMapping] UTF8String]

Use UIPasteboard
[[possibleData precomposedStringWithCanonicalMapping] UTF8String]

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

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

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