Archived
1

Improved Model

Added Keyboard Selection Support
Added Mouse Selection Support
Added Keyboard Editing Support
Corrected Some Bugs
Abstracted the Layout System further
Added Functions Button (test)
This commit is contained in:
Kim Wittenburg
2014-08-31 15:41:17 +02:00
parent 9aa4bca234
commit 4a3ea0cede
23 changed files with 885 additions and 262 deletions

View File

@@ -15,11 +15,17 @@
#pragma mark Creation Methods
- (instancetype)init;
- (instancetype)initWithPath:(NSIndexPath *)path
parent:(MPLayout *)parent;
- (instancetype)initWithElementAtPath:(NSIndexPath *)path
inRootExpression:(MPExpression *)rootExpression
parent:(MPLayout *)parent;
#pragma mark Text System Objects
@property (readonly, nonatomic, weak) MPExpressionStorage *expressionStorage;
#pragma mark Properties
- (NSFont *)font;
- (CGFloat)fontSize;
- (NSFont *)normalFont;
- (CGFloat)normalFontSize;
- (NSFont *)smallFont;
- (CGFloat)smallFontSize;
#pragma mark Cache Tree
@property (readonly, nonatomic, weak) MPLayout *parent;
@@ -35,14 +41,21 @@
- (void)invalidate;
#pragma mark Calculation and Drawing Methods
// TODO: Implement Small Size
// @property (nonatomic) BOOL usesSmallSize;
- (NSSize)size;
@property (nonatomic, getter = isFlipped) BOOL flipped;
@property (nonatomic) BOOL usesSmallSize;
- (NSRect)bounds;
- (NSRect)boundingRectForRangePath:(MPRangePath *)rangePath; /* if rangePath.length is 0 the returned rect will have a width of 0 */
- (void)drawAtPoint:(NSPoint)point;
@end
@interface MPLayout (MPSubclassImplement)
- (MPLayout *)childLayoutAtIndex:(NSUInteger)index; // To be implemented
- (NSSize)generateSize; // To be implemented
- (NSRect)generateBounds; // To be implemented
- (NSRect)boundingRectForRange:(NSRange)range; // To be implemented, use rangePath instead, this one has wrong origin
- (NSPoint)offsetOfChildLayoutAtIndex:(NSUInteger)index;
- (NSIndexPath *)indexPathForMousePoint:(NSPoint)point;
- (void)draw; // To be implemented
@end