f UIKit
+C UIBarStyleDefault 0
+C UIBarStyleBlack 1
+C UIBarStyleBlackOpaque 2
+C UIBarStyleBlackTranslucent 3
+
+C UIDataDetectorTypePhoneNumber (1<<0)
+C UIDataDetectorTypeLink (1<<1)
+C UIDataDetectorTypeNone 0
+# XXX: NSUIntegerMax
+C UIDataDetectorTypeAll -1
+
+# UINavigationBar
+
+# UINavigationController
+
+V UINavigationControllerHideShowBarDuration f
+
+# UINavigationControllerDelegate
+
+: navigationController:willShowViewController:animated: v20@0:4@8@12B16
+: navigationController:didShowViewController:animated: v20@0:4@8@12B16
+
+# UIScrollView
+
+C UIScrollViewIndicatorStyleDefault 0
+C UIScrollViewIndicatorStyleBlack 1
+C UIScrollViewIndicatorStyleWhite 2
+
+V UIScrollViewDecelerationRateNormal f
+V UIScrollViewDecelerationRateFast f
+
+# UIScrollViewDelegate
+
+: scrollViewDidScroll: v12@0:4@8
+: scrollViewWillBeginDragging: v12@0:4@8
+: scrollViewDidEndDragging:willDecelerate: v16@0:4@8B12
+: scrollViewShouldScrollToTop: B12@0:4@8
+: scrollViewDidScrollToTop: v12@0:4@8
+: scrollViewWillBeginDecelerating: v12@0:4@8
+: scrollViewDidEndDecelerating: v12@0:4@8
+
+: viewForZoomingInScrollView: @12@0:4@8
+: scrollViewDidEndZooming:withView:atScale: v20@0:4@8@12f16
+
+: scrollViewDidEndScrollingAnimation: v12@0:4@8
+
+# UITabBar
+
+# UITabBarDelegate
+
+: tabBar:willBeginCustomizingItems: v16@0:4@8@12
+: tabBar:didBeginCustomizingItems: v16@0:4@8@12
+: tabBar:willBeginCustomizingItems:changed: v20@0:4@8@12B16
+: tabBar:didBeginCustomizingItems:changed: v20@0:4@8@12B16
+: tabBar:didSelectItem: v16@0:4@8@12
+
# UITableView
C UITableViewStylePlain 0
C UITableViewCellSeparatorStyleNone 0
C UITableViewCellSeparatorStyleSingleLine 1
+# UITableViewController
+
# UITableViewDataSource
: tableView:numberOfRowsInSection: i16@0:4@8i12
: tableView:canMoveRowAtIndexPath: B16@0:4@8@12
: tableView:moveRowAtIndexPath:toIndexPath: v20@0:4@8@12@16
+# UIToolbar
+
# UIView
C UIViewAnimationCurveEaseInOut 0
C UIViewAnimationTransitionCurlUp 3
C UIViewAnimationTransitionCurlDown 4
+# UIViewController
+
+C UIModalTransitionStyleCoverVertical 0
+C UIModalTransitionStyleFlipHorizontal 1
+C UIModalTransitionStyleCrossDissolve 2
+
# UIWebView
C UIWebViewNavigationTypeLinkClicked 0
: webViewDidFinishLoad: v12@0:4@8
: webView:didFailLoadWithError: v16@0:4@8@12
-# Miscellaneous
-
-F UIApplicationUseLegacyEvents vB
+# Functions
-F UIAccessibilityPostNotification vI@
F UIApplicationMain ii^^c@@
-F UIGraphicsEndImageContext v
-F UIGraphicsGetCurrentContext @
-F UIGraphicsGetImageFromCurrentImageContext @
-F UIGraphicsPopContext v
-F UIGraphicsPushContext v@
+
F UIImageJPEGRepresentation @@
F UIImagePNGRepresentation @@
F UIImageWriteToSavedPhotosAlbum v@@:^v
+F UISaveVideoAtPathToSavedPhotosAlbum v@@:^v
+F UIVideoAtPathIsCompatibleWithSavedPhotosAlbum B@
+
+F UIGraphicsGetCurrentContext @
+F UIGraphicsPushContext v@
+F UIGraphicsPopContext v
+F UIGraphicsBeginImageContext v{CGSize=ff}
+F UIGraphicsGetImageFromCurrentImageContext @
+F UIGraphicsEndImageContext v
+F UIRectClip v{CGRect={CGPoint=ff}{CGSize=ff}}
+F UIRectFill v{CGRect={CGPoint=ff}{CGSize=ff}}
+F UIRectFillUsingBlendMode v{CGRect={CGPoint=ff}{CGSize=ff}}i
+F UIRectFrame v{CGRect={CGPoint=ff}{CGSize=ff}}
+F UIRectFrameUsingBlendMode v{CGRect={CGPoint=ff}{CGSize=ff}}i
+
+F CGPointFromString {CGPoint=ff}@
+F CGRectFromString {CGRect={CGPoint=ff}{CGSize=ff}}@
+F CGSizeFromString {CGSize=ff}@
+F CGAffineTransformFromString {CGAffineTransform=ffffff}@
+F UIEdgeInsetsFromString {UIEdgeInsets=ffff}@
+F NSStringFromCGPoint @{CGPoint=ff}
+F NSStringFromCGRect @{CGRect={CGPoint=ff}{CGSize=ff}}
+F NSStringFromCGSize @{CGSize=ff}
+F NSStringFromCGAffineTransform @{CGAffineTransform=ffffff}
+F NSStringFromUIEdgeInsets @{UIEdgeInsets=ffff}
+
+F UIEdgeInsetsMake {UIEdgeInsets=ffff}ffff
+F UIEdgeInsetsEqualToEdgeInsets B{UIEdgeInsets=ffff}{UIEdgeInsets=ffff}
+F UIEdgeInsetsInsetRect {CGRect={CGPoint=ff}{CGSize=ff}}{CGRect={CGPoint=ff}{CGSize=ff}}{UIEdgeInsets=ffff}
+
+# XXX: UIInterfaceOrientationIsPortrait
+# XXX: UIInterfaceOrientationIsLandscape
+
+# XXX: UIDeviceOrientationIsValidInterfaceOrientation
+# XXX: UIDeviceOrientationIsPortrait
+# XXX: UIDeviceOrientationIsLandscape
+
+F UIAccessibilityPostNotification vI@
+
+# Miscellaneous
+
+F UIApplicationUseLegacyEvents vB
+
F UIKeyboardDisableAutomaticAppearance v
F UIKeyboardEnableAutomaticAppearance v
F UIKeyboardInputModeUsesKBStar B@
F CFShow v@
F CFShowStr v@
+f CoreGraphics
+
+# CGAffineTransform
+
+F CGAffineTransformMake {CGAffineTransform=ffffff}ffffff
+F CGAffineTransformMakeRotation {CGAffineTransform=ffffff}f
+F CGAffineTransformMakeScale {CGAffineTransform=ffffff}ff
+F CGAffineTransformMakeTranslation {CGAffineTransform=ffffff}ff
+
+F CGAffineTransformTranslate {CGAffineTransform=ffffff}{CGAffineTransform=ffffff}ff
+F CGAffineTransformScale {CGAffineTransform=ffffff}{CGAffineTransform=ffffff}ff
+F CGAffineTransformRotate {CGAffineTransform=ffffff}{CGAffineTransform=ffffff}f
+F CGAffineTransformInvert {CGAffineTransform=ffffff}{CGAffineTransform=ffffff}
+F CGAffineTransformConcat {CGAffineTransform=ffffff}{CGAffineTransform=ffffff}{CGAffineTransform=ffffff}
+
+F CGPointApplyAffineTransform {CGPoint=ff}{CGPoint=ff}{CGAffineTransform=ffffff}
+F CGSizeApplyAffineTransform {CGSize=ff}{CGSize=ff}{CGAffineTransform=ffffff}
+F CGRectApplyAffineTransform {CGRect={CGPoint=ff}{CGSize=ff}}{CGRect={CGPoint=ff}{CGSize=ff}}{CGAffineTransform=ffffff}
+
+F CGAffineTransformIsIdentity B{CGAffineTransform=ffffff}
+F CGAffineTransformEqualToTransform B{CGAffineTransform=ffffff}{CGAffineTransform=ffffff}
+
+S CGAffineTransform "a"f"b"f"c"f"d"f"tx"f"ty"f
+
+V CGAffineTransformIdentity {CGAffineTransform=ffffff}
+
f CoreLocation
V kCLLocationAccuracyBest d
return value;
}
-void Index_(Struct_privateData *internal, double number, ssize_t &index, uint8_t *&base) {
+bool Index_(apr_pool_t *pool, Struct_privateData *internal, JSStringRef property, ssize_t &index, uint8_t *&base) {
Type_privateData *typical(internal->type_);
+ size_t length;
+ const char *name(CYPoolCString(pool, property, &length));
+ double number(CYCastDouble(name, length));
+
+ if (std::isnan(number))
+ // XXX: implement!
+ return false;
+
index = static_cast<ssize_t>(number);
- if (index != number)
- @throw [NSException exceptionWithName:NSInvalidArgumentException reason:@"struct index non-integral" userInfo:nil];
- if (index < 0)
- @throw [NSException exceptionWithName:NSInvalidArgumentException reason:@"struct index negative" userInfo:nil];
+ if (index != number || index < 0 || static_cast<size_t>(index) >= typical->type_.data.signature.count)
+ return false;
base = reinterpret_cast<uint8_t *>(internal->value_);
for (ssize_t local(0); local != index; ++local)
- if (ffi_type *element = typical->ffi_.elements[local])
- base += element->size;
- else
- @throw [NSException exceptionWithName:NSInvalidArgumentException reason:@"struct index out-of-range" userInfo:nil];
+ base += typical->ffi_.elements[local]->size;
+
+ return true;
}
static JSValueRef Struct_getProperty(JSContextRef context, JSObjectRef object, JSStringRef property, JSValueRef *exception) {
Struct_privateData *internal(reinterpret_cast<Struct_privateData *>(JSObjectGetPrivate(object)));
Type_privateData *typical(internal->type_);
- size_t length;
- const char *name(CYPoolCString(pool, property, &length));
- double number(CYCastDouble(name, length));
-
- if (std::isnan(number)) {
- // XXX: implement!
- return NULL;
- }
-
ssize_t index;
uint8_t *base;
- Index_(internal, number, index, base);
+ if (!Index_(pool, internal, property, index, base))
+ return NULL;
return CYFromFFI(context, typical->type_.data.signature.elements[index].type, typical->ffi_.elements[index], base, object);
} CYCatch
Struct_privateData *internal(reinterpret_cast<Struct_privateData *>(JSObjectGetPrivate(object)));
Type_privateData *typical(internal->type_);
- size_t length;
- const char *name(CYPoolCString(pool, property, &length));
- double number(CYCastDouble(name, length));
-
- if (std::isnan(number)) {
- // XXX: implement!
- return false;
- }
-
ssize_t index;
uint8_t *base;
- Index_(internal, number, index, base);
+ if (!Index_(pool, internal, property, index, base))
+ return false;
CYPoolFFI(NULL, context, typical->type_.data.signature.elements[index].type, typical->ffi_.elements[index], base, value);
return true;