mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-04 14:24:53 +08:00
feat(spine-ios): Add Objective-C support to generated Swift bindings
- Add NSObject inheritance to root classes for ObjC compatibility - Add @objc(Spine<ClassName>) and @objcMembers annotations to all classes - Fix property name conflicts (className -> rttiClassName, hash -> hashString) - Use @nonobjc on subclass initializers to avoid selector conflicts - Fix convenience init override modifiers - Update ObjC example to use new API method names - Update test to use rttiClassName property
This commit is contained in:
parent
81c9f5630a
commit
cb62bd70c0
@ -42,7 +42,7 @@
|
||||
self = [super init];
|
||||
if (self) {
|
||||
self.spineController = [[SpineController alloc] initOnInitialized:^(SpineController *controller) {
|
||||
[controller.animationState setAnimationByNameWithTrackIndex:0 animationName:@"walk" loop:YES];
|
||||
[controller.animationState setAnimation:0 :@"walk" :YES];
|
||||
}
|
||||
onBeforeUpdateWorldTransforms:nil
|
||||
onAfterUpdateWorldTransforms:nil
|
||||
@ -60,8 +60,8 @@
|
||||
skeletonFileName:@"spineboy-pro.skel"
|
||||
bundle:[NSBundle mainBundle]
|
||||
controller:self.spineController
|
||||
mode:ContentModeFit
|
||||
alignment:AlignmentCenter
|
||||
mode:SpineContentModeFit
|
||||
alignment:SpineAlignmentCenter
|
||||
boundsProvider:[[SpineSetupPoseBounds alloc] init]
|
||||
backgroundColor:[UIColor clearColor]];
|
||||
spineView.frame = self.view.bounds;
|
||||
|
||||
@ -33,11 +33,14 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// Animation wrapper
|
||||
public class Animation {
|
||||
@objc(SpineAnimation)
|
||||
@objcMembers
|
||||
public class Animation: NSObject {
|
||||
public let _ptr: UnsafeMutableRawPointer
|
||||
|
||||
public init(fromPointer ptr: spine_animation) {
|
||||
self._ptr = UnsafeMutableRawPointer(ptr)
|
||||
super.init()
|
||||
}
|
||||
|
||||
public convenience init(_ name: String, _ timelines: ArrayTimeline, _ duration: Float) {
|
||||
|
||||
@ -33,18 +33,21 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// ArrayFloat wrapper
|
||||
public class ArrayFloat {
|
||||
@objc(SpineArrayFloat)
|
||||
@objcMembers
|
||||
public class ArrayFloat: NSObject {
|
||||
public let _ptr: UnsafeMutableRawPointer
|
||||
private let _ownsMemory: Bool
|
||||
|
||||
public init(fromPointer ptr: spine_array_float, ownsMemory: Bool = false) {
|
||||
self._ptr = UnsafeMutableRawPointer(ptr)
|
||||
self._ownsMemory = ownsMemory
|
||||
super.init()
|
||||
}
|
||||
|
||||
|
||||
/// Create a new empty array
|
||||
public convenience init() {
|
||||
public override convenience init() {
|
||||
let ptr = spine_array_float_create()!
|
||||
self.init(fromPointer: ptr, ownsMemory: true)
|
||||
}
|
||||
@ -107,18 +110,21 @@ public class ArrayFloat {
|
||||
}
|
||||
|
||||
/// ArrayInt wrapper
|
||||
public class ArrayInt {
|
||||
@objc(SpineArrayInt)
|
||||
@objcMembers
|
||||
public class ArrayInt: NSObject {
|
||||
public let _ptr: UnsafeMutableRawPointer
|
||||
private let _ownsMemory: Bool
|
||||
|
||||
public init(fromPointer ptr: spine_array_int, ownsMemory: Bool = false) {
|
||||
self._ptr = UnsafeMutableRawPointer(ptr)
|
||||
self._ownsMemory = ownsMemory
|
||||
super.init()
|
||||
}
|
||||
|
||||
|
||||
/// Create a new empty array
|
||||
public convenience init() {
|
||||
public override convenience init() {
|
||||
let ptr = spine_array_int_create()!
|
||||
self.init(fromPointer: ptr, ownsMemory: true)
|
||||
}
|
||||
@ -181,18 +187,21 @@ public class ArrayInt {
|
||||
}
|
||||
|
||||
/// ArrayUnsignedShort wrapper
|
||||
public class ArrayUnsignedShort {
|
||||
@objc(SpineArrayUnsignedShort)
|
||||
@objcMembers
|
||||
public class ArrayUnsignedShort: NSObject {
|
||||
public let _ptr: UnsafeMutableRawPointer
|
||||
private let _ownsMemory: Bool
|
||||
|
||||
public init(fromPointer ptr: spine_array_unsigned_short, ownsMemory: Bool = false) {
|
||||
self._ptr = UnsafeMutableRawPointer(ptr)
|
||||
self._ownsMemory = ownsMemory
|
||||
super.init()
|
||||
}
|
||||
|
||||
|
||||
/// Create a new empty array
|
||||
public convenience init() {
|
||||
public override convenience init() {
|
||||
let ptr = spine_array_unsigned_short_create()!
|
||||
self.init(fromPointer: ptr, ownsMemory: true)
|
||||
}
|
||||
@ -255,18 +264,21 @@ public class ArrayUnsignedShort {
|
||||
}
|
||||
|
||||
/// ArrayPropertyId wrapper
|
||||
public class ArrayPropertyId {
|
||||
@objc(SpineArrayPropertyId)
|
||||
@objcMembers
|
||||
public class ArrayPropertyId: NSObject {
|
||||
public let _ptr: UnsafeMutableRawPointer
|
||||
private let _ownsMemory: Bool
|
||||
|
||||
public init(fromPointer ptr: spine_array_property_id, ownsMemory: Bool = false) {
|
||||
self._ptr = UnsafeMutableRawPointer(ptr)
|
||||
self._ownsMemory = ownsMemory
|
||||
super.init()
|
||||
}
|
||||
|
||||
|
||||
/// Create a new empty array
|
||||
public convenience init() {
|
||||
public override convenience init() {
|
||||
let ptr = spine_array_property_id_create()!
|
||||
self.init(fromPointer: ptr, ownsMemory: true)
|
||||
}
|
||||
@ -329,18 +341,21 @@ public class ArrayPropertyId {
|
||||
}
|
||||
|
||||
/// ArrayAnimation wrapper
|
||||
public class ArrayAnimation {
|
||||
@objc(SpineArrayAnimation)
|
||||
@objcMembers
|
||||
public class ArrayAnimation: NSObject {
|
||||
public let _ptr: UnsafeMutableRawPointer
|
||||
private let _ownsMemory: Bool
|
||||
|
||||
public init(fromPointer ptr: spine_array_animation, ownsMemory: Bool = false) {
|
||||
self._ptr = UnsafeMutableRawPointer(ptr)
|
||||
self._ownsMemory = ownsMemory
|
||||
super.init()
|
||||
}
|
||||
|
||||
|
||||
/// Create a new empty array
|
||||
public convenience init() {
|
||||
public override convenience init() {
|
||||
let ptr = spine_array_animation_create()!
|
||||
self.init(fromPointer: ptr, ownsMemory: true)
|
||||
}
|
||||
@ -404,18 +419,21 @@ public class ArrayAnimation {
|
||||
}
|
||||
|
||||
/// ArrayAtlasPage wrapper
|
||||
public class ArrayAtlasPage {
|
||||
@objc(SpineArrayAtlasPage)
|
||||
@objcMembers
|
||||
public class ArrayAtlasPage: NSObject {
|
||||
public let _ptr: UnsafeMutableRawPointer
|
||||
private let _ownsMemory: Bool
|
||||
|
||||
public init(fromPointer ptr: spine_array_atlas_page, ownsMemory: Bool = false) {
|
||||
self._ptr = UnsafeMutableRawPointer(ptr)
|
||||
self._ownsMemory = ownsMemory
|
||||
super.init()
|
||||
}
|
||||
|
||||
|
||||
/// Create a new empty array
|
||||
public convenience init() {
|
||||
public override convenience init() {
|
||||
let ptr = spine_array_atlas_page_create()!
|
||||
self.init(fromPointer: ptr, ownsMemory: true)
|
||||
}
|
||||
@ -479,18 +497,21 @@ public class ArrayAtlasPage {
|
||||
}
|
||||
|
||||
/// ArrayAtlasRegion wrapper
|
||||
public class ArrayAtlasRegion {
|
||||
@objc(SpineArrayAtlasRegion)
|
||||
@objcMembers
|
||||
public class ArrayAtlasRegion: NSObject {
|
||||
public let _ptr: UnsafeMutableRawPointer
|
||||
private let _ownsMemory: Bool
|
||||
|
||||
public init(fromPointer ptr: spine_array_atlas_region, ownsMemory: Bool = false) {
|
||||
self._ptr = UnsafeMutableRawPointer(ptr)
|
||||
self._ownsMemory = ownsMemory
|
||||
super.init()
|
||||
}
|
||||
|
||||
|
||||
/// Create a new empty array
|
||||
public convenience init() {
|
||||
public override convenience init() {
|
||||
let ptr = spine_array_atlas_region_create()!
|
||||
self.init(fromPointer: ptr, ownsMemory: true)
|
||||
}
|
||||
@ -554,18 +575,21 @@ public class ArrayAtlasRegion {
|
||||
}
|
||||
|
||||
/// ArrayAttachment wrapper
|
||||
public class ArrayAttachment {
|
||||
@objc(SpineArrayAttachment)
|
||||
@objcMembers
|
||||
public class ArrayAttachment: NSObject {
|
||||
public let _ptr: UnsafeMutableRawPointer
|
||||
private let _ownsMemory: Bool
|
||||
|
||||
public init(fromPointer ptr: spine_array_attachment, ownsMemory: Bool = false) {
|
||||
self._ptr = UnsafeMutableRawPointer(ptr)
|
||||
self._ownsMemory = ownsMemory
|
||||
super.init()
|
||||
}
|
||||
|
||||
|
||||
/// Create a new empty array
|
||||
public convenience init() {
|
||||
public override convenience init() {
|
||||
let ptr = spine_array_attachment_create()!
|
||||
self.init(fromPointer: ptr, ownsMemory: true)
|
||||
}
|
||||
@ -587,8 +611,8 @@ public class ArrayAttachment {
|
||||
let elementPtr = buffer[Int(index)]
|
||||
guard let ptr = elementPtr else { return nil }
|
||||
let rtti = spine_attachment_get_rtti(ptr)
|
||||
let className = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||
switch className {
|
||||
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||
switch rttiClassName {
|
||||
case "spine_bounding_box_attachment":
|
||||
return BoundingBoxAttachment(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_bounding_box_attachment_wrapper.self))
|
||||
case "spine_clipping_attachment":
|
||||
@ -602,7 +626,7 @@ public class ArrayAttachment {
|
||||
case "spine_region_attachment":
|
||||
return RegionAttachment(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_region_attachment_wrapper.self))
|
||||
default:
|
||||
fatalError("Unknown concrete type: \(className) for abstract class Attachment")
|
||||
fatalError("Unknown concrete type: \(rttiClassName) for abstract class Attachment")
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -647,18 +671,21 @@ public class ArrayAttachment {
|
||||
}
|
||||
|
||||
/// ArrayBone wrapper
|
||||
public class ArrayBone {
|
||||
@objc(SpineArrayBone)
|
||||
@objcMembers
|
||||
public class ArrayBone: NSObject {
|
||||
public let _ptr: UnsafeMutableRawPointer
|
||||
private let _ownsMemory: Bool
|
||||
|
||||
public init(fromPointer ptr: spine_array_bone, ownsMemory: Bool = false) {
|
||||
self._ptr = UnsafeMutableRawPointer(ptr)
|
||||
self._ownsMemory = ownsMemory
|
||||
super.init()
|
||||
}
|
||||
|
||||
|
||||
/// Create a new empty array
|
||||
public convenience init() {
|
||||
public override convenience init() {
|
||||
let ptr = spine_array_bone_create()!
|
||||
self.init(fromPointer: ptr, ownsMemory: true)
|
||||
}
|
||||
@ -722,18 +749,21 @@ public class ArrayBone {
|
||||
}
|
||||
|
||||
/// ArrayBoneData wrapper
|
||||
public class ArrayBoneData {
|
||||
@objc(SpineArrayBoneData)
|
||||
@objcMembers
|
||||
public class ArrayBoneData: NSObject {
|
||||
public let _ptr: UnsafeMutableRawPointer
|
||||
private let _ownsMemory: Bool
|
||||
|
||||
public init(fromPointer ptr: spine_array_bone_data, ownsMemory: Bool = false) {
|
||||
self._ptr = UnsafeMutableRawPointer(ptr)
|
||||
self._ownsMemory = ownsMemory
|
||||
super.init()
|
||||
}
|
||||
|
||||
|
||||
/// Create a new empty array
|
||||
public convenience init() {
|
||||
public override convenience init() {
|
||||
let ptr = spine_array_bone_data_create()!
|
||||
self.init(fromPointer: ptr, ownsMemory: true)
|
||||
}
|
||||
@ -797,18 +827,21 @@ public class ArrayBoneData {
|
||||
}
|
||||
|
||||
/// ArrayBonePose wrapper
|
||||
public class ArrayBonePose {
|
||||
@objc(SpineArrayBonePose)
|
||||
@objcMembers
|
||||
public class ArrayBonePose: NSObject {
|
||||
public let _ptr: UnsafeMutableRawPointer
|
||||
private let _ownsMemory: Bool
|
||||
|
||||
public init(fromPointer ptr: spine_array_bone_pose, ownsMemory: Bool = false) {
|
||||
self._ptr = UnsafeMutableRawPointer(ptr)
|
||||
self._ownsMemory = ownsMemory
|
||||
super.init()
|
||||
}
|
||||
|
||||
|
||||
/// Create a new empty array
|
||||
public convenience init() {
|
||||
public override convenience init() {
|
||||
let ptr = spine_array_bone_pose_create()!
|
||||
self.init(fromPointer: ptr, ownsMemory: true)
|
||||
}
|
||||
@ -872,18 +905,21 @@ public class ArrayBonePose {
|
||||
}
|
||||
|
||||
/// ArrayBoundingBoxAttachment wrapper
|
||||
public class ArrayBoundingBoxAttachment {
|
||||
@objc(SpineArrayBoundingBoxAttachment)
|
||||
@objcMembers
|
||||
public class ArrayBoundingBoxAttachment: NSObject {
|
||||
public let _ptr: UnsafeMutableRawPointer
|
||||
private let _ownsMemory: Bool
|
||||
|
||||
public init(fromPointer ptr: spine_array_bounding_box_attachment, ownsMemory: Bool = false) {
|
||||
self._ptr = UnsafeMutableRawPointer(ptr)
|
||||
self._ownsMemory = ownsMemory
|
||||
super.init()
|
||||
}
|
||||
|
||||
|
||||
/// Create a new empty array
|
||||
public convenience init() {
|
||||
public override convenience init() {
|
||||
let ptr = spine_array_bounding_box_attachment_create()!
|
||||
self.init(fromPointer: ptr, ownsMemory: true)
|
||||
}
|
||||
@ -947,18 +983,21 @@ public class ArrayBoundingBoxAttachment {
|
||||
}
|
||||
|
||||
/// ArrayConstraint wrapper
|
||||
public class ArrayConstraint {
|
||||
@objc(SpineArrayConstraint)
|
||||
@objcMembers
|
||||
public class ArrayConstraint: NSObject {
|
||||
public let _ptr: UnsafeMutableRawPointer
|
||||
private let _ownsMemory: Bool
|
||||
|
||||
public init(fromPointer ptr: spine_array_constraint, ownsMemory: Bool = false) {
|
||||
self._ptr = UnsafeMutableRawPointer(ptr)
|
||||
self._ownsMemory = ownsMemory
|
||||
super.init()
|
||||
}
|
||||
|
||||
|
||||
/// Create a new empty array
|
||||
public convenience init() {
|
||||
public override convenience init() {
|
||||
let ptr = spine_array_constraint_create()!
|
||||
self.init(fromPointer: ptr, ownsMemory: true)
|
||||
}
|
||||
@ -980,8 +1019,8 @@ public class ArrayConstraint {
|
||||
let elementPtr = buffer[Int(index)]
|
||||
guard let ptr = elementPtr else { return nil }
|
||||
let rtti = spine_constraint_get_rtti(ptr)
|
||||
let className = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||
switch className {
|
||||
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||
switch rttiClassName {
|
||||
case "spine_ik_constraint":
|
||||
return IkConstraint(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_ik_constraint_wrapper.self))
|
||||
case "spine_path_constraint":
|
||||
@ -993,7 +1032,7 @@ public class ArrayConstraint {
|
||||
case "spine_transform_constraint":
|
||||
return TransformConstraint(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_transform_constraint_wrapper.self))
|
||||
default:
|
||||
fatalError("Unknown concrete type: \(className) for abstract class Constraint")
|
||||
fatalError("Unknown concrete type: \(rttiClassName) for abstract class Constraint")
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1038,18 +1077,21 @@ public class ArrayConstraint {
|
||||
}
|
||||
|
||||
/// ArrayConstraintData wrapper
|
||||
public class ArrayConstraintData {
|
||||
@objc(SpineArrayConstraintData)
|
||||
@objcMembers
|
||||
public class ArrayConstraintData: NSObject {
|
||||
public let _ptr: UnsafeMutableRawPointer
|
||||
private let _ownsMemory: Bool
|
||||
|
||||
public init(fromPointer ptr: spine_array_constraint_data, ownsMemory: Bool = false) {
|
||||
self._ptr = UnsafeMutableRawPointer(ptr)
|
||||
self._ownsMemory = ownsMemory
|
||||
super.init()
|
||||
}
|
||||
|
||||
|
||||
/// Create a new empty array
|
||||
public convenience init() {
|
||||
public override convenience init() {
|
||||
let ptr = spine_array_constraint_data_create()!
|
||||
self.init(fromPointer: ptr, ownsMemory: true)
|
||||
}
|
||||
@ -1071,8 +1113,8 @@ public class ArrayConstraintData {
|
||||
let elementPtr = buffer[Int(index)]
|
||||
guard let ptr = elementPtr else { return nil }
|
||||
let rtti = spine_constraint_data_get_rtti(ptr)
|
||||
let className = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||
switch className {
|
||||
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||
switch rttiClassName {
|
||||
case "spine_ik_constraint_data":
|
||||
return IkConstraintData(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_ik_constraint_data_wrapper.self))
|
||||
case "spine_path_constraint_data":
|
||||
@ -1084,7 +1126,7 @@ public class ArrayConstraintData {
|
||||
case "spine_transform_constraint_data":
|
||||
return TransformConstraintData(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_transform_constraint_data_wrapper.self))
|
||||
default:
|
||||
fatalError("Unknown concrete type: \(className) for abstract class ConstraintData")
|
||||
fatalError("Unknown concrete type: \(rttiClassName) for abstract class ConstraintData")
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1129,18 +1171,21 @@ public class ArrayConstraintData {
|
||||
}
|
||||
|
||||
/// ArrayEvent wrapper
|
||||
public class ArrayEvent {
|
||||
@objc(SpineArrayEvent)
|
||||
@objcMembers
|
||||
public class ArrayEvent: NSObject {
|
||||
public let _ptr: UnsafeMutableRawPointer
|
||||
private let _ownsMemory: Bool
|
||||
|
||||
public init(fromPointer ptr: spine_array_event, ownsMemory: Bool = false) {
|
||||
self._ptr = UnsafeMutableRawPointer(ptr)
|
||||
self._ownsMemory = ownsMemory
|
||||
super.init()
|
||||
}
|
||||
|
||||
|
||||
/// Create a new empty array
|
||||
public convenience init() {
|
||||
public override convenience init() {
|
||||
let ptr = spine_array_event_create()!
|
||||
self.init(fromPointer: ptr, ownsMemory: true)
|
||||
}
|
||||
@ -1204,18 +1249,21 @@ public class ArrayEvent {
|
||||
}
|
||||
|
||||
/// ArrayEventData wrapper
|
||||
public class ArrayEventData {
|
||||
@objc(SpineArrayEventData)
|
||||
@objcMembers
|
||||
public class ArrayEventData: NSObject {
|
||||
public let _ptr: UnsafeMutableRawPointer
|
||||
private let _ownsMemory: Bool
|
||||
|
||||
public init(fromPointer ptr: spine_array_event_data, ownsMemory: Bool = false) {
|
||||
self._ptr = UnsafeMutableRawPointer(ptr)
|
||||
self._ownsMemory = ownsMemory
|
||||
super.init()
|
||||
}
|
||||
|
||||
|
||||
/// Create a new empty array
|
||||
public convenience init() {
|
||||
public override convenience init() {
|
||||
let ptr = spine_array_event_data_create()!
|
||||
self.init(fromPointer: ptr, ownsMemory: true)
|
||||
}
|
||||
@ -1279,18 +1327,21 @@ public class ArrayEventData {
|
||||
}
|
||||
|
||||
/// ArrayFromProperty wrapper
|
||||
public class ArrayFromProperty {
|
||||
@objc(SpineArrayFromProperty)
|
||||
@objcMembers
|
||||
public class ArrayFromProperty: NSObject {
|
||||
public let _ptr: UnsafeMutableRawPointer
|
||||
private let _ownsMemory: Bool
|
||||
|
||||
public init(fromPointer ptr: spine_array_from_property, ownsMemory: Bool = false) {
|
||||
self._ptr = UnsafeMutableRawPointer(ptr)
|
||||
self._ownsMemory = ownsMemory
|
||||
super.init()
|
||||
}
|
||||
|
||||
|
||||
/// Create a new empty array
|
||||
public convenience init() {
|
||||
public override convenience init() {
|
||||
let ptr = spine_array_from_property_create()!
|
||||
self.init(fromPointer: ptr, ownsMemory: true)
|
||||
}
|
||||
@ -1312,8 +1363,8 @@ public class ArrayFromProperty {
|
||||
let elementPtr = buffer[Int(index)]
|
||||
guard let ptr = elementPtr else { return nil }
|
||||
let rtti = spine_from_property_get_rtti(ptr)
|
||||
let className = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||
switch className {
|
||||
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||
switch rttiClassName {
|
||||
case "spine_from_rotate":
|
||||
return FromRotate(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_from_rotate_wrapper.self))
|
||||
case "spine_from_scale_x":
|
||||
@ -1327,7 +1378,7 @@ public class ArrayFromProperty {
|
||||
case "spine_from_y":
|
||||
return FromY(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_from_y_wrapper.self))
|
||||
default:
|
||||
fatalError("Unknown concrete type: \(className) for abstract class FromProperty")
|
||||
fatalError("Unknown concrete type: \(rttiClassName) for abstract class FromProperty")
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1372,18 +1423,21 @@ public class ArrayFromProperty {
|
||||
}
|
||||
|
||||
/// ArrayPhysicsConstraint wrapper
|
||||
public class ArrayPhysicsConstraint {
|
||||
@objc(SpineArrayPhysicsConstraint)
|
||||
@objcMembers
|
||||
public class ArrayPhysicsConstraint: NSObject {
|
||||
public let _ptr: UnsafeMutableRawPointer
|
||||
private let _ownsMemory: Bool
|
||||
|
||||
public init(fromPointer ptr: spine_array_physics_constraint, ownsMemory: Bool = false) {
|
||||
self._ptr = UnsafeMutableRawPointer(ptr)
|
||||
self._ownsMemory = ownsMemory
|
||||
super.init()
|
||||
}
|
||||
|
||||
|
||||
/// Create a new empty array
|
||||
public convenience init() {
|
||||
public override convenience init() {
|
||||
let ptr = spine_array_physics_constraint_create()!
|
||||
self.init(fromPointer: ptr, ownsMemory: true)
|
||||
}
|
||||
@ -1447,18 +1501,21 @@ public class ArrayPhysicsConstraint {
|
||||
}
|
||||
|
||||
/// ArrayPolygon wrapper
|
||||
public class ArrayPolygon {
|
||||
@objc(SpineArrayPolygon)
|
||||
@objcMembers
|
||||
public class ArrayPolygon: NSObject {
|
||||
public let _ptr: UnsafeMutableRawPointer
|
||||
private let _ownsMemory: Bool
|
||||
|
||||
public init(fromPointer ptr: spine_array_polygon, ownsMemory: Bool = false) {
|
||||
self._ptr = UnsafeMutableRawPointer(ptr)
|
||||
self._ownsMemory = ownsMemory
|
||||
super.init()
|
||||
}
|
||||
|
||||
|
||||
/// Create a new empty array
|
||||
public convenience init() {
|
||||
public override convenience init() {
|
||||
let ptr = spine_array_polygon_create()!
|
||||
self.init(fromPointer: ptr, ownsMemory: true)
|
||||
}
|
||||
@ -1522,18 +1579,21 @@ public class ArrayPolygon {
|
||||
}
|
||||
|
||||
/// ArraySkin wrapper
|
||||
public class ArraySkin {
|
||||
@objc(SpineArraySkin)
|
||||
@objcMembers
|
||||
public class ArraySkin: NSObject {
|
||||
public let _ptr: UnsafeMutableRawPointer
|
||||
private let _ownsMemory: Bool
|
||||
|
||||
public init(fromPointer ptr: spine_array_skin, ownsMemory: Bool = false) {
|
||||
self._ptr = UnsafeMutableRawPointer(ptr)
|
||||
self._ownsMemory = ownsMemory
|
||||
super.init()
|
||||
}
|
||||
|
||||
|
||||
/// Create a new empty array
|
||||
public convenience init() {
|
||||
public override convenience init() {
|
||||
let ptr = spine_array_skin_create()!
|
||||
self.init(fromPointer: ptr, ownsMemory: true)
|
||||
}
|
||||
@ -1597,18 +1657,21 @@ public class ArraySkin {
|
||||
}
|
||||
|
||||
/// ArraySlot wrapper
|
||||
public class ArraySlot {
|
||||
@objc(SpineArraySlot)
|
||||
@objcMembers
|
||||
public class ArraySlot: NSObject {
|
||||
public let _ptr: UnsafeMutableRawPointer
|
||||
private let _ownsMemory: Bool
|
||||
|
||||
public init(fromPointer ptr: spine_array_slot, ownsMemory: Bool = false) {
|
||||
self._ptr = UnsafeMutableRawPointer(ptr)
|
||||
self._ownsMemory = ownsMemory
|
||||
super.init()
|
||||
}
|
||||
|
||||
|
||||
/// Create a new empty array
|
||||
public convenience init() {
|
||||
public override convenience init() {
|
||||
let ptr = spine_array_slot_create()!
|
||||
self.init(fromPointer: ptr, ownsMemory: true)
|
||||
}
|
||||
@ -1672,18 +1735,21 @@ public class ArraySlot {
|
||||
}
|
||||
|
||||
/// ArraySlotData wrapper
|
||||
public class ArraySlotData {
|
||||
@objc(SpineArraySlotData)
|
||||
@objcMembers
|
||||
public class ArraySlotData: NSObject {
|
||||
public let _ptr: UnsafeMutableRawPointer
|
||||
private let _ownsMemory: Bool
|
||||
|
||||
public init(fromPointer ptr: spine_array_slot_data, ownsMemory: Bool = false) {
|
||||
self._ptr = UnsafeMutableRawPointer(ptr)
|
||||
self._ownsMemory = ownsMemory
|
||||
super.init()
|
||||
}
|
||||
|
||||
|
||||
/// Create a new empty array
|
||||
public convenience init() {
|
||||
public override convenience init() {
|
||||
let ptr = spine_array_slot_data_create()!
|
||||
self.init(fromPointer: ptr, ownsMemory: true)
|
||||
}
|
||||
@ -1747,18 +1813,21 @@ public class ArraySlotData {
|
||||
}
|
||||
|
||||
/// ArrayTextureRegion wrapper
|
||||
public class ArrayTextureRegion {
|
||||
@objc(SpineArrayTextureRegion)
|
||||
@objcMembers
|
||||
public class ArrayTextureRegion: NSObject {
|
||||
public let _ptr: UnsafeMutableRawPointer
|
||||
private let _ownsMemory: Bool
|
||||
|
||||
public init(fromPointer ptr: spine_array_texture_region, ownsMemory: Bool = false) {
|
||||
self._ptr = UnsafeMutableRawPointer(ptr)
|
||||
self._ownsMemory = ownsMemory
|
||||
super.init()
|
||||
}
|
||||
|
||||
|
||||
/// Create a new empty array
|
||||
public convenience init() {
|
||||
public override convenience init() {
|
||||
let ptr = spine_array_texture_region_create()!
|
||||
self.init(fromPointer: ptr, ownsMemory: true)
|
||||
}
|
||||
@ -1822,18 +1891,21 @@ public class ArrayTextureRegion {
|
||||
}
|
||||
|
||||
/// ArrayTimeline wrapper
|
||||
public class ArrayTimeline {
|
||||
@objc(SpineArrayTimeline)
|
||||
@objcMembers
|
||||
public class ArrayTimeline: NSObject {
|
||||
public let _ptr: UnsafeMutableRawPointer
|
||||
private let _ownsMemory: Bool
|
||||
|
||||
public init(fromPointer ptr: spine_array_timeline, ownsMemory: Bool = false) {
|
||||
self._ptr = UnsafeMutableRawPointer(ptr)
|
||||
self._ownsMemory = ownsMemory
|
||||
super.init()
|
||||
}
|
||||
|
||||
|
||||
/// Create a new empty array
|
||||
public convenience init() {
|
||||
public override convenience init() {
|
||||
let ptr = spine_array_timeline_create()!
|
||||
self.init(fromPointer: ptr, ownsMemory: true)
|
||||
}
|
||||
@ -1855,8 +1927,8 @@ public class ArrayTimeline {
|
||||
let elementPtr = buffer[Int(index)]
|
||||
guard let ptr = elementPtr else { return nil }
|
||||
let rtti = spine_timeline_get_rtti(ptr)
|
||||
let className = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||
switch className {
|
||||
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||
switch rttiClassName {
|
||||
case "spine_alpha_timeline":
|
||||
return AlphaTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_alpha_timeline_wrapper.self))
|
||||
case "spine_attachment_timeline":
|
||||
@ -1930,7 +2002,7 @@ public class ArrayTimeline {
|
||||
case "spine_translate_y_timeline":
|
||||
return TranslateYTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_translate_y_timeline_wrapper.self))
|
||||
default:
|
||||
fatalError("Unknown concrete type: \(className) for abstract class Timeline")
|
||||
fatalError("Unknown concrete type: \(rttiClassName) for abstract class Timeline")
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1975,18 +2047,21 @@ public class ArrayTimeline {
|
||||
}
|
||||
|
||||
/// ArrayToProperty wrapper
|
||||
public class ArrayToProperty {
|
||||
@objc(SpineArrayToProperty)
|
||||
@objcMembers
|
||||
public class ArrayToProperty: NSObject {
|
||||
public let _ptr: UnsafeMutableRawPointer
|
||||
private let _ownsMemory: Bool
|
||||
|
||||
public init(fromPointer ptr: spine_array_to_property, ownsMemory: Bool = false) {
|
||||
self._ptr = UnsafeMutableRawPointer(ptr)
|
||||
self._ownsMemory = ownsMemory
|
||||
super.init()
|
||||
}
|
||||
|
||||
|
||||
/// Create a new empty array
|
||||
public convenience init() {
|
||||
public override convenience init() {
|
||||
let ptr = spine_array_to_property_create()!
|
||||
self.init(fromPointer: ptr, ownsMemory: true)
|
||||
}
|
||||
@ -2008,8 +2083,8 @@ public class ArrayToProperty {
|
||||
let elementPtr = buffer[Int(index)]
|
||||
guard let ptr = elementPtr else { return nil }
|
||||
let rtti = spine_to_property_get_rtti(ptr)
|
||||
let className = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||
switch className {
|
||||
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||
switch rttiClassName {
|
||||
case "spine_to_rotate":
|
||||
return ToRotate(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_to_rotate_wrapper.self))
|
||||
case "spine_to_scale_x":
|
||||
@ -2023,7 +2098,7 @@ public class ArrayToProperty {
|
||||
case "spine_to_y":
|
||||
return ToY(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_to_y_wrapper.self))
|
||||
default:
|
||||
fatalError("Unknown concrete type: \(className) for abstract class ToProperty")
|
||||
fatalError("Unknown concrete type: \(rttiClassName) for abstract class ToProperty")
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2068,18 +2143,21 @@ public class ArrayToProperty {
|
||||
}
|
||||
|
||||
/// ArrayTrackEntry wrapper
|
||||
public class ArrayTrackEntry {
|
||||
@objc(SpineArrayTrackEntry)
|
||||
@objcMembers
|
||||
public class ArrayTrackEntry: NSObject {
|
||||
public let _ptr: UnsafeMutableRawPointer
|
||||
private let _ownsMemory: Bool
|
||||
|
||||
public init(fromPointer ptr: spine_array_track_entry, ownsMemory: Bool = false) {
|
||||
self._ptr = UnsafeMutableRawPointer(ptr)
|
||||
self._ownsMemory = ownsMemory
|
||||
super.init()
|
||||
}
|
||||
|
||||
|
||||
/// Create a new empty array
|
||||
public convenience init() {
|
||||
public override convenience init() {
|
||||
let ptr = spine_array_track_entry_create()!
|
||||
self.init(fromPointer: ptr, ownsMemory: true)
|
||||
}
|
||||
@ -2143,18 +2221,21 @@ public class ArrayTrackEntry {
|
||||
}
|
||||
|
||||
/// ArrayUpdate wrapper
|
||||
public class ArrayUpdate {
|
||||
@objc(SpineArrayUpdate)
|
||||
@objcMembers
|
||||
public class ArrayUpdate: NSObject {
|
||||
public let _ptr: UnsafeMutableRawPointer
|
||||
private let _ownsMemory: Bool
|
||||
|
||||
public init(fromPointer ptr: spine_array_update, ownsMemory: Bool = false) {
|
||||
self._ptr = UnsafeMutableRawPointer(ptr)
|
||||
self._ownsMemory = ownsMemory
|
||||
super.init()
|
||||
}
|
||||
|
||||
|
||||
/// Create a new empty array
|
||||
public convenience init() {
|
||||
public override convenience init() {
|
||||
let ptr = spine_array_update_create()!
|
||||
self.init(fromPointer: ptr, ownsMemory: true)
|
||||
}
|
||||
@ -2176,8 +2257,8 @@ public class ArrayUpdate {
|
||||
let elementPtr = buffer[Int(index)]
|
||||
guard let ptr = elementPtr else { return nil }
|
||||
let rtti = spine_update_get_rtti(ptr)
|
||||
let className = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||
switch className {
|
||||
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||
switch rttiClassName {
|
||||
case "spine_bone":
|
||||
return Bone(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_bone_wrapper.self))
|
||||
case "spine_bone_pose":
|
||||
@ -2193,7 +2274,7 @@ public class ArrayUpdate {
|
||||
case "spine_transform_constraint":
|
||||
return TransformConstraint(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_transform_constraint_wrapper.self))
|
||||
default:
|
||||
fatalError("Unknown concrete type: \(className) for abstract class Update")
|
||||
fatalError("Unknown concrete type: \(rttiClassName) for abstract class Update")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -33,11 +33,14 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// Atlas wrapper
|
||||
public class Atlas {
|
||||
@objc(SpineAtlas)
|
||||
@objcMembers
|
||||
public class Atlas: NSObject {
|
||||
public let _ptr: UnsafeMutableRawPointer
|
||||
|
||||
public init(fromPointer ptr: spine_atlas) {
|
||||
self._ptr = UnsafeMutableRawPointer(ptr)
|
||||
super.init()
|
||||
}
|
||||
|
||||
public var pages: ArrayAtlasPage {
|
||||
|
||||
@ -33,11 +33,14 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// Attachment wrapper
|
||||
open class Attachment {
|
||||
@objc(SpineAttachment)
|
||||
@objcMembers
|
||||
open class Attachment: NSObject {
|
||||
public let _ptr: UnsafeMutableRawPointer
|
||||
|
||||
public init(fromPointer ptr: spine_attachment) {
|
||||
self._ptr = UnsafeMutableRawPointer(ptr)
|
||||
super.init()
|
||||
}
|
||||
|
||||
public var rtti: Rtti {
|
||||
@ -58,8 +61,8 @@ open class Attachment {
|
||||
public func copyAttachment() -> Attachment {
|
||||
let result = spine_attachment_copy(_ptr.assumingMemoryBound(to: spine_attachment_wrapper.self))
|
||||
let rtti = spine_attachment_get_rtti(result!)
|
||||
let className = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||
switch className {
|
||||
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||
switch rttiClassName {
|
||||
case "spine_bounding_box_attachment":
|
||||
return BoundingBoxAttachment(fromPointer: UnsafeMutableRawPointer(result!).assumingMemoryBound(to: spine_bounding_box_attachment_wrapper.self))
|
||||
case "spine_clipping_attachment":
|
||||
@ -73,7 +76,7 @@ open class Attachment {
|
||||
case "spine_region_attachment":
|
||||
return RegionAttachment(fromPointer: UnsafeMutableRawPointer(result!).assumingMemoryBound(to: spine_region_attachment_wrapper.self))
|
||||
default:
|
||||
fatalError("Unknown concrete type: \(className) for abstract class Attachment")
|
||||
fatalError("Unknown concrete type: \(rttiClassName) for abstract class Attachment")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -33,7 +33,10 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// Bone wrapper
|
||||
@objc(SpineBone)
|
||||
@objcMembers
|
||||
public class Bone: PosedActive, Posed, Update {
|
||||
@nonobjc
|
||||
public init(fromPointer ptr: spine_bone) {
|
||||
super.init(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_posed_active_wrapper.self))
|
||||
}
|
||||
|
||||
@ -33,14 +33,17 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// Color wrapper
|
||||
public class Color {
|
||||
@objc(SpineColor)
|
||||
@objcMembers
|
||||
public class Color: NSObject {
|
||||
public let _ptr: UnsafeMutableRawPointer
|
||||
|
||||
public init(fromPointer ptr: spine_color) {
|
||||
self._ptr = UnsafeMutableRawPointer(ptr)
|
||||
super.init()
|
||||
}
|
||||
|
||||
public convenience init() {
|
||||
public override convenience init() {
|
||||
let ptr = spine_color_create()
|
||||
self.init(fromPointer: ptr!)
|
||||
}
|
||||
|
||||
@ -33,11 +33,14 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// Event wrapper
|
||||
public class Event {
|
||||
@objc(SpineEvent)
|
||||
@objcMembers
|
||||
public class Event: NSObject {
|
||||
public let _ptr: UnsafeMutableRawPointer
|
||||
|
||||
public init(fromPointer ptr: spine_event) {
|
||||
self._ptr = UnsafeMutableRawPointer(ptr)
|
||||
super.init()
|
||||
}
|
||||
|
||||
public convenience init(_ time: Float, _ data: EventData) {
|
||||
|
||||
@ -33,14 +33,17 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// Polygon wrapper
|
||||
public class Polygon {
|
||||
@objc(SpinePolygon)
|
||||
@objcMembers
|
||||
public class Polygon: NSObject {
|
||||
public let _ptr: UnsafeMutableRawPointer
|
||||
|
||||
public init(fromPointer ptr: spine_polygon) {
|
||||
self._ptr = UnsafeMutableRawPointer(ptr)
|
||||
super.init()
|
||||
}
|
||||
|
||||
public convenience init() {
|
||||
public override convenience init() {
|
||||
let ptr = spine_polygon_create()
|
||||
self.init(fromPointer: ptr!)
|
||||
}
|
||||
|
||||
@ -33,14 +33,17 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// Rtti wrapper
|
||||
public class Rtti {
|
||||
@objc(SpineRtti)
|
||||
@objcMembers
|
||||
public class Rtti: NSObject {
|
||||
public let _ptr: UnsafeMutableRawPointer
|
||||
|
||||
public init(fromPointer ptr: spine_rtti) {
|
||||
self._ptr = UnsafeMutableRawPointer(ptr)
|
||||
super.init()
|
||||
}
|
||||
|
||||
public var className: String? {
|
||||
public var rttiClassName: String? {
|
||||
let result = spine_rtti_get_class_name(_ptr.assumingMemoryBound(to: spine_rtti_wrapper.self))
|
||||
return result.map { String(cString: $0) }
|
||||
}
|
||||
|
||||
@ -33,11 +33,14 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// Sequence wrapper
|
||||
public class Sequence {
|
||||
@objc(SpineSequence)
|
||||
@objcMembers
|
||||
public class Sequence: NSObject {
|
||||
public let _ptr: UnsafeMutableRawPointer
|
||||
|
||||
public init(fromPointer ptr: spine_sequence) {
|
||||
self._ptr = UnsafeMutableRawPointer(ptr)
|
||||
super.init()
|
||||
}
|
||||
|
||||
public convenience init(_ count: Int32) {
|
||||
|
||||
@ -33,11 +33,14 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// Skeleton wrapper
|
||||
public class Skeleton {
|
||||
@objc(SpineSkeleton)
|
||||
@objcMembers
|
||||
public class Skeleton: NSObject {
|
||||
public let _ptr: UnsafeMutableRawPointer
|
||||
|
||||
public init(fromPointer ptr: spine_skeleton) {
|
||||
self._ptr = UnsafeMutableRawPointer(ptr)
|
||||
super.init()
|
||||
}
|
||||
|
||||
public convenience init(_ skeletonData: SkeletonData) {
|
||||
@ -274,8 +277,8 @@ public class Skeleton {
|
||||
let result = spine_skeleton_get_attachment_1(_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), slotName, attachmentName)
|
||||
guard let ptr = result else { return nil }
|
||||
let rtti = spine_attachment_get_rtti(ptr)
|
||||
let className = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||
switch className {
|
||||
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||
switch rttiClassName {
|
||||
case "spine_bounding_box_attachment":
|
||||
return BoundingBoxAttachment(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_bounding_box_attachment_wrapper.self))
|
||||
case "spine_clipping_attachment":
|
||||
@ -289,7 +292,7 @@ public class Skeleton {
|
||||
case "spine_region_attachment":
|
||||
return RegionAttachment(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_region_attachment_wrapper.self))
|
||||
default:
|
||||
fatalError("Unknown concrete type: \(className) for abstract class Attachment")
|
||||
fatalError("Unknown concrete type: \(rttiClassName) for abstract class Attachment")
|
||||
}
|
||||
}
|
||||
|
||||
@ -297,8 +300,8 @@ public class Skeleton {
|
||||
let result = spine_skeleton_get_attachment_2(_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), slotIndex, attachmentName)
|
||||
guard let ptr = result else { return nil }
|
||||
let rtti = spine_attachment_get_rtti(ptr)
|
||||
let className = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||
switch className {
|
||||
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||
switch rttiClassName {
|
||||
case "spine_bounding_box_attachment":
|
||||
return BoundingBoxAttachment(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_bounding_box_attachment_wrapper.self))
|
||||
case "spine_clipping_attachment":
|
||||
@ -312,7 +315,7 @@ public class Skeleton {
|
||||
case "spine_region_attachment":
|
||||
return RegionAttachment(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_region_attachment_wrapper.self))
|
||||
default:
|
||||
fatalError("Unknown concrete type: \(className) for abstract class Attachment")
|
||||
fatalError("Unknown concrete type: \(rttiClassName) for abstract class Attachment")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -33,11 +33,14 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// Skin wrapper
|
||||
public class Skin {
|
||||
@objc(SpineSkin)
|
||||
@objcMembers
|
||||
public class Skin: NSObject {
|
||||
public let _ptr: UnsafeMutableRawPointer
|
||||
|
||||
public init(fromPointer ptr: spine_skin) {
|
||||
self._ptr = UnsafeMutableRawPointer(ptr)
|
||||
super.init()
|
||||
}
|
||||
|
||||
public convenience init(_ name: String) {
|
||||
@ -73,8 +76,8 @@ public class Skin {
|
||||
let result = spine_skin_get_attachment(_ptr.assumingMemoryBound(to: spine_skin_wrapper.self), slotIndex, name)
|
||||
guard let ptr = result else { return nil }
|
||||
let rtti = spine_attachment_get_rtti(ptr)
|
||||
let className = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||
switch className {
|
||||
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||
switch rttiClassName {
|
||||
case "spine_bounding_box_attachment":
|
||||
return BoundingBoxAttachment(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_bounding_box_attachment_wrapper.self))
|
||||
case "spine_clipping_attachment":
|
||||
@ -88,7 +91,7 @@ public class Skin {
|
||||
case "spine_region_attachment":
|
||||
return RegionAttachment(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_region_attachment_wrapper.self))
|
||||
default:
|
||||
fatalError("Unknown concrete type: \(className) for abstract class Attachment")
|
||||
fatalError("Unknown concrete type: \(rttiClassName) for abstract class Attachment")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -33,7 +33,10 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// Slider wrapper
|
||||
@objc(SpineSlider)
|
||||
@objcMembers
|
||||
public class Slider: PosedActive, Posed, Constraint {
|
||||
@nonobjc
|
||||
public init(fromPointer ptr: spine_slider) {
|
||||
super.init(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_posed_active_wrapper.self))
|
||||
}
|
||||
|
||||
@ -33,11 +33,14 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// Slot wrapper
|
||||
public class Slot: Posed {
|
||||
@objc(SpineSlot)
|
||||
@objcMembers
|
||||
public class Slot: NSObject, Posed {
|
||||
public let _ptr: UnsafeMutableRawPointer
|
||||
|
||||
public init(fromPointer ptr: spine_slot) {
|
||||
self._ptr = UnsafeMutableRawPointer(ptr)
|
||||
super.init()
|
||||
}
|
||||
|
||||
public convenience init(_ data: SlotData, _ skeleton: Skeleton) {
|
||||
|
||||
@ -33,11 +33,14 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// Timeline wrapper
|
||||
open class Timeline {
|
||||
@objc(SpineTimeline)
|
||||
@objcMembers
|
||||
open class Timeline: NSObject {
|
||||
public let _ptr: UnsafeMutableRawPointer
|
||||
|
||||
public init(fromPointer ptr: spine_timeline) {
|
||||
self._ptr = UnsafeMutableRawPointer(ptr)
|
||||
super.init()
|
||||
}
|
||||
|
||||
public var rtti: Rtti {
|
||||
|
||||
@ -33,7 +33,10 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// AlphaTimeline wrapper
|
||||
@objc(SpineAlphaTimeline)
|
||||
@objcMembers
|
||||
public class AlphaTimeline: CurveTimeline1, SlotTimeline {
|
||||
@nonobjc
|
||||
public init(fromPointer ptr: spine_alpha_timeline) {
|
||||
super.init(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_curve_timeline1_wrapper.self))
|
||||
}
|
||||
|
||||
@ -33,11 +33,14 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// AnimationState wrapper
|
||||
public class AnimationState {
|
||||
@objc(SpineAnimationState)
|
||||
@objcMembers
|
||||
public class AnimationState: NSObject {
|
||||
public let _ptr: UnsafeMutableRawPointer
|
||||
|
||||
public init(fromPointer ptr: spine_animation_state) {
|
||||
self._ptr = UnsafeMutableRawPointer(ptr)
|
||||
super.init()
|
||||
}
|
||||
|
||||
public convenience init(_ data: AnimationStateData) {
|
||||
|
||||
@ -33,11 +33,14 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// AnimationStateData wrapper
|
||||
public class AnimationStateData {
|
||||
@objc(SpineAnimationStateData)
|
||||
@objcMembers
|
||||
public class AnimationStateData: NSObject {
|
||||
public let _ptr: UnsafeMutableRawPointer
|
||||
|
||||
public init(fromPointer ptr: spine_animation_state_data) {
|
||||
self._ptr = UnsafeMutableRawPointer(ptr)
|
||||
super.init()
|
||||
}
|
||||
|
||||
public convenience init(_ skeletonData: SkeletonData) {
|
||||
|
||||
@ -33,11 +33,14 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// AtlasAttachmentLoader wrapper
|
||||
public class AtlasAttachmentLoader: AttachmentLoader {
|
||||
@objc(SpineAtlasAttachmentLoader)
|
||||
@objcMembers
|
||||
public class AtlasAttachmentLoader: NSObject, AttachmentLoader {
|
||||
public let _ptr: UnsafeMutableRawPointer
|
||||
|
||||
public init(fromPointer ptr: spine_atlas_attachment_loader) {
|
||||
self._ptr = UnsafeMutableRawPointer(ptr)
|
||||
super.init()
|
||||
}
|
||||
|
||||
public convenience init(_ atlas: Atlas) {
|
||||
|
||||
@ -33,11 +33,14 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// AtlasPage wrapper
|
||||
public class AtlasPage {
|
||||
@objc(SpineAtlasPage)
|
||||
@objcMembers
|
||||
public class AtlasPage: NSObject {
|
||||
public let _ptr: UnsafeMutableRawPointer
|
||||
|
||||
public init(fromPointer ptr: spine_atlas_page) {
|
||||
self._ptr = UnsafeMutableRawPointer(ptr)
|
||||
super.init()
|
||||
}
|
||||
|
||||
public convenience init(_ inName: String) {
|
||||
|
||||
@ -33,7 +33,10 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// AtlasRegion wrapper
|
||||
@objc(SpineAtlasRegion)
|
||||
@objcMembers
|
||||
public class AtlasRegion: TextureRegion {
|
||||
@nonobjc
|
||||
public init(fromPointer ptr: spine_atlas_region) {
|
||||
super.init(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_texture_region_wrapper.self))
|
||||
}
|
||||
|
||||
@ -33,7 +33,10 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// AttachmentTimeline wrapper
|
||||
@objc(SpineAttachmentTimeline)
|
||||
@objcMembers
|
||||
public class AttachmentTimeline: Timeline, SlotTimeline {
|
||||
@nonobjc
|
||||
public init(fromPointer ptr: spine_attachment_timeline) {
|
||||
super.init(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_timeline_wrapper.self))
|
||||
}
|
||||
|
||||
@ -33,7 +33,10 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// BoneData wrapper
|
||||
@objc(SpineBoneData)
|
||||
@objcMembers
|
||||
public class BoneData: PosedData {
|
||||
@nonobjc
|
||||
public init(fromPointer ptr: spine_bone_data) {
|
||||
super.init(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_posed_data_wrapper.self))
|
||||
}
|
||||
|
||||
@ -33,14 +33,17 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// BoneLocal wrapper
|
||||
public class BoneLocal {
|
||||
@objc(SpineBoneLocal)
|
||||
@objcMembers
|
||||
public class BoneLocal: NSObject {
|
||||
public let _ptr: UnsafeMutableRawPointer
|
||||
|
||||
public init(fromPointer ptr: spine_bone_local) {
|
||||
self._ptr = UnsafeMutableRawPointer(ptr)
|
||||
super.init()
|
||||
}
|
||||
|
||||
public convenience init() {
|
||||
public override convenience init() {
|
||||
let ptr = spine_bone_local_create()
|
||||
self.init(fromPointer: ptr!)
|
||||
}
|
||||
|
||||
@ -33,7 +33,10 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// BonePose wrapper
|
||||
@objc(SpineBonePose)
|
||||
@objcMembers
|
||||
public class BonePose: BoneLocal, Update {
|
||||
@nonobjc
|
||||
public init(fromPointer ptr: spine_bone_pose) {
|
||||
super.init(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_bone_local_wrapper.self))
|
||||
}
|
||||
|
||||
@ -33,7 +33,10 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// BoneTimeline1 wrapper
|
||||
@objc(SpineBoneTimeline1)
|
||||
@objcMembers
|
||||
open class BoneTimeline1: CurveTimeline1, BoneTimeline {
|
||||
@nonobjc
|
||||
public init(fromPointer ptr: spine_bone_timeline1) {
|
||||
super.init(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_curve_timeline1_wrapper.self))
|
||||
}
|
||||
|
||||
@ -33,7 +33,10 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// BoneTimeline2 wrapper
|
||||
@objc(SpineBoneTimeline2)
|
||||
@objcMembers
|
||||
open class BoneTimeline2: CurveTimeline, BoneTimeline {
|
||||
@nonobjc
|
||||
public init(fromPointer ptr: spine_bone_timeline2) {
|
||||
super.init(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_curve_timeline_wrapper.self))
|
||||
}
|
||||
|
||||
@ -33,7 +33,10 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// BoundingBoxAttachment wrapper
|
||||
@objc(SpineBoundingBoxAttachment)
|
||||
@objcMembers
|
||||
public class BoundingBoxAttachment: VertexAttachment {
|
||||
@nonobjc
|
||||
public init(fromPointer ptr: spine_bounding_box_attachment) {
|
||||
super.init(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_vertex_attachment_wrapper.self))
|
||||
}
|
||||
|
||||
@ -33,7 +33,10 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// ClippingAttachment wrapper
|
||||
@objc(SpineClippingAttachment)
|
||||
@objcMembers
|
||||
public class ClippingAttachment: VertexAttachment {
|
||||
@nonobjc
|
||||
public init(fromPointer ptr: spine_clipping_attachment) {
|
||||
super.init(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_vertex_attachment_wrapper.self))
|
||||
}
|
||||
|
||||
@ -33,7 +33,10 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// ConstraintTimeline1 wrapper
|
||||
@objc(SpineConstraintTimeline1)
|
||||
@objcMembers
|
||||
open class ConstraintTimeline1: CurveTimeline1, ConstraintTimeline {
|
||||
@nonobjc
|
||||
public init(fromPointer ptr: spine_constraint_timeline1) {
|
||||
super.init(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_curve_timeline1_wrapper.self))
|
||||
}
|
||||
|
||||
@ -33,7 +33,10 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// CurveTimeline wrapper
|
||||
@objc(SpineCurveTimeline)
|
||||
@objcMembers
|
||||
open class CurveTimeline: Timeline {
|
||||
@nonobjc
|
||||
public init(fromPointer ptr: spine_curve_timeline) {
|
||||
super.init(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_timeline_wrapper.self))
|
||||
}
|
||||
|
||||
@ -33,7 +33,10 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// CurveTimeline1 wrapper
|
||||
@objc(SpineCurveTimeline1)
|
||||
@objcMembers
|
||||
open class CurveTimeline1: CurveTimeline {
|
||||
@nonobjc
|
||||
public init(fromPointer ptr: spine_curve_timeline1) {
|
||||
super.init(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_curve_timeline_wrapper.self))
|
||||
}
|
||||
|
||||
@ -33,7 +33,10 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// DeformTimeline wrapper
|
||||
@objc(SpineDeformTimeline)
|
||||
@objcMembers
|
||||
public class DeformTimeline: SlotCurveTimeline {
|
||||
@nonobjc
|
||||
public init(fromPointer ptr: spine_deform_timeline) {
|
||||
super.init(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_slot_curve_timeline_wrapper.self))
|
||||
}
|
||||
@ -47,8 +50,8 @@ public class DeformTimeline: SlotCurveTimeline {
|
||||
get {
|
||||
let result = spine_deform_timeline_get_attachment(_ptr.assumingMemoryBound(to: spine_deform_timeline_wrapper.self))
|
||||
let rtti = spine_vertex_attachment_get_rtti(result!)
|
||||
let className = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||
switch className {
|
||||
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||
switch rttiClassName {
|
||||
case "spine_bounding_box_attachment":
|
||||
return BoundingBoxAttachment(fromPointer: UnsafeMutableRawPointer(result!).assumingMemoryBound(to: spine_bounding_box_attachment_wrapper.self))
|
||||
case "spine_clipping_attachment":
|
||||
@ -58,7 +61,7 @@ public class DeformTimeline: SlotCurveTimeline {
|
||||
case "spine_path_attachment":
|
||||
return PathAttachment(fromPointer: UnsafeMutableRawPointer(result!).assumingMemoryBound(to: spine_path_attachment_wrapper.self))
|
||||
default:
|
||||
fatalError("Unknown concrete type: \(className) for abstract class VertexAttachment")
|
||||
fatalError("Unknown concrete type: \(rttiClassName) for abstract class VertexAttachment")
|
||||
}
|
||||
}
|
||||
set {
|
||||
|
||||
@ -33,7 +33,10 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// DrawOrderTimeline wrapper
|
||||
@objc(SpineDrawOrderTimeline)
|
||||
@objcMembers
|
||||
public class DrawOrderTimeline: Timeline {
|
||||
@nonobjc
|
||||
public init(fromPointer ptr: spine_draw_order_timeline) {
|
||||
super.init(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_timeline_wrapper.self))
|
||||
}
|
||||
|
||||
@ -33,11 +33,14 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// EventData wrapper
|
||||
public class EventData {
|
||||
@objc(SpineEventData)
|
||||
@objcMembers
|
||||
public class EventData: NSObject {
|
||||
public let _ptr: UnsafeMutableRawPointer
|
||||
|
||||
public init(fromPointer ptr: spine_event_data) {
|
||||
self._ptr = UnsafeMutableRawPointer(ptr)
|
||||
super.init()
|
||||
}
|
||||
|
||||
public convenience init(_ name: String) {
|
||||
|
||||
@ -33,11 +33,14 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// EventQueueEntry wrapper
|
||||
public class EventQueueEntry {
|
||||
@objc(SpineEventQueueEntry)
|
||||
@objcMembers
|
||||
public class EventQueueEntry: NSObject {
|
||||
public let _ptr: UnsafeMutableRawPointer
|
||||
|
||||
public init(fromPointer ptr: spine_event_queue_entry) {
|
||||
self._ptr = UnsafeMutableRawPointer(ptr)
|
||||
super.init()
|
||||
}
|
||||
|
||||
public convenience init(_ eventType: EventType, _ trackEntry: TrackEntry?, _ event: Event?) {
|
||||
|
||||
@ -33,7 +33,10 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// EventTimeline wrapper
|
||||
@objc(SpineEventTimeline)
|
||||
@objcMembers
|
||||
public class EventTimeline: Timeline {
|
||||
@nonobjc
|
||||
public init(fromPointer ptr: spine_event_timeline) {
|
||||
super.init(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_timeline_wrapper.self))
|
||||
}
|
||||
|
||||
@ -33,11 +33,14 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// FromProperty wrapper
|
||||
open class FromProperty {
|
||||
@objc(SpineFromProperty)
|
||||
@objcMembers
|
||||
open class FromProperty: NSObject {
|
||||
public let _ptr: UnsafeMutableRawPointer
|
||||
|
||||
public init(fromPointer ptr: spine_from_property) {
|
||||
self._ptr = UnsafeMutableRawPointer(ptr)
|
||||
super.init()
|
||||
}
|
||||
|
||||
public var rtti: Rtti {
|
||||
|
||||
@ -33,7 +33,10 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// FromRotate wrapper
|
||||
@objc(SpineFromRotate)
|
||||
@objcMembers
|
||||
public class FromRotate: FromProperty {
|
||||
@nonobjc
|
||||
public init(fromPointer ptr: spine_from_rotate) {
|
||||
super.init(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_from_property_wrapper.self))
|
||||
}
|
||||
|
||||
@ -33,7 +33,10 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// FromScaleX wrapper
|
||||
@objc(SpineFromScaleX)
|
||||
@objcMembers
|
||||
public class FromScaleX: FromProperty {
|
||||
@nonobjc
|
||||
public init(fromPointer ptr: spine_from_scale_x) {
|
||||
super.init(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_from_property_wrapper.self))
|
||||
}
|
||||
|
||||
@ -33,7 +33,10 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// FromScaleY wrapper
|
||||
@objc(SpineFromScaleY)
|
||||
@objcMembers
|
||||
public class FromScaleY: FromProperty {
|
||||
@nonobjc
|
||||
public init(fromPointer ptr: spine_from_scale_y) {
|
||||
super.init(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_from_property_wrapper.self))
|
||||
}
|
||||
|
||||
@ -33,7 +33,10 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// FromShearY wrapper
|
||||
@objc(SpineFromShearY)
|
||||
@objcMembers
|
||||
public class FromShearY: FromProperty {
|
||||
@nonobjc
|
||||
public init(fromPointer ptr: spine_from_shear_y) {
|
||||
super.init(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_from_property_wrapper.self))
|
||||
}
|
||||
|
||||
@ -33,7 +33,10 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// FromX wrapper
|
||||
@objc(SpineFromX)
|
||||
@objcMembers
|
||||
public class FromX: FromProperty {
|
||||
@nonobjc
|
||||
public init(fromPointer ptr: spine_from_x) {
|
||||
super.init(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_from_property_wrapper.self))
|
||||
}
|
||||
|
||||
@ -33,7 +33,10 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// FromY wrapper
|
||||
@objc(SpineFromY)
|
||||
@objcMembers
|
||||
public class FromY: FromProperty {
|
||||
@nonobjc
|
||||
public init(fromPointer ptr: spine_from_y) {
|
||||
super.init(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_from_property_wrapper.self))
|
||||
}
|
||||
|
||||
@ -33,7 +33,10 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// IkConstraint wrapper
|
||||
@objc(SpineIkConstraint)
|
||||
@objcMembers
|
||||
public class IkConstraint: PosedActive, Posed, Constraint {
|
||||
@nonobjc
|
||||
public init(fromPointer ptr: spine_ik_constraint) {
|
||||
super.init(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_posed_active_wrapper.self))
|
||||
}
|
||||
|
||||
@ -33,7 +33,10 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// IkConstraintData wrapper
|
||||
@objc(SpineIkConstraintData)
|
||||
@objcMembers
|
||||
public class IkConstraintData: PosedData, ConstraintData {
|
||||
@nonobjc
|
||||
public init(fromPointer ptr: spine_ik_constraint_data) {
|
||||
super.init(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_posed_data_wrapper.self))
|
||||
}
|
||||
@ -81,8 +84,8 @@ public class IkConstraintData: PosedData, ConstraintData {
|
||||
public func createMethod(_ skeleton: Skeleton) -> Constraint {
|
||||
let result = spine_ik_constraint_data_create_method(_ptr.assumingMemoryBound(to: spine_ik_constraint_data_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||
let rtti = spine_constraint_get_rtti(result!)
|
||||
let className = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||
switch className {
|
||||
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||
switch rttiClassName {
|
||||
case "spine_ik_constraint":
|
||||
return IkConstraint(fromPointer: UnsafeMutableRawPointer(result!).assumingMemoryBound(to: spine_ik_constraint_wrapper.self))
|
||||
case "spine_path_constraint":
|
||||
@ -94,7 +97,7 @@ public class IkConstraintData: PosedData, ConstraintData {
|
||||
case "spine_transform_constraint":
|
||||
return TransformConstraint(fromPointer: UnsafeMutableRawPointer(result!).assumingMemoryBound(to: spine_transform_constraint_wrapper.self))
|
||||
default:
|
||||
fatalError("Unknown concrete type: \(className) for abstract class Constraint")
|
||||
fatalError("Unknown concrete type: \(rttiClassName) for abstract class Constraint")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -33,14 +33,17 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// IkConstraintPose wrapper
|
||||
public class IkConstraintPose {
|
||||
@objc(SpineIkConstraintPose)
|
||||
@objcMembers
|
||||
public class IkConstraintPose: NSObject {
|
||||
public let _ptr: UnsafeMutableRawPointer
|
||||
|
||||
public init(fromPointer ptr: spine_ik_constraint_pose) {
|
||||
self._ptr = UnsafeMutableRawPointer(ptr)
|
||||
super.init()
|
||||
}
|
||||
|
||||
public convenience init() {
|
||||
public override convenience init() {
|
||||
let ptr = spine_ik_constraint_pose_create()
|
||||
self.init(fromPointer: ptr!)
|
||||
}
|
||||
|
||||
@ -33,7 +33,10 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// IkConstraintTimeline wrapper
|
||||
@objc(SpineIkConstraintTimeline)
|
||||
@objcMembers
|
||||
public class IkConstraintTimeline: CurveTimeline, ConstraintTimeline {
|
||||
@nonobjc
|
||||
public init(fromPointer ptr: spine_ik_constraint_timeline) {
|
||||
super.init(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_curve_timeline_wrapper.self))
|
||||
}
|
||||
|
||||
@ -33,7 +33,10 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// InheritTimeline wrapper
|
||||
@objc(SpineInheritTimeline)
|
||||
@objcMembers
|
||||
public class InheritTimeline: Timeline, BoneTimeline {
|
||||
@nonobjc
|
||||
public init(fromPointer ptr: spine_inherit_timeline) {
|
||||
super.init(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_timeline_wrapper.self))
|
||||
}
|
||||
|
||||
@ -33,7 +33,10 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// MeshAttachment wrapper
|
||||
@objc(SpineMeshAttachment)
|
||||
@objcMembers
|
||||
public class MeshAttachment: VertexAttachment {
|
||||
@nonobjc
|
||||
public init(fromPointer ptr: spine_mesh_attachment) {
|
||||
super.init(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_vertex_attachment_wrapper.self))
|
||||
}
|
||||
|
||||
@ -33,7 +33,10 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// PathAttachment wrapper
|
||||
@objc(SpinePathAttachment)
|
||||
@objcMembers
|
||||
public class PathAttachment: VertexAttachment {
|
||||
@nonobjc
|
||||
public init(fromPointer ptr: spine_path_attachment) {
|
||||
super.init(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_vertex_attachment_wrapper.self))
|
||||
}
|
||||
|
||||
@ -33,7 +33,10 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// PathConstraint wrapper
|
||||
@objc(SpinePathConstraint)
|
||||
@objcMembers
|
||||
public class PathConstraint: PosedActive, Posed, Constraint {
|
||||
@nonobjc
|
||||
public init(fromPointer ptr: spine_path_constraint) {
|
||||
super.init(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_posed_active_wrapper.self))
|
||||
}
|
||||
|
||||
@ -33,7 +33,10 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// PathConstraintData wrapper
|
||||
@objc(SpinePathConstraintData)
|
||||
@objcMembers
|
||||
public class PathConstraintData: PosedData, ConstraintData {
|
||||
@nonobjc
|
||||
public init(fromPointer ptr: spine_path_constraint_data) {
|
||||
super.init(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_posed_data_wrapper.self))
|
||||
}
|
||||
@ -111,8 +114,8 @@ public class PathConstraintData: PosedData, ConstraintData {
|
||||
public func createMethod(_ skeleton: Skeleton) -> Constraint {
|
||||
let result = spine_path_constraint_data_create_method(_ptr.assumingMemoryBound(to: spine_path_constraint_data_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||
let rtti = spine_constraint_get_rtti(result!)
|
||||
let className = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||
switch className {
|
||||
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||
switch rttiClassName {
|
||||
case "spine_ik_constraint":
|
||||
return IkConstraint(fromPointer: UnsafeMutableRawPointer(result!).assumingMemoryBound(to: spine_ik_constraint_wrapper.self))
|
||||
case "spine_path_constraint":
|
||||
@ -124,7 +127,7 @@ public class PathConstraintData: PosedData, ConstraintData {
|
||||
case "spine_transform_constraint":
|
||||
return TransformConstraint(fromPointer: UnsafeMutableRawPointer(result!).assumingMemoryBound(to: spine_transform_constraint_wrapper.self))
|
||||
default:
|
||||
fatalError("Unknown concrete type: \(className) for abstract class Constraint")
|
||||
fatalError("Unknown concrete type: \(rttiClassName) for abstract class Constraint")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -33,7 +33,10 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// PathConstraintMixTimeline wrapper
|
||||
@objc(SpinePathConstraintMixTimeline)
|
||||
@objcMembers
|
||||
public class PathConstraintMixTimeline: CurveTimeline, ConstraintTimeline {
|
||||
@nonobjc
|
||||
public init(fromPointer ptr: spine_path_constraint_mix_timeline) {
|
||||
super.init(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_curve_timeline_wrapper.self))
|
||||
}
|
||||
|
||||
@ -33,14 +33,17 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// PathConstraintPose wrapper
|
||||
public class PathConstraintPose {
|
||||
@objc(SpinePathConstraintPose)
|
||||
@objcMembers
|
||||
public class PathConstraintPose: NSObject {
|
||||
public let _ptr: UnsafeMutableRawPointer
|
||||
|
||||
public init(fromPointer ptr: spine_path_constraint_pose) {
|
||||
self._ptr = UnsafeMutableRawPointer(ptr)
|
||||
super.init()
|
||||
}
|
||||
|
||||
public convenience init() {
|
||||
public override convenience init() {
|
||||
let ptr = spine_path_constraint_pose_create()
|
||||
self.init(fromPointer: ptr!)
|
||||
}
|
||||
|
||||
@ -33,7 +33,10 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// PathConstraintPositionTimeline wrapper
|
||||
@objc(SpinePathConstraintPositionTimeline)
|
||||
@objcMembers
|
||||
public class PathConstraintPositionTimeline: ConstraintTimeline1 {
|
||||
@nonobjc
|
||||
public init(fromPointer ptr: spine_path_constraint_position_timeline) {
|
||||
super.init(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_constraint_timeline1_wrapper.self))
|
||||
}
|
||||
|
||||
@ -33,7 +33,10 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// PathConstraintSpacingTimeline wrapper
|
||||
@objc(SpinePathConstraintSpacingTimeline)
|
||||
@objcMembers
|
||||
public class PathConstraintSpacingTimeline: ConstraintTimeline1 {
|
||||
@nonobjc
|
||||
public init(fromPointer ptr: spine_path_constraint_spacing_timeline) {
|
||||
super.init(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_constraint_timeline1_wrapper.self))
|
||||
}
|
||||
|
||||
@ -33,7 +33,10 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// PhysicsConstraint wrapper
|
||||
@objc(SpinePhysicsConstraint)
|
||||
@objcMembers
|
||||
public class PhysicsConstraint: PosedActive, Posed, Constraint {
|
||||
@nonobjc
|
||||
public init(fromPointer ptr: spine_physics_constraint) {
|
||||
super.init(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_posed_active_wrapper.self))
|
||||
}
|
||||
|
||||
@ -33,7 +33,10 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// PhysicsConstraintDampingTimeline wrapper
|
||||
@objc(SpinePhysicsConstraintDampingTimeline)
|
||||
@objcMembers
|
||||
public class PhysicsConstraintDampingTimeline: PhysicsConstraintTimeline {
|
||||
@nonobjc
|
||||
public init(fromPointer ptr: spine_physics_constraint_damping_timeline) {
|
||||
super.init(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_physics_constraint_timeline_wrapper.self))
|
||||
}
|
||||
|
||||
@ -33,7 +33,10 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// PhysicsConstraintData wrapper
|
||||
@objc(SpinePhysicsConstraintData)
|
||||
@objcMembers
|
||||
public class PhysicsConstraintData: PosedData, ConstraintData {
|
||||
@nonobjc
|
||||
public init(fromPointer ptr: spine_physics_constraint_data) {
|
||||
super.init(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_posed_data_wrapper.self))
|
||||
}
|
||||
@ -206,8 +209,8 @@ public class PhysicsConstraintData: PosedData, ConstraintData {
|
||||
public func createMethod(_ skeleton: Skeleton) -> Constraint {
|
||||
let result = spine_physics_constraint_data_create_method(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||
let rtti = spine_constraint_get_rtti(result!)
|
||||
let className = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||
switch className {
|
||||
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||
switch rttiClassName {
|
||||
case "spine_ik_constraint":
|
||||
return IkConstraint(fromPointer: UnsafeMutableRawPointer(result!).assumingMemoryBound(to: spine_ik_constraint_wrapper.self))
|
||||
case "spine_path_constraint":
|
||||
@ -219,7 +222,7 @@ public class PhysicsConstraintData: PosedData, ConstraintData {
|
||||
case "spine_transform_constraint":
|
||||
return TransformConstraint(fromPointer: UnsafeMutableRawPointer(result!).assumingMemoryBound(to: spine_transform_constraint_wrapper.self))
|
||||
default:
|
||||
fatalError("Unknown concrete type: \(className) for abstract class Constraint")
|
||||
fatalError("Unknown concrete type: \(rttiClassName) for abstract class Constraint")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -33,7 +33,10 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// PhysicsConstraintGravityTimeline wrapper
|
||||
@objc(SpinePhysicsConstraintGravityTimeline)
|
||||
@objcMembers
|
||||
public class PhysicsConstraintGravityTimeline: PhysicsConstraintTimeline {
|
||||
@nonobjc
|
||||
public init(fromPointer ptr: spine_physics_constraint_gravity_timeline) {
|
||||
super.init(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_physics_constraint_timeline_wrapper.self))
|
||||
}
|
||||
|
||||
@ -33,7 +33,10 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// PhysicsConstraintInertiaTimeline wrapper
|
||||
@objc(SpinePhysicsConstraintInertiaTimeline)
|
||||
@objcMembers
|
||||
public class PhysicsConstraintInertiaTimeline: PhysicsConstraintTimeline {
|
||||
@nonobjc
|
||||
public init(fromPointer ptr: spine_physics_constraint_inertia_timeline) {
|
||||
super.init(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_physics_constraint_timeline_wrapper.self))
|
||||
}
|
||||
|
||||
@ -33,7 +33,10 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// PhysicsConstraintMassTimeline wrapper
|
||||
@objc(SpinePhysicsConstraintMassTimeline)
|
||||
@objcMembers
|
||||
public class PhysicsConstraintMassTimeline: PhysicsConstraintTimeline {
|
||||
@nonobjc
|
||||
public init(fromPointer ptr: spine_physics_constraint_mass_timeline) {
|
||||
super.init(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_physics_constraint_timeline_wrapper.self))
|
||||
}
|
||||
|
||||
@ -33,7 +33,10 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// PhysicsConstraintMixTimeline wrapper
|
||||
@objc(SpinePhysicsConstraintMixTimeline)
|
||||
@objcMembers
|
||||
public class PhysicsConstraintMixTimeline: PhysicsConstraintTimeline {
|
||||
@nonobjc
|
||||
public init(fromPointer ptr: spine_physics_constraint_mix_timeline) {
|
||||
super.init(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_physics_constraint_timeline_wrapper.self))
|
||||
}
|
||||
|
||||
@ -33,14 +33,17 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// PhysicsConstraintPose wrapper
|
||||
public class PhysicsConstraintPose {
|
||||
@objc(SpinePhysicsConstraintPose)
|
||||
@objcMembers
|
||||
public class PhysicsConstraintPose: NSObject {
|
||||
public let _ptr: UnsafeMutableRawPointer
|
||||
|
||||
public init(fromPointer ptr: spine_physics_constraint_pose) {
|
||||
self._ptr = UnsafeMutableRawPointer(ptr)
|
||||
super.init()
|
||||
}
|
||||
|
||||
public convenience init() {
|
||||
public override convenience init() {
|
||||
let ptr = spine_physics_constraint_pose_create()
|
||||
self.init(fromPointer: ptr!)
|
||||
}
|
||||
|
||||
@ -33,7 +33,10 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// PhysicsConstraintResetTimeline wrapper
|
||||
@objc(SpinePhysicsConstraintResetTimeline)
|
||||
@objcMembers
|
||||
public class PhysicsConstraintResetTimeline: Timeline, ConstraintTimeline {
|
||||
@nonobjc
|
||||
public init(fromPointer ptr: spine_physics_constraint_reset_timeline) {
|
||||
super.init(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_timeline_wrapper.self))
|
||||
}
|
||||
|
||||
@ -33,7 +33,10 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// PhysicsConstraintStrengthTimeline wrapper
|
||||
@objc(SpinePhysicsConstraintStrengthTimeline)
|
||||
@objcMembers
|
||||
public class PhysicsConstraintStrengthTimeline: PhysicsConstraintTimeline {
|
||||
@nonobjc
|
||||
public init(fromPointer ptr: spine_physics_constraint_strength_timeline) {
|
||||
super.init(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_physics_constraint_timeline_wrapper.self))
|
||||
}
|
||||
|
||||
@ -33,7 +33,10 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// PhysicsConstraintTimeline wrapper
|
||||
@objc(SpinePhysicsConstraintTimeline)
|
||||
@objcMembers
|
||||
open class PhysicsConstraintTimeline: CurveTimeline1, ConstraintTimeline {
|
||||
@nonobjc
|
||||
public init(fromPointer ptr: spine_physics_constraint_timeline) {
|
||||
super.init(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_curve_timeline1_wrapper.self))
|
||||
}
|
||||
|
||||
@ -33,7 +33,10 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// PhysicsConstraintWindTimeline wrapper
|
||||
@objc(SpinePhysicsConstraintWindTimeline)
|
||||
@objcMembers
|
||||
public class PhysicsConstraintWindTimeline: PhysicsConstraintTimeline {
|
||||
@nonobjc
|
||||
public init(fromPointer ptr: spine_physics_constraint_wind_timeline) {
|
||||
super.init(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_physics_constraint_timeline_wrapper.self))
|
||||
}
|
||||
|
||||
@ -33,7 +33,10 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// PointAttachment wrapper
|
||||
@objc(SpinePointAttachment)
|
||||
@objcMembers
|
||||
public class PointAttachment: Attachment {
|
||||
@nonobjc
|
||||
public init(fromPointer ptr: spine_point_attachment) {
|
||||
super.init(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_attachment_wrapper.self))
|
||||
}
|
||||
|
||||
@ -33,11 +33,14 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// PosedActive wrapper
|
||||
public class PosedActive {
|
||||
@objc(SpinePosedActive)
|
||||
@objcMembers
|
||||
public class PosedActive: NSObject {
|
||||
public let _ptr: UnsafeMutableRawPointer
|
||||
|
||||
public init(fromPointer ptr: spine_posed_active) {
|
||||
self._ptr = UnsafeMutableRawPointer(ptr)
|
||||
super.init()
|
||||
}
|
||||
|
||||
public var isActive: Bool {
|
||||
|
||||
@ -33,11 +33,14 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// PosedData wrapper
|
||||
public class PosedData {
|
||||
@objc(SpinePosedData)
|
||||
@objcMembers
|
||||
public class PosedData: NSObject {
|
||||
public let _ptr: UnsafeMutableRawPointer
|
||||
|
||||
public init(fromPointer ptr: spine_posed_data) {
|
||||
self._ptr = UnsafeMutableRawPointer(ptr)
|
||||
super.init()
|
||||
}
|
||||
|
||||
public convenience init(_ name: String) {
|
||||
|
||||
@ -33,7 +33,10 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// RegionAttachment wrapper
|
||||
@objc(SpineRegionAttachment)
|
||||
@objcMembers
|
||||
public class RegionAttachment: Attachment {
|
||||
@nonobjc
|
||||
public init(fromPointer ptr: spine_region_attachment) {
|
||||
super.init(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_attachment_wrapper.self))
|
||||
}
|
||||
|
||||
@ -33,11 +33,14 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// RenderCommand wrapper
|
||||
public class RenderCommand {
|
||||
@objc(SpineRenderCommand)
|
||||
@objcMembers
|
||||
public class RenderCommand: NSObject {
|
||||
public let _ptr: UnsafeMutableRawPointer
|
||||
|
||||
public init(fromPointer ptr: spine_render_command) {
|
||||
self._ptr = UnsafeMutableRawPointer(ptr)
|
||||
super.init()
|
||||
}
|
||||
|
||||
public var positions: UnsafeMutablePointer<Float>? {
|
||||
|
||||
@ -33,7 +33,10 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// Rgb2Timeline wrapper
|
||||
@objc(SpineRgb2Timeline)
|
||||
@objcMembers
|
||||
public class Rgb2Timeline: SlotCurveTimeline {
|
||||
@nonobjc
|
||||
public init(fromPointer ptr: spine_rgb2_timeline) {
|
||||
super.init(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_slot_curve_timeline_wrapper.self))
|
||||
}
|
||||
|
||||
@ -33,7 +33,10 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// RgbTimeline wrapper
|
||||
@objc(SpineRgbTimeline)
|
||||
@objcMembers
|
||||
public class RgbTimeline: SlotCurveTimeline {
|
||||
@nonobjc
|
||||
public init(fromPointer ptr: spine_rgb_timeline) {
|
||||
super.init(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_slot_curve_timeline_wrapper.self))
|
||||
}
|
||||
|
||||
@ -33,7 +33,10 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// Rgba2Timeline wrapper
|
||||
@objc(SpineRgba2Timeline)
|
||||
@objcMembers
|
||||
public class Rgba2Timeline: SlotCurveTimeline {
|
||||
@nonobjc
|
||||
public init(fromPointer ptr: spine_rgba2_timeline) {
|
||||
super.init(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_slot_curve_timeline_wrapper.self))
|
||||
}
|
||||
|
||||
@ -33,7 +33,10 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// RgbaTimeline wrapper
|
||||
@objc(SpineRgbaTimeline)
|
||||
@objcMembers
|
||||
public class RgbaTimeline: SlotCurveTimeline {
|
||||
@nonobjc
|
||||
public init(fromPointer ptr: spine_rgba_timeline) {
|
||||
super.init(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_slot_curve_timeline_wrapper.self))
|
||||
}
|
||||
|
||||
@ -33,7 +33,10 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// RotateTimeline wrapper
|
||||
@objc(SpineRotateTimeline)
|
||||
@objcMembers
|
||||
public class RotateTimeline: BoneTimeline1 {
|
||||
@nonobjc
|
||||
public init(fromPointer ptr: spine_rotate_timeline) {
|
||||
super.init(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_bone_timeline1_wrapper.self))
|
||||
}
|
||||
|
||||
@ -33,7 +33,10 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// ScaleTimeline wrapper
|
||||
@objc(SpineScaleTimeline)
|
||||
@objcMembers
|
||||
public class ScaleTimeline: BoneTimeline2 {
|
||||
@nonobjc
|
||||
public init(fromPointer ptr: spine_scale_timeline) {
|
||||
super.init(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_bone_timeline2_wrapper.self))
|
||||
}
|
||||
|
||||
@ -33,7 +33,10 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// ScaleXTimeline wrapper
|
||||
@objc(SpineScaleXTimeline)
|
||||
@objcMembers
|
||||
public class ScaleXTimeline: BoneTimeline1 {
|
||||
@nonobjc
|
||||
public init(fromPointer ptr: spine_scale_x_timeline) {
|
||||
super.init(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_bone_timeline1_wrapper.self))
|
||||
}
|
||||
|
||||
@ -33,7 +33,10 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// ScaleYTimeline wrapper
|
||||
@objc(SpineScaleYTimeline)
|
||||
@objcMembers
|
||||
public class ScaleYTimeline: BoneTimeline1 {
|
||||
@nonobjc
|
||||
public init(fromPointer ptr: spine_scale_y_timeline) {
|
||||
super.init(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_bone_timeline1_wrapper.self))
|
||||
}
|
||||
|
||||
@ -33,7 +33,10 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// SequenceTimeline wrapper
|
||||
@objc(SpineSequenceTimeline)
|
||||
@objcMembers
|
||||
public class SequenceTimeline: Timeline, SlotTimeline {
|
||||
@nonobjc
|
||||
public init(fromPointer ptr: spine_sequence_timeline) {
|
||||
super.init(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_timeline_wrapper.self))
|
||||
}
|
||||
@ -46,8 +49,8 @@ public class SequenceTimeline: Timeline, SlotTimeline {
|
||||
public var attachment: Attachment {
|
||||
let result = spine_sequence_timeline_get_attachment(_ptr.assumingMemoryBound(to: spine_sequence_timeline_wrapper.self))
|
||||
let rtti = spine_attachment_get_rtti(result!)
|
||||
let className = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||
switch className {
|
||||
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||
switch rttiClassName {
|
||||
case "spine_bounding_box_attachment":
|
||||
return BoundingBoxAttachment(fromPointer: UnsafeMutableRawPointer(result!).assumingMemoryBound(to: spine_bounding_box_attachment_wrapper.self))
|
||||
case "spine_clipping_attachment":
|
||||
@ -61,7 +64,7 @@ public class SequenceTimeline: Timeline, SlotTimeline {
|
||||
case "spine_region_attachment":
|
||||
return RegionAttachment(fromPointer: UnsafeMutableRawPointer(result!).assumingMemoryBound(to: spine_region_attachment_wrapper.self))
|
||||
default:
|
||||
fatalError("Unknown concrete type: \(className) for abstract class Attachment")
|
||||
fatalError("Unknown concrete type: \(rttiClassName) for abstract class Attachment")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -33,7 +33,10 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// ShearTimeline wrapper
|
||||
@objc(SpineShearTimeline)
|
||||
@objcMembers
|
||||
public class ShearTimeline: BoneTimeline2 {
|
||||
@nonobjc
|
||||
public init(fromPointer ptr: spine_shear_timeline) {
|
||||
super.init(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_bone_timeline2_wrapper.self))
|
||||
}
|
||||
|
||||
@ -33,7 +33,10 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// ShearXTimeline wrapper
|
||||
@objc(SpineShearXTimeline)
|
||||
@objcMembers
|
||||
public class ShearXTimeline: BoneTimeline1 {
|
||||
@nonobjc
|
||||
public init(fromPointer ptr: spine_shear_x_timeline) {
|
||||
super.init(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_bone_timeline1_wrapper.self))
|
||||
}
|
||||
|
||||
@ -33,7 +33,10 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// ShearYTimeline wrapper
|
||||
@objc(SpineShearYTimeline)
|
||||
@objcMembers
|
||||
public class ShearYTimeline: BoneTimeline1 {
|
||||
@nonobjc
|
||||
public init(fromPointer ptr: spine_shear_y_timeline) {
|
||||
super.init(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_bone_timeline1_wrapper.self))
|
||||
}
|
||||
|
||||
@ -33,11 +33,14 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// SkeletonBinary wrapper
|
||||
public class SkeletonBinary {
|
||||
@objc(SpineSkeletonBinary)
|
||||
@objcMembers
|
||||
public class SkeletonBinary: NSObject {
|
||||
public let _ptr: UnsafeMutableRawPointer
|
||||
|
||||
public init(fromPointer ptr: spine_skeleton_binary) {
|
||||
self._ptr = UnsafeMutableRawPointer(ptr)
|
||||
super.init()
|
||||
}
|
||||
|
||||
public convenience init(_ atlas: Atlas) {
|
||||
|
||||
@ -33,14 +33,17 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// SkeletonBounds wrapper
|
||||
public class SkeletonBounds {
|
||||
@objc(SpineSkeletonBounds)
|
||||
@objcMembers
|
||||
public class SkeletonBounds: NSObject {
|
||||
public let _ptr: UnsafeMutableRawPointer
|
||||
|
||||
public init(fromPointer ptr: spine_skeleton_bounds) {
|
||||
self._ptr = UnsafeMutableRawPointer(ptr)
|
||||
super.init()
|
||||
}
|
||||
|
||||
public convenience init() {
|
||||
public override convenience init() {
|
||||
let ptr = spine_skeleton_bounds_create()
|
||||
self.init(fromPointer: ptr!)
|
||||
}
|
||||
|
||||
@ -33,14 +33,17 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// SkeletonClipping wrapper
|
||||
public class SkeletonClipping {
|
||||
@objc(SpineSkeletonClipping)
|
||||
@objcMembers
|
||||
public class SkeletonClipping: NSObject {
|
||||
public let _ptr: UnsafeMutableRawPointer
|
||||
|
||||
public init(fromPointer ptr: spine_skeleton_clipping) {
|
||||
self._ptr = UnsafeMutableRawPointer(ptr)
|
||||
super.init()
|
||||
}
|
||||
|
||||
public convenience init() {
|
||||
public override convenience init() {
|
||||
let ptr = spine_skeleton_clipping_create()
|
||||
self.init(fromPointer: ptr!)
|
||||
}
|
||||
|
||||
@ -33,14 +33,17 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// SkeletonData wrapper
|
||||
public class SkeletonData {
|
||||
@objc(SpineSkeletonData)
|
||||
@objcMembers
|
||||
public class SkeletonData: NSObject {
|
||||
public let _ptr: UnsafeMutableRawPointer
|
||||
|
||||
public init(fromPointer ptr: spine_skeleton_data) {
|
||||
self._ptr = UnsafeMutableRawPointer(ptr)
|
||||
super.init()
|
||||
}
|
||||
|
||||
public convenience init() {
|
||||
public override convenience init() {
|
||||
let ptr = spine_skeleton_data_create()
|
||||
self.init(fromPointer: ptr!)
|
||||
}
|
||||
@ -155,7 +158,7 @@ public class SkeletonData {
|
||||
}
|
||||
}
|
||||
|
||||
public var hash: String {
|
||||
public var hashString: String {
|
||||
get {
|
||||
let result = spine_skeleton_data_get_hash(_ptr.assumingMemoryBound(to: spine_skeleton_data_wrapper.self))
|
||||
return String(cString: result!)
|
||||
|
||||
@ -33,11 +33,14 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// SkeletonJson wrapper
|
||||
public class SkeletonJson {
|
||||
@objc(SpineSkeletonJson)
|
||||
@objcMembers
|
||||
public class SkeletonJson: NSObject {
|
||||
public let _ptr: UnsafeMutableRawPointer
|
||||
|
||||
public init(fromPointer ptr: spine_skeleton_json) {
|
||||
self._ptr = UnsafeMutableRawPointer(ptr)
|
||||
super.init()
|
||||
}
|
||||
|
||||
public convenience init(_ atlas: Atlas) {
|
||||
|
||||
@ -33,14 +33,17 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// SkeletonRenderer wrapper
|
||||
public class SkeletonRenderer {
|
||||
@objc(SpineSkeletonRenderer)
|
||||
@objcMembers
|
||||
public class SkeletonRenderer: NSObject {
|
||||
public let _ptr: UnsafeMutableRawPointer
|
||||
|
||||
public init(fromPointer ptr: spine_skeleton_renderer) {
|
||||
self._ptr = UnsafeMutableRawPointer(ptr)
|
||||
super.init()
|
||||
}
|
||||
|
||||
public convenience init() {
|
||||
public override convenience init() {
|
||||
let ptr = spine_skeleton_renderer_create()
|
||||
self.init(fromPointer: ptr!)
|
||||
}
|
||||
|
||||
@ -33,7 +33,10 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// SliderData wrapper
|
||||
@objc(SpineSliderData)
|
||||
@objcMembers
|
||||
public class SliderData: PosedData, ConstraintData {
|
||||
@nonobjc
|
||||
public init(fromPointer ptr: spine_slider_data) {
|
||||
super.init(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_posed_data_wrapper.self))
|
||||
}
|
||||
@ -93,8 +96,8 @@ public class SliderData: PosedData, ConstraintData {
|
||||
let result = spine_slider_data_get_property(_ptr.assumingMemoryBound(to: spine_slider_data_wrapper.self))
|
||||
guard let ptr = result else { return nil }
|
||||
let rtti = spine_from_property_get_rtti(ptr)
|
||||
let className = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||
switch className {
|
||||
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||
switch rttiClassName {
|
||||
case "spine_from_rotate":
|
||||
return FromRotate(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_from_rotate_wrapper.self))
|
||||
case "spine_from_scale_x":
|
||||
@ -108,7 +111,7 @@ public class SliderData: PosedData, ConstraintData {
|
||||
case "spine_from_y":
|
||||
return FromY(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_from_y_wrapper.self))
|
||||
default:
|
||||
fatalError("Unknown concrete type: \(className) for abstract class FromProperty")
|
||||
fatalError("Unknown concrete type: \(rttiClassName) for abstract class FromProperty")
|
||||
}
|
||||
}
|
||||
set {
|
||||
@ -154,8 +157,8 @@ public class SliderData: PosedData, ConstraintData {
|
||||
public func createMethod(_ skeleton: Skeleton) -> Constraint {
|
||||
let result = spine_slider_data_create_method(_ptr.assumingMemoryBound(to: spine_slider_data_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||
let rtti = spine_constraint_get_rtti(result!)
|
||||
let className = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||
switch className {
|
||||
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||
switch rttiClassName {
|
||||
case "spine_ik_constraint":
|
||||
return IkConstraint(fromPointer: UnsafeMutableRawPointer(result!).assumingMemoryBound(to: spine_ik_constraint_wrapper.self))
|
||||
case "spine_path_constraint":
|
||||
@ -167,7 +170,7 @@ public class SliderData: PosedData, ConstraintData {
|
||||
case "spine_transform_constraint":
|
||||
return TransformConstraint(fromPointer: UnsafeMutableRawPointer(result!).assumingMemoryBound(to: spine_transform_constraint_wrapper.self))
|
||||
default:
|
||||
fatalError("Unknown concrete type: \(className) for abstract class Constraint")
|
||||
fatalError("Unknown concrete type: \(rttiClassName) for abstract class Constraint")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -33,7 +33,10 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// SliderMixTimeline wrapper
|
||||
@objc(SpineSliderMixTimeline)
|
||||
@objcMembers
|
||||
public class SliderMixTimeline: ConstraintTimeline1 {
|
||||
@nonobjc
|
||||
public init(fromPointer ptr: spine_slider_mix_timeline) {
|
||||
super.init(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_constraint_timeline1_wrapper.self))
|
||||
}
|
||||
|
||||
@ -33,14 +33,17 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// SliderPose wrapper
|
||||
public class SliderPose {
|
||||
@objc(SpineSliderPose)
|
||||
@objcMembers
|
||||
public class SliderPose: NSObject {
|
||||
public let _ptr: UnsafeMutableRawPointer
|
||||
|
||||
public init(fromPointer ptr: spine_slider_pose) {
|
||||
self._ptr = UnsafeMutableRawPointer(ptr)
|
||||
super.init()
|
||||
}
|
||||
|
||||
public convenience init() {
|
||||
public override convenience init() {
|
||||
let ptr = spine_slider_pose_create()
|
||||
self.init(fromPointer: ptr!)
|
||||
}
|
||||
|
||||
@ -33,7 +33,10 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// SliderTimeline wrapper
|
||||
@objc(SpineSliderTimeline)
|
||||
@objcMembers
|
||||
public class SliderTimeline: ConstraintTimeline1 {
|
||||
@nonobjc
|
||||
public init(fromPointer ptr: spine_slider_timeline) {
|
||||
super.init(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_constraint_timeline1_wrapper.self))
|
||||
}
|
||||
|
||||
@ -33,7 +33,10 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// SlotCurveTimeline wrapper
|
||||
@objc(SpineSlotCurveTimeline)
|
||||
@objcMembers
|
||||
open class SlotCurveTimeline: CurveTimeline, SlotTimeline {
|
||||
@nonobjc
|
||||
public init(fromPointer ptr: spine_slot_curve_timeline) {
|
||||
super.init(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_curve_timeline_wrapper.self))
|
||||
}
|
||||
|
||||
@ -33,7 +33,10 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// SlotData wrapper
|
||||
@objc(SpineSlotData)
|
||||
@objcMembers
|
||||
public class SlotData: PosedData {
|
||||
@nonobjc
|
||||
public init(fromPointer ptr: spine_slot_data) {
|
||||
super.init(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_posed_data_wrapper.self))
|
||||
}
|
||||
|
||||
@ -33,14 +33,17 @@ import Foundation
|
||||
import SpineC
|
||||
|
||||
/// SlotPose wrapper
|
||||
public class SlotPose {
|
||||
@objc(SpineSlotPose)
|
||||
@objcMembers
|
||||
public class SlotPose: NSObject {
|
||||
public let _ptr: UnsafeMutableRawPointer
|
||||
|
||||
public init(fromPointer ptr: spine_slot_pose) {
|
||||
self._ptr = UnsafeMutableRawPointer(ptr)
|
||||
super.init()
|
||||
}
|
||||
|
||||
public convenience init() {
|
||||
public override convenience init() {
|
||||
let ptr = spine_slot_pose_create()
|
||||
self.init(fromPointer: ptr!)
|
||||
}
|
||||
@ -70,8 +73,8 @@ public class SlotPose {
|
||||
let result = spine_slot_pose_get_attachment(_ptr.assumingMemoryBound(to: spine_slot_pose_wrapper.self))
|
||||
guard let ptr = result else { return nil }
|
||||
let rtti = spine_attachment_get_rtti(ptr)
|
||||
let className = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||
switch className {
|
||||
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||
switch rttiClassName {
|
||||
case "spine_bounding_box_attachment":
|
||||
return BoundingBoxAttachment(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_bounding_box_attachment_wrapper.self))
|
||||
case "spine_clipping_attachment":
|
||||
@ -85,7 +88,7 @@ public class SlotPose {
|
||||
case "spine_region_attachment":
|
||||
return RegionAttachment(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_region_attachment_wrapper.self))
|
||||
default:
|
||||
fatalError("Unknown concrete type: \(className) for abstract class Attachment")
|
||||
fatalError("Unknown concrete type: \(rttiClassName) for abstract class Attachment")
|
||||
}
|
||||
}
|
||||
set {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user