[Chlor-commits] SF.net SVN: chlor: [338] trunk/src
Status: Pre-Alpha
Brought to you by:
lenny222
From: <chl...@li...> - 2006-04-02 13:22:09
|
Revision: 338 Author: lenny222 Date: 2006-04-02 06:21:39 -0700 (Sun, 02 Apr 2006) ViewCVS: http://svn.sourceforge.net/chlor/?rev=338&view=rev Log Message: ----------- more cleanup and documentation Modified Paths: -------------- trunk/src/CShape.m trunk/src/core/CFill.h trunk/src/core/CFont.h trunk/src/core/CGeometry.h trunk/src/core/CGradientPaint.h trunk/src/core/CGroup.h trunk/src/core/CLayer.h trunk/src/core/CNode.h trunk/src/core/CObject.h trunk/src/core/CPaint.h trunk/src/core/CPath.h trunk/src/core/CPath.m trunk/src/core/CPoint.h trunk/src/core/CPoint.m trunk/src/core/CSolidPaint.h trunk/src/io/pdf/CPdfImport.m trunk/src/io/svg/CSvgImport.m Modified: trunk/src/CShape.m =================================================================== --- trunk/src/CShape.m 2006-04-02 12:45:13 UTC (rev 337) +++ trunk/src/CShape.m 2006-04-02 13:21:39 UTC (rev 338) @@ -30,11 +30,11 @@ { // Create circle with radius 0.5 and bottom left (0, 0). CPath* path = [[CPath alloc] init]; - [path moveToX: 0.0 Y: 0.5]; - [path arcToX: 0.5 Y: 0.0 TanX: 0.0 TanY: 0.0 Radius: 0.5]; - [path arcToX: 1.0 Y: 0.5 TanX: 1.0 TanY: 0.0 Radius: 0.5]; - [path arcToX: 0.5 Y: 1.0 TanX: 1.0 TanY: 1.0 Radius: 0.5]; - [path arcToX: 0.0 Y: 0.5 TanX: 0.0 TanY: 1.0 Radius: 0.5]; + [path moveToX: 0.0 y: 0.5]; + [path arcToX: 0.5 y: 0.0 tanX: 0.0 tanY: 0.0 radius: 0.5]; + [path arcToX: 1.0 y: 0.5 tanX: 1.0 tanY: 0.0 radius: 0.5]; + [path arcToX: 0.5 y: 1.0 tanX: 1.0 tanY: 1.0 radius: 0.5]; + [path arcToX: 0.0 y: 0.5 tanX: 0.0 tanY: 1.0 radius: 0.5]; [path close]; // Scale and translate to final position. @@ -92,17 +92,15 @@ const double incr = 2 * M_PI / edges; a = offset; - [path - moveToX: radius * cos( a ) + x - Y: radius * sin( a ) + y]; + [path moveToX: radius * cos( a ) + x + y: radius * sin( a ) + y]; int i; for( i = 0; i < edges; ++i ) { a = offset + incr * ( i + 1.0 ); - [path - lineToX: radius * cos( a ) + x - Y: radius * sin( a ) + y]; + [path lineToX: radius * cos( a ) + x + y: radius * sin( a ) + y]; } [path close]; @@ -118,10 +116,10 @@ { CPath* path = [[CPath alloc] init]; - [path moveToX: left Y: bottom]; - [path lineToX: left + width Y: bottom]; - [path lineToX: left + width Y: bottom + height]; - [path lineToX: left Y: bottom + height]; + [path moveToX: left y: bottom]; + [path lineToX: left + width y: bottom]; + [path lineToX: left + width y: bottom + height]; + [path lineToX: left y: bottom + height]; [path close]; return [path autorelease]; @@ -143,19 +141,28 @@ CPath* path = [[CPath alloc] init]; - [path moveToX: left Y: bottom + height - radius]; - [path - arcToX: left + radius Y: bottom - TanX: left TanY: bottom Radius: radius]; - [path - arcToX: left + width Y: bottom + radius - TanX: left + width TanY: bottom Radius: radius]; - [path - arcToX: left + width - radius Y: bottom + height - TanX: left + width TanY: bottom + height Radius: radius]; - [path - arcToX: left Y: bottom + height - radius - TanX: left TanY: bottom + height Radius: radius]; + [path moveToX: left + y: bottom + height - radius]; + [path arcToX: left + radius + y: bottom + tanX: left + tanY: bottom + radius: radius]; + [path arcToX: left + width + y: bottom + radius + tanX: left + width + tanY: bottom + radius: radius]; + [path arcToX: left + width - radius + y: bottom + height + tanX: left + width + tanY: bottom + height + radius: radius]; + [path arcToX: left + y: bottom + height - radius + tanX: left + tanY: bottom + height + radius: radius]; [path close]; return [path autorelease]; @@ -175,16 +182,19 @@ const double incr = 2 * M_PI / edges; a = offset; - [path moveToX: outerRadius * cos( a ) + x Y: outerRadius * sin( a ) + y]; + [path moveToX: outerRadius * cos( a ) + x + y: outerRadius * sin( a ) + y]; int i; for( i = 0; i < edges; ++i ) { a = offset + incr * ( i + 0.5 ); - [path lineToX: innerRadius * cos( a ) + x Y: innerRadius * sin( a ) + y]; + [path lineToX: innerRadius * cos( a ) + x + y: innerRadius * sin( a ) + y]; a = offset + incr * ( i + 1.0 ); - [path lineToX: outerRadius * cos( a ) + x Y: outerRadius * sin( a ) + y]; + [path lineToX: outerRadius * cos( a ) + x + y: outerRadius * sin( a ) + y]; } [path close]; Modified: trunk/src/core/CFill.h =================================================================== --- trunk/src/core/CFill.h 2006-04-02 12:45:13 UTC (rev 337) +++ trunk/src/core/CFill.h 2006-04-02 13:21:39 UTC (rev 338) @@ -32,7 +32,7 @@ /** - * The CObjects' fill. + * An CFill object represents a CObject fill, which is defined by a fil rule and a paint. */ @interface CFill : NSObject <NSCopying> { Modified: trunk/src/core/CFont.h =================================================================== --- trunk/src/core/CFont.h 2006-04-02 12:45:13 UTC (rev 337) +++ trunk/src/core/CFont.h 2006-04-02 13:21:39 UTC (rev 338) @@ -21,7 +21,7 @@ #import "CAcceptor.h" /** - * CFont represents a font. + * An CFont object represents a CText font, which is defined by margin, name and size. */ @interface CFont : NSObject <CAcceptor, NSCopying> { Modified: trunk/src/core/CGeometry.h =================================================================== --- trunk/src/core/CGeometry.h 2006-04-02 12:45:13 UTC (rev 337) +++ trunk/src/core/CGeometry.h 2006-04-02 13:21:39 UTC (rev 338) @@ -19,6 +19,10 @@ #import <Cocoa/Cocoa.h> +/** + * The CGeometry namespace includes geometric lowelevel methods like + * distance calculationsand segment intersection determination. + */ @interface CGeometry : NSObject { } Modified: trunk/src/core/CGradientPaint.h =================================================================== --- trunk/src/core/CGradientPaint.h 2006-04-02 12:45:13 UTC (rev 337) +++ trunk/src/core/CGradientPaint.h 2006-04-02 13:21:39 UTC (rev 338) @@ -21,11 +21,18 @@ #import "CPaint.h" /** - * Gradient stop point. + * An CGradientStop object represents a CGradientPaint stop point. */ @interface CGradientStop : NSObject <NSCopying> { + /** + * The gradient stop point color. + */ CGColorRef m_color; + + /** + * The gradient stop point offset. + */ double m_offset; } @@ -52,7 +59,7 @@ /** - * Gradient paint (linear or radial). + * An CGradientPaint object represents a gradient paint (linear or radial). */ @interface CGradientPaint : CPaint { @@ -62,20 +69,30 @@ CGradientPaintSpreadMethod m_spreadMethod; /** - * Stop list. + * Gradient stop point list. */ NSMutableArray* m_stopList; } +/** + * Sets the gradient paint spread method. + */ - (void) setSpreadMethod: (CGradientPaintSpreadMethod) theSpreadMethod; + +/** + * Returns the gradient paint spread method. + */ - (CGradientPaintSpreadMethod) spreadMethod; + +/** + * Returns the list of gradient stop points. + */ - (NSMutableArray*) stopList; - @end /** - * Linear gradient paint. + * An CLinearGradientPaint object represents a linear gradient paint. */ @interface CLinearGradientPaint : CGradientPaint { @@ -96,11 +113,10 @@ /** - * Radial gradient paint. + * An CRadialGradientPaint object represents a radial gradient paint. */ @interface CRadialGradientPaint : CGradientPaint { - } @end \ No newline at end of file Modified: trunk/src/core/CGroup.h =================================================================== --- trunk/src/core/CGroup.h 2006-04-02 12:45:13 UTC (rev 337) +++ trunk/src/core/CGroup.h 2006-04-02 13:21:39 UTC (rev 338) @@ -20,7 +20,7 @@ #import "CObject.h" /** - * CGroup is a composite of CObjects. + * An CGroup object represents a composite of CObjects. */ @interface CGroup : CObject { Modified: trunk/src/core/CLayer.h =================================================================== --- trunk/src/core/CLayer.h 2006-04-02 12:45:13 UTC (rev 337) +++ trunk/src/core/CLayer.h 2006-04-02 13:21:39 UTC (rev 338) @@ -20,7 +20,7 @@ #import "CGroup.h" /** - * A Chlor layer. + * An CLayer objects represents a graphical layer. */ @interface CLayer : CGroup { Modified: trunk/src/core/CNode.h =================================================================== --- trunk/src/core/CNode.h 2006-04-02 12:45:13 UTC (rev 337) +++ trunk/src/core/CNode.h 2006-04-02 13:21:39 UTC (rev 338) @@ -22,7 +22,7 @@ @class CPoint; /** - * CNode is the graphical representation of a CPoint. A CNode can be selected. + * An CNode objects represents a CPoint graphically. A CNode can be selected. */ @interface CNode : NSObject <CIsSelectable, NSCopying> { Modified: trunk/src/core/CObject.h =================================================================== --- trunk/src/core/CObject.h 2006-04-02 12:45:13 UTC (rev 337) +++ trunk/src/core/CObject.h 2006-04-02 13:21:39 UTC (rev 338) @@ -28,7 +28,7 @@ @class CVisitor; /** - * CObject is the base class for all graphical Chlor objects. + * CObject is the abstract base class for all graphical Chlor objects. */ @interface CObject : NSObject <CAcceptor, CHasComplexBoundaries, CIsSelectable, NSCopying> { Modified: trunk/src/core/CPaint.h =================================================================== --- trunk/src/core/CPaint.h 2006-04-02 12:45:13 UTC (rev 337) +++ trunk/src/core/CPaint.h 2006-04-02 13:21:39 UTC (rev 338) @@ -20,7 +20,7 @@ #import <Cocoa/Cocoa.h> /** - * Abstract base class for all paints. + * CPaint is the abstract base class for all paints (solid color, pattern, gradient). */ @interface CPaint : NSObject <NSCopying> { Modified: trunk/src/core/CPath.h =================================================================== --- trunk/src/core/CPath.h 2006-04-02 12:45:13 UTC (rev 337) +++ trunk/src/core/CPath.h 2006-04-02 13:21:39 UTC (rev 338) @@ -36,21 +36,21 @@ */ - (BOOL) arcAroundX: (double) centerX - Y: (double) centerY - Tan0: (double) tan0 - Tan1: (double) tan1 - RadiusX: (double) radX - RadiusY: (double) radY - XRotation: (double) xrot; + Y: (double) centerY + Tan0: (double) tan0 + Tan1: (double) tan1 + RadiusX: (double) radX + RadiusY: (double) radY + XRotation: (double) xrot; /** * Like the PostScript "arcto". */ - (BOOL) arcToX: (double) x - Y: (double) y - TanX: (double) tanX - TanY: (double) tanY + Y: (double) y + TanX: (double) tanX + TanY: (double) tanY Radius: (double) theRadius; /** @@ -68,11 +68,11 @@ */ - (BOOL) curveToX: (double) x - Y: (double) y - X1: (double) x1 - Y1: (double) y1 - X2: (double) x2 - Y2: (double) y2; + Y: (double) y + X1: (double) x1 + Y1: (double) y1 + X2: (double) x2 + Y2: (double) y2; /** * Returns YES if subpath is closed. @@ -92,97 +92,110 @@ @end +/** + * An CPath object represents a graphical path. + */ @interface CPath : CGroup { } - - - (CPath*) arcToX: (double) x - Y: (double) y - TanX: (double) tanX - TanY: (double) tanY - Radius: (double) theRadius; + y: (double) y + tanX: (double) tanX + tanY: (double) tanY + radius: (double) theRadius; +/** + * Closes the current subpath. + */ - (CPath*) close; +/** + * Returns the current point. + */ - (CNode*) currentPoint; - (CPath*) curveToX: (double) x - Y: (double) y - X1: (double) x1 - Y1: (double) y1 - X2: (double) x2 - Y2: (double) y2; + y: (double) y + x1: (double) x1 + y1: (double) y1 + x2: (double) x2 + y2: (double) y2; - (CPath*) curveToRelativeX: (double) x - Y: (double) y - X1: (double) x1 - Y1: (double) y1 - X2: (double) x2 - Y2: (double) y2; + y: (double) y + x1: (double) x1 + y1: (double) y1 + x2: (double) x2 + y2: (double) y2; - (CPath*) ellipticalArcToX: (double) x - Y: (double) y - RadiusX: (double) radX - RadiusY: (double) radY - XRotation: (double) xrot - LargeArc: (BOOL) largeArc - Clockwise: (BOOL) clockWise; + y: (double) y + radiusX: (double) radX + radiusY: (double) radY + xRotation: (double) xrot + largeArc: (BOOL) largeArc + clockwise: (BOOL) clockWise; - (CPath*) ellipticalArcToRelativeX: (double) x - Y: (double) y - RadiusX: (double) radX - RadiusY: (double) radY - XRotation: (double) xrot - LargeArc: (BOOL) largeArc - Clockwise: (BOOL) clockWise; + y: (double) y + radiusX: (double) radX + radiusY: (double) radY + xRotation: (double) xrot + largeArc: (BOOL) largeArc + clockwise: (BOOL) clockWise; +/** + * Appends a horizontal line to the current subpath. + */ - (CPath*) horizontalLineTo: (double) x; - (CPath*) horizontalLineToRelative: (double) x; -- (CPath*) lineToX: (double) x Y: (double) y; +- (CPath*) lineToX: (double) x y: (double) y; -- (CPath*) lineToRelativeX: (double) x Y: (double) y; +- (CPath*) lineToRelativeX: (double) x y: (double) y; -- (CPath*) moveToX: (double) x Y: (double) y; +- (CPath*) moveToX: (double) x y: (double) y; -- (CPath*)moveToRelativeX: (double) x Y: (double) y; +- (CPath*) moveToRelativeX: (double) x y: (double) y; - (CPath*) quadraticCurveToX: (double) x - Y: (double) y - X1: (double) x1 - Y1: (double) y1; + y: (double) y + x1: (double) x1 + y1: (double) y1; - (CPath*) quadraticCurveToRelativeX: (double) x - Y: (double) y - X1: (double) x1 - Y1: (double) y1; + y: (double) y + x1: (double) x1 + y1: (double) y1; - (CPath*) smoothCurveToX: (double) x - Y: (double) y - X2: (double) x2 - Y2: (double) y2; + y: (double) y + x2: (double) x2 + y2: (double) y2; - (CPath*) smoothCurveToRelativeX: (double) x - Y: (double) y - X2: (double) x2 - Y2: (double) y2; + y: (double) y + x2: (double) x2 + y2: (double) y2; -- (CPath*) smoothQuadraticCurveToX: (double) x Y: (double) y; +- (CPath*) smoothQuadraticCurveToX: (double) x y: (double) y; -- (CPath*) smoothQuadraticCurveToRelativeX: (double) x Y: (double) y; +- (CPath*) smoothQuadraticCurveToRelativeX: (double) x y: (double) y; +/** + * Appends a vertical line to the current subpath. + */ - (CPath*) verticalLineTo: (double) y; - (CPath*) verticalLineToRelative: (double) y; Modified: trunk/src/core/CPath.m =================================================================== --- trunk/src/core/CPath.m 2006-04-02 12:45:13 UTC (rev 337) +++ trunk/src/core/CPath.m 2006-04-02 13:21:39 UTC (rev 338) @@ -405,10 +405,10 @@ - (CPath*) arcToX: (double) x - Y: (double) y - TanX: (double) tanX - TanY: (double) tanY - Radius: (double) theRadius + y: (double) y + tanX: (double) tanX + tanY: (double) tanY + radius: (double) theRadius { // Get last subpath. CSubPath* last = nil; @@ -529,11 +529,11 @@ - (CPath*) curveToX: (double) x - Y: (double) y - X1: (double) x1 - Y1: (double) y1 - X2: (double) x2 - Y2: (double) y2 + y: (double) y + x1: (double) x1 + y1: (double) y1 + x2: (double) x2 + y2: (double) y2 { // Get last subpath. CSubPath* last = nil; @@ -555,11 +555,11 @@ - (CPath*) curveToRelativeX: (double) x - Y: (double) y - X1: (double) x1 - Y1: (double) y1 - X2: (double) x2 - Y2: (double) y2 + y: (double) y + x1: (double) x1 + y1: (double) y1 + x2: (double) x2 + y2: (double) y2 { // Get current point. CNode* current = [self currentPoint]; @@ -578,10 +578,12 @@ currY = [current y]; } - return [self - curveToX: currX + x Y: currY + y - X1: currX + x1 Y1: currY + y1 - X2: currX + x2 Y2: currY + y2]; + return [self curveToX: currX + x + y: currY + y + x1: currX + x1 + y1: currY + y1 + x2: currX + x2 + y2: currY + y2]; } - (CRect*) drawingArea @@ -606,12 +608,12 @@ - (CPath*) ellipticalArcToX: (double) x - Y: (double) y - RadiusX: (double) radX - RadiusY: (double) radY - XRotation: (double) xrot - LargeArc: (BOOL) largeArc - Clockwise: (BOOL) clockWise + y: (double) y + radiusX: (double) radX + radiusY: (double) radY + xRotation: (double) xrot + largeArc: (BOOL) largeArc + clockwise: (BOOL) clockWise { // Get current point. CNode* current = [self currentPoint]; @@ -716,11 +718,13 @@ int i; for( i = 0; i < segmentNumber; ++i ) { - [last - arcAroundX: centerX Y: centerY - Tan0: th0 + i * th_arc / segmentNumber Tan1: th0 + (i + 1) * th_arc / segmentNumber - RadiusX: radX RadiusY: radY - XRotation: xrot]; + [last arcAroundX: centerX + Y: centerY + Tan0: th0 + i * th_arc / segmentNumber + Tan1: th0 + (i + 1) * th_arc / segmentNumber + RadiusX: radX + RadiusY: radY + XRotation: xrot]; } return self; @@ -728,12 +732,12 @@ - (CPath*) ellipticalArcToRelativeX: (double) x - Y: (double) y - RadiusX: (double) radX - RadiusY: (double) radY - XRotation: (double) xrot - LargeArc: (BOOL) largeArc - Clockwise: (BOOL) clockWise + y: (double) y + radiusX: (double) radX + radiusY: (double) radY + xRotation: (double) xrot + largeArc: (BOOL) largeArc + clockwise: (BOOL) clockWise { // Get current point. CNode* current = [self currentPoint]; @@ -752,12 +756,13 @@ currY = [current y]; } - return [self - ellipticalArcToX: currX + x Y: currY + y - RadiusX: radX RadiusY: radY - XRotation: xrot - LargeArc: largeArc - Clockwise: clockWise]; + return [self ellipticalArcToX: currX + x + y: currY + y + radiusX: radX + radiusY: radY + xRotation: xrot + largeArc: largeArc + clockwise: clockWise]; } - (CPath*) horizontalLineTo: (double) x @@ -772,7 +777,7 @@ else currY = [current y]; - return [self lineToX: x Y: currY]; + return [self lineToX: x y: currY]; } - (CPath*) horizontalLineToRelative: (double) x @@ -794,10 +799,10 @@ currY = [current y]; } - return [self lineToX: currX + x Y: currY]; + return [self lineToX: currX + x y: currY]; } -- (CPath*) lineToX: (double) x Y: (double) y +- (CPath*) lineToX: (double) x y: (double) y { // Get last subpath. CSubPath* last = nil; @@ -817,7 +822,7 @@ return self; } -- (CPath*) lineToRelativeX: (double) x Y: (double) y +- (CPath*) lineToRelativeX: (double) x y: (double) y { // Get current point. CNode* current = [self currentPoint]; @@ -836,10 +841,10 @@ currY = [current y]; } - return [self lineToX: currX + x Y: currY + y]; + return [self lineToX: currX + x y: currY + y]; } -- (CPath*) moveToX: (double) x Y: (double) y; +- (CPath*) moveToX: (double) x y: (double) y; { // Get last subpath. CSubPath* last = nil; @@ -969,7 +974,7 @@ return NO; } -- (CPath*) moveToRelativeX: (double) x Y: (double) y +- (CPath*) moveToRelativeX: (double) x y: (double) y { // Get current point. CNode* current = [self currentPoint]; @@ -988,14 +993,14 @@ currY = [current y]; } - return [self moveToX: currX + x Y: currY + y]; + return [self moveToX: currX + x y: currY + y]; } - (CPath*) quadraticCurveToX: (double) x - Y: (double) y - X1: (double) x1 - Y1: (double) y1 + y: (double) y + x1: (double) x1 + y1: (double) y1 { // Perform degree elevation in order to abtain a cubic bezier. @@ -1021,14 +1026,19 @@ x1 = x0 + 2.0/3.0 * (x1 - x0); y1 = y0 + 2.0/3.0 * (y1 - y0); - return [self curveToX: x Y: y X1: x1 Y1: y1 X2: x2 Y2: y2]; + return [self curveToX: x + y: y + x1: x1 + y1: y1 + x2: x2 + y2: y2]; } - (CPath*) quadraticCurveToRelativeX: (double) x - Y: (double) y - X1: (double) x1 - Y1: (double) y1 + y: (double) y + x1: (double) x1 + y1: (double) y1 { // Get current point. CNode* current = [self currentPoint]; @@ -1047,16 +1057,17 @@ currY = [current y]; } - return [self - quadraticCurveToX: currX + x Y: currY + y - X1: currX + x1 Y1: currY + y1]; + return [self quadraticCurveToX: currX + x + y: currY + y + x1: currX + x1 + y1: currY + y1]; } - (CPath*) smoothCurveToX: (double) x - Y: (double) y - X2: (double) x2 - Y2: (double) y2 + y: (double) y + x2: (double) x2 + y2: (double) y2 { // Get last subpath. CSubPath* lastSubPath = nil; @@ -1106,14 +1117,19 @@ } } - return [self curveToX: x Y: y X1: x1 Y1: y1 X2: x2 Y2: y2]; + return [self curveToX: x + y: y + x1: x1 + y1: y1 + x2: x2 + y2: y2]; } - (CPath*) smoothCurveToRelativeX: (double) x - Y: (double) y - X2: (double) x2 - Y2: (double) y2 + y: (double) y + x2: (double) x2 + y2: (double) y2 { // Get current point. CNode* current = [self currentPoint]; @@ -1132,12 +1148,13 @@ currY = [current y]; } - return [self - smoothCurveToX: currX + x Y: currY + y - X2: currX + x2 Y2: currY + y2]; + return [self smoothCurveToX: currX + x + y: currY + y + x2: currX + x2 + y2: currY + y2]; } -- (CPath*) smoothQuadraticCurveToX: (double) x Y: (double) y +- (CPath*) smoothQuadraticCurveToX: (double) x y: (double) y { // Get last subpath. CSubPath* lastSubPath = nil; @@ -1187,10 +1204,13 @@ } } - return [self quadraticCurveToX: x Y: y X1: x1 Y1: y1]; + return [self quadraticCurveToX: x + y: y + x1: x1 + y1: y1]; } -- (CPath*) smoothQuadraticCurveToRelativeX: (double) x Y: (double) y +- (CPath*) smoothQuadraticCurveToRelativeX: (double) x y: (double) y { // Get current point. CNode* current = [self currentPoint]; @@ -1209,7 +1229,7 @@ currY = [current y]; } - return [self smoothQuadraticCurveToX: currX Y: currY + y]; + return [self smoothQuadraticCurveToX: currX y: currY + y]; } - (CPath*) verticalLineTo: (double) y @@ -1224,7 +1244,7 @@ else currX = [current x]; - return [self lineToX: currX Y: y]; + return [self lineToX: currX y: y]; } - (CPath*) verticalLineToRelative: (double) y @@ -1246,7 +1266,7 @@ currY = [current y]; } - return [self lineToX: currX Y: currY + y]; + return [self lineToX: currX y: currY + y]; } @end Modified: trunk/src/core/CPoint.h =================================================================== --- trunk/src/core/CPoint.h 2006-04-02 12:45:13 UTC (rev 337) +++ trunk/src/core/CPoint.h 2006-04-02 13:21:39 UTC (rev 338) @@ -32,16 +32,6 @@ + (CPoint*) pointWithX: (double) x y: (double) y; /** - * Returns the x coordinate. - */ -- (double) x; - -/** - * Returns the y coordinate. - */ -- (double) y; - -/** * Changes the node's position. */ - (void) moveToX: (double) x y: (double) y; @@ -61,4 +51,14 @@ */ - (double) squaredDistanceTo: (CPoint*) aPoint; +/** + * Returns the x coordinate. + */ +- (double) x; + +/** + * Returns the y coordinate. + */ +- (double) y; + @end Modified: trunk/src/core/CPoint.m =================================================================== --- trunk/src/core/CPoint.m 2006-04-02 12:45:13 UTC (rev 337) +++ trunk/src/core/CPoint.m 2006-04-02 13:21:39 UTC (rev 338) @@ -71,16 +71,6 @@ aNSPoint->y = m_y; } -- (double) x -{ - return m_x; -} - -- (double) y -{ - return m_y; -} - - (void) moveToX: (double) x y: (double) y { m_x = x; @@ -99,4 +89,14 @@ return [CGeometry squaredDistanceFromX: m_x y: m_y toX: [point x] y: [point y]]; } +- (double) x +{ + return m_x; +} + +- (double) y +{ + return m_y; +} + @end Modified: trunk/src/core/CSolidPaint.h =================================================================== --- trunk/src/core/CSolidPaint.h 2006-04-02 12:45:13 UTC (rev 337) +++ trunk/src/core/CSolidPaint.h 2006-04-02 13:21:39 UTC (rev 338) @@ -21,9 +21,19 @@ @interface CSolidPaint : CPaint { + /** + * The solid color. + */ CGColorRef m_color; } +/** + * Returns the solid color. + */ - (CGColorRef) color; + +/** + * Sets the solid color. + */ - (void) setColor: (CGColorRef) theColor; @end Modified: trunk/src/io/pdf/CPdfImport.m =================================================================== --- trunk/src/io/pdf/CPdfImport.m 2006-04-02 12:45:13 UTC (rev 337) +++ trunk/src/io/pdf/CPdfImport.m 2006-04-02 13:21:39 UTC (rev 338) @@ -279,7 +279,12 @@ // Perform operation. CPath* path = getLastChlorPath(); - [path curveToX: x[ 2 ] Y: y[ 2 ] X1: x[ 0 ] Y1: y[ 0 ] X2: x[ 1 ] Y2: y[ 1 ]]; + [path curveToX: x[ 2 ] + y: y[ 2 ] + x1: x[ 0 ] + y1: y[ 0 ] + x2: x[ 1 ] + y2: y[ 1 ]]; } // PDF operator "d": line dash pattern. @@ -474,7 +479,7 @@ // Perform operation. CPath* path = getLastChlorPath(); - [path lineToX: x Y: y]; + [path lineToX: x y: y]; } // PDF operator "M": miter limit. @@ -501,7 +506,7 @@ // Perform operation. CPath* path = getLastChlorPath(); - [path moveToX: x Y: y]; + [path moveToX: x y: y]; } // PDF operator "n": close path. Modified: trunk/src/io/svg/CSvgImport.m =================================================================== --- trunk/src/io/svg/CSvgImport.m 2006-04-02 12:45:13 UTC (rev 337) +++ trunk/src/io/svg/CSvgImport.m 2006-04-02 13:21:39 UTC (rev 338) @@ -820,14 +820,14 @@ [scanner scanDouble: &x[ 0 ]]; [scanner scanString: @"," intoString: NULL]; [scanner scanDouble: &y[ 0 ]]; - [theCPath moveToX: x[ 0 ] Y: y[ 0 ]]; + [theCPath moveToX: x[ 0 ] y: y[ 0 ]]; // Subsequent coordinates are treated as LineTo. while( [scanner scanDouble: &x[ 0 ]] ) { [scanner scanString: @"," intoString: NULL]; [scanner scanDouble: &y[ 0 ]]; - [theCPath lineToX: x[ 0 ] Y: y[ 0 ]]; + [theCPath lineToX: x[ 0 ] y: y[ 0 ]]; } } // Got a relative SVG MoveTo ("m") @@ -836,14 +836,14 @@ [scanner scanDouble: &x[ 0 ]]; [scanner scanString: @"," intoString: NULL]; [scanner scanDouble: &y[ 0 ]]; - [theCPath moveToRelativeX: x[ 0 ] Y: y[ 0 ]]; + [theCPath moveToRelativeX: x[ 0 ] y: y[ 0 ]]; // Subsequent coordinates are treated as LineTo. while( [scanner scanDouble: &x[ 0 ]] ) { [scanner scanString: @"," intoString: NULL]; [scanner scanDouble: &y[ 0 ]]; - [theCPath lineToRelativeX: x[ 0 ] Y: y[ 0 ]]; + [theCPath lineToRelativeX: x[ 0 ] y: y[ 0 ]]; } } // Got an absoluteSVG LineTo ("L") @@ -853,7 +853,7 @@ { [scanner scanString: @"," intoString: NULL]; [scanner scanDouble: &y[ 0 ]]; - [theCPath lineToX: x[ 0 ] Y: y[ 0 ]]; + [theCPath lineToX: x[ 0 ] y: y[ 0 ]]; } } // Got a relative SVG LineTo ("l") @@ -863,7 +863,7 @@ { [scanner scanString: @"," intoString: NULL]; [scanner scanDouble: &y[ 0 ]]; - [theCPath lineToRelativeX: x[ 0 ] Y: y[ 0 ]]; + [theCPath lineToRelativeX: x[ 0 ] y: y[ 0 ]]; } } // Got an absolute SVG CurveTo ("C") @@ -879,10 +879,13 @@ [scanner scanDouble: &x[ 2 ]]; [scanner scanString: @"," intoString: NULL]; [scanner scanDouble: &y[ 2 ]]; - [theCPath - curveToX: x[ 2 ] Y: y[ 2 ] - X1: x[ 0 ] Y1: y[ 0 ] - X2: x[ 1 ] Y2: y[ 1 ]]; + + [theCPath curveToX: x[ 2 ] + y: y[ 2 ] + x1: x[ 0 ] + y1: y[ 0 ] + x2: x[ 1 ] + y2: y[ 1 ]]; } } // Got a relative SVG CurveTo ("c") @@ -898,10 +901,13 @@ [scanner scanDouble: &x[ 2 ]]; [scanner scanString: @"," intoString: NULL]; [scanner scanDouble: &y[ 2 ]]; - [theCPath - curveToRelativeX: x[ 2 ] Y: y[ 2 ] - X1: x[ 0 ] Y1: y[ 0 ] - X2: x[ 1 ] Y2: y[ 1 ]]; + + [theCPath curveToRelativeX: x[ 2 ] + y: y[ 2 ] + x1: x[ 0 ] + y1: y[ 0 ] + x2: x[ 1 ] + y2: y[ 1 ]]; } } // Got an absolute SVG Smooth CurveTo ("S") @@ -914,9 +920,11 @@ [scanner scanDouble: &x[ 2 ]]; [scanner scanString: @"," intoString: NULL]; [scanner scanDouble: &y[ 2 ]]; - [theCPath - smoothCurveToX: x[ 2 ] Y: y[ 2 ] - X2: x[ 1 ] Y2: y[ 1 ]]; + + [theCPath smoothCurveToX: x[ 2 ] + y: y[ 2 ] + x2: x[ 1 ] + y2: y[ 1 ]]; } } // Got a relative SVG Smooth CurveTo ("s") @@ -929,9 +937,11 @@ [scanner scanDouble: &x[ 2 ]]; [scanner scanString: @"," intoString: NULL]; [scanner scanDouble: &y[ 2 ]]; - [theCPath - smoothCurveToRelativeX: x[ 2 ] Y: y[ 2 ] - X2: x[ 1 ] Y2: y[ 1 ]]; + + [theCPath smoothCurveToRelativeX: x[ 2 ] + y: y[ 2 ] + x2: x[ 1 ] + y2: y[ 1 ]]; } } // Got a SVG closePath ("Z"/"z"). @@ -975,9 +985,11 @@ [scanner scanDouble: &x[ 2 ]]; [scanner scanString: @"," intoString: NULL]; [scanner scanDouble: &y[ 2 ]]; - [theCPath - quadraticCurveToX: x[ 2 ] Y: y[ 2 ] - X1: x[ 1 ] Y1: y[ 1 ]]; + + [theCPath quadraticCurveToX: x[ 2 ] + y: y[ 2 ] + x1: x[ 1 ] + y1: y[ 1 ]]; } } // Got a SVG relative Quadratic CurveTo ("q") @@ -990,9 +1002,11 @@ [scanner scanDouble: &x[ 2 ]]; [scanner scanString: @"," intoString: NULL]; [scanner scanDouble: &y[ 2 ]]; - [theCPath - quadraticCurveToRelativeX: x[ 2 ] Y: y[ 2 ] - X1: x[ 1 ] Y1: y[ 1 ]]; + + [theCPath quadraticCurveToRelativeX: x[ 2 ] + y: y[ 2 ] + x1: x[ 1 ] + y1: y[ 1 ]]; } } // Got a SVG absolute Smooth Quadratic CurveTo ("T") @@ -1002,8 +1016,8 @@ { [scanner scanString: @"," intoString: NULL]; [scanner scanDouble: &y[ 2 ]]; - [theCPath - smoothQuadraticCurveToX: x[ 2 ] Y: y[ 2 ]]; + + [theCPath smoothQuadraticCurveToX: x[ 2 ] y: y[ 2 ]]; } } // Got a SVG relative Smooth Quadratic CurveTo ("t") @@ -1013,8 +1027,8 @@ { [scanner scanString: @"," intoString: NULL]; [scanner scanDouble: &y[ 2 ]]; - [theCPath - smoothQuadraticCurveToRelativeX: x[ 2 ] Y: y[ 2 ]]; + + [theCPath smoothQuadraticCurveToRelativeX: x[ 2 ] y: y[ 2 ]]; } } // Got a SVG absolute Elliptical Arc ("A") @@ -1038,12 +1052,13 @@ [scanner scanString: @"," intoString: NULL]; [scanner scanDouble: &y[ 2 ]]; - [theCPath - ellipticalArcToX: x[ 2 ] Y: y[ 2 ] - RadiusX: x[ 0 ] RadiusY: y[ 0 ] - XRotation: x[ 1 ] - LargeArc: flag1 > 0 - Clockwise: flag2 > 0]; + [theCPath ellipticalArcToX: x[ 2 ] + y: y[ 2 ] + radiusX: x[ 0 ] + radiusY: y[ 0 ] + xRotation: x[ 1 ] + largeArc: flag1 > 0 + clockwise: flag2 > 0]; } } // Got a SVG relative Elliptical Arc ("a") @@ -1067,12 +1082,13 @@ [scanner scanString: @"," intoString: NULL]; [scanner scanDouble: &y[ 2 ]]; - [theCPath - ellipticalArcToRelativeX: x[ 2 ] Y: y[ 2 ] - RadiusX: x[ 0 ] RadiusY: y[ 0 ] - XRotation: x[ 1 ] - LargeArc: flag1 > 0 - Clockwise: flag2 > 0]; + [theCPath ellipticalArcToRelativeX: x[ 2 ] + y: y[ 2 ] + radiusX: x[ 0 ] + radiusY: y[ 0 ] + xRotation: x[ 1 ] + largeArc: flag1 > 0 + clockwise: flag2 > 0]; } } else break; @@ -1175,8 +1191,8 @@ // Create Chlor path. CPath* path = [[CPath alloc] init]; - [path moveToX: x1 Y: y1]; - [path lineToX: x2 Y: y2]; + [path moveToX: x1 y: y1]; + [path lineToX: x2 y: y2]; // Add path to parent group. [theCGroup add: path]; @@ -1206,7 +1222,7 @@ [scanner scanDouble: &x]; [scanner scanString: @"," intoString: NULL]; [scanner scanDouble: &y]; - [path moveToX: x Y: y]; + [path moveToX: x y: y]; [scanner scanString: @"," intoString: NULL]; while( [scanner isAtEnd] == NO ) @@ -1214,7 +1230,7 @@ [scanner scanDouble: &x]; [scanner scanString: @"," intoString: NULL]; [scanner scanDouble: &y]; - [path lineToX: x Y: y]; + [path lineToX: x y: y]; [scanner scanString: @"," intoString: NULL]; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |