@@ -11,44 +11,42 @@ * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ -#import "OFDimensionValue.h" +#import "OFSizeValue.h" #import "OFMethodSignature.h" #import "OFString.h" #import "OFOutOfRangeException.h" -@implementation OFDimensionValue -@synthesize dimensionValue = _dimension; +@implementation OFSizeValue +@synthesize sizeValue = _size; -- (instancetype)initWithDimension: (of_dimension_t)dimension +- (instancetype)initWithSize: (OFSize)size { self = [super init]; - _dimension = dimension; + _size = size; return self; } - (const char *)objCType { - return @encode(of_dimension_t); + return @encode(OFSize); } -- (void)getValue: (void *)value - size: (size_t)size +- (void)getValue: (void *)value size: (size_t)size { - if (size != sizeof(_dimension)) + if (size != sizeof(_size)) @throw [OFOutOfRangeException exception]; - memcpy(value, &_dimension, sizeof(_dimension)); + memcpy(value, &_size, sizeof(_size)); } - (OFString *)description { return [OFString stringWithFormat: - @"", - _dimension.width, _dimension.height]; + @"", _size.width, _size.height]; } @end