Added missing methods and changed the ivars.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@8717 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Fred Kiefer 2001-01-20 17:40:43 +00:00
parent 69e71a4f06
commit bb882afc06

View file

@ -27,169 +27,134 @@
#ifndef BEZIERPATH_H
#define BEZIERPATH_H
#import <Foundation/Foundation.h>
#import <AppKit/NSFont.h>
#include <Foundation/Foundation.h>
#include <AppKit/NSFont.h>
@class NSAffineTransform;
@class NSImage;
typedef enum {
NSButtLineCapStyle = 0,
NSRoundLineCapStyle = 1,
NSSquareLineCapStyle = 2
NSButtLineCapStyle = 0,
NSRoundLineCapStyle = 1,
NSSquareLineCapStyle = 2
} NSLineCapStyle;
typedef enum {
NSMiterLineJoinStyle = 0,
NSRoundLineJoinStyle = 1,
NSBevelLineJoinStyle = 2
NSMiterLineJoinStyle = 0,
NSRoundLineJoinStyle = 1,
NSBevelLineJoinStyle = 2
} NSLineJoinStyle;
typedef enum {
NSNonZeroWindingRule,
NSEvenOddWindingRule
NSNonZeroWindingRule,
NSEvenOddWindingRule
} NSWindingRule;
typedef enum {
NSMoveToBezierPathElement,
NSLineToBezierPathElement,
NSCurveToBezierPathElement,
NSClosePathBezierPathElement
NSMoveToBezierPathElement,
NSLineToBezierPathElement,
NSCurveToBezierPathElement,
NSClosePathBezierPathElement
} NSBezierPathElement;
@interface NSBezierPath : NSObject <NSCopying, NSCoding>
{
@private
int _state;
int _segmentCount;
int _segmentMax;
// struct PATHSEGMENT *_head;
int _lastSubpathIndex;
int _elementCount;
BOOL _isFlat;
NSWindingRule _windingRule;
NSLineCapStyle _lineCapStyle;
NSLineJoinStyle _lineJoinStyle;
float _lineWidth;
NSRect _bounds;
BOOL _shouldRecalculateBounds;
NSRect _controlPointBounds;
BOOL _shouldRecalculateControlPointBounds;
BOOL _cachesBezierPath;
BOOL _shouldRecacheUserPath;
// int _dpsUserPath;
@private
NSWindingRule _windingRule;
NSLineCapStyle _lineCapStyle;
NSLineJoinStyle _lineJoinStyle;
float _lineWidth;
float _flatness;
float _miterLimit;
BOOL _shouldRecalculateBounds;
NSRect _bounds;
NSRect _controlPointBounds;
BOOL _cachesBezierPath;
NSImage *_cacheImage;
}
//
// Creating common paths
//
+ (NSBezierPath *)bezierPath;
+ (NSBezierPath *)bezierPathWithRect:(NSRect)aRect;
+ (NSBezierPath *)bezierPathWithOvalInRect:(NSRect)rect;
//
// Immediate mode drawing of common paths
//
+ (void)fillRect:(NSRect)rect;
+ (void)strokeRect:(NSRect)rect;
+ (void)clipRect:(NSRect)rect;
+ (void)strokeLineFromPoint:(NSPoint)point1 toPoint:(NSPoint)point2;
+ (void)drawPackedGlyphs:(const char *)packedGlyphs atPoint:(NSPoint)point;
//
// Default path rendering parameters
//
+ (void)setDefaultMiterLimit:(float)limit;
+ (float)defaultMiterLimit;
+ (void)setDefaultFlatness:(float)flatness;
+ (float)defaultFlatness;
+ (void)setDefaultWindingRule:(NSWindingRule)windingRule;
+ (NSWindingRule)defaultWindingRule;
+ (void)setDefaultLineCapStyle:(NSLineCapStyle)lineCapStyle;
+ (NSLineCapStyle)defaultLineCapStyle;
+ (void)setDefaultLineJoinStyle:(NSLineJoinStyle)lineJoinStyle;
+ (NSLineJoinStyle)defaultLineJoinStyle;
+ (void)setDefaultLineWidth:(float)lineWidth;
+ (float)defaultLineWidth;
//
// Path construction
//
- (void)moveToPoint:(NSPoint)aPoint;
- (void)lineToPoint:(NSPoint)aPoint;
- (void)curveToPoint:(NSPoint)aPoint
controlPoint1:(NSPoint)controlPoint1
controlPoint2:(NSPoint)controlPoint2;
controlPoint1:(NSPoint)controlPoint1
controlPoint2:(NSPoint)controlPoint2;
- (void)closePath;
- (void)removeAllPoints;
//
// Relative path construction
//
- (void)relativeMoveToPoint:(NSPoint)aPoint;
- (void)relativeLineToPoint:(NSPoint)aPoint;
- (void)relativeCurveToPoint:(NSPoint)aPoint
controlPoint1:(NSPoint)controlPoint1
controlPoint2:(NSPoint)controlPoint2;
controlPoint1:(NSPoint)controlPoint1
controlPoint2:(NSPoint)controlPoint2;
//
// Path rendering parameters
//
- (float)lineWidth;
- (void)setLineWidth:(float)lineWidth;
- (NSLineCapStyle)lineCapStyle;
- (void)setLineCapStyle:(NSLineCapStyle)lineCapStyle;
- (NSLineJoinStyle)lineJoinStyle;
- (void)setLineJoinStyle:(NSLineJoinStyle)lineJoinStyle;
- (NSWindingRule)windingRule;
- (void)setWindingRule:(NSWindingRule)windingRule;
- (void)setFlatness:(float)flatness;
- (float)flatness;
- (void)setMiterLimit:(float)limit;
- (float)miterLimit;
- (void)getLineDash:(float *)pattern count:(int *)count phase:(float *)phase;
- (void)setLineDash:(const float *)pattern count:(int)count phase:(float)phase;
//
// Path operations
//
- (void)stroke;
- (void)fill;
- (void)addClip;
- (void)setClip;
//
// Path modifications.
//
- (NSBezierPath *)bezierPathByFlatteningPath;
- (NSBezierPath *)bezierPathByReversingPath;
//
@ -201,64 +166,42 @@ typedef enum {
// Path info
//
- (BOOL)isEmpty;
- (NSPoint)currentPoint;
- (NSRect)controlPointBounds;
- (NSRect)bounds;
//
// Elements
//
- (int)elementCount;
- (NSBezierPathElement)elementAtIndex:(int)index
associatedPoints:(NSPoint *)points;
//- (NSBezierPathElement)elementAtIndex:(int)index
// associatedPoints:(NSPointArray)points;
associatedPoints:(NSPoint *)points;
- (NSBezierPathElement)elementAtIndex:(int)index;
- (void)setAssociatedPoints:(NSPoint *)points atIndex:(int)index;
//- (void)setAssociatedPoints:(NSPointArray)points atIndex:(int)index;
//
// Appending common paths
//
- (void)appendBezierPath:(NSBezierPath *)path;
- (void)appendBezierPathWithRect:(NSRect)rect;
- (void)appendBezierPathWithPoints:(NSPoint *)points count:(int)count;
//- (void)appendBezierPathWithPoints:(NSPointArray)points count:(int)count;
- (void)appendBezierPathWithOvalInRect:(NSRect)aRect;
- (void)appendBezierPathWithArcWithCenter:(NSPoint)center
radius:(float)radius
startAngle:(float)startAngle
endAngle:(float)endAngle
clockwise:(BOOL)clockwise;
radius:(float)radius
startAngle:(float)startAngle
endAngle:(float)endAngle
clockwise:(BOOL)clockwise;
- (void)appendBezierPathWithArcWithCenter:(NSPoint)center
radius:(float)radius
startAngle:(float)startAngle
endAngle:(float)endAngle;
radius:(float)radius
startAngle:(float)startAngle
endAngle:(float)endAngle;
- (void)appendBezierPathWithArcFromPoint:(NSPoint)point1
toPoint:(NSPoint)point2
radius:(float)radius;
toPoint:(NSPoint)point2
radius:(float)radius;
- (void)appendBezierPathWithGlyph:(NSGlyph)glyph inFont:(NSFont *)font;
- (void)appendBezierPathWithGlyphs:(NSGlyph *)glyphs
count:(int)count
inFont:(NSFont *)font;
count:(int)count
inFont:(NSFont *)font;
- (void)appendBezierPathWithPackedGlyphs:(const char *)packedGlyphs;
//
@ -270,7 +213,6 @@ typedef enum {
// Caching
//
- (BOOL)cachesBezierPath;
- (void)setCachesBezierPath:(BOOL)flag;
@end