iSqueak Wikki : clipboardReadIntoAt

HomePage :: Categories :: PageIndex :: RecentChanges :: RecentlyCommented :: Login/Register

Revision [449]

Most recent edit made on 2010-09-12 23:19:39 by JohnMcIntosh

Additions:
Use NSPasteboard
[[possibleData precomposedStringWithCanonicalMapping] UTF8String]
Use UIPasteboard
[[possibleData precomposedStringWithCanonicalMapping] UTF8String]


Deletions:
TBD




Revision [323]

Edited on 2008-10-22 02:29:56 by JohnMcIntosh

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




Revision [322]

The oldest known version of this page was edited on 2008-10-22 02:25:14 by JohnMcIntosh

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

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 1.0 Transitional :: Valid CSS :: Powered by WikkaWiki
Page was generated in 0.0426 seconds