Пример #1
0
QRegion QRegion::fromQDRgn(RgnHandle rgn)
{
    QRegion ret;
    ret.detach();
    OSStatus oss = QDRegionToRects(rgn, kQDParseRegionFromTopLeft, qt_mac_get_rgn_rect, (void *)&ret);
    if(oss != noErr)
        return QRegion();
    return ret;
}
Пример #2
0
bool MCRegionConvertToCGRects(MCRegionRef self, void*& r_cgrects, uint32_t& r_cgrect_count)
{
	MCRegionConvertToCGRectsState t_state;
	t_state . rects = nil;
	t_state . count = 0;
	
	if (QDRegionToRects((RgnHandle)self, kQDParseRegionFromTopLeft, MCRegionConvertToCGRectsCallback, &t_state) != noErr)
	{
		MCMemoryDeleteArray(t_state . rects);
		return false;
	}
	
	r_cgrects = t_state . rects;
	r_cgrect_count = t_state . count;
	
	return true;
}