view dstep/applicationservices/coregraphics/CGGeometry.d @ 12:9f0b49a2f64e

Added the ApplicationServices frameworks: ATS, ColorSync and CoreGraphics
author Jacob Carlborg <doob@me.com>
date Mon, 03 Aug 2009 14:00:21 +0200
parents
children
line wrap: on
line source

/**
 * Copyright: Copyright (c) 2009 Jacob Carlborg.
 * Authors: Jacob Carlborg
 * Version: Initial created: Aug 1, 2009 
 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
 */
module dstep.applicationservices.coregraphics.CGGeometry;

import dstep.corefoundation.CFDictionary;
import dstep.applicationservices.coregraphics.CGBase;

alias int CGRectEdge;

extern (C)
{
	extern
	{
		const CGPoint CGPointZero;
		const CGSize CGSizeZero;
		const CGRect CGRectZero;
		const CGRect CGRectNull;
		const CGRect CGRectInfinite;
	}
}

enum /*CGRectEdge*/ 
{
	CGRectMinXEdge,
	CGRectMinYEdge,
	CGRectMaxXEdge,
	CGRectMaxYEdge
}

struct CGPoint
{
	CGFloat x;
	CGFloat y;
}


struct CGSize
{
	CGFloat width;
	CGFloat height;
}


struct CGRect
{
	CGPoint origin;
	CGSize size;
}

extern (C)
{
	CGFloat CGRectGetMinX (CGRect rect);
	CGFloat CGRectGetMidX (CGRect rect);
	CGFloat CGRectGetMaxX (CGRect rect);
	CGFloat CGRectGetMinY (CGRect rect);
	CGFloat CGRectGetMidY (CGRect rect);
	CGFloat CGRectGetMaxY (CGRect rect);
	CGFloat CGRectGetWidth (CGRect rect);
	CGFloat CGRectGetHeight (CGRect rect);
	bool CGPointEqualToPoint (CGPoint point1, CGPoint point2);
	bool CGSizeEqualToSize (CGSize size1, CGSize size2);
	bool CGRectEqualToRect (CGRect rect1, CGRect rect2);
	CGRect CGRectStandardize (CGRect rect);
	bool CGRectIsEmpty (CGRect rect);
	bool CGRectIsNull (CGRect rect);
	bool CGRectIsInfinite (CGRect rect);
	CGRect CGRectInset (CGRect rect, CGFloat dx, CGFloat dy);
	CGRect CGRectIntegral (CGRect rect);
	CGRect CGRectUnion (CGRect r1, CGRect r2);
	CGRect CGRectIntersection (CGRect r1, CGRect r2);
	CGRect CGRectOffset (CGRect rect, CGFloat dx, CGFloat dy);
	void CGRectDivide (CGRect rect, CGRect* slice, CGRect* remainder, CGFloat amount, int edge);
	bool CGRectContainsPoint (CGRect rect, CGPoint point);
	bool CGRectContainsRect (CGRect rect1, CGRect rect2);
	bool CGRectIntersectsRect (CGRect rect1, CGRect rect2);
	CFDictionaryRef CGPointCreateDictionaryRepresentation (CGPoint point);
	bool CGPointMakeWithDictionaryRepresentation (CFDictionaryRef dict, CGPoint* point);
	CFDictionaryRef CGSizeCreateDictionaryRepresentation (CGSize size);
	bool CGSizeMakeWithDictionaryRepresentation (CFDictionaryRef dict, CGSize* size);
	CFDictionaryRef CGRectCreateDictionaryRepresentation (CGRect dummy);
	bool CGRectMakeWithDictionaryRepresentation (CFDictionaryRef dict, CGRect* rect);
}