Import Tk 8.6.12
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user