Import Tk 8.6.12

This commit is contained in:
Steve Dower
2021-11-08 17:28:57 +00:00
parent 070b8750b0
commit c6710de848
290 changed files with 5626 additions and 3660 deletions

View File

@@ -555,6 +555,55 @@ TkMacOSHIShapeUnion(
return result;
}
static OSStatus
rectCounter(
int msg,
TCL_UNUSED(HIShapeRef),
const CGRect *rect,
void *ref)
{
int *count = (int *)ref;
(*count)++;
return noErr;
}
static OSStatus
rectPrinter(
int msg,
TCL_UNUSED(HIShapeRef),
const CGRect *rect,
void *ref)
{
if (rect) {
fprintf(stderr, " %s\n", NSStringFromRect(*rect).UTF8String);
}
return noErr;
}
int
TkMacOSXCountRectsInRegion(
HIShapeRef shape)
{
int rect_count = 0;
if (!HIShapeIsEmpty(shape)) {
ChkErr(HIShapeEnumerate, shape,
kHIShapeParseFromBottom|kHIShapeParseFromLeft,
rectCounter, &rect_count);
}
return rect_count;
}
void
TkMacOSXPrintRectsInRegion(
HIShapeRef shape)
{
if (!HIShapeIsEmpty(shape)) {
ChkErr(HIShapeEnumerate, shape,
kHIShapeParseFromBottom|kHIShapeParseFromLeft,
rectPrinter, NULL);
}
}
/*
* Local Variables:
* mode: objc