Archived
1

Fundamental Redesign of the View and Controller

This commit is contained in:
Kim Wittenburg
2014-08-22 00:54:13 +02:00
parent a37d587e1f
commit c024886241
12 changed files with 255 additions and 150 deletions

View File

@@ -27,32 +27,63 @@
return [[self alloc] initWithPath:path parent:parent];
}
#pragma mark Properties
- (MPFunction *)function
- (instancetype)initWithPath:(NSIndexPath *)path
parent:(MPLayout *)parent
{
return [self.expressionStorage elementAtIndexPath:self.path];
self = [super initWithPath:path
parent:parent];
if (self) {
_function = [parent.expressionStorage elementAtIndexPath:path];
}
return self;
}
#pragma mark Properties
//- (MPFunction *)function
//{
// return [self.expressionStorage elementAtIndexPath:self.path];
//}
#pragma mark Cache Methods
- (CTLineRef)lineForPrivateCacheIndex:(NSUInteger)index
generator:(CTLineRef (^)())generator
{
NSUInteger actualIndex = self.function.numberOfChildren + index;
id (^actualGenerator)() = ^{
CTLineRef line = generator();
return CFBridgingRelease(line);
};
id lineObject = [self cachableObjectForIndex:actualIndex
generator:actualGenerator];
return (__bridge CTLineRef)(lineObject);
}
- (MPLayout *)childLayoutAtIndex:(NSUInteger)index
{
return [self cachableObjectForIndex:index generator:^id{
NSIndexPath *childPath = [self.path indexPathByAddingIndex:index];
NSIndexPath *childPath = [self.function.indexPath indexPathByAddingIndex:index];
MPExpressionLayout *layout = [[MPExpressionLayout alloc] initWithPath:childPath
parent:self];
return layout;
}];
}
#pragma mark Size and Drawing Methods
- (NSSize)sizeForChildAtIndex:(NSUInteger)index
{
MPLayout *childLayout = [self childLayoutAtIndex:index];
return [childLayout size];
}
- (NSBezierPath *)generateBezierPath
- (NSSize)generateSize
{
return [NSBezierPath bezierPath];
return NSZeroSize;
}
- (void)drawAtPoint:(NSPoint)point
{
}
@end