-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathETStrokeDash.h
61 lines (45 loc) · 1.63 KB
/
ETStrokeDash.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
//
// ETStrokeDash.h
/// DrawKit ©2005-2008 Apptree.net
//
// Created by graham on 10/09/2006.
///
/// This software is released subject to licensing conditions as detailed in DRAWKIT-LICENSING.TXT, which must accompany this source file.
//
#import <Cocoa/Cocoa.h>
@interface ETStrokeDash : NSObject <NSCoding, NSCopying>
{
@private
float m_pattern[8];
float m_phase;
unsigned m_count;
BOOL m_scaleToLineWidth;
}
+ (ETStrokeDash*) defaultDash;
+ (ETStrokeDash*) dashWithPattern:(float[]) dashes count:(int) count;
+ (ETStrokeDash*) dashWithName:(NSString*) name;
+ (void) registerDash:(ETStrokeDash*) dash withName:(NSString*) name;
+ (NSArray*) registeredDashes;
+ (ETStrokeDash*) equallySpacedDashToFitSize:(NSSize) aSize dashLength:(float) len;
+ (void) saveDefaults;
+ (void) loadDefaults;
- (id) initWithPattern:(float[]) dashes count:(int) count;
- (void) setDashPattern:(float[]) dashes count:(int) count;
- (void) getDashPattern:(float[]) dashes count:(int*) count;
- (int) count;
- (void) setPhase:(float) ph;
- (float) phase;
- (float) length;
- (void) setScalesToLineWidth:(BOOL) stlw;
- (BOOL) scalesToLineWidth;
- (void) applyToPath:(NSBezierPath*) path;
- (void) applyToPath:(NSBezierPath*) path withPhase:(float) phase;
- (NSString*) styleScript;
- (NSImage*) dashSwatchImageWithSize:(NSSize) size strokeWidth:(float) width;
- (NSImage*) standardDashSwatchImage;
@end
/*
This stores a particular dash pattern for stroking an NSBezierPath, and can be owned by a ETStroke.
*/
#define kETStandardDashSwatchImageSize (NSMakeSize( 80.0, 4.0 ))
#define kETStandardDashSwatchStrokeWidth 2.0