Wiki source for clipboardReadIntoAt


Show raw source

======**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://
Use NSPasteboard
[[possibleData precomposedStringWithCanonicalMapping] UTF8String]

**iPhone**
Use UIPasteboard
[[possibleData precomposedStringWithCanonicalMapping] UTF8String]

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

Valid XHTML :: Valid CSS: :: Powered by WikkaWiki