forked from IconJar/IJSVG
-
Notifications
You must be signed in to change notification settings - Fork 0
/
IJSVGCommand.h
63 lines (51 loc) · 1.79 KB
/
IJSVGCommand.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
62
63
//
// IJSVGCommand.h
// IconJar
//
// Created by Curtis Hard on 30/08/2014.
// Copyright (c) 2014 Curtis Hard. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "IJSVGPath.h"
typedef NS_ENUM( NSInteger, IJSVGCommandType ) {
IJSVGCommandTypeAbsolute,
IJSVGCommandTypeRelative
};
@class IJSVGCommand;
@protocol IJSVGCommandProtocol <NSObject>
@required
+ (void)runWithParams:(CGFloat *)params
paramCount:(NSInteger)count
previousCommand:(IJSVGCommand *)command
type:(IJSVGCommandType)type
path:(IJSVGPath *)path;
+ (NSInteger)requiredParameterCount;
@end
@interface IJSVGCommand : NSObject {
NSString * commandString;
NSString * string;
NSString * command;
CGFloat * parameters;
NSInteger parameterCount;
NSMutableArray * subCommands;
NSInteger requiredParameters;
IJSVGCommandType type;
IJSVGCommand * previousCommand;
Class<IJSVGCommandProtocol> commandClass;
}
@property ( nonatomic, copy ) NSString * string;
@property ( nonatomic, copy ) NSString * commandString;
@property ( nonatomic, copy ) NSString * command;
@property ( nonatomic, assign ) CGFloat * parameters;
@property ( nonatomic, assign ) NSInteger parameterCount;
@property ( nonatomic, assign ) NSInteger requiredParameters;
@property ( nonatomic, assign ) IJSVGCommandType type;
@property ( nonatomic, retain ) NSMutableArray * subCommands;
@property ( nonatomic, assign ) Class<IJSVGCommandProtocol> commandClass;
@property ( nonatomic, assign ) IJSVGCommand * previousCommand;
- (id)initWithCommandString:(NSString *)commandString;
+ (void)registerClass:(Class)aClass
forCommand:(NSString *)command;
+ (NSDictionary *)registeredCommandClasses;
+ (Class<IJSVGCommandProtocol>)commandClassForCommandLetter:(NSString *)str;
@end