Add improvements

- Remove defaults for ASEnvironmentLayoutOptionsState and ASEnvironmentHierarchyState
- Add locking for ASEnvironmentLayoutExtensibilityForwarding
- Other smaller improvements
This commit is contained in:
Michael Schneider
2016-03-31 10:30:43 -07:00
parent 4e757f0969
commit f46f5640ff
6 changed files with 23 additions and 22 deletions

View File

@@ -231,30 +231,39 @@ extern void ASLayoutableClearCurrentContext();
#define ASEnvironmentLayoutExtensibilityForwarding \
- (void)setLayoutOptionExtensionBool:(BOOL)value atIndex:(int)idx\
{\
_propertyLock.lock();\
_ASEnvironmentLayoutOptionsExtensionSetBoolAtIndex(self, idx, value);\
_propertyLock.unlock();\
}\
\
- (BOOL)layoutOptionExtensionBoolAtIndex:(int)idx\
{\
ASDN::MutexLocker l(_propertyLock);\
return _ASEnvironmentLayoutOptionsExtensionGetBoolAtIndex(self, idx);\
}\
\
- (void)setLayoutOptionExtensionInteger:(NSInteger)value atIndex:(int)idx\
{\
_propertyLock.lock();\
_ASEnvironmentLayoutOptionsExtensionSetIntegerAtIndex(self, idx, value);\
_propertyLock.unlock();\
}\
\
- (NSInteger)layoutOptionExtensionIntegerAtIndex:(int)idx\
{\
ASDN::MutexLocker l(_propertyLock);\
return _ASEnvironmentLayoutOptionsExtensionGetIntegerAtIndex(self, idx);\
}\
\
- (void)setLayoutOptionExtensionEdgeInsets:(UIEdgeInsets)value atIndex:(int)idx\
{\
_propertyLock.lock();\
_ASEnvironmentLayoutOptionsExtensionSetEdgeInsetsAtIndex(self, idx, value);\
_propertyLock.unlock();\
}\
\
- (UIEdgeInsets)layoutOptionExtensionEdgeInsetsAtIndex:(int)idx\
{\
ASDN::MutexLocker l(_propertyLock);\
return _ASEnvironmentLayoutOptionsExtensionGetEdgeInsetsAtIndex(self, idx);\
}\