diff dstep/applicationservices/coregraphics/CGContext.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 diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dstep/applicationservices/coregraphics/CGContext.d	Mon Aug 03 14:00:21 2009 +0200
@@ -0,0 +1,232 @@
+/**
+ * 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.CGContext;
+
+import dstep.applicationservices.coregraphics.CGAffineTransform;
+import dstep.applicationservices.coregraphics.CGBase;
+import dstep.applicationservices.coregraphics.CGColor;
+import dstep.applicationservices.coregraphics.CGColorSpace;
+import dstep.applicationservices.coregraphics.CGContext;
+import dstep.applicationservices.coregraphics.CGFont;
+import dstep.applicationservices.coregraphics.CGGeometry;
+import dstep.applicationservices.coregraphics.CGGradient;
+import dstep.applicationservices.coregraphics.CGImage;
+import dstep.applicationservices.coregraphics.CGPDFDocument;
+import dstep.applicationservices.coregraphics.CGPath;
+import dstep.applicationservices.coregraphics.CGPattern;
+import dstep.applicationservices.coregraphics.CGPDFPage;
+import dstep.applicationservices.coregraphics.CGShading;
+import dstep.corefoundation.CFDictionary;
+
+struct CGContext;
+
+alias CGContext* CGContextRef;
+alias int CGLineJoin;
+alias int CGLineCap;
+alias int CGPathDrawingMode;
+alias int CGTextDrawingMode;
+alias int CGTextEncoding;
+alias int CGInterpolationQuality;
+alias int CGBlendMode;
+
+enum /*CGLineJoin*/ 
+{
+	kCGLineJoinMiter,
+	kCGLineJoinRound,
+	kCGLineJoinBevel
+}
+
+enum /*CGLineCap*/ 
+{
+	kCGLineCapButt,
+	kCGLineCapRound,
+	kCGLineCapSquare
+}
+
+enum /*CGPathDrawingMode*/ 
+{
+	kCGPathFill,
+	kCGPathEOFill,
+	kCGPathStroke,
+	kCGPathFillStroke,
+	kCGPathEOFillStroke
+}
+
+enum /*CGTextDrawingMode*/ 
+{
+	kCGTextFill,
+	kCGTextStroke,
+	kCGTextFillStroke,
+	kCGTextInvisible,
+	kCGTextFillClip,
+	kCGTextStrokeClip,
+	kCGTextFillStrokeClip,
+	kCGTextClip
+}
+
+enum /*CGTextEncoding*/ 
+{
+	kCGEncodingFontSpecific,
+	kCGEncodingMacRoman
+}
+
+enum /*CGInterpolationQuality*/ 
+{
+	kCGInterpolationDefault,
+	kCGInterpolationNone,
+	kCGInterpolationLow,
+	kCGInterpolationHigh
+}
+
+enum /*CGBlendMode*/ 
+{
+	kCGBlendModeNormal,
+	kCGBlendModeMultiply,
+	kCGBlendModeScreen,
+	kCGBlendModeOverlay,
+	kCGBlendModeDarken,
+	kCGBlendModeLighten,
+	kCGBlendModeColorDodge,
+	kCGBlendModeColorBurn,
+	kCGBlendModeSoftLight,
+	kCGBlendModeHardLight,
+	kCGBlendModeDifference,
+	kCGBlendModeExclusion,
+	kCGBlendModeHue,
+	kCGBlendModeSaturation,
+	kCGBlendModeColor,
+	kCGBlendModeLuminosity,
+	kCGBlendModeClear,
+	kCGBlendModeCopy,
+	kCGBlendModeSourceIn,
+	kCGBlendModeSourceOut,
+	kCGBlendModeSourceAtop,
+	kCGBlendModeDestinationOver,
+	kCGBlendModeDestinationIn,
+	kCGBlendModeDestinationOut,
+	kCGBlendModeDestinationAtop,
+	kCGBlendModeXOR,
+	kCGBlendModePlusDarker,
+	kCGBlendModePlusLighter
+}
+
+extern (C)
+{
+	uint CGContextGetTypeID ();
+	void CGContextSaveGState (CGContextRef c);
+	void CGContextRestoreGState (CGContextRef c);
+	void CGContextScaleCTM (CGContextRef c, CGFloat sx, CGFloat sy);
+	void CGContextTranslateCTM (CGContextRef c, CGFloat tx, CGFloat ty);
+	void CGContextRotateCTM (CGContextRef c, CGFloat angle);
+	void CGContextConcatCTM (CGContextRef c, CGAffineTransform transform);
+	CGAffineTransform CGContextGetCTM (CGContextRef c);
+	void CGContextSetLineWidth (CGContextRef c, CGFloat width);
+	void CGContextSetLineCap (CGContextRef c, int cap);
+	void CGContextSetLineJoin (CGContextRef c, int join);
+	void CGContextSetMiterLimit (CGContextRef c, CGFloat limit);
+	void CGContextSetLineDash (CGContextRef c, CGFloat phase, CGFloat* lengths, uint count);
+	void CGContextSetFlatness (CGContextRef c, CGFloat flatness);
+	void CGContextSetAlpha (CGContextRef c, CGFloat alpha);
+	void CGContextSetBlendMode (CGContextRef context, int mode);
+	void CGContextBeginPath (CGContextRef c);
+	void CGContextMoveToPoint (CGContextRef c, CGFloat x, CGFloat y);
+	void CGContextAddLineToPoint (CGContextRef c, CGFloat x, CGFloat y);
+	void CGContextAddCurveToPoint (CGContextRef c, CGFloat cp1x, CGFloat cp1y, CGFloat cp2x, CGFloat cp2y, CGFloat x, CGFloat y);
+	void CGContextAddQuadCurveToPoint (CGContextRef c, CGFloat cpx, CGFloat cpy, CGFloat x, CGFloat y);
+	void CGContextClosePath (CGContextRef c);
+	void CGContextAddRect (CGContextRef c, CGRect rect);
+	void CGContextAddRects (CGContextRef c, CGRect* rects, uint count);
+	void CGContextAddLines (CGContextRef c, CGPoint* points, uint count);
+	void CGContextAddEllipseInRect (CGContextRef context, CGRect rect);
+	void CGContextAddArc (CGContextRef c, CGFloat x, CGFloat y, CGFloat radius, CGFloat startAngle, CGFloat endAngle, int clockwise);
+	void CGContextAddArcToPoint (CGContextRef c, CGFloat x1, CGFloat y1, CGFloat x2, CGFloat y2, CGFloat radius);
+	void CGContextAddPath (CGContextRef context, CGPathRef path);
+	void CGContextReplacePathWithStrokedPath (CGContextRef c);
+	bool CGContextIsPathEmpty (CGContextRef c);
+	CGPoint CGContextGetPathCurrentPoint (CGContextRef c);
+	CGRect CGContextGetPathBoundingBox (CGContextRef c);
+	bool CGContextPathContainsPoint (CGContextRef context, CGPoint point, int mode);
+	void CGContextDrawPath (CGContextRef c, int mode);
+	void CGContextFillPath (CGContextRef c);
+	void CGContextEOFillPath (CGContextRef c);
+	void CGContextStrokePath (CGContextRef c);
+	void CGContextFillRect (CGContextRef c, CGRect rect);
+	void CGContextFillRects (CGContextRef c, CGRect* rects, uint count);
+	void CGContextStrokeRect (CGContextRef c, CGRect rect);
+	void CGContextStrokeRectWithWidth (CGContextRef c, CGRect rect, CGFloat width);
+	void CGContextClearRect (CGContextRef c, CGRect rect);
+	void CGContextFillEllipseInRect (CGContextRef context, CGRect rect);
+	void CGContextStrokeEllipseInRect (CGContextRef context, CGRect rect);
+	void CGContextStrokeLineSegments (CGContextRef c, CGPoint* points, uint count);
+	void CGContextClip (CGContextRef c);
+	void CGContextEOClip (CGContextRef c);
+	void CGContextClipToMask (CGContextRef c, CGRect rect, CGImageRef mask);
+	CGRect CGContextGetClipBoundingBox (CGContextRef c);
+	void CGContextClipToRect (CGContextRef c, CGRect rect);
+	void CGContextClipToRects (CGContextRef c, CGRect* rects, uint count);
+	void CGContextSetFillColorWithColor (CGContextRef c, CGColorRef color);
+	void CGContextSetStrokeColorWithColor (CGContextRef c, CGColorRef color);
+	void CGContextSetFillColorSpace (CGContextRef c, CGColorSpaceRef colorspace);
+	void CGContextSetStrokeColorSpace (CGContextRef c, CGColorSpaceRef colorspace);
+	void CGContextSetFillColor (CGContextRef c, CGFloat* components);
+	void CGContextSetStrokeColor (CGContextRef c, CGFloat* components);
+	void CGContextSetFillPattern (CGContextRef c, CGPatternRef pattern, CGFloat* components);
+	void CGContextSetStrokePattern (CGContextRef c, CGPatternRef pattern, CGFloat* components);
+	void CGContextSetPatternPhase (CGContextRef c, CGSize phase);
+	void CGContextSetGrayFillColor (CGContextRef c, CGFloat gray, CGFloat alpha);
+	void CGContextSetGrayStrokeColor (CGContextRef c, CGFloat gray, CGFloat alpha);
+	void CGContextSetRGBFillColor (CGContextRef c, CGFloat red, CGFloat green, CGFloat blue, CGFloat alpha);
+	void CGContextSetRGBStrokeColor (CGContextRef c, CGFloat red, CGFloat green, CGFloat blue, CGFloat alpha);
+	void CGContextSetCMYKFillColor (CGContextRef c, CGFloat cyan, CGFloat magenta, CGFloat yellow, CGFloat black, CGFloat alpha);
+	void CGContextSetCMYKStrokeColor (CGContextRef c, CGFloat cyan, CGFloat magenta, CGFloat yellow, CGFloat black, CGFloat alpha);
+	void CGContextSetRenderingIntent (CGContextRef c, int intent);
+	void CGContextDrawImage (CGContextRef c, CGRect rect, CGImageRef image);
+	void CGContextDrawTiledImage (CGContextRef c, CGRect rect, CGImageRef image);
+	int CGContextGetInterpolationQuality (CGContextRef c);
+	void CGContextSetInterpolationQuality (CGContextRef c, int quality);
+	void CGContextSetShadowWithColor (CGContextRef context, CGSize offset, CGFloat blur, CGColorRef color);
+	void CGContextSetShadow (CGContextRef context, CGSize offset, CGFloat blur);
+	void CGContextDrawLinearGradient (CGContextRef context, CGGradientRef gradient, CGPoint startPoint, CGPoint endPoint, uint options);
+	void CGContextDrawRadialGradient (CGContextRef context, CGGradientRef gradient, CGPoint startCenter, CGFloat startRadius, CGPoint endCenter, CGFloat endRadius, uint options);
+	void CGContextDrawShading (CGContextRef context, CGShadingRef shading);
+	void CGContextSetCharacterSpacing (CGContextRef c, CGFloat spacing);
+	void CGContextSetTextPosition (CGContextRef c, CGFloat x, CGFloat y);
+	CGPoint CGContextGetTextPosition (CGContextRef c);
+	void CGContextSetTextMatrix (CGContextRef c, CGAffineTransform t);
+	CGAffineTransform CGContextGetTextMatrix (CGContextRef c);
+	void CGContextSetTextDrawingMode (CGContextRef c, int mode);
+	void CGContextSetFont (CGContextRef c, CGFontRef font);
+	void CGContextSetFontSize (CGContextRef c, CGFloat size);
+	void CGContextSelectFont (CGContextRef c, char* name, CGFloat size, int textEncoding);
+	void CGContextShowGlyphsAtPositions (CGContextRef context, CGGlyph* glyphs, CGPoint* positions, uint count);
+	void CGContextShowText (CGContextRef c, char* string, uint length);
+	void CGContextShowTextAtPoint (CGContextRef c, CGFloat x, CGFloat y, char* string, uint length);
+	void CGContextShowGlyphs (CGContextRef c, CGGlyph* g, uint count);
+	void CGContextShowGlyphsAtPoint (CGContextRef c, CGFloat x, CGFloat y, CGGlyph* glyphs, uint count);
+	void CGContextShowGlyphsWithAdvances (CGContextRef c, CGGlyph* glyphs, CGSize* advances, uint count);
+	void CGContextDrawPDFPage (CGContextRef c, CGPDFPageRef page);
+	void CGContextDrawPDFDocument (CGContextRef c, CGRect rect, CGPDFDocumentRef document, int page);
+	void CGContextBeginPage (CGContextRef c, CGRect* mediaBox);
+	void CGContextEndPage (CGContextRef c);
+	CGContextRef CGContextRetain (CGContextRef c);
+	void CGContextRelease (CGContextRef c);
+	void CGContextFlush (CGContextRef c);
+	void CGContextSynchronize (CGContextRef c);
+	void CGContextSetShouldAntialias (CGContextRef c, bool shouldAntialias);
+	void CGContextSetAllowsAntialiasing (CGContextRef context, bool allowsAntialiasing);
+	void CGContextSetShouldSmoothFonts (CGContextRef c, bool shouldSmoothFonts);
+	void CGContextBeginTransparencyLayer (CGContextRef context, CFDictionaryRef auxiliaryInfo);
+	void CGContextBeginTransparencyLayerWithRect (CGContextRef context, CGRect rect, CFDictionaryRef auxiliaryInfo);
+	void CGContextEndTransparencyLayer (CGContextRef context);
+	CGAffineTransform CGContextGetUserSpaceToDeviceSpaceTransform (CGContextRef c);
+	CGPoint CGContextConvertPointToDeviceSpace (CGContextRef c, CGPoint point);
+	CGPoint CGContextConvertPointToUserSpace (CGContextRef c, CGPoint point);
+	CGSize CGContextConvertSizeToDeviceSpace (CGContextRef c, CGSize size);
+	CGSize CGContextConvertSizeToUserSpace (CGContextRef c, CGSize size);
+	CGRect CGContextConvertRectToDeviceSpace (CGContextRef c, CGRect rect);
+	CGRect CGContextConvertRectToUserSpace (CGContextRef c, CGRect rect);
+}
\ No newline at end of file