Skip to content

Commit

Permalink
CogVM source as per VMMaker.oscog-eem.3313
Browse files Browse the repository at this point in the history
Have the copyBits primitives answer #'bad receiver' if loadBitBltFrom:warping:
fails.  Speed up noSource/noHalftone setup there-in.

Fix the ClipboardExtendedPlugin on Mac & Win32 so that multiple invocations of
addClipboardData:dataFormat: allow different formats to be pasted at once.
Regenerate the unchanged src/plugins/ClipboardExtendedPlugin/ClipboardExtendedPlugin.c
so that the image can check the version number to see if the new support exists.
  • Loading branch information
eliotmiranda committed Mar 25, 2023
1 parent 128e98c commit 1567c4a
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 137 deletions.
Expand Up @@ -36,9 +36,7 @@
void
sqPasteboardClear(CLIPBOARDTYPE inPasteboard)
{
NSArray *arrayOfTypes = [NSArray array];

[inPasteboard declareTypes: arrayOfTypes owner: nil];
[inPasteboard clearContents];
}

sqInt
Expand Down Expand Up @@ -81,7 +79,7 @@
NSData* data = AUTORELEASEOBJ([[NSData alloc ] initWithBytes: inData length: dataLength]);
NSArray *arrayOfTypes = @[formatType];

[inPasteboard declareTypes: arrayOfTypes owner: nil];
[inPasteboard addTypes: arrayOfTypes owner: nil];
int ok = true;
@try {
ok = [inPasteboard setData: data forType: formatType];
Expand Down
Expand Up @@ -88,7 +88,7 @@ void
sqPasteboardPutItemFlavordatalengthformatType(CLIPBOARDTYPE inPasteboard, char *inData, sqInt dataLength, sqInt format)
{
HANDLE globalMem;
int nullTerminationBytes = 0;
int nullTerminationBytes = 0, okSet, okClose;

if (dataLength <= 0) {
interpreterProxy->primitiveFailFor(PrimErrBadArgument);
Expand Down Expand Up @@ -181,14 +181,12 @@ sqPasteboardPutItemFlavordatalengthformatType(CLIPBOARDTYPE inPasteboard, char *
}
}
GlobalUnlock(globalMem);
(void)EmptyClipboard();
if (!SetClipboardData((UINT)format, globalMem)) {
CloseClipboard();
okSet = SetClipboardData((UINT)format, globalMem);
okClose = CloseClipboard();
iif (!okSet || !okClose) {
GlobalFree(globalMem);
interpreterProxy->primitiveFailFor(PrimErrOperationFailed);
return;
}
CloseClipboard();
}

sqInt
Expand Down

0 comments on commit 1567c4a

Please sign in to comment.