diff --git a/native/build/cocos2d_libs.xcodeproj/project.pbxproj b/native/build/cocos2d_libs.xcodeproj/project.pbxproj index 9e5ce80f5e..13fb8ea0c4 100644 --- a/native/build/cocos2d_libs.xcodeproj/project.pbxproj +++ b/native/build/cocos2d_libs.xcodeproj/project.pbxproj @@ -45,64 +45,6 @@ 15AE1BC219AADFFB00C27E9E /* ExtensionMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168321807AF4E005B8026 /* ExtensionMacros.h */; }; 15AE1BC319AADFFB00C27E9E /* cocos-ext.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A167D21807AF4D005B8026 /* cocos-ext.h */; }; 15AE1BC419AADFFB00C27E9E /* ExtensionMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168321807AF4E005B8026 /* ExtensionMacros.h */; }; - 15AE1BC919AAE01E00C27E9E /* CCControl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168351807AF4E005B8026 /* CCControl.cpp */; }; - 15AE1BCA19AAE01E00C27E9E /* CCControl.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168361807AF4E005B8026 /* CCControl.h */; }; - 15AE1BCB19AAE01E00C27E9E /* CCControlButton.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168371807AF4E005B8026 /* CCControlButton.cpp */; }; - 15AE1BCC19AAE01E00C27E9E /* CCControlButton.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168381807AF4E005B8026 /* CCControlButton.h */; }; - 15AE1BCD19AAE01E00C27E9E /* CCControlColourPicker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168391807AF4E005B8026 /* CCControlColourPicker.cpp */; }; - 15AE1BCE19AAE01E00C27E9E /* CCControlColourPicker.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A1683A1807AF4E005B8026 /* CCControlColourPicker.h */; }; - 15AE1BCF19AAE01E00C27E9E /* CCControlExtensions.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A1683B1807AF4E005B8026 /* CCControlExtensions.h */; }; - 15AE1BD019AAE01E00C27E9E /* CCControlHuePicker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A1683C1807AF4E005B8026 /* CCControlHuePicker.cpp */; }; - 15AE1BD119AAE01E00C27E9E /* CCControlHuePicker.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A1683D1807AF4E005B8026 /* CCControlHuePicker.h */; }; - 15AE1BD219AAE01E00C27E9E /* CCControlPotentiometer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A1683E1807AF4E005B8026 /* CCControlPotentiometer.cpp */; }; - 15AE1BD319AAE01E00C27E9E /* CCControlPotentiometer.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A1683F1807AF4E005B8026 /* CCControlPotentiometer.h */; }; - 15AE1BD419AAE01E00C27E9E /* CCControlSaturationBrightnessPicker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168401807AF4E005B8026 /* CCControlSaturationBrightnessPicker.cpp */; }; - 15AE1BD519AAE01E00C27E9E /* CCControlSaturationBrightnessPicker.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168411807AF4E005B8026 /* CCControlSaturationBrightnessPicker.h */; }; - 15AE1BD619AAE01E00C27E9E /* CCControlSlider.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168421807AF4E005B8026 /* CCControlSlider.cpp */; }; - 15AE1BD719AAE01E00C27E9E /* CCControlSlider.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168431807AF4E005B8026 /* CCControlSlider.h */; }; - 15AE1BD819AAE01E00C27E9E /* CCControlStepper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168441807AF4E005B8026 /* CCControlStepper.cpp */; }; - 15AE1BD919AAE01E00C27E9E /* CCControlStepper.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168451807AF4E005B8026 /* CCControlStepper.h */; }; - 15AE1BDA19AAE01E00C27E9E /* CCControlSwitch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168461807AF4E005B8026 /* CCControlSwitch.cpp */; }; - 15AE1BDB19AAE01E00C27E9E /* CCControlSwitch.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168471807AF4E005B8026 /* CCControlSwitch.h */; }; - 15AE1BDC19AAE01E00C27E9E /* CCControlUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168481807AF4E005B8026 /* CCControlUtils.cpp */; }; - 15AE1BDD19AAE01E00C27E9E /* CCControlUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168491807AF4E005B8026 /* CCControlUtils.h */; }; - 15AE1BDE19AAE01E00C27E9E /* CCInvocation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A1684A1807AF4E005B8026 /* CCInvocation.cpp */; }; - 15AE1BDF19AAE01E00C27E9E /* CCInvocation.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A1684B1807AF4E005B8026 /* CCInvocation.h */; }; - 15AE1BE219AAE01E00C27E9E /* CCScrollView.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A1685E1807AF4E005B8026 /* CCScrollView.cpp */; }; - 15AE1BE319AAE01E00C27E9E /* CCScrollView.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A1685F1807AF4E005B8026 /* CCScrollView.h */; }; - 15AE1BE419AAE01E00C27E9E /* CCTableView.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168621807AF4E005B8026 /* CCTableView.cpp */; }; - 15AE1BE519AAE01E00C27E9E /* CCTableView.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168631807AF4E005B8026 /* CCTableView.h */; }; - 15AE1BE619AAE01E00C27E9E /* CCTableViewCell.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168641807AF4E005B8026 /* CCTableViewCell.cpp */; }; - 15AE1BE719AAE01E00C27E9E /* CCTableViewCell.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168651807AF4E005B8026 /* CCTableViewCell.h */; }; - 15AE1BE819AAE01E00C27E9E /* CCControl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168351807AF4E005B8026 /* CCControl.cpp */; }; - 15AE1BE919AAE01E00C27E9E /* CCControl.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168361807AF4E005B8026 /* CCControl.h */; }; - 15AE1BEA19AAE01E00C27E9E /* CCControlButton.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168371807AF4E005B8026 /* CCControlButton.cpp */; }; - 15AE1BEB19AAE01E00C27E9E /* CCControlButton.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168381807AF4E005B8026 /* CCControlButton.h */; }; - 15AE1BEC19AAE01E00C27E9E /* CCControlColourPicker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168391807AF4E005B8026 /* CCControlColourPicker.cpp */; }; - 15AE1BED19AAE01E00C27E9E /* CCControlColourPicker.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A1683A1807AF4E005B8026 /* CCControlColourPicker.h */; }; - 15AE1BEE19AAE01E00C27E9E /* CCControlExtensions.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A1683B1807AF4E005B8026 /* CCControlExtensions.h */; }; - 15AE1BEF19AAE01E00C27E9E /* CCControlHuePicker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A1683C1807AF4E005B8026 /* CCControlHuePicker.cpp */; }; - 15AE1BF019AAE01E00C27E9E /* CCControlHuePicker.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A1683D1807AF4E005B8026 /* CCControlHuePicker.h */; }; - 15AE1BF119AAE01E00C27E9E /* CCControlPotentiometer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A1683E1807AF4E005B8026 /* CCControlPotentiometer.cpp */; }; - 15AE1BF219AAE01E00C27E9E /* CCControlPotentiometer.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A1683F1807AF4E005B8026 /* CCControlPotentiometer.h */; }; - 15AE1BF319AAE01E00C27E9E /* CCControlSaturationBrightnessPicker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168401807AF4E005B8026 /* CCControlSaturationBrightnessPicker.cpp */; }; - 15AE1BF419AAE01E00C27E9E /* CCControlSaturationBrightnessPicker.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168411807AF4E005B8026 /* CCControlSaturationBrightnessPicker.h */; }; - 15AE1BF519AAE01E00C27E9E /* CCControlSlider.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168421807AF4E005B8026 /* CCControlSlider.cpp */; }; - 15AE1BF619AAE01E00C27E9E /* CCControlSlider.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168431807AF4E005B8026 /* CCControlSlider.h */; }; - 15AE1BF719AAE01E00C27E9E /* CCControlStepper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168441807AF4E005B8026 /* CCControlStepper.cpp */; }; - 15AE1BF819AAE01E00C27E9E /* CCControlStepper.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168451807AF4E005B8026 /* CCControlStepper.h */; }; - 15AE1BF919AAE01E00C27E9E /* CCControlSwitch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168461807AF4E005B8026 /* CCControlSwitch.cpp */; }; - 15AE1BFA19AAE01E00C27E9E /* CCControlSwitch.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168471807AF4E005B8026 /* CCControlSwitch.h */; }; - 15AE1BFB19AAE01E00C27E9E /* CCControlUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168481807AF4E005B8026 /* CCControlUtils.cpp */; }; - 15AE1BFC19AAE01E00C27E9E /* CCControlUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168491807AF4E005B8026 /* CCControlUtils.h */; }; - 15AE1BFD19AAE01E00C27E9E /* CCInvocation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A1684A1807AF4E005B8026 /* CCInvocation.cpp */; }; - 15AE1BFE19AAE01E00C27E9E /* CCInvocation.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A1684B1807AF4E005B8026 /* CCInvocation.h */; }; - 15AE1C0119AAE01E00C27E9E /* CCScrollView.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A1685E1807AF4E005B8026 /* CCScrollView.cpp */; }; - 15AE1C0219AAE01E00C27E9E /* CCScrollView.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A1685F1807AF4E005B8026 /* CCScrollView.h */; }; - 15AE1C0319AAE01E00C27E9E /* CCTableView.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168621807AF4E005B8026 /* CCTableView.cpp */; }; - 15AE1C0419AAE01E00C27E9E /* CCTableView.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168631807AF4E005B8026 /* CCTableView.h */; }; - 15AE1C0519AAE01E00C27E9E /* CCTableViewCell.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168641807AF4E005B8026 /* CCTableViewCell.cpp */; }; - 15AE1C0619AAE01E00C27E9E /* CCTableViewCell.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168651807AF4E005B8026 /* CCTableViewCell.h */; }; 15EFA211198A2BB5000C57D3 /* CCProtectedNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15EFA20F198A2BB5000C57D3 /* CCProtectedNode.cpp */; }; 15EFA212198A2BB5000C57D3 /* CCProtectedNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15EFA20F198A2BB5000C57D3 /* CCProtectedNode.cpp */; }; 15EFA213198A2BB5000C57D3 /* CCProtectedNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 15EFA210198A2BB5000C57D3 /* CCProtectedNode.h */; }; @@ -1174,12 +1116,6 @@ A0E749F81BA8FD7F001A8332 /* UIEditBoxImpl-common.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0E749F51BA8FD7F001A8332 /* UIEditBoxImpl-common.cpp */; }; A0E749F91BA8FD7F001A8332 /* UIEditBoxImpl-common.h in Headers */ = {isa = PBXBuildFile; fileRef = A0E749F61BA8FD7F001A8332 /* UIEditBoxImpl-common.h */; }; A0E749FA1BA8FD7F001A8332 /* UIEditBoxImpl-common.h in Headers */ = {isa = PBXBuildFile; fileRef = A0E749F61BA8FD7F001A8332 /* UIEditBoxImpl-common.h */; }; - A60A9D5F1C200DE10070800A /* CCPhysicsDebugNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A60A9D5B1C200DE10070800A /* CCPhysicsDebugNode.cpp */; }; - A60A9D601C200DE10070800A /* CCPhysicsDebugNode.h in Headers */ = {isa = PBXBuildFile; fileRef = A60A9D5C1C200DE10070800A /* CCPhysicsDebugNode.h */; }; - A60A9D611C200DE10070800A /* CCPhysicsSprite.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A60A9D5D1C200DE10070800A /* CCPhysicsSprite.cpp */; }; - A60A9D621C200DE10070800A /* CCPhysicsSprite.h in Headers */ = {isa = PBXBuildFile; fileRef = A60A9D5E1C200DE10070800A /* CCPhysicsSprite.h */; }; - A60A9D631C200DE40070800A /* CCPhysicsDebugNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A60A9D5B1C200DE10070800A /* CCPhysicsDebugNode.cpp */; }; - A60A9D641C200DE70070800A /* CCPhysicsSprite.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A60A9D5D1C200DE10070800A /* CCPhysicsSprite.cpp */; }; A60A9D661C200E5A0070800A /* libchipmunk.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A60A9D651C200E5A0070800A /* libchipmunk.a */; }; A614E2E01C8E72360065A737 /* CCLabelTTF.h in Headers */ = {isa = PBXBuildFile; fileRef = A614E2DE1C8E72360065A737 /* CCLabelTTF.h */; }; A614E2E11C8E761D0065A737 /* CCLabelTTF.h in Headers */ = {isa = PBXBuildFile; fileRef = A614E2DE1C8E72360065A737 /* CCLabelTTF.h */; }; @@ -1846,35 +1782,6 @@ 46A15FE11807A56F005B8026 /* Export.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Export.h; sourceTree = ""; }; 46A167D21807AF4D005B8026 /* cocos-ext.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "cocos-ext.h"; sourceTree = ""; }; 46A168321807AF4E005B8026 /* ExtensionMacros.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ExtensionMacros.h; sourceTree = ""; }; - 46A168351807AF4E005B8026 /* CCControl.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCControl.cpp; sourceTree = ""; }; - 46A168361807AF4E005B8026 /* CCControl.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCControl.h; sourceTree = ""; }; - 46A168371807AF4E005B8026 /* CCControlButton.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCControlButton.cpp; sourceTree = ""; }; - 46A168381807AF4E005B8026 /* CCControlButton.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCControlButton.h; sourceTree = ""; }; - 46A168391807AF4E005B8026 /* CCControlColourPicker.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCControlColourPicker.cpp; sourceTree = ""; }; - 46A1683A1807AF4E005B8026 /* CCControlColourPicker.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCControlColourPicker.h; sourceTree = ""; }; - 46A1683B1807AF4E005B8026 /* CCControlExtensions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCControlExtensions.h; sourceTree = ""; }; - 46A1683C1807AF4E005B8026 /* CCControlHuePicker.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCControlHuePicker.cpp; sourceTree = ""; }; - 46A1683D1807AF4E005B8026 /* CCControlHuePicker.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCControlHuePicker.h; sourceTree = ""; }; - 46A1683E1807AF4E005B8026 /* CCControlPotentiometer.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCControlPotentiometer.cpp; sourceTree = ""; }; - 46A1683F1807AF4E005B8026 /* CCControlPotentiometer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCControlPotentiometer.h; sourceTree = ""; }; - 46A168401807AF4E005B8026 /* CCControlSaturationBrightnessPicker.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCControlSaturationBrightnessPicker.cpp; sourceTree = ""; }; - 46A168411807AF4E005B8026 /* CCControlSaturationBrightnessPicker.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCControlSaturationBrightnessPicker.h; sourceTree = ""; }; - 46A168421807AF4E005B8026 /* CCControlSlider.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCControlSlider.cpp; sourceTree = ""; }; - 46A168431807AF4E005B8026 /* CCControlSlider.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCControlSlider.h; sourceTree = ""; }; - 46A168441807AF4E005B8026 /* CCControlStepper.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCControlStepper.cpp; sourceTree = ""; }; - 46A168451807AF4E005B8026 /* CCControlStepper.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCControlStepper.h; sourceTree = ""; }; - 46A168461807AF4E005B8026 /* CCControlSwitch.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCControlSwitch.cpp; sourceTree = ""; }; - 46A168471807AF4E005B8026 /* CCControlSwitch.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCControlSwitch.h; sourceTree = ""; }; - 46A168481807AF4E005B8026 /* CCControlUtils.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCControlUtils.cpp; sourceTree = ""; }; - 46A168491807AF4E005B8026 /* CCControlUtils.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCControlUtils.h; sourceTree = ""; }; - 46A1684A1807AF4E005B8026 /* CCInvocation.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCInvocation.cpp; sourceTree = ""; }; - 46A1684B1807AF4E005B8026 /* CCInvocation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCInvocation.h; sourceTree = ""; }; - 46A1685E1807AF4E005B8026 /* CCScrollView.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = CCScrollView.cpp; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.cpp; }; - 46A1685F1807AF4E005B8026 /* CCScrollView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCScrollView.h; sourceTree = ""; }; - 46A168621807AF4E005B8026 /* CCTableView.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCTableView.cpp; sourceTree = ""; }; - 46A168631807AF4E005B8026 /* CCTableView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCTableView.h; sourceTree = ""; }; - 46A168641807AF4E005B8026 /* CCTableViewCell.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCTableViewCell.cpp; sourceTree = ""; }; - 46A168651807AF4E005B8026 /* CCTableViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCTableViewCell.h; sourceTree = ""; }; 4D2816641E8CBB7200F26B06 /* CCPhysicsContactImpulse.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCPhysicsContactImpulse.cpp; sourceTree = ""; }; 4D2816651E8CBB7200F26B06 /* CCPhysicsContactImpulse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCPhysicsContactImpulse.h; sourceTree = ""; }; 4D2E69031CC543B40032DD5C /* CCGraphicsNode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCGraphicsNode.cpp; path = creator/CCGraphicsNode.cpp; sourceTree = ""; }; @@ -2247,10 +2154,6 @@ A07A4D641783777C0073F6A7 /* libcocos2d iOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libcocos2d iOS.a"; sourceTree = BUILT_PRODUCTS_DIR; }; A0E749F51BA8FD7F001A8332 /* UIEditBoxImpl-common.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "UIEditBoxImpl-common.cpp"; sourceTree = ""; }; A0E749F61BA8FD7F001A8332 /* UIEditBoxImpl-common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIEditBoxImpl-common.h"; sourceTree = ""; }; - A60A9D5B1C200DE10070800A /* CCPhysicsDebugNode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCPhysicsDebugNode.cpp; path = "physics-nodes/CCPhysicsDebugNode.cpp"; sourceTree = ""; }; - A60A9D5C1C200DE10070800A /* CCPhysicsDebugNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCPhysicsDebugNode.h; path = "physics-nodes/CCPhysicsDebugNode.h"; sourceTree = ""; }; - A60A9D5D1C200DE10070800A /* CCPhysicsSprite.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCPhysicsSprite.cpp; path = "physics-nodes/CCPhysicsSprite.cpp"; sourceTree = ""; }; - A60A9D5E1C200DE10070800A /* CCPhysicsSprite.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCPhysicsSprite.h; path = "physics-nodes/CCPhysicsSprite.h"; sourceTree = ""; }; A60A9D651C200E5A0070800A /* libchipmunk.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libchipmunk.a; path = ../external/ios/libs/libchipmunk.a; sourceTree = ""; }; A614E2DE1C8E72360065A737 /* CCLabelTTF.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCLabelTTF.h; sourceTree = ""; }; A63CEFF91CD9CF3500A6971D /* CCUIEditBoxMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCUIEditBoxMac.h; path = Mac/CCUIEditBoxMac.h; sourceTree = ""; }; @@ -3276,67 +3179,13 @@ isa = PBXGroup; children = ( BA679B271CEC371100F875FA /* assets-manager */, - A60A9D5A1C200DD00070800A /* PhysicsSprite */, 46A167D21807AF4D005B8026 /* cocos-ext.h */, 46A168321807AF4E005B8026 /* ExtensionMacros.h */, - 46A168331807AF4E005B8026 /* GUI */, ); name = extensions; path = ../extensions; sourceTree = ""; }; - 46A168331807AF4E005B8026 /* GUI */ = { - isa = PBXGroup; - children = ( - 46A168341807AF4E005B8026 /* CCControlExtension */, - 46A1685D1807AF4E005B8026 /* CCScrollView */, - ); - path = GUI; - sourceTree = ""; - }; - 46A168341807AF4E005B8026 /* CCControlExtension */ = { - isa = PBXGroup; - children = ( - 46A168351807AF4E005B8026 /* CCControl.cpp */, - 46A168361807AF4E005B8026 /* CCControl.h */, - 46A168371807AF4E005B8026 /* CCControlButton.cpp */, - 46A168381807AF4E005B8026 /* CCControlButton.h */, - 46A168391807AF4E005B8026 /* CCControlColourPicker.cpp */, - 46A1683A1807AF4E005B8026 /* CCControlColourPicker.h */, - 46A1683B1807AF4E005B8026 /* CCControlExtensions.h */, - 46A1683C1807AF4E005B8026 /* CCControlHuePicker.cpp */, - 46A1683D1807AF4E005B8026 /* CCControlHuePicker.h */, - 46A1683E1807AF4E005B8026 /* CCControlPotentiometer.cpp */, - 46A1683F1807AF4E005B8026 /* CCControlPotentiometer.h */, - 46A168401807AF4E005B8026 /* CCControlSaturationBrightnessPicker.cpp */, - 46A168411807AF4E005B8026 /* CCControlSaturationBrightnessPicker.h */, - 46A168421807AF4E005B8026 /* CCControlSlider.cpp */, - 46A168431807AF4E005B8026 /* CCControlSlider.h */, - 46A168441807AF4E005B8026 /* CCControlStepper.cpp */, - 46A168451807AF4E005B8026 /* CCControlStepper.h */, - 46A168461807AF4E005B8026 /* CCControlSwitch.cpp */, - 46A168471807AF4E005B8026 /* CCControlSwitch.h */, - 46A168481807AF4E005B8026 /* CCControlUtils.cpp */, - 46A168491807AF4E005B8026 /* CCControlUtils.h */, - 46A1684A1807AF4E005B8026 /* CCInvocation.cpp */, - 46A1684B1807AF4E005B8026 /* CCInvocation.h */, - ); - path = CCControlExtension; - sourceTree = ""; - }; - 46A1685D1807AF4E005B8026 /* CCScrollView */ = { - isa = PBXGroup; - children = ( - 46A1685E1807AF4E005B8026 /* CCScrollView.cpp */, - 46A1685F1807AF4E005B8026 /* CCScrollView.h */, - 46A168621807AF4E005B8026 /* CCTableView.cpp */, - 46A168631807AF4E005B8026 /* CCTableView.h */, - 46A168641807AF4E005B8026 /* CCTableViewCell.cpp */, - 46A168651807AF4E005B8026 /* CCTableViewCell.h */, - ); - path = CCScrollView; - sourceTree = ""; - }; 46A169A11807B037005B8026 /* 2d */ = { isa = PBXGroup; children = ( @@ -3854,17 +3703,6 @@ path = apple; sourceTree = ""; }; - A60A9D5A1C200DD00070800A /* PhysicsSprite */ = { - isa = PBXGroup; - children = ( - A60A9D5B1C200DE10070800A /* CCPhysicsDebugNode.cpp */, - A60A9D5C1C200DE10070800A /* CCPhysicsDebugNode.h */, - A60A9D5D1C200DE10070800A /* CCPhysicsSprite.cpp */, - A60A9D5E1C200DE10070800A /* CCPhysicsSprite.h */, - ); - name = PhysicsSprite; - sourceTree = ""; - }; A63CEFF81CD9CF2700A6971D /* Mac */ = { isa = PBXGroup; children = ( @@ -4238,14 +4076,10 @@ 4DED487A1DFFA4AF0070C5C4 /* b2RevoluteJoint.h in Headers */, 4DED487E1DFFA4AF0070C5C4 /* b2RopeJoint.h in Headers */, 1A57006F180BC5A10088DEC7 /* CCActionEase.h in Headers */, - 15AE1BD719AAE01E00C27E9E /* CCControlSlider.h in Headers */, - 15AE1BE519AAE01E00C27E9E /* CCTableView.h in Headers */, - 15AE1BD319AAE01E00C27E9E /* CCControlPotentiometer.h in Headers */, FA6F1B4B1D80F858007DD223 /* IAnimateble.h in Headers */, 15AE1B6E19AADA9900C27E9E /* UIHelper.h in Headers */, B230ED7319B417AE00364AA8 /* CCTrianglesCommand.h in Headers */, 1A570073180BC5A10088DEC7 /* CCActionGrid.h in Headers */, - 15AE1BCC19AAE01E00C27E9E /* CCControlButton.h in Headers */, FA6F1B751D80F858007DD223 /* CCTextureData.h in Headers */, 5034CA3B191D591100CE6051 /* ccShader_PositionColor.vert in Headers */, 1A570077180BC5A10088DEC7 /* CCActionGrid3D.h in Headers */, @@ -4314,7 +4148,6 @@ 15AE1B6C19AADA9900C27E9E /* UIWidget.h in Headers */, FA6F1B711D80F858007DD223 /* CCSlot.h in Headers */, 1A5701B3180BCB590088DEC7 /* CCFontFNT.h in Headers */, - 15AE1BD919AAE01E00C27E9E /* CCControlStepper.h in Headers */, FA6F1BA31D80F858007DD223 /* TimelineData.h in Headers */, 5034CA47191D591100CE6051 /* ccShader_Label_normal.frag in Headers */, BAFF7DDA1D5C1CF80051B92F /* VertexAttachment.h in Headers */, @@ -4335,7 +4168,6 @@ 4DED488A1DFFA4AF0070C5C4 /* b2Rope.h in Headers */, 4DED48361DFFA4AF0070C5C4 /* b2ChainAndCircleContact.h in Headers */, 1A5701E4180BCB8C0088DEC7 /* CCScene.h in Headers */, - 15AE1BDD19AAE01E00C27E9E /* CCControlUtils.h in Headers */, 294D7D9A1D0E93A2002CE7B7 /* CCDevice-apple.h in Headers */, FA6F1B971D80F858007DD223 /* ArmatureData.h in Headers */, A6F0D7A21C2796020029CC44 /* CCStencilStateManager.hpp in Headers */, @@ -4344,7 +4176,6 @@ 1A5701E8180BCB8C0088DEC7 /* CCTransition.h in Headers */, 1A5701EC180BCB8C0088DEC7 /* CCTransitionPageTurn.h in Headers */, FA6F1B871D80F858007DD223 /* ColorTransform.h in Headers */, - A60A9D621C200DE10070800A /* CCPhysicsSprite.h in Headers */, BAFF7DD21D5C1CF80051B92F /* TransformConstraint.h in Headers */, 1A28FF851F20AFAB007A1D9D /* SRSIMDHelpers.h in Headers */, 1A5701F0180BCB8C0088DEC7 /* CCTransitionProgress.h in Headers */, @@ -4369,7 +4200,6 @@ 4D6CF4391E83AAD5003327D4 /* CCCameraNode.h in Headers */, FAC8F6681E1DF15D002B17E8 /* kvec.h in Headers */, 4DC06BE11E8A68D400CA08B1 /* CCPhysicsRayCastCallback.h in Headers */, - 15AE1BD519AAE01E00C27E9E /* CCControlSaturationBrightnessPicker.h in Headers */, 50ABBD891925AB4100A911A9 /* CCCustomCommand.h in Headers */, 5034CA43191D591100CE6051 /* ccShader_Label.vert in Headers */, 4DC06BDD1E8A68D400CA08B1 /* CCPhysicsDebugDraw.h in Headers */, @@ -4408,7 +4238,6 @@ 1A570284180BCC900088DEC7 /* CCSpriteBatchNode.h in Headers */, 5034CA2B191D591100CE6051 /* ccShader_PositionTextureA8Color.vert in Headers */, FA6F1B8D1D80F858007DD223 /* Rectangle.h in Headers */, - 15AE1BCE19AAE01E00C27E9E /* CCControlColourPicker.h in Headers */, 1A570288180BCC900088DEC7 /* CCSpriteFrame.h in Headers */, 1A57028C180BCC900088DEC7 /* CCSpriteFrameCache.h in Headers */, 4DED48421DFFA4AF0070C5C4 /* b2Contact.h in Headers */, @@ -4437,7 +4266,6 @@ 50ABBD4E1925AB0000A911A9 /* MathUtil.h in Headers */, 15AE1BC219AADFFB00C27E9E /* ExtensionMacros.h in Headers */, 4DED48241DFFA4AF0070C5C4 /* b2Fixture.h in Headers */, - 15AE1BDF19AAE01E00C27E9E /* CCInvocation.h in Headers */, BAFF7D9C1D5C1CF80051B92F /* PathConstraintData.h in Headers */, 50ABBE431925AB6F00A911A9 /* CCDirector.h in Headers */, 1A28FF911F20AFAB007A1D9D /* NSURLRequest+SRWebSocket.h in Headers */, @@ -4488,11 +4316,9 @@ FA6F1B611D80F858007DD223 /* Slot.h in Headers */, 50ABBE331925AB6F00A911A9 /* CCConfiguration.h in Headers */, 4D2816681E8CBB7200F26B06 /* CCPhysicsContactImpulse.h in Headers */, - 15AE1BE319AAE01E00C27E9E /* CCScrollView.h in Headers */, 50CB247519D9C5A100687767 /* AudioCache.h in Headers */, 50ABC01F1926664800A911A9 /* CCThread.h in Headers */, BAFF7DC81D5C1CF80051B92F /* SlotData.h in Headers */, - 15AE1BCA19AAE01E00C27E9E /* CCControl.h in Headers */, 50ABBDBF1925AB4100A911A9 /* CCTextureCache.h in Headers */, BAFF7D701D5C1CF80051B92F /* BoundingBoxAttachment.h in Headers */, 5034CA35191D591100CE6051 /* ccShader_PositionTexture.frag in Headers */, @@ -4526,11 +4352,9 @@ 50ABBDA51925AB4100A911A9 /* CCQuadCommand.h in Headers */, BAFF7D5C1D5C1CF80051B92F /* Attachment.h in Headers */, BA68D7811D62F4A500B7A3F9 /* utils.h in Headers */, - 15AE1BCF19AAE01E00C27E9E /* CCControlExtensions.h in Headers */, 1A28FF951F20AFAB007A1D9D /* SocketRocket.h in Headers */, 50643BD919BFAF4400EF68ED /* CCApplication.h in Headers */, BA68D78B1D62F4A500B7A3F9 /* cdt.h in Headers */, - 15AE1BE719AAE01E00C27E9E /* CCTableViewCell.h in Headers */, BAFF7D641D5C1CF80051B92F /* AttachmentVertices.h in Headers */, 50ABBD3A1925AB0000A911A9 /* CCAffineTransform.h in Headers */, 15AE1BB319AADFEF00C27E9E /* HttpRequest.h in Headers */, @@ -4547,7 +4371,6 @@ 50ABBD5A1925AB0000A911A9 /* Vec2.h in Headers */, FA6F1BAF1D80F858007DD223 /* TextureData.h in Headers */, FAC8F66C1E1DF15D002B17E8 /* SkeletonBinary.h in Headers */, - 15AE1BDB19AAE01E00C27E9E /* CCControlSwitch.h in Headers */, B24AA987195A675C007B4522 /* CCFastTMXLayer.h in Headers */, 50ABBEBD1925AB6F00A911A9 /* ccUtils.h in Headers */, 4DED486E1DFFA4AF0070C5C4 /* b2MouseJoint.h in Headers */, @@ -4584,7 +4407,6 @@ 50ABBE2D1925AB6F00A911A9 /* ccCArray.h in Headers */, 50ABBD5E1925AB0000A911A9 /* Vec3.h in Headers */, ED3057A21BEC77D50083C3ED /* xxhash.h in Headers */, - A60A9D601C200DE10070800A /* CCPhysicsDebugNode.h in Headers */, BAFF7D581D5C1CF80051B92F /* AtlasAttachmentLoader.h in Headers */, 291901431B05895600F8B4BA /* CCNinePatchImageParser.h in Headers */, B24AA98B195A675C007B4522 /* CCFastTMXTiledMap.h in Headers */, @@ -4604,7 +4426,6 @@ 50ABC0691926664800A911A9 /* CCStdC-mac.h in Headers */, BAFF7DC01D5C1CF80051B92F /* Skin.h in Headers */, 1A28FF711F20AFAB007A1D9D /* SRHash.h in Headers */, - 15AE1BD119AAE01E00C27E9E /* CCControlHuePicker.h in Headers */, FA6F1B891D80F858007DD223 /* Matrix.h in Headers */, 50ABBE771925AB6F00A911A9 /* CCEventListenerTouch.h in Headers */, 5034CA33191D591100CE6051 /* ccShader_PositionTexture_uColor.frag in Headers */, @@ -4653,7 +4474,6 @@ 1A28FF8E1F20AFAB007A1D9D /* NSRunLoop+SRWebSocket.h in Headers */, 5034CA40191D591100CE6051 /* ccShader_Position_uColor.vert in Headers */, BAFF7DCF1D5C1CF80051B92F /* spine.h in Headers */, - 15AE1BFC19AAE01E00C27E9E /* CCControlUtils.h in Headers */, 4D2E690E1CC543B40032DD5C /* Triangulate.h in Headers */, 50ABBEC21925AB6F00A911A9 /* CCValue.h in Headers */, 2980F0241BA9A5550059E678 /* CCUIMultilineTextField.h in Headers */, @@ -4728,7 +4548,6 @@ 1A570094180BC5A10088DEC7 /* CCActionTween.h in Headers */, 1A57009B180BC5C10088DEC7 /* CCAtlasNode.h in Headers */, 1A5700A1180BC5D20088DEC7 /* CCNode.h in Headers */, - 15AE1BF019AAE01E00C27E9E /* CCControlHuePicker.h in Headers */, 503DD8E41926736A00CD74DD /* CCDirectorCaller-ios.h in Headers */, BAFF7D551D5C1CF80051B92F /* Atlas.h in Headers */, FA6F1B681D80F858007DD223 /* CCArmatureDisplay.h in Headers */, @@ -4771,7 +4590,6 @@ 1A28FF6A1F20AFAB007A1D9D /* SRConstants.h in Headers */, 50ABBFFE1926664800A911A9 /* CCFileUtils-apple.h in Headers */, 1A5701A4180BCB590088DEC7 /* CCFontAtlas.h in Headers */, - 15AE1C0219AAE01E00C27E9E /* CCScrollView.h in Headers */, 1A5701A8180BCB590088DEC7 /* CCFontAtlasCache.h in Headers */, FA6F1B581D80F858007DD223 /* Armature.h in Headers */, 1A5701B4180BCB590088DEC7 /* CCFontFNT.h in Headers */, @@ -4797,12 +4615,10 @@ 4DED48211DFFA4AF0070C5C4 /* b2ContactManager.h in Headers */, 5034CA22191D591100CE6051 /* ccShader_PositionTextureColorAlphaTest.frag in Headers */, 50643BE519BFCF1800EF68ED /* CCPlatformMacros.h in Headers */, - 15AE1BFA19AAE01E00C27E9E /* CCControlSwitch.h in Headers */, FA6F1B641D80F858007DD223 /* TransformObject.h in Headers */, 4DED47E91DFFA4AF0070C5C4 /* b2DynamicTree.h in Headers */, BAFF7D651D5C1CF80051B92F /* AttachmentVertices.h in Headers */, 1A5701E1180BCB8C0088DEC7 /* CCLayer.h in Headers */, - 15AE1BEE19AAE01E00C27E9E /* CCControlExtensions.h in Headers */, 1A28FF621F20AFAB007A1D9D /* SRRunLoopThread.h in Headers */, 1A5701E5180BCB8C0088DEC7 /* CCScene.h in Headers */, 1A5701E9180BCB8C0088DEC7 /* CCTransition.h in Headers */, @@ -4828,7 +4644,6 @@ BAFF7D751D5C1CF80051B92F /* Cocos2dAttachmentLoader.h in Headers */, 1A28FF7A1F20AFAB007A1D9D /* SRLog.h in Headers */, BAFF7DB11D5C1CF80051B92F /* SkeletonBounds.h in Headers */, - 15AE1C0419AAE01E00C27E9E /* CCTableView.h in Headers */, 50ABBEA21925AB6F00A911A9 /* CCScheduler.h in Headers */, 4D2816691E8CBB7200F26B06 /* CCPhysicsContactImpulse.h in Headers */, 4DC06BE21E8A68D400CA08B1 /* CCPhysicsRayCastCallback.h in Headers */, @@ -4877,8 +4692,6 @@ 2980F0221BA9A5550059E678 /* CCUIEditBoxIOS.h in Headers */, FA6F1B941D80F858007DD223 /* AnimationData.h in Headers */, 4DED47FD1DFFA4AF0070C5C4 /* b2PolygonShape.h in Headers */, - 15AE1BF219AAE01E00C27E9E /* CCControlPotentiometer.h in Headers */, - 15AE1BEB19AAE01E00C27E9E /* CCControlButton.h in Headers */, 1A570281180BCC900088DEC7 /* CCSprite.h in Headers */, 1A570285180BCC900088DEC7 /* CCSpriteBatchNode.h in Headers */, 1A570289180BCC900088DEC7 /* CCSpriteFrame.h in Headers */, @@ -4929,7 +4742,6 @@ 4DED487F1DFFA4AF0070C5C4 /* b2RopeJoint.h in Headers */, 1A570313180BCF190088DEC7 /* CCComponentContainer.h in Headers */, 15AE1BC419AADFFB00C27E9E /* ExtensionMacros.h in Headers */, - 15AE1BFE19AAE01E00C27E9E /* CCInvocation.h in Headers */, 1AFFCD781F7A59B200628F2C /* CCThreadPool.h in Headers */, 4DC06BF01E8B604B00CA08B1 /* CCPhysicsManifoldWrapper.h in Headers */, 50ABBD4B1925AB0000A911A9 /* Mat4.h in Headers */, @@ -4974,7 +4786,6 @@ FA6F1B441D80F858007DD223 /* Animation.h in Headers */, 50ABBD4F1925AB0000A911A9 /* MathUtil.h in Headers */, 1A28FF561F20AFAB007A1D9D /* SRIOConsumerPool.h in Headers */, - 15AE1C0619AAE01E00C27E9E /* CCTableViewCell.h in Headers */, 50ABBEBE1925AB6F00A911A9 /* ccUtils.h in Headers */, 1A28FF7E1F20AFAB007A1D9D /* SRMutex.h in Headers */, FA6F1B8C1D80F858007DD223 /* Point.h in Headers */, @@ -4985,7 +4796,6 @@ 50ABBE541925AB6F00A911A9 /* CCEventDispatcher.h in Headers */, BAFF7DDB1D5C1CF80051B92F /* VertexAttachment.h in Headers */, 1A12775A18DFCC4F0005F345 /* CCTweenFunction.h in Headers */, - 15AE1BF419AAE01E00C27E9E /* CCControlSaturationBrightnessPicker.h in Headers */, 50643BD519BFAECF00EF68ED /* CCGL.h in Headers */, B276EF601988D1D500CD400F /* CCVertexIndexData.h in Headers */, 50ABBD5F1925AB0000A911A9 /* Vec3.h in Headers */, @@ -5004,9 +4814,7 @@ 50ABBEAE1925AB6F00A911A9 /* ccTypes.h in Headers */, 4DED48371DFFA4AF0070C5C4 /* b2ChainAndCircleContact.h in Headers */, BA679B3F1CEC373000F875FA /* Manifest.h in Headers */, - 15AE1BF819AAE01E00C27E9E /* CCControlStepper.h in Headers */, 50ABBE261925AB6F00A911A9 /* base64.h in Headers */, - 15AE1BF619AAE01E00C27E9E /* CCControlSlider.h in Headers */, 50ABBEDA1925AB6F00A911A9 /* ZipUtils.h in Headers */, 1A28FF5C1F20AFAB007A1D9D /* NSURLRequest+SRWebSocketPrivate.h in Headers */, 50ABBDC01925AB4100A911A9 /* CCTextureCache.h in Headers */, @@ -5019,7 +4827,6 @@ 15AE184B19AAD30500C27E9E /* Export.h in Headers */, 50ABBED21925AB6F00A911A9 /* TGAlib.h in Headers */, 4DED47F11DFFA4AF0070C5C4 /* b2ChainShape.h in Headers */, - 15AE1BED19AAE01E00C27E9E /* CCControlColourPicker.h in Headers */, 4DED48771DFFA4AF0070C5C4 /* b2PulleyJoint.h in Headers */, 4DED483F1DFFA4AF0070C5C4 /* b2CircleContact.h in Headers */, 4DED48531DFFA4AF0070C5C4 /* b2PolygonAndCircleContact.h in Headers */, @@ -5034,7 +4841,6 @@ 50ABC01C1926664800A911A9 /* CCSAXParser.h in Headers */, 503DD8F11926736A00CD74DD /* OpenGL_Internal-ios.h in Headers */, 50ABBDAA1925AB4100A911A9 /* CCRenderCommand.h in Headers */, - 15AE1BE919AAE01E00C27E9E /* CCControl.h in Headers */, BAFF7DCD1D5C1CF80051B92F /* spine-cocos2dx.h in Headers */, B63990CF1A490AFE00B07923 /* CCAsyncTaskPool.h in Headers */, A614E2E11C8E761D0065A737 /* CCLabelTTF.h in Headers */, @@ -5123,12 +4929,9 @@ 4D2E69071CC543B40032DD5C /* CCGraphicsNode.cpp in Sources */, 4DED48221DFFA4AF0070C5C4 /* b2Fixture.cpp in Sources */, 50ABBE2B1925AB6F00A911A9 /* ccCArray.cpp in Sources */, - 15AE1BDE19AAE01E00C27E9E /* CCInvocation.cpp in Sources */, - 15AE1BE219AAE01E00C27E9E /* CCScrollView.cpp in Sources */, 50ABBD581925AB0000A911A9 /* Vec2.cpp in Sources */, 50ABBE311925AB6F00A911A9 /* CCConfiguration.cpp in Sources */, 4D2E690B1CC543B40032DD5C /* Triangulate.cpp in Sources */, - 15AE1BDA19AAE01E00C27E9E /* CCControlSwitch.cpp in Sources */, 4DED47F21DFFA4AF0070C5C4 /* b2CircleShape.cpp in Sources */, 4DED481E1DFFA4AF0070C5C4 /* b2ContactManager.cpp in Sources */, 5027253C190BF1B900AAF4ED /* cocos2d.cpp in Sources */, @@ -5146,7 +4949,6 @@ 4DED48581DFFA4AF0070C5C4 /* b2DistanceJoint.cpp in Sources */, 50ABBDA71925AB4100A911A9 /* CCRenderCommand.cpp in Sources */, 50ABBD501925AB0000A911A9 /* Quaternion.cpp in Sources */, - 15AE1BE619AAE01E00C27E9E /* CCTableViewCell.cpp in Sources */, 4DFA4C171CBCE34100E3B736 /* CCScale9Sprite.cpp in Sources */, 50ABBEBB1925AB6F00A911A9 /* ccUtils.cpp in Sources */, ED30579A1BEC77B70083C3ED /* ConvertUTF.c in Sources */, @@ -5161,9 +4963,7 @@ 50ABBE8B1925AB6F00A911A9 /* CCNS.cpp in Sources */, FA6F1B551D80F858007DD223 /* Armature.cpp in Sources */, 1A28FF6B1F20AFAB007A1D9D /* SRConstants.m in Sources */, - 15AE1BD819AAE01E00C27E9E /* CCControlStepper.cpp in Sources */, 1A570061180BC5A10088DEC7 /* CCAction.cpp in Sources */, - 15AE1BDC19AAE01E00C27E9E /* CCControlUtils.cpp in Sources */, 294D7D9C1D0E93A2002CE7B7 /* CCDevice-apple.mm in Sources */, BAFF7D7A1D5C1CF80051B92F /* EventData.c in Sources */, 4DED48301DFFA4AF0070C5C4 /* b2WorldCallbacks.cpp in Sources */, @@ -5227,13 +5027,11 @@ 15AE1B6D19AADA9900C27E9E /* UIHelper.cpp in Sources */, 29394CF219B01DBA00D2DE1A /* UIWebView.mm in Sources */, A0534A671B872FFD006B03E5 /* CCDownloader-apple.mm in Sources */, - 15AE1BD419AAE01E00C27E9E /* CCControlSaturationBrightnessPicker.cpp in Sources */, BAFF7D621D5C1CF80051B92F /* AttachmentVertices.cpp in Sources */, 1A57019D180BCB590088DEC7 /* CCFont.cpp in Sources */, 50CB247B19D9C5A100687767 /* AudioEngine-inl.mm in Sources */, 1A5701A1180BCB590088DEC7 /* CCFontAtlas.cpp in Sources */, 1A5701A5180BCB590088DEC7 /* CCFontAtlasCache.cpp in Sources */, - 15AE1BCD19AAE01E00C27E9E /* CCControlColourPicker.cpp in Sources */, BAFF7DD01D5C1CF80051B92F /* TransformConstraint.c in Sources */, 1A5701B1180BCB590088DEC7 /* CCFontFNT.cpp in Sources */, BAFF7D6A1D5C1CF80051B92F /* BoneData.c in Sources */, @@ -5275,7 +5073,6 @@ 1A5701EE180BCB8C0088DEC7 /* CCTransitionProgress.cpp in Sources */, 1A5701F7180BCBAD0088DEC7 /* CCMenu.cpp in Sources */, ED3057821BEC76C90083C3ED /* unzip.cpp in Sources */, - 15AE1BC919AAE01E00C27E9E /* CCControl.cpp in Sources */, 1A5701FB180BCBAD0088DEC7 /* CCMenuItem.cpp in Sources */, 1A570202180BCBD40088DEC7 /* CCClippingNode.cpp in Sources */, A63CF0091CD9CF3500A6971D /* CCUIPasswordTextField.m in Sources */, @@ -5292,7 +5089,6 @@ 1A570214180BCBF40088DEC7 /* CCRenderTexture.cpp in Sources */, A0E749F71BA8FD7F001A8332 /* UIEditBoxImpl-common.cpp in Sources */, BAFF7D661D5C1CF80051B92F /* Bone.c in Sources */, - 15AE1BD019AAE01E00C27E9E /* CCControlHuePicker.cpp in Sources */, B276EF651988D1D500CD400F /* CCVertexIndexBuffer.cpp in Sources */, 50ABBE411925AB6F00A911A9 /* CCDirector.cpp in Sources */, 4DC06BE31E8A68D400CA08B1 /* CCPhysicsUtils.cpp in Sources */, @@ -5321,7 +5117,6 @@ 50693C5E1B6BF2AE005C5820 /* CCDownloader.cpp in Sources */, 50ABBEAF1925AB6F00A911A9 /* CCUserDefault.cpp in Sources */, BAFF7D4A1D5C1CF80051B92F /* AnimationState.c in Sources */, - 15AE1BCB19AAE01E00C27E9E /* CCControlButton.cpp in Sources */, 50ABBE791925AB6F00A911A9 /* CCEventMouse.cpp in Sources */, A05DCF9D1B90584E00EE040B /* CCDownloader-curl.cpp in Sources */, 4DED48001DFFA4AF0070C5C4 /* b2BlockAllocator.cpp in Sources */, @@ -5333,7 +5128,6 @@ 1A28FF4F1F20AFAB007A1D9D /* SRDelegateController.m in Sources */, 1A5702EA180BCE750088DEC7 /* CCTileMapAtlas.cpp in Sources */, 50ABBD971925AB4100A911A9 /* CCGLProgramStateCache.cpp in Sources */, - 15AE1BD619AAE01E00C27E9E /* CCControlSlider.cpp in Sources */, 50ABBE691925AB6F00A911A9 /* CCEventListenerFocus.cpp in Sources */, 4DED485C1DFFA4AF0070C5C4 /* b2FrictionJoint.cpp in Sources */, FA6F1B951D80F858007DD223 /* ArmatureData.cpp in Sources */, @@ -5380,7 +5174,6 @@ 4DED48401DFFA4AF0070C5C4 /* b2Contact.cpp in Sources */, 50ABBEA71925AB6F00A911A9 /* CCTouch.cpp in Sources */, BAFF7D9A1D5C1CF80051B92F /* PathConstraintData.c in Sources */, - A60A9D611C200DE10070800A /* CCPhysicsSprite.cpp in Sources */, FA6F1BA91D80F858007DD223 /* JSONDataParser.cpp in Sources */, 4DED48441DFFA4AF0070C5C4 /* b2ContactSolver.cpp in Sources */, BA68D7891D62F4A500B7A3F9 /* cdt.cc in Sources */, @@ -5409,7 +5202,6 @@ 4DED48781DFFA4AF0070C5C4 /* b2RevoluteJoint.cpp in Sources */, 15AE1B6719AADA9900C27E9E /* UIScale9Sprite.cpp in Sources */, 1AAF584F180E40B9000584C8 /* LocalStorage.cpp in Sources */, - 15AE1BD219AAE01E00C27E9E /* CCControlPotentiometer.cpp in Sources */, 50ABBEA31925AB6F00A911A9 /* CCScriptSupport.cpp in Sources */, 826294331AAF001C00CB7CF7 /* HttpAsynConnection-apple.m in Sources */, 50ABBE6D1925AB6F00A911A9 /* CCEventListenerKeyboard.cpp in Sources */, @@ -5421,7 +5213,6 @@ 4DC06BCF1E8A68D400CA08B1 /* CCPhysicsAABBQueryCallback.cpp in Sources */, 50ABBD9B1925AB4100A911A9 /* ccGLStateCache.cpp in Sources */, 50ABBDB91925AB4100A911A9 /* CCTextureAtlas.cpp in Sources */, - 15AE1BE419AAE01E00C27E9E /* CCTableView.cpp in Sources */, FA6F1B911D80F858007DD223 /* AnimationData.cpp in Sources */, BA68D77D1D62F4A500B7A3F9 /* shapes.cc in Sources */, 50ABBECF1925AB6F00A911A9 /* TGAlib.cpp in Sources */, @@ -5474,7 +5265,6 @@ 4DED47DA1DFFA4AF0070C5C4 /* b2CollideEdge.cpp in Sources */, 15AE1B6B19AADA9900C27E9E /* UIWidget.cpp in Sources */, 50ABBE931925AB6F00A911A9 /* CCProfiling.cpp in Sources */, - A60A9D5F1C200DE10070800A /* CCPhysicsDebugNode.cpp in Sources */, 1A28FF9D1F20AFAB007A1D9D /* SRWebSocket.m in Sources */, 1ABA68AE1888D700007D1BB4 /* CCFontCharMap.cpp in Sources */, 1A28FF931F20AFAB007A1D9D /* NSURLRequest+SRWebSocket.m in Sources */, @@ -5490,13 +5280,11 @@ 15AE1B9819AADAA100C27E9E /* UIVideoPlayer-ios.mm in Sources */, FA6F1B521D80F858007DD223 /* WorldClock.cpp in Sources */, 1A28FF601F20AFAB007A1D9D /* SRProxyConnect.m in Sources */, - 15AE1C0519AAE01E00C27E9E /* CCTableViewCell.cpp in Sources */, 2986667F18B1B246000E39CA /* CCTweenFunction.cpp in Sources */, FA6F1B701D80F858007DD223 /* CCSlot.cpp in Sources */, 50ABBDA01925AB4100A911A9 /* CCGroupCommand.cpp in Sources */, 1A28FF901F20AFAB007A1D9D /* NSRunLoop+SRWebSocket.m in Sources */, 50ABC0161926664800A911A9 /* CCImage.cpp in Sources */, - 15AE1BFB19AAE01E00C27E9E /* CCControlUtils.cpp in Sources */, B230ED7219B417AE00364AA8 /* CCTrianglesCommand.cpp in Sources */, 4DED47DD1DFFA4AF0070C5C4 /* b2CollidePolygon.cpp in Sources */, 15AE1B9019AADA9A00C27E9E /* UIWidget.cpp in Sources */, @@ -5516,7 +5304,6 @@ BAFF7D9B1D5C1CF80051B92F /* PathConstraintData.c in Sources */, FA6F1B961D80F858007DD223 /* ArmatureData.cpp in Sources */, 503DD8EE1926736A00CD74DD /* CCImage-ios.mm in Sources */, - 15AE1BEA19AAE01E00C27E9E /* CCControlButton.cpp in Sources */, 50ABBD941925AB4100A911A9 /* CCGLProgramState.cpp in Sources */, ED30578B1BEC774D0083C3ED /* ioapi_mem.cpp in Sources */, FA6F1B421D80F858007DD223 /* Animation.cpp in Sources */, @@ -5524,7 +5311,6 @@ 4DFA4C181CBCE34100E3B736 /* CCScale9Sprite.cpp in Sources */, 1A28FF9A1F20AFAB007A1D9D /* SRSecurityPolicy.m in Sources */, 50ABBE281925AB6F00A911A9 /* CCAutoreleasePool.cpp in Sources */, - A60A9D641C200DE70070800A /* CCPhysicsSprite.cpp in Sources */, BAFF7D531D5C1CF80051B92F /* Atlas.c in Sources */, 1A570062180BC5A10088DEC7 /* CCAction.cpp in Sources */, 1A570066180BC5A10088DEC7 /* CCActionCamera.cpp in Sources */, @@ -5532,11 +5318,9 @@ 4DC06BE81E8A68D400CA08B1 /* CCPhysicsWorldManifoldWrapper.cpp in Sources */, 1A28FF581F20AFAB007A1D9D /* SRIOConsumerPool.m in Sources */, B276EF661988D1D500CD400F /* CCVertexIndexBuffer.cpp in Sources */, - 15AE1C0119AAE01E00C27E9E /* CCScrollView.cpp in Sources */, ED30579E1BEC77BD0083C3ED /* ConvertUTFWrapper.cpp in Sources */, 1A28FF801F20AFAB007A1D9D /* SRMutex.m in Sources */, 1A57006A180BC5A10088DEC7 /* CCActionCatmullRom.cpp in Sources */, - 15AE1BEF19AAE01E00C27E9E /* CCControlHuePicker.cpp in Sources */, BAFF7DA31D5C1CF80051B92F /* Skeleton.c in Sources */, BAFF7D4F1D5C1CF80051B92F /* AnimationStateData.c in Sources */, BA679B391CEC373000F875FA /* CCEventListenerAssetsManagerEx.cpp in Sources */, @@ -5552,7 +5336,6 @@ 4DED48411DFFA4AF0070C5C4 /* b2Contact.cpp in Sources */, FA6F1B841D80F858007DD223 /* BaseFactory.cpp in Sources */, DABC9FAA19E7DFA900FA252C /* CCClippingRectangleNode.cpp in Sources */, - 15AE1BF119AAE01E00C27E9E /* CCControlPotentiometer.cpp in Sources */, 4DED48791DFFA4AF0070C5C4 /* b2RevoluteJoint.cpp in Sources */, 4DED47D91DFFA4AF0070C5C4 /* b2CollideCircle.cpp in Sources */, 50ABBE621925AB6F00A911A9 /* CCEventListenerAcceleration.cpp in Sources */, @@ -5562,7 +5345,6 @@ 4DED48491DFFA4AF0070C5C4 /* b2EdgeAndCircleContact.cpp in Sources */, BAFF7D6F1D5C1CF80051B92F /* BoundingBoxAttachment.c in Sources */, 4D2E690C1CC543B40032DD5C /* Triangulate.cpp in Sources */, - 15AE1BF719AAE01E00C27E9E /* CCControlStepper.cpp in Sources */, 4DED48651DFFA4AF0070C5C4 /* b2Joint.cpp in Sources */, 50ABBE6E1925AB6F00A911A9 /* CCEventListenerKeyboard.cpp in Sources */, ED30578A1BEC77460083C3ED /* tinyxml2.cpp in Sources */, @@ -5571,7 +5353,6 @@ 50ABBE461925AB6F00A911A9 /* CCEvent.cpp in Sources */, 50ABBEA01925AB6F00A911A9 /* CCScheduler.cpp in Sources */, 50ABBE4E1925AB6F00A911A9 /* CCEventCustom.cpp in Sources */, - 15AE1BF519AAE01E00C27E9E /* CCControlSlider.cpp in Sources */, 4DC06BEE1E8B604B00CA08B1 /* CCPhysicsManifoldWrapper.cpp in Sources */, 50ABBE761925AB6F00A911A9 /* CCEventListenerTouch.cpp in Sources */, 50ABBE5A1925AB6F00A911A9 /* CCEventKeyboard.cpp in Sources */, @@ -5580,7 +5361,6 @@ 50ABBD551925AB0000A911A9 /* TransformUtils.cpp in Sources */, 4DED480B1DFFA4AF0070C5C4 /* b2Math.cpp in Sources */, 1A57007A180BC5A10088DEC7 /* CCActionInstant.cpp in Sources */, - 15AE1BEC19AAE01E00C27E9E /* CCControlColourPicker.cpp in Sources */, 4DC06BD41E8A68D400CA08B1 /* CCPhysicsContactListener.cpp in Sources */, FA6F1B4E1D80F858007DD223 /* TimelineState.cpp in Sources */, 50ABBEC01925AB6F00A911A9 /* CCValue.cpp in Sources */, @@ -5591,10 +5371,8 @@ 1A28FF9E1F20AFAB007A1D9D /* SRWebSocket.m in Sources */, 50ABBE421925AB6F00A911A9 /* CCDirector.cpp in Sources */, BAFF7D831D5C1CF80051B92F /* IkConstraint.c in Sources */, - 15AE1C0319AAE01E00C27E9E /* CCTableView.cpp in Sources */, BA679B311CEC373000F875FA /* AssetsManagerEx.cpp in Sources */, 1A57007E180BC5A10088DEC7 /* CCActionInterval.cpp in Sources */, - 15AE1BF319AAE01E00C27E9E /* CCControlSaturationBrightnessPicker.cpp in Sources */, 4DC06BD01E8A68D400CA08B1 /* CCPhysicsAABBQueryCallback.cpp in Sources */, 1A570082180BC5A10088DEC7 /* CCActionManager.cpp in Sources */, 4D6CF4381E83AAD5003327D4 /* CCCameraNode.cpp in Sources */, @@ -5693,7 +5471,6 @@ 1A570222180BCC1A0088DEC7 /* CCParticleBatchNode.cpp in Sources */, 4DED48751DFFA4AF0070C5C4 /* b2PulleyJoint.cpp in Sources */, BAFF7DA71D5C1CF80051B92F /* SkeletonAnimation.cpp in Sources */, - 15AE1BE819AAE01E00C27E9E /* CCControl.cpp in Sources */, 1A570226180BCC1A0088DEC7 /* CCParticleExamples.cpp in Sources */, ED30579D1BEC77B90083C3ED /* ConvertUTF.c in Sources */, BA8122AC1D77C4160010BEE9 /* CCLabelTTF.cpp in Sources */, @@ -5701,7 +5478,6 @@ 15AE1BBD19AADFF000C27E9E /* SocketIO.cpp in Sources */, BAFF7DAB1D5C1CF80051B92F /* SkeletonBatch.cpp in Sources */, 4DED483D1DFFA4AF0070C5C4 /* b2CircleContact.cpp in Sources */, - 15AE1BFD19AAE01E00C27E9E /* CCInvocation.cpp in Sources */, B24AA98A195A675C007B4522 /* CCFastTMXTiledMap.cpp in Sources */, BAFF7D4B1D5C1CF80051B92F /* AnimationState.c in Sources */, 29394CF719B01DBA00D2DE1A /* UIWebViewImpl-ios.mm in Sources */, @@ -5785,7 +5561,6 @@ 50ABBDA81925AB4100A911A9 /* CCRenderCommand.cpp in Sources */, 50ABBEA41925AB6F00A911A9 /* CCScriptSupport.cpp in Sources */, 503DD8E71926736A00CD74DD /* CCEAGLView-ios.mm in Sources */, - A60A9D631C200DE40070800A /* CCPhysicsDebugNode.cpp in Sources */, 3E2BDAEC19C0436F0055CDCD /* AudioEngine.cpp in Sources */, 52B47A311A5349A3004E4C60 /* HttpCookie.cpp in Sources */, 50ABBDA41925AB4100A911A9 /* CCQuadCommand.cpp in Sources */, @@ -5799,7 +5574,6 @@ BA68D7861D62F4A500B7A3F9 /* advancing_front.cc in Sources */, FA6F1B561D80F858007DD223 /* Armature.cpp in Sources */, 1A9DCA28180E6955007A3AD4 /* CCGLBufferedNode.cpp in Sources */, - 15AE1BF919AAE01E00C27E9E /* CCControlSwitch.cpp in Sources */, A6E018661CB7A7E000EC1419 /* CCDownloader.cpp in Sources */, BAFF7DD11D5C1CF80051B92F /* TransformConstraint.c in Sources */, 50CB248019D9C5A100687767 /* AudioPlayer.mm in Sources */, diff --git a/native/cocos/2d/libcocos2d.vcxproj b/native/cocos/2d/libcocos2d.vcxproj index 303730b4f3..6ed7338fe6 100644 --- a/native/cocos/2d/libcocos2d.vcxproj +++ b/native/cocos/2d/libcocos2d.vcxproj @@ -162,22 +162,6 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32\libs\*.*" "$(OutDir)" - - - - - - - - - - - - - - - - @@ -391,23 +375,6 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32\libs\*.*" "$(OutDir)" - - - - - - - - - - - - - - - - - diff --git a/native/cocos/2d/libcocos2d.vcxproj.filters b/native/cocos/2d/libcocos2d.vcxproj.filters index df5f5cad4a..c943443e89 100644 --- a/native/cocos/2d/libcocos2d.vcxproj.filters +++ b/native/cocos/2d/libcocos2d.vcxproj.filters @@ -52,12 +52,6 @@ {976bf662-699e-482e-b5db-a20d4abab137} - - {b27aba95-51a2-413c-8570-0aff9adf2b6b} - - - {a1f539bc-d5be-4224-a4d2-01c0b6f17d6e} - {31338a7d-ebe1-4867-9c17-d3645122a864} @@ -79,9 +73,6 @@ {89eb6312-dc7f-4fda-b9b2-ab67c31ddd55} - - {118d80ca-ccf2-480c-b87d-25220af23440} - {e916e2b4-0a6e-4d25-8b36-66fa03719f48} @@ -100,9 +91,6 @@ {691a1234-91c6-4c12-992d-3973f4da830f} - - {87ddafca-e85f-430b-bfa1-b6e09279138f} - {c1b7ac70-432f-4d5b-bd3b-5ff5fce3436b} @@ -565,15 +553,6 @@ base - - extension\GUI\CCScrollView - - - extension\GUI\CCScrollView - - - extension\GUI\CCScrollView - network\Source Files @@ -595,39 +574,6 @@ ui\UIWidgets\EditBox - - extension\GUI\CCControlExtensions - - - extension\GUI\CCControlExtensions - - - extension\GUI\CCControlExtensions - - - extension\GUI\CCControlExtensions - - - extension\GUI\CCControlExtensions - - - extension\GUI\CCControlExtensions - - - extension\GUI\CCControlExtensions - - - extension\GUI\CCControlExtensions - - - extension\GUI\CCControlExtensions - - - extension\GUI\CCControlExtensions - - - extension\GUI\CCControlExtensions - platform\win32 @@ -695,12 +641,6 @@ creator - - extension\PhysicsSprite - - - extension\PhysicsSprite - extension\AssetManager @@ -1272,15 +1212,6 @@ base - - extension\GUI\CCScrollView - - - extension\GUI\CCScrollView - - - extension\GUI\CCScrollView - extension @@ -1326,42 +1257,6 @@ ui\UIWidgets\EditBox - - extension\GUI\CCControlExtensions - - - extension\GUI\CCControlExtensions - - - extension\GUI\CCControlExtensions - - - extension\GUI\CCControlExtensions - - - extension\GUI\CCControlExtensions - - - extension\GUI\CCControlExtensions - - - extension\GUI\CCControlExtensions - - - extension\GUI\CCControlExtensions - - - extension\GUI\CCControlExtensions - - - extension\GUI\CCControlExtensions - - - extension\GUI\CCControlExtensions - - - extension\GUI\CCControlExtensions - platform\win32 @@ -1453,12 +1348,6 @@ creator - - extension\PhysicsSprite - - - extension\PhysicsSprite - creator diff --git a/native/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_extension_auto_api.js b/native/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_extension_auto_api.js index c16f23b77a..b22c8751ff 100644 --- a/native/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_extension_auto_api.js +++ b/native/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_extension_auto_api.js @@ -572,2331 +572,3 @@ EventListenerAssetsManagerEx : function ( }, }; - -/** - * @class Control - */ -cc.Control = { - -/** - * @method setEnabled - * @param {bool} arg0 - */ -setEnabled : function ( -bool -) -{ -}, - -/** - * @method getState - * @return {cc.Control::State} - */ -getState : function ( -) -{ - return 0; -}, - -/** - * @method sendActionsForControlEvents - * @param {cc.Control::EventType} arg0 - */ -sendActionsForControlEvents : function ( -eventtype -) -{ -}, - -/** - * @method setSelected - * @param {bool} arg0 - */ -setSelected : function ( -bool -) -{ -}, - -/** - * @method isEnabled - * @return {bool} - */ -isEnabled : function ( -) -{ - return false; -}, - -/** - * @method needsLayout - */ -needsLayout : function ( -) -{ -}, - -/** - * @method hasVisibleParents - * @return {bool} - */ -hasVisibleParents : function ( -) -{ - return false; -}, - -/** - * @method isSelected - * @return {bool} - */ -isSelected : function ( -) -{ - return false; -}, - -/** - * @method isTouchInside - * @param {cc.Touch} arg0 - * @return {bool} - */ -isTouchInside : function ( -touch -) -{ - return false; -}, - -/** - * @method setHighlighted - * @param {bool} arg0 - */ -setHighlighted : function ( -bool -) -{ -}, - -/** - * @method getTouchLocation - * @param {cc.Touch} arg0 - * @return {vec2_object} - */ -getTouchLocation : function ( -touch -) -{ - return cc.Vec2; -}, - -/** - * @method isHighlighted - * @return {bool} - */ -isHighlighted : function ( -) -{ - return false; -}, - -/** - * @method create - * @return {cc.Control} - */ -create : function ( -) -{ - return cc.Control; -}, - -/** - * @method Control - * @constructor - */ -Control : function ( -) -{ -}, - -}; - -/** - * @class ControlButton - */ -cc.ControlButton = { - -/** - * @method isPushed - * @return {bool} - */ -isPushed : function ( -) -{ - return false; -}, - -/** - * @method setTitleLabelForState - * @param {cc.Node} arg0 - * @param {cc.Control::State} arg1 - */ -setTitleLabelForState : function ( -node, -state -) -{ -}, - -/** - * @method setAdjustBackgroundImage - * @param {bool} arg0 - */ -setAdjustBackgroundImage : function ( -bool -) -{ -}, - -/** - * @method setTitleForState - * @param {String} arg0 - * @param {cc.Control::State} arg1 - */ -setTitleForState : function ( -str, -state -) -{ -}, - -/** - * @method setLabelAnchorPoint - * @param {vec2_object} arg0 - */ -setLabelAnchorPoint : function ( -vec2 -) -{ -}, - -/** - * @method getLabelAnchorPoint - * @return {vec2_object} - */ -getLabelAnchorPoint : function ( -) -{ - return cc.Vec2; -}, - -/** - * @method initWithBackgroundSprite - * @param {ccui.Scale9Sprite} arg0 - * @return {bool} - */ -initWithBackgroundSprite : function ( -scale9sprite -) -{ - return false; -}, - -/** - * @method getTitleTTFSizeForState - * @param {cc.Control::State} arg0 - * @return {float} - */ -getTitleTTFSizeForState : function ( -state -) -{ - return 0; -}, - -/** - * @method setTitleTTFForState - * @param {String} arg0 - * @param {cc.Control::State} arg1 - */ -setTitleTTFForState : function ( -str, -state -) -{ -}, - -/** - * @method setTitleTTFSizeForState - * @param {float} arg0 - * @param {cc.Control::State} arg1 - */ -setTitleTTFSizeForState : function ( -float, -state -) -{ -}, - -/** - * @method setTitleLabel - * @param {cc.Node} arg0 - */ -setTitleLabel : function ( -node -) -{ -}, - -/** - * @method setPreferredSize - * @param {size_object} arg0 - */ -setPreferredSize : function ( -size -) -{ -}, - -/** - * @method getCurrentTitleColor - * @return {color3b_object} - */ -getCurrentTitleColor : function ( -) -{ - return cc.Color3B; -}, - -/** - * @method setZoomOnTouchDown - * @param {bool} arg0 - */ -setZoomOnTouchDown : function ( -bool -) -{ -}, - -/** - * @method setBackgroundSprite - * @param {ccui.Scale9Sprite} arg0 - */ -setBackgroundSprite : function ( -scale9sprite -) -{ -}, - -/** - * @method getBackgroundSpriteForState - * @param {cc.Control::State} arg0 - * @return {ccui.Scale9Sprite} - */ -getBackgroundSpriteForState : function ( -state -) -{ - return ccui.Scale9Sprite; -}, - -/** - * @method getHorizontalOrigin - * @return {int} - */ -getHorizontalOrigin : function ( -) -{ - return 0; -}, - -/** - * @method initWithTitleAndFontNameAndFontSize - * @param {String} arg0 - * @param {String} arg1 - * @param {float} arg2 - * @return {bool} - */ -initWithTitleAndFontNameAndFontSize : function ( -str, -str, -float -) -{ - return false; -}, - -/** - * @method setTitleBMFontForState - * @param {String} arg0 - * @param {cc.Control::State} arg1 - */ -setTitleBMFontForState : function ( -str, -state -) -{ -}, - -/** - * @method getScaleRatio - * @return {float} - */ -getScaleRatio : function ( -) -{ - return 0; -}, - -/** - * @method getTitleTTFForState - * @param {cc.Control::State} arg0 - * @return {String} - */ -getTitleTTFForState : function ( -state -) -{ - return ; -}, - -/** - * @method getBackgroundSprite - * @return {ccui.Scale9Sprite} - */ -getBackgroundSprite : function ( -) -{ - return ccui.Scale9Sprite; -}, - -/** - * @method getTitleColorForState - * @param {cc.Control::State} arg0 - * @return {color3b_object} - */ -getTitleColorForState : function ( -state -) -{ - return cc.Color3B; -}, - -/** - * @method setTitleColorForState - * @param {color3b_object} arg0 - * @param {cc.Control::State} arg1 - */ -setTitleColorForState : function ( -color3b, -state -) -{ -}, - -/** - * @method doesAdjustBackgroundImage - * @return {bool} - */ -doesAdjustBackgroundImage : function ( -) -{ - return false; -}, - -/** - * @method setBackgroundSpriteFrameForState - * @param {cc.SpriteFrame} arg0 - * @param {cc.Control::State} arg1 - */ -setBackgroundSpriteFrameForState : function ( -spriteframe, -state -) -{ -}, - -/** - * @method setBackgroundSpriteForState - * @param {ccui.Scale9Sprite} arg0 - * @param {cc.Control::State} arg1 - */ -setBackgroundSpriteForState : function ( -scale9sprite, -state -) -{ -}, - -/** - * @method setScaleRatio - * @param {float} arg0 - */ -setScaleRatio : function ( -float -) -{ -}, - -/** - * @method getTitleBMFontForState - * @param {cc.Control::State} arg0 - * @return {String} - */ -getTitleBMFontForState : function ( -state -) -{ - return ; -}, - -/** - * @method getTitleLabel - * @return {cc.Node} - */ -getTitleLabel : function ( -) -{ - return cc.Node; -}, - -/** - * @method getPreferredSize - * @return {size_object} - */ -getPreferredSize : function ( -) -{ - return cc.Size; -}, - -/** - * @method getVerticalMargin - * @return {int} - */ -getVerticalMargin : function ( -) -{ - return 0; -}, - -/** - * @method getTitleLabelForState - * @param {cc.Control::State} arg0 - * @return {cc.Node} - */ -getTitleLabelForState : function ( -state -) -{ - return cc.Node; -}, - -/** - * @method setMargins - * @param {int} arg0 - * @param {int} arg1 - */ -setMargins : function ( -int, -int -) -{ -}, - -/** - * @method getCurrentTitle -* @return {String|String} -*/ -getCurrentTitle : function( -) -{ - return ; -}, - -/** - * @method initWithLabelAndBackgroundSprite - * @param {cc.Node} arg0 - * @param {ccui.Scale9Sprite} arg1 - * @param {bool} arg2 - * @return {bool} - */ -initWithLabelAndBackgroundSprite : function ( -node, -scale9sprite, -bool -) -{ - return false; -}, - -/** - * @method getZoomOnTouchDown - * @return {bool} - */ -getZoomOnTouchDown : function ( -) -{ - return false; -}, - -/** - * @method getTitleForState - * @param {cc.Control::State} arg0 - * @return {String} - */ -getTitleForState : function ( -state -) -{ - return ; -}, - -/** - * @method create -* @param {ccui.Scale9Sprite|cc.Node|String|cc.Node} scale9sprite -* @param {ccui.Scale9Sprite|String|ccui.Scale9Sprite} scale9sprite -* @param {float|bool} float -* @return {cc.ControlButton|cc.ControlButton|cc.ControlButton|cc.ControlButton|cc.ControlButton} -*/ -create : function( -node, -scale9sprite, -bool -) -{ - return cc.ControlButton; -}, - -/** - * @method ControlButton - * @constructor - */ -ControlButton : function ( -) -{ -}, - -}; - -/** - * @class ControlHuePicker - */ -cc.ControlHuePicker = { - -/** - * @method initWithTargetAndPos - * @param {cc.Node} arg0 - * @param {vec2_object} arg1 - * @return {bool} - */ -initWithTargetAndPos : function ( -node, -vec2 -) -{ - return false; -}, - -/** - * @method setHue - * @param {float} arg0 - */ -setHue : function ( -float -) -{ -}, - -/** - * @method getStartPos - * @return {vec2_object} - */ -getStartPos : function ( -) -{ - return cc.Vec2; -}, - -/** - * @method getHue - * @return {float} - */ -getHue : function ( -) -{ - return 0; -}, - -/** - * @method getSlider - * @return {cc.Sprite} - */ -getSlider : function ( -) -{ - return cc.Sprite; -}, - -/** - * @method setBackground - * @param {cc.Sprite} arg0 - */ -setBackground : function ( -sprite -) -{ -}, - -/** - * @method setHuePercentage - * @param {float} arg0 - */ -setHuePercentage : function ( -float -) -{ -}, - -/** - * @method getBackground - * @return {cc.Sprite} - */ -getBackground : function ( -) -{ - return cc.Sprite; -}, - -/** - * @method getHuePercentage - * @return {float} - */ -getHuePercentage : function ( -) -{ - return 0; -}, - -/** - * @method setSlider - * @param {cc.Sprite} arg0 - */ -setSlider : function ( -sprite -) -{ -}, - -/** - * @method create - * @param {cc.Node} arg0 - * @param {vec2_object} arg1 - * @return {cc.ControlHuePicker} - */ -create : function ( -node, -vec2 -) -{ - return cc.ControlHuePicker; -}, - -/** - * @method ControlHuePicker - * @constructor - */ -ControlHuePicker : function ( -) -{ -}, - -}; - -/** - * @class ControlSaturationBrightnessPicker - */ -cc.ControlSaturationBrightnessPicker = { - -/** - * @method getShadow - * @return {cc.Sprite} - */ -getShadow : function ( -) -{ - return cc.Sprite; -}, - -/** - * @method initWithTargetAndPos - * @param {cc.Node} arg0 - * @param {vec2_object} arg1 - * @return {bool} - */ -initWithTargetAndPos : function ( -node, -vec2 -) -{ - return false; -}, - -/** - * @method getStartPos - * @return {vec2_object} - */ -getStartPos : function ( -) -{ - return cc.Vec2; -}, - -/** - * @method getOverlay - * @return {cc.Sprite} - */ -getOverlay : function ( -) -{ - return cc.Sprite; -}, - -/** - * @method getSlider - * @return {cc.Sprite} - */ -getSlider : function ( -) -{ - return cc.Sprite; -}, - -/** - * @method getBackground - * @return {cc.Sprite} - */ -getBackground : function ( -) -{ - return cc.Sprite; -}, - -/** - * @method getSaturation - * @return {float} - */ -getSaturation : function ( -) -{ - return 0; -}, - -/** - * @method getBrightness - * @return {float} - */ -getBrightness : function ( -) -{ - return 0; -}, - -/** - * @method create - * @param {cc.Node} arg0 - * @param {vec2_object} arg1 - * @return {cc.ControlSaturationBrightnessPicker} - */ -create : function ( -node, -vec2 -) -{ - return cc.ControlSaturationBrightnessPicker; -}, - -/** - * @method ControlSaturationBrightnessPicker - * @constructor - */ -ControlSaturationBrightnessPicker : function ( -) -{ -}, - -}; - -/** - * @class ControlColourPicker - */ -cc.ControlColourPicker = { - -/** - * @method hueSliderValueChanged - * @param {cc.Ref} arg0 - * @param {cc.Control::EventType} arg1 - */ -hueSliderValueChanged : function ( -ref, -eventtype -) -{ -}, - -/** - * @method getHuePicker - * @return {cc.ControlHuePicker} - */ -getHuePicker : function ( -) -{ - return cc.ControlHuePicker; -}, - -/** - * @method getcolourPicker - * @return {cc.ControlSaturationBrightnessPicker} - */ -getcolourPicker : function ( -) -{ - return cc.ControlSaturationBrightnessPicker; -}, - -/** - * @method setBackground - * @param {cc.Sprite} arg0 - */ -setBackground : function ( -sprite -) -{ -}, - -/** - * @method setcolourPicker - * @param {cc.ControlSaturationBrightnessPicker} arg0 - */ -setcolourPicker : function ( -controlsaturationbrightnesspicker -) -{ -}, - -/** - * @method colourSliderValueChanged - * @param {cc.Ref} arg0 - * @param {cc.Control::EventType} arg1 - */ -colourSliderValueChanged : function ( -ref, -eventtype -) -{ -}, - -/** - * @method setHuePicker - * @param {cc.ControlHuePicker} arg0 - */ -setHuePicker : function ( -controlhuepicker -) -{ -}, - -/** - * @method getBackground - * @return {cc.Sprite} - */ -getBackground : function ( -) -{ - return cc.Sprite; -}, - -/** - * @method create - * @return {cc.ControlColourPicker} - */ -create : function ( -) -{ - return cc.ControlColourPicker; -}, - -/** - * @method ControlColourPicker - * @constructor - */ -ControlColourPicker : function ( -) -{ -}, - -}; - -/** - * @class ControlPotentiometer - */ -cc.ControlPotentiometer = { - -/** - * @method setPreviousLocation - * @param {vec2_object} arg0 - */ -setPreviousLocation : function ( -vec2 -) -{ -}, - -/** - * @method setValue - * @param {float} arg0 - */ -setValue : function ( -float -) -{ -}, - -/** - * @method getProgressTimer - * @return {cc.ProgressTimer} - */ -getProgressTimer : function ( -) -{ - return cc.ProgressTimer; -}, - -/** - * @method getMaximumValue - * @return {float} - */ -getMaximumValue : function ( -) -{ - return 0; -}, - -/** - * @method angleInDegreesBetweenLineFromPoint_toPoint_toLineFromPoint_toPoint - * @param {vec2_object} arg0 - * @param {vec2_object} arg1 - * @param {vec2_object} arg2 - * @param {vec2_object} arg3 - * @return {float} - */ -angleInDegreesBetweenLineFromPoint_toPoint_toLineFromPoint_toPoint : function ( -vec2, -vec2, -vec2, -vec2 -) -{ - return 0; -}, - -/** - * @method potentiometerBegan - * @param {vec2_object} arg0 - */ -potentiometerBegan : function ( -vec2 -) -{ -}, - -/** - * @method setMaximumValue - * @param {float} arg0 - */ -setMaximumValue : function ( -float -) -{ -}, - -/** - * @method getMinimumValue - * @return {float} - */ -getMinimumValue : function ( -) -{ - return 0; -}, - -/** - * @method setThumbSprite - * @param {cc.Sprite} arg0 - */ -setThumbSprite : function ( -sprite -) -{ -}, - -/** - * @method getValue - * @return {float} - */ -getValue : function ( -) -{ - return 0; -}, - -/** - * @method getPreviousLocation - * @return {vec2_object} - */ -getPreviousLocation : function ( -) -{ - return cc.Vec2; -}, - -/** - * @method distanceBetweenPointAndPoint - * @param {vec2_object} arg0 - * @param {vec2_object} arg1 - * @return {float} - */ -distanceBetweenPointAndPoint : function ( -vec2, -vec2 -) -{ - return 0; -}, - -/** - * @method potentiometerEnded - * @param {vec2_object} arg0 - */ -potentiometerEnded : function ( -vec2 -) -{ -}, - -/** - * @method setProgressTimer - * @param {cc.ProgressTimer} arg0 - */ -setProgressTimer : function ( -progresstimer -) -{ -}, - -/** - * @method setMinimumValue - * @param {float} arg0 - */ -setMinimumValue : function ( -float -) -{ -}, - -/** - * @method getThumbSprite - * @return {cc.Sprite} - */ -getThumbSprite : function ( -) -{ - return cc.Sprite; -}, - -/** - * @method initWithTrackSprite_ProgressTimer_ThumbSprite - * @param {cc.Sprite} arg0 - * @param {cc.ProgressTimer} arg1 - * @param {cc.Sprite} arg2 - * @return {bool} - */ -initWithTrackSprite_ProgressTimer_ThumbSprite : function ( -sprite, -progresstimer, -sprite -) -{ - return false; -}, - -/** - * @method potentiometerMoved - * @param {vec2_object} arg0 - */ -potentiometerMoved : function ( -vec2 -) -{ -}, - -/** - * @method create - * @param {char} arg0 - * @param {char} arg1 - * @param {char} arg2 - * @return {cc.ControlPotentiometer} - */ -create : function ( -char, -char, -char -) -{ - return cc.ControlPotentiometer; -}, - -/** - * @method ControlPotentiometer - * @constructor - */ -ControlPotentiometer : function ( -) -{ -}, - -}; - -/** - * @class ControlSlider - */ -cc.ControlSlider = { - -/** - * @method setBackgroundSprite - * @param {cc.Sprite} arg0 - */ -setBackgroundSprite : function ( -sprite -) -{ -}, - -/** - * @method getMaximumAllowedValue - * @return {float} - */ -getMaximumAllowedValue : function ( -) -{ - return 0; -}, - -/** - * @method initWithSprites -* @param {cc.Sprite|cc.Sprite} sprite -* @param {cc.Sprite|cc.Sprite} sprite -* @param {cc.Sprite|cc.Sprite} sprite -* @param {cc.Sprite} sprite -* @return {bool|bool} -*/ -initWithSprites : function( -sprite, -sprite, -sprite, -sprite -) -{ - return false; -}, - -/** - * @method getMinimumAllowedValue - * @return {float} - */ -getMinimumAllowedValue : function ( -) -{ - return 0; -}, - -/** - * @method getMaximumValue - * @return {float} - */ -getMaximumValue : function ( -) -{ - return 0; -}, - -/** - * @method getSelectedThumbSprite - * @return {cc.Sprite} - */ -getSelectedThumbSprite : function ( -) -{ - return cc.Sprite; -}, - -/** - * @method setProgressSprite - * @param {cc.Sprite} arg0 - */ -setProgressSprite : function ( -sprite -) -{ -}, - -/** - * @method setMaximumValue - * @param {float} arg0 - */ -setMaximumValue : function ( -float -) -{ -}, - -/** - * @method getMinimumValue - * @return {float} - */ -getMinimumValue : function ( -) -{ - return 0; -}, - -/** - * @method setThumbSprite - * @param {cc.Sprite} arg0 - */ -setThumbSprite : function ( -sprite -) -{ -}, - -/** - * @method getValue - * @return {float} - */ -getValue : function ( -) -{ - return 0; -}, - -/** - * @method getBackgroundSprite - * @return {cc.Sprite} - */ -getBackgroundSprite : function ( -) -{ - return cc.Sprite; -}, - -/** - * @method getThumbSprite - * @return {cc.Sprite} - */ -getThumbSprite : function ( -) -{ - return cc.Sprite; -}, - -/** - * @method setValue - * @param {float} arg0 - */ -setValue : function ( -float -) -{ -}, - -/** - * @method locationFromTouch - * @param {cc.Touch} arg0 - * @return {vec2_object} - */ -locationFromTouch : function ( -touch -) -{ - return cc.Vec2; -}, - -/** - * @method setMinimumValue - * @param {float} arg0 - */ -setMinimumValue : function ( -float -) -{ -}, - -/** - * @method setMinimumAllowedValue - * @param {float} arg0 - */ -setMinimumAllowedValue : function ( -float -) -{ -}, - -/** - * @method getProgressSprite - * @return {cc.Sprite} - */ -getProgressSprite : function ( -) -{ - return cc.Sprite; -}, - -/** - * @method setSelectedThumbSprite - * @param {cc.Sprite} arg0 - */ -setSelectedThumbSprite : function ( -sprite -) -{ -}, - -/** - * @method setMaximumAllowedValue - * @param {float} arg0 - */ -setMaximumAllowedValue : function ( -float -) -{ -}, - -/** - * @method create -* @param {cc.Sprite|char|char|cc.Sprite} sprite -* @param {cc.Sprite|char|char|cc.Sprite} sprite -* @param {cc.Sprite|char|char|cc.Sprite} sprite -* @param {char|cc.Sprite} char -* @return {cc.ControlSlider|cc.ControlSlider|cc.ControlSlider|cc.ControlSlider} -*/ -create : function( -sprite, -sprite, -sprite, -sprite -) -{ - return cc.ControlSlider; -}, - -/** - * @method ControlSlider - * @constructor - */ -ControlSlider : function ( -) -{ -}, - -}; - -/** - * @class ControlStepper - */ -cc.ControlStepper = { - -/** - * @method getMinusSprite - * @return {cc.Sprite} - */ -getMinusSprite : function ( -) -{ - return cc.Sprite; -}, - -/** - * @method setValue - * @param {double} arg0 - */ -setValue : function ( -double -) -{ -}, - -/** - * @method setStepValue - * @param {double} arg0 - */ -setStepValue : function ( -double -) -{ -}, - -/** - * @method initWithMinusSpriteAndPlusSprite - * @param {cc.Sprite} arg0 - * @param {cc.Sprite} arg1 - * @return {bool} - */ -initWithMinusSpriteAndPlusSprite : function ( -sprite, -sprite -) -{ - return false; -}, - -/** - * @method setValueWithSendingEvent - * @param {double} arg0 - * @param {bool} arg1 - */ -setValueWithSendingEvent : function ( -double, -bool -) -{ -}, - -/** - * @method setMaximumValue - * @param {double} arg0 - */ -setMaximumValue : function ( -double -) -{ -}, - -/** - * @method getMinusLabel - * @return {cc.Label} - */ -getMinusLabel : function ( -) -{ - return cc.Label; -}, - -/** - * @method getPlusLabel - * @return {cc.Label} - */ -getPlusLabel : function ( -) -{ - return cc.Label; -}, - -/** - * @method setWraps - * @param {bool} arg0 - */ -setWraps : function ( -bool -) -{ -}, - -/** - * @method setMinusLabel - * @param {cc.Label} arg0 - */ -setMinusLabel : function ( -label -) -{ -}, - -/** - * @method startAutorepeat - */ -startAutorepeat : function ( -) -{ -}, - -/** - * @method updateLayoutUsingTouchLocation - * @param {vec2_object} arg0 - */ -updateLayoutUsingTouchLocation : function ( -vec2 -) -{ -}, - -/** - * @method isContinuous - * @return {bool} - */ -isContinuous : function ( -) -{ - return false; -}, - -/** - * @method stopAutorepeat - */ -stopAutorepeat : function ( -) -{ -}, - -/** - * @method setMinimumValue - * @param {double} arg0 - */ -setMinimumValue : function ( -double -) -{ -}, - -/** - * @method setPlusLabel - * @param {cc.Label} arg0 - */ -setPlusLabel : function ( -label -) -{ -}, - -/** - * @method getValue - * @return {double} - */ -getValue : function ( -) -{ - return 0; -}, - -/** - * @method getPlusSprite - * @return {cc.Sprite} - */ -getPlusSprite : function ( -) -{ - return cc.Sprite; -}, - -/** - * @method setPlusSprite - * @param {cc.Sprite} arg0 - */ -setPlusSprite : function ( -sprite -) -{ -}, - -/** - * @method setMinusSprite - * @param {cc.Sprite} arg0 - */ -setMinusSprite : function ( -sprite -) -{ -}, - -/** - * @method create - * @param {cc.Sprite} arg0 - * @param {cc.Sprite} arg1 - * @return {cc.ControlStepper} - */ -create : function ( -sprite, -sprite -) -{ - return cc.ControlStepper; -}, - -/** - * @method ControlStepper - * @constructor - */ -ControlStepper : function ( -) -{ -}, - -}; - -/** - * @class ControlSwitch - */ -cc.ControlSwitch = { - -/** - * @method setOn -* @param {bool|bool} bool -* @param {bool} bool -*/ -setOn : function( -bool, -bool -) -{ -}, - -/** - * @method locationFromTouch - * @param {cc.Touch} arg0 - * @return {vec2_object} - */ -locationFromTouch : function ( -touch -) -{ - return cc.Vec2; -}, - -/** - * @method isOn - * @return {bool} - */ -isOn : function ( -) -{ - return false; -}, - -/** - * @method initWithMaskSprite -* @param {cc.Sprite|cc.Sprite} sprite -* @param {cc.Sprite|cc.Sprite} sprite -* @param {cc.Sprite|cc.Sprite} sprite -* @param {cc.Sprite|cc.Sprite} sprite -* @param {cc.Label} label -* @param {cc.Label} label -* @return {bool|bool} -*/ -initWithMaskSprite : function( -sprite, -sprite, -sprite, -sprite, -label, -label -) -{ - return false; -}, - -/** - * @method hasMoved - * @return {bool} - */ -hasMoved : function ( -) -{ - return false; -}, - -/** - * @method create -* @param {cc.Sprite|cc.Sprite} sprite -* @param {cc.Sprite|cc.Sprite} sprite -* @param {cc.Sprite|cc.Sprite} sprite -* @param {cc.Sprite|cc.Sprite} sprite -* @param {cc.Label} label -* @param {cc.Label} label -* @return {cc.ControlSwitch|cc.ControlSwitch} -*/ -create : function( -sprite, -sprite, -sprite, -sprite, -label, -label -) -{ - return cc.ControlSwitch; -}, - -/** - * @method ControlSwitch - * @constructor - */ -ControlSwitch : function ( -) -{ -}, - -}; - -/** - * @class ScrollView - */ -cc.ScrollView = { - -/** - * @method isClippingToBounds - * @return {bool} - */ -isClippingToBounds : function ( -) -{ - return false; -}, - -/** - * @method setContainer - * @param {cc.Node} arg0 - */ -setContainer : function ( -node -) -{ -}, - -/** - * @method setContentOffsetInDuration - * @param {vec2_object} arg0 - * @param {float} arg1 - */ -setContentOffsetInDuration : function ( -vec2, -float -) -{ -}, - -/** - * @method setZoomScaleInDuration - * @param {float} arg0 - * @param {float} arg1 - */ -setZoomScaleInDuration : function ( -float, -float -) -{ -}, - -/** - * @method updateTweenAction - * @param {float} arg0 - * @param {String} arg1 - */ -updateTweenAction : function ( -float, -str -) -{ -}, - -/** - * @method setMaxScale - * @param {float} arg0 - */ -setMaxScale : function ( -float -) -{ -}, - -/** - * @method hasVisibleParents - * @return {bool} - */ -hasVisibleParents : function ( -) -{ - return false; -}, - -/** - * @method getDirection - * @return {cc.ScrollView::Direction} - */ -getDirection : function ( -) -{ - return 0; -}, - -/** - * @method getContainer - * @return {cc.Node} - */ -getContainer : function ( -) -{ - return cc.Node; -}, - -/** - * @method setMinScale - * @param {float} arg0 - */ -setMinScale : function ( -float -) -{ -}, - -/** - * @method getZoomScale - * @return {float} - */ -getZoomScale : function ( -) -{ - return 0; -}, - -/** - * @method updateInset - */ -updateInset : function ( -) -{ -}, - -/** - * @method initWithViewSize - * @param {size_object} arg0 - * @param {cc.Node} arg1 - * @return {bool} - */ -initWithViewSize : function ( -size, -node -) -{ - return false; -}, - -/** - * @method pause - * @param {cc.Ref} arg0 - */ -pause : function ( -ref -) -{ -}, - -/** - * @method setDirection - * @param {cc.ScrollView::Direction} arg0 - */ -setDirection : function ( -direction -) -{ -}, - -/** - * @method stopAnimatedContentOffset - */ -stopAnimatedContentOffset : function ( -) -{ -}, - -/** - * @method setContentOffset - * @param {vec2_object} arg0 - * @param {bool} arg1 - */ -setContentOffset : function ( -vec2, -bool -) -{ -}, - -/** - * @method isDragging - * @return {bool} - */ -isDragging : function ( -) -{ - return false; -}, - -/** - * @method isTouchEnabled - * @return {bool} - */ -isTouchEnabled : function ( -) -{ - return false; -}, - -/** - * @method isBounceable - * @return {bool} - */ -isBounceable : function ( -) -{ - return false; -}, - -/** - * @method setTouchEnabled - * @param {bool} arg0 - */ -setTouchEnabled : function ( -bool -) -{ -}, - -/** - * @method getContentOffset - * @return {vec2_object} - */ -getContentOffset : function ( -) -{ - return cc.Vec2; -}, - -/** - * @method resume - * @param {cc.Ref} arg0 - */ -resume : function ( -ref -) -{ -}, - -/** - * @method setClippingToBounds - * @param {bool} arg0 - */ -setClippingToBounds : function ( -bool -) -{ -}, - -/** - * @method setViewSize - * @param {size_object} arg0 - */ -setViewSize : function ( -size -) -{ -}, - -/** - * @method getViewSize - * @return {size_object} - */ -getViewSize : function ( -) -{ - return cc.Size; -}, - -/** - * @method maxContainerOffset - * @return {vec2_object} - */ -maxContainerOffset : function ( -) -{ - return cc.Vec2; -}, - -/** - * @method setBounceable - * @param {bool} arg0 - */ -setBounceable : function ( -bool -) -{ -}, - -/** - * @method isTouchMoved - * @return {bool} - */ -isTouchMoved : function ( -) -{ - return false; -}, - -/** - * @method isNodeVisible - * @param {cc.Node} arg0 - * @return {bool} - */ -isNodeVisible : function ( -node -) -{ - return false; -}, - -/** - * @method minContainerOffset - * @return {vec2_object} - */ -minContainerOffset : function ( -) -{ - return cc.Vec2; -}, - -/** - * @method setZoomScale -* @param {float|float} float -* @param {bool} bool -*/ -setZoomScale : function( -float, -bool -) -{ -}, - -/** - * @method create -* @param {size_object} size -* @param {cc.Node} node -* @return {cc.ScrollView|cc.ScrollView} -*/ -create : function( -size, -node -) -{ - return cc.ScrollView; -}, - -/** - * @method ScrollView - * @constructor - */ -ScrollView : function ( -) -{ -}, - -}; - -/** - * @class TableViewCell - */ -cc.TableViewCell = { - -/** - * @method reset - */ -reset : function ( -) -{ -}, - -/** - * @method getIdx - * @return {int} - */ -getIdx : function ( -) -{ - return 0; -}, - -/** - * @method setIdx - * @param {int} arg0 - */ -setIdx : function ( -int -) -{ -}, - -/** - * @method create - * @return {cc.TableViewCell} - */ -create : function ( -) -{ - return cc.TableViewCell; -}, - -/** - * @method TableViewCell - * @constructor - */ -TableViewCell : function ( -) -{ -}, - -}; - -/** - * @class TableView - */ -cc.TableView = { - -/** - * @method updateCellAtIndex - * @param {int} arg0 - */ -updateCellAtIndex : function ( -int -) -{ -}, - -/** - * @method setVerticalFillOrder - * @param {cc.TableView::VerticalFillOrder} arg0 - */ -setVerticalFillOrder : function ( -verticalfillorder -) -{ -}, - -/** - * @method scrollViewDidZoom - * @param {cc.ScrollView} arg0 - */ -scrollViewDidZoom : function ( -scrollview -) -{ -}, - -/** - * @method _updateContentSize - */ -_updateContentSize : function ( -) -{ -}, - -/** - * @method getVerticalFillOrder - * @return {cc.TableView::VerticalFillOrder} - */ -getVerticalFillOrder : function ( -) -{ - return 0; -}, - -/** - * @method removeCellAtIndex - * @param {int} arg0 - */ -removeCellAtIndex : function ( -int -) -{ -}, - -/** - * @method initWithViewSize - * @param {size_object} arg0 - * @param {cc.Node} arg1 - * @return {bool} - */ -initWithViewSize : function ( -size, -node -) -{ - return false; -}, - -/** - * @method scrollViewDidScroll - * @param {cc.ScrollView} arg0 - */ -scrollViewDidScroll : function ( -scrollview -) -{ -}, - -/** - * @method reloadData - */ -reloadData : function ( -) -{ -}, - -/** - * @method insertCellAtIndex - * @param {int} arg0 - */ -insertCellAtIndex : function ( -int -) -{ -}, - -/** - * @method cellAtIndex - * @param {int} arg0 - * @return {cc.TableViewCell} - */ -cellAtIndex : function ( -int -) -{ - return cc.TableViewCell; -}, - -/** - * @method dequeueCell - * @return {cc.TableViewCell} - */ -dequeueCell : function ( -) -{ - return cc.TableViewCell; -}, - -/** - * @method TableView - * @constructor - */ -TableView : function ( -) -{ -}, - -}; diff --git a/native/cocos/scripting/js-bindings/auto/jsb_cocos2dx_extension_auto.cpp b/native/cocos/scripting/js-bindings/auto/jsb_cocos2dx_extension_auto.cpp index 5aa11dfaea..5970a9f09e 100644 --- a/native/cocos/scripting/js-bindings/auto/jsb_cocos2dx_extension_auto.cpp +++ b/native/cocos/scripting/js-bindings/auto/jsb_cocos2dx_extension_auto.cpp @@ -1336,4888 +1336,6 @@ bool js_register_cocos2dx_extension_EventListenerAssetsManagerEx(se::Object* obj return true; } -se::Object* __jsb_cocos2d_extension_Control_proto = nullptr; -se::Class* __jsb_cocos2d_extension_Control_class = nullptr; - -static bool js_cocos2dx_extension_Control_setEnabled(se::State& s) -{ - cocos2d::extension::Control* cobj = (cocos2d::extension::Control*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_Control_setEnabled : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 1) { - bool arg0; - ok &= seval_to_boolean(args[0], &arg0); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_Control_setEnabled : Error processing arguments"); - cobj->setEnabled(arg0); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_Control_setEnabled) - -static bool js_cocos2dx_extension_Control_getState(se::State& s) -{ - cocos2d::extension::Control* cobj = (cocos2d::extension::Control*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_Control_getState : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 0) { - int result = (int)cobj->getState(); - ok &= int32_to_seval(result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_Control_getState : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_Control_getState) - -static bool js_cocos2dx_extension_Control_sendActionsForControlEvents(se::State& s) -{ - cocos2d::extension::Control* cobj = (cocos2d::extension::Control*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_Control_sendActionsForControlEvents : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 1) { - cocos2d::extension::Control::EventType arg0; - ok &= seval_to_int32(args[0], (int32_t*)&arg0); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_Control_sendActionsForControlEvents : Error processing arguments"); - cobj->sendActionsForControlEvents(arg0); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_Control_sendActionsForControlEvents) - -static bool js_cocos2dx_extension_Control_setSelected(se::State& s) -{ - cocos2d::extension::Control* cobj = (cocos2d::extension::Control*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_Control_setSelected : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 1) { - bool arg0; - ok &= seval_to_boolean(args[0], &arg0); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_Control_setSelected : Error processing arguments"); - cobj->setSelected(arg0); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_Control_setSelected) - -static bool js_cocos2dx_extension_Control_isEnabled(se::State& s) -{ - cocos2d::extension::Control* cobj = (cocos2d::extension::Control*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_Control_isEnabled : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 0) { - bool result = cobj->isEnabled(); - ok &= boolean_to_seval(result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_Control_isEnabled : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_Control_isEnabled) - -static bool js_cocos2dx_extension_Control_needsLayout(se::State& s) -{ - cocos2d::extension::Control* cobj = (cocos2d::extension::Control*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_Control_needsLayout : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - if (argc == 0) { - cobj->needsLayout(); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_Control_needsLayout) - -static bool js_cocos2dx_extension_Control_hasVisibleParents(se::State& s) -{ - cocos2d::extension::Control* cobj = (cocos2d::extension::Control*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_Control_hasVisibleParents : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 0) { - bool result = cobj->hasVisibleParents(); - ok &= boolean_to_seval(result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_Control_hasVisibleParents : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_Control_hasVisibleParents) - -static bool js_cocos2dx_extension_Control_isSelected(se::State& s) -{ - cocos2d::extension::Control* cobj = (cocos2d::extension::Control*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_Control_isSelected : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 0) { - bool result = cobj->isSelected(); - ok &= boolean_to_seval(result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_Control_isSelected : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_Control_isSelected) - -static bool js_cocos2dx_extension_Control_isTouchInside(se::State& s) -{ - cocos2d::extension::Control* cobj = (cocos2d::extension::Control*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_Control_isTouchInside : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 1) { - cocos2d::Touch* arg0 = nullptr; - ok &= seval_to_native_ptr(args[0], &arg0); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_Control_isTouchInside : Error processing arguments"); - bool result = cobj->isTouchInside(arg0); - ok &= boolean_to_seval(result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_Control_isTouchInside : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_Control_isTouchInside) - -static bool js_cocos2dx_extension_Control_setHighlighted(se::State& s) -{ - cocos2d::extension::Control* cobj = (cocos2d::extension::Control*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_Control_setHighlighted : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 1) { - bool arg0; - ok &= seval_to_boolean(args[0], &arg0); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_Control_setHighlighted : Error processing arguments"); - cobj->setHighlighted(arg0); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_Control_setHighlighted) - -static bool js_cocos2dx_extension_Control_getTouchLocation(se::State& s) -{ - cocos2d::extension::Control* cobj = (cocos2d::extension::Control*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_Control_getTouchLocation : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 1) { - cocos2d::Touch* arg0 = nullptr; - ok &= seval_to_native_ptr(args[0], &arg0); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_Control_getTouchLocation : Error processing arguments"); - cocos2d::Vec2 result = cobj->getTouchLocation(arg0); - ok &= Vec2_to_seval(result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_Control_getTouchLocation : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_Control_getTouchLocation) - -static bool js_cocos2dx_extension_Control_isHighlighted(se::State& s) -{ - cocos2d::extension::Control* cobj = (cocos2d::extension::Control*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_Control_isHighlighted : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 0) { - bool result = cobj->isHighlighted(); - ok &= boolean_to_seval(result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_Control_isHighlighted : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_Control_isHighlighted) - -static bool js_cocos2dx_extension_Control_create(se::State& s) -{ - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 0) { - auto result = cocos2d::extension::Control::create(); - result->retain(); - auto obj = se::Object::createObjectWithClass(__jsb_cocos2d_extension_Control_class); - obj->setPrivateData(result); - s.rval().setObject(obj); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_Control_create) - -SE_DECLARE_FINALIZE_FUNC(js_cocos2d_extension_Control_finalize) - -static bool js_cocos2dx_extension_Control_constructor(se::State& s) -{ - cocos2d::extension::Control* cobj = new (std::nothrow) cocos2d::extension::Control(); - s.thisObject()->setPrivateData(cobj); - return true; -} -SE_BIND_CTOR(js_cocos2dx_extension_Control_constructor, __jsb_cocos2d_extension_Control_class, js_cocos2d_extension_Control_finalize) - - - -extern se::Object* __jsb_cocos2d_Layer_proto; - -static bool js_cocos2d_extension_Control_finalize(se::State& s) -{ - CCLOG("jsbindings: finalizing JS object %p (cocos2d::extension::Control)", s.nativeThisObject()); - cocos2d::extension::Control* cobj = (cocos2d::extension::Control*)s.nativeThisObject(); - if (cobj->getReferenceCount() == 1) - cobj->autorelease(); - else - cobj->release(); - return true; -} -SE_BIND_FINALIZE_FUNC(js_cocos2d_extension_Control_finalize) - -bool js_register_cocos2dx_extension_Control(se::Object* obj) -{ - auto cls = se::Class::create("Control", obj, __jsb_cocos2d_Layer_proto, _SE(js_cocos2dx_extension_Control_constructor)); - - cls->defineFunction("setEnabled", _SE(js_cocos2dx_extension_Control_setEnabled)); - cls->defineFunction("getState", _SE(js_cocos2dx_extension_Control_getState)); - cls->defineFunction("sendActionsForControlEvents", _SE(js_cocos2dx_extension_Control_sendActionsForControlEvents)); - cls->defineFunction("setSelected", _SE(js_cocos2dx_extension_Control_setSelected)); - cls->defineFunction("isEnabled", _SE(js_cocos2dx_extension_Control_isEnabled)); - cls->defineFunction("needsLayout", _SE(js_cocos2dx_extension_Control_needsLayout)); - cls->defineFunction("hasVisibleParents", _SE(js_cocos2dx_extension_Control_hasVisibleParents)); - cls->defineFunction("isSelected", _SE(js_cocos2dx_extension_Control_isSelected)); - cls->defineFunction("isTouchInside", _SE(js_cocos2dx_extension_Control_isTouchInside)); - cls->defineFunction("setHighlighted", _SE(js_cocos2dx_extension_Control_setHighlighted)); - cls->defineFunction("getTouchLocation", _SE(js_cocos2dx_extension_Control_getTouchLocation)); - cls->defineFunction("isHighlighted", _SE(js_cocos2dx_extension_Control_isHighlighted)); - cls->defineStaticFunction("create", _SE(js_cocos2dx_extension_Control_create)); - cls->defineFinalizeFunction(_SE(js_cocos2d_extension_Control_finalize)); - cls->install(); - JSBClassType::registerClass(cls); - - __jsb_cocos2d_extension_Control_proto = cls->getProto(); - __jsb_cocos2d_extension_Control_class = cls; - - se::ScriptEngine::getInstance()->clearException(); - return true; -} - -se::Object* __jsb_cocos2d_extension_ControlButton_proto = nullptr; -se::Class* __jsb_cocos2d_extension_ControlButton_class = nullptr; - -static bool js_cocos2dx_extension_ControlButton_isPushed(se::State& s) -{ - cocos2d::extension::ControlButton* cobj = (cocos2d::extension::ControlButton*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlButton_isPushed : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 0) { - bool result = cobj->isPushed(); - ok &= boolean_to_seval(result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlButton_isPushed : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlButton_isPushed) - -static bool js_cocos2dx_extension_ControlButton_setTitleLabelForState(se::State& s) -{ - cocos2d::extension::ControlButton* cobj = (cocos2d::extension::ControlButton*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlButton_setTitleLabelForState : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 2) { - cocos2d::Node* arg0 = nullptr; - cocos2d::extension::Control::State arg1; - ok &= seval_to_native_ptr(args[0], &arg0); - ok &= seval_to_int32(args[1], (int32_t*)&arg1); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlButton_setTitleLabelForState : Error processing arguments"); - cobj->setTitleLabelForState(arg0, arg1); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 2); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlButton_setTitleLabelForState) - -static bool js_cocos2dx_extension_ControlButton_setAdjustBackgroundImage(se::State& s) -{ - cocos2d::extension::ControlButton* cobj = (cocos2d::extension::ControlButton*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlButton_setAdjustBackgroundImage : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 1) { - bool arg0; - ok &= seval_to_boolean(args[0], &arg0); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlButton_setAdjustBackgroundImage : Error processing arguments"); - cobj->setAdjustBackgroundImage(arg0); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlButton_setAdjustBackgroundImage) - -static bool js_cocos2dx_extension_ControlButton_setTitleForState(se::State& s) -{ - cocos2d::extension::ControlButton* cobj = (cocos2d::extension::ControlButton*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlButton_setTitleForState : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 2) { - std::string arg0; - cocos2d::extension::Control::State arg1; - ok &= seval_to_std_string(args[0], &arg0); - ok &= seval_to_int32(args[1], (int32_t*)&arg1); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlButton_setTitleForState : Error processing arguments"); - cobj->setTitleForState(arg0, arg1); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 2); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlButton_setTitleForState) - -static bool js_cocos2dx_extension_ControlButton_setLabelAnchorPoint(se::State& s) -{ - cocos2d::extension::ControlButton* cobj = (cocos2d::extension::ControlButton*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlButton_setLabelAnchorPoint : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 1) { - cocos2d::Vec2 arg0; - ok &= seval_to_Vec2(args[0], &arg0); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlButton_setLabelAnchorPoint : Error processing arguments"); - cobj->setLabelAnchorPoint(arg0); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlButton_setLabelAnchorPoint) - -static bool js_cocos2dx_extension_ControlButton_getLabelAnchorPoint(se::State& s) -{ - cocos2d::extension::ControlButton* cobj = (cocos2d::extension::ControlButton*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlButton_getLabelAnchorPoint : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 0) { - const cocos2d::Vec2& result = cobj->getLabelAnchorPoint(); - ok &= Vec2_to_seval(result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlButton_getLabelAnchorPoint : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlButton_getLabelAnchorPoint) - -static bool js_cocos2dx_extension_ControlButton_initWithBackgroundSprite(se::State& s) -{ - cocos2d::extension::ControlButton* cobj = (cocos2d::extension::ControlButton*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlButton_initWithBackgroundSprite : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 1) { - cocos2d::ui::Scale9Sprite* arg0 = nullptr; - ok &= seval_to_native_ptr(args[0], &arg0); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlButton_initWithBackgroundSprite : Error processing arguments"); - bool result = cobj->initWithBackgroundSprite(arg0); - ok &= boolean_to_seval(result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlButton_initWithBackgroundSprite : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlButton_initWithBackgroundSprite) - -static bool js_cocos2dx_extension_ControlButton_getTitleTTFSizeForState(se::State& s) -{ - cocos2d::extension::ControlButton* cobj = (cocos2d::extension::ControlButton*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlButton_getTitleTTFSizeForState : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 1) { - cocos2d::extension::Control::State arg0; - ok &= seval_to_int32(args[0], (int32_t*)&arg0); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlButton_getTitleTTFSizeForState : Error processing arguments"); - float result = cobj->getTitleTTFSizeForState(arg0); - ok &= float_to_seval(result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlButton_getTitleTTFSizeForState : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlButton_getTitleTTFSizeForState) - -static bool js_cocos2dx_extension_ControlButton_setTitleTTFForState(se::State& s) -{ - cocos2d::extension::ControlButton* cobj = (cocos2d::extension::ControlButton*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlButton_setTitleTTFForState : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 2) { - std::string arg0; - cocos2d::extension::Control::State arg1; - ok &= seval_to_std_string(args[0], &arg0); - ok &= seval_to_int32(args[1], (int32_t*)&arg1); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlButton_setTitleTTFForState : Error processing arguments"); - cobj->setTitleTTFForState(arg0, arg1); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 2); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlButton_setTitleTTFForState) - -static bool js_cocos2dx_extension_ControlButton_setTitleTTFSizeForState(se::State& s) -{ - cocos2d::extension::ControlButton* cobj = (cocos2d::extension::ControlButton*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlButton_setTitleTTFSizeForState : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 2) { - float arg0 = 0; - cocos2d::extension::Control::State arg1; - ok &= seval_to_float(args[0], &arg0); - ok &= seval_to_int32(args[1], (int32_t*)&arg1); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlButton_setTitleTTFSizeForState : Error processing arguments"); - cobj->setTitleTTFSizeForState(arg0, arg1); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 2); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlButton_setTitleTTFSizeForState) - -static bool js_cocos2dx_extension_ControlButton_setTitleLabel(se::State& s) -{ - cocos2d::extension::ControlButton* cobj = (cocos2d::extension::ControlButton*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlButton_setTitleLabel : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 1) { - cocos2d::Node* arg0 = nullptr; - ok &= seval_to_native_ptr(args[0], &arg0); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlButton_setTitleLabel : Error processing arguments"); - cobj->setTitleLabel(arg0); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlButton_setTitleLabel) - -static bool js_cocos2dx_extension_ControlButton_setPreferredSize(se::State& s) -{ - cocos2d::extension::ControlButton* cobj = (cocos2d::extension::ControlButton*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlButton_setPreferredSize : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 1) { - cocos2d::Size arg0; - ok &= seval_to_Size(args[0], &arg0); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlButton_setPreferredSize : Error processing arguments"); - cobj->setPreferredSize(arg0); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlButton_setPreferredSize) - -static bool js_cocos2dx_extension_ControlButton_getCurrentTitleColor(se::State& s) -{ - cocos2d::extension::ControlButton* cobj = (cocos2d::extension::ControlButton*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlButton_getCurrentTitleColor : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 0) { - const cocos2d::Color3B& result = cobj->getCurrentTitleColor(); - ok &= Color3B_to_seval(result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlButton_getCurrentTitleColor : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlButton_getCurrentTitleColor) - -static bool js_cocos2dx_extension_ControlButton_setZoomOnTouchDown(se::State& s) -{ - cocos2d::extension::ControlButton* cobj = (cocos2d::extension::ControlButton*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlButton_setZoomOnTouchDown : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 1) { - bool arg0; - ok &= seval_to_boolean(args[0], &arg0); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlButton_setZoomOnTouchDown : Error processing arguments"); - cobj->setZoomOnTouchDown(arg0); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlButton_setZoomOnTouchDown) - -static bool js_cocos2dx_extension_ControlButton_setBackgroundSprite(se::State& s) -{ - cocos2d::extension::ControlButton* cobj = (cocos2d::extension::ControlButton*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlButton_setBackgroundSprite : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 1) { - cocos2d::ui::Scale9Sprite* arg0 = nullptr; - ok &= seval_to_native_ptr(args[0], &arg0); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlButton_setBackgroundSprite : Error processing arguments"); - cobj->setBackgroundSprite(arg0); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlButton_setBackgroundSprite) - -static bool js_cocos2dx_extension_ControlButton_getBackgroundSpriteForState(se::State& s) -{ - cocos2d::extension::ControlButton* cobj = (cocos2d::extension::ControlButton*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlButton_getBackgroundSpriteForState : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 1) { - cocos2d::extension::Control::State arg0; - ok &= seval_to_int32(args[0], (int32_t*)&arg0); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlButton_getBackgroundSpriteForState : Error processing arguments"); - cocos2d::ui::Scale9Sprite* result = cobj->getBackgroundSpriteForState(arg0); - ok &= native_ptr_to_seval((cocos2d::ui::Scale9Sprite*)result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlButton_getBackgroundSpriteForState : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlButton_getBackgroundSpriteForState) - -static bool js_cocos2dx_extension_ControlButton_getHorizontalOrigin(se::State& s) -{ - cocos2d::extension::ControlButton* cobj = (cocos2d::extension::ControlButton*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlButton_getHorizontalOrigin : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 0) { - int result = cobj->getHorizontalOrigin(); - ok &= int32_to_seval(result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlButton_getHorizontalOrigin : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlButton_getHorizontalOrigin) - -static bool js_cocos2dx_extension_ControlButton_initWithTitleAndFontNameAndFontSize(se::State& s) -{ - cocos2d::extension::ControlButton* cobj = (cocos2d::extension::ControlButton*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlButton_initWithTitleAndFontNameAndFontSize : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 3) { - std::string arg0; - std::string arg1; - float arg2 = 0; - ok &= seval_to_std_string(args[0], &arg0); - ok &= seval_to_std_string(args[1], &arg1); - ok &= seval_to_float(args[2], &arg2); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlButton_initWithTitleAndFontNameAndFontSize : Error processing arguments"); - bool result = cobj->initWithTitleAndFontNameAndFontSize(arg0, arg1, arg2); - ok &= boolean_to_seval(result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlButton_initWithTitleAndFontNameAndFontSize : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 3); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlButton_initWithTitleAndFontNameAndFontSize) - -static bool js_cocos2dx_extension_ControlButton_setTitleBMFontForState(se::State& s) -{ - cocos2d::extension::ControlButton* cobj = (cocos2d::extension::ControlButton*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlButton_setTitleBMFontForState : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 2) { - std::string arg0; - cocos2d::extension::Control::State arg1; - ok &= seval_to_std_string(args[0], &arg0); - ok &= seval_to_int32(args[1], (int32_t*)&arg1); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlButton_setTitleBMFontForState : Error processing arguments"); - cobj->setTitleBMFontForState(arg0, arg1); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 2); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlButton_setTitleBMFontForState) - -static bool js_cocos2dx_extension_ControlButton_getScaleRatio(se::State& s) -{ - cocos2d::extension::ControlButton* cobj = (cocos2d::extension::ControlButton*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlButton_getScaleRatio : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 0) { - float result = cobj->getScaleRatio(); - ok &= float_to_seval(result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlButton_getScaleRatio : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlButton_getScaleRatio) - -static bool js_cocos2dx_extension_ControlButton_getTitleTTFForState(se::State& s) -{ - cocos2d::extension::ControlButton* cobj = (cocos2d::extension::ControlButton*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlButton_getTitleTTFForState : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 1) { - cocos2d::extension::Control::State arg0; - ok &= seval_to_int32(args[0], (int32_t*)&arg0); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlButton_getTitleTTFForState : Error processing arguments"); - const std::string& result = cobj->getTitleTTFForState(arg0); - ok &= std_string_to_seval(result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlButton_getTitleTTFForState : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlButton_getTitleTTFForState) - -static bool js_cocos2dx_extension_ControlButton_getBackgroundSprite(se::State& s) -{ - cocos2d::extension::ControlButton* cobj = (cocos2d::extension::ControlButton*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlButton_getBackgroundSprite : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 0) { - cocos2d::ui::Scale9Sprite* result = cobj->getBackgroundSprite(); - ok &= native_ptr_to_seval((cocos2d::ui::Scale9Sprite*)result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlButton_getBackgroundSprite : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlButton_getBackgroundSprite) - -static bool js_cocos2dx_extension_ControlButton_getTitleColorForState(se::State& s) -{ - cocos2d::extension::ControlButton* cobj = (cocos2d::extension::ControlButton*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlButton_getTitleColorForState : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 1) { - cocos2d::extension::Control::State arg0; - ok &= seval_to_int32(args[0], (int32_t*)&arg0); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlButton_getTitleColorForState : Error processing arguments"); - cocos2d::Color3B result = cobj->getTitleColorForState(arg0); - ok &= Color3B_to_seval(result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlButton_getTitleColorForState : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlButton_getTitleColorForState) - -static bool js_cocos2dx_extension_ControlButton_setTitleColorForState(se::State& s) -{ - cocos2d::extension::ControlButton* cobj = (cocos2d::extension::ControlButton*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlButton_setTitleColorForState : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 2) { - cocos2d::Color3B arg0; - cocos2d::extension::Control::State arg1; - ok &= seval_to_Color3B(args[0], &arg0); - ok &= seval_to_int32(args[1], (int32_t*)&arg1); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlButton_setTitleColorForState : Error processing arguments"); - cobj->setTitleColorForState(arg0, arg1); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 2); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlButton_setTitleColorForState) - -static bool js_cocos2dx_extension_ControlButton_doesAdjustBackgroundImage(se::State& s) -{ - cocos2d::extension::ControlButton* cobj = (cocos2d::extension::ControlButton*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlButton_doesAdjustBackgroundImage : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 0) { - bool result = cobj->doesAdjustBackgroundImage(); - ok &= boolean_to_seval(result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlButton_doesAdjustBackgroundImage : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlButton_doesAdjustBackgroundImage) - -static bool js_cocos2dx_extension_ControlButton_setBackgroundSpriteFrameForState(se::State& s) -{ - cocos2d::extension::ControlButton* cobj = (cocos2d::extension::ControlButton*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlButton_setBackgroundSpriteFrameForState : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 2) { - cocos2d::SpriteFrame* arg0 = nullptr; - cocos2d::extension::Control::State arg1; - ok &= seval_to_native_ptr(args[0], &arg0); - ok &= seval_to_int32(args[1], (int32_t*)&arg1); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlButton_setBackgroundSpriteFrameForState : Error processing arguments"); - cobj->setBackgroundSpriteFrameForState(arg0, arg1); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 2); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlButton_setBackgroundSpriteFrameForState) - -static bool js_cocos2dx_extension_ControlButton_setBackgroundSpriteForState(se::State& s) -{ - cocos2d::extension::ControlButton* cobj = (cocos2d::extension::ControlButton*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlButton_setBackgroundSpriteForState : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 2) { - cocos2d::ui::Scale9Sprite* arg0 = nullptr; - cocos2d::extension::Control::State arg1; - ok &= seval_to_native_ptr(args[0], &arg0); - ok &= seval_to_int32(args[1], (int32_t*)&arg1); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlButton_setBackgroundSpriteForState : Error processing arguments"); - cobj->setBackgroundSpriteForState(arg0, arg1); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 2); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlButton_setBackgroundSpriteForState) - -static bool js_cocos2dx_extension_ControlButton_setScaleRatio(se::State& s) -{ - cocos2d::extension::ControlButton* cobj = (cocos2d::extension::ControlButton*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlButton_setScaleRatio : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 1) { - float arg0 = 0; - ok &= seval_to_float(args[0], &arg0); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlButton_setScaleRatio : Error processing arguments"); - cobj->setScaleRatio(arg0); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlButton_setScaleRatio) - -static bool js_cocos2dx_extension_ControlButton_getTitleBMFontForState(se::State& s) -{ - cocos2d::extension::ControlButton* cobj = (cocos2d::extension::ControlButton*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlButton_getTitleBMFontForState : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 1) { - cocos2d::extension::Control::State arg0; - ok &= seval_to_int32(args[0], (int32_t*)&arg0); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlButton_getTitleBMFontForState : Error processing arguments"); - const std::string& result = cobj->getTitleBMFontForState(arg0); - ok &= std_string_to_seval(result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlButton_getTitleBMFontForState : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlButton_getTitleBMFontForState) - -static bool js_cocos2dx_extension_ControlButton_getTitleLabel(se::State& s) -{ - cocos2d::extension::ControlButton* cobj = (cocos2d::extension::ControlButton*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlButton_getTitleLabel : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 0) { - cocos2d::Node* result = cobj->getTitleLabel(); - ok &= native_ptr_to_seval((cocos2d::Node*)result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlButton_getTitleLabel : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlButton_getTitleLabel) - -static bool js_cocos2dx_extension_ControlButton_getPreferredSize(se::State& s) -{ - cocos2d::extension::ControlButton* cobj = (cocos2d::extension::ControlButton*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlButton_getPreferredSize : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 0) { - const cocos2d::Size& result = cobj->getPreferredSize(); - ok &= Size_to_seval(result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlButton_getPreferredSize : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlButton_getPreferredSize) - -static bool js_cocos2dx_extension_ControlButton_getVerticalMargin(se::State& s) -{ - cocos2d::extension::ControlButton* cobj = (cocos2d::extension::ControlButton*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlButton_getVerticalMargin : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 0) { - int result = cobj->getVerticalMargin(); - ok &= int32_to_seval(result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlButton_getVerticalMargin : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlButton_getVerticalMargin) - -static bool js_cocos2dx_extension_ControlButton_getTitleLabelForState(se::State& s) -{ - cocos2d::extension::ControlButton* cobj = (cocos2d::extension::ControlButton*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlButton_getTitleLabelForState : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 1) { - cocos2d::extension::Control::State arg0; - ok &= seval_to_int32(args[0], (int32_t*)&arg0); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlButton_getTitleLabelForState : Error processing arguments"); - cocos2d::Node* result = cobj->getTitleLabelForState(arg0); - ok &= native_ptr_to_seval((cocos2d::Node*)result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlButton_getTitleLabelForState : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlButton_getTitleLabelForState) - -static bool js_cocos2dx_extension_ControlButton_setMargins(se::State& s) -{ - cocos2d::extension::ControlButton* cobj = (cocos2d::extension::ControlButton*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlButton_setMargins : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 2) { - int arg0 = 0; - int arg1 = 0; - ok &= seval_to_int32(args[0], (int32_t*)&arg0); - ok &= seval_to_int32(args[1], (int32_t*)&arg1); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlButton_setMargins : Error processing arguments"); - cobj->setMargins(arg0, arg1); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 2); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlButton_setMargins) - -static bool js_cocos2dx_extension_ControlButton_getCurrentTitle(se::State& s) -{ - CC_UNUSED bool ok = true; - cocos2d::extension::ControlButton* cobj = (cocos2d::extension::ControlButton*)s.nativeThisObject(); - SE_PRECONDITION2( cobj, false, "js_cocos2dx_extension_ControlButton_getCurrentTitle : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - do { - if (argc == 0) { - std::string result = cobj->getCurrentTitle(); - ok &= std_string_to_seval(result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlButton_getCurrentTitle : Error processing arguments"); - return true; - } - } while(false); - - do { - if (argc == 0) { - const std::string& result = cobj->getCurrentTitle(); - ok &= std_string_to_seval(result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlButton_getCurrentTitle : Error processing arguments"); - return true; - } - } while(false); - - SE_REPORT_ERROR("wrong number of arguments: %d", (int)argc); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlButton_getCurrentTitle) - -static bool js_cocos2dx_extension_ControlButton_initWithLabelAndBackgroundSprite(se::State& s) -{ - cocos2d::extension::ControlButton* cobj = (cocos2d::extension::ControlButton*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlButton_initWithLabelAndBackgroundSprite : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 3) { - cocos2d::Node* arg0 = nullptr; - cocos2d::ui::Scale9Sprite* arg1 = nullptr; - bool arg2; - ok &= seval_to_native_ptr(args[0], &arg0); - ok &= seval_to_native_ptr(args[1], &arg1); - ok &= seval_to_boolean(args[2], &arg2); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlButton_initWithLabelAndBackgroundSprite : Error processing arguments"); - bool result = cobj->initWithLabelAndBackgroundSprite(arg0, arg1, arg2); - ok &= boolean_to_seval(result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlButton_initWithLabelAndBackgroundSprite : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 3); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlButton_initWithLabelAndBackgroundSprite) - -static bool js_cocos2dx_extension_ControlButton_getZoomOnTouchDown(se::State& s) -{ - cocos2d::extension::ControlButton* cobj = (cocos2d::extension::ControlButton*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlButton_getZoomOnTouchDown : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 0) { - bool result = cobj->getZoomOnTouchDown(); - ok &= boolean_to_seval(result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlButton_getZoomOnTouchDown : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlButton_getZoomOnTouchDown) - -static bool js_cocos2dx_extension_ControlButton_getTitleForState(se::State& s) -{ - cocos2d::extension::ControlButton* cobj = (cocos2d::extension::ControlButton*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlButton_getTitleForState : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 1) { - cocos2d::extension::Control::State arg0; - ok &= seval_to_int32(args[0], (int32_t*)&arg0); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlButton_getTitleForState : Error processing arguments"); - std::string result = cobj->getTitleForState(arg0); - ok &= std_string_to_seval(result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlButton_getTitleForState : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlButton_getTitleForState) - -static bool js_cocos2dx_extension_ControlButton_create(se::State& s) -{ - CC_UNUSED bool ok = true; - const auto& args = s.args(); - size_t argc = args.size(); - do { - if (argc == 1) { - cocos2d::ui::Scale9Sprite* arg0 = nullptr; - ok &= seval_to_native_ptr(args[0], &arg0); - if (!ok) { ok = true; break; } - cocos2d::extension::ControlButton* result = cocos2d::extension::ControlButton::create(arg0); - ok &= native_ptr_to_seval((cocos2d::extension::ControlButton*)result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlButton_create : Error processing arguments"); - return true; - } - } while (false); - do { - if (argc == 0) { - cocos2d::extension::ControlButton* result = cocos2d::extension::ControlButton::create(); - ok &= native_ptr_to_seval((cocos2d::extension::ControlButton*)result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlButton_create : Error processing arguments"); - return true; - } - } while (false); - do { - if (argc == 2) { - cocos2d::Node* arg0 = nullptr; - ok &= seval_to_native_ptr(args[0], &arg0); - if (!ok) { ok = true; break; } - cocos2d::ui::Scale9Sprite* arg1 = nullptr; - ok &= seval_to_native_ptr(args[1], &arg1); - if (!ok) { ok = true; break; } - cocos2d::extension::ControlButton* result = cocos2d::extension::ControlButton::create(arg0, arg1); - ok &= native_ptr_to_seval((cocos2d::extension::ControlButton*)result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlButton_create : Error processing arguments"); - return true; - } - } while (false); - do { - if (argc == 3) { - std::string arg0; - ok &= seval_to_std_string(args[0], &arg0); - if (!ok) { ok = true; break; } - std::string arg1; - ok &= seval_to_std_string(args[1], &arg1); - if (!ok) { ok = true; break; } - float arg2 = 0; - ok &= seval_to_float(args[2], &arg2); - if (!ok) { ok = true; break; } - cocos2d::extension::ControlButton* result = cocos2d::extension::ControlButton::create(arg0, arg1, arg2); - ok &= native_ptr_to_seval((cocos2d::extension::ControlButton*)result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlButton_create : Error processing arguments"); - return true; - } - } while (false); - do { - if (argc == 3) { - cocos2d::Node* arg0 = nullptr; - ok &= seval_to_native_ptr(args[0], &arg0); - if (!ok) { ok = true; break; } - cocos2d::ui::Scale9Sprite* arg1 = nullptr; - ok &= seval_to_native_ptr(args[1], &arg1); - if (!ok) { ok = true; break; } - bool arg2; - ok &= seval_to_boolean(args[2], &arg2); - if (!ok) { ok = true; break; } - cocos2d::extension::ControlButton* result = cocos2d::extension::ControlButton::create(arg0, arg1, arg2); - ok &= native_ptr_to_seval((cocos2d::extension::ControlButton*)result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlButton_create : Error processing arguments"); - return true; - } - } while (false); - SE_REPORT_ERROR("wrong number of arguments: %d", (int)argc); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlButton_create) - -SE_DECLARE_FINALIZE_FUNC(js_cocos2d_extension_ControlButton_finalize) - -static bool js_cocos2dx_extension_ControlButton_constructor(se::State& s) -{ - cocos2d::extension::ControlButton* cobj = new (std::nothrow) cocos2d::extension::ControlButton(); - s.thisObject()->setPrivateData(cobj); - return true; -} -SE_BIND_CTOR(js_cocos2dx_extension_ControlButton_constructor, __jsb_cocos2d_extension_ControlButton_class, js_cocos2d_extension_ControlButton_finalize) - -static bool js_cocos2dx_extension_ControlButton_ctor(se::State& s) -{ - cocos2d::extension::ControlButton* cobj = new (std::nothrow) cocos2d::extension::ControlButton(); - s.thisObject()->setPrivateData(cobj); - return true; -} -SE_BIND_SUB_CLS_CTOR(js_cocos2dx_extension_ControlButton_ctor, __jsb_cocos2d_extension_ControlButton_class, js_cocos2d_extension_ControlButton_finalize) - - - - -extern se::Object* __jsb_cocos2d_extension_Control_proto; - -static bool js_cocos2d_extension_ControlButton_finalize(se::State& s) -{ - CCLOG("jsbindings: finalizing JS object %p (cocos2d::extension::ControlButton)", s.nativeThisObject()); - cocos2d::extension::ControlButton* cobj = (cocos2d::extension::ControlButton*)s.nativeThisObject(); - if (cobj->getReferenceCount() == 1) - cobj->autorelease(); - else - cobj->release(); - return true; -} -SE_BIND_FINALIZE_FUNC(js_cocos2d_extension_ControlButton_finalize) - -bool js_register_cocos2dx_extension_ControlButton(se::Object* obj) -{ - auto cls = se::Class::create("ControlButton", obj, __jsb_cocos2d_extension_Control_proto, _SE(js_cocos2dx_extension_ControlButton_constructor)); - - cls->defineFunction("isPushed", _SE(js_cocos2dx_extension_ControlButton_isPushed)); - cls->defineFunction("setTitleLabelForState", _SE(js_cocos2dx_extension_ControlButton_setTitleLabelForState)); - cls->defineFunction("setAdjustBackgroundImage", _SE(js_cocos2dx_extension_ControlButton_setAdjustBackgroundImage)); - cls->defineFunction("setTitleForState", _SE(js_cocos2dx_extension_ControlButton_setTitleForState)); - cls->defineFunction("setLabelAnchorPoint", _SE(js_cocos2dx_extension_ControlButton_setLabelAnchorPoint)); - cls->defineFunction("getLabelAnchorPoint", _SE(js_cocos2dx_extension_ControlButton_getLabelAnchorPoint)); - cls->defineFunction("initWithBackgroundSprite", _SE(js_cocos2dx_extension_ControlButton_initWithBackgroundSprite)); - cls->defineFunction("getTitleTTFSizeForState", _SE(js_cocos2dx_extension_ControlButton_getTitleTTFSizeForState)); - cls->defineFunction("setTitleTTFForState", _SE(js_cocos2dx_extension_ControlButton_setTitleTTFForState)); - cls->defineFunction("setTitleTTFSizeForState", _SE(js_cocos2dx_extension_ControlButton_setTitleTTFSizeForState)); - cls->defineFunction("setTitleLabel", _SE(js_cocos2dx_extension_ControlButton_setTitleLabel)); - cls->defineFunction("setPreferredSize", _SE(js_cocos2dx_extension_ControlButton_setPreferredSize)); - cls->defineFunction("getCurrentTitleColor", _SE(js_cocos2dx_extension_ControlButton_getCurrentTitleColor)); - cls->defineFunction("setZoomOnTouchDown", _SE(js_cocos2dx_extension_ControlButton_setZoomOnTouchDown)); - cls->defineFunction("setBackgroundSprite", _SE(js_cocos2dx_extension_ControlButton_setBackgroundSprite)); - cls->defineFunction("getBackgroundSpriteForState", _SE(js_cocos2dx_extension_ControlButton_getBackgroundSpriteForState)); - cls->defineFunction("getHorizontalOrigin", _SE(js_cocos2dx_extension_ControlButton_getHorizontalOrigin)); - cls->defineFunction("initWithTitleAndFontNameAndFontSize", _SE(js_cocos2dx_extension_ControlButton_initWithTitleAndFontNameAndFontSize)); - cls->defineFunction("setTitleBMFontForState", _SE(js_cocos2dx_extension_ControlButton_setTitleBMFontForState)); - cls->defineFunction("getScaleRatio", _SE(js_cocos2dx_extension_ControlButton_getScaleRatio)); - cls->defineFunction("getTitleTTFForState", _SE(js_cocos2dx_extension_ControlButton_getTitleTTFForState)); - cls->defineFunction("getBackgroundSprite", _SE(js_cocos2dx_extension_ControlButton_getBackgroundSprite)); - cls->defineFunction("getTitleColorForState", _SE(js_cocos2dx_extension_ControlButton_getTitleColorForState)); - cls->defineFunction("setTitleColorForState", _SE(js_cocos2dx_extension_ControlButton_setTitleColorForState)); - cls->defineFunction("doesAdjustBackgroundImage", _SE(js_cocos2dx_extension_ControlButton_doesAdjustBackgroundImage)); - cls->defineFunction("setBackgroundSpriteFrameForState", _SE(js_cocos2dx_extension_ControlButton_setBackgroundSpriteFrameForState)); - cls->defineFunction("setBackgroundSpriteForState", _SE(js_cocos2dx_extension_ControlButton_setBackgroundSpriteForState)); - cls->defineFunction("setScaleRatio", _SE(js_cocos2dx_extension_ControlButton_setScaleRatio)); - cls->defineFunction("getTitleBMFontForState", _SE(js_cocos2dx_extension_ControlButton_getTitleBMFontForState)); - cls->defineFunction("getTitleLabel", _SE(js_cocos2dx_extension_ControlButton_getTitleLabel)); - cls->defineFunction("getPreferredSize", _SE(js_cocos2dx_extension_ControlButton_getPreferredSize)); - cls->defineFunction("getVerticalMargin", _SE(js_cocos2dx_extension_ControlButton_getVerticalMargin)); - cls->defineFunction("getTitleLabelForState", _SE(js_cocos2dx_extension_ControlButton_getTitleLabelForState)); - cls->defineFunction("setMargins", _SE(js_cocos2dx_extension_ControlButton_setMargins)); - cls->defineFunction("getCurrentTitle", _SE(js_cocos2dx_extension_ControlButton_getCurrentTitle)); - cls->defineFunction("initWithLabelAndBackgroundSprite", _SE(js_cocos2dx_extension_ControlButton_initWithLabelAndBackgroundSprite)); - cls->defineFunction("getZoomOnTouchDown", _SE(js_cocos2dx_extension_ControlButton_getZoomOnTouchDown)); - cls->defineFunction("getTitleForState", _SE(js_cocos2dx_extension_ControlButton_getTitleForState)); - cls->defineFunction("ctor", _SE(js_cocos2dx_extension_ControlButton_ctor)); - cls->defineStaticFunction("create", _SE(js_cocos2dx_extension_ControlButton_create)); - cls->defineFinalizeFunction(_SE(js_cocos2d_extension_ControlButton_finalize)); - cls->install(); - JSBClassType::registerClass(cls); - - __jsb_cocos2d_extension_ControlButton_proto = cls->getProto(); - __jsb_cocos2d_extension_ControlButton_class = cls; - - se::ScriptEngine::getInstance()->evalString("(function () { cc.ControlButton.extend = cc.Class.extend; })()"); - se::ScriptEngine::getInstance()->clearException(); - return true; -} - -se::Object* __jsb_cocos2d_extension_ControlHuePicker_proto = nullptr; -se::Class* __jsb_cocos2d_extension_ControlHuePicker_class = nullptr; - -static bool js_cocos2dx_extension_ControlHuePicker_initWithTargetAndPos(se::State& s) -{ - cocos2d::extension::ControlHuePicker* cobj = (cocos2d::extension::ControlHuePicker*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlHuePicker_initWithTargetAndPos : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 2) { - cocos2d::Node* arg0 = nullptr; - cocos2d::Vec2 arg1; - ok &= seval_to_native_ptr(args[0], &arg0); - ok &= seval_to_Vec2(args[1], &arg1); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlHuePicker_initWithTargetAndPos : Error processing arguments"); - bool result = cobj->initWithTargetAndPos(arg0, arg1); - ok &= boolean_to_seval(result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlHuePicker_initWithTargetAndPos : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 2); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlHuePicker_initWithTargetAndPos) - -static bool js_cocos2dx_extension_ControlHuePicker_setHue(se::State& s) -{ - cocos2d::extension::ControlHuePicker* cobj = (cocos2d::extension::ControlHuePicker*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlHuePicker_setHue : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 1) { - float arg0 = 0; - ok &= seval_to_float(args[0], &arg0); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlHuePicker_setHue : Error processing arguments"); - cobj->setHue(arg0); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlHuePicker_setHue) - -static bool js_cocos2dx_extension_ControlHuePicker_getStartPos(se::State& s) -{ - cocos2d::extension::ControlHuePicker* cobj = (cocos2d::extension::ControlHuePicker*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlHuePicker_getStartPos : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 0) { - cocos2d::Vec2 result = cobj->getStartPos(); - ok &= Vec2_to_seval(result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlHuePicker_getStartPos : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlHuePicker_getStartPos) - -static bool js_cocos2dx_extension_ControlHuePicker_getHue(se::State& s) -{ - cocos2d::extension::ControlHuePicker* cobj = (cocos2d::extension::ControlHuePicker*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlHuePicker_getHue : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 0) { - float result = cobj->getHue(); - ok &= float_to_seval(result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlHuePicker_getHue : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlHuePicker_getHue) - -static bool js_cocos2dx_extension_ControlHuePicker_getSlider(se::State& s) -{ - cocos2d::extension::ControlHuePicker* cobj = (cocos2d::extension::ControlHuePicker*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlHuePicker_getSlider : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 0) { - cocos2d::Sprite* result = cobj->getSlider(); - ok &= native_ptr_to_seval((cocos2d::Sprite*)result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlHuePicker_getSlider : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlHuePicker_getSlider) - -static bool js_cocos2dx_extension_ControlHuePicker_setBackground(se::State& s) -{ - cocos2d::extension::ControlHuePicker* cobj = (cocos2d::extension::ControlHuePicker*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlHuePicker_setBackground : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 1) { - cocos2d::Sprite* arg0 = nullptr; - ok &= seval_to_native_ptr(args[0], &arg0); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlHuePicker_setBackground : Error processing arguments"); - cobj->setBackground(arg0); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlHuePicker_setBackground) - -static bool js_cocos2dx_extension_ControlHuePicker_setHuePercentage(se::State& s) -{ - cocos2d::extension::ControlHuePicker* cobj = (cocos2d::extension::ControlHuePicker*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlHuePicker_setHuePercentage : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 1) { - float arg0 = 0; - ok &= seval_to_float(args[0], &arg0); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlHuePicker_setHuePercentage : Error processing arguments"); - cobj->setHuePercentage(arg0); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlHuePicker_setHuePercentage) - -static bool js_cocos2dx_extension_ControlHuePicker_getBackground(se::State& s) -{ - cocos2d::extension::ControlHuePicker* cobj = (cocos2d::extension::ControlHuePicker*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlHuePicker_getBackground : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 0) { - cocos2d::Sprite* result = cobj->getBackground(); - ok &= native_ptr_to_seval((cocos2d::Sprite*)result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlHuePicker_getBackground : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlHuePicker_getBackground) - -static bool js_cocos2dx_extension_ControlHuePicker_getHuePercentage(se::State& s) -{ - cocos2d::extension::ControlHuePicker* cobj = (cocos2d::extension::ControlHuePicker*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlHuePicker_getHuePercentage : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 0) { - float result = cobj->getHuePercentage(); - ok &= float_to_seval(result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlHuePicker_getHuePercentage : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlHuePicker_getHuePercentage) - -static bool js_cocos2dx_extension_ControlHuePicker_setSlider(se::State& s) -{ - cocos2d::extension::ControlHuePicker* cobj = (cocos2d::extension::ControlHuePicker*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlHuePicker_setSlider : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 1) { - cocos2d::Sprite* arg0 = nullptr; - ok &= seval_to_native_ptr(args[0], &arg0); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlHuePicker_setSlider : Error processing arguments"); - cobj->setSlider(arg0); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlHuePicker_setSlider) - -static bool js_cocos2dx_extension_ControlHuePicker_create(se::State& s) -{ - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 2) { - cocos2d::Node* arg0 = nullptr; - cocos2d::Vec2 arg1; - ok &= seval_to_native_ptr(args[0], &arg0); - ok &= seval_to_Vec2(args[1], &arg1); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlHuePicker_create : Error processing arguments"); - auto result = cocos2d::extension::ControlHuePicker::create(arg0, arg1); - result->retain(); - auto obj = se::Object::createObjectWithClass(__jsb_cocos2d_extension_ControlHuePicker_class); - obj->setPrivateData(result); - s.rval().setObject(obj); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 2); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlHuePicker_create) - -SE_DECLARE_FINALIZE_FUNC(js_cocos2d_extension_ControlHuePicker_finalize) - -static bool js_cocos2dx_extension_ControlHuePicker_constructor(se::State& s) -{ - cocos2d::extension::ControlHuePicker* cobj = new (std::nothrow) cocos2d::extension::ControlHuePicker(); - s.thisObject()->setPrivateData(cobj); - return true; -} -SE_BIND_CTOR(js_cocos2dx_extension_ControlHuePicker_constructor, __jsb_cocos2d_extension_ControlHuePicker_class, js_cocos2d_extension_ControlHuePicker_finalize) - - - -extern se::Object* __jsb_cocos2d_extension_Control_proto; - -static bool js_cocos2d_extension_ControlHuePicker_finalize(se::State& s) -{ - CCLOG("jsbindings: finalizing JS object %p (cocos2d::extension::ControlHuePicker)", s.nativeThisObject()); - cocos2d::extension::ControlHuePicker* cobj = (cocos2d::extension::ControlHuePicker*)s.nativeThisObject(); - if (cobj->getReferenceCount() == 1) - cobj->autorelease(); - else - cobj->release(); - return true; -} -SE_BIND_FINALIZE_FUNC(js_cocos2d_extension_ControlHuePicker_finalize) - -bool js_register_cocos2dx_extension_ControlHuePicker(se::Object* obj) -{ - auto cls = se::Class::create("ControlHuePicker", obj, __jsb_cocos2d_extension_Control_proto, _SE(js_cocos2dx_extension_ControlHuePicker_constructor)); - - cls->defineFunction("initWithTargetAndPos", _SE(js_cocos2dx_extension_ControlHuePicker_initWithTargetAndPos)); - cls->defineFunction("setHue", _SE(js_cocos2dx_extension_ControlHuePicker_setHue)); - cls->defineFunction("getStartPos", _SE(js_cocos2dx_extension_ControlHuePicker_getStartPos)); - cls->defineFunction("getHue", _SE(js_cocos2dx_extension_ControlHuePicker_getHue)); - cls->defineFunction("getSlider", _SE(js_cocos2dx_extension_ControlHuePicker_getSlider)); - cls->defineFunction("setBackground", _SE(js_cocos2dx_extension_ControlHuePicker_setBackground)); - cls->defineFunction("setHuePercentage", _SE(js_cocos2dx_extension_ControlHuePicker_setHuePercentage)); - cls->defineFunction("getBackground", _SE(js_cocos2dx_extension_ControlHuePicker_getBackground)); - cls->defineFunction("getHuePercentage", _SE(js_cocos2dx_extension_ControlHuePicker_getHuePercentage)); - cls->defineFunction("setSlider", _SE(js_cocos2dx_extension_ControlHuePicker_setSlider)); - cls->defineStaticFunction("create", _SE(js_cocos2dx_extension_ControlHuePicker_create)); - cls->defineFinalizeFunction(_SE(js_cocos2d_extension_ControlHuePicker_finalize)); - cls->install(); - JSBClassType::registerClass(cls); - - __jsb_cocos2d_extension_ControlHuePicker_proto = cls->getProto(); - __jsb_cocos2d_extension_ControlHuePicker_class = cls; - - se::ScriptEngine::getInstance()->clearException(); - return true; -} - -se::Object* __jsb_cocos2d_extension_ControlSaturationBrightnessPicker_proto = nullptr; -se::Class* __jsb_cocos2d_extension_ControlSaturationBrightnessPicker_class = nullptr; - -static bool js_cocos2dx_extension_ControlSaturationBrightnessPicker_getShadow(se::State& s) -{ - cocos2d::extension::ControlSaturationBrightnessPicker* cobj = (cocos2d::extension::ControlSaturationBrightnessPicker*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlSaturationBrightnessPicker_getShadow : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 0) { - cocos2d::Sprite* result = cobj->getShadow(); - ok &= native_ptr_to_seval((cocos2d::Sprite*)result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlSaturationBrightnessPicker_getShadow : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlSaturationBrightnessPicker_getShadow) - -static bool js_cocos2dx_extension_ControlSaturationBrightnessPicker_initWithTargetAndPos(se::State& s) -{ - cocos2d::extension::ControlSaturationBrightnessPicker* cobj = (cocos2d::extension::ControlSaturationBrightnessPicker*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlSaturationBrightnessPicker_initWithTargetAndPos : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 2) { - cocos2d::Node* arg0 = nullptr; - cocos2d::Vec2 arg1; - ok &= seval_to_native_ptr(args[0], &arg0); - ok &= seval_to_Vec2(args[1], &arg1); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlSaturationBrightnessPicker_initWithTargetAndPos : Error processing arguments"); - bool result = cobj->initWithTargetAndPos(arg0, arg1); - ok &= boolean_to_seval(result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlSaturationBrightnessPicker_initWithTargetAndPos : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 2); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlSaturationBrightnessPicker_initWithTargetAndPos) - -static bool js_cocos2dx_extension_ControlSaturationBrightnessPicker_getStartPos(se::State& s) -{ - cocos2d::extension::ControlSaturationBrightnessPicker* cobj = (cocos2d::extension::ControlSaturationBrightnessPicker*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlSaturationBrightnessPicker_getStartPos : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 0) { - cocos2d::Vec2 result = cobj->getStartPos(); - ok &= Vec2_to_seval(result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlSaturationBrightnessPicker_getStartPos : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlSaturationBrightnessPicker_getStartPos) - -static bool js_cocos2dx_extension_ControlSaturationBrightnessPicker_getOverlay(se::State& s) -{ - cocos2d::extension::ControlSaturationBrightnessPicker* cobj = (cocos2d::extension::ControlSaturationBrightnessPicker*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlSaturationBrightnessPicker_getOverlay : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 0) { - cocos2d::Sprite* result = cobj->getOverlay(); - ok &= native_ptr_to_seval((cocos2d::Sprite*)result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlSaturationBrightnessPicker_getOverlay : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlSaturationBrightnessPicker_getOverlay) - -static bool js_cocos2dx_extension_ControlSaturationBrightnessPicker_getSlider(se::State& s) -{ - cocos2d::extension::ControlSaturationBrightnessPicker* cobj = (cocos2d::extension::ControlSaturationBrightnessPicker*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlSaturationBrightnessPicker_getSlider : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 0) { - cocos2d::Sprite* result = cobj->getSlider(); - ok &= native_ptr_to_seval((cocos2d::Sprite*)result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlSaturationBrightnessPicker_getSlider : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlSaturationBrightnessPicker_getSlider) - -static bool js_cocos2dx_extension_ControlSaturationBrightnessPicker_getBackground(se::State& s) -{ - cocos2d::extension::ControlSaturationBrightnessPicker* cobj = (cocos2d::extension::ControlSaturationBrightnessPicker*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlSaturationBrightnessPicker_getBackground : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 0) { - cocos2d::Sprite* result = cobj->getBackground(); - ok &= native_ptr_to_seval((cocos2d::Sprite*)result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlSaturationBrightnessPicker_getBackground : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlSaturationBrightnessPicker_getBackground) - -static bool js_cocos2dx_extension_ControlSaturationBrightnessPicker_getSaturation(se::State& s) -{ - cocos2d::extension::ControlSaturationBrightnessPicker* cobj = (cocos2d::extension::ControlSaturationBrightnessPicker*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlSaturationBrightnessPicker_getSaturation : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 0) { - float result = cobj->getSaturation(); - ok &= float_to_seval(result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlSaturationBrightnessPicker_getSaturation : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlSaturationBrightnessPicker_getSaturation) - -static bool js_cocos2dx_extension_ControlSaturationBrightnessPicker_getBrightness(se::State& s) -{ - cocos2d::extension::ControlSaturationBrightnessPicker* cobj = (cocos2d::extension::ControlSaturationBrightnessPicker*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlSaturationBrightnessPicker_getBrightness : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 0) { - float result = cobj->getBrightness(); - ok &= float_to_seval(result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlSaturationBrightnessPicker_getBrightness : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlSaturationBrightnessPicker_getBrightness) - -static bool js_cocos2dx_extension_ControlSaturationBrightnessPicker_create(se::State& s) -{ - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 2) { - cocos2d::Node* arg0 = nullptr; - cocos2d::Vec2 arg1; - ok &= seval_to_native_ptr(args[0], &arg0); - ok &= seval_to_Vec2(args[1], &arg1); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlSaturationBrightnessPicker_create : Error processing arguments"); - auto result = cocos2d::extension::ControlSaturationBrightnessPicker::create(arg0, arg1); - result->retain(); - auto obj = se::Object::createObjectWithClass(__jsb_cocos2d_extension_ControlSaturationBrightnessPicker_class); - obj->setPrivateData(result); - s.rval().setObject(obj); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 2); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlSaturationBrightnessPicker_create) - -SE_DECLARE_FINALIZE_FUNC(js_cocos2d_extension_ControlSaturationBrightnessPicker_finalize) - -static bool js_cocos2dx_extension_ControlSaturationBrightnessPicker_constructor(se::State& s) -{ - cocos2d::extension::ControlSaturationBrightnessPicker* cobj = new (std::nothrow) cocos2d::extension::ControlSaturationBrightnessPicker(); - s.thisObject()->setPrivateData(cobj); - return true; -} -SE_BIND_CTOR(js_cocos2dx_extension_ControlSaturationBrightnessPicker_constructor, __jsb_cocos2d_extension_ControlSaturationBrightnessPicker_class, js_cocos2d_extension_ControlSaturationBrightnessPicker_finalize) - - - -extern se::Object* __jsb_cocos2d_extension_Control_proto; - -static bool js_cocos2d_extension_ControlSaturationBrightnessPicker_finalize(se::State& s) -{ - CCLOG("jsbindings: finalizing JS object %p (cocos2d::extension::ControlSaturationBrightnessPicker)", s.nativeThisObject()); - cocos2d::extension::ControlSaturationBrightnessPicker* cobj = (cocos2d::extension::ControlSaturationBrightnessPicker*)s.nativeThisObject(); - if (cobj->getReferenceCount() == 1) - cobj->autorelease(); - else - cobj->release(); - return true; -} -SE_BIND_FINALIZE_FUNC(js_cocos2d_extension_ControlSaturationBrightnessPicker_finalize) - -bool js_register_cocos2dx_extension_ControlSaturationBrightnessPicker(se::Object* obj) -{ - auto cls = se::Class::create("ControlSaturationBrightnessPicker", obj, __jsb_cocos2d_extension_Control_proto, _SE(js_cocos2dx_extension_ControlSaturationBrightnessPicker_constructor)); - - cls->defineFunction("getShadow", _SE(js_cocos2dx_extension_ControlSaturationBrightnessPicker_getShadow)); - cls->defineFunction("initWithTargetAndPos", _SE(js_cocos2dx_extension_ControlSaturationBrightnessPicker_initWithTargetAndPos)); - cls->defineFunction("getStartPos", _SE(js_cocos2dx_extension_ControlSaturationBrightnessPicker_getStartPos)); - cls->defineFunction("getOverlay", _SE(js_cocos2dx_extension_ControlSaturationBrightnessPicker_getOverlay)); - cls->defineFunction("getSlider", _SE(js_cocos2dx_extension_ControlSaturationBrightnessPicker_getSlider)); - cls->defineFunction("getBackground", _SE(js_cocos2dx_extension_ControlSaturationBrightnessPicker_getBackground)); - cls->defineFunction("getSaturation", _SE(js_cocos2dx_extension_ControlSaturationBrightnessPicker_getSaturation)); - cls->defineFunction("getBrightness", _SE(js_cocos2dx_extension_ControlSaturationBrightnessPicker_getBrightness)); - cls->defineStaticFunction("create", _SE(js_cocos2dx_extension_ControlSaturationBrightnessPicker_create)); - cls->defineFinalizeFunction(_SE(js_cocos2d_extension_ControlSaturationBrightnessPicker_finalize)); - cls->install(); - JSBClassType::registerClass(cls); - - __jsb_cocos2d_extension_ControlSaturationBrightnessPicker_proto = cls->getProto(); - __jsb_cocos2d_extension_ControlSaturationBrightnessPicker_class = cls; - - se::ScriptEngine::getInstance()->clearException(); - return true; -} - -se::Object* __jsb_cocos2d_extension_ControlColourPicker_proto = nullptr; -se::Class* __jsb_cocos2d_extension_ControlColourPicker_class = nullptr; - -static bool js_cocos2dx_extension_ControlColourPicker_hueSliderValueChanged(se::State& s) -{ - cocos2d::extension::ControlColourPicker* cobj = (cocos2d::extension::ControlColourPicker*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlColourPicker_hueSliderValueChanged : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 2) { - cocos2d::Ref* arg0 = nullptr; - cocos2d::extension::Control::EventType arg1; - ok &= seval_to_native_ptr(args[0], &arg0); - ok &= seval_to_int32(args[1], (int32_t*)&arg1); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlColourPicker_hueSliderValueChanged : Error processing arguments"); - cobj->hueSliderValueChanged(arg0, arg1); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 2); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlColourPicker_hueSliderValueChanged) - -static bool js_cocos2dx_extension_ControlColourPicker_getHuePicker(se::State& s) -{ - cocos2d::extension::ControlColourPicker* cobj = (cocos2d::extension::ControlColourPicker*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlColourPicker_getHuePicker : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 0) { - cocos2d::extension::ControlHuePicker* result = cobj->getHuePicker(); - ok &= native_ptr_to_seval((cocos2d::extension::ControlHuePicker*)result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlColourPicker_getHuePicker : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlColourPicker_getHuePicker) - -static bool js_cocos2dx_extension_ControlColourPicker_getcolourPicker(se::State& s) -{ - cocos2d::extension::ControlColourPicker* cobj = (cocos2d::extension::ControlColourPicker*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlColourPicker_getcolourPicker : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 0) { - cocos2d::extension::ControlSaturationBrightnessPicker* result = cobj->getcolourPicker(); - ok &= native_ptr_to_seval((cocos2d::extension::ControlSaturationBrightnessPicker*)result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlColourPicker_getcolourPicker : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlColourPicker_getcolourPicker) - -static bool js_cocos2dx_extension_ControlColourPicker_setBackground(se::State& s) -{ - cocos2d::extension::ControlColourPicker* cobj = (cocos2d::extension::ControlColourPicker*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlColourPicker_setBackground : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 1) { - cocos2d::Sprite* arg0 = nullptr; - ok &= seval_to_native_ptr(args[0], &arg0); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlColourPicker_setBackground : Error processing arguments"); - cobj->setBackground(arg0); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlColourPicker_setBackground) - -static bool js_cocos2dx_extension_ControlColourPicker_setcolourPicker(se::State& s) -{ - cocos2d::extension::ControlColourPicker* cobj = (cocos2d::extension::ControlColourPicker*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlColourPicker_setcolourPicker : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 1) { - cocos2d::extension::ControlSaturationBrightnessPicker* arg0 = nullptr; - ok &= seval_to_native_ptr(args[0], &arg0); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlColourPicker_setcolourPicker : Error processing arguments"); - cobj->setcolourPicker(arg0); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlColourPicker_setcolourPicker) - -static bool js_cocos2dx_extension_ControlColourPicker_colourSliderValueChanged(se::State& s) -{ - cocos2d::extension::ControlColourPicker* cobj = (cocos2d::extension::ControlColourPicker*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlColourPicker_colourSliderValueChanged : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 2) { - cocos2d::Ref* arg0 = nullptr; - cocos2d::extension::Control::EventType arg1; - ok &= seval_to_native_ptr(args[0], &arg0); - ok &= seval_to_int32(args[1], (int32_t*)&arg1); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlColourPicker_colourSliderValueChanged : Error processing arguments"); - cobj->colourSliderValueChanged(arg0, arg1); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 2); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlColourPicker_colourSliderValueChanged) - -static bool js_cocos2dx_extension_ControlColourPicker_setHuePicker(se::State& s) -{ - cocos2d::extension::ControlColourPicker* cobj = (cocos2d::extension::ControlColourPicker*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlColourPicker_setHuePicker : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 1) { - cocos2d::extension::ControlHuePicker* arg0 = nullptr; - ok &= seval_to_native_ptr(args[0], &arg0); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlColourPicker_setHuePicker : Error processing arguments"); - cobj->setHuePicker(arg0); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlColourPicker_setHuePicker) - -static bool js_cocos2dx_extension_ControlColourPicker_getBackground(se::State& s) -{ - cocos2d::extension::ControlColourPicker* cobj = (cocos2d::extension::ControlColourPicker*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlColourPicker_getBackground : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 0) { - cocos2d::Sprite* result = cobj->getBackground(); - ok &= native_ptr_to_seval((cocos2d::Sprite*)result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlColourPicker_getBackground : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlColourPicker_getBackground) - -static bool js_cocos2dx_extension_ControlColourPicker_create(se::State& s) -{ - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 0) { - auto result = cocos2d::extension::ControlColourPicker::create(); - result->retain(); - auto obj = se::Object::createObjectWithClass(__jsb_cocos2d_extension_ControlColourPicker_class); - obj->setPrivateData(result); - s.rval().setObject(obj); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlColourPicker_create) - -SE_DECLARE_FINALIZE_FUNC(js_cocos2d_extension_ControlColourPicker_finalize) - -static bool js_cocos2dx_extension_ControlColourPicker_constructor(se::State& s) -{ - cocos2d::extension::ControlColourPicker* cobj = new (std::nothrow) cocos2d::extension::ControlColourPicker(); - s.thisObject()->setPrivateData(cobj); - return true; -} -SE_BIND_CTOR(js_cocos2dx_extension_ControlColourPicker_constructor, __jsb_cocos2d_extension_ControlColourPicker_class, js_cocos2d_extension_ControlColourPicker_finalize) - -static bool js_cocos2dx_extension_ControlColourPicker_ctor(se::State& s) -{ - cocos2d::extension::ControlColourPicker* cobj = new (std::nothrow) cocos2d::extension::ControlColourPicker(); - s.thisObject()->setPrivateData(cobj); - return true; -} -SE_BIND_SUB_CLS_CTOR(js_cocos2dx_extension_ControlColourPicker_ctor, __jsb_cocos2d_extension_ControlColourPicker_class, js_cocos2d_extension_ControlColourPicker_finalize) - - - - -extern se::Object* __jsb_cocos2d_extension_Control_proto; - -static bool js_cocos2d_extension_ControlColourPicker_finalize(se::State& s) -{ - CCLOG("jsbindings: finalizing JS object %p (cocos2d::extension::ControlColourPicker)", s.nativeThisObject()); - cocos2d::extension::ControlColourPicker* cobj = (cocos2d::extension::ControlColourPicker*)s.nativeThisObject(); - if (cobj->getReferenceCount() == 1) - cobj->autorelease(); - else - cobj->release(); - return true; -} -SE_BIND_FINALIZE_FUNC(js_cocos2d_extension_ControlColourPicker_finalize) - -bool js_register_cocos2dx_extension_ControlColourPicker(se::Object* obj) -{ - auto cls = se::Class::create("ControlColourPicker", obj, __jsb_cocos2d_extension_Control_proto, _SE(js_cocos2dx_extension_ControlColourPicker_constructor)); - - cls->defineFunction("hueSliderValueChanged", _SE(js_cocos2dx_extension_ControlColourPicker_hueSliderValueChanged)); - cls->defineFunction("getHuePicker", _SE(js_cocos2dx_extension_ControlColourPicker_getHuePicker)); - cls->defineFunction("getcolourPicker", _SE(js_cocos2dx_extension_ControlColourPicker_getcolourPicker)); - cls->defineFunction("setBackground", _SE(js_cocos2dx_extension_ControlColourPicker_setBackground)); - cls->defineFunction("setcolourPicker", _SE(js_cocos2dx_extension_ControlColourPicker_setcolourPicker)); - cls->defineFunction("colourSliderValueChanged", _SE(js_cocos2dx_extension_ControlColourPicker_colourSliderValueChanged)); - cls->defineFunction("setHuePicker", _SE(js_cocos2dx_extension_ControlColourPicker_setHuePicker)); - cls->defineFunction("getBackground", _SE(js_cocos2dx_extension_ControlColourPicker_getBackground)); - cls->defineFunction("ctor", _SE(js_cocos2dx_extension_ControlColourPicker_ctor)); - cls->defineStaticFunction("create", _SE(js_cocos2dx_extension_ControlColourPicker_create)); - cls->defineFinalizeFunction(_SE(js_cocos2d_extension_ControlColourPicker_finalize)); - cls->install(); - JSBClassType::registerClass(cls); - - __jsb_cocos2d_extension_ControlColourPicker_proto = cls->getProto(); - __jsb_cocos2d_extension_ControlColourPicker_class = cls; - - se::ScriptEngine::getInstance()->evalString("(function () { cc.ControlColourPicker.extend = cc.Class.extend; })()"); - se::ScriptEngine::getInstance()->clearException(); - return true; -} - -se::Object* __jsb_cocos2d_extension_ControlPotentiometer_proto = nullptr; -se::Class* __jsb_cocos2d_extension_ControlPotentiometer_class = nullptr; - -static bool js_cocos2dx_extension_ControlPotentiometer_setPreviousLocation(se::State& s) -{ - cocos2d::extension::ControlPotentiometer* cobj = (cocos2d::extension::ControlPotentiometer*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlPotentiometer_setPreviousLocation : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 1) { - cocos2d::Vec2 arg0; - ok &= seval_to_Vec2(args[0], &arg0); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlPotentiometer_setPreviousLocation : Error processing arguments"); - cobj->setPreviousLocation(arg0); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlPotentiometer_setPreviousLocation) - -static bool js_cocos2dx_extension_ControlPotentiometer_setValue(se::State& s) -{ - cocos2d::extension::ControlPotentiometer* cobj = (cocos2d::extension::ControlPotentiometer*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlPotentiometer_setValue : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 1) { - float arg0 = 0; - ok &= seval_to_float(args[0], &arg0); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlPotentiometer_setValue : Error processing arguments"); - cobj->setValue(arg0); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlPotentiometer_setValue) - -static bool js_cocos2dx_extension_ControlPotentiometer_getProgressTimer(se::State& s) -{ - cocos2d::extension::ControlPotentiometer* cobj = (cocos2d::extension::ControlPotentiometer*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlPotentiometer_getProgressTimer : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 0) { - cocos2d::ProgressTimer* result = cobj->getProgressTimer(); - ok &= native_ptr_to_seval((cocos2d::ProgressTimer*)result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlPotentiometer_getProgressTimer : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlPotentiometer_getProgressTimer) - -static bool js_cocos2dx_extension_ControlPotentiometer_getMaximumValue(se::State& s) -{ - cocos2d::extension::ControlPotentiometer* cobj = (cocos2d::extension::ControlPotentiometer*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlPotentiometer_getMaximumValue : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 0) { - float result = cobj->getMaximumValue(); - ok &= float_to_seval(result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlPotentiometer_getMaximumValue : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlPotentiometer_getMaximumValue) - -static bool js_cocos2dx_extension_ControlPotentiometer_angleInDegreesBetweenLineFromPoint_toPoint_toLineFromPoint_toPoint(se::State& s) -{ - cocos2d::extension::ControlPotentiometer* cobj = (cocos2d::extension::ControlPotentiometer*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlPotentiometer_angleInDegreesBetweenLineFromPoint_toPoint_toLineFromPoint_toPoint : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 4) { - cocos2d::Vec2 arg0; - cocos2d::Vec2 arg1; - cocos2d::Vec2 arg2; - cocos2d::Vec2 arg3; - ok &= seval_to_Vec2(args[0], &arg0); - ok &= seval_to_Vec2(args[1], &arg1); - ok &= seval_to_Vec2(args[2], &arg2); - ok &= seval_to_Vec2(args[3], &arg3); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlPotentiometer_angleInDegreesBetweenLineFromPoint_toPoint_toLineFromPoint_toPoint : Error processing arguments"); - float result = cobj->angleInDegreesBetweenLineFromPoint_toPoint_toLineFromPoint_toPoint(arg0, arg1, arg2, arg3); - ok &= float_to_seval(result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlPotentiometer_angleInDegreesBetweenLineFromPoint_toPoint_toLineFromPoint_toPoint : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 4); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlPotentiometer_angleInDegreesBetweenLineFromPoint_toPoint_toLineFromPoint_toPoint) - -static bool js_cocos2dx_extension_ControlPotentiometer_potentiometerBegan(se::State& s) -{ - cocos2d::extension::ControlPotentiometer* cobj = (cocos2d::extension::ControlPotentiometer*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlPotentiometer_potentiometerBegan : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 1) { - cocos2d::Vec2 arg0; - ok &= seval_to_Vec2(args[0], &arg0); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlPotentiometer_potentiometerBegan : Error processing arguments"); - cobj->potentiometerBegan(arg0); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlPotentiometer_potentiometerBegan) - -static bool js_cocos2dx_extension_ControlPotentiometer_setMaximumValue(se::State& s) -{ - cocos2d::extension::ControlPotentiometer* cobj = (cocos2d::extension::ControlPotentiometer*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlPotentiometer_setMaximumValue : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 1) { - float arg0 = 0; - ok &= seval_to_float(args[0], &arg0); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlPotentiometer_setMaximumValue : Error processing arguments"); - cobj->setMaximumValue(arg0); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlPotentiometer_setMaximumValue) - -static bool js_cocos2dx_extension_ControlPotentiometer_getMinimumValue(se::State& s) -{ - cocos2d::extension::ControlPotentiometer* cobj = (cocos2d::extension::ControlPotentiometer*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlPotentiometer_getMinimumValue : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 0) { - float result = cobj->getMinimumValue(); - ok &= float_to_seval(result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlPotentiometer_getMinimumValue : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlPotentiometer_getMinimumValue) - -static bool js_cocos2dx_extension_ControlPotentiometer_setThumbSprite(se::State& s) -{ - cocos2d::extension::ControlPotentiometer* cobj = (cocos2d::extension::ControlPotentiometer*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlPotentiometer_setThumbSprite : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 1) { - cocos2d::Sprite* arg0 = nullptr; - ok &= seval_to_native_ptr(args[0], &arg0); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlPotentiometer_setThumbSprite : Error processing arguments"); - cobj->setThumbSprite(arg0); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlPotentiometer_setThumbSprite) - -static bool js_cocos2dx_extension_ControlPotentiometer_getValue(se::State& s) -{ - cocos2d::extension::ControlPotentiometer* cobj = (cocos2d::extension::ControlPotentiometer*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlPotentiometer_getValue : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 0) { - float result = cobj->getValue(); - ok &= float_to_seval(result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlPotentiometer_getValue : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlPotentiometer_getValue) - -static bool js_cocos2dx_extension_ControlPotentiometer_getPreviousLocation(se::State& s) -{ - cocos2d::extension::ControlPotentiometer* cobj = (cocos2d::extension::ControlPotentiometer*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlPotentiometer_getPreviousLocation : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 0) { - cocos2d::Vec2 result = cobj->getPreviousLocation(); - ok &= Vec2_to_seval(result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlPotentiometer_getPreviousLocation : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlPotentiometer_getPreviousLocation) - -static bool js_cocos2dx_extension_ControlPotentiometer_distanceBetweenPointAndPoint(se::State& s) -{ - cocos2d::extension::ControlPotentiometer* cobj = (cocos2d::extension::ControlPotentiometer*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlPotentiometer_distanceBetweenPointAndPoint : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 2) { - cocos2d::Vec2 arg0; - cocos2d::Vec2 arg1; - ok &= seval_to_Vec2(args[0], &arg0); - ok &= seval_to_Vec2(args[1], &arg1); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlPotentiometer_distanceBetweenPointAndPoint : Error processing arguments"); - float result = cobj->distanceBetweenPointAndPoint(arg0, arg1); - ok &= float_to_seval(result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlPotentiometer_distanceBetweenPointAndPoint : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 2); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlPotentiometer_distanceBetweenPointAndPoint) - -static bool js_cocos2dx_extension_ControlPotentiometer_potentiometerEnded(se::State& s) -{ - cocos2d::extension::ControlPotentiometer* cobj = (cocos2d::extension::ControlPotentiometer*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlPotentiometer_potentiometerEnded : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 1) { - cocos2d::Vec2 arg0; - ok &= seval_to_Vec2(args[0], &arg0); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlPotentiometer_potentiometerEnded : Error processing arguments"); - cobj->potentiometerEnded(arg0); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlPotentiometer_potentiometerEnded) - -static bool js_cocos2dx_extension_ControlPotentiometer_setProgressTimer(se::State& s) -{ - cocos2d::extension::ControlPotentiometer* cobj = (cocos2d::extension::ControlPotentiometer*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlPotentiometer_setProgressTimer : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 1) { - cocos2d::ProgressTimer* arg0 = nullptr; - ok &= seval_to_native_ptr(args[0], &arg0); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlPotentiometer_setProgressTimer : Error processing arguments"); - cobj->setProgressTimer(arg0); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlPotentiometer_setProgressTimer) - -static bool js_cocos2dx_extension_ControlPotentiometer_setMinimumValue(se::State& s) -{ - cocos2d::extension::ControlPotentiometer* cobj = (cocos2d::extension::ControlPotentiometer*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlPotentiometer_setMinimumValue : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 1) { - float arg0 = 0; - ok &= seval_to_float(args[0], &arg0); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlPotentiometer_setMinimumValue : Error processing arguments"); - cobj->setMinimumValue(arg0); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlPotentiometer_setMinimumValue) - -static bool js_cocos2dx_extension_ControlPotentiometer_getThumbSprite(se::State& s) -{ - cocos2d::extension::ControlPotentiometer* cobj = (cocos2d::extension::ControlPotentiometer*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlPotentiometer_getThumbSprite : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 0) { - cocos2d::Sprite* result = cobj->getThumbSprite(); - ok &= native_ptr_to_seval((cocos2d::Sprite*)result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlPotentiometer_getThumbSprite : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlPotentiometer_getThumbSprite) - -static bool js_cocos2dx_extension_ControlPotentiometer_initWithTrackSprite_ProgressTimer_ThumbSprite(se::State& s) -{ - cocos2d::extension::ControlPotentiometer* cobj = (cocos2d::extension::ControlPotentiometer*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlPotentiometer_initWithTrackSprite_ProgressTimer_ThumbSprite : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 3) { - cocos2d::Sprite* arg0 = nullptr; - cocos2d::ProgressTimer* arg1 = nullptr; - cocos2d::Sprite* arg2 = nullptr; - ok &= seval_to_native_ptr(args[0], &arg0); - ok &= seval_to_native_ptr(args[1], &arg1); - ok &= seval_to_native_ptr(args[2], &arg2); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlPotentiometer_initWithTrackSprite_ProgressTimer_ThumbSprite : Error processing arguments"); - bool result = cobj->initWithTrackSprite_ProgressTimer_ThumbSprite(arg0, arg1, arg2); - ok &= boolean_to_seval(result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlPotentiometer_initWithTrackSprite_ProgressTimer_ThumbSprite : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 3); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlPotentiometer_initWithTrackSprite_ProgressTimer_ThumbSprite) - -static bool js_cocos2dx_extension_ControlPotentiometer_potentiometerMoved(se::State& s) -{ - cocos2d::extension::ControlPotentiometer* cobj = (cocos2d::extension::ControlPotentiometer*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlPotentiometer_potentiometerMoved : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 1) { - cocos2d::Vec2 arg0; - ok &= seval_to_Vec2(args[0], &arg0); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlPotentiometer_potentiometerMoved : Error processing arguments"); - cobj->potentiometerMoved(arg0); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlPotentiometer_potentiometerMoved) - -static bool js_cocos2dx_extension_ControlPotentiometer_create(se::State& s) -{ - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 3) { - const char* arg0 = nullptr; - const char* arg1 = nullptr; - const char* arg2 = nullptr; - std::string arg0_tmp; ok &= seval_to_std_string(args[0], &arg0_tmp); arg0 = arg0_tmp.c_str(); - std::string arg1_tmp; ok &= seval_to_std_string(args[1], &arg1_tmp); arg1 = arg1_tmp.c_str(); - std::string arg2_tmp; ok &= seval_to_std_string(args[2], &arg2_tmp); arg2 = arg2_tmp.c_str(); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlPotentiometer_create : Error processing arguments"); - auto result = cocos2d::extension::ControlPotentiometer::create(arg0, arg1, arg2); - result->retain(); - auto obj = se::Object::createObjectWithClass(__jsb_cocos2d_extension_ControlPotentiometer_class); - obj->setPrivateData(result); - s.rval().setObject(obj); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 3); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlPotentiometer_create) - -SE_DECLARE_FINALIZE_FUNC(js_cocos2d_extension_ControlPotentiometer_finalize) - -static bool js_cocos2dx_extension_ControlPotentiometer_constructor(se::State& s) -{ - cocos2d::extension::ControlPotentiometer* cobj = new (std::nothrow) cocos2d::extension::ControlPotentiometer(); - s.thisObject()->setPrivateData(cobj); - return true; -} -SE_BIND_CTOR(js_cocos2dx_extension_ControlPotentiometer_constructor, __jsb_cocos2d_extension_ControlPotentiometer_class, js_cocos2d_extension_ControlPotentiometer_finalize) - -static bool js_cocos2dx_extension_ControlPotentiometer_ctor(se::State& s) -{ - cocos2d::extension::ControlPotentiometer* cobj = new (std::nothrow) cocos2d::extension::ControlPotentiometer(); - s.thisObject()->setPrivateData(cobj); - return true; -} -SE_BIND_SUB_CLS_CTOR(js_cocos2dx_extension_ControlPotentiometer_ctor, __jsb_cocos2d_extension_ControlPotentiometer_class, js_cocos2d_extension_ControlPotentiometer_finalize) - - - - -extern se::Object* __jsb_cocos2d_extension_Control_proto; - -static bool js_cocos2d_extension_ControlPotentiometer_finalize(se::State& s) -{ - CCLOG("jsbindings: finalizing JS object %p (cocos2d::extension::ControlPotentiometer)", s.nativeThisObject()); - cocos2d::extension::ControlPotentiometer* cobj = (cocos2d::extension::ControlPotentiometer*)s.nativeThisObject(); - if (cobj->getReferenceCount() == 1) - cobj->autorelease(); - else - cobj->release(); - return true; -} -SE_BIND_FINALIZE_FUNC(js_cocos2d_extension_ControlPotentiometer_finalize) - -bool js_register_cocos2dx_extension_ControlPotentiometer(se::Object* obj) -{ - auto cls = se::Class::create("ControlPotentiometer", obj, __jsb_cocos2d_extension_Control_proto, _SE(js_cocos2dx_extension_ControlPotentiometer_constructor)); - - cls->defineFunction("setPreviousLocation", _SE(js_cocos2dx_extension_ControlPotentiometer_setPreviousLocation)); - cls->defineFunction("setValue", _SE(js_cocos2dx_extension_ControlPotentiometer_setValue)); - cls->defineFunction("getProgressTimer", _SE(js_cocos2dx_extension_ControlPotentiometer_getProgressTimer)); - cls->defineFunction("getMaximumValue", _SE(js_cocos2dx_extension_ControlPotentiometer_getMaximumValue)); - cls->defineFunction("angleInDegreesBetweenLineFromPoint_toPoint_toLineFromPoint_toPoint", _SE(js_cocos2dx_extension_ControlPotentiometer_angleInDegreesBetweenLineFromPoint_toPoint_toLineFromPoint_toPoint)); - cls->defineFunction("potentiometerBegan", _SE(js_cocos2dx_extension_ControlPotentiometer_potentiometerBegan)); - cls->defineFunction("setMaximumValue", _SE(js_cocos2dx_extension_ControlPotentiometer_setMaximumValue)); - cls->defineFunction("getMinimumValue", _SE(js_cocos2dx_extension_ControlPotentiometer_getMinimumValue)); - cls->defineFunction("setThumbSprite", _SE(js_cocos2dx_extension_ControlPotentiometer_setThumbSprite)); - cls->defineFunction("getValue", _SE(js_cocos2dx_extension_ControlPotentiometer_getValue)); - cls->defineFunction("getPreviousLocation", _SE(js_cocos2dx_extension_ControlPotentiometer_getPreviousLocation)); - cls->defineFunction("distanceBetweenPointAndPoint", _SE(js_cocos2dx_extension_ControlPotentiometer_distanceBetweenPointAndPoint)); - cls->defineFunction("potentiometerEnded", _SE(js_cocos2dx_extension_ControlPotentiometer_potentiometerEnded)); - cls->defineFunction("setProgressTimer", _SE(js_cocos2dx_extension_ControlPotentiometer_setProgressTimer)); - cls->defineFunction("setMinimumValue", _SE(js_cocos2dx_extension_ControlPotentiometer_setMinimumValue)); - cls->defineFunction("getThumbSprite", _SE(js_cocos2dx_extension_ControlPotentiometer_getThumbSprite)); - cls->defineFunction("initWithTrackSprite_ProgressTimer_ThumbSprite", _SE(js_cocos2dx_extension_ControlPotentiometer_initWithTrackSprite_ProgressTimer_ThumbSprite)); - cls->defineFunction("potentiometerMoved", _SE(js_cocos2dx_extension_ControlPotentiometer_potentiometerMoved)); - cls->defineFunction("ctor", _SE(js_cocos2dx_extension_ControlPotentiometer_ctor)); - cls->defineStaticFunction("create", _SE(js_cocos2dx_extension_ControlPotentiometer_create)); - cls->defineFinalizeFunction(_SE(js_cocos2d_extension_ControlPotentiometer_finalize)); - cls->install(); - JSBClassType::registerClass(cls); - - __jsb_cocos2d_extension_ControlPotentiometer_proto = cls->getProto(); - __jsb_cocos2d_extension_ControlPotentiometer_class = cls; - - se::ScriptEngine::getInstance()->evalString("(function () { cc.ControlPotentiometer.extend = cc.Class.extend; })()"); - se::ScriptEngine::getInstance()->clearException(); - return true; -} - -se::Object* __jsb_cocos2d_extension_ControlSlider_proto = nullptr; -se::Class* __jsb_cocos2d_extension_ControlSlider_class = nullptr; - -static bool js_cocos2dx_extension_ControlSlider_setBackgroundSprite(se::State& s) -{ - cocos2d::extension::ControlSlider* cobj = (cocos2d::extension::ControlSlider*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlSlider_setBackgroundSprite : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 1) { - cocos2d::Sprite* arg0 = nullptr; - ok &= seval_to_native_ptr(args[0], &arg0); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlSlider_setBackgroundSprite : Error processing arguments"); - cobj->setBackgroundSprite(arg0); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlSlider_setBackgroundSprite) - -static bool js_cocos2dx_extension_ControlSlider_getMaximumAllowedValue(se::State& s) -{ - cocos2d::extension::ControlSlider* cobj = (cocos2d::extension::ControlSlider*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlSlider_getMaximumAllowedValue : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 0) { - float result = cobj->getMaximumAllowedValue(); - ok &= float_to_seval(result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlSlider_getMaximumAllowedValue : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlSlider_getMaximumAllowedValue) - -static bool js_cocos2dx_extension_ControlSlider_initWithSprites(se::State& s) -{ - CC_UNUSED bool ok = true; - cocos2d::extension::ControlSlider* cobj = (cocos2d::extension::ControlSlider*)s.nativeThisObject(); - SE_PRECONDITION2( cobj, false, "js_cocos2dx_extension_ControlSlider_initWithSprites : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - do { - if (argc == 4) { - cocos2d::Sprite* arg0 = nullptr; - ok &= seval_to_native_ptr(args[0], &arg0); - if (!ok) { ok = true; break; } - cocos2d::Sprite* arg1 = nullptr; - ok &= seval_to_native_ptr(args[1], &arg1); - if (!ok) { ok = true; break; } - cocos2d::Sprite* arg2 = nullptr; - ok &= seval_to_native_ptr(args[2], &arg2); - if (!ok) { ok = true; break; } - cocos2d::Sprite* arg3 = nullptr; - ok &= seval_to_native_ptr(args[3], &arg3); - if (!ok) { ok = true; break; } - bool result = cobj->initWithSprites(arg0, arg1, arg2, arg3); - ok &= boolean_to_seval(result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlSlider_initWithSprites : Error processing arguments"); - return true; - } - } while(false); - - do { - if (argc == 3) { - cocos2d::Sprite* arg0 = nullptr; - ok &= seval_to_native_ptr(args[0], &arg0); - if (!ok) { ok = true; break; } - cocos2d::Sprite* arg1 = nullptr; - ok &= seval_to_native_ptr(args[1], &arg1); - if (!ok) { ok = true; break; } - cocos2d::Sprite* arg2 = nullptr; - ok &= seval_to_native_ptr(args[2], &arg2); - if (!ok) { ok = true; break; } - bool result = cobj->initWithSprites(arg0, arg1, arg2); - ok &= boolean_to_seval(result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlSlider_initWithSprites : Error processing arguments"); - return true; - } - } while(false); - - SE_REPORT_ERROR("wrong number of arguments: %d", (int)argc); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlSlider_initWithSprites) - -static bool js_cocos2dx_extension_ControlSlider_getMinimumAllowedValue(se::State& s) -{ - cocos2d::extension::ControlSlider* cobj = (cocos2d::extension::ControlSlider*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlSlider_getMinimumAllowedValue : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 0) { - float result = cobj->getMinimumAllowedValue(); - ok &= float_to_seval(result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlSlider_getMinimumAllowedValue : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlSlider_getMinimumAllowedValue) - -static bool js_cocos2dx_extension_ControlSlider_getMaximumValue(se::State& s) -{ - cocos2d::extension::ControlSlider* cobj = (cocos2d::extension::ControlSlider*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlSlider_getMaximumValue : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 0) { - float result = cobj->getMaximumValue(); - ok &= float_to_seval(result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlSlider_getMaximumValue : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlSlider_getMaximumValue) - -static bool js_cocos2dx_extension_ControlSlider_getSelectedThumbSprite(se::State& s) -{ - cocos2d::extension::ControlSlider* cobj = (cocos2d::extension::ControlSlider*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlSlider_getSelectedThumbSprite : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 0) { - cocos2d::Sprite* result = cobj->getSelectedThumbSprite(); - ok &= native_ptr_to_seval((cocos2d::Sprite*)result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlSlider_getSelectedThumbSprite : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlSlider_getSelectedThumbSprite) - -static bool js_cocos2dx_extension_ControlSlider_setProgressSprite(se::State& s) -{ - cocos2d::extension::ControlSlider* cobj = (cocos2d::extension::ControlSlider*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlSlider_setProgressSprite : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 1) { - cocos2d::Sprite* arg0 = nullptr; - ok &= seval_to_native_ptr(args[0], &arg0); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlSlider_setProgressSprite : Error processing arguments"); - cobj->setProgressSprite(arg0); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlSlider_setProgressSprite) - -static bool js_cocos2dx_extension_ControlSlider_setMaximumValue(se::State& s) -{ - cocos2d::extension::ControlSlider* cobj = (cocos2d::extension::ControlSlider*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlSlider_setMaximumValue : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 1) { - float arg0 = 0; - ok &= seval_to_float(args[0], &arg0); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlSlider_setMaximumValue : Error processing arguments"); - cobj->setMaximumValue(arg0); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlSlider_setMaximumValue) - -static bool js_cocos2dx_extension_ControlSlider_getMinimumValue(se::State& s) -{ - cocos2d::extension::ControlSlider* cobj = (cocos2d::extension::ControlSlider*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlSlider_getMinimumValue : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 0) { - float result = cobj->getMinimumValue(); - ok &= float_to_seval(result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlSlider_getMinimumValue : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlSlider_getMinimumValue) - -static bool js_cocos2dx_extension_ControlSlider_setThumbSprite(se::State& s) -{ - cocos2d::extension::ControlSlider* cobj = (cocos2d::extension::ControlSlider*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlSlider_setThumbSprite : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 1) { - cocos2d::Sprite* arg0 = nullptr; - ok &= seval_to_native_ptr(args[0], &arg0); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlSlider_setThumbSprite : Error processing arguments"); - cobj->setThumbSprite(arg0); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlSlider_setThumbSprite) - -static bool js_cocos2dx_extension_ControlSlider_getValue(se::State& s) -{ - cocos2d::extension::ControlSlider* cobj = (cocos2d::extension::ControlSlider*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlSlider_getValue : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 0) { - float result = cobj->getValue(); - ok &= float_to_seval(result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlSlider_getValue : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlSlider_getValue) - -static bool js_cocos2dx_extension_ControlSlider_getBackgroundSprite(se::State& s) -{ - cocos2d::extension::ControlSlider* cobj = (cocos2d::extension::ControlSlider*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlSlider_getBackgroundSprite : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 0) { - cocos2d::Sprite* result = cobj->getBackgroundSprite(); - ok &= native_ptr_to_seval((cocos2d::Sprite*)result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlSlider_getBackgroundSprite : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlSlider_getBackgroundSprite) - -static bool js_cocos2dx_extension_ControlSlider_getThumbSprite(se::State& s) -{ - cocos2d::extension::ControlSlider* cobj = (cocos2d::extension::ControlSlider*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlSlider_getThumbSprite : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 0) { - cocos2d::Sprite* result = cobj->getThumbSprite(); - ok &= native_ptr_to_seval((cocos2d::Sprite*)result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlSlider_getThumbSprite : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlSlider_getThumbSprite) - -static bool js_cocos2dx_extension_ControlSlider_setValue(se::State& s) -{ - cocos2d::extension::ControlSlider* cobj = (cocos2d::extension::ControlSlider*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlSlider_setValue : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 1) { - float arg0 = 0; - ok &= seval_to_float(args[0], &arg0); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlSlider_setValue : Error processing arguments"); - cobj->setValue(arg0); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlSlider_setValue) - -static bool js_cocos2dx_extension_ControlSlider_locationFromTouch(se::State& s) -{ - cocos2d::extension::ControlSlider* cobj = (cocos2d::extension::ControlSlider*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlSlider_locationFromTouch : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 1) { - cocos2d::Touch* arg0 = nullptr; - ok &= seval_to_native_ptr(args[0], &arg0); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlSlider_locationFromTouch : Error processing arguments"); - cocos2d::Vec2 result = cobj->locationFromTouch(arg0); - ok &= Vec2_to_seval(result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlSlider_locationFromTouch : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlSlider_locationFromTouch) - -static bool js_cocos2dx_extension_ControlSlider_setMinimumValue(se::State& s) -{ - cocos2d::extension::ControlSlider* cobj = (cocos2d::extension::ControlSlider*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlSlider_setMinimumValue : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 1) { - float arg0 = 0; - ok &= seval_to_float(args[0], &arg0); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlSlider_setMinimumValue : Error processing arguments"); - cobj->setMinimumValue(arg0); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlSlider_setMinimumValue) - -static bool js_cocos2dx_extension_ControlSlider_setMinimumAllowedValue(se::State& s) -{ - cocos2d::extension::ControlSlider* cobj = (cocos2d::extension::ControlSlider*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlSlider_setMinimumAllowedValue : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 1) { - float arg0 = 0; - ok &= seval_to_float(args[0], &arg0); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlSlider_setMinimumAllowedValue : Error processing arguments"); - cobj->setMinimumAllowedValue(arg0); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlSlider_setMinimumAllowedValue) - -static bool js_cocos2dx_extension_ControlSlider_getProgressSprite(se::State& s) -{ - cocos2d::extension::ControlSlider* cobj = (cocos2d::extension::ControlSlider*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlSlider_getProgressSprite : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 0) { - cocos2d::Sprite* result = cobj->getProgressSprite(); - ok &= native_ptr_to_seval((cocos2d::Sprite*)result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlSlider_getProgressSprite : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlSlider_getProgressSprite) - -static bool js_cocos2dx_extension_ControlSlider_setSelectedThumbSprite(se::State& s) -{ - cocos2d::extension::ControlSlider* cobj = (cocos2d::extension::ControlSlider*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlSlider_setSelectedThumbSprite : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 1) { - cocos2d::Sprite* arg0 = nullptr; - ok &= seval_to_native_ptr(args[0], &arg0); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlSlider_setSelectedThumbSprite : Error processing arguments"); - cobj->setSelectedThumbSprite(arg0); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlSlider_setSelectedThumbSprite) - -static bool js_cocos2dx_extension_ControlSlider_setMaximumAllowedValue(se::State& s) -{ - cocos2d::extension::ControlSlider* cobj = (cocos2d::extension::ControlSlider*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlSlider_setMaximumAllowedValue : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 1) { - float arg0 = 0; - ok &= seval_to_float(args[0], &arg0); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlSlider_setMaximumAllowedValue : Error processing arguments"); - cobj->setMaximumAllowedValue(arg0); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlSlider_setMaximumAllowedValue) - -static bool js_cocos2dx_extension_ControlSlider_create(se::State& s) -{ - CC_UNUSED bool ok = true; - const auto& args = s.args(); - size_t argc = args.size(); - do { - if (argc == 3) { - cocos2d::Sprite* arg0 = nullptr; - ok &= seval_to_native_ptr(args[0], &arg0); - if (!ok) { ok = true; break; } - cocos2d::Sprite* arg1 = nullptr; - ok &= seval_to_native_ptr(args[1], &arg1); - if (!ok) { ok = true; break; } - cocos2d::Sprite* arg2 = nullptr; - ok &= seval_to_native_ptr(args[2], &arg2); - if (!ok) { ok = true; break; } - cocos2d::extension::ControlSlider* result = cocos2d::extension::ControlSlider::create(arg0, arg1, arg2); - ok &= native_ptr_to_seval((cocos2d::extension::ControlSlider*)result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlSlider_create : Error processing arguments"); - return true; - } - } while (false); - do { - if (argc == 3) { - const char* arg0 = nullptr; - std::string arg0_tmp; ok &= seval_to_std_string(args[0], &arg0_tmp); arg0 = arg0_tmp.c_str(); - if (!ok) { ok = true; break; } - const char* arg1 = nullptr; - std::string arg1_tmp; ok &= seval_to_std_string(args[1], &arg1_tmp); arg1 = arg1_tmp.c_str(); - if (!ok) { ok = true; break; } - const char* arg2 = nullptr; - std::string arg2_tmp; ok &= seval_to_std_string(args[2], &arg2_tmp); arg2 = arg2_tmp.c_str(); - if (!ok) { ok = true; break; } - cocos2d::extension::ControlSlider* result = cocos2d::extension::ControlSlider::create(arg0, arg1, arg2); - ok &= native_ptr_to_seval((cocos2d::extension::ControlSlider*)result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlSlider_create : Error processing arguments"); - return true; - } - } while (false); - do { - if (argc == 4) { - const char* arg0 = nullptr; - std::string arg0_tmp; ok &= seval_to_std_string(args[0], &arg0_tmp); arg0 = arg0_tmp.c_str(); - if (!ok) { ok = true; break; } - const char* arg1 = nullptr; - std::string arg1_tmp; ok &= seval_to_std_string(args[1], &arg1_tmp); arg1 = arg1_tmp.c_str(); - if (!ok) { ok = true; break; } - const char* arg2 = nullptr; - std::string arg2_tmp; ok &= seval_to_std_string(args[2], &arg2_tmp); arg2 = arg2_tmp.c_str(); - if (!ok) { ok = true; break; } - const char* arg3 = nullptr; - std::string arg3_tmp; ok &= seval_to_std_string(args[3], &arg3_tmp); arg3 = arg3_tmp.c_str(); - if (!ok) { ok = true; break; } - cocos2d::extension::ControlSlider* result = cocos2d::extension::ControlSlider::create(arg0, arg1, arg2, arg3); - ok &= native_ptr_to_seval((cocos2d::extension::ControlSlider*)result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlSlider_create : Error processing arguments"); - return true; - } - } while (false); - do { - if (argc == 4) { - cocos2d::Sprite* arg0 = nullptr; - ok &= seval_to_native_ptr(args[0], &arg0); - if (!ok) { ok = true; break; } - cocos2d::Sprite* arg1 = nullptr; - ok &= seval_to_native_ptr(args[1], &arg1); - if (!ok) { ok = true; break; } - cocos2d::Sprite* arg2 = nullptr; - ok &= seval_to_native_ptr(args[2], &arg2); - if (!ok) { ok = true; break; } - cocos2d::Sprite* arg3 = nullptr; - ok &= seval_to_native_ptr(args[3], &arg3); - if (!ok) { ok = true; break; } - cocos2d::extension::ControlSlider* result = cocos2d::extension::ControlSlider::create(arg0, arg1, arg2, arg3); - ok &= native_ptr_to_seval((cocos2d::extension::ControlSlider*)result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlSlider_create : Error processing arguments"); - return true; - } - } while (false); - SE_REPORT_ERROR("wrong number of arguments: %d", (int)argc); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlSlider_create) - -SE_DECLARE_FINALIZE_FUNC(js_cocos2d_extension_ControlSlider_finalize) - -static bool js_cocos2dx_extension_ControlSlider_constructor(se::State& s) -{ - cocos2d::extension::ControlSlider* cobj = new (std::nothrow) cocos2d::extension::ControlSlider(); - s.thisObject()->setPrivateData(cobj); - return true; -} -SE_BIND_CTOR(js_cocos2dx_extension_ControlSlider_constructor, __jsb_cocos2d_extension_ControlSlider_class, js_cocos2d_extension_ControlSlider_finalize) - -static bool js_cocos2dx_extension_ControlSlider_ctor(se::State& s) -{ - cocos2d::extension::ControlSlider* cobj = new (std::nothrow) cocos2d::extension::ControlSlider(); - s.thisObject()->setPrivateData(cobj); - return true; -} -SE_BIND_SUB_CLS_CTOR(js_cocos2dx_extension_ControlSlider_ctor, __jsb_cocos2d_extension_ControlSlider_class, js_cocos2d_extension_ControlSlider_finalize) - - - - -extern se::Object* __jsb_cocos2d_extension_Control_proto; - -static bool js_cocos2d_extension_ControlSlider_finalize(se::State& s) -{ - CCLOG("jsbindings: finalizing JS object %p (cocos2d::extension::ControlSlider)", s.nativeThisObject()); - cocos2d::extension::ControlSlider* cobj = (cocos2d::extension::ControlSlider*)s.nativeThisObject(); - if (cobj->getReferenceCount() == 1) - cobj->autorelease(); - else - cobj->release(); - return true; -} -SE_BIND_FINALIZE_FUNC(js_cocos2d_extension_ControlSlider_finalize) - -bool js_register_cocos2dx_extension_ControlSlider(se::Object* obj) -{ - auto cls = se::Class::create("ControlSlider", obj, __jsb_cocos2d_extension_Control_proto, _SE(js_cocos2dx_extension_ControlSlider_constructor)); - - cls->defineFunction("setBackgroundSprite", _SE(js_cocos2dx_extension_ControlSlider_setBackgroundSprite)); - cls->defineFunction("getMaximumAllowedValue", _SE(js_cocos2dx_extension_ControlSlider_getMaximumAllowedValue)); - cls->defineFunction("initWithSprites", _SE(js_cocos2dx_extension_ControlSlider_initWithSprites)); - cls->defineFunction("getMinimumAllowedValue", _SE(js_cocos2dx_extension_ControlSlider_getMinimumAllowedValue)); - cls->defineFunction("getMaximumValue", _SE(js_cocos2dx_extension_ControlSlider_getMaximumValue)); - cls->defineFunction("getSelectedThumbSprite", _SE(js_cocos2dx_extension_ControlSlider_getSelectedThumbSprite)); - cls->defineFunction("setProgressSprite", _SE(js_cocos2dx_extension_ControlSlider_setProgressSprite)); - cls->defineFunction("setMaximumValue", _SE(js_cocos2dx_extension_ControlSlider_setMaximumValue)); - cls->defineFunction("getMinimumValue", _SE(js_cocos2dx_extension_ControlSlider_getMinimumValue)); - cls->defineFunction("setThumbSprite", _SE(js_cocos2dx_extension_ControlSlider_setThumbSprite)); - cls->defineFunction("getValue", _SE(js_cocos2dx_extension_ControlSlider_getValue)); - cls->defineFunction("getBackgroundSprite", _SE(js_cocos2dx_extension_ControlSlider_getBackgroundSprite)); - cls->defineFunction("getThumbSprite", _SE(js_cocos2dx_extension_ControlSlider_getThumbSprite)); - cls->defineFunction("setValue", _SE(js_cocos2dx_extension_ControlSlider_setValue)); - cls->defineFunction("locationFromTouch", _SE(js_cocos2dx_extension_ControlSlider_locationFromTouch)); - cls->defineFunction("setMinimumValue", _SE(js_cocos2dx_extension_ControlSlider_setMinimumValue)); - cls->defineFunction("setMinimumAllowedValue", _SE(js_cocos2dx_extension_ControlSlider_setMinimumAllowedValue)); - cls->defineFunction("getProgressSprite", _SE(js_cocos2dx_extension_ControlSlider_getProgressSprite)); - cls->defineFunction("setSelectedThumbSprite", _SE(js_cocos2dx_extension_ControlSlider_setSelectedThumbSprite)); - cls->defineFunction("setMaximumAllowedValue", _SE(js_cocos2dx_extension_ControlSlider_setMaximumAllowedValue)); - cls->defineFunction("ctor", _SE(js_cocos2dx_extension_ControlSlider_ctor)); - cls->defineStaticFunction("create", _SE(js_cocos2dx_extension_ControlSlider_create)); - cls->defineFinalizeFunction(_SE(js_cocos2d_extension_ControlSlider_finalize)); - cls->install(); - JSBClassType::registerClass(cls); - - __jsb_cocos2d_extension_ControlSlider_proto = cls->getProto(); - __jsb_cocos2d_extension_ControlSlider_class = cls; - - se::ScriptEngine::getInstance()->evalString("(function () { cc.ControlSlider.extend = cc.Class.extend; })()"); - se::ScriptEngine::getInstance()->clearException(); - return true; -} - -se::Object* __jsb_cocos2d_extension_ControlStepper_proto = nullptr; -se::Class* __jsb_cocos2d_extension_ControlStepper_class = nullptr; - -static bool js_cocos2dx_extension_ControlStepper_getMinusSprite(se::State& s) -{ - cocos2d::extension::ControlStepper* cobj = (cocos2d::extension::ControlStepper*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlStepper_getMinusSprite : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 0) { - cocos2d::Sprite* result = cobj->getMinusSprite(); - ok &= native_ptr_to_seval((cocos2d::Sprite*)result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlStepper_getMinusSprite : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlStepper_getMinusSprite) - -static bool js_cocos2dx_extension_ControlStepper_setValue(se::State& s) -{ - cocos2d::extension::ControlStepper* cobj = (cocos2d::extension::ControlStepper*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlStepper_setValue : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 1) { - double arg0 = 0; - ok &= seval_to_double(args[0], &arg0); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlStepper_setValue : Error processing arguments"); - cobj->setValue(arg0); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlStepper_setValue) - -static bool js_cocos2dx_extension_ControlStepper_setStepValue(se::State& s) -{ - cocos2d::extension::ControlStepper* cobj = (cocos2d::extension::ControlStepper*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlStepper_setStepValue : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 1) { - double arg0 = 0; - ok &= seval_to_double(args[0], &arg0); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlStepper_setStepValue : Error processing arguments"); - cobj->setStepValue(arg0); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlStepper_setStepValue) - -static bool js_cocos2dx_extension_ControlStepper_initWithMinusSpriteAndPlusSprite(se::State& s) -{ - cocos2d::extension::ControlStepper* cobj = (cocos2d::extension::ControlStepper*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlStepper_initWithMinusSpriteAndPlusSprite : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 2) { - cocos2d::Sprite* arg0 = nullptr; - cocos2d::Sprite* arg1 = nullptr; - ok &= seval_to_native_ptr(args[0], &arg0); - ok &= seval_to_native_ptr(args[1], &arg1); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlStepper_initWithMinusSpriteAndPlusSprite : Error processing arguments"); - bool result = cobj->initWithMinusSpriteAndPlusSprite(arg0, arg1); - ok &= boolean_to_seval(result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlStepper_initWithMinusSpriteAndPlusSprite : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 2); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlStepper_initWithMinusSpriteAndPlusSprite) - -static bool js_cocos2dx_extension_ControlStepper_setValueWithSendingEvent(se::State& s) -{ - cocos2d::extension::ControlStepper* cobj = (cocos2d::extension::ControlStepper*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlStepper_setValueWithSendingEvent : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 2) { - double arg0 = 0; - bool arg1; - ok &= seval_to_double(args[0], &arg0); - ok &= seval_to_boolean(args[1], &arg1); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlStepper_setValueWithSendingEvent : Error processing arguments"); - cobj->setValueWithSendingEvent(arg0, arg1); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 2); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlStepper_setValueWithSendingEvent) - -static bool js_cocos2dx_extension_ControlStepper_setMaximumValue(se::State& s) -{ - cocos2d::extension::ControlStepper* cobj = (cocos2d::extension::ControlStepper*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlStepper_setMaximumValue : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 1) { - double arg0 = 0; - ok &= seval_to_double(args[0], &arg0); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlStepper_setMaximumValue : Error processing arguments"); - cobj->setMaximumValue(arg0); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlStepper_setMaximumValue) - -static bool js_cocos2dx_extension_ControlStepper_getMinusLabel(se::State& s) -{ - cocos2d::extension::ControlStepper* cobj = (cocos2d::extension::ControlStepper*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlStepper_getMinusLabel : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 0) { - cocos2d::Label* result = cobj->getMinusLabel(); - ok &= native_ptr_to_seval((cocos2d::Label*)result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlStepper_getMinusLabel : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlStepper_getMinusLabel) - -static bool js_cocos2dx_extension_ControlStepper_getPlusLabel(se::State& s) -{ - cocos2d::extension::ControlStepper* cobj = (cocos2d::extension::ControlStepper*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlStepper_getPlusLabel : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 0) { - cocos2d::Label* result = cobj->getPlusLabel(); - ok &= native_ptr_to_seval((cocos2d::Label*)result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlStepper_getPlusLabel : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlStepper_getPlusLabel) - -static bool js_cocos2dx_extension_ControlStepper_setWraps(se::State& s) -{ - cocos2d::extension::ControlStepper* cobj = (cocos2d::extension::ControlStepper*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlStepper_setWraps : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 1) { - bool arg0; - ok &= seval_to_boolean(args[0], &arg0); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlStepper_setWraps : Error processing arguments"); - cobj->setWraps(arg0); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlStepper_setWraps) - -static bool js_cocos2dx_extension_ControlStepper_setMinusLabel(se::State& s) -{ - cocos2d::extension::ControlStepper* cobj = (cocos2d::extension::ControlStepper*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlStepper_setMinusLabel : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 1) { - cocos2d::Label* arg0 = nullptr; - ok &= seval_to_native_ptr(args[0], &arg0); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlStepper_setMinusLabel : Error processing arguments"); - cobj->setMinusLabel(arg0); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlStepper_setMinusLabel) - -static bool js_cocos2dx_extension_ControlStepper_startAutorepeat(se::State& s) -{ - cocos2d::extension::ControlStepper* cobj = (cocos2d::extension::ControlStepper*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlStepper_startAutorepeat : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - if (argc == 0) { - cobj->startAutorepeat(); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlStepper_startAutorepeat) - -static bool js_cocos2dx_extension_ControlStepper_updateLayoutUsingTouchLocation(se::State& s) -{ - cocos2d::extension::ControlStepper* cobj = (cocos2d::extension::ControlStepper*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlStepper_updateLayoutUsingTouchLocation : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 1) { - cocos2d::Vec2 arg0; - ok &= seval_to_Vec2(args[0], &arg0); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlStepper_updateLayoutUsingTouchLocation : Error processing arguments"); - cobj->updateLayoutUsingTouchLocation(arg0); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlStepper_updateLayoutUsingTouchLocation) - -static bool js_cocos2dx_extension_ControlStepper_isContinuous(se::State& s) -{ - cocos2d::extension::ControlStepper* cobj = (cocos2d::extension::ControlStepper*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlStepper_isContinuous : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 0) { - bool result = cobj->isContinuous(); - ok &= boolean_to_seval(result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlStepper_isContinuous : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlStepper_isContinuous) - -static bool js_cocos2dx_extension_ControlStepper_stopAutorepeat(se::State& s) -{ - cocos2d::extension::ControlStepper* cobj = (cocos2d::extension::ControlStepper*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlStepper_stopAutorepeat : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - if (argc == 0) { - cobj->stopAutorepeat(); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlStepper_stopAutorepeat) - -static bool js_cocos2dx_extension_ControlStepper_setMinimumValue(se::State& s) -{ - cocos2d::extension::ControlStepper* cobj = (cocos2d::extension::ControlStepper*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlStepper_setMinimumValue : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 1) { - double arg0 = 0; - ok &= seval_to_double(args[0], &arg0); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlStepper_setMinimumValue : Error processing arguments"); - cobj->setMinimumValue(arg0); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlStepper_setMinimumValue) - -static bool js_cocos2dx_extension_ControlStepper_setPlusLabel(se::State& s) -{ - cocos2d::extension::ControlStepper* cobj = (cocos2d::extension::ControlStepper*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlStepper_setPlusLabel : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 1) { - cocos2d::Label* arg0 = nullptr; - ok &= seval_to_native_ptr(args[0], &arg0); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlStepper_setPlusLabel : Error processing arguments"); - cobj->setPlusLabel(arg0); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlStepper_setPlusLabel) - -static bool js_cocos2dx_extension_ControlStepper_getValue(se::State& s) -{ - cocos2d::extension::ControlStepper* cobj = (cocos2d::extension::ControlStepper*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlStepper_getValue : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 0) { - double result = cobj->getValue(); - ok &= double_to_seval(result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlStepper_getValue : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlStepper_getValue) - -static bool js_cocos2dx_extension_ControlStepper_getPlusSprite(se::State& s) -{ - cocos2d::extension::ControlStepper* cobj = (cocos2d::extension::ControlStepper*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlStepper_getPlusSprite : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 0) { - cocos2d::Sprite* result = cobj->getPlusSprite(); - ok &= native_ptr_to_seval((cocos2d::Sprite*)result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlStepper_getPlusSprite : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlStepper_getPlusSprite) - -static bool js_cocos2dx_extension_ControlStepper_setPlusSprite(se::State& s) -{ - cocos2d::extension::ControlStepper* cobj = (cocos2d::extension::ControlStepper*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlStepper_setPlusSprite : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 1) { - cocos2d::Sprite* arg0 = nullptr; - ok &= seval_to_native_ptr(args[0], &arg0); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlStepper_setPlusSprite : Error processing arguments"); - cobj->setPlusSprite(arg0); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlStepper_setPlusSprite) - -static bool js_cocos2dx_extension_ControlStepper_setMinusSprite(se::State& s) -{ - cocos2d::extension::ControlStepper* cobj = (cocos2d::extension::ControlStepper*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlStepper_setMinusSprite : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 1) { - cocos2d::Sprite* arg0 = nullptr; - ok &= seval_to_native_ptr(args[0], &arg0); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlStepper_setMinusSprite : Error processing arguments"); - cobj->setMinusSprite(arg0); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlStepper_setMinusSprite) - -static bool js_cocos2dx_extension_ControlStepper_create(se::State& s) -{ - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 2) { - cocos2d::Sprite* arg0 = nullptr; - cocos2d::Sprite* arg1 = nullptr; - ok &= seval_to_native_ptr(args[0], &arg0); - ok &= seval_to_native_ptr(args[1], &arg1); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlStepper_create : Error processing arguments"); - auto result = cocos2d::extension::ControlStepper::create(arg0, arg1); - result->retain(); - auto obj = se::Object::createObjectWithClass(__jsb_cocos2d_extension_ControlStepper_class); - obj->setPrivateData(result); - s.rval().setObject(obj); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 2); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlStepper_create) - -SE_DECLARE_FINALIZE_FUNC(js_cocos2d_extension_ControlStepper_finalize) - -static bool js_cocos2dx_extension_ControlStepper_constructor(se::State& s) -{ - cocos2d::extension::ControlStepper* cobj = new (std::nothrow) cocos2d::extension::ControlStepper(); - s.thisObject()->setPrivateData(cobj); - return true; -} -SE_BIND_CTOR(js_cocos2dx_extension_ControlStepper_constructor, __jsb_cocos2d_extension_ControlStepper_class, js_cocos2d_extension_ControlStepper_finalize) - -static bool js_cocos2dx_extension_ControlStepper_ctor(se::State& s) -{ - cocos2d::extension::ControlStepper* cobj = new (std::nothrow) cocos2d::extension::ControlStepper(); - s.thisObject()->setPrivateData(cobj); - return true; -} -SE_BIND_SUB_CLS_CTOR(js_cocos2dx_extension_ControlStepper_ctor, __jsb_cocos2d_extension_ControlStepper_class, js_cocos2d_extension_ControlStepper_finalize) - - - - -extern se::Object* __jsb_cocos2d_extension_Control_proto; - -static bool js_cocos2d_extension_ControlStepper_finalize(se::State& s) -{ - CCLOG("jsbindings: finalizing JS object %p (cocos2d::extension::ControlStepper)", s.nativeThisObject()); - cocos2d::extension::ControlStepper* cobj = (cocos2d::extension::ControlStepper*)s.nativeThisObject(); - if (cobj->getReferenceCount() == 1) - cobj->autorelease(); - else - cobj->release(); - return true; -} -SE_BIND_FINALIZE_FUNC(js_cocos2d_extension_ControlStepper_finalize) - -bool js_register_cocos2dx_extension_ControlStepper(se::Object* obj) -{ - auto cls = se::Class::create("ControlStepper", obj, __jsb_cocos2d_extension_Control_proto, _SE(js_cocos2dx_extension_ControlStepper_constructor)); - - cls->defineFunction("getMinusSprite", _SE(js_cocos2dx_extension_ControlStepper_getMinusSprite)); - cls->defineFunction("setValue", _SE(js_cocos2dx_extension_ControlStepper_setValue)); - cls->defineFunction("setStepValue", _SE(js_cocos2dx_extension_ControlStepper_setStepValue)); - cls->defineFunction("initWithMinusSpriteAndPlusSprite", _SE(js_cocos2dx_extension_ControlStepper_initWithMinusSpriteAndPlusSprite)); - cls->defineFunction("setValueWithSendingEvent", _SE(js_cocos2dx_extension_ControlStepper_setValueWithSendingEvent)); - cls->defineFunction("setMaximumValue", _SE(js_cocos2dx_extension_ControlStepper_setMaximumValue)); - cls->defineFunction("getMinusLabel", _SE(js_cocos2dx_extension_ControlStepper_getMinusLabel)); - cls->defineFunction("getPlusLabel", _SE(js_cocos2dx_extension_ControlStepper_getPlusLabel)); - cls->defineFunction("setWraps", _SE(js_cocos2dx_extension_ControlStepper_setWraps)); - cls->defineFunction("setMinusLabel", _SE(js_cocos2dx_extension_ControlStepper_setMinusLabel)); - cls->defineFunction("startAutorepeat", _SE(js_cocos2dx_extension_ControlStepper_startAutorepeat)); - cls->defineFunction("updateLayoutUsingTouchLocation", _SE(js_cocos2dx_extension_ControlStepper_updateLayoutUsingTouchLocation)); - cls->defineFunction("isContinuous", _SE(js_cocos2dx_extension_ControlStepper_isContinuous)); - cls->defineFunction("stopAutorepeat", _SE(js_cocos2dx_extension_ControlStepper_stopAutorepeat)); - cls->defineFunction("setMinimumValue", _SE(js_cocos2dx_extension_ControlStepper_setMinimumValue)); - cls->defineFunction("setPlusLabel", _SE(js_cocos2dx_extension_ControlStepper_setPlusLabel)); - cls->defineFunction("getValue", _SE(js_cocos2dx_extension_ControlStepper_getValue)); - cls->defineFunction("getPlusSprite", _SE(js_cocos2dx_extension_ControlStepper_getPlusSprite)); - cls->defineFunction("setPlusSprite", _SE(js_cocos2dx_extension_ControlStepper_setPlusSprite)); - cls->defineFunction("setMinusSprite", _SE(js_cocos2dx_extension_ControlStepper_setMinusSprite)); - cls->defineFunction("ctor", _SE(js_cocos2dx_extension_ControlStepper_ctor)); - cls->defineStaticFunction("create", _SE(js_cocos2dx_extension_ControlStepper_create)); - cls->defineFinalizeFunction(_SE(js_cocos2d_extension_ControlStepper_finalize)); - cls->install(); - JSBClassType::registerClass(cls); - - __jsb_cocos2d_extension_ControlStepper_proto = cls->getProto(); - __jsb_cocos2d_extension_ControlStepper_class = cls; - - se::ScriptEngine::getInstance()->evalString("(function () { cc.ControlStepper.extend = cc.Class.extend; })()"); - se::ScriptEngine::getInstance()->clearException(); - return true; -} - -se::Object* __jsb_cocos2d_extension_ControlSwitch_proto = nullptr; -se::Class* __jsb_cocos2d_extension_ControlSwitch_class = nullptr; - -static bool js_cocos2dx_extension_ControlSwitch_setOn(se::State& s) -{ - CC_UNUSED bool ok = true; - cocos2d::extension::ControlSwitch* cobj = (cocos2d::extension::ControlSwitch*)s.nativeThisObject(); - SE_PRECONDITION2( cobj, false, "js_cocos2dx_extension_ControlSwitch_setOn : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - do { - if (argc == 1) { - bool arg0; - ok &= seval_to_boolean(args[0], &arg0); - cobj->setOn(arg0); - return true; - } - } while(false); - - do { - if (argc == 2) { - bool arg0; - ok &= seval_to_boolean(args[0], &arg0); - bool arg1; - ok &= seval_to_boolean(args[1], &arg1); - cobj->setOn(arg0, arg1); - return true; - } - } while(false); - - SE_REPORT_ERROR("wrong number of arguments: %d", (int)argc); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlSwitch_setOn) - -static bool js_cocos2dx_extension_ControlSwitch_locationFromTouch(se::State& s) -{ - cocos2d::extension::ControlSwitch* cobj = (cocos2d::extension::ControlSwitch*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlSwitch_locationFromTouch : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 1) { - cocos2d::Touch* arg0 = nullptr; - ok &= seval_to_native_ptr(args[0], &arg0); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlSwitch_locationFromTouch : Error processing arguments"); - cocos2d::Vec2 result = cobj->locationFromTouch(arg0); - ok &= Vec2_to_seval(result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlSwitch_locationFromTouch : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlSwitch_locationFromTouch) - -static bool js_cocos2dx_extension_ControlSwitch_isOn(se::State& s) -{ - cocos2d::extension::ControlSwitch* cobj = (cocos2d::extension::ControlSwitch*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlSwitch_isOn : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 0) { - bool result = cobj->isOn(); - ok &= boolean_to_seval(result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlSwitch_isOn : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlSwitch_isOn) - -static bool js_cocos2dx_extension_ControlSwitch_initWithMaskSprite(se::State& s) -{ - CC_UNUSED bool ok = true; - cocos2d::extension::ControlSwitch* cobj = (cocos2d::extension::ControlSwitch*)s.nativeThisObject(); - SE_PRECONDITION2( cobj, false, "js_cocos2dx_extension_ControlSwitch_initWithMaskSprite : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - do { - if (argc == 6) { - cocos2d::Sprite* arg0 = nullptr; - ok &= seval_to_native_ptr(args[0], &arg0); - if (!ok) { ok = true; break; } - cocos2d::Sprite* arg1 = nullptr; - ok &= seval_to_native_ptr(args[1], &arg1); - if (!ok) { ok = true; break; } - cocos2d::Sprite* arg2 = nullptr; - ok &= seval_to_native_ptr(args[2], &arg2); - if (!ok) { ok = true; break; } - cocos2d::Sprite* arg3 = nullptr; - ok &= seval_to_native_ptr(args[3], &arg3); - if (!ok) { ok = true; break; } - cocos2d::Label* arg4 = nullptr; - ok &= seval_to_native_ptr(args[4], &arg4); - if (!ok) { ok = true; break; } - cocos2d::Label* arg5 = nullptr; - ok &= seval_to_native_ptr(args[5], &arg5); - if (!ok) { ok = true; break; } - bool result = cobj->initWithMaskSprite(arg0, arg1, arg2, arg3, arg4, arg5); - ok &= boolean_to_seval(result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlSwitch_initWithMaskSprite : Error processing arguments"); - return true; - } - } while(false); - - do { - if (argc == 4) { - cocos2d::Sprite* arg0 = nullptr; - ok &= seval_to_native_ptr(args[0], &arg0); - if (!ok) { ok = true; break; } - cocos2d::Sprite* arg1 = nullptr; - ok &= seval_to_native_ptr(args[1], &arg1); - if (!ok) { ok = true; break; } - cocos2d::Sprite* arg2 = nullptr; - ok &= seval_to_native_ptr(args[2], &arg2); - if (!ok) { ok = true; break; } - cocos2d::Sprite* arg3 = nullptr; - ok &= seval_to_native_ptr(args[3], &arg3); - if (!ok) { ok = true; break; } - bool result = cobj->initWithMaskSprite(arg0, arg1, arg2, arg3); - ok &= boolean_to_seval(result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlSwitch_initWithMaskSprite : Error processing arguments"); - return true; - } - } while(false); - - SE_REPORT_ERROR("wrong number of arguments: %d", (int)argc); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlSwitch_initWithMaskSprite) - -static bool js_cocos2dx_extension_ControlSwitch_hasMoved(se::State& s) -{ - cocos2d::extension::ControlSwitch* cobj = (cocos2d::extension::ControlSwitch*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ControlSwitch_hasMoved : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 0) { - bool result = cobj->hasMoved(); - ok &= boolean_to_seval(result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlSwitch_hasMoved : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlSwitch_hasMoved) - -static bool js_cocos2dx_extension_ControlSwitch_create(se::State& s) -{ - CC_UNUSED bool ok = true; - const auto& args = s.args(); - size_t argc = args.size(); - do { - if (argc == 4) { - cocos2d::Sprite* arg0 = nullptr; - ok &= seval_to_native_ptr(args[0], &arg0); - if (!ok) { ok = true; break; } - cocos2d::Sprite* arg1 = nullptr; - ok &= seval_to_native_ptr(args[1], &arg1); - if (!ok) { ok = true; break; } - cocos2d::Sprite* arg2 = nullptr; - ok &= seval_to_native_ptr(args[2], &arg2); - if (!ok) { ok = true; break; } - cocos2d::Sprite* arg3 = nullptr; - ok &= seval_to_native_ptr(args[3], &arg3); - if (!ok) { ok = true; break; } - cocos2d::extension::ControlSwitch* result = cocos2d::extension::ControlSwitch::create(arg0, arg1, arg2, arg3); - ok &= native_ptr_to_seval((cocos2d::extension::ControlSwitch*)result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlSwitch_create : Error processing arguments"); - return true; - } - } while (false); - do { - if (argc == 6) { - cocos2d::Sprite* arg0 = nullptr; - ok &= seval_to_native_ptr(args[0], &arg0); - if (!ok) { ok = true; break; } - cocos2d::Sprite* arg1 = nullptr; - ok &= seval_to_native_ptr(args[1], &arg1); - if (!ok) { ok = true; break; } - cocos2d::Sprite* arg2 = nullptr; - ok &= seval_to_native_ptr(args[2], &arg2); - if (!ok) { ok = true; break; } - cocos2d::Sprite* arg3 = nullptr; - ok &= seval_to_native_ptr(args[3], &arg3); - if (!ok) { ok = true; break; } - cocos2d::Label* arg4 = nullptr; - ok &= seval_to_native_ptr(args[4], &arg4); - if (!ok) { ok = true; break; } - cocos2d::Label* arg5 = nullptr; - ok &= seval_to_native_ptr(args[5], &arg5); - if (!ok) { ok = true; break; } - cocos2d::extension::ControlSwitch* result = cocos2d::extension::ControlSwitch::create(arg0, arg1, arg2, arg3, arg4, arg5); - ok &= native_ptr_to_seval((cocos2d::extension::ControlSwitch*)result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ControlSwitch_create : Error processing arguments"); - return true; - } - } while (false); - SE_REPORT_ERROR("wrong number of arguments: %d", (int)argc); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ControlSwitch_create) - -SE_DECLARE_FINALIZE_FUNC(js_cocos2d_extension_ControlSwitch_finalize) - -static bool js_cocos2dx_extension_ControlSwitch_constructor(se::State& s) -{ - cocos2d::extension::ControlSwitch* cobj = new (std::nothrow) cocos2d::extension::ControlSwitch(); - s.thisObject()->setPrivateData(cobj); - return true; -} -SE_BIND_CTOR(js_cocos2dx_extension_ControlSwitch_constructor, __jsb_cocos2d_extension_ControlSwitch_class, js_cocos2d_extension_ControlSwitch_finalize) - -static bool js_cocos2dx_extension_ControlSwitch_ctor(se::State& s) -{ - cocos2d::extension::ControlSwitch* cobj = new (std::nothrow) cocos2d::extension::ControlSwitch(); - s.thisObject()->setPrivateData(cobj); - return true; -} -SE_BIND_SUB_CLS_CTOR(js_cocos2dx_extension_ControlSwitch_ctor, __jsb_cocos2d_extension_ControlSwitch_class, js_cocos2d_extension_ControlSwitch_finalize) - - - - -extern se::Object* __jsb_cocos2d_extension_Control_proto; - -static bool js_cocos2d_extension_ControlSwitch_finalize(se::State& s) -{ - CCLOG("jsbindings: finalizing JS object %p (cocos2d::extension::ControlSwitch)", s.nativeThisObject()); - cocos2d::extension::ControlSwitch* cobj = (cocos2d::extension::ControlSwitch*)s.nativeThisObject(); - if (cobj->getReferenceCount() == 1) - cobj->autorelease(); - else - cobj->release(); - return true; -} -SE_BIND_FINALIZE_FUNC(js_cocos2d_extension_ControlSwitch_finalize) - -bool js_register_cocos2dx_extension_ControlSwitch(se::Object* obj) -{ - auto cls = se::Class::create("ControlSwitch", obj, __jsb_cocos2d_extension_Control_proto, _SE(js_cocos2dx_extension_ControlSwitch_constructor)); - - cls->defineFunction("setOn", _SE(js_cocos2dx_extension_ControlSwitch_setOn)); - cls->defineFunction("locationFromTouch", _SE(js_cocos2dx_extension_ControlSwitch_locationFromTouch)); - cls->defineFunction("isOn", _SE(js_cocos2dx_extension_ControlSwitch_isOn)); - cls->defineFunction("initWithMaskSprite", _SE(js_cocos2dx_extension_ControlSwitch_initWithMaskSprite)); - cls->defineFunction("hasMoved", _SE(js_cocos2dx_extension_ControlSwitch_hasMoved)); - cls->defineFunction("ctor", _SE(js_cocos2dx_extension_ControlSwitch_ctor)); - cls->defineStaticFunction("create", _SE(js_cocos2dx_extension_ControlSwitch_create)); - cls->defineFinalizeFunction(_SE(js_cocos2d_extension_ControlSwitch_finalize)); - cls->install(); - JSBClassType::registerClass(cls); - - __jsb_cocos2d_extension_ControlSwitch_proto = cls->getProto(); - __jsb_cocos2d_extension_ControlSwitch_class = cls; - - se::ScriptEngine::getInstance()->evalString("(function () { cc.ControlSwitch.extend = cc.Class.extend; })()"); - se::ScriptEngine::getInstance()->clearException(); - return true; -} - -se::Object* __jsb_cocos2d_extension_ScrollView_proto = nullptr; -se::Class* __jsb_cocos2d_extension_ScrollView_class = nullptr; - -static bool js_cocos2dx_extension_ScrollView_isClippingToBounds(se::State& s) -{ - cocos2d::extension::ScrollView* cobj = (cocos2d::extension::ScrollView*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ScrollView_isClippingToBounds : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 0) { - bool result = cobj->isClippingToBounds(); - ok &= boolean_to_seval(result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ScrollView_isClippingToBounds : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ScrollView_isClippingToBounds) - -static bool js_cocos2dx_extension_ScrollView_setContainer(se::State& s) -{ - cocos2d::extension::ScrollView* cobj = (cocos2d::extension::ScrollView*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ScrollView_setContainer : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 1) { - cocos2d::Node* arg0 = nullptr; - ok &= seval_to_native_ptr(args[0], &arg0); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ScrollView_setContainer : Error processing arguments"); - cobj->setContainer(arg0); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ScrollView_setContainer) - -static bool js_cocos2dx_extension_ScrollView_setContentOffsetInDuration(se::State& s) -{ - cocos2d::extension::ScrollView* cobj = (cocos2d::extension::ScrollView*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ScrollView_setContentOffsetInDuration : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 2) { - cocos2d::Vec2 arg0; - float arg1 = 0; - ok &= seval_to_Vec2(args[0], &arg0); - ok &= seval_to_float(args[1], &arg1); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ScrollView_setContentOffsetInDuration : Error processing arguments"); - cobj->setContentOffsetInDuration(arg0, arg1); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 2); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ScrollView_setContentOffsetInDuration) - -static bool js_cocos2dx_extension_ScrollView_setZoomScaleInDuration(se::State& s) -{ - cocos2d::extension::ScrollView* cobj = (cocos2d::extension::ScrollView*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ScrollView_setZoomScaleInDuration : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 2) { - float arg0 = 0; - float arg1 = 0; - ok &= seval_to_float(args[0], &arg0); - ok &= seval_to_float(args[1], &arg1); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ScrollView_setZoomScaleInDuration : Error processing arguments"); - cobj->setZoomScaleInDuration(arg0, arg1); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 2); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ScrollView_setZoomScaleInDuration) - -static bool js_cocos2dx_extension_ScrollView_updateTweenAction(se::State& s) -{ - cocos2d::extension::ScrollView* cobj = (cocos2d::extension::ScrollView*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ScrollView_updateTweenAction : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 2) { - float arg0 = 0; - std::string arg1; - ok &= seval_to_float(args[0], &arg0); - ok &= seval_to_std_string(args[1], &arg1); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ScrollView_updateTweenAction : Error processing arguments"); - cobj->updateTweenAction(arg0, arg1); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 2); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ScrollView_updateTweenAction) - -static bool js_cocos2dx_extension_ScrollView_setMaxScale(se::State& s) -{ - cocos2d::extension::ScrollView* cobj = (cocos2d::extension::ScrollView*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ScrollView_setMaxScale : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 1) { - float arg0 = 0; - ok &= seval_to_float(args[0], &arg0); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ScrollView_setMaxScale : Error processing arguments"); - cobj->setMaxScale(arg0); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ScrollView_setMaxScale) - -static bool js_cocos2dx_extension_ScrollView_hasVisibleParents(se::State& s) -{ - cocos2d::extension::ScrollView* cobj = (cocos2d::extension::ScrollView*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ScrollView_hasVisibleParents : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 0) { - bool result = cobj->hasVisibleParents(); - ok &= boolean_to_seval(result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ScrollView_hasVisibleParents : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ScrollView_hasVisibleParents) - -static bool js_cocos2dx_extension_ScrollView_getDirection(se::State& s) -{ - cocos2d::extension::ScrollView* cobj = (cocos2d::extension::ScrollView*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ScrollView_getDirection : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 0) { - int result = (int)cobj->getDirection(); - ok &= int32_to_seval(result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ScrollView_getDirection : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ScrollView_getDirection) - -static bool js_cocos2dx_extension_ScrollView_getContainer(se::State& s) -{ - cocos2d::extension::ScrollView* cobj = (cocos2d::extension::ScrollView*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ScrollView_getContainer : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 0) { - cocos2d::Node* result = cobj->getContainer(); - ok &= native_ptr_to_seval((cocos2d::Node*)result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ScrollView_getContainer : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ScrollView_getContainer) - -static bool js_cocos2dx_extension_ScrollView_setMinScale(se::State& s) -{ - cocos2d::extension::ScrollView* cobj = (cocos2d::extension::ScrollView*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ScrollView_setMinScale : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 1) { - float arg0 = 0; - ok &= seval_to_float(args[0], &arg0); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ScrollView_setMinScale : Error processing arguments"); - cobj->setMinScale(arg0); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ScrollView_setMinScale) - -static bool js_cocos2dx_extension_ScrollView_getZoomScale(se::State& s) -{ - cocos2d::extension::ScrollView* cobj = (cocos2d::extension::ScrollView*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ScrollView_getZoomScale : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 0) { - float result = cobj->getZoomScale(); - ok &= float_to_seval(result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ScrollView_getZoomScale : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ScrollView_getZoomScale) - -static bool js_cocos2dx_extension_ScrollView_updateInset(se::State& s) -{ - cocos2d::extension::ScrollView* cobj = (cocos2d::extension::ScrollView*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ScrollView_updateInset : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - if (argc == 0) { - cobj->updateInset(); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ScrollView_updateInset) - -static bool js_cocos2dx_extension_ScrollView_initWithViewSize(se::State& s) -{ - cocos2d::extension::ScrollView* cobj = (cocos2d::extension::ScrollView*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ScrollView_initWithViewSize : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 2) { - cocos2d::Size arg0; - cocos2d::Node* arg1 = nullptr; - ok &= seval_to_Size(args[0], &arg0); - ok &= seval_to_native_ptr(args[1], &arg1); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ScrollView_initWithViewSize : Error processing arguments"); - bool result = cobj->initWithViewSize(arg0, arg1); - ok &= boolean_to_seval(result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ScrollView_initWithViewSize : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 2); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ScrollView_initWithViewSize) - -static bool js_cocos2dx_extension_ScrollView_pause(se::State& s) -{ - cocos2d::extension::ScrollView* cobj = (cocos2d::extension::ScrollView*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ScrollView_pause : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 1) { - cocos2d::Ref* arg0 = nullptr; - ok &= seval_to_native_ptr(args[0], &arg0); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ScrollView_pause : Error processing arguments"); - cobj->pause(arg0); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ScrollView_pause) - -static bool js_cocos2dx_extension_ScrollView_setDirection(se::State& s) -{ - cocos2d::extension::ScrollView* cobj = (cocos2d::extension::ScrollView*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ScrollView_setDirection : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 1) { - cocos2d::extension::ScrollView::Direction arg0; - ok &= seval_to_int32(args[0], (int32_t*)&arg0); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ScrollView_setDirection : Error processing arguments"); - cobj->setDirection(arg0); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ScrollView_setDirection) - -static bool js_cocos2dx_extension_ScrollView_stopAnimatedContentOffset(se::State& s) -{ - cocos2d::extension::ScrollView* cobj = (cocos2d::extension::ScrollView*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ScrollView_stopAnimatedContentOffset : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - if (argc == 0) { - cobj->stopAnimatedContentOffset(); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ScrollView_stopAnimatedContentOffset) - -static bool js_cocos2dx_extension_ScrollView_setContentOffset(se::State& s) -{ - cocos2d::extension::ScrollView* cobj = (cocos2d::extension::ScrollView*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ScrollView_setContentOffset : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 1) { - cocos2d::Vec2 arg0; - ok &= seval_to_Vec2(args[0], &arg0); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ScrollView_setContentOffset : Error processing arguments"); - cobj->setContentOffset(arg0); - return true; - } - if (argc == 2) { - cocos2d::Vec2 arg0; - bool arg1; - ok &= seval_to_Vec2(args[0], &arg0); - ok &= seval_to_boolean(args[1], &arg1); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ScrollView_setContentOffset : Error processing arguments"); - cobj->setContentOffset(arg0, arg1); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 2); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ScrollView_setContentOffset) - -static bool js_cocos2dx_extension_ScrollView_isDragging(se::State& s) -{ - cocos2d::extension::ScrollView* cobj = (cocos2d::extension::ScrollView*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ScrollView_isDragging : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 0) { - bool result = cobj->isDragging(); - ok &= boolean_to_seval(result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ScrollView_isDragging : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ScrollView_isDragging) - -static bool js_cocos2dx_extension_ScrollView_isTouchEnabled(se::State& s) -{ - cocos2d::extension::ScrollView* cobj = (cocos2d::extension::ScrollView*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ScrollView_isTouchEnabled : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 0) { - bool result = cobj->isTouchEnabled(); - ok &= boolean_to_seval(result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ScrollView_isTouchEnabled : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ScrollView_isTouchEnabled) - -static bool js_cocos2dx_extension_ScrollView_isBounceable(se::State& s) -{ - cocos2d::extension::ScrollView* cobj = (cocos2d::extension::ScrollView*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ScrollView_isBounceable : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 0) { - bool result = cobj->isBounceable(); - ok &= boolean_to_seval(result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ScrollView_isBounceable : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ScrollView_isBounceable) - -static bool js_cocos2dx_extension_ScrollView_setTouchEnabled(se::State& s) -{ - cocos2d::extension::ScrollView* cobj = (cocos2d::extension::ScrollView*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ScrollView_setTouchEnabled : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 1) { - bool arg0; - ok &= seval_to_boolean(args[0], &arg0); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ScrollView_setTouchEnabled : Error processing arguments"); - cobj->setTouchEnabled(arg0); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ScrollView_setTouchEnabled) - -static bool js_cocos2dx_extension_ScrollView_getContentOffset(se::State& s) -{ - cocos2d::extension::ScrollView* cobj = (cocos2d::extension::ScrollView*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ScrollView_getContentOffset : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 0) { - cocos2d::Vec2 result = cobj->getContentOffset(); - ok &= Vec2_to_seval(result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ScrollView_getContentOffset : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ScrollView_getContentOffset) - -static bool js_cocos2dx_extension_ScrollView_resume(se::State& s) -{ - cocos2d::extension::ScrollView* cobj = (cocos2d::extension::ScrollView*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ScrollView_resume : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 1) { - cocos2d::Ref* arg0 = nullptr; - ok &= seval_to_native_ptr(args[0], &arg0); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ScrollView_resume : Error processing arguments"); - cobj->resume(arg0); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ScrollView_resume) - -static bool js_cocos2dx_extension_ScrollView_setClippingToBounds(se::State& s) -{ - cocos2d::extension::ScrollView* cobj = (cocos2d::extension::ScrollView*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ScrollView_setClippingToBounds : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 1) { - bool arg0; - ok &= seval_to_boolean(args[0], &arg0); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ScrollView_setClippingToBounds : Error processing arguments"); - cobj->setClippingToBounds(arg0); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ScrollView_setClippingToBounds) - -static bool js_cocos2dx_extension_ScrollView_setViewSize(se::State& s) -{ - cocos2d::extension::ScrollView* cobj = (cocos2d::extension::ScrollView*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ScrollView_setViewSize : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 1) { - cocos2d::Size arg0; - ok &= seval_to_Size(args[0], &arg0); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ScrollView_setViewSize : Error processing arguments"); - cobj->setViewSize(arg0); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ScrollView_setViewSize) - -static bool js_cocos2dx_extension_ScrollView_getViewSize(se::State& s) -{ - cocos2d::extension::ScrollView* cobj = (cocos2d::extension::ScrollView*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ScrollView_getViewSize : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 0) { - cocos2d::Size result = cobj->getViewSize(); - ok &= Size_to_seval(result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ScrollView_getViewSize : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ScrollView_getViewSize) - -static bool js_cocos2dx_extension_ScrollView_maxContainerOffset(se::State& s) -{ - cocos2d::extension::ScrollView* cobj = (cocos2d::extension::ScrollView*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ScrollView_maxContainerOffset : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 0) { - cocos2d::Vec2 result = cobj->maxContainerOffset(); - ok &= Vec2_to_seval(result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ScrollView_maxContainerOffset : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ScrollView_maxContainerOffset) - -static bool js_cocos2dx_extension_ScrollView_setBounceable(se::State& s) -{ - cocos2d::extension::ScrollView* cobj = (cocos2d::extension::ScrollView*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ScrollView_setBounceable : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 1) { - bool arg0; - ok &= seval_to_boolean(args[0], &arg0); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ScrollView_setBounceable : Error processing arguments"); - cobj->setBounceable(arg0); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ScrollView_setBounceable) - -static bool js_cocos2dx_extension_ScrollView_isTouchMoved(se::State& s) -{ - cocos2d::extension::ScrollView* cobj = (cocos2d::extension::ScrollView*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ScrollView_isTouchMoved : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 0) { - bool result = cobj->isTouchMoved(); - ok &= boolean_to_seval(result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ScrollView_isTouchMoved : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ScrollView_isTouchMoved) - -static bool js_cocos2dx_extension_ScrollView_isNodeVisible(se::State& s) -{ - cocos2d::extension::ScrollView* cobj = (cocos2d::extension::ScrollView*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ScrollView_isNodeVisible : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 1) { - cocos2d::Node* arg0 = nullptr; - ok &= seval_to_native_ptr(args[0], &arg0); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ScrollView_isNodeVisible : Error processing arguments"); - bool result = cobj->isNodeVisible(arg0); - ok &= boolean_to_seval(result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ScrollView_isNodeVisible : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ScrollView_isNodeVisible) - -static bool js_cocos2dx_extension_ScrollView_minContainerOffset(se::State& s) -{ - cocos2d::extension::ScrollView* cobj = (cocos2d::extension::ScrollView*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_ScrollView_minContainerOffset : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 0) { - cocos2d::Vec2 result = cobj->minContainerOffset(); - ok &= Vec2_to_seval(result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ScrollView_minContainerOffset : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ScrollView_minContainerOffset) - -static bool js_cocos2dx_extension_ScrollView_setZoomScale(se::State& s) -{ - CC_UNUSED bool ok = true; - cocos2d::extension::ScrollView* cobj = (cocos2d::extension::ScrollView*)s.nativeThisObject(); - SE_PRECONDITION2( cobj, false, "js_cocos2dx_extension_ScrollView_setZoomScale : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - do { - if (argc == 2) { - float arg0 = 0; - ok &= seval_to_float(args[0], &arg0); - if (!ok) { ok = true; break; } - bool arg1; - ok &= seval_to_boolean(args[1], &arg1); - cobj->setZoomScale(arg0, arg1); - return true; - } - } while(false); - - do { - if (argc == 1) { - float arg0 = 0; - ok &= seval_to_float(args[0], &arg0); - if (!ok) { ok = true; break; } - cobj->setZoomScale(arg0); - return true; - } - } while(false); - - SE_REPORT_ERROR("wrong number of arguments: %d", (int)argc); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ScrollView_setZoomScale) - -static bool js_cocos2dx_extension_ScrollView_create(se::State& s) -{ - CC_UNUSED bool ok = true; - const auto& args = s.args(); - size_t argc = args.size(); - do { - if (argc == 0) { - cocos2d::extension::ScrollView* result = cocos2d::extension::ScrollView::create(); - ok &= native_ptr_to_seval((cocos2d::extension::ScrollView*)result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ScrollView_create : Error processing arguments"); - return true; - } - } while (false); - do { - if (argc == 2) { - cocos2d::Size arg0; - ok &= seval_to_Size(args[0], &arg0); - if (!ok) { ok = true; break; } - cocos2d::Node* arg1 = nullptr; - ok &= seval_to_native_ptr(args[1], &arg1); - if (!ok) { ok = true; break; } - cocos2d::extension::ScrollView* result = cocos2d::extension::ScrollView::create(arg0, arg1); - ok &= native_ptr_to_seval((cocos2d::extension::ScrollView*)result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_ScrollView_create : Error processing arguments"); - return true; - } - } while (false); - SE_REPORT_ERROR("wrong number of arguments: %d", (int)argc); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_ScrollView_create) - -SE_DECLARE_FINALIZE_FUNC(js_cocos2d_extension_ScrollView_finalize) - -static bool js_cocos2dx_extension_ScrollView_constructor(se::State& s) -{ - cocos2d::extension::ScrollView* cobj = new (std::nothrow) cocos2d::extension::ScrollView(); - s.thisObject()->setPrivateData(cobj); - return true; -} -SE_BIND_CTOR(js_cocos2dx_extension_ScrollView_constructor, __jsb_cocos2d_extension_ScrollView_class, js_cocos2d_extension_ScrollView_finalize) - -static bool js_cocos2dx_extension_ScrollView_ctor(se::State& s) -{ - cocos2d::extension::ScrollView* cobj = new (std::nothrow) cocos2d::extension::ScrollView(); - s.thisObject()->setPrivateData(cobj); - return true; -} -SE_BIND_SUB_CLS_CTOR(js_cocos2dx_extension_ScrollView_ctor, __jsb_cocos2d_extension_ScrollView_class, js_cocos2d_extension_ScrollView_finalize) - - - - -extern se::Object* __jsb_cocos2d_Layer_proto; - -static bool js_cocos2d_extension_ScrollView_finalize(se::State& s) -{ - CCLOG("jsbindings: finalizing JS object %p (cocos2d::extension::ScrollView)", s.nativeThisObject()); - cocos2d::extension::ScrollView* cobj = (cocos2d::extension::ScrollView*)s.nativeThisObject(); - if (cobj->getReferenceCount() == 1) - cobj->autorelease(); - else - cobj->release(); - return true; -} -SE_BIND_FINALIZE_FUNC(js_cocos2d_extension_ScrollView_finalize) - -bool js_register_cocos2dx_extension_ScrollView(se::Object* obj) -{ - auto cls = se::Class::create("ScrollView", obj, __jsb_cocos2d_Layer_proto, _SE(js_cocos2dx_extension_ScrollView_constructor)); - - cls->defineFunction("isClippingToBounds", _SE(js_cocos2dx_extension_ScrollView_isClippingToBounds)); - cls->defineFunction("setContainer", _SE(js_cocos2dx_extension_ScrollView_setContainer)); - cls->defineFunction("setContentOffsetInDuration", _SE(js_cocos2dx_extension_ScrollView_setContentOffsetInDuration)); - cls->defineFunction("setZoomScaleInDuration", _SE(js_cocos2dx_extension_ScrollView_setZoomScaleInDuration)); - cls->defineFunction("updateTweenAction", _SE(js_cocos2dx_extension_ScrollView_updateTweenAction)); - cls->defineFunction("setMaxScale", _SE(js_cocos2dx_extension_ScrollView_setMaxScale)); - cls->defineFunction("hasVisibleParents", _SE(js_cocos2dx_extension_ScrollView_hasVisibleParents)); - cls->defineFunction("getDirection", _SE(js_cocos2dx_extension_ScrollView_getDirection)); - cls->defineFunction("getContainer", _SE(js_cocos2dx_extension_ScrollView_getContainer)); - cls->defineFunction("setMinScale", _SE(js_cocos2dx_extension_ScrollView_setMinScale)); - cls->defineFunction("getZoomScale", _SE(js_cocos2dx_extension_ScrollView_getZoomScale)); - cls->defineFunction("updateInset", _SE(js_cocos2dx_extension_ScrollView_updateInset)); - cls->defineFunction("initWithViewSize", _SE(js_cocos2dx_extension_ScrollView_initWithViewSize)); - cls->defineFunction("pause", _SE(js_cocos2dx_extension_ScrollView_pause)); - cls->defineFunction("setDirection", _SE(js_cocos2dx_extension_ScrollView_setDirection)); - cls->defineFunction("stopAnimatedContentOffset", _SE(js_cocos2dx_extension_ScrollView_stopAnimatedContentOffset)); - cls->defineFunction("setContentOffset", _SE(js_cocos2dx_extension_ScrollView_setContentOffset)); - cls->defineFunction("isDragging", _SE(js_cocos2dx_extension_ScrollView_isDragging)); - cls->defineFunction("isTouchEnabled", _SE(js_cocos2dx_extension_ScrollView_isTouchEnabled)); - cls->defineFunction("isBounceable", _SE(js_cocos2dx_extension_ScrollView_isBounceable)); - cls->defineFunction("setTouchEnabled", _SE(js_cocos2dx_extension_ScrollView_setTouchEnabled)); - cls->defineFunction("getContentOffset", _SE(js_cocos2dx_extension_ScrollView_getContentOffset)); - cls->defineFunction("resume", _SE(js_cocos2dx_extension_ScrollView_resume)); - cls->defineFunction("setClippingToBounds", _SE(js_cocos2dx_extension_ScrollView_setClippingToBounds)); - cls->defineFunction("setViewSize", _SE(js_cocos2dx_extension_ScrollView_setViewSize)); - cls->defineFunction("getViewSize", _SE(js_cocos2dx_extension_ScrollView_getViewSize)); - cls->defineFunction("maxContainerOffset", _SE(js_cocos2dx_extension_ScrollView_maxContainerOffset)); - cls->defineFunction("setBounceable", _SE(js_cocos2dx_extension_ScrollView_setBounceable)); - cls->defineFunction("isTouchMoved", _SE(js_cocos2dx_extension_ScrollView_isTouchMoved)); - cls->defineFunction("isNodeVisible", _SE(js_cocos2dx_extension_ScrollView_isNodeVisible)); - cls->defineFunction("minContainerOffset", _SE(js_cocos2dx_extension_ScrollView_minContainerOffset)); - cls->defineFunction("setZoomScale", _SE(js_cocos2dx_extension_ScrollView_setZoomScale)); - cls->defineFunction("ctor", _SE(js_cocos2dx_extension_ScrollView_ctor)); - cls->defineStaticFunction("create", _SE(js_cocos2dx_extension_ScrollView_create)); - cls->defineFinalizeFunction(_SE(js_cocos2d_extension_ScrollView_finalize)); - cls->install(); - JSBClassType::registerClass(cls); - - __jsb_cocos2d_extension_ScrollView_proto = cls->getProto(); - __jsb_cocos2d_extension_ScrollView_class = cls; - - se::ScriptEngine::getInstance()->evalString("(function () { cc.ScrollView.extend = cc.Class.extend; })()"); - se::ScriptEngine::getInstance()->clearException(); - return true; -} - -se::Object* __jsb_cocos2d_extension_TableViewCell_proto = nullptr; -se::Class* __jsb_cocos2d_extension_TableViewCell_class = nullptr; - -static bool js_cocos2dx_extension_TableViewCell_reset(se::State& s) -{ - cocos2d::extension::TableViewCell* cobj = (cocos2d::extension::TableViewCell*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_TableViewCell_reset : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - if (argc == 0) { - cobj->reset(); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_TableViewCell_reset) - -static bool js_cocos2dx_extension_TableViewCell_getIdx(se::State& s) -{ - cocos2d::extension::TableViewCell* cobj = (cocos2d::extension::TableViewCell*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_TableViewCell_getIdx : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 0) { - ssize_t result = cobj->getIdx(); - ok &= ssize_to_seval(result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_TableViewCell_getIdx : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_TableViewCell_getIdx) - -static bool js_cocos2dx_extension_TableViewCell_setIdx(se::State& s) -{ - cocos2d::extension::TableViewCell* cobj = (cocos2d::extension::TableViewCell*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_TableViewCell_setIdx : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 1) { - ssize_t arg0 = 0; - ok &= seval_to_ssize(args[0], &arg0); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_TableViewCell_setIdx : Error processing arguments"); - cobj->setIdx(arg0); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_TableViewCell_setIdx) - -static bool js_cocos2dx_extension_TableViewCell_create(se::State& s) -{ - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 0) { - auto result = cocos2d::extension::TableViewCell::create(); - result->retain(); - auto obj = se::Object::createObjectWithClass(__jsb_cocos2d_extension_TableViewCell_class); - obj->setPrivateData(result); - s.rval().setObject(obj); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_TableViewCell_create) - -SE_DECLARE_FINALIZE_FUNC(js_cocos2d_extension_TableViewCell_finalize) - -static bool js_cocos2dx_extension_TableViewCell_constructor(se::State& s) -{ - cocos2d::extension::TableViewCell* cobj = new (std::nothrow) cocos2d::extension::TableViewCell(); - s.thisObject()->setPrivateData(cobj); - return true; -} -SE_BIND_CTOR(js_cocos2dx_extension_TableViewCell_constructor, __jsb_cocos2d_extension_TableViewCell_class, js_cocos2d_extension_TableViewCell_finalize) - -static bool js_cocos2dx_extension_TableViewCell_ctor(se::State& s) -{ - cocos2d::extension::TableViewCell* cobj = new (std::nothrow) cocos2d::extension::TableViewCell(); - s.thisObject()->setPrivateData(cobj); - return true; -} -SE_BIND_SUB_CLS_CTOR(js_cocos2dx_extension_TableViewCell_ctor, __jsb_cocos2d_extension_TableViewCell_class, js_cocos2d_extension_TableViewCell_finalize) - - - - -extern se::Object* __jsb_cocos2d_Node_proto; - -static bool js_cocos2d_extension_TableViewCell_finalize(se::State& s) -{ - CCLOG("jsbindings: finalizing JS object %p (cocos2d::extension::TableViewCell)", s.nativeThisObject()); - cocos2d::extension::TableViewCell* cobj = (cocos2d::extension::TableViewCell*)s.nativeThisObject(); - if (cobj->getReferenceCount() == 1) - cobj->autorelease(); - else - cobj->release(); - return true; -} -SE_BIND_FINALIZE_FUNC(js_cocos2d_extension_TableViewCell_finalize) - -bool js_register_cocos2dx_extension_TableViewCell(se::Object* obj) -{ - auto cls = se::Class::create("TableViewCell", obj, __jsb_cocos2d_Node_proto, _SE(js_cocos2dx_extension_TableViewCell_constructor)); - - cls->defineFunction("reset", _SE(js_cocos2dx_extension_TableViewCell_reset)); - cls->defineFunction("getIdx", _SE(js_cocos2dx_extension_TableViewCell_getIdx)); - cls->defineFunction("setIdx", _SE(js_cocos2dx_extension_TableViewCell_setIdx)); - cls->defineFunction("ctor", _SE(js_cocos2dx_extension_TableViewCell_ctor)); - cls->defineStaticFunction("create", _SE(js_cocos2dx_extension_TableViewCell_create)); - cls->defineFinalizeFunction(_SE(js_cocos2d_extension_TableViewCell_finalize)); - cls->install(); - JSBClassType::registerClass(cls); - - __jsb_cocos2d_extension_TableViewCell_proto = cls->getProto(); - __jsb_cocos2d_extension_TableViewCell_class = cls; - - se::ScriptEngine::getInstance()->evalString("(function () { cc.TableViewCell.extend = cc.Class.extend; })()"); - se::ScriptEngine::getInstance()->clearException(); - return true; -} - -se::Object* __jsb_cocos2d_extension_TableView_proto = nullptr; -se::Class* __jsb_cocos2d_extension_TableView_class = nullptr; - -static bool js_cocos2dx_extension_TableView_updateCellAtIndex(se::State& s) -{ - cocos2d::extension::TableView* cobj = (cocos2d::extension::TableView*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_TableView_updateCellAtIndex : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 1) { - ssize_t arg0 = 0; - ok &= seval_to_ssize(args[0], &arg0); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_TableView_updateCellAtIndex : Error processing arguments"); - cobj->updateCellAtIndex(arg0); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_TableView_updateCellAtIndex) - -static bool js_cocos2dx_extension_TableView_setVerticalFillOrder(se::State& s) -{ - cocos2d::extension::TableView* cobj = (cocos2d::extension::TableView*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_TableView_setVerticalFillOrder : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 1) { - cocos2d::extension::TableView::VerticalFillOrder arg0; - ok &= seval_to_int32(args[0], (int32_t*)&arg0); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_TableView_setVerticalFillOrder : Error processing arguments"); - cobj->setVerticalFillOrder(arg0); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_TableView_setVerticalFillOrder) - -static bool js_cocos2dx_extension_TableView_scrollViewDidZoom(se::State& s) -{ - cocos2d::extension::TableView* cobj = (cocos2d::extension::TableView*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_TableView_scrollViewDidZoom : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 1) { - cocos2d::extension::ScrollView* arg0 = nullptr; - ok &= seval_to_native_ptr(args[0], &arg0); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_TableView_scrollViewDidZoom : Error processing arguments"); - cobj->scrollViewDidZoom(arg0); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_TableView_scrollViewDidZoom) - -static bool js_cocos2dx_extension_TableView__updateContentSize(se::State& s) -{ - cocos2d::extension::TableView* cobj = (cocos2d::extension::TableView*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_TableView__updateContentSize : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - if (argc == 0) { - cobj->_updateContentSize(); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_TableView__updateContentSize) - -static bool js_cocos2dx_extension_TableView_getVerticalFillOrder(se::State& s) -{ - cocos2d::extension::TableView* cobj = (cocos2d::extension::TableView*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_TableView_getVerticalFillOrder : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 0) { - int result = (int)cobj->getVerticalFillOrder(); - ok &= int32_to_seval(result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_TableView_getVerticalFillOrder : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_TableView_getVerticalFillOrder) - -static bool js_cocos2dx_extension_TableView_removeCellAtIndex(se::State& s) -{ - cocos2d::extension::TableView* cobj = (cocos2d::extension::TableView*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_TableView_removeCellAtIndex : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 1) { - ssize_t arg0 = 0; - ok &= seval_to_ssize(args[0], &arg0); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_TableView_removeCellAtIndex : Error processing arguments"); - cobj->removeCellAtIndex(arg0); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_TableView_removeCellAtIndex) - -static bool js_cocos2dx_extension_TableView_initWithViewSize(se::State& s) -{ - cocos2d::extension::TableView* cobj = (cocos2d::extension::TableView*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_TableView_initWithViewSize : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 2) { - cocos2d::Size arg0; - cocos2d::Node* arg1 = nullptr; - ok &= seval_to_Size(args[0], &arg0); - ok &= seval_to_native_ptr(args[1], &arg1); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_TableView_initWithViewSize : Error processing arguments"); - bool result = cobj->initWithViewSize(arg0, arg1); - ok &= boolean_to_seval(result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_TableView_initWithViewSize : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 2); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_TableView_initWithViewSize) - -static bool js_cocos2dx_extension_TableView_scrollViewDidScroll(se::State& s) -{ - cocos2d::extension::TableView* cobj = (cocos2d::extension::TableView*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_TableView_scrollViewDidScroll : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 1) { - cocos2d::extension::ScrollView* arg0 = nullptr; - ok &= seval_to_native_ptr(args[0], &arg0); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_TableView_scrollViewDidScroll : Error processing arguments"); - cobj->scrollViewDidScroll(arg0); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_TableView_scrollViewDidScroll) - -static bool js_cocos2dx_extension_TableView_reloadData(se::State& s) -{ - cocos2d::extension::TableView* cobj = (cocos2d::extension::TableView*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_TableView_reloadData : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - if (argc == 0) { - cobj->reloadData(); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_TableView_reloadData) - -static bool js_cocos2dx_extension_TableView_insertCellAtIndex(se::State& s) -{ - cocos2d::extension::TableView* cobj = (cocos2d::extension::TableView*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_TableView_insertCellAtIndex : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 1) { - ssize_t arg0 = 0; - ok &= seval_to_ssize(args[0], &arg0); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_TableView_insertCellAtIndex : Error processing arguments"); - cobj->insertCellAtIndex(arg0); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_TableView_insertCellAtIndex) - -static bool js_cocos2dx_extension_TableView_cellAtIndex(se::State& s) -{ - cocos2d::extension::TableView* cobj = (cocos2d::extension::TableView*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_TableView_cellAtIndex : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 1) { - ssize_t arg0 = 0; - ok &= seval_to_ssize(args[0], &arg0); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_TableView_cellAtIndex : Error processing arguments"); - cocos2d::extension::TableViewCell* result = cobj->cellAtIndex(arg0); - ok &= native_ptr_to_seval((cocos2d::extension::TableViewCell*)result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_TableView_cellAtIndex : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_TableView_cellAtIndex) - -static bool js_cocos2dx_extension_TableView_dequeueCell(se::State& s) -{ - cocos2d::extension::TableView* cobj = (cocos2d::extension::TableView*)s.nativeThisObject(); - SE_PRECONDITION2(cobj, false, "js_cocos2dx_extension_TableView_dequeueCell : Invalid Native Object"); - const auto& args = s.args(); - size_t argc = args.size(); - CC_UNUSED bool ok = true; - if (argc == 0) { - cocos2d::extension::TableViewCell* result = cobj->dequeueCell(); - ok &= native_ptr_to_seval((cocos2d::extension::TableViewCell*)result, &s.rval()); - SE_PRECONDITION2(ok, false, "js_cocos2dx_extension_TableView_dequeueCell : Error processing arguments"); - return true; - } - SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); - return false; -} -SE_BIND_FUNC(js_cocos2dx_extension_TableView_dequeueCell) - -SE_DECLARE_FINALIZE_FUNC(js_cocos2d_extension_TableView_finalize) - -static bool js_cocos2dx_extension_TableView_constructor(se::State& s) -{ - cocos2d::extension::TableView* cobj = new (std::nothrow) cocos2d::extension::TableView(); - s.thisObject()->setPrivateData(cobj); - return true; -} -SE_BIND_CTOR(js_cocos2dx_extension_TableView_constructor, __jsb_cocos2d_extension_TableView_class, js_cocos2d_extension_TableView_finalize) - -static bool js_cocos2dx_extension_TableView_ctor(se::State& s) -{ - cocos2d::extension::TableView* cobj = new (std::nothrow) cocos2d::extension::TableView(); - s.thisObject()->setPrivateData(cobj); - return true; -} -SE_BIND_SUB_CLS_CTOR(js_cocos2dx_extension_TableView_ctor, __jsb_cocos2d_extension_TableView_class, js_cocos2d_extension_TableView_finalize) - - - - -extern se::Object* __jsb_cocos2d_extension_ScrollView_proto; - -static bool js_cocos2d_extension_TableView_finalize(se::State& s) -{ - CCLOG("jsbindings: finalizing JS object %p (cocos2d::extension::TableView)", s.nativeThisObject()); - cocos2d::extension::TableView* cobj = (cocos2d::extension::TableView*)s.nativeThisObject(); - if (cobj->getReferenceCount() == 1) - cobj->autorelease(); - else - cobj->release(); - return true; -} -SE_BIND_FINALIZE_FUNC(js_cocos2d_extension_TableView_finalize) - -bool js_register_cocos2dx_extension_TableView(se::Object* obj) -{ - auto cls = se::Class::create("TableView", obj, __jsb_cocos2d_extension_ScrollView_proto, _SE(js_cocos2dx_extension_TableView_constructor)); - - cls->defineFunction("updateCellAtIndex", _SE(js_cocos2dx_extension_TableView_updateCellAtIndex)); - cls->defineFunction("setVerticalFillOrder", _SE(js_cocos2dx_extension_TableView_setVerticalFillOrder)); - cls->defineFunction("scrollViewDidZoom", _SE(js_cocos2dx_extension_TableView_scrollViewDidZoom)); - cls->defineFunction("_updateContentSize", _SE(js_cocos2dx_extension_TableView__updateContentSize)); - cls->defineFunction("getVerticalFillOrder", _SE(js_cocos2dx_extension_TableView_getVerticalFillOrder)); - cls->defineFunction("removeCellAtIndex", _SE(js_cocos2dx_extension_TableView_removeCellAtIndex)); - cls->defineFunction("initWithViewSize", _SE(js_cocos2dx_extension_TableView_initWithViewSize)); - cls->defineFunction("scrollViewDidScroll", _SE(js_cocos2dx_extension_TableView_scrollViewDidScroll)); - cls->defineFunction("reloadData", _SE(js_cocos2dx_extension_TableView_reloadData)); - cls->defineFunction("insertCellAtIndex", _SE(js_cocos2dx_extension_TableView_insertCellAtIndex)); - cls->defineFunction("cellAtIndex", _SE(js_cocos2dx_extension_TableView_cellAtIndex)); - cls->defineFunction("dequeueCell", _SE(js_cocos2dx_extension_TableView_dequeueCell)); - cls->defineFunction("ctor", _SE(js_cocos2dx_extension_TableView_ctor)); - cls->defineFinalizeFunction(_SE(js_cocos2d_extension_TableView_finalize)); - cls->install(); - JSBClassType::registerClass(cls); - - __jsb_cocos2d_extension_TableView_proto = cls->getProto(); - __jsb_cocos2d_extension_TableView_class = cls; - - se::ScriptEngine::getInstance()->evalString("(function () { cc.TableView.extend = cc.Class.extend; })()"); - se::ScriptEngine::getInstance()->clearException(); - return true; -} - bool register_all_cocos2dx_extension(se::Object* obj) { // Get the ns @@ -6231,21 +1349,9 @@ bool register_all_cocos2dx_extension(se::Object* obj) se::Object* ns = nsVal.toObject(); js_register_cocos2dx_extension_AssetsManagerEx(ns); - js_register_cocos2dx_extension_Control(ns); - js_register_cocos2dx_extension_ControlHuePicker(ns); - js_register_cocos2dx_extension_TableViewCell(ns); - js_register_cocos2dx_extension_ControlStepper(ns); - js_register_cocos2dx_extension_ControlColourPicker(ns); - js_register_cocos2dx_extension_ControlButton(ns); - js_register_cocos2dx_extension_ControlSlider(ns); - js_register_cocos2dx_extension_ScrollView(ns); - js_register_cocos2dx_extension_Manifest(ns); - js_register_cocos2dx_extension_ControlPotentiometer(ns); js_register_cocos2dx_extension_EventListenerAssetsManagerEx(ns); - js_register_cocos2dx_extension_TableView(ns); + js_register_cocos2dx_extension_Manifest(ns); js_register_cocos2dx_extension_EventAssetsManagerEx(ns); - js_register_cocos2dx_extension_ControlSwitch(ns); - js_register_cocos2dx_extension_ControlSaturationBrightnessPicker(ns); return true; } diff --git a/native/cocos/scripting/js-bindings/auto/jsb_cocos2dx_extension_auto.hpp b/native/cocos/scripting/js-bindings/auto/jsb_cocos2dx_extension_auto.hpp index c76e09658a..4fcb9e73d3 100644 --- a/native/cocos/scripting/js-bindings/auto/jsb_cocos2dx_extension_auto.hpp +++ b/native/cocos/scripting/js-bindings/auto/jsb_cocos2dx_extension_auto.hpp @@ -78,284 +78,3 @@ SE_DECLARE_FUNC(js_cocos2dx_extension_EventListenerAssetsManagerEx_init); SE_DECLARE_FUNC(js_cocos2dx_extension_EventListenerAssetsManagerEx_create); SE_DECLARE_FUNC(js_cocos2dx_extension_EventListenerAssetsManagerEx_EventListenerAssetsManagerEx); -extern se::Object* __jsb_cocos2d_extension_Control_proto; -extern se::Class* __jsb_cocos2d_extension_Control_class; - -bool js_register_cocos2d_extension_Control(se::Object* obj); -bool register_all_cocos2dx_extension(se::Object* obj); -SE_DECLARE_FUNC(js_cocos2dx_extension_Control_setEnabled); -SE_DECLARE_FUNC(js_cocos2dx_extension_Control_getState); -SE_DECLARE_FUNC(js_cocos2dx_extension_Control_sendActionsForControlEvents); -SE_DECLARE_FUNC(js_cocos2dx_extension_Control_setSelected); -SE_DECLARE_FUNC(js_cocos2dx_extension_Control_isEnabled); -SE_DECLARE_FUNC(js_cocos2dx_extension_Control_needsLayout); -SE_DECLARE_FUNC(js_cocos2dx_extension_Control_hasVisibleParents); -SE_DECLARE_FUNC(js_cocos2dx_extension_Control_isSelected); -SE_DECLARE_FUNC(js_cocos2dx_extension_Control_isTouchInside); -SE_DECLARE_FUNC(js_cocos2dx_extension_Control_setHighlighted); -SE_DECLARE_FUNC(js_cocos2dx_extension_Control_getTouchLocation); -SE_DECLARE_FUNC(js_cocos2dx_extension_Control_isHighlighted); -SE_DECLARE_FUNC(js_cocos2dx_extension_Control_create); -SE_DECLARE_FUNC(js_cocos2dx_extension_Control_Control); - -extern se::Object* __jsb_cocos2d_extension_ControlButton_proto; -extern se::Class* __jsb_cocos2d_extension_ControlButton_class; - -bool js_register_cocos2d_extension_ControlButton(se::Object* obj); -bool register_all_cocos2dx_extension(se::Object* obj); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlButton_isPushed); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlButton_setTitleLabelForState); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlButton_setAdjustBackgroundImage); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlButton_setTitleForState); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlButton_setLabelAnchorPoint); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlButton_getLabelAnchorPoint); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlButton_initWithBackgroundSprite); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlButton_getTitleTTFSizeForState); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlButton_setTitleTTFForState); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlButton_setTitleTTFSizeForState); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlButton_setTitleLabel); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlButton_setPreferredSize); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlButton_getCurrentTitleColor); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlButton_setZoomOnTouchDown); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlButton_setBackgroundSprite); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlButton_getBackgroundSpriteForState); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlButton_getHorizontalOrigin); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlButton_initWithTitleAndFontNameAndFontSize); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlButton_setTitleBMFontForState); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlButton_getScaleRatio); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlButton_getTitleTTFForState); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlButton_getBackgroundSprite); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlButton_getTitleColorForState); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlButton_setTitleColorForState); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlButton_doesAdjustBackgroundImage); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlButton_setBackgroundSpriteFrameForState); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlButton_setBackgroundSpriteForState); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlButton_setScaleRatio); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlButton_getTitleBMFontForState); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlButton_getTitleLabel); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlButton_getPreferredSize); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlButton_getVerticalMargin); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlButton_getTitleLabelForState); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlButton_setMargins); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlButton_getCurrentTitle); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlButton_initWithLabelAndBackgroundSprite); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlButton_getZoomOnTouchDown); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlButton_getTitleForState); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlButton_create); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlButton_ControlButton); - -extern se::Object* __jsb_cocos2d_extension_ControlHuePicker_proto; -extern se::Class* __jsb_cocos2d_extension_ControlHuePicker_class; - -bool js_register_cocos2d_extension_ControlHuePicker(se::Object* obj); -bool register_all_cocos2dx_extension(se::Object* obj); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlHuePicker_initWithTargetAndPos); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlHuePicker_setHue); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlHuePicker_getStartPos); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlHuePicker_getHue); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlHuePicker_getSlider); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlHuePicker_setBackground); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlHuePicker_setHuePercentage); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlHuePicker_getBackground); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlHuePicker_getHuePercentage); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlHuePicker_setSlider); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlHuePicker_create); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlHuePicker_ControlHuePicker); - -extern se::Object* __jsb_cocos2d_extension_ControlSaturationBrightnessPicker_proto; -extern se::Class* __jsb_cocos2d_extension_ControlSaturationBrightnessPicker_class; - -bool js_register_cocos2d_extension_ControlSaturationBrightnessPicker(se::Object* obj); -bool register_all_cocos2dx_extension(se::Object* obj); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlSaturationBrightnessPicker_getShadow); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlSaturationBrightnessPicker_initWithTargetAndPos); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlSaturationBrightnessPicker_getStartPos); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlSaturationBrightnessPicker_getOverlay); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlSaturationBrightnessPicker_getSlider); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlSaturationBrightnessPicker_getBackground); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlSaturationBrightnessPicker_getSaturation); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlSaturationBrightnessPicker_getBrightness); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlSaturationBrightnessPicker_create); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlSaturationBrightnessPicker_ControlSaturationBrightnessPicker); - -extern se::Object* __jsb_cocos2d_extension_ControlColourPicker_proto; -extern se::Class* __jsb_cocos2d_extension_ControlColourPicker_class; - -bool js_register_cocos2d_extension_ControlColourPicker(se::Object* obj); -bool register_all_cocos2dx_extension(se::Object* obj); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlColourPicker_hueSliderValueChanged); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlColourPicker_getHuePicker); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlColourPicker_getcolourPicker); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlColourPicker_setBackground); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlColourPicker_setcolourPicker); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlColourPicker_colourSliderValueChanged); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlColourPicker_setHuePicker); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlColourPicker_getBackground); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlColourPicker_create); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlColourPicker_ControlColourPicker); - -extern se::Object* __jsb_cocos2d_extension_ControlPotentiometer_proto; -extern se::Class* __jsb_cocos2d_extension_ControlPotentiometer_class; - -bool js_register_cocos2d_extension_ControlPotentiometer(se::Object* obj); -bool register_all_cocos2dx_extension(se::Object* obj); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlPotentiometer_setPreviousLocation); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlPotentiometer_setValue); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlPotentiometer_getProgressTimer); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlPotentiometer_getMaximumValue); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlPotentiometer_angleInDegreesBetweenLineFromPoint_toPoint_toLineFromPoint_toPoint); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlPotentiometer_potentiometerBegan); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlPotentiometer_setMaximumValue); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlPotentiometer_getMinimumValue); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlPotentiometer_setThumbSprite); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlPotentiometer_getValue); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlPotentiometer_getPreviousLocation); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlPotentiometer_distanceBetweenPointAndPoint); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlPotentiometer_potentiometerEnded); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlPotentiometer_setProgressTimer); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlPotentiometer_setMinimumValue); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlPotentiometer_getThumbSprite); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlPotentiometer_initWithTrackSprite_ProgressTimer_ThumbSprite); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlPotentiometer_potentiometerMoved); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlPotentiometer_create); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlPotentiometer_ControlPotentiometer); - -extern se::Object* __jsb_cocos2d_extension_ControlSlider_proto; -extern se::Class* __jsb_cocos2d_extension_ControlSlider_class; - -bool js_register_cocos2d_extension_ControlSlider(se::Object* obj); -bool register_all_cocos2dx_extension(se::Object* obj); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlSlider_setBackgroundSprite); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlSlider_getMaximumAllowedValue); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlSlider_initWithSprites); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlSlider_getMinimumAllowedValue); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlSlider_getMaximumValue); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlSlider_getSelectedThumbSprite); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlSlider_setProgressSprite); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlSlider_setMaximumValue); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlSlider_getMinimumValue); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlSlider_setThumbSprite); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlSlider_getValue); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlSlider_getBackgroundSprite); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlSlider_getThumbSprite); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlSlider_setValue); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlSlider_locationFromTouch); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlSlider_setMinimumValue); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlSlider_setMinimumAllowedValue); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlSlider_getProgressSprite); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlSlider_setSelectedThumbSprite); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlSlider_setMaximumAllowedValue); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlSlider_create); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlSlider_ControlSlider); - -extern se::Object* __jsb_cocos2d_extension_ControlStepper_proto; -extern se::Class* __jsb_cocos2d_extension_ControlStepper_class; - -bool js_register_cocos2d_extension_ControlStepper(se::Object* obj); -bool register_all_cocos2dx_extension(se::Object* obj); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlStepper_getMinusSprite); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlStepper_setValue); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlStepper_setStepValue); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlStepper_initWithMinusSpriteAndPlusSprite); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlStepper_setValueWithSendingEvent); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlStepper_setMaximumValue); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlStepper_getMinusLabel); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlStepper_getPlusLabel); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlStepper_setWraps); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlStepper_setMinusLabel); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlStepper_startAutorepeat); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlStepper_updateLayoutUsingTouchLocation); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlStepper_isContinuous); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlStepper_stopAutorepeat); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlStepper_setMinimumValue); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlStepper_setPlusLabel); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlStepper_getValue); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlStepper_getPlusSprite); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlStepper_setPlusSprite); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlStepper_setMinusSprite); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlStepper_create); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlStepper_ControlStepper); - -extern se::Object* __jsb_cocos2d_extension_ControlSwitch_proto; -extern se::Class* __jsb_cocos2d_extension_ControlSwitch_class; - -bool js_register_cocos2d_extension_ControlSwitch(se::Object* obj); -bool register_all_cocos2dx_extension(se::Object* obj); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlSwitch_setOn); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlSwitch_locationFromTouch); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlSwitch_isOn); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlSwitch_initWithMaskSprite); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlSwitch_hasMoved); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlSwitch_create); -SE_DECLARE_FUNC(js_cocos2dx_extension_ControlSwitch_ControlSwitch); - -extern se::Object* __jsb_cocos2d_extension_ScrollView_proto; -extern se::Class* __jsb_cocos2d_extension_ScrollView_class; - -bool js_register_cocos2d_extension_ScrollView(se::Object* obj); -bool register_all_cocos2dx_extension(se::Object* obj); -SE_DECLARE_FUNC(js_cocos2dx_extension_ScrollView_isClippingToBounds); -SE_DECLARE_FUNC(js_cocos2dx_extension_ScrollView_setContainer); -SE_DECLARE_FUNC(js_cocos2dx_extension_ScrollView_setContentOffsetInDuration); -SE_DECLARE_FUNC(js_cocos2dx_extension_ScrollView_setZoomScaleInDuration); -SE_DECLARE_FUNC(js_cocos2dx_extension_ScrollView_updateTweenAction); -SE_DECLARE_FUNC(js_cocos2dx_extension_ScrollView_setMaxScale); -SE_DECLARE_FUNC(js_cocos2dx_extension_ScrollView_hasVisibleParents); -SE_DECLARE_FUNC(js_cocos2dx_extension_ScrollView_getDirection); -SE_DECLARE_FUNC(js_cocos2dx_extension_ScrollView_getContainer); -SE_DECLARE_FUNC(js_cocos2dx_extension_ScrollView_setMinScale); -SE_DECLARE_FUNC(js_cocos2dx_extension_ScrollView_getZoomScale); -SE_DECLARE_FUNC(js_cocos2dx_extension_ScrollView_updateInset); -SE_DECLARE_FUNC(js_cocos2dx_extension_ScrollView_initWithViewSize); -SE_DECLARE_FUNC(js_cocos2dx_extension_ScrollView_pause); -SE_DECLARE_FUNC(js_cocos2dx_extension_ScrollView_setDirection); -SE_DECLARE_FUNC(js_cocos2dx_extension_ScrollView_stopAnimatedContentOffset); -SE_DECLARE_FUNC(js_cocos2dx_extension_ScrollView_setContentOffset); -SE_DECLARE_FUNC(js_cocos2dx_extension_ScrollView_isDragging); -SE_DECLARE_FUNC(js_cocos2dx_extension_ScrollView_isTouchEnabled); -SE_DECLARE_FUNC(js_cocos2dx_extension_ScrollView_isBounceable); -SE_DECLARE_FUNC(js_cocos2dx_extension_ScrollView_setTouchEnabled); -SE_DECLARE_FUNC(js_cocos2dx_extension_ScrollView_getContentOffset); -SE_DECLARE_FUNC(js_cocos2dx_extension_ScrollView_resume); -SE_DECLARE_FUNC(js_cocos2dx_extension_ScrollView_setClippingToBounds); -SE_DECLARE_FUNC(js_cocos2dx_extension_ScrollView_setViewSize); -SE_DECLARE_FUNC(js_cocos2dx_extension_ScrollView_getViewSize); -SE_DECLARE_FUNC(js_cocos2dx_extension_ScrollView_maxContainerOffset); -SE_DECLARE_FUNC(js_cocos2dx_extension_ScrollView_setBounceable); -SE_DECLARE_FUNC(js_cocos2dx_extension_ScrollView_isTouchMoved); -SE_DECLARE_FUNC(js_cocos2dx_extension_ScrollView_isNodeVisible); -SE_DECLARE_FUNC(js_cocos2dx_extension_ScrollView_minContainerOffset); -SE_DECLARE_FUNC(js_cocos2dx_extension_ScrollView_setZoomScale); -SE_DECLARE_FUNC(js_cocos2dx_extension_ScrollView_create); -SE_DECLARE_FUNC(js_cocos2dx_extension_ScrollView_ScrollView); - -extern se::Object* __jsb_cocos2d_extension_TableViewCell_proto; -extern se::Class* __jsb_cocos2d_extension_TableViewCell_class; - -bool js_register_cocos2d_extension_TableViewCell(se::Object* obj); -bool register_all_cocos2dx_extension(se::Object* obj); -SE_DECLARE_FUNC(js_cocos2dx_extension_TableViewCell_reset); -SE_DECLARE_FUNC(js_cocos2dx_extension_TableViewCell_getIdx); -SE_DECLARE_FUNC(js_cocos2dx_extension_TableViewCell_setIdx); -SE_DECLARE_FUNC(js_cocos2dx_extension_TableViewCell_create); -SE_DECLARE_FUNC(js_cocos2dx_extension_TableViewCell_TableViewCell); - -extern se::Object* __jsb_cocos2d_extension_TableView_proto; -extern se::Class* __jsb_cocos2d_extension_TableView_class; - -bool js_register_cocos2d_extension_TableView(se::Object* obj); -bool register_all_cocos2dx_extension(se::Object* obj); -SE_DECLARE_FUNC(js_cocos2dx_extension_TableView_updateCellAtIndex); -SE_DECLARE_FUNC(js_cocos2dx_extension_TableView_setVerticalFillOrder); -SE_DECLARE_FUNC(js_cocos2dx_extension_TableView_scrollViewDidZoom); -SE_DECLARE_FUNC(js_cocos2dx_extension_TableView__updateContentSize); -SE_DECLARE_FUNC(js_cocos2dx_extension_TableView_getVerticalFillOrder); -SE_DECLARE_FUNC(js_cocos2dx_extension_TableView_removeCellAtIndex); -SE_DECLARE_FUNC(js_cocos2dx_extension_TableView_initWithViewSize); -SE_DECLARE_FUNC(js_cocos2dx_extension_TableView_scrollViewDidScroll); -SE_DECLARE_FUNC(js_cocos2dx_extension_TableView_reloadData); -SE_DECLARE_FUNC(js_cocos2dx_extension_TableView_insertCellAtIndex); -SE_DECLARE_FUNC(js_cocos2dx_extension_TableView_cellAtIndex); -SE_DECLARE_FUNC(js_cocos2dx_extension_TableView_dequeueCell); -SE_DECLARE_FUNC(js_cocos2dx_extension_TableView_TableView); - diff --git a/native/extensions/Android.mk b/native/extensions/Android.mk index 5207a25daa..8749c4ae6a 100644 --- a/native/extensions/Android.mk +++ b/native/extensions/Android.mk @@ -14,22 +14,6 @@ assets-manager/Manifest.cpp \ assets-manager/AssetsManagerEx.cpp \ assets-manager/CCEventAssetsManagerEx.cpp \ assets-manager/CCEventListenerAssetsManagerEx.cpp \ -GUI/CCControlExtension/CCControl.cpp \ -GUI/CCControlExtension/CCControlButton.cpp \ -GUI/CCControlExtension/CCControlColourPicker.cpp \ -GUI/CCControlExtension/CCControlHuePicker.cpp \ -GUI/CCControlExtension/CCControlPotentiometer.cpp \ -GUI/CCControlExtension/CCControlSaturationBrightnessPicker.cpp \ -GUI/CCControlExtension/CCControlSlider.cpp \ -GUI/CCControlExtension/CCControlStepper.cpp \ -GUI/CCControlExtension/CCControlSwitch.cpp \ -GUI/CCControlExtension/CCControlUtils.cpp \ -GUI/CCControlExtension/CCInvocation.cpp \ -GUI/CCScrollView/CCScrollView.cpp \ -GUI/CCScrollView/CCTableView.cpp \ -GUI/CCScrollView/CCTableViewCell.cpp \ -physics-nodes/CCPhysicsDebugNode.cpp \ -physics-nodes/CCPhysicsSprite.cpp LOCAL_STATIC_LIBRARIES := cocos2dx_internal_static LOCAL_STATIC_LIBRARIES += cocos_chipmunk_static diff --git a/native/extensions/GUI/CCControlExtension/CCControl.cpp b/native/extensions/GUI/CCControlExtension/CCControl.cpp deleted file mode 100644 index d31775617c..0000000000 --- a/native/extensions/GUI/CCControlExtension/CCControl.cpp +++ /dev/null @@ -1,338 +0,0 @@ -/* - * Copyright (c) 2012 cocos2d-x.org - * http://www.cocos2d-x.org - * - * Copyright 2011 Yannick Loriot. - * http://yannickloriot.com - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * - * - * converted to c++ / cocos2d-x by Angus C - */ - -#include "CCControl.h" -#include "base/CCDirector.h" -#include "2d/CCMenu.h" -#include "base/CCTouch.h" -#include "CCInvocation.h" -#include "base/CCEventDispatcher.h" -#include "base/CCEventListenerTouch.h" - -NS_CC_EXT_BEGIN - -Control::Control() -: _enabled(false) -, _selected(false) -, _highlighted(false) -, _hasVisibleParents(false) -, _isOpacityModifyRGB(false) -, _state(State::NORMAL) -{ - -} - -Control* Control::create() -{ - Control* pRet = new (std::nothrow) Control(); - if (pRet && pRet->init()) - { - pRet->autorelease(); - return pRet; - } - else - { - CC_SAFE_DELETE(pRet); - return nullptr; - } -} - -bool Control::init() -{ - if (Layer::init()) - { - // Initialise instance variables - _state=Control::State::NORMAL; - setEnabled(true); - setSelected(false); - setHighlighted(false); - - auto dispatcher = Director::getInstance()->getEventDispatcher(); - auto touchListener = EventListenerTouchOneByOne::create(); - touchListener->setSwallowTouches(true); - touchListener->onTouchBegan = CC_CALLBACK_2(Control::onTouchBegan, this); - touchListener->onTouchMoved = CC_CALLBACK_2(Control::onTouchMoved, this); - touchListener->onTouchEnded = CC_CALLBACK_2(Control::onTouchEnded, this); - touchListener->onTouchCancelled = CC_CALLBACK_2(Control::onTouchCancelled, this); - - dispatcher->addEventListenerWithSceneGraphPriority(touchListener, this); - - return true; - } - else - { - return false; - } -} - -Control::~Control() -{ - for (auto iter = _dispatchTable.begin(); iter != _dispatchTable.end(); ++iter) - { - delete iter->second; - } - - _dispatchTable.clear(); -} - -void Control::sendActionsForControlEvents(EventType controlEvents) -{ - retain(); - // For each control events - for (int i = 0; i < kControlEventTotalNumber; i++) - { - // If the given controlEvents bitmask contains the curent event - if (((int)controlEvents & (1 << i))) - { - // Call invocations - const auto& invocationList = this->dispatchListforControlEvent((Control::EventType)(1<invoke(this); - } - -#if CC_ENABLE_SCRIPT_BINDING - //Call ScriptFunc - if (kScriptTypeLua == _scriptType) - { - cocos2d::BasicScriptData data(this,(void*)&controlEvents); - cocos2d::ScriptEvent event(cocos2d::kControlEvent,(void*)&data); - cocos2d::ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event); - } -#endif - } - } - release(); -} -void Control::addTargetWithActionForControlEvents(Ref* target, Handler action, EventType controlEvents) -{ - // For each control events - for (int i = 0; i < kControlEventTotalNumber; i++) - { - // If the given controlEvents bitmask contains the curent event - if (((int)controlEvents & (1 << i))) - { - this->addTargetWithActionForControlEvent(target, action, (EventType)(1<dispatchListforControlEvent(controlEvent); - eventInvocationList.pushBack(invocation); -} - -void Control::removeTargetWithActionForControlEvents(Ref* target, Handler action, EventType controlEvents) -{ - // For each control events - for (int i = 0; i < kControlEventTotalNumber; i++) - { - // If the given controlEvents bitmask contains the curent event - if (((int)controlEvents & (1 << i))) - { - this->removeTargetWithActionForControlEvent(target, action, (EventType)(1 << i)); - } - } -} - -void Control::removeTargetWithActionForControlEvent(Ref* target, Handler action, EventType controlEvent) -{ - // Retrieve all invocations for the given control event - // - auto& eventInvocationList = this->dispatchListforControlEvent(controlEvent); - - //remove all invocations if the target and action are null - //TODO: should the invocations be deleted, or just removed from the array? Won't that cause issues if you add a single invocation for multiple events? - - if (!target && !action) - { - //remove objects - eventInvocationList.clear(); - } - else - { - std::vector tobeRemovedInvocations; - - //normally we would use a predicate, but this won't work here. Have to do it manually - for(const auto &invocation : eventInvocationList) { - bool shouldBeRemoved=true; - if (target) - { - shouldBeRemoved=(target==invocation->getTarget()); - } - if (action) - { - shouldBeRemoved=(shouldBeRemoved && (action==invocation->getAction())); - } - // Remove the corresponding invocation object - if (shouldBeRemoved) - { - tobeRemovedInvocations.push_back(invocation); - } - } - - for(const auto &invocation : tobeRemovedInvocations) { - eventInvocationList.eraseObject(invocation); - } - } -} - - -//CRGBA protocol -void Control::setOpacityModifyRGB(bool bOpacityModifyRGB) -{ - _isOpacityModifyRGB=bOpacityModifyRGB; - - for(auto child : _children){ - child->setOpacityModifyRGB(bOpacityModifyRGB); - } -} - -bool Control::isOpacityModifyRGB() const -{ - return _isOpacityModifyRGB; -} - - -Vec2 Control::getTouchLocation(Touch* touch) -{ - Vec2 touchLocation = touch->getLocation(); // Get the touch position - touchLocation = this->convertToNodeSpace(touchLocation); // Convert to the node space of this class - - return touchLocation; -} - -bool Control::isTouchInside(Touch* touch) -{ - Vec2 touchLocation = touch->getLocation(); // Get the touch position - touchLocation = this->getParent()->convertToNodeSpace(touchLocation); - Rect bBox = getBoundingBox(); - return bBox.containsPoint(touchLocation); -} - -Vector& Control::dispatchListforControlEvent(EventType controlEvent) -{ - Vector* invocationList = nullptr; - auto iter = _dispatchTable.find((int)controlEvent); - - // If the invocation list does not exist for the dispatch table, we create it - if (iter == _dispatchTable.end()) - { - invocationList = new (std::nothrow) Vector(); - _dispatchTable[(int)controlEvent] = invocationList; - } - else - { - invocationList = iter->second; - } - return *invocationList; -} - -void Control::needsLayout() -{ -} - -void Control::setEnabled(bool bEnabled) -{ - _enabled = bEnabled; - if(_enabled) { - _state = Control::State::NORMAL; - } else { - _state = Control::State::DISABLED; - } - - this->needsLayout(); -} - -bool Control::isEnabled() const -{ - return _enabled; -} - -void Control::setSelected(bool bSelected) -{ - _selected = bSelected; - this->needsLayout(); -} - -bool Control::isSelected() const -{ - return _selected; -} - -void Control::setHighlighted(bool bHighlighted) -{ - _highlighted = bHighlighted; - this->needsLayout(); -} - -bool Control::isHighlighted() const -{ - return _highlighted; -} - -bool Control::hasVisibleParents() const -{ - auto parent = this->getParent(); - for( auto c = parent; c != nullptr; c = c->getParent() ) - { - if( !c->isVisible() ) - { - return false; - } - } - return true; -} - -Control::EventType operator|(Control::EventType a, Control::EventType b) { - return static_cast(static_cast(a) | static_cast(b)); -} - -NS_CC_EXT_END - diff --git a/native/extensions/GUI/CCControlExtension/CCControl.h b/native/extensions/GUI/CCControlExtension/CCControl.h deleted file mode 100644 index 2e20db8d8b..0000000000 --- a/native/extensions/GUI/CCControlExtension/CCControl.h +++ /dev/null @@ -1,278 +0,0 @@ -/* - * Copyright (c) 2012 cocos2d-x.org - * http://www.cocos2d-x.org - * - * Copyright 2011 Yannick Loriot. - * http://yannickloriot.com - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * - * Converted to c++ / cocos2d-x by Angus C - */ - - -#ifndef __CCCONTROL_H__ -#define __CCCONTROL_H__ - -#include "CCControlUtils.h" -#include "2d/CCLayer.h" -#include "extensions/ExtensionExport.h" - -NS_CC_EXT_BEGIN - - -class Invocation; - -/** - * @addtogroup GUI - * @{ - * @addtogroup control_extension - * @{ - */ - -/** Number of kinds of control event. */ -#define kControlEventTotalNumber 9 - - -/* - * @class - * Control is inspired by the UIControl API class from the UIKit library of - * CocoaTouch. It provides a base class for control Sprites such as Button - * or Slider that convey user intent to the application. - * - * The goal of Control is to define an interface and base implementation for - * preparing action messages and initially dispatching them to their targets when - * certain events occur. - * - * To use the Control you have to subclass it. - */ -class CC_EX_DLL Control : public Layer -{ -public: - /** Kinds of possible events for the control objects. */ - enum class CC_EX_DLL EventType - { - TOUCH_DOWN = 1 << 0, // A touch-down event in the control. - DRAG_INSIDE = 1 << 1, // An event where a finger is dragged inside the bounds of the control. - DRAG_OUTSIDE = 1 << 2, // An event where a finger is dragged just outside the bounds of the control. - DRAG_ENTER = 1 << 3, // An event where a finger is dragged into the bounds of the control. - DRAG_EXIT = 1 << 4, // An event where a finger is dragged from within a control to outside its bounds. - TOUCH_UP_INSIDE = 1 << 5, // A touch-up event in the control where the finger is inside the bounds of the control. - TOUCH_UP_OUTSIDE = 1 << 6, // A touch-up event in the control where the finger is outside the bounds of the control. - TOUCH_CANCEL = 1 << 7, // A system event canceling the current touches for the control. - VALUE_CHANGED = 1 << 8 // A touch dragging or otherwise manipulating a control, causing it to emit a series of different values. - }; - - typedef void (Ref::*Handler)(Ref*, EventType); - - /** The possible state for a control. */ - enum class State - { - NORMAL = 1 << 0, // The normal, or default state of a control。ェthat is, enabled but neither selected nor highlighted. - HIGH_LIGHTED = 1 << 1, // Highlighted state of a control. A control enters this state when a touch down, drag inside or drag enter is performed. You can retrieve and set this value through the highlighted property. - DISABLED = 1 << 2, // Disabled state of a control. This state indicates that the control is currently disabled. You can retrieve and set this value through the enabled property. - SELECTED = 1 << 3 // Selected state of a control. This state indicates that the control is currently selected. You can retrieve and set this value through the selected property. - }; - - /** Creates a Control object */ - static Control* create(); - - /** Tells whether the control is enabled. */ - virtual void setEnabled(bool bEnabled); - virtual bool isEnabled() const; - - /** A Boolean value that determines the control selected state. */ - virtual void setSelected(bool bSelected); - virtual bool isSelected() const; - - /** A Boolean value that determines whether the control is highlighted. */ - virtual void setHighlighted(bool bHighlighted); - virtual bool isHighlighted() const; - - bool hasVisibleParents() const; - /** - * Updates the control layout using its current internal state. - */ - virtual void needsLayout(); - - /** - * Sends action messages for the given control events. - * - * @param controlEvents A bitmask whose set flags specify the control events for - * which action messages are sent. See "CCControlEvent" for bitmask constants. - */ - virtual void sendActionsForControlEvents(EventType controlEvents); - - /** - * Adds a target and action for a particular event (or events) to an internal - * dispatch table. - * The action message may optionnaly include the sender and the event as - * parameters, in that order. - * When you call this method, target is not retained. - * - * @param target The target object that is, the object to which the action - * message is sent. It cannot be nil. The target is not retained. - * @param action A selector identifying an action message. It cannot be NULL. - * @param controlEvents A bitmask specifying the control events for which the - * action message is sent. See "CCControlEvent" for bitmask constants. - */ - virtual void addTargetWithActionForControlEvents(Ref* target, Handler action, EventType controlEvents); - - /** - * Removes a target and action for a particular event (or events) from an - * internal dispatch table. - * - * @param target The target object葉hat is, the object to which the action - * message is sent. Pass nil to remove all targets paired with action and the - * specified control events. - * @param action A selector identifying an action message. Pass NULL to remove - * all action messages paired with target. - * @param controlEvents A bitmask specifying the control events associated with - * target and action. See "CCControlEvent" for bitmask constants. - */ - virtual void removeTargetWithActionForControlEvents(Ref* target, Handler action, EventType controlEvents); - - /** - * Returns a point corresponding to the touh location converted into the - * control space coordinates. - * @param touch A Touch object that represents a touch. - */ - virtual Vec2 getTouchLocation(Touch* touch); - - virtual bool onTouchBegan(Touch *touch, Event *event) { return false; }; - virtual void onTouchMoved(Touch *touch, Event *event) {}; - virtual void onTouchEnded(Touch *touch, Event *event) {}; - virtual void onTouchCancelled(Touch *touch, Event *event) {}; - - /** - * Returns a boolean value that indicates whether a touch is inside the bounds - * of the receiver. The given touch must be relative to the world. - * - * @param touch A Touch object that represents a touch. - * - * @return Whether a touch is inside the receiver's rect. - */ - virtual bool isTouchInside(Touch * touch); - - // Overrides - virtual bool isOpacityModifyRGB() const override; - virtual void setOpacityModifyRGB(bool bOpacityModifyRGB) override; - -CC_CONSTRUCTOR_ACCESS: - /** - * @js ctor - */ - Control(); - /** - * @js NA - * @lua NA - */ - virtual ~Control(); - - virtual bool init(void) override; - -protected: - /** - * Returns an Invocation object able to construct messages using a given - * target-action pair. (The invocation may optionnaly include the sender and - * the event as parameters, in that order) - * - * @param target The target object. - * @param action A selector identifying an action message. - * @param controlEvent A control events for which the action message is sent. - * See "CCControlEvent" for constants. - * - * @return an Invocation object able to construct messages using a given - * target-action pair. - */ - Invocation* invocationWithTargetAndActionForControlEvent(Ref* target, Handler action, EventType controlEvent); - - /** - * Returns the Invocation list for the given control event. If the list does - * not exist, it'll create an empty array before returning it. - * - * @param controlEvent A control events for which the action message is sent. - * See "CCControlEvent" for constants. - * - * @return the Invocation list for the given control event. - */ - Vector& dispatchListforControlEvent(EventType controlEvent); - - /** - * Adds a target and action for a particular event to an internal dispatch - * table. - * The action message may optionnaly include the sender and the event as - * parameters, in that order. - * When you call this method, target is not retained. - * - * @param target The target object。ェthat is, the object to which the action - * message is sent. It cannot be nil. The target is not retained. - * @param action A selector identifying an action message. It cannot be NULL. - * @param controlEvent A control event for which the action message is sent. - * See "CCControlEvent" for constants. - */ - void addTargetWithActionForControlEvent(Ref* target, Handler action, EventType controlEvent); - - /** - * Removes a target and action for a particular event from an internal dispatch - * table. - * - * @param target The target object。ェthat is, the object to which the action - * message is sent. Pass nil to remove all targets paired with action and the - * specified control events. - * @param action A selector identifying an action message. Pass NULL to remove - * all action messages paired with target. - * @param controlEvent A control event for which the action message is sent. - * See "CCControlEvent" for constants. - */ - void removeTargetWithActionForControlEvent(Ref* target, Handler action, EventType controlEvent); - - bool _enabled; - bool _selected; - bool _highlighted; - - /** True if all of the controls parents are visible */ - bool _hasVisibleParents; - - /** - * Table of connection between the ControlEvents and their associated - * target-actions pairs. For each ButtonEvents a list of NSInvocation - * (which contains the target-action pair) is linked. - */ - std::unordered_map*> _dispatchTable; - - //CCRGBAProtocol - bool _isOpacityModifyRGB; - - /** The current control state constant. */ - CC_SYNTHESIZE_READONLY(State, _state, State); - -private: - CC_DISALLOW_COPY_AND_ASSIGN(Control); -}; - -CC_EX_DLL Control::EventType operator|(Control::EventType a, Control::EventType b); - -// end of GUI group -/// @} -/// @} - -NS_CC_EXT_END - -#endif diff --git a/native/extensions/GUI/CCControlExtension/CCControlButton.cpp b/native/extensions/GUI/CCControlExtension/CCControlButton.cpp deleted file mode 100644 index 655854382d..0000000000 --- a/native/extensions/GUI/CCControlExtension/CCControlButton.cpp +++ /dev/null @@ -1,755 +0,0 @@ -/* - * Copyright (c) 2012 cocos2d-x.org - * http://www.cocos2d-x.org - * - * Copyright 2011 Yannick Loriot. - * http://yannickloriot.com - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * - */ - -#include "CCControlButton.h" -#include "2d/CCLabel.h" -#include "2d/CCAction.h" -#include "2d/CCActionInterval.h" - -using namespace std; - -NS_CC_EXT_BEGIN - -enum -{ - kZoomActionTag = 0xCCCB0001, -}; - -ControlButton::ControlButton() -: _isPushed(false) -, _parentInited(false) -, _doesAdjustBackgroundImage(false) -, _currentTitleColor(Color3B::WHITE) -, _titleLabel(nullptr) -, _backgroundSprite(nullptr) -, _zoomOnTouchDown(false) -, _marginV(ControlButtonMarginTB) -, _marginH(ControlButtonMarginLR) -{ - -} - -ControlButton::~ControlButton() -{ - CC_SAFE_RELEASE(_titleLabel); - CC_SAFE_RELEASE(_backgroundSprite); -} - -//initialisers - -bool ControlButton::init() -{ - return this->initWithLabelAndBackgroundSprite(Label::createWithSystemFont("", "Helvetica", 12), cocos2d::ui::Scale9Sprite::create(),true); -} - -bool ControlButton::initWithLabelAndBackgroundSprite(Node* node, ui::Scale9Sprite* backgroundSprite, bool adjustBackGroundSize) -{ - if (Control::init()) - { - CCASSERT(node != nullptr, "node must not be nil."); - if (node == nullptr) { - return false; - } - LabelProtocol* label = dynamic_cast(node); - CCASSERT(backgroundSprite != nullptr, "Background sprite must not be nil."); - CCASSERT(label != nullptr, "label must not be nil."); - if (backgroundSprite == nullptr || label == nullptr) { - return false; - } - - _parentInited = true; - - _isPushed = false; - - setPreferredSize(Size::ZERO); - // Adjust the background image by adjustBackGroundSize - setAdjustBackgroundImage(adjustBackGroundSize); - - // Zooming button by default - _zoomOnTouchDown = true; - _scaleRatio = 1.1f; - - // Set the default anchor point - setIgnoreAnchorPointForPosition(false); - setAnchorPoint(Vec2::ANCHOR_MIDDLE); - - // Set the nodes - setTitleLabel(node); - setBackgroundSprite(backgroundSprite); - - // Set the default color and opacity - setColor(Color3B::WHITE); - setOpacity(255.0f); - setOpacityModifyRGB(true); - - // Initialize the dispatch table - - setTitleForState(label->getString(), Control::State::NORMAL); - setTitleColorForState(node->getColor(), Control::State::NORMAL); - setTitleLabelForState(node, Control::State::NORMAL); - setBackgroundSpriteForState(backgroundSprite, Control::State::NORMAL); - - setLabelAnchorPoint(Vec2::ANCHOR_MIDDLE); - - // Layout update - needsLayout(); - - return true; - } - //couldn't init the Control - else - { - return false; - } -} - -ControlButton* ControlButton::create(Node* label, cocos2d::ui::Scale9Sprite* backgroundSprite) -{ - ControlButton *ret = new (std::nothrow) ControlButton(); - if (ret && ret->initWithLabelAndBackgroundSprite(label, backgroundSprite, true)) - { - ret->autorelease(); - return ret; - } - - delete ret; - return nullptr; -} - -ControlButton* ControlButton::create(Node* label, cocos2d::ui::Scale9Sprite* backgroundSprite, bool adjustBackGroundSize) -{ - ControlButton *pRet = new (std::nothrow) ControlButton(); - pRet->initWithLabelAndBackgroundSprite(label, backgroundSprite, adjustBackGroundSize); - pRet->autorelease(); - return pRet; -} - -bool ControlButton::initWithTitleAndFontNameAndFontSize(const std::string& title, const std::string& fontName, float fontSize) -{ - return initWithLabelAndBackgroundSprite(Label::createWithSystemFont(title, fontName, fontSize), cocos2d::ui::Scale9Sprite::create(),true); -} - -ControlButton* ControlButton::create(const std::string& title, const std::string& fontName, float fontSize) -{ - ControlButton *pRet = new (std::nothrow) ControlButton(); - pRet->initWithTitleAndFontNameAndFontSize(title, fontName, fontSize); - pRet->autorelease(); - return pRet; -} - -bool ControlButton::initWithBackgroundSprite(cocos2d::ui::Scale9Sprite* sprite) -{ - Label *label = Label::createWithSystemFont("", "Arial", 30);// - return initWithLabelAndBackgroundSprite(label, sprite,false); -} - -ControlButton* ControlButton::create(cocos2d::ui::Scale9Sprite* sprite) -{ - ControlButton *pRet = new (std::nothrow) ControlButton(); - pRet->initWithBackgroundSprite(sprite); - pRet->autorelease(); - return pRet; -} - - -void ControlButton::setMargins(int marginH, int marginV) -{ - _marginV = marginV; - _marginH = marginH; - needsLayout(); -} - -void ControlButton::setEnabled(bool enabled) -{ - Control::setEnabled(enabled); - needsLayout(); -} - -void ControlButton::setSelected(bool enabled) -{ - Control::setSelected(enabled); - needsLayout(); -} - -void ControlButton::setHighlighted(bool enabled) -{ - if (enabled == true) - { - _state = Control::State::HIGH_LIGHTED; - } - else - { - _state = Control::State::NORMAL; - } - - Control::setHighlighted(enabled); - - Action *action = getActionByTag(kZoomActionTag); - if (action) - { - stopAction(action); - } - needsLayout(); - if( _zoomOnTouchDown ) - { - float scaleValue = (isHighlighted() && isEnabled() && !isSelected()) ? _scaleRatio : 1.0f; - Action *zoomAction = ScaleTo::create(0.05f, scaleValue); - zoomAction->setTag(kZoomActionTag); - runAction(zoomAction); - } -} - -void ControlButton::setZoomOnTouchDown(bool zoomOnTouchDown) -{ - _zoomOnTouchDown = zoomOnTouchDown; -} - -bool ControlButton::getZoomOnTouchDown() const -{ - return _zoomOnTouchDown; -} - -void ControlButton::setPreferredSize(const Size& size) -{ - if(size.width == 0 && size.height == 0) - { - _doesAdjustBackgroundImage = true; - } - else - { - _doesAdjustBackgroundImage = false; - - for (auto iter = _backgroundSpriteDispatchTable.begin(); iter != _backgroundSpriteDispatchTable.end(); ++iter) - { - iter->second->setPreferredSize(size); - } - } - - _preferredSize = size; - needsLayout(); -} - -const Size& ControlButton::getPreferredSize() const -{ - return _preferredSize; -} - -void ControlButton::setAdjustBackgroundImage(bool adjustBackgroundImage) -{ - _doesAdjustBackgroundImage = adjustBackgroundImage; - needsLayout(); -} - -bool ControlButton::doesAdjustBackgroundImage() -{ - return _doesAdjustBackgroundImage; -} - -const Vec2& ControlButton::getLabelAnchorPoint() const -{ - return this->_labelAnchorPoint; -} - -void ControlButton::setLabelAnchorPoint(const Vec2& labelAnchorPoint) -{ - this->_labelAnchorPoint = labelAnchorPoint; - if (_titleLabel != nullptr) - { - this->_titleLabel->setAnchorPoint(labelAnchorPoint); - } -} - -std::string ControlButton::getTitleForState(State state) -{ - auto iter = _titleDispatchTable.find((int)state); - if (iter != _titleDispatchTable.end()) - { - return iter->second; - } - - iter = _titleDispatchTable.find((int)Control::State::NORMAL); - - return iter != _titleDispatchTable.end() ? iter->second : ""; -} - -void ControlButton::setTitleForState(const std::string& title, State state) -{ - _titleDispatchTable.erase((int)state); - - if (!title.empty()) - { - _titleDispatchTable[(int)state] = title; - } - - // If the current state if equal to the given state we update the layout - if (getState() == state) - { - needsLayout(); - } -} - - -Color3B ControlButton::getTitleColorForState(State state) const -{ - Color3B returnColor = Color3B::WHITE; - - auto iter = _titleColorDispatchTable.find((int)state); - if (iter != _titleColorDispatchTable.end()) - { - returnColor = iter->second; - } - else - { - iter = _titleColorDispatchTable.find((int)Control::State::NORMAL); - if (iter != _titleColorDispatchTable.end()) - { - returnColor = iter->second; - } - } - - return returnColor; -} - -void ControlButton::setTitleColorForState(const Color3B& color, State state) -{ - _titleColorDispatchTable.erase((int)state); - _titleColorDispatchTable[(int)state] = color; - - // If the current state if equal to the given state we update the layout - if (getState() == state) - { - needsLayout(); - } -} - -Node* ControlButton::getTitleLabelForState(State state) -{ - Node* titleLabel = _titleLabelDispatchTable.at((int)state); - if (titleLabel) - { - return titleLabel; - } - return _titleLabelDispatchTable.at((int)Control::State::NORMAL); -} - -void ControlButton::setTitleLabelForState(Node* titleLabel, State state) -{ - Node* previousLabel = _titleLabelDispatchTable.at((int)state); - if (previousLabel) - { - removeChild(previousLabel, true); - _titleLabelDispatchTable.erase((int)state); - } - - _titleLabelDispatchTable.insert((int)state, titleLabel); - titleLabel->setVisible(false); - titleLabel->setAnchorPoint(Vec2::ANCHOR_MIDDLE); - addChild(titleLabel, 1); - - // If the current state if equal to the given state we update the layout - if (getState() == state) - { - needsLayout(); - } -} - -void ControlButton::setTitleTTFForState(const std::string& fontName, State state) -{ - this->setTitleLabelForState(Label::createWithSystemFont(getTitleForState(state), fontName, 12), state); -} - -const std::string& ControlButton::getTitleTTFForState(State state) -{ - LabelProtocol* label = dynamic_cast(this->getTitleLabelForState(state)); - Label* labelTTF = dynamic_cast(label); - if(labelTTF != 0) - { - return labelTTF->getSystemFontName(); - } - - static std::string ret(""); - return ret; -} - -void ControlButton::setTitleTTFSizeForState(float size, State state) -{ - LabelProtocol* label = dynamic_cast(this->getTitleLabelForState(state)); - if(label) - { - Label* labelTTF = dynamic_cast(label); - if(labelTTF != 0) - { - return labelTTF->setSystemFontSize(size); - } - } -} - -float ControlButton::getTitleTTFSizeForState(State state) -{ - LabelProtocol* label = dynamic_cast(this->getTitleLabelForState(state)); - Label* labelTTF = dynamic_cast(label); - if(labelTTF != 0) - { - return labelTTF->getSystemFontSize(); - } - else - { - return 0; - } -} - -void ControlButton::setTitleBMFontForState(const std::string& fntFile, State state) -{ - std::string title = this->getTitleForState(state); - this->setTitleLabelForState(Label::createWithBMFont(fntFile, title, nullptr), state); -} - -const std::string& ControlButton::getTitleBMFontForState(State state) -{ - LabelProtocol* label = dynamic_cast(this->getTitleLabelForState(state)); - auto labelBMFont = dynamic_cast(label); - if(labelBMFont != 0) - { - return labelBMFont->getBMFontFilePath(); - } - - static std::string ret(""); - return ret; -} - - -ui::Scale9Sprite* ControlButton::getBackgroundSpriteForState(State state) -{ - auto backgroundSprite = _backgroundSpriteDispatchTable.at((int)state); - if (backgroundSprite) - { - return backgroundSprite; - } - return _backgroundSpriteDispatchTable.at((int)Control::State::NORMAL); -} - - -void ControlButton::setBackgroundSpriteForState(ui::Scale9Sprite* sprite, State state) -{ - Size oldPreferredSize = _preferredSize; - - auto previousBackgroundSprite = _backgroundSpriteDispatchTable.at((int)state); - if (previousBackgroundSprite) - { - removeChild(previousBackgroundSprite, true); - _backgroundSpriteDispatchTable.erase((int)state); - } - - _backgroundSpriteDispatchTable.insert((int)state, sprite); - sprite->setVisible(false); - sprite->setAnchorPoint(Vec2::ANCHOR_MIDDLE); - addChild(sprite); - - if (this->_preferredSize.width != 0 || this->_preferredSize.height != 0) - { - if (oldPreferredSize.equals(_preferredSize)) - { - // Force update of preferred size - sprite->setPreferredSize(Size(oldPreferredSize.width+1, oldPreferredSize.height+1)); - } - - sprite->setPreferredSize(this->_preferredSize); - } - - // If the current state if equal to the given state we update the layout - if (getState() == state) - { - needsLayout(); - } -} - -void ControlButton::setBackgroundSpriteFrameForState(SpriteFrame * spriteFrame, State state) -{ - ui::Scale9Sprite * sprite = ui::Scale9Sprite::createWithSpriteFrame(spriteFrame); - this->setBackgroundSpriteForState(sprite, state); -} - - -void ControlButton::needsLayout() -{ - if (!_parentInited) { - return; - } - // Hide the background and the label - if (_titleLabel != nullptr) { - _titleLabel->setVisible(false); - } - if (_backgroundSprite) { - _backgroundSprite->setVisible(false); - } - // Update anchor of all labels - this->setLabelAnchorPoint(this->_labelAnchorPoint); - - // Update the label to match with the current state - _currentTitle = getTitleForState(_state); - - _currentTitleColor = getTitleColorForState(_state); - - this->setTitleLabel(getTitleLabelForState(_state)); - - LabelProtocol* label = dynamic_cast(_titleLabel); - if (label && !_currentTitle.empty()) - { - label->setString(_currentTitle); - } - - if (_titleLabel) - { - _titleLabel->setColor(_currentTitleColor); - } - if (_titleLabel != nullptr) - { - _titleLabel->setPosition(getContentSize().width / 2, getContentSize().height / 2); - } - - // Update the background sprite - this->setBackgroundSprite(this->getBackgroundSpriteForState(_state)); - if (_backgroundSprite != nullptr) - { - _backgroundSprite->setPosition(getContentSize().width / 2, getContentSize().height / 2); - } - - // Get the title label size - Size titleLabelSize; - if (_titleLabel != nullptr) - { - titleLabelSize = _titleLabel->getBoundingBox().size; - } - - // Adjust the background image if necessary - if (_doesAdjustBackgroundImage) - { - // Add the margins - if (_backgroundSprite != nullptr) - { - _backgroundSprite->setContentSize(Size(titleLabelSize.width + _marginH * 2, titleLabelSize.height + _marginV * 2)); - } - } - else - { - //TODO: should this also have margins if one of the preferred sizes is relaxed? - if (_backgroundSprite != nullptr) - { - Size preferredSize = _backgroundSprite->getPreferredSize(); - if (preferredSize.width <= 0) - { - preferredSize.width = titleLabelSize.width; - } - if (preferredSize.height <= 0) - { - preferredSize.height = titleLabelSize.height; - } - - _backgroundSprite->setContentSize(preferredSize); - } - } - - // Set the content size - Rect rectTitle; - if (_titleLabel != nullptr) - { - rectTitle = _titleLabel->getBoundingBox(); - } - Rect rectBackground; - if (_backgroundSprite != nullptr) - { - rectBackground = _backgroundSprite->getBoundingBox(); - } - - Rect maxRect = ControlUtils::RectUnion(rectTitle, rectBackground); - setContentSize(Size(maxRect.size.width, maxRect.size.height)); - - if (_titleLabel != nullptr) - { - _titleLabel->setPosition(getContentSize().width/2, getContentSize().height/2); - // Make visible the background and the label - _titleLabel->setVisible(true); - } - - if (_backgroundSprite != nullptr) - { - _backgroundSprite->setPosition(getContentSize().width/2, getContentSize().height/2); - _backgroundSprite->setVisible(true); - } -} - - - -bool ControlButton::onTouchBegan(Touch *pTouch, Event *pEvent) -{ - if (!isTouchInside(pTouch) || !isEnabled() || !isVisible() || !hasVisibleParents() ) - { - return false; - } - - for (Node *c = this->_parent; c != nullptr; c = c->getParent()) - { - if (c->isVisible() == false) - { - return false; - } - } - - _isPushed = true; - this->setHighlighted(true); - sendActionsForControlEvents(Control::EventType::TOUCH_DOWN); - return true; -} - -void ControlButton::onTouchMoved(Touch *pTouch, Event *pEvent) -{ - if (!isEnabled() || !isPushed() || isSelected()) - { - if (isHighlighted()) - { - setHighlighted(false); - } - return; - } - - bool isTouchMoveInside = isTouchInside(pTouch); - if (isTouchMoveInside && !isHighlighted()) - { - setHighlighted(true); - sendActionsForControlEvents(Control::EventType::DRAG_ENTER); - } - else if (isTouchMoveInside && isHighlighted()) - { - sendActionsForControlEvents(Control::EventType::DRAG_INSIDE); - } - else if (!isTouchMoveInside && isHighlighted()) - { - setHighlighted(false); - - sendActionsForControlEvents(Control::EventType::DRAG_EXIT); - } - else if (!isTouchMoveInside && !isHighlighted()) - { - sendActionsForControlEvents(Control::EventType::DRAG_OUTSIDE); - } -} -void ControlButton::onTouchEnded(Touch *pTouch, Event *pEvent) -{ - _isPushed = false; - setHighlighted(false); - - - if (isTouchInside(pTouch)) - { - sendActionsForControlEvents(Control::EventType::TOUCH_UP_INSIDE); - } - else - { - sendActionsForControlEvents(Control::EventType::TOUCH_UP_OUTSIDE); - } -} - -void ControlButton::setOpacity(GLubyte opacity) -{ - Control::setOpacity(opacity); - - for (auto iter = _backgroundSpriteDispatchTable.begin(); iter != _backgroundSpriteDispatchTable.end(); ++iter) - { - iter->second->setOpacity(opacity); - } - - for (auto iter = _titleLabelDispatchTable.begin(); iter != _titleLabelDispatchTable.end(); ++iter) - { - iter->second->setOpacity(opacity); - } -} - -void ControlButton::updateDisplayedOpacity(GLubyte parentOpacity) -{ - Control::updateDisplayedOpacity(parentOpacity); - - for (auto iter = _backgroundSpriteDispatchTable.begin(); iter != _backgroundSpriteDispatchTable.end(); ++iter) - { - iter->second->updateDisplayedOpacity(parentOpacity); - } - - for (auto iter = _titleLabelDispatchTable.begin(); iter != _titleLabelDispatchTable.end(); ++iter) - { - iter->second->updateDisplayedOpacity(parentOpacity); - } -} - -void ControlButton::setColor(const Color3B & color) -{ - Control::setColor(color); - - for (auto iter = _backgroundSpriteDispatchTable.begin(); iter != _backgroundSpriteDispatchTable.end(); ++iter) - { - iter->second->setColor(color); - } - - for (auto iter = _titleLabelDispatchTable.begin(); iter != _titleLabelDispatchTable.end(); ++iter) - { - iter->second->setColor(color); - } -} - -void ControlButton::updateDisplayedColor(const Color3B& parentColor) -{ - Control::updateDisplayedColor(parentColor); - - for (auto iter = _backgroundSpriteDispatchTable.begin(); iter != _backgroundSpriteDispatchTable.end(); ++iter) - { - iter->second->updateDisplayedColor(parentColor); - } - - for (auto iter = _titleLabelDispatchTable.begin(); iter != _titleLabelDispatchTable.end(); ++iter) - { - iter->second->updateDisplayedColor(parentColor); - } -} - -void ControlButton::onTouchCancelled(Touch *pTouch, Event *pEvent) -{ - _isPushed = false; - setHighlighted(false); - sendActionsForControlEvents(Control::EventType::TOUCH_CANCEL); -} - -ControlButton* ControlButton::create() -{ - ControlButton *pControlButton = new (std::nothrow) ControlButton(); - if (pControlButton && pControlButton->init()) - { - pControlButton->autorelease(); - return pControlButton; - } - CC_SAFE_DELETE(pControlButton); - return nullptr; -} - -NS_CC_EXT_END diff --git a/native/extensions/GUI/CCControlExtension/CCControlButton.h b/native/extensions/GUI/CCControlExtension/CCControlButton.h deleted file mode 100644 index 924ff6c5bf..0000000000 --- a/native/extensions/GUI/CCControlExtension/CCControlButton.h +++ /dev/null @@ -1,259 +0,0 @@ -/* - * Copyright (c) 2012 cocos2d-x.org - * http://www.cocos2d-x.org - * - * Copyright 2011 Yannick Loriot. All rights reserved. - * http://yannickloriot.com - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * - * Converted to c++ / cocos2d-x by Angus C - */ - - -#ifndef __CCCONTROL_BUTTON_H__ -#define __CCCONTROL_BUTTON_H__ - -#include "CCControl.h" -#include "CCInvocation.h" -#include "base/CCMap.h" -#include "ui/UIScale9Sprite.h" - -NS_CC_EXT_BEGIN - -/* Define the button margin for Left/Right edge */ -#define ControlButtonMarginLR 8 // px -/* Define the button margin for Top/Bottom edge */ -#define ControlButtonMarginTB 2 // px - - -/** - * @addtogroup GUI - * @{ - * @addtogroup control_extension - * @{ - */ - -/** @class ControlButton Button control for Cocos2D. */ -class CC_EX_DLL ControlButton : public Control -{ -public: - static ControlButton* create(); - static ControlButton* create(cocos2d::ui::Scale9Sprite* sprite); - static ControlButton* create(Node* label, cocos2d::ui::Scale9Sprite* backgroundSprite); - static ControlButton* create(const std::string& title, const std::string& fontName, float fontSize); - static ControlButton* create(Node* label, cocos2d::ui::Scale9Sprite* backgroundSprite, bool adjustBackGroundSize); - - virtual void needsLayout(void) override; - - virtual void setEnabled(bool enabled) override; - virtual void setSelected(bool enabled) override; - virtual void setHighlighted(bool enabled) override; - - bool isPushed() const { return _isPushed; } - - /** - * Returns the title used for a state. - * - * @param state The state that uses the title. Possible values are described in - * "CCControlState". - * - * @return The title for the specified state. - */ - virtual std::string getTitleForState(State state); - - /** - * Sets the title string to use for the specified state. - * If a property is not specified for a state, the default is to use - * the ButtonStateNormal value. - * - * @param title The title string to use for the specified state. - * @param state The state that uses the specified title. The values are described - * in "CCControlState". - */ - virtual void setTitleForState(const std::string& title, State state); - - /** - * Returns the title color used for a state. - * - * @param state The state that uses the specified color. The values are described - * in "CCControlState". - * - * @return The color of the title for the specified state. - */ - - virtual Color3B getTitleColorForState(State state) const; - - /** - * Sets the color of the title to use for the specified state. - * - * @param color The color of the title to use for the specified state. - * @param state The state that uses the specified color. The values are described - * in "CCControlState". - */ - virtual void setTitleColorForState(const Color3B& color, State state); - - /** - * Returns the title label used for a state. - * - * @param state The state that uses the title label. Possible values are described - * in "CCControlState". - */ - virtual Node* getTitleLabelForState(State state); - - /** - * Sets the title label to use for the specified state. - * If a property is not specified for a state, the default is to use - * the ButtonStateNormal value. - * - * @param label The title label to use for the specified state. - * @param state The state that uses the specified title. The values are described - * in "CCControlState". - */ - virtual void setTitleLabelForState(Node* label, State state); - - virtual void setTitleTTFForState(const std::string& fntFile, State state); - virtual const std::string& getTitleTTFForState(State state); - - virtual void setTitleTTFSizeForState(float size, State state); - virtual float getTitleTTFSizeForState(State state); - - /** - * Sets the font of the label, changes the label to a BMFont if necessary. - * @param fntFile The name of the font to change to - * @param state The state that uses the specified fntFile. The values are described - * in "CCControlState". - */ - virtual void setTitleBMFontForState(const std::string& fntFile, State state); - virtual const std::string& getTitleBMFontForState(State state); - - /** - * Returns the background sprite used for a state. - * - * @param state The state that uses the background sprite. Possible values are - * described in "CCControlState". - */ - virtual cocos2d::ui::Scale9Sprite* getBackgroundSpriteForState(State state); - - /** - * Sets the background sprite to use for the specified button state. - * - * @param sprite The background sprite to use for the specified state. - * @param state The state that uses the specified image. The values are described - * in "CCControlState". - */ - virtual void setBackgroundSpriteForState(cocos2d::ui::Scale9Sprite* sprite, State state); - - /** - * Sets the background spriteFrame to use for the specified button state. - * - * @param spriteFrame The background spriteFrame to use for the specified state. - * @param state The state that uses the specified image. The values are described - * in "CCControlState". - */ - virtual void setBackgroundSpriteFrameForState(SpriteFrame * spriteFrame, State state); - - //set the margins at once (so we only have to do one call of needsLayout) - virtual void setMargins(int marginH, int marginV); - - /** Adjust the background image. YES by default. If the property is set to NO, the - background will use the preferred size of the background image. */ - bool doesAdjustBackgroundImage(); - void setAdjustBackgroundImage(bool adjustBackgroundImage); - - // Overrides - virtual bool onTouchBegan(Touch *touch, Event *event) override; - virtual void onTouchMoved(Touch *touch, Event *event) override; - virtual void onTouchEnded(Touch *touch, Event *event) override; - virtual void onTouchCancelled(Touch *touch, Event *event) override; - - virtual void setOpacity(GLubyte var) override; - virtual void updateDisplayedOpacity(GLubyte parentOpacity) override; - virtual void setColor(const Color3B&) override; - virtual void updateDisplayedColor(const Color3B& parentColor) override; - - const std::string& getCurrentTitle() const { return _currentTitle; }; - std::string getCurrentTitle() { return _currentTitle; }; - -CC_CONSTRUCTOR_ACCESS: - /** - * @js ctor - */ - ControlButton(); - /** - * @js NA - * @lua NA - */ - virtual ~ControlButton(); - - virtual bool init() override; - virtual bool initWithLabelAndBackgroundSprite(Node* label, cocos2d::ui::Scale9Sprite* backgroundSprite, bool adjustBackGroundSize); - virtual bool initWithBackgroundSprite(cocos2d::ui::Scale9Sprite* sprite); - virtual bool initWithTitleAndFontNameAndFontSize(const std::string& title, const std::string& fontName, float fontSize); - -protected: - bool _isPushed; - bool _parentInited; - bool _doesAdjustBackgroundImage; - - /** The current title that is displayed on the button. */ - std::string _currentTitle; - - /** The current color used to display the title. */ - CC_SYNTHESIZE_READONLY_PASS_BY_REF(Color3B, _currentTitleColor, CurrentTitleColor); - - /** The current title label. */ - CC_SYNTHESIZE_RETAIN(Node*, _titleLabel, TitleLabel); - - /** The current background sprite. */ - CC_SYNTHESIZE_RETAIN(cocos2d::ui::Scale9Sprite*, _backgroundSprite, BackgroundSprite); - - /** The preferred size of the button, if label is larger it will be expanded. */ - CC_PROPERTY_PASS_BY_REF(Size, _preferredSize, PreferredSize); - - /** Adjust the button zooming on touchdown. Default value is YES. */ - CC_PROPERTY(bool, _zoomOnTouchDown, ZoomOnTouchDown); - /** Scale ratio button on touchdown. Default value 1.1f */ - CC_SYNTHESIZE(float, _scaleRatio, ScaleRatio); - - CC_PROPERTY_PASS_BY_REF(Vec2, _labelAnchorPoint, LabelAnchorPoint); - - std::unordered_map _titleDispatchTable; - std::unordered_map _titleColorDispatchTable; - - Map _titleLabelDispatchTable; - Map _backgroundSpriteDispatchTable; - - /* Define the button margin for Top/Bottom edge */ - CC_SYNTHESIZE_READONLY(int, _marginV, VerticalMargin); - /* Define the button margin for Left/Right edge */ - CC_SYNTHESIZE_READONLY(int, _marginH, HorizontalOrigin); - -private: - CC_DISALLOW_COPY_AND_ASSIGN(ControlButton); -}; - -// end of GUI group -/// @} -/// @} - -NS_CC_EXT_END - -#endif - diff --git a/native/extensions/GUI/CCControlExtension/CCControlColourPicker.cpp b/native/extensions/GUI/CCControlExtension/CCControlColourPicker.cpp deleted file mode 100644 index 577b5a4156..0000000000 --- a/native/extensions/GUI/CCControlExtension/CCControlColourPicker.cpp +++ /dev/null @@ -1,200 +0,0 @@ -/* - * Copyright (c) 2012 cocos2d-x.org - * http://www.cocos2d-x.org - * - * Copyright 2012 Stewart Hamilton-Arrandale. - * http://creativewax.co.uk - * - * Modified by Yannick Loriot. - * http://yannickloriot.com - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * - * converted to c++ / cocos2d-x by Angus C - */ - -#include "CCControlColourPicker.h" -#include "2d/CCSpriteFrameCache.h" -#include "2d/CCSpriteBatchNode.h" - -NS_CC_EXT_BEGIN - -ControlColourPicker::ControlColourPicker() -: _colourPicker(nullptr) -, _huePicker(nullptr) -, _background(nullptr) -{ - -} - -ControlColourPicker::~ControlColourPicker() -{ - CC_SAFE_RELEASE(_background); - CC_SAFE_RELEASE(_huePicker); - CC_SAFE_RELEASE(_colourPicker); -} - -bool ControlColourPicker::init() -{ - if (Control::init()) - { - // Cache the sprites - SpriteFrameCache::getInstance()->addSpriteFramesWithFile("extensions/CCControlColourPickerSpriteSheet.plist"); - - // Create the sprite batch node - SpriteBatchNode *spriteSheet = SpriteBatchNode::create("extensions/CCControlColourPickerSpriteSheet.png"); - addChild(spriteSheet); - - // MIPMAP -// ccTexParams params = {GL_LINEAR_MIPMAP_LINEAR, GL_LINEAR, GL_REPEAT, GL_REPEAT}; - /* Comment next line to avoid something like mosaic in 'ControlExtensionTest', - especially the display of 'huePickerBackground.png' when in 800*480 window size with 480*320 design resolution and hd(960*640) resources. - */ -// spriteSheet->getTexture()->setAliasTexParameters(); -// spriteSheet->getTexture()->setTexParameters(¶ms); -// spriteSheet->getTexture()->generateMipmap(); - - // Init default color - _hsv.h = 0; - _hsv.s = 0; - _hsv.v = 0; - - // Add image - _background=ControlUtils::addSpriteToTargetWithPosAndAnchor("menuColourPanelBackground.png", spriteSheet, Vec2::ZERO, Vec2(0.5f, 0.5f)); - if(!_background) return false; - CC_SAFE_RETAIN(_background); - - Vec2 backgroundPointZero = _background->getPosition() - Vec2(_background->getContentSize().width / 2, _background->getContentSize().height / 2); - - // Setup panels - float hueShift = 8; - float colourShift = 28; - - _huePicker = new (std::nothrow) ControlHuePicker(); - _huePicker->initWithTargetAndPos(spriteSheet, Vec2(backgroundPointZero.x + hueShift, backgroundPointZero.y + hueShift)); - _colourPicker = new (std::nothrow) ControlSaturationBrightnessPicker(); - _colourPicker->initWithTargetAndPos(spriteSheet, Vec2(backgroundPointZero.x + colourShift, backgroundPointZero.y + colourShift)); - - // Setup events - _huePicker->addTargetWithActionForControlEvents(this, cccontrol_selector(ControlColourPicker::hueSliderValueChanged), Control::EventType::VALUE_CHANGED); - _colourPicker->addTargetWithActionForControlEvents(this, cccontrol_selector(ControlColourPicker::colourSliderValueChanged), Control::EventType::VALUE_CHANGED); - - // Set defaults - updateHueAndControlPicker(); - addChild(_huePicker); - addChild(_colourPicker); - - // Set content size - setContentSize(_background->getContentSize()); - return true; - } - else - return false; -} - -ControlColourPicker* ControlColourPicker::create() -{ - ControlColourPicker *pRet = new (std::nothrow) ControlColourPicker(); - pRet->init(); - pRet->autorelease(); - return pRet; -} - - -void ControlColourPicker::setColor(const Color3B& color) -{ - // FIXME: fixed me if not correct - Control::setColor(color); - - RGBA rgba; - rgba.r = color.r / 255.0f; - rgba.g = color.g / 255.0f; - rgba.b = color.b / 255.0f; - rgba.a = 1.0f; - - _hsv=ControlUtils::HSVfromRGB(rgba); - updateHueAndControlPicker(); -} - -void ControlColourPicker::setEnabled(bool enabled) -{ - Control::setEnabled(enabled); - if (_huePicker != nullptr) - { - _huePicker->setEnabled(enabled); - } - if (_colourPicker) - { - _colourPicker->setEnabled(enabled); - } -} - - -//need two events to prevent an infinite loop! (can't update huePicker when the huePicker triggers the callback due to Control::EventType::VALUE_CHANGED) -void ControlColourPicker::updateControlPicker() -{ - _huePicker->setHue(_hsv.h); - _colourPicker->updateWithHSV(_hsv); -} - -void ControlColourPicker::updateHueAndControlPicker() -{ - _huePicker->setHue(_hsv.h); - _colourPicker->updateWithHSV(_hsv); - _colourPicker->updateDraggerWithHSV(_hsv); -} - - -void ControlColourPicker::hueSliderValueChanged(Ref * sender, Control::EventType controlEvent) -{ - _hsv.h = ((ControlHuePicker*)sender)->getHue(); - - // Update the value - RGBA rgb = ControlUtils::RGBfromHSV(_hsv); - // FIXME: fixed me if not correct - Control::setColor(Color3B((GLubyte)(rgb.r * 255.0f), (GLubyte)(rgb.g * 255.0f), (GLubyte)(rgb.b * 255.0f))); - - // Send Control callback - sendActionsForControlEvents(Control::EventType::VALUE_CHANGED); - updateControlPicker(); -} - -void ControlColourPicker::colourSliderValueChanged(Ref * sender, Control::EventType controlEvent) -{ - _hsv.s=((ControlSaturationBrightnessPicker*)sender)->getSaturation(); - _hsv.v=((ControlSaturationBrightnessPicker*)sender)->getBrightness(); - - - // Update the value - RGBA rgb = ControlUtils::RGBfromHSV(_hsv); - // FIXME: fixed me if not correct - Control::setColor(Color3B((GLubyte)(rgb.r * 255.0f), (GLubyte)(rgb.g * 255.0f), (GLubyte)(rgb.b * 255.0f))); - - // Send Control callback - sendActionsForControlEvents(Control::EventType::VALUE_CHANGED); -} - -//ignore all touches, handled by children -bool ControlColourPicker::onTouchBegan(Touch* touch, Event* pEvent) -{ - return false; -} - -NS_CC_EXT_END - diff --git a/native/extensions/GUI/CCControlExtension/CCControlColourPicker.h b/native/extensions/GUI/CCControlExtension/CCControlColourPicker.h deleted file mode 100644 index 9709a2fd45..0000000000 --- a/native/extensions/GUI/CCControlExtension/CCControlColourPicker.h +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright (c) 2012 cocos2d-x.org - * http://www.cocos2d-x.org - * - * Copyright 2012 Stewart Hamilton-Arrandale. - * http://creativewax.co.uk - * - * Modified by Yannick Loriot. - * http://yannickloriot.com - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * - * Converted to c++ / cocos2d-x by Angus C - */ - -#ifndef __CCCONTROL_COLOUR_PICKER_H__ -#define __CCCONTROL_COLOUR_PICKER_H__ - - -#include "CCControl.h" -#include "CCControlUtils.h" -#include "CCControlHuePicker.h" -#include "CCControlSaturationBrightnessPicker.h" -#include "extensions/ExtensionExport.h" - -NS_CC_EXT_BEGIN - -/** - * @addtogroup GUI - * @{ - * @addtogroup control_extension - * @{ - */ - -class CC_EX_DLL ControlColourPicker: public Control -{ -public: - static ControlColourPicker* create(); - /** - * @js ctor - * @lua new - */ - ControlColourPicker(); - /** - * @js NA - * @lua NA - */ - virtual ~ControlColourPicker(); - - virtual bool init() override; - - virtual void setColor(const Color3B& colorValue) override; - virtual void setEnabled(bool bEnabled) override; - - //virtual ~ControlColourPicker(); - void hueSliderValueChanged(Ref * sender, Control::EventType controlEvent); - void colourSliderValueChanged(Ref * sender, Control::EventType controlEvent); - -protected: - void updateControlPicker(); - void updateHueAndControlPicker(); - virtual bool onTouchBegan(Touch* touch, Event* pEvent) override; - - HSV _hsv; - CC_SYNTHESIZE_RETAIN(ControlSaturationBrightnessPicker*, _colourPicker, colourPicker) - CC_SYNTHESIZE_RETAIN(ControlHuePicker*, _huePicker, HuePicker) - CC_SYNTHESIZE_RETAIN(Sprite*, _background, Background) -}; - -// end of GUI group -/// @} -/// @} - -NS_CC_EXT_END - -#endif - diff --git a/native/extensions/GUI/CCControlExtension/CCControlExtensions.h b/native/extensions/GUI/CCControlExtension/CCControlExtensions.h deleted file mode 100644 index 9374ec6240..0000000000 --- a/native/extensions/GUI/CCControlExtension/CCControlExtensions.h +++ /dev/null @@ -1,37 +0,0 @@ -/**************************************************************************** -Copyright (c) 2012 cocos2d-x.org - -http://www.cocos2d-x.org - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -****************************************************************************/ - -#ifndef __CCCONTROL_EXTENSIONS_H__ -#define __CCCONTROL_EXTENSIONS_H__ - -#include "CCControl.h" -#include "CCControlButton.h" -#include "CCControlColourPicker.h" -#include "CCControlPotentiometer.h" -#include "CCControlSlider.h" -#include "CCControlStepper.h" -#include "CCControlSwitch.h" - -#endif - diff --git a/native/extensions/GUI/CCControlExtension/CCControlHuePicker.cpp b/native/extensions/GUI/CCControlExtension/CCControlHuePicker.cpp deleted file mode 100644 index d544390e5d..0000000000 --- a/native/extensions/GUI/CCControlExtension/CCControlHuePicker.cpp +++ /dev/null @@ -1,194 +0,0 @@ -/* - * Copyright (c) 2012 cocos2d-x.org - * http://www.cocos2d-x.org - * - * Copyright 2012 Stewart Hamilton-Arrandale. - * http://creativewax.co.uk - * - * Modified by Yannick Loriot. - * http://yannickloriot.com - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * - * Converted to c++ / cocos2d-x by Angus C - */ - -#include "CCControlHuePicker.h" - -NS_CC_EXT_BEGIN - -ControlHuePicker::ControlHuePicker() -: _hue(0.0f) -, _huePercentage(0.0f) -, _background(nullptr) -, _slider(nullptr) -{ - -} - -ControlHuePicker::~ControlHuePicker() -{ - removeAllChildrenWithCleanup(true); - CC_SAFE_RELEASE(_background); - CC_SAFE_RELEASE(_slider); -} - -ControlHuePicker* ControlHuePicker::create(Node* target, const Vec2& pos) -{ - ControlHuePicker *pRet = new (std::nothrow) ControlHuePicker(); - pRet->initWithTargetAndPos(target, pos); - pRet->autorelease(); - return pRet; -} - - -bool ControlHuePicker::initWithTargetAndPos(Node* target, const Vec2& pos) -{ - if (Control::init()) - { - // Add background and slider sprites - this->setBackground(ControlUtils::addSpriteToTargetWithPosAndAnchor("huePickerBackground.png", target, pos, Vec2::ZERO)); - this->setSlider(ControlUtils::addSpriteToTargetWithPosAndAnchor("colourPicker.png", target, pos, Vec2::ANCHOR_MIDDLE)); - - _slider->setPosition(pos.x, pos.y + _background->getBoundingBox().size.height * 0.5f); - _startPos=pos; - - // Sets the default value - _hue=0.0f; - _huePercentage=0.0f; - return true; - } - else - { - return false; - } -} - -void ControlHuePicker::setHue(float hueValue) -{ - _hue=hueValue; - // Set the position of the slider to the correct hue - // We need to divide it by 360 as its taken as an angle in degrees - float huePercentage = hueValue / 360.0f; - setHuePercentage(huePercentage); -} - -void ControlHuePicker::setHuePercentage(float hueValueInPercent) -{ - _huePercentage=hueValueInPercent; - _hue=_huePercentage*360.0f; - - // Clamp the position of the icon within the circle - Rect backgroundBox=_background->getBoundingBox(); - - // Get the center point of the background image - float centerX = _startPos.x + backgroundBox.size.width * 0.5f; - float centerY = _startPos.y + backgroundBox.size.height * 0.5f; - - // Work out the limit to the distance of the picker when moving around the hue bar - float limit = backgroundBox.size.width * 0.5f - 15.0f; - - // Update angle - float angleDeg = _huePercentage * 360.0f - 180.0f; - float angle = CC_DEGREES_TO_RADIANS(angleDeg); - - // Set new position of the slider - float x = centerX + limit * cosf(angle); - float y = centerY + limit * sinf(angle); - _slider->setPosition(x, y); - -} - -void ControlHuePicker::setEnabled(bool enabled) -{ - Control::setEnabled(enabled); - if (_slider != nullptr) - { - _slider->setOpacity(enabled ? 255 : 128); - } -} - -void ControlHuePicker::updateSliderPosition(const Vec2& location) -{ - - // Clamp the position of the icon within the circle - Rect backgroundBox=_background->getBoundingBox(); - - // Get the center point of the background image - float centerX = _startPos.x + backgroundBox.size.width * 0.5f; - float centerY = _startPos.y + backgroundBox.size.height * 0.5f; - - // Work out the distance difference between the location and center - float dx = location.x - centerX; - float dy = location.y - centerY; - - // Update angle by using the direction of the location - float angle = atan2f(dy, dx); - float angleDeg = CC_RADIANS_TO_DEGREES(angle) + 180.0f; - - // use the position / slider width to determin the percentage the dragger is at - setHue(angleDeg); - - // send Control callback - sendActionsForControlEvents(Control::EventType::VALUE_CHANGED); -} - -bool ControlHuePicker::checkSliderPosition(const Vec2& location) -{ - // compute the distance between the current location and the center - double distance = sqrt(pow (location.x + 10, 2) + pow(location.y, 2)); - - // check that the touch location is within the circle - if (80 > distance && distance > 59) - { - updateSliderPosition(location); - return true; - } - return false; -} - -bool ControlHuePicker::onTouchBegan(Touch* touch, Event* event) -{ - if (!isEnabled() || !isVisible()) - { - return false; - } - - // Get the touch location - Vec2 touchLocation=getTouchLocation(touch); - - // Check the touch position on the slider - return checkSliderPosition(touchLocation); -} - - -void ControlHuePicker::onTouchMoved(Touch* touch, Event* event) -{ - // Get the touch location - Vec2 touchLocation=getTouchLocation(touch); - - //small modification: this allows changing of the colour, even if the touch leaves the bounding area -// updateSliderPosition(touchLocation); -// sendActionsForControlEvents(Control::EventType::VALUE_CHANGED); - // Check the touch position on the slider - checkSliderPosition(touchLocation); -} - -NS_CC_EXT_END - diff --git a/native/extensions/GUI/CCControlExtension/CCControlHuePicker.h b/native/extensions/GUI/CCControlExtension/CCControlHuePicker.h deleted file mode 100644 index 74b773eae5..0000000000 --- a/native/extensions/GUI/CCControlExtension/CCControlHuePicker.h +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright (c) 2012 cocos2d-x.org - * http://www.cocos2d-x.org - * - * Copyright 2012 Stewart Hamilton-Arrandale. - * http://creativewax.co.uk - * - * Modified by Yannick Loriot. - * http://yannickloriot.com - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * - * Converted to c++ / cocos2d-x by Angus C - */ - - -#ifndef __CCCONTROL_HUE_PICKER_H__ -#define __CCCONTROL_HUE_PICKER_H__ - -#include "CCControl.h" -#include "CCInvocation.h" -#include "extensions/ExtensionExport.h" - -NS_CC_EXT_BEGIN - -/** - * @addtogroup GUI - * @{ - * @addtogroup control_extension - * @{ - */ - -class CC_EX_DLL ControlHuePicker : public Control -{ -public: - static ControlHuePicker* create(Node* target, const Vec2& pos); - /** - * @js ctor - */ - ControlHuePicker(); - /** - * @js NA - * @lua NA - */ - virtual ~ControlHuePicker(); - virtual bool initWithTargetAndPos(Node* target, const Vec2& pos); - - virtual void setEnabled(bool enabled) override; - - // overrides - virtual bool onTouchBegan(Touch* touch, Event* pEvent) override; - virtual void onTouchMoved(Touch *pTouch, Event *pEvent) override; - -protected: - void updateSliderPosition(const Vec2& location); - bool checkSliderPosition(const Vec2& location); - - //maunally put in the setters - CC_SYNTHESIZE_READONLY(float, _hue, Hue); - virtual void setHue(float val); - CC_SYNTHESIZE_READONLY(float, _huePercentage, HuePercentage); - virtual void setHuePercentage(float val); - - //not sure if these need to be there actually. I suppose someone might want to access the sprite? - CC_SYNTHESIZE_RETAIN(Sprite*, _background, Background); - CC_SYNTHESIZE_RETAIN(Sprite*, _slider, Slider); - CC_SYNTHESIZE_READONLY(Vec2, _startPos, StartPos); -}; - -// end of GUI group -/// @} -/// @} - -NS_CC_EXT_END - -#endif - diff --git a/native/extensions/GUI/CCControlExtension/CCControlPotentiometer.cpp b/native/extensions/GUI/CCControlExtension/CCControlPotentiometer.cpp deleted file mode 100644 index 464c7e4ee4..0000000000 --- a/native/extensions/GUI/CCControlExtension/CCControlPotentiometer.cpp +++ /dev/null @@ -1,264 +0,0 @@ -/* - * Copyright (c) 2012 cocos2d-x.org - * http://www.cocos2d-x.org - * - * Copyright 2012 Yannick Loriot. All rights reserved. - * http://yannickloriot.com - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * - */ - -#include "CCControlPotentiometer.h" - -NS_CC_EXT_BEGIN - -ControlPotentiometer::ControlPotentiometer() -: _value(0.0f) -, _minimumValue(0.0f) -, _maximumValue(0.0f) -, _thumbSprite(nullptr) -, _progressTimer(nullptr) -{ - -} - -ControlPotentiometer::~ControlPotentiometer() -{ - CC_SAFE_RELEASE(_thumbSprite); - CC_SAFE_RELEASE(_progressTimer); -} - -ControlPotentiometer* ControlPotentiometer::create(const char* backgroundFile, const char* progressFile, const char* thumbFile) -{ - ControlPotentiometer* pRet = new (std::nothrow) ControlPotentiometer(); - if (pRet != nullptr) - { - // Prepare track for potentiometer - Sprite *backgroundSprite = Sprite::create(backgroundFile); - - // Prepare thumb for potentiometer - Sprite *thumbSprite = Sprite::create(thumbFile); - - // Prepare progress for potentiometer - ProgressTimer *progressTimer = ProgressTimer::create(Sprite::create(progressFile)); - //progressTimer.type = ProgressTimer::RADIALCW; - if (pRet->initWithTrackSprite_ProgressTimer_ThumbSprite(backgroundSprite, progressTimer, thumbSprite)) - { - pRet->autorelease(); - } - else - { - CC_SAFE_DELETE(pRet); - } - } - return pRet; -} - -bool ControlPotentiometer::initWithTrackSprite_ProgressTimer_ThumbSprite(Sprite* trackSprite, ProgressTimer* progressTimer, Sprite* thumbSprite) -{ - if (Control::init()) - { - setProgressTimer(progressTimer); - setThumbSprite(thumbSprite); - thumbSprite->setPosition(progressTimer->getPosition()); - - addChild(thumbSprite, 2); - addChild(progressTimer, 1); - addChild(trackSprite); - - setContentSize(trackSprite->getContentSize()); - - // Init default values - _minimumValue = 0.0f; - _maximumValue = 1.0f; - setValue(_minimumValue); - return true; - } - return false; -} - -void ControlPotentiometer::setEnabled(bool enabled) -{ - Control::setEnabled(enabled); - if (_thumbSprite != nullptr) - { - _thumbSprite->setOpacity((enabled) ? 255 : 128); - } -} - -void ControlPotentiometer::setValue(float value) -{ - // set new value with sentinel - if (value < _minimumValue) - { - value = _minimumValue; - } - - if (value > _maximumValue) - { - value = _maximumValue; - } - - _value = value; - - // Update thumb and progress position for new value - float percent = (value - _minimumValue) / (_maximumValue - _minimumValue); - _progressTimer->setPercentage(percent * 100.0f); - _thumbSprite->setRotation(percent * 360.0f); - - sendActionsForControlEvents(Control::EventType::VALUE_CHANGED); -} - -float ControlPotentiometer::getValue() -{ - return _value; -} - -void ControlPotentiometer::setMinimumValue(float minimumValue) -{ - _minimumValue = minimumValue; - - if (_minimumValue >= _maximumValue) - { - _maximumValue = _minimumValue + 1.0f; - } - - setValue(_maximumValue); -} - -float ControlPotentiometer::getMinimumValue() -{ - return _minimumValue; -} - -void ControlPotentiometer::setMaximumValue(float maximumValue) -{ - _maximumValue = maximumValue; - - if (_maximumValue <= _minimumValue) - { - _minimumValue = _maximumValue - 1.0f; - } - - setValue(_minimumValue); -} - -float ControlPotentiometer::getMaximumValue() -{ - return _maximumValue; -} - -bool ControlPotentiometer::isTouchInside(Touch * touch) -{ - Vec2 touchLocation = this->getTouchLocation(touch); - - float distance = this->distanceBetweenPointAndPoint(_progressTimer->getPosition(), touchLocation); - - return distance < MIN(getContentSize().width / 2, getContentSize().height / 2); -} - -bool ControlPotentiometer::onTouchBegan(Touch *pTouch, Event *pEvent) -{ - if (!this->isTouchInside(pTouch) || !this->isEnabled() || !isVisible()) - { - return false; - } - - _previousLocation = this->getTouchLocation(pTouch); - - this->potentiometerBegan(_previousLocation); - - return true; -} - -void ControlPotentiometer::onTouchMoved(Touch *pTouch, Event *pEvent) -{ - Vec2 location = this->getTouchLocation(pTouch); - - this->potentiometerMoved(location); -} - -void ControlPotentiometer::onTouchEnded(Touch *pTouch, Event *pEvent) -{ - this->potentiometerEnded(Vec2::ZERO); -} - -float ControlPotentiometer::distanceBetweenPointAndPoint(const Vec2& point1, const Vec2& point2) -{ - float dx = point1.x - point2.x; - float dy = point1.y - point2.y; - return sqrt(dx*dx + dy*dy); -} - -float ControlPotentiometer::angleInDegreesBetweenLineFromPoint_toPoint_toLineFromPoint_toPoint( - const Vec2& beginLineA, - const Vec2& endLineA, - const Vec2& beginLineB, - const Vec2& endLineB) -{ - float a = endLineA.x - beginLineA.x; - float b = endLineA.y - beginLineA.y; - float c = endLineB.x - beginLineB.x; - float d = endLineB.y - beginLineB.y; - - float atanA = atan2(a, b); - float atanB = atan2(c, d); - - // convert radiants to degrees - return (atanA - atanB) * 180 / M_PI; -} - -void ControlPotentiometer::potentiometerBegan(const Vec2& location) -{ - setSelected(true); - getThumbSprite()->setColor(Color3B::GRAY); -} - -void ControlPotentiometer::potentiometerMoved(const Vec2& location) -{ - float angle = this->angleInDegreesBetweenLineFromPoint_toPoint_toLineFromPoint_toPoint( - _progressTimer->getPosition(), - location, - _progressTimer->getPosition(), - _previousLocation); - - // fix value, if the 12 o'clock position is between location and previousLocation - if (angle > 180) - { - angle -= 360; - } - else if (angle < -180) - { - angle += 360; - } - - setValue(_value + angle / 360.0f * (_maximumValue - _minimumValue)); - - _previousLocation = location; -} - -void ControlPotentiometer::potentiometerEnded(const Vec2& location) -{ - getThumbSprite()->setColor(Color3B::WHITE); - setSelected(false); -} - -NS_CC_EXT_END - diff --git a/native/extensions/GUI/CCControlExtension/CCControlPotentiometer.h b/native/extensions/GUI/CCControlExtension/CCControlPotentiometer.h deleted file mode 100644 index 302ce5df23..0000000000 --- a/native/extensions/GUI/CCControlExtension/CCControlPotentiometer.h +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Copyright (c) 2012 cocos2d-x.org - * http://www.cocos2d-x.org - * - * Copyright 2012 Yannick Loriot. All rights reserved. - * http://yannickloriot.com - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * - */ -#ifndef __CCCONTROLPOTENTIOMETER_H__ -#define __CCCONTROLPOTENTIOMETER_H__ - -#include "CCControl.h" -#include "2d/CCProgressTimer.h" -#include "extensions/ExtensionExport.h" - -NS_CC_EXT_BEGIN - -/** - * @addtogroup GUI - * @{ - * @addtogroup control_extension - * @{ - */ - -/** @class ControlPotentiometer Potentiometer control for Cocos2D. */ -class CC_EX_DLL ControlPotentiometer : public Control -{ -public: - /** - * Creates potentiometer with a track filename and a progress filename. - */ - static ControlPotentiometer* create(const char* backgroundFile, const char* progressFile, const char* thumbFile); - /** - * @js ctor - * @lua new - */ - ControlPotentiometer(); - /** - * @js NA - * @lua NA - */ - virtual ~ControlPotentiometer(); - - /** - * Initializes a potentiometer with a track sprite and a progress bar. - * - * @param trackSprite Sprite, that is used as a background. - * @param progressTimer ProgressTimer, that is used as a progress bar. - */ - bool initWithTrackSprite_ProgressTimer_ThumbSprite(Sprite* trackSprite, ProgressTimer* progressTimer, Sprite* thumbSprite); - - void setValue(float value); - float getValue(); - - void setMinimumValue(float minimumValue); - float getMinimumValue(); - - void setMaximumValue(float maximumValue); - float getMaximumValue(); - - // Overrides - virtual bool isTouchInside(Touch * touch) override; - void setEnabled(bool enabled) override; - virtual bool onTouchBegan(Touch *pTouch, Event *pEvent) override; - virtual void onTouchMoved(Touch *pTouch, Event *pEvent) override; - virtual void onTouchEnded(Touch *pTouch, Event *pEvent) override; - - /** Factorize the event dispath into these methods. */ - void potentiometerBegan(const Vec2& location); - void potentiometerMoved(const Vec2& location); - void potentiometerEnded(const Vec2& location); - - /** Returns the distance between the point1 and point2. */ - float distanceBetweenPointAndPoint(const Vec2& point1, const Vec2& point2); - /** Returns the angle in degree between line1 and line2. */ - float angleInDegreesBetweenLineFromPoint_toPoint_toLineFromPoint_toPoint( - const Vec2& beginLineA, - const Vec2& endLineA, - const Vec2& beginLineB, - const Vec2& endLineB); - -protected: - /** Contains the receiver’s current value. */ - float _value; - /** Contains the minimum value of the receiver. - * The default value of this property is 0.0. */ - float _minimumValue; - /** Contains the maximum value of the receiver. - * The default value of this property is 1.0. */ - float _maximumValue; - - CC_SYNTHESIZE_RETAIN(Sprite*, _thumbSprite, ThumbSprite) - CC_SYNTHESIZE_RETAIN(ProgressTimer*, _progressTimer, ProgressTimer) - CC_SYNTHESIZE(Vec2, _previousLocation, PreviousLocation) -}; - -// end of GUI group -/// @} -/// @} - -NS_CC_EXT_END - -#endif /* __CCCONTROLPOTENTIOMETER_H__ */ - diff --git a/native/extensions/GUI/CCControlExtension/CCControlSaturationBrightnessPicker.cpp b/native/extensions/GUI/CCControlExtension/CCControlSaturationBrightnessPicker.cpp deleted file mode 100644 index a9e274c06c..0000000000 --- a/native/extensions/GUI/CCControlExtension/CCControlSaturationBrightnessPicker.cpp +++ /dev/null @@ -1,211 +0,0 @@ -/* - * Copyright (c) 2012 cocos2d-x.org - * http://www.cocos2d-x.org - * - * Copyright 2012 Stewart Hamilton-Arrandale. - * http://creativewax.co.uk - * - * Modified by Yannick Loriot. - * http://yannickloriot.com - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * - * Converted to c++ / cocos2d-x by Angus C - */ - -#include "CCControlSaturationBrightnessPicker.h" - -NS_CC_EXT_BEGIN - -ControlSaturationBrightnessPicker::ControlSaturationBrightnessPicker() -: _saturation(0.0f) -, _brightness(0.0f) -, _background(nullptr) -, _overlay(nullptr) -, _shadow(nullptr) -, _slider(nullptr) -, boxPos(0) -, boxSize(0) -{ - -} - -ControlSaturationBrightnessPicker::~ControlSaturationBrightnessPicker() -{ - removeAllChildrenWithCleanup(true); - - _background = nullptr; - _overlay = nullptr; - _shadow = nullptr; - _slider = nullptr; -} - -bool ControlSaturationBrightnessPicker::initWithTargetAndPos(Node* target, const Vec2& pos) -{ - if (Control::init()) - { - // Add background and slider sprites - _background=ControlUtils::addSpriteToTargetWithPosAndAnchor("colourPickerBackground.png", target, pos, Vec2::ZERO); - _overlay=ControlUtils::addSpriteToTargetWithPosAndAnchor("colourPickerOverlay.png", target, pos, Vec2::ZERO); - _shadow=ControlUtils::addSpriteToTargetWithPosAndAnchor("colourPickerShadow.png", target, pos, Vec2::ZERO); - _slider=ControlUtils::addSpriteToTargetWithPosAndAnchor("colourPicker.png", target, pos, Vec2::ANCHOR_MIDDLE); - - _startPos=pos; // starting position of the colour picker - boxPos = 35; // starting position of the virtual box area for picking a colour - boxSize = _background->getContentSize().width / 2;; // the size (width and height) of the virtual box for picking a colour from - return true; - } - else - { - return false; - } -} - -ControlSaturationBrightnessPicker* ControlSaturationBrightnessPicker::create(Node* target, const Vec2& pos) -{ - ControlSaturationBrightnessPicker *pRet = new (std::nothrow) ControlSaturationBrightnessPicker(); - pRet->initWithTargetAndPos(target, pos); - pRet->autorelease(); - return pRet; -} - -void ControlSaturationBrightnessPicker::setEnabled(bool enabled) -{ - Control::setEnabled(enabled); - if (_slider != nullptr) - { - _slider->setOpacity(enabled ? 255 : 128); - } -} - -void ControlSaturationBrightnessPicker::updateWithHSV(HSV hsv) -{ - HSV hsvTemp; - hsvTemp.s = 1; - hsvTemp.h = hsv.h; - hsvTemp.v = 1; - - RGBA rgb = ControlUtils::RGBfromHSV(hsvTemp); - _background->setColor(Color3B((GLubyte)(rgb.r * 255.0f), (GLubyte)(rgb.g * 255.0f), (GLubyte)(rgb.b * 255.0f))); -} - -void ControlSaturationBrightnessPicker::updateDraggerWithHSV(HSV hsv) -{ - // Set the position of the slider to the correct saturation and brightness - Vec2 pos(_startPos.x + boxPos + (boxSize*(1 - hsv.s)), - _startPos.y + boxPos + (boxSize*hsv.v)); - - // update - updateSliderPosition(pos); -} - -void ControlSaturationBrightnessPicker::updateSliderPosition(Vec2 sliderPosition) -{ - // Clamp the position of the icon within the circle - - // Get the center point of the bkgd image - float centerX = _startPos.x + _background->getBoundingBox().size.width*0.5f; - float centerY = _startPos.y + _background->getBoundingBox().size.height*0.5f; - - // Work out the distance difference between the location and center - float dx = sliderPosition.x - centerX; - float dy = sliderPosition.y - centerY; - float dist = sqrtf(dx * dx + dy * dy); - - // Update angle by using the direction of the location - float angle = atan2f(dy, dx); - - // Set the limit to the slider movement within the colour picker - float limit = _background->getBoundingBox().size.width*0.5f; - - // Check distance doesn't exceed the bounds of the circle - if (dist > limit) - { - sliderPosition.x = centerX + limit * cosf(angle); - sliderPosition.y = centerY + limit * sinf(angle); - } - - // Set the position of the dragger - _slider->setPosition(sliderPosition); - - - // Clamp the position within the virtual box for colour selection - if (sliderPosition.x < _startPos.x + boxPos) sliderPosition.x = _startPos.x + boxPos; - else if (sliderPosition.x > _startPos.x + boxPos + boxSize - 1) sliderPosition.x = _startPos.x + boxPos + boxSize - 1; - if (sliderPosition.y < _startPos.y + boxPos) sliderPosition.y = _startPos.y + boxPos; - else if (sliderPosition.y > _startPos.y + boxPos + boxSize) sliderPosition.y = _startPos.y + boxPos + boxSize; - - // Use the position / slider width to determin the percentage the dragger is at - _saturation = 1.0f - fabs((_startPos.x + (float)boxPos - sliderPosition.x)/(float)boxSize); - _brightness = fabs((_startPos.y + (float)boxPos - sliderPosition.y)/(float)boxSize); -} - -bool ControlSaturationBrightnessPicker::checkSliderPosition(const Vec2& location) -{ - // Clamp the position of the icon within the circle - - // get the center point of the bkgd image - float centerX = _startPos.x + _background->getBoundingBox().size.width*0.5f; - float centerY = _startPos.y + _background->getBoundingBox().size.height*0.5f; - - // work out the distance difference between the location and center - float dx = location.x - centerX; - float dy = location.y - centerY; - float dist = sqrtf(dx*dx+dy*dy); - - // check that the touch location is within the bounding rectangle before sending updates - if (dist <= _background->getBoundingBox().size.width*0.5f) - { - updateSliderPosition(location); - sendActionsForControlEvents(Control::EventType::VALUE_CHANGED); - return true; - } - return false; -} - - -bool ControlSaturationBrightnessPicker::onTouchBegan(Touch* touch, Event* event) -{ - if (!isEnabled() || !isVisible()) - { - return false; - } - - // Get the touch location - Vec2 touchLocation=getTouchLocation(touch); - - // Check the touch position on the slider - return checkSliderPosition(touchLocation); -} - - -void ControlSaturationBrightnessPicker::onTouchMoved(Touch* touch, Event* event) -{ - // Get the touch location - Vec2 touchLocation=getTouchLocation(touch); - - //small modification: this allows changing of the colour, even if the touch leaves the bounding area -// updateSliderPosition(touchLocation); -// sendActionsForControlEvents(Control::EventType::VALUE_CHANGED); - // Check the touch position on the slider - checkSliderPosition(touchLocation); -} - -NS_CC_EXT_END - diff --git a/native/extensions/GUI/CCControlExtension/CCControlSaturationBrightnessPicker.h b/native/extensions/GUI/CCControlExtension/CCControlSaturationBrightnessPicker.h deleted file mode 100644 index 504c63a4c4..0000000000 --- a/native/extensions/GUI/CCControlExtension/CCControlSaturationBrightnessPicker.h +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Copyright (c) 2012 cocos2d-x.org - * http://www.cocos2d-x.org - * - * Copyright 2012 Stewart Hamilton-Arrandale. - * http://creativewax.co.uk - * - * Modified by Yannick Loriot. - * http://yannickloriot.com - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * - * Converted to c++ / cocos2d-x by Angus C - */ - - -#ifndef __CCCONTROL_SATURATION_PICKER_H__ -#define __CCCONTROL_SATURATION_PICKER_H__ - -#include "CCControl.h" -#include "CCInvocation.h" -#include "extensions/ExtensionExport.h" - -NS_CC_EXT_BEGIN - -/** - * @addtogroup GUI - * @{ - * @addtogroup control_extension - * @{ - */ - -class CC_EX_DLL ControlSaturationBrightnessPicker : public Control -{ - /** Contains the receiver's current saturation value. */ - CC_SYNTHESIZE_READONLY(float, _saturation, Saturation); - /** Contains the receiver's current brightness value. */ - CC_SYNTHESIZE_READONLY(float, _brightness, Brightness); - - //not sure if these need to be there actually. I suppose someone might want to access the sprite? - CC_SYNTHESIZE_READONLY(Sprite*, _background, Background); - CC_SYNTHESIZE_READONLY(Sprite*, _overlay, Overlay); - CC_SYNTHESIZE_READONLY(Sprite*, _shadow, Shadow); - CC_SYNTHESIZE_READONLY(Sprite*, _slider, Slider); - CC_SYNTHESIZE_READONLY(Vec2, _startPos, StartPos); - -protected: - int boxPos; - int boxSize; - -public: - /** - * @js ctor - */ - ControlSaturationBrightnessPicker(); - /** - * @js NA - * @lua NA - */ - virtual ~ControlSaturationBrightnessPicker(); - virtual bool initWithTargetAndPos(Node* target, const Vec2& pos); - - static ControlSaturationBrightnessPicker* create(Node* target, const Vec2& pos); - - virtual void setEnabled(bool enabled) override; - /** - * @js NA - * @lua NA - */ - virtual void updateWithHSV(HSV hsv); - /** - * @js NA - * @lua NA - */ - virtual void updateDraggerWithHSV(HSV hsv); - -protected: - void updateSliderPosition(Vec2 location); - bool checkSliderPosition(const Vec2& location); - - virtual bool onTouchBegan(Touch* touch, Event* pEvent) override; - virtual void onTouchMoved(Touch *pTouch, Event *pEvent) override; -}; - -// end of GUI group -/// @} -/// @} - -NS_CC_EXT_END - -#endif - diff --git a/native/extensions/GUI/CCControlExtension/CCControlSlider.cpp b/native/extensions/GUI/CCControlExtension/CCControlSlider.cpp deleted file mode 100644 index f7b6455e15..0000000000 --- a/native/extensions/GUI/CCControlExtension/CCControlSlider.cpp +++ /dev/null @@ -1,328 +0,0 @@ -/* - * Copyright (c) 2012 cocos2d-x.org - * http://www.cocos2d-x.org - * - * Copyright 2011 Yannick Loriot. - * http://yannickloriot.com - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * - * Converted to c++ / cocos2d-x by Angus C -* - */ - -#include "CCControlSlider.h" -#include "base/CCTouch.h" -#include "base/CCDirector.h" - -NS_CC_EXT_BEGIN - -ControlSlider::ControlSlider() -: _value(0.0f) -, _minimumValue(0.0f) -, _maximumValue(0.0f) -, _minimumAllowedValue(0.0f) -, _maximumAllowedValue(0.0f) -, _thumbSprite(nullptr) -, _selectedThumbSprite(nullptr) -, _progressSprite(nullptr) -, _backgroundSprite(nullptr) -{ - -} - -ControlSlider::~ControlSlider() -{ - CC_SAFE_RELEASE(_thumbSprite); - CC_SAFE_RELEASE(_selectedThumbSprite); - CC_SAFE_RELEASE(_progressSprite); - CC_SAFE_RELEASE(_backgroundSprite); -} - -ControlSlider* ControlSlider::create(const char* bgFile, const char* progressFile, const char* thumbFile) -{ - // Prepare background for slider - Sprite *backgroundSprite = Sprite::create(bgFile); - - // Prepare progress for slider - Sprite *progressSprite = Sprite::create(progressFile); - - // Prepare thumb (menuItem) for slider - Sprite *thumbSprite = Sprite::create(thumbFile); - - return ControlSlider::create(backgroundSprite, progressSprite, thumbSprite); -} - -ControlSlider* ControlSlider::create(const char* bgFile, const char* progressFile, const char* thumbFile, - const char* selectedThumbSpriteFile) -{ - // Prepare background for slider - Sprite *backgroundSprite = Sprite::create(bgFile); - - // Prepare progress for slider - Sprite *progressSprite = Sprite::create(progressFile); - - // Prepare thumb (menuItem) for slider - Sprite *thumbSprite = Sprite::create(thumbFile); - - // Prepare selected thumb (menuItem) for slider - Sprite *selectedThumbSprite = Sprite::create(selectedThumbSpriteFile); - - return ControlSlider::create(backgroundSprite, progressSprite, thumbSprite, selectedThumbSprite); -} - -ControlSlider* ControlSlider::create(Sprite * backgroundSprite, Sprite* pogressSprite, Sprite* thumbSprite) -{ - ControlSlider *pRet = new (std::nothrow) ControlSlider(); - pRet->initWithSprites(backgroundSprite, pogressSprite, thumbSprite); - pRet->autorelease(); - return pRet; -} - -ControlSlider* ControlSlider::create(Sprite * backgroundSprite, Sprite* pogressSprite, Sprite* thumbSprite, - Sprite* selectedThumbSprite) -{ - ControlSlider *pRet = new (std::nothrow) ControlSlider(); - pRet->initWithSprites(backgroundSprite, pogressSprite, thumbSprite, selectedThumbSprite); - pRet->autorelease(); - return pRet; -} - -bool ControlSlider::initWithSprites(Sprite * backgroundSprite, Sprite* progressSprite, Sprite* thumbSprite) -{ - Sprite* selectedThumbSprite = Sprite::createWithTexture(thumbSprite->getTexture(), - thumbSprite->getTextureRect()); - selectedThumbSprite->setColor(Color3B::GRAY); - return this->initWithSprites(backgroundSprite, progressSprite, thumbSprite, selectedThumbSprite); -} - - bool ControlSlider::initWithSprites(Sprite * backgroundSprite, Sprite* progressSprite, Sprite* thumbSprite, - Sprite* selectedThumbSprite) - { - if (Control::init()) - { - CCASSERT(backgroundSprite, "Background sprite must be not nil"); - CCASSERT(progressSprite, "Progress sprite must be not nil"); - CCASSERT(thumbSprite, "Thumb sprite must be not nil"); - CCASSERT(selectedThumbSprite, "Thumb sprite must be not nil"); - if (backgroundSprite == nullptr || progressSprite == nullptr || - thumbSprite == nullptr || selectedThumbSprite == nullptr) { - return false; - } - - setIgnoreAnchorPointForPosition(false); - - this->setBackgroundSprite(backgroundSprite); - this->setProgressSprite(progressSprite); - this->setThumbSprite(thumbSprite); - this->setSelectedThumbSprite(selectedThumbSprite); - - // Defines the content size - Rect maxRect = ControlUtils::RectUnion(backgroundSprite->getBoundingBox(), thumbSprite->getBoundingBox()); - - setContentSize(Size(maxRect.size.width, maxRect.size.height)); - - // Add the slider background - _backgroundSprite->setAnchorPoint(Vec2::ANCHOR_MIDDLE); - _backgroundSprite->setPosition(this->getContentSize().width / 2, this->getContentSize().height / 2); - addChild(_backgroundSprite); - - // Add the progress bar - _progressSprite->setAnchorPoint(Vec2::ANCHOR_MIDDLE_LEFT); - _progressSprite->setPosition(0.0f, this->getContentSize().height / 2); - addChild(_progressSprite); - - // Add the slider thumb - _thumbSprite->setPosition(0.0f, this->getContentSize().height / 2); - addChild(_thumbSprite); - - _selectedThumbSprite->setPosition(0.0f, this->getContentSize().height / 2); - _selectedThumbSprite->setVisible(false); - addChild(_selectedThumbSprite); - - // Init default values - _minimumValue = 0.0f; - _maximumValue = 1.0f; - - setValue(_minimumValue); - return true; - } - else - { - return false; - } - } - - -void ControlSlider::setEnabled(bool enabled) -{ - Control::setEnabled(enabled); - if (_thumbSprite != nullptr) - { - _thumbSprite->setOpacity((enabled) ? 255 : 128); - } -} - - void ControlSlider::setValue(float value) - { - // set new value with sentinel - if (value < _minimumValue) - { - value = _minimumValue; - } - - if (value > _maximumValue) - { - value = _maximumValue; - } - - _value = value; - - this->needsLayout(); - - this->sendActionsForControlEvents(Control::EventType::VALUE_CHANGED); - } - - void ControlSlider::setMinimumValue(float minimumValue) - { - _minimumValue=minimumValue; - _minimumAllowedValue = minimumValue; - if (_minimumValue >= _maximumValue) - { - _maximumValue = _minimumValue + 1.0f; - } - setValue(_value); - } - - void ControlSlider::setMaximumValue(float maximumValue) - { - _maximumValue=maximumValue; - _maximumAllowedValue = maximumValue; - if (_maximumValue <= _minimumValue) - { - _minimumValue = _maximumValue - 1.0f; - } - setValue(_value); - } - -bool ControlSlider::isTouchInside(Touch * touch) -{ - Vec2 touchLocation = touch->getLocation(); - touchLocation = this->getParent()->convertToNodeSpace(touchLocation); - - Rect rect = this->getBoundingBox(); - rect.size.width += _thumbSprite->getContentSize().width; - rect.origin.x -= _thumbSprite->getContentSize().width / 2; - - return rect.containsPoint(touchLocation); -} - -Vec2 ControlSlider::locationFromTouch(Touch* touch) -{ - Vec2 touchLocation = touch->getLocation(); // Get the touch position - touchLocation = this->convertToNodeSpace(touchLocation); // Convert to the node space of this class - - if (touchLocation.x < 0) - { - touchLocation.x = 0; - } else if (touchLocation.x > _backgroundSprite->getContentSize().width) - { - touchLocation.x = _backgroundSprite->getContentSize().width; - } - - return touchLocation; -} - - -bool ControlSlider::onTouchBegan(Touch* touch, Event* pEvent) -{ - if (!isTouchInside(touch) || !isEnabled() || !isVisible()) - { - return false; - } - - Vec2 location = locationFromTouch(touch); - sliderBegan(location); - return true; -} - -void ControlSlider::onTouchMoved(Touch *pTouch, Event *pEvent) -{ - Vec2 location = locationFromTouch(pTouch); - sliderMoved(location); -} - -void ControlSlider::onTouchEnded(Touch *pTouch, Event *pEvent) -{ - sliderEnded(Vec2::ZERO); -} - -void ControlSlider::needsLayout() -{ - if (nullptr == _thumbSprite || nullptr == _selectedThumbSprite || nullptr == _backgroundSprite - || nullptr == _progressSprite) - { - return; - } - // Update thumb position for new value - float percent = (_value - _minimumValue) / (_maximumValue - _minimumValue); - - Vec2 pos = _thumbSprite->getPosition(); - pos.x = percent * _backgroundSprite->getContentSize().width; - _thumbSprite->setPosition(pos); - _selectedThumbSprite->setPosition(pos); - - // Stretches content proportional to newLevel - Rect textureRect = _progressSprite->getTextureRect(); - textureRect = Rect(textureRect.origin.x, textureRect.origin.y, pos.x, textureRect.size.height); - _progressSprite->setTextureRect(textureRect, _progressSprite->isTextureRectRotated(), textureRect.size); -} - -void ControlSlider::sliderBegan(const Vec2& location) -{ - this->setSelected(true); - _thumbSprite->setVisible(false); - _selectedThumbSprite->setVisible(true); - setValue(valueForLocation(location)); -} - -void ControlSlider::sliderMoved(const Vec2& location) -{ - setValue(valueForLocation(location)); -} - -void ControlSlider::sliderEnded(const Vec2& location) -{ - if (this->isSelected()) - { - setValue(valueForLocation(_thumbSprite->getPosition())); - } - _thumbSprite->setVisible(true); - _selectedThumbSprite->setVisible(false); - this->setSelected(false); -} - -float ControlSlider::valueForLocation(const Vec2& location) -{ - float percent = location.x/ _backgroundSprite->getContentSize().width; - return MAX(MIN(_minimumValue + percent * (_maximumValue - _minimumValue), _maximumAllowedValue), _minimumAllowedValue); -} - -NS_CC_EXT_END - diff --git a/native/extensions/GUI/CCControlExtension/CCControlSlider.h b/native/extensions/GUI/CCControlExtension/CCControlSlider.h deleted file mode 100644 index f0b4d1b7f8..0000000000 --- a/native/extensions/GUI/CCControlExtension/CCControlSlider.h +++ /dev/null @@ -1,162 +0,0 @@ -/* - * Copyright (c) 2012 cocos2d-x.org - * http://www.cocos2d-x.org - * - * Copyright 2011 Yannick Loriot. All rights reserved. - * http://yannickloriot.com - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * - * Converted to c++ / cocos2d-x by Angus C - */ - - -#ifndef __CCCONTROL_SLIDER_H__ -#define __CCCONTROL_SLIDER_H__ - -#include "CCControl.h" -#include "CCInvocation.h" -#include "extensions/ExtensionExport.h" - -NS_CC_EXT_BEGIN - -/** - * @addtogroup GUI - * @{ - * @addtogroup control_extension - * @{ - */ - -class CC_EX_DLL ControlSlider: public Control -{ -public: - /** - * Creates slider with a background filename, a progress filename and a - * thumb image filename. - */ - static ControlSlider* create(const char* bgFile, const char* progressFile, const char* thumbFile); - - /** - * Creates a slider with a given background sprite and a progress bar and a - * thumb item. - * - * @see initWithSprites - */ - static ControlSlider* create(Sprite * backgroundSprite, Sprite* pogressSprite, Sprite* thumbSprite); - - /** - * Creates slider with a background filename, a progress filename, a thumb - * and a selected thumb image filename. - */ - static ControlSlider* create(const char* bgFile, const char* progressFile, const char* thumbFile, - const char* selectedThumbSpriteFile); - - /** - * Creates a slider with a given background sprite and a progress bar, a thumb - * and a selected thumb . - * - * @see initWithSprites - */ - static ControlSlider* create(Sprite * backgroundSprite, Sprite* pogressSprite, Sprite* thumbSprite, - Sprite* selectedThumbSprite); - /** - * @js ctor - * @lua new - */ - ControlSlider(); - /** - * @js NA - * @lua NA - */ - virtual ~ControlSlider(); - - /** - * Initializes a slider with a background sprite, a progress bar and a thumb - * item. - * - * @param backgroundSprite Sprite, that is used as a background. - * @param progressSprite Sprite, that is used as a progress bar. - * @param thumbSprite Sprite, that is used as a thumb. - */ - virtual bool initWithSprites(Sprite * backgroundSprite, Sprite* progressSprite, Sprite* thumbSprite); - - /** - * Initializes a slider with a background sprite, a progress bar and a thumb - * item. - * - * @param backgroundSprite Sprite, that is used as a background. - * @param progressSprite Sprite, that is used as a progress bar. - * @param thumbSprite Sprite, that is used as a thumb. - * @param selectedThumbSprite Sprite, that is used as a selected thumb. - */ - virtual bool initWithSprites(Sprite * backgroundSprite, Sprite* progressSprite, Sprite* thumbSprite, - Sprite* selectedThumbSprite); - - virtual void needsLayout() override; - - virtual void setMaximumValue(float val); - virtual void setEnabled(bool enabled) override; - virtual bool isTouchInside(Touch * touch) override; - Vec2 locationFromTouch(Touch* touch); - virtual void setValue(float val); - virtual void setMinimumValue(float val); - -protected: - void sliderBegan(const Vec2& location); - void sliderMoved(const Vec2& location); - void sliderEnded(const Vec2& location); - - virtual bool onTouchBegan(Touch* touch, Event* pEvent) override; - virtual void onTouchMoved(Touch *pTouch, Event *pEvent) override; - virtual void onTouchEnded(Touch *pTouch, Event *pEvent) override; - - /** Returns the value for the given location. */ - float valueForLocation(const Vec2& location); - - //maunally put in the setters - /** Contains the receiver's current value. */ - CC_SYNTHESIZE_READONLY(float, _value, Value); - - /** Contains the minimum value of the receiver. - * The default value of this property is 0.0. */ - CC_SYNTHESIZE_READONLY(float, _minimumValue, MinimumValue); - - /** Contains the maximum value of the receiver. - * The default value of this property is 1.0. */ - CC_SYNTHESIZE_READONLY(float, _maximumValue, MaximumValue); - - CC_SYNTHESIZE(float, _minimumAllowedValue, MinimumAllowedValue); - CC_SYNTHESIZE(float, _maximumAllowedValue, MaximumAllowedValue); - - // maybe this should be read-only - CC_SYNTHESIZE_RETAIN(Sprite*, _thumbSprite, ThumbSprite); - CC_SYNTHESIZE_RETAIN(Sprite*, _selectedThumbSprite, SelectedThumbSprite); - CC_SYNTHESIZE_RETAIN(Sprite*, _progressSprite, ProgressSprite); - CC_SYNTHESIZE_RETAIN(Sprite*, _backgroundSprite, BackgroundSprite); - -}; - -// end of GUI group -/// @} -/// @} - -NS_CC_EXT_END - -#endif - diff --git a/native/extensions/GUI/CCControlExtension/CCControlStepper.cpp b/native/extensions/GUI/CCControlExtension/CCControlStepper.cpp deleted file mode 100644 index 41f0979143..0000000000 --- a/native/extensions/GUI/CCControlExtension/CCControlStepper.cpp +++ /dev/null @@ -1,352 +0,0 @@ -/* - * Copyright (c) 2012 cocos2d-x.org - * http://www.cocos2d-x.org - * - * Copyright 2012 Yannick Loriot. All rights reserved. - * http://yannickloriot.com - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT falseT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND falseNINFRINGEMENT. IN false EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * - */ - -#include "CCControlStepper.h" - -NS_CC_EXT_BEGIN - -#define ControlStepperLabelColorEnabled Color3B(55, 55, 55) -#define ControlStepperLabelColorDisabled Color3B(147, 147, 147) - -#define ControlStepperLabelFont "CourierNewPSMT" - - -#define kAutorepeatDeltaTime 0.15f -#define kAutorepeatIncreaseTimeIncrement 12 - -ControlStepper::ControlStepper() -: _value(0.0) -, _continuous(false) -, _autorepeat(false) -, _wraps(false) -, _minimumValue(0.0) -, _maximumValue(0.0) -, _stepValue(0.0) -, _touchInsideFlag(false) -, _touchedPart(Part::NONE) -, _autorepeatCount(0) -, _minusSprite(nullptr) -, _plusSprite(nullptr) -, _minusLabel(nullptr) -, _plusLabel(nullptr) -{ - -} - -ControlStepper::~ControlStepper() -{ - unscheduleAllCallbacks(); - - CC_SAFE_RELEASE(_minusSprite); - CC_SAFE_RELEASE(_plusSprite); - CC_SAFE_RELEASE(_minusLabel); - CC_SAFE_RELEASE(_plusLabel); -} - -bool ControlStepper::initWithMinusSpriteAndPlusSprite(Sprite *minusSprite, Sprite *plusSprite) -{ - if (Control::init()) - { - CCASSERT(minusSprite, "Minus sprite must be not nil"); - CCASSERT(plusSprite, "Plus sprite must be not nil"); - if (minusSprite == nullptr || plusSprite == nullptr) { - return false; - } - - // Set the default values - _autorepeat = true; - _continuous = true; - _minimumValue = 0; - _maximumValue = 100; - _value = 0; - _stepValue = 1; - _wraps = false; - this->setIgnoreAnchorPointForPosition( false ); - - // Add the minus components - this->setMinusSprite(minusSprite); - _minusSprite->setPosition(minusSprite->getContentSize().width / 2, minusSprite->getContentSize().height / 2); - this->addChild(_minusSprite); - - this->setMinusLabel( Label::createWithSystemFont("-", ControlStepperLabelFont, 40)); - _minusLabel->setColor(ControlStepperLabelColorDisabled); - _minusLabel->setAnchorPoint(Vec2::ANCHOR_MIDDLE); - _minusLabel->setPosition(_minusSprite->getContentSize().width / 2, _minusSprite->getContentSize().height / 2); - _minusSprite->addChild(_minusLabel); - - // Add the plus components - this->setPlusSprite( plusSprite ); - _plusSprite->setPosition(minusSprite->getContentSize().width + plusSprite->getContentSize().width / 2, - minusSprite->getContentSize().height / 2); - this->addChild(_plusSprite); - - this->setPlusLabel( Label::createWithSystemFont("+", ControlStepperLabelFont, 40 )); - _plusLabel->setColor( ControlStepperLabelColorEnabled ); - _plusLabel->setAnchorPoint(Vec2::ANCHOR_MIDDLE); - _plusLabel->setPosition(_plusSprite->getContentSize().width / 2, _plusSprite->getContentSize().height / 2); - _plusSprite->addChild(_plusLabel); - - // Defines the content size - Rect maxRect = ControlUtils::RectUnion(_minusSprite->getBoundingBox(), _plusSprite->getBoundingBox()); - this->setContentSize( Size(_minusSprite->getContentSize().width + _plusSprite->getContentSize().height, maxRect.size.height) ); - return true; - } - return false; -} - -ControlStepper* ControlStepper::create(Sprite *minusSprite, Sprite *plusSprite) -{ - ControlStepper* pRet = new (std::nothrow) ControlStepper(); - if (pRet != nullptr && pRet->initWithMinusSpriteAndPlusSprite(minusSprite, plusSprite)) - { - pRet->autorelease(); - } - else - { - CC_SAFE_DELETE(pRet); - } - return pRet; -} - -//// Properties - -void ControlStepper::setWraps(bool wraps) -{ - _wraps = wraps; - - if (_wraps) - { - _minusLabel->setColor( ControlStepperLabelColorEnabled ); - _plusLabel->setColor(ControlStepperLabelColorEnabled ); - } - - this->setValue( _value ); -} - -void ControlStepper::setMinimumValue(double minimumValue) -{ - if (minimumValue >= _maximumValue) - { - CCASSERT(0, "Must be numerically less than maximumValue."); - } - - _minimumValue = minimumValue; - this->setValue( _value ); -} - -void ControlStepper::setMaximumValue(double maximumValue) -{ - if (maximumValue <= _minimumValue) - { - CCASSERT(0, "Must be numerically greater than minimumValue."); - } - - _maximumValue = maximumValue; - this->setValue(_value); -} - -void ControlStepper::setValue(double value) -{ - this->setValueWithSendingEvent(value, true); -} - -double ControlStepper::getValue() const -{ - return _value; -} - -void ControlStepper::setStepValue(double stepValue) -{ - if (stepValue <= 0) - { - CCASSERT(0,"Must be numerically greater than 0."); - } - - _stepValue = stepValue; -} - -bool ControlStepper::isContinuous() const -{ - return _continuous; -} -// -//// ControlStepper Public Methods - -void ControlStepper::setValueWithSendingEvent(double value, bool send) -{ - if (value < _minimumValue) - { - value = _wraps ? _maximumValue : _minimumValue; - } else if (value > _maximumValue) - { - value = _wraps ? _minimumValue : _maximumValue; - } - - _value = value; - - if (!_wraps) - { - _minusLabel->setColor((value == _minimumValue) ? ControlStepperLabelColorDisabled : ControlStepperLabelColorEnabled); - _plusLabel->setColor((value == _maximumValue) ? ControlStepperLabelColorDisabled : ControlStepperLabelColorEnabled); - } - - if (send) - { - this->sendActionsForControlEvents(Control::EventType::VALUE_CHANGED); - } -} - -void ControlStepper::startAutorepeat() -{ - _autorepeatCount = -1; - - this->schedule(CC_SCHEDULE_SELECTOR(ControlStepper::update), kAutorepeatDeltaTime, CC_REPEAT_FOREVER, kAutorepeatDeltaTime * 3); -} - -/** Stop the autorepeat. */ -void ControlStepper::stopAutorepeat() -{ - this->unschedule(CC_SCHEDULE_SELECTOR(ControlStepper::update)); -} - -void ControlStepper::update(float dt) -{ - _autorepeatCount++; - - if ((_autorepeatCount < kAutorepeatIncreaseTimeIncrement) && (_autorepeatCount % 3) != 0) - return; - - if (_touchedPart == Part::MINUS) - { - this->setValueWithSendingEvent(_value - _stepValue, _continuous); - } else if (_touchedPart == Part::PLUS) - { - this->setValueWithSendingEvent(_value + _stepValue, _continuous); - } -} - -//// ControlStepper Private Methods - -void ControlStepper::updateLayoutUsingTouchLocation(const Vec2& location) -{ - if (location.x < _minusSprite->getContentSize().width - && _value > _minimumValue) - { - _touchedPart = Part::MINUS; - - _minusSprite->setColor(Color3B::GRAY); - _plusSprite->setColor(Color3B::WHITE); - } else if (location.x >= _minusSprite->getContentSize().width - && _value < _maximumValue) - { - _touchedPart = Part::PLUS; - - _minusSprite->setColor(Color3B::WHITE); - _plusSprite->setColor(Color3B::GRAY); - } else - { - _touchedPart = Part::NONE; - - _minusSprite->setColor(Color3B::WHITE); - _plusSprite->setColor(Color3B::WHITE); - } -} - - -bool ControlStepper::onTouchBegan(Touch *pTouch, Event *pEvent) -{ - if (!isTouchInside(pTouch) || !isEnabled() || !isVisible()) - { - return false; - } - - Vec2 location = this->getTouchLocation(pTouch); - this->updateLayoutUsingTouchLocation(location); - - _touchInsideFlag = true; - - if (_autorepeat) - { - this->startAutorepeat(); - } - - return true; -} - -void ControlStepper::onTouchMoved(Touch *pTouch, Event *pEvent) -{ - if (this->isTouchInside(pTouch)) - { - Vec2 location = this->getTouchLocation(pTouch); - this->updateLayoutUsingTouchLocation(location); - - if (!_touchInsideFlag) - { - _touchInsideFlag = true; - - if (_autorepeat) - { - this->startAutorepeat(); - } - } - } - else - { - _touchInsideFlag = false; - - _touchedPart = Part::NONE; - - _minusSprite->setColor(Color3B::WHITE); - _plusSprite->setColor(Color3B::WHITE); - - if (_autorepeat) - { - this->stopAutorepeat(); - } - } -} - -void ControlStepper::onTouchEnded(Touch *pTouch, Event *pEvent) -{ - _minusSprite->setColor(Color3B::WHITE); - _plusSprite->setColor(Color3B::WHITE); - - if (_autorepeat) - { - this->stopAutorepeat(); - } - - if (this->isTouchInside(pTouch)) - { - Vec2 location = this->getTouchLocation(pTouch); - - this->setValue(_value + ((location.x < _minusSprite->getContentSize().width) ? (0.0-_stepValue) : _stepValue)); - } -} - -NS_CC_EXT_END - diff --git a/native/extensions/GUI/CCControlExtension/CCControlStepper.h b/native/extensions/GUI/CCControlExtension/CCControlStepper.h deleted file mode 100644 index 9518830bfc..0000000000 --- a/native/extensions/GUI/CCControlExtension/CCControlStepper.h +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Copyright (c) 2012 cocos2d-x.org - * http://www.cocos2d-x.org - * - * Copyright 2012 Yannick Loriot. All rights reserved. - * http://yannickloriot.com - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * - */ - -#ifndef __CCCONTROLSTEPPER_H__ -#define __CCCONTROLSTEPPER_H__ - -#include "CCControl.h" -#include "2d/CCLabel.h" -#include "extensions/ExtensionExport.h" - -NS_CC_EXT_BEGIN - -/** - * @addtogroup GUI - * @{ - * @addtogroup control_extension - * @{ - */ - -class CC_EX_DLL ControlStepper : public Control -{ -public: - enum class Part - { - MINUS, - PLUS, - NONE - }; - - static ControlStepper* create(Sprite *minusSprite, Sprite *plusSprite); - /** - * @js ctor - * @lua new - */ - ControlStepper(); - /** - * @js NA - * @lua NA - */ - virtual ~ControlStepper(); - - bool initWithMinusSpriteAndPlusSprite(Sprite *minusSprite, Sprite *plusSprite); - - virtual void setWraps(bool wraps); - virtual void setMinimumValue(double minimumValue); - virtual void setMaximumValue(double maximumValue); - virtual void setValue(double value); - - virtual double getValue() const; - virtual void setStepValue(double stepValue); - /** Set the numeric value of the stepper. If send is true, the Control::EventType::VALUE_CHANGED is sent. */ - virtual void setValueWithSendingEvent(double value, bool send); - virtual bool isContinuous() const; - - // Overrides - virtual bool onTouchBegan(Touch *pTouch, Event *pEvent) override; - virtual void onTouchMoved(Touch *pTouch, Event *pEvent) override; - virtual void onTouchEnded(Touch *pTouch, Event *pEvent) override; - void update(float dt) override; - - /** Update the layout of the stepper with the given touch location. */ - void updateLayoutUsingTouchLocation(const Vec2& location); - - /** Start the autorepeat increment/decrement. */ - void startAutorepeat(); - - /** Stop the autorepeat. */ - void stopAutorepeat(); - -protected: - /** The numeric value of the stepper. */ - double _value; - /** The continuous vs. noncontinuous state of the stepper. */ - bool _continuous; - /** The automatic vs. nonautomatic repeat state of the stepper. */ - bool _autorepeat; - /** The wrap vs. no-wrap state of the stepper. */ - bool _wraps; - /** The lowest possible numeric value for the stepper. */ - double _minimumValue; - /** The highest possible numeric value for the stepper. */ - double _maximumValue; - /** The step, or increment, value for the stepper. */ - double _stepValue; - bool _touchInsideFlag; - Part _touchedPart; - int _autorepeatCount; - - // Weak links to children - CC_SYNTHESIZE_RETAIN(Sprite*, _minusSprite, MinusSprite) - CC_SYNTHESIZE_RETAIN(Sprite*, _plusSprite, PlusSprite) - CC_SYNTHESIZE_RETAIN(Label*, _minusLabel, MinusLabel) - CC_SYNTHESIZE_RETAIN(Label*, _plusLabel, PlusLabel) -}; - -// end of GUI group -/// @} -/// @} - -NS_CC_EXT_END - -#endif /* __CCCONTROLSTEPPER_H__ */ - diff --git a/native/extensions/GUI/CCControlExtension/CCControlSwitch.cpp b/native/extensions/GUI/CCControlExtension/CCControlSwitch.cpp deleted file mode 100644 index 0a6eeb447d..0000000000 --- a/native/extensions/GUI/CCControlExtension/CCControlSwitch.cpp +++ /dev/null @@ -1,464 +0,0 @@ -/* - * Copyright (c) 2012 cocos2d-x.org - * http://www.cocos2d-x.org - * - * Copyright 2012 Yannick Loriot. All rights reserved. - * http://yannickloriot.com - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * - */ - -#include "CCControlSwitch.h" -#include "2d/CCSprite.h" -#include "2d/CCActionTween.h" -#include "2d/CCLabel.h" -#include "2d/CCClippingNode.h" -#include "renderer/ccShaders.h" -#include "2d/CCRenderTexture.h" - -NS_CC_EXT_BEGIN -// ControlSwitchSprite - -class ControlSwitchSprite : public Sprite, public ActionTweenDelegate -{ -public: - /** creates an autorelease instance of ControlSwitchSprite */ - static ControlSwitchSprite* create( - Sprite *maskSprite, - Sprite *onSprite, - Sprite *offSprite, - Sprite *thumbSprite, - Label* onLabel, - Label* offLabel); - - /** - * @js NA - * @lua NA - */ - void needsLayout(); - /** - * @js NA - * @lua NA - */ - void setSliderXPosition(float sliderXPosition); - /** - * @js NA - * @lua NA - */ - float getSliderXPosition() {return _sliderXPosition;} - /** - * @js NA - * @lua NA - */ - float onSideWidth(); - /** - * @js NA - * @lua NA - */ - float offSideWidth(); - /** - * @js NA - * @lua NA - */ - virtual void updateTweenAction(float value, const std::string& key) override; - -/** Contains the position (in x-axis) of the slider inside the receiver. */ - float _sliderXPosition; - CC_SYNTHESIZE(float, _onPosition, OnPosition) - CC_SYNTHESIZE(float, _offPosition, OffPosition) - - CC_SYNTHESIZE_RETAIN(Texture2D*, _maskTexture, MaskTexture) - CC_SYNTHESIZE(GLuint, _textureLocation, TextureLocation) - CC_SYNTHESIZE(GLuint, _maskLocation, MaskLocation) - - CC_SYNTHESIZE_RETAIN(Sprite*, _onSprite, OnSprite) - CC_SYNTHESIZE_RETAIN(Sprite*, _offSprite, OffSprite) - CC_SYNTHESIZE_RETAIN(Sprite*, _thumbSprite, ThumbSprite) - CC_SYNTHESIZE_RETAIN(Label*, _onLabel, OnLabel) - CC_SYNTHESIZE_RETAIN(Label*, _offLabel, OffLabel) - - Sprite* _clipperStencil; - -protected: - /** - * @js NA - * @lua NA - */ - ControlSwitchSprite(); - /** - * @js NA - * @lua NA - */ - virtual ~ControlSwitchSprite(); - /** - * @js NA - * @lua NA - */ - bool initWithMaskSprite( - Sprite *maskSprite, - Sprite *onSprite, - Sprite *offSprite, - Sprite *thumbSprite, - Label* onLabel, - Label* offLabel); -private: - CC_DISALLOW_COPY_AND_ASSIGN(ControlSwitchSprite); -}; - -ControlSwitchSprite* ControlSwitchSprite::create(Sprite *maskSprite, - Sprite *onSprite, - Sprite *offSprite, - Sprite *thumbSprite, - Label* onLabel, - Label* offLabel) -{ - auto ret = new (std::nothrow) ControlSwitchSprite(); - ret->initWithMaskSprite(maskSprite, onSprite, offSprite, thumbSprite, onLabel, offLabel); - ret->autorelease(); - return ret; -} - -ControlSwitchSprite::ControlSwitchSprite() -: _sliderXPosition(0.0f) -, _onPosition(0.0f) -, _offPosition(0.0f) -, _maskTexture(nullptr) -, _textureLocation(0) -, _maskLocation(0) -, _onSprite(nullptr) -, _offSprite(nullptr) -, _thumbSprite(nullptr) -, _onLabel(nullptr) -, _offLabel(nullptr) -, _clipperStencil(nullptr) -{ - -} - -ControlSwitchSprite::~ControlSwitchSprite() -{ - CC_SAFE_RELEASE(_onSprite); - CC_SAFE_RELEASE(_offSprite); - CC_SAFE_RELEASE(_thumbSprite); - CC_SAFE_RELEASE(_onLabel); - CC_SAFE_RELEASE(_offLabel); - CC_SAFE_RELEASE(_maskTexture); - CC_SAFE_RELEASE(_clipperStencil); -} - -bool ControlSwitchSprite::initWithMaskSprite( - Sprite *maskSprite, - Sprite *onSprite, - Sprite *offSprite, - Sprite *thumbSprite, - Label* onLabel, - Label* offLabel) -{ - if (Sprite::initWithTexture(maskSprite->getTexture())) - { - // Sets the default values - _onPosition = 0; - _offPosition = -onSprite->getContentSize().width + thumbSprite->getContentSize().width / 2; - _sliderXPosition = _onPosition; - - setOnSprite(onSprite); - setOffSprite(offSprite); - setThumbSprite(thumbSprite); - setOnLabel(onLabel); - setOffLabel(offLabel); - - ClippingNode* clipper = ClippingNode::create(); - _clipperStencil = Sprite::createWithTexture(maskSprite->getTexture()); - _clipperStencil->retain(); - clipper->setAlphaThreshold(0.1f); - - clipper->setStencil(_clipperStencil); - - clipper->addChild(onSprite); - clipper->addChild(offSprite); - clipper->addChild(onLabel); - clipper->addChild(offLabel); - clipper->addChild(thumbSprite); - - addChild(clipper); - - // Set up the mask with the Mask shader - setMaskTexture(maskSprite->getTexture()); - - setContentSize(_maskTexture->getContentSize()); - - needsLayout(); - return true; - } - return false; -} - -void ControlSwitchSprite::updateTweenAction(float value, const std::string& key) -{ - CCLOGINFO("key = %s, value = %f", key.c_str(), value); - setSliderXPosition(value); -} - -void ControlSwitchSprite::needsLayout() -{ - _onSprite->setPosition(_onSprite->getContentSize().width / 2 + _sliderXPosition, - _onSprite->getContentSize().height / 2); - _offSprite->setPosition(_onSprite->getContentSize().width + _offSprite->getContentSize().width / 2 + _sliderXPosition, - _offSprite->getContentSize().height / 2); - _thumbSprite->setPosition(_onSprite->getContentSize().width + _sliderXPosition, - _maskTexture->getContentSize().height / 2); - - _clipperStencil->setPosition(_maskTexture->getContentSize().width/2, - _maskTexture->getContentSize().height / 2); - - if (_onLabel) - { - _onLabel->setAnchorPoint(Vec2::ANCHOR_MIDDLE); - _onLabel->setPosition(_onSprite->getPosition().x - _thumbSprite->getContentSize().width / 6, - _onSprite->getContentSize().height / 2); - } - if (_offLabel) - { - _offLabel->setAnchorPoint(Vec2::ANCHOR_MIDDLE); - _offLabel->setPosition(_offSprite->getPosition().x + _thumbSprite->getContentSize().width / 6, - _offSprite->getContentSize().height / 2); - } - - setFlippedY(true); -} - -void ControlSwitchSprite::setSliderXPosition(float sliderXPosition) -{ - if (sliderXPosition <= _offPosition) - { - // Off - sliderXPosition = _offPosition; - } else if (sliderXPosition >= _onPosition) - { - // On - sliderXPosition = _onPosition; - } - - _sliderXPosition = sliderXPosition; - - needsLayout(); -} - - -float ControlSwitchSprite::onSideWidth() -{ - return _onSprite->getContentSize().width; -} - -float ControlSwitchSprite::offSideWidth() -{ - return _offSprite->getContentSize().height; -} - - -// ControlSwitch - -ControlSwitch::ControlSwitch() -: _switchSprite(nullptr) -, _initialTouchXPosition(0.0f) -, _moved(false) -, _on(false) -{ - -} - -ControlSwitch::~ControlSwitch() -{ - CC_SAFE_RELEASE(_switchSprite); -} - -bool ControlSwitch::initWithMaskSprite(Sprite *maskSprite, Sprite * onSprite, Sprite * offSprite, Sprite * thumbSprite) -{ - return initWithMaskSprite(maskSprite, onSprite, offSprite, thumbSprite, nullptr, nullptr); -} - -ControlSwitch* ControlSwitch::create(Sprite *maskSprite, Sprite * onSprite, Sprite * offSprite, Sprite * thumbSprite) -{ - ControlSwitch* pRet = new (std::nothrow) ControlSwitch(); - if (pRet && pRet->initWithMaskSprite(maskSprite, onSprite, offSprite, thumbSprite, nullptr, nullptr)) - { - pRet->autorelease(); - } - else - { - CC_SAFE_DELETE(pRet); - } - return pRet; -} - -bool ControlSwitch::initWithMaskSprite(Sprite *maskSprite, Sprite * onSprite, Sprite * offSprite, Sprite * thumbSprite, Label* onLabel, Label* offLabel) -{ - if (Control::init()) - { - CCASSERT(maskSprite, "Mask must not be nil."); - CCASSERT(onSprite, "onSprite must not be nil."); - CCASSERT(offSprite, "offSprite must not be nil."); - CCASSERT(thumbSprite, "thumbSprite must not be nil."); - if (maskSprite == nullptr || onSprite == nullptr || - offSprite == nullptr || thumbSprite == nullptr) { - return false; - } - - _on = true; - - _switchSprite = ControlSwitchSprite::create(maskSprite, - onSprite, - offSprite, - thumbSprite, - onLabel, - offLabel); - _switchSprite->retain(); - _switchSprite->setPosition(_switchSprite->getContentSize().width / 2, _switchSprite->getContentSize().height / 2); - addChild(_switchSprite); - - setIgnoreAnchorPointForPosition(false); - setAnchorPoint(Vec2::ANCHOR_MIDDLE); - setContentSize(_switchSprite->getContentSize()); - return true; - } - return false; -} - -ControlSwitch* ControlSwitch::create(Sprite *maskSprite, Sprite * onSprite, Sprite * offSprite, Sprite * thumbSprite, Label* onLabel, Label* offLabel) -{ - ControlSwitch* pRet = new (std::nothrow) ControlSwitch(); - if (pRet && pRet->initWithMaskSprite(maskSprite, onSprite, offSprite, thumbSprite, onLabel, offLabel)) - { - pRet->autorelease(); - } - else - { - CC_SAFE_DELETE(pRet); - } - return pRet; -} - -void ControlSwitch::setOn(bool isOn) -{ - setOn(isOn, false); -} - -void ControlSwitch::setOn(bool isOn, bool animated) -{ - _on = isOn; - - if (animated) { - _switchSprite->runAction - ( - ActionTween::create - ( - 0.2f, - "sliderXPosition", - _switchSprite->getSliderXPosition(), - (_on) ? _switchSprite->getOnPosition() : _switchSprite->getOffPosition() - ) - ); - } - else { - _switchSprite->setSliderXPosition((_on) ? _switchSprite->getOnPosition() : _switchSprite->getOffPosition()); - } - - sendActionsForControlEvents(Control::EventType::VALUE_CHANGED); -} - -void ControlSwitch::setEnabled(bool enabled) -{ - _enabled = enabled; - if (_switchSprite != nullptr) - { - _switchSprite->setOpacity((enabled) ? 255 : 128); - } -} - -Vec2 ControlSwitch::locationFromTouch(Touch* pTouch) -{ - Vec2 touchLocation = pTouch->getLocation(); // Get the touch position - touchLocation = this->convertToNodeSpace(touchLocation); // Convert to the node space of this class - - return touchLocation; -} - -bool ControlSwitch::onTouchBegan(Touch *pTouch, Event *pEvent) -{ - if (!isTouchInside(pTouch) || !isEnabled() || !isVisible()) - { - return false; - } - - _moved = false; - - Vec2 location = this->locationFromTouch(pTouch); - - _initialTouchXPosition = location.x - _switchSprite->getSliderXPosition(); - - _switchSprite->getThumbSprite()->setColor(Color3B::GRAY); - _switchSprite->needsLayout(); - - return true; -} - -void ControlSwitch::onTouchMoved(Touch *pTouch, Event *pEvent) -{ - Vec2 location = this->locationFromTouch(pTouch); - location = Vec2(location.x - _initialTouchXPosition, 0); - - _moved = true; - - _switchSprite->setSliderXPosition(location.x); -} - -void ControlSwitch::onTouchEnded(Touch *pTouch, Event *pEvent) -{ - Vec2 location = this->locationFromTouch(pTouch); - - _switchSprite->getThumbSprite()->setColor(Color3B::WHITE); - - if (hasMoved()) - { - setOn(!(location.x < _switchSprite->getContentSize().width / 2), true); - } - else - { - setOn(!_on, true); - } -} - -void ControlSwitch::onTouchCancelled(Touch *pTouch, Event *pEvent) -{ - Vec2 location = this->locationFromTouch(pTouch); - - _switchSprite->getThumbSprite()->setColor(Color3B::WHITE); - - if (hasMoved()) - { - setOn(!(location.x < _switchSprite->getContentSize().width / 2), true); - } else - { - setOn(!_on, true); - } -} - -NS_CC_EXT_END - diff --git a/native/extensions/GUI/CCControlExtension/CCControlSwitch.h b/native/extensions/GUI/CCControlExtension/CCControlSwitch.h deleted file mode 100644 index 29f9ee8573..0000000000 --- a/native/extensions/GUI/CCControlExtension/CCControlSwitch.h +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Copyright (c) 2012 cocos2d-x.org - * http://www.cocos2d-x.org - * - * Copyright 2012 Yannick Loriot. All rights reserved. - * http://yannickloriot.com - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * - */ - -#ifndef __CCCONTROLSWITCH_H__ -#define __CCCONTROLSWITCH_H__ - -#include "CCControl.h" -#include "extensions/ExtensionExport.h" - -namespace cocos2d { class Sprite; } -namespace cocos2d { class Label; } - -NS_CC_EXT_BEGIN - -class ControlSwitchSprite; - -/** - * @addtogroup GUI - * @{ - * @addtogroup control_extension - * @{ - */ - -/** @class ControlSwitch Switch control for Cocos2D. */ -class CC_EX_DLL ControlSwitch : public Control -{ -public: - /** Creates a switch with a mask sprite, on/off sprites for on/off states, a thumb sprite and an on/off labels. */ - static ControlSwitch* create(Sprite *maskSprite, Sprite * onSprite, Sprite * offSprite, Sprite * thumbSprite, Label* onLabel, Label* offLabel); - /** Creates a switch with a mask sprite, on/off sprites for on/off states and a thumb sprite. */ - static ControlSwitch* create(Sprite *maskSprite, Sprite * onSprite, Sprite * offSprite, Sprite * thumbSprite); - /** - * @js ctor - * @lua new - */ - ControlSwitch(); - /** - * @js NA - * @lua NA - */ - virtual ~ControlSwitch(); - - /** Initializes a switch with a mask sprite, on/off sprites for on/off states and a thumb sprite. */ - bool initWithMaskSprite(Sprite *maskSprite, Sprite * onSprite, Sprite * offSprite, Sprite * thumbSprite); - /** Initializes a switch with a mask sprite, on/off sprites for on/off states, a thumb sprite and an on/off labels. */ - bool initWithMaskSprite(Sprite *maskSprite, Sprite * onSprite, Sprite * offSprite, Sprite * thumbSprite, Label* onLabel, Label* offLabel); - - /** - * Set the state of the switch to On or Off, optionally animating the transition. - * - * @param isOn YES if the switch should be turned to the On position; NO if it - * should be turned to the Off position. If the switch is already in the - * designated position, nothing happens. - * @param animated YES to animate the "flipping" of the switch; otherwise NO. - */ - void setOn(bool isOn, bool animated); - void setOn(bool isOn); - bool isOn(void) const { return _on; } - bool hasMoved() const { return _moved; } - virtual void setEnabled(bool enabled) override; - - Vec2 locationFromTouch(Touch* touch); - - // Overrides - virtual bool onTouchBegan(Touch *pTouch, Event *pEvent) override; - virtual void onTouchMoved(Touch *pTouch, Event *pEvent) override; - virtual void onTouchEnded(Touch *pTouch, Event *pEvent) override; - virtual void onTouchCancelled(Touch *pTouch, Event *pEvent) override; - -protected: - /** Sprite which represents the view. */ - ControlSwitchSprite* _switchSprite; - float _initialTouchXPosition; - - bool _moved; - /** A Boolean value that determines the off/on state of the switch. */ - bool _on; -}; - -// end of GUI group -/// @} -/// @} - -NS_CC_EXT_END - -#endif /* __CCCONTROLSWITCH_H__ */ - diff --git a/native/extensions/GUI/CCControlExtension/CCControlUtils.cpp b/native/extensions/GUI/CCControlExtension/CCControlUtils.cpp deleted file mode 100644 index 4fc297d9cd..0000000000 --- a/native/extensions/GUI/CCControlExtension/CCControlUtils.cpp +++ /dev/null @@ -1,172 +0,0 @@ -/**************************************************************************** -Copyright (c) 2012 cocos2d-x.org - -http://www.cocos2d-x.org - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -****************************************************************************/ - -#include "CCControlUtils.h" - -NS_CC_EXT_BEGIN - -Sprite* ControlUtils::addSpriteToTargetWithPosAndAnchor(const char* spriteName, Node * target, const Vec2& pos, const Vec2& anchor) -{ - Sprite *sprite =Sprite::createWithSpriteFrameName(spriteName); - - if (!sprite) - return nullptr; - - sprite->setPosition(pos); - sprite->setAnchorPoint(anchor); - target->addChild(sprite); - - return sprite; -} - - -HSV ControlUtils::HSVfromRGB(RGBA value) -{ - HSV out; - double min, max, delta; - - min = value.r < value.g ? value.r : value.g; - min = min < value.b ? min : value.b; - - max = value.r > value.g ? value.r : value.g; - max = max > value.b ? max : value.b; - - out.v = max; // v - delta = max - min; - if( max > 0.0 ) - { - out.s = (delta / max); // s - } else - { - // r = g = b = 0 // s = 0, v is undefined - out.s = 0.0; - out.h = -1; // its now undefined (don't know if setting to NAN is a good idea) - return out; - } - if( value.r >= max ) // > is bogus, just keeps compilor happy - { - out.h = ( value.g - value.b ) / delta; // between yellow & magenta - } else - { - if( value.g >= max ) - out.h = 2.0 + ( value.b - value.r ) / delta; // between cyan & yellow - else - out.h = 4.0 + ( value.r - value.g ) / delta; // between magenta & cyan - } - - out.h *= 60.0; // degrees - - if( out.h < 0.0 ) - out.h += 360.0; - - return out; -} - -RGBA ControlUtils::RGBfromHSV(HSV value) -{ - double hh, p, q, t, ff; - long i; - RGBA out; - out.a = 1; - - if (value.s <= 0.0) // < is bogus, just shuts up warnings - { - if (std::isnan(value.h)) // value.h == NAN - { - out.r = value.v; - out.g = value.v; - out.b = value.v; - return out; - } - - // error - should never happen - out.r = 0.0; - out.g = 0.0; - out.b = 0.0; - return out; - } - - hh = value.h; - if(hh >= 360.0) hh = 0.0; - hh /= 60.0; - i = (long)hh; - ff = hh - i; - p = value.v * (1.0 - value.s); - q = value.v * (1.0 - (value.s * ff)); - t = value.v * (1.0 - (value.s * (1.0 - ff))); - - switch(i) - { - case 0: - out.r = value.v; - out.g = t; - out.b = p; - break; - case 1: - out.r = q; - out.g = value.v; - out.b = p; - break; - case 2: - out.r = p; - out.g = value.v; - out.b = t; - break; - - case 3: - out.r = p; - out.g = q; - out.b = value.v; - break; - case 4: - out.r = t; - out.g = p; - out.b = value.v; - break; - case 5: - default: - out.r = value.v; - out.g = p; - out.b = q; - break; - } - return out; -} - -Rect ControlUtils::RectUnion(const Rect& src1, const Rect& src2) -{ - Rect result; - - float x1 = MIN(src1.getMinX(), src2.getMinX()); - float y1 = MIN(src1.getMinY(), src2.getMinY()); - float x2 = MAX(src1.getMaxX(), src2.getMaxX()); - float y2 = MAX(src1.getMaxY(), src2.getMaxY()); - - result.origin=Vec2(x1,y1); - result.size=Size(x2-x1, y2-y1); - return result; -} - -NS_CC_EXT_END - diff --git a/native/extensions/GUI/CCControlExtension/CCControlUtils.h b/native/extensions/GUI/CCControlExtension/CCControlUtils.h deleted file mode 100644 index 179676d469..0000000000 --- a/native/extensions/GUI/CCControlExtension/CCControlUtils.h +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Copyright (c) 2012 cocos2d-x.org - * http://www.cocos2d-x.org - * - * - * Copyright 2012 Stewart Hamilton-Arrandale. - * http://creativewax.co.uk - * - * Modified by Yannick Loriot. - * http://yannickloriot.com - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * - * - * Converted to c++ / cocos2d-x by Angus C - */ - -#ifndef __CCCONTROL_UTILS_H__ -#define __CCCONTROL_UTILS_H__ - -#include "2d/CCSprite.h" -#include "../../ExtensionMacros.h" -#include "extensions/ExtensionExport.h" - -NS_CC_EXT_BEGIN - -typedef struct -{ - double r; // percent - double g; // percent - double b; // percent - double a; // percent -} RGBA; - -typedef struct -{ - double h; // angle in degrees - double s; // percent - double v; // percent -} HSV; - -/** - * @addtogroup GUI - * @{ - * @addtogroup control_extension - * @{ - */ - -//helper class to store Color3B's in mutable arrays -class CC_EX_DLL Color3bObject : public Ref -{ -public: - Color3B value; - /** - * @js NA - * @lua NA - */ - Color3bObject(Color3B s_value):value(s_value){} -}; - -class CC_EX_DLL ControlUtils -{ -public: - /** - * @js NA - * @lua NA - */ - static Sprite* addSpriteToTargetWithPosAndAnchor(const char* spriteName, Node * target, const Vec2& pos, const Vec2& anchor); - /** - * @js NA - * @lua NA - */ - static HSV HSVfromRGB(RGBA value); - /** - * @js NA - * @lua NA - */ - static RGBA RGBfromHSV(HSV value); - /** - * @js NA - * @lua NA - */ - static Rect RectUnion(const Rect& src1, const Rect& src2); -}; - -// end of GUI group -/// @} -/// @} - -NS_CC_EXT_END - -#endif - diff --git a/native/extensions/GUI/CCControlExtension/CCInvocation.cpp b/native/extensions/GUI/CCControlExtension/CCInvocation.cpp deleted file mode 100644 index ddeac12b0a..0000000000 --- a/native/extensions/GUI/CCControlExtension/CCInvocation.cpp +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2012 cocos2d-x.org - * http://www.cocos2d-x.org - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * - * - * Converted to c++ / cocos2d-x by Angus C - */ - -#include "CCInvocation.h" - -NS_CC_EXT_BEGIN - -Invocation* Invocation::create(Ref* target, Control::Handler action, Control::EventType controlEvent) -{ - Invocation* pRet = new (std::nothrow) Invocation(target, action, controlEvent); - if (pRet != nullptr) - { - pRet->autorelease(); - } - return pRet; -} - -Invocation::Invocation(Ref* target, Control::Handler action, Control::EventType controlEvent) -{ - _target=target; - _action=action; - _controlEvent=controlEvent; -} - -void Invocation::invoke(Ref* sender) -{ - if (_target && _action) - { - (_target->*_action)(sender, _controlEvent); - } -} - -NS_CC_EXT_END - diff --git a/native/extensions/GUI/CCControlExtension/CCInvocation.h b/native/extensions/GUI/CCControlExtension/CCInvocation.h deleted file mode 100644 index 8ed1f4edcf..0000000000 --- a/native/extensions/GUI/CCControlExtension/CCInvocation.h +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (c) 2012 cocos2d-x.org - * http://www.cocos2d-x.org - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * - * - * Converted to c++ / cocos2d-x by Angus C - */ -/* - * - * Helper class to store targets and selectors (and eventually, params?) in the same MutableArray. Basically a very crude form of a NSInvocation - */ -#ifndef __CCINVOCATION_H__ -#define __CCINVOCATION_H__ - -#include "base/CCRef.h" -#include "../../ExtensionMacros.h" -#include "extensions/ExtensionExport.h" -#include "CCControl.h" - -NS_CC_EXT_BEGIN - -/** - * @addtogroup GUI - * @{ - * @addtogroup control_extension - * @{ - */ - -#define cccontrol_selector(_SELECTOR) static_cast(&_SELECTOR) - -class CC_EX_DLL Invocation : public Ref -{ -public: - /** - * @js NA - * @lua NA - */ - static Invocation* create(Ref* target, Control::Handler action, Control::EventType controlEvent); - /** - * @js NA - * @lua NA - */ - Invocation(Ref* target, Control::Handler action, Control::EventType controlEvent); - /** - * @js NA - * @lua NA - */ - void invoke(Ref* sender); - -protected: - CC_SYNTHESIZE_READONLY(Control::Handler, _action, Action); - CC_SYNTHESIZE_READONLY(Ref*, _target, Target); - CC_SYNTHESIZE_READONLY(Control::EventType, _controlEvent, ControlEvent); -}; - -// end of GUI group -/// @} -/// @} - -NS_CC_EXT_END - -#endif - diff --git a/native/extensions/GUI/CCScrollView/CCScrollView.cpp b/native/extensions/GUI/CCScrollView/CCScrollView.cpp deleted file mode 100644 index cb4378d5ff..0000000000 --- a/native/extensions/GUI/CCScrollView/CCScrollView.cpp +++ /dev/null @@ -1,888 +0,0 @@ -/**************************************************************************** - Copyright (c) 2012 cocos2d-x.org - Copyright (c) 2010 Sangwoo Im - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#include "CCScrollView.h" -#include "platform/CCDevice.h" -#include "2d/CCActionInstant.h" -#include "2d/CCActionInterval.h" -#include "2d/CCActionTween.h" -#include "base/CCDirector.h" -#include "base/CCEventDispatcher.h" -#include "renderer/CCRenderer.h" - -#include - -NS_CC_EXT_BEGIN - -#define SCROLL_DEACCEL_RATE 0.95f -#define SCROLL_DEACCEL_DIST 1.0f -#define BOUNCE_DURATION 0.15f -#define INSET_RATIO 0.2f -#define MOVE_INCH 7.0f/160.0f -#define BOUNCE_BACK_FACTOR 0.35f - -static float convertDistanceFromPointToInch(float pointDis) -{ - auto glview = Director::getInstance()->getOpenGLView(); - float factor = ( glview->getScaleX() + glview->getScaleY() ) / 2; - return pointDis * factor / Device::getDPI(); -} - - -ScrollView::ScrollView() -: _delegate(nullptr) -, _direction(Direction::BOTH) -, _dragging(false) -, _container(nullptr) -, _touchMoved(false) -, _bounceable(false) -, _clippingToBounds(false) -, _touchLength(0.0f) -, _minScale(0.0f) -, _maxScale(0.0f) -, _scissorRestored(false) -, _touchListener(nullptr) -, _animatedScrollAction(nullptr) -{ - -} - -ScrollView::~ScrollView() -{ - -} - -ScrollView* ScrollView::create(const Size& size, Node* container/* = nullptr*/) -{ - ScrollView* pRet = new (std::nothrow) ScrollView(); - if (pRet && pRet->initWithViewSize(size, container)) - { - pRet->autorelease(); - } - else - { - CC_SAFE_DELETE(pRet); - } - return pRet; -} - -ScrollView* ScrollView::create() -{ - ScrollView* pRet = new (std::nothrow) ScrollView(); - if (pRet && pRet->init()) - { - pRet->autorelease(); - } - else - { - CC_SAFE_DELETE(pRet); - } - return pRet; -} - - -bool ScrollView::initWithViewSize(const Size& size, Node *container/* = nullptr*/) -{ - if (Layer::init()) - { - _container = container; - - if (!this->_container) - { - _container = Layer::create(); - _container->setIgnoreAnchorPointForPosition(false); - _container->setAnchorPoint(Vec2::ANCHOR_BOTTOM_LEFT); - } - - this->setViewSize(size); - - setTouchEnabled(true); - - _touches.reserve(EventTouch::MAX_TOUCHES); - - _delegate = nullptr; - _bounceable = true; - _clippingToBounds = true; - //_container->setContentSize(Size::ZERO); - _direction = Direction::BOTH; - _container->setPosition(0.0f, 0.0f); - _touchLength = 0.0f; - - this->addChild(_container); - _minScale = _maxScale = 1.0f; - - - return true; - } - return false; -} - -bool ScrollView::init() -{ - return this->initWithViewSize(Size(200, 200), nullptr); -} - -bool ScrollView::isNodeVisible(Node* node) -{ - const Vec2 offset = this->getContentOffset(); - const Size size = this->getViewSize(); - const float scale = this->getZoomScale(); - - Rect viewRect; - - viewRect = Rect(-offset.x/scale, -offset.y/scale, size.width/scale, size.height/scale); - - return viewRect.intersectsRect(node->getBoundingBox()); -} - -void ScrollView::pause(Ref* sender) -{ - _container->pause(); - - auto& children = _container->getChildren(); - for(const auto &child : children) { - child->pause(); - } -} - -void ScrollView::resume(Ref* sender) -{ - auto& children = _container->getChildren(); - for(const auto &child : children) { - child->resume(); - } - - _container->resume(); -} - -bool ScrollView::isTouchEnabled() const -{ - return _touchListener != nullptr; -} - -void ScrollView::setTouchEnabled(bool enabled) -{ - _eventDispatcher->removeEventListener(_touchListener); - _touchListener = nullptr; - - if (enabled) - { - _touchListener = EventListenerTouchOneByOne::create(); - _touchListener->setSwallowTouches(true); - _touchListener->onTouchBegan = CC_CALLBACK_2(ScrollView::onTouchBegan, this); - _touchListener->onTouchMoved = CC_CALLBACK_2(ScrollView::onTouchMoved, this); - _touchListener->onTouchEnded = CC_CALLBACK_2(ScrollView::onTouchEnded, this); - _touchListener->onTouchCancelled = CC_CALLBACK_2(ScrollView::onTouchCancelled, this); - - _eventDispatcher->addEventListenerWithSceneGraphPriority(_touchListener, this); - } - else - { - _dragging = false; - _touchMoved = false; - _touches.clear(); - } -} - -void ScrollView::setContentOffset(Vec2 offset, bool animated/* = false*/) -{ - if (animated) - { //animate scrolling - this->setContentOffsetInDuration(offset, BOUNCE_DURATION); - } - else - { //set the container position directly - if (!_bounceable) - { - const Vec2 minOffset = this->minContainerOffset(); - const Vec2 maxOffset = this->maxContainerOffset(); - - offset.x = MAX(minOffset.x, MIN(maxOffset.x, offset.x)); - offset.y = MAX(minOffset.y, MIN(maxOffset.y, offset.y)); - } - - _container->setPosition(offset); - - if (_delegate != nullptr) - { - _delegate->scrollViewDidScroll(this); - } - } -} - -void ScrollView::setContentOffsetInDuration(const Vec2& offset, float dt) -{ - FiniteTimeAction *scroll, *expire; - if (_animatedScrollAction) { - stopAnimatedContentOffset(); - } - - scroll = MoveTo::create(dt, offset); - expire = CallFuncN::create(CC_CALLBACK_1(ScrollView::stoppedAnimatedScroll,this)); - _animatedScrollAction = _container->runAction(Sequence::create(scroll, expire, nullptr)); - this->schedule(CC_SCHEDULE_SELECTOR(ScrollView::performedAnimatedScroll)); -} - -void ScrollView::stopAnimatedContentOffset() -{ - stopAction(_animatedScrollAction); - _animatedScrollAction = nullptr; - stoppedAnimatedScroll(this); -} - -Vec2 ScrollView::getContentOffset() -{ - return _container->getPosition(); -} - -void ScrollView::setZoomScale(float s) -{ - if (_container->getScale() != s) - { - Vec2 oldCenter, newCenter; - Vec2 center; - - if (_touchLength == 0.0f) - { - center.set(_viewSize.width*0.5f, _viewSize.height*0.5f); - center = this->convertToWorldSpace(center); - } - else - { - center = _touchPoint; - } - - oldCenter = _container->convertToNodeSpace(center); - _container->setScale(MAX(_minScale, MIN(_maxScale, s))); - newCenter = _container->convertToWorldSpace(oldCenter); - - const Vec2 offset = center - newCenter; - if (_delegate != nullptr) - { - _delegate->scrollViewDidZoom(this); - } - this->setContentOffset(_container->getPosition() + offset); - } -} - -float ScrollView::getZoomScale() -{ - return _container->getScale(); -} - -void ScrollView::setZoomScale(float s, bool animated) -{ - if (animated) - { - this->setZoomScaleInDuration(s, BOUNCE_DURATION); - } - else - { - this->setZoomScale(s); - } -} - -void ScrollView::setZoomScaleInDuration(float s, float dt) -{ - if (dt > 0) - { - if (_container->getScale() != s) - { - ActionTween *scaleAction; - scaleAction = ActionTween::create(dt, "zoomScale", _container->getScale(), s); - this->runAction(scaleAction); - } - } - else - { - this->setZoomScale(s); - } -} - -void ScrollView::updateTweenAction(float value, const std::string& key) -{ - this->setZoomScale(value); -} - -void ScrollView::setViewSize(const Size& size) -{ - _viewSize = size; - Layer::setContentSize(size); -} - -Node * ScrollView::getContainer() -{ - return this->_container; -} - -void ScrollView::setContainer(Node * pContainer) -{ - // Make sure that '_container' has a non-nullptr value since there are - // lots of logic that use '_container'. - if (nullptr == pContainer) - return; - - this->removeAllChildrenWithCleanup(true); - this->_container = pContainer; - - this->_container->setIgnoreAnchorPointForPosition(false); - this->_container->setAnchorPoint(Vec2::ANCHOR_BOTTOM_LEFT); - - this->addChild(this->_container); - - this->setViewSize(this->_viewSize); -} - -bool ScrollView::hasVisibleParents() const -{ - auto parent = this->getParent(); - for( auto c = parent; c != nullptr; c = c->getParent() ) - { - if( !c->isVisible() ) - { - return false; - } - } - return true; -} - -void ScrollView::relocateContainer(bool animated) -{ - Vec2 oldPoint, min, max; - float newX, newY; - - min = this->minContainerOffset(); - max = this->maxContainerOffset(); - - oldPoint = _container->getPosition(); - - newX = oldPoint.x; - newY = oldPoint.y; - if (_direction == Direction::BOTH || _direction == Direction::HORIZONTAL) - { - newX = MAX(newX, min.x); - newX = MIN(newX, max.x); - } - - if (_direction == Direction::BOTH || _direction == Direction::VERTICAL) - { - newY = MIN(newY, max.y); - newY = MAX(newY, min.y); - } - - if (newY != oldPoint.y || newX != oldPoint.x) - { - this->setContentOffset(Vec2(newX, newY), animated); - } -} - -Vec2 ScrollView::maxContainerOffset() -{ - Point anchorPoint = _container->isIgnoreAnchorPointForPosition()?Point::ZERO:_container->getAnchorPoint(); - float contW = _container->getContentSize().width * _container->getScaleX(); - float contH = _container->getContentSize().height * _container->getScaleY(); - - return Vec2(anchorPoint.x * contW, anchorPoint.y * contH); -} - -Vec2 ScrollView::minContainerOffset() -{ - Point anchorPoint = _container->isIgnoreAnchorPointForPosition()?Point::ZERO:_container->getAnchorPoint(); - float contW = _container->getContentSize().width * _container->getScaleX(); - float contH = _container->getContentSize().height * _container->getScaleY(); - - return Vec2(_viewSize.width - (1 - anchorPoint.x) * contW, _viewSize.height - (1 - anchorPoint.y) * contH); -} - -void ScrollView::deaccelerateScrolling(float dt) -{ - if (_dragging) - { - this->unschedule(CC_SCHEDULE_SELECTOR(ScrollView::deaccelerateScrolling)); - return; - } - - float newX, newY; - Vec2 maxInset, minInset; - - _container->setPosition(_container->getPosition() + _scrollDistance); - - if (_bounceable) - { - maxInset = _maxInset; - minInset = _minInset; - } - else - { - maxInset = this->maxContainerOffset(); - minInset = this->minContainerOffset(); - } - - newX = _container->getPosition().x; - newY = _container->getPosition().y; - - _scrollDistance = _scrollDistance * SCROLL_DEACCEL_RATE; - this->setContentOffset(Vec2(newX,newY)); - - if ((fabsf(_scrollDistance.x) <= SCROLL_DEACCEL_DIST && - fabsf(_scrollDistance.y) <= SCROLL_DEACCEL_DIST) || - ((_direction == Direction::BOTH || _direction == Direction::VERTICAL) && (newY >= maxInset.y || newY <= minInset.y)) || - ((_direction == Direction::BOTH || _direction == Direction::HORIZONTAL) && (newX >= maxInset.x || newX <= minInset.x))) - { - this->unschedule(CC_SCHEDULE_SELECTOR(ScrollView::deaccelerateScrolling)); - this->relocateContainer(true); - } -} - -void ScrollView::stoppedAnimatedScroll(Node * node) -{ - this->unschedule(CC_SCHEDULE_SELECTOR(ScrollView::performedAnimatedScroll)); - // After the animation stopped, "scrollViewDidScroll" should be invoked, this could fix the bug of lack of tableview cells. - if (_delegate != nullptr) - { - _delegate->scrollViewDidScroll(this); - } -} - -void ScrollView::performedAnimatedScroll(float dt) -{ - if (_dragging) - { - this->unschedule(CC_SCHEDULE_SELECTOR(ScrollView::performedAnimatedScroll)); - return; - } - - if (_delegate != nullptr) - { - _delegate->scrollViewDidScroll(this); - } -} - - -const Size& ScrollView::getContentSize() const -{ - return _container->getContentSize(); -} - -void ScrollView::setContentSize(const Size & size) -{ - if (this->getContainer() != nullptr) - { - this->getContainer()->setContentSize(size); - this->updateInset(); - } -} - -void ScrollView::updateInset() -{ - if (this->getContainer() != nullptr) - { - _maxInset = this->maxContainerOffset(); - _maxInset.set(_maxInset.x + _viewSize.width * INSET_RATIO, - _maxInset.y + _viewSize.height * INSET_RATIO); - _minInset = this->minContainerOffset(); - _minInset.set(_minInset.x - _viewSize.width * INSET_RATIO, - _minInset.y - _viewSize.height * INSET_RATIO); - } -} - -/** - * make sure all children go to the container - */ -void ScrollView::addChild(Node * child, int zOrder, int tag) -{ - if (_container != child) { - _container->addChild(child, zOrder, tag); - } else { - Layer::addChild(child, zOrder, tag); - } -} - -void ScrollView::removeChild(Node* node, bool cleanup) -{ - if(_container != node) - { - _container->removeChild(node, cleanup); - } - else - { - Layer::removeChild(node, cleanup); - } -} - -void ScrollView::removeAllChildrenWithCleanup(bool cleanup) -{ - _container->removeAllChildrenWithCleanup(cleanup); - Layer::removeAllChildrenWithCleanup(cleanup); -} - -void ScrollView::removeAllChildren() -{ - removeAllChildrenWithCleanup(true); -} - -void ScrollView::addChild(Node * child, int zOrder, const std::string &name) -{ - if (_container != child) - { - _container->addChild(child, zOrder, name); - } - else - { - Layer::addChild(child, zOrder, name); - } -} - -void ScrollView::beforeDraw() -{ - //ScrollView don't support drawing in 3D space - _beforeDrawCommand.init(_globalZOrder); - _beforeDrawCommand.func = CC_CALLBACK_0(ScrollView::onBeforeDraw, this); - Director::getInstance()->getRenderer()->addCommand(&_beforeDrawCommand); -} - -/** - * clip this view so that outside of the visible bounds can be hidden. - */ -void ScrollView::onBeforeDraw() -{ - if (_clippingToBounds) - { - _scissorRestored = false; - Rect frame = getViewRect(); - auto glview = Director::getInstance()->getOpenGLView(); - - if (glview->isScissorEnabled()) { - _scissorRestored = true; - _parentScissorRect = glview->getScissorRect(); - //set the intersection of _parentScissorRect and frame as the new scissor rect - if (frame.intersectsRect(_parentScissorRect)) { - float x = MAX(frame.origin.x, _parentScissorRect.origin.x); - float y = MAX(frame.origin.y, _parentScissorRect.origin.y); - float xx = MIN(frame.origin.x+frame.size.width, _parentScissorRect.origin.x+_parentScissorRect.size.width); - float yy = MIN(frame.origin.y+frame.size.height, _parentScissorRect.origin.y+_parentScissorRect.size.height); - glview->setScissorInPoints(x, y, xx-x, yy-y); - } - } - else { - glEnable(GL_SCISSOR_TEST); - glview->setScissorInPoints(frame.origin.x, frame.origin.y, frame.size.width, frame.size.height); - } - } -} - -void ScrollView::afterDraw() -{ - _afterDrawCommand.init(_globalZOrder); - _afterDrawCommand.func = CC_CALLBACK_0(ScrollView::onAfterDraw, this); - Director::getInstance()->getRenderer()->addCommand(&_afterDrawCommand); -} - -/** - * retract what's done in beforeDraw so that there's no side effect to - * other nodes. - */ -void ScrollView::onAfterDraw() -{ - if (_clippingToBounds) - { - if (_scissorRestored) {//restore the parent's scissor rect - auto glview = Director::getInstance()->getOpenGLView(); - - glview->setScissorInPoints(_parentScissorRect.origin.x, _parentScissorRect.origin.y, _parentScissorRect.size.width, _parentScissorRect.size.height); - } - else { - glDisable(GL_SCISSOR_TEST); - } - } -} - -void ScrollView::visit(Renderer *renderer, const Mat4 &parentTransform, uint32_t parentFlags) -{ - // quick return if not visible - if (!isVisible()) - { - return; - } - - uint32_t flags = processParentFlags(parentTransform, parentFlags); - - // IMPORTANT: - // To ease the migration to v3.0, we still support the Mat4 stack, - // but it is deprecated and your code should not rely on it - Director* director = Director::getInstance(); - CCASSERT(nullptr != director, "Director is null when setting matrix stack"); - director->pushMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW); - director->loadMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW, _modelViewTransform); - - this->beforeDraw(); - - if (!_children.empty()) - { - int i=0; - - // draw children zOrder < 0 - for( ; i < _children.size(); i++ ) - { - Node *child = _children.at(i); - if ( child->getLocalZOrder() < 0 ) - { - child->visit(renderer, _modelViewTransform, flags); - } - else - { - break; - } - } - - // this draw - this->draw(renderer, _modelViewTransform, flags); - - // draw children zOrder >= 0 - for( ; i < _children.size(); i++ ) - { - Node *child = _children.at(i); - child->visit(renderer, _modelViewTransform, flags); - } - } - else - { - this->draw(renderer, _modelViewTransform, flags); - } - - this->afterDraw(); - - director->popMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW); -} - -bool ScrollView::onTouchBegan(Touch* touch, Event* event) -{ - if (!this->isVisible() || !this->hasVisibleParents()) - { - return false; - } - - Rect frame = getViewRect(); - - //dispatcher does not know about clipping. reject touches outside visible bounds. - if (_touches.size() > 2 || - _touchMoved || - !frame.containsPoint(touch->getLocation())) - { - return false; - } - - if (std::find(_touches.begin(), _touches.end(), touch) == _touches.end()) - { - _touches.push_back(touch); - } - - if (_touches.size() == 1) - { // scrolling - _touchPoint = this->convertTouchToNodeSpace(touch); - _touchMoved = false; - _dragging = true; //dragging started - _scrollDistance.setZero(); - _touchLength = 0.0f; - } - else if (_touches.size() == 2) - { - _touchPoint = (this->convertTouchToNodeSpace(_touches[0]).getMidpoint( - this->convertTouchToNodeSpace(_touches[1]))); - - _touchLength = _container->convertTouchToNodeSpace(_touches[0]).getDistance( - _container->convertTouchToNodeSpace(_touches[1])); - - _dragging = false; - } - return true; -} - -void ScrollView::onTouchMoved(Touch* touch, Event* event) -{ - if (!this->isVisible()) - { - return; - } - - if (std::find(_touches.begin(), _touches.end(), touch) != _touches.end()) - { - if (_touches.size() == 1 && _dragging) - { // scrolling - Vec2 moveDistance, newPoint; - Rect frame; - float newX, newY; - - frame = getViewRect(); - - newPoint = this->convertTouchToNodeSpace(_touches[0]); - moveDistance = newPoint - _touchPoint; - - float dis = 0.0f; - if (_direction == Direction::VERTICAL) - { - dis = moveDistance.y; - float pos = _container->getPosition().y; - if (!(minContainerOffset().y <= pos && pos <= maxContainerOffset().y)) { - moveDistance.y *= BOUNCE_BACK_FACTOR; - } - } - else if (_direction == Direction::HORIZONTAL) - { - dis = moveDistance.x; - float pos = _container->getPosition().x; - if (!(minContainerOffset().x <= pos && pos <= maxContainerOffset().x)) { - moveDistance.x *= BOUNCE_BACK_FACTOR; - } - } - else - { - dis = sqrtf(moveDistance.x*moveDistance.x + moveDistance.y*moveDistance.y); - - float pos = _container->getPosition().y; - if (!(minContainerOffset().y <= pos && pos <= maxContainerOffset().y)) { - moveDistance.y *= BOUNCE_BACK_FACTOR; - } - - pos = _container->getPosition().x; - if (!(minContainerOffset().x <= pos && pos <= maxContainerOffset().x)) { - moveDistance.x *= BOUNCE_BACK_FACTOR; - } - } - - if (!_touchMoved && fabs(convertDistanceFromPointToInch(dis)) < MOVE_INCH ) - { - //CCLOG("Invalid movement, distance = [%f, %f], disInch = %f", moveDistance.x, moveDistance.y); - return; - } - - if (!_touchMoved) - { - moveDistance.setZero(); - } - - _touchPoint = newPoint; - _touchMoved = true; - - if (_dragging) - { - switch (_direction) - { - case Direction::VERTICAL: - moveDistance.set(0.0f, moveDistance.y); - break; - case Direction::HORIZONTAL: - moveDistance.set(moveDistance.x, 0.0f); - break; - default: - break; - } - - newX = _container->getPosition().x + moveDistance.x; - newY = _container->getPosition().y + moveDistance.y; - - _scrollDistance = moveDistance; - this->setContentOffset(Vec2(newX, newY)); - } - } - else if (_touches.size() == 2 && !_dragging) - { - const float len = _container->convertTouchToNodeSpace(_touches[0]).getDistance( - _container->convertTouchToNodeSpace(_touches[1])); - this->setZoomScale(this->getZoomScale()*len/_touchLength); - } - } -} - -void ScrollView::onTouchEnded(Touch* touch, Event* event) -{ - if (!this->isVisible()) - { - return; - } - - auto touchIter = std::find(_touches.begin(), _touches.end(), touch); - - if (touchIter != _touches.end()) - { - if (_touches.size() == 1 && _touchMoved) - { - this->schedule(CC_SCHEDULE_SELECTOR(ScrollView::deaccelerateScrolling)); - } - _touches.erase(touchIter); - } - - if (_touches.empty()) - { - _dragging = false; - _touchMoved = false; - } -} - -void ScrollView::onTouchCancelled(Touch* touch, Event* event) -{ - if (!this->isVisible()) - { - return; - } - - auto touchIter = std::find(_touches.begin(), _touches.end(), touch); - _touches.erase(touchIter); - - if (_touches.empty()) - { - _dragging = false; - _touchMoved = false; - } -} - -Rect ScrollView::getViewRect() -{ - Vec2 screenPos = this->convertToWorldSpace(Vec2::ZERO); - - float scaleX = this->getScaleX(); - float scaleY = this->getScaleY(); - - for (Node *p = _parent; p != nullptr; p = p->getParent()) { - scaleX *= p->getScaleX(); - scaleY *= p->getScaleY(); - } - - // Support negative scaling. Not doing so causes intersectsRect calls - // (eg: to check if the touch was within the bounds) to return false. - // Note, Node::getScale will assert if X and Y scales are different. - if(scaleX<0.f) { - screenPos.x += _viewSize.width*scaleX; - scaleX = -scaleX; - } - if(scaleY<0.f) { - screenPos.y += _viewSize.height*scaleY; - scaleY = -scaleY; - } - - return Rect(screenPos.x, screenPos.y, _viewSize.width*scaleX, _viewSize.height*scaleY); -} -NS_CC_EXT_END - diff --git a/native/extensions/GUI/CCScrollView/CCScrollView.h b/native/extensions/GUI/CCScrollView/CCScrollView.h deleted file mode 100644 index f8aa1e0fad..0000000000 --- a/native/extensions/GUI/CCScrollView/CCScrollView.h +++ /dev/null @@ -1,399 +0,0 @@ -/**************************************************************************** - Copyright (c) 2012 cocos2d-x.org - Copyright (c) 2010 Sangwoo Im - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#ifndef __CCSCROLLVIEW_H__ -#define __CCSCROLLVIEW_H__ - -#include "2d/CCLayer.h" -#include "base/CCEventListenerTouch.h" -#include "2d/CCActionTween.h" -#include "extensions/ExtensionMacros.h" -#include "extensions/ExtensionExport.h" - -/** - * @addtogroup ui - * @{ - */ -NS_CC_EXT_BEGIN - - -class ScrollView; - -class CC_EX_DLL ScrollViewDelegate -{ -public: - /** - * @js NA - * @lua NA - */ - virtual ~ScrollViewDelegate() {} - /** - * @js NA - * @lua NA - */ - virtual void scrollViewDidScroll(ScrollView* view) {}; - /** - * @js NA - * @lua NA - */ - virtual void scrollViewDidZoom(ScrollView* view) {}; -}; - - -/** - * ScrollView support for cocos2d-x. - * It provides scroll view functionalities to cocos2d projects natively. - */ -class CC_EX_DLL ScrollView : public Layer, public ActionTweenDelegate -{ -public: - enum class Direction - { - NONE = -1, - HORIZONTAL = 0, - VERTICAL, - BOTH - }; - /** - * Returns an autoreleased scroll view object. - * - * @param size view size - * @param container parent object - * @return autoreleased scroll view object - */ - static ScrollView* create(const Size& size, Node* container = NULL); - - /** - * Returns an autoreleased scroll view object. - * - * @return autoreleased scroll view object - */ - static ScrollView* create(); - /** - * @js ctor - * @lua new - */ - ScrollView(); - /** - * @js NA - * @lua NA - */ - virtual ~ScrollView(); - - bool init() override; - /** - * Returns a scroll view object - * - * @param size view size - * @param container parent object - * @return scroll view object - */ - bool initWithViewSize(const Size& size, Node* container = NULL); - - /** - * Sets a new content offset. It ignores max/min offset. It just sets what's given. (just like UIKit's UIScrollView) - * - * @param offset The new offset. - * @param animated If true, the view will scroll to the new offset. - */ - void setContentOffset(Vec2 offset, bool animated = false); - Vec2 getContentOffset(); - /** - * Sets a new content offset. It ignores max/min offset. It just sets what's given. (just like UIKit's UIScrollView) - * You can override the animation duration with this method. - * - * @param offset The new offset. - * @param dt The animation duration. - */ - void setContentOffsetInDuration(const Vec2& offset, float dt); - - /** - * Halts the movement animation of the inner content started with setContentOffset() or setContentOffsetInDuration() - */ - void stopAnimatedContentOffset(); - - void setZoomScale(float s); - /** - * Sets a new scale and does that for a predefined duration. - * - * @param s The new scale vale - * @param animated If true, scaling is animated - */ - void setZoomScale(float s, bool animated); - - float getZoomScale(); - - /** - * Sets a new scale for container in a given duration. - * - * @param s The new scale value - * @param dt The animation duration - */ - void setZoomScaleInDuration(float s, float dt); - - /** - * Set min scale - * - * @param minScale min scale - */ - void setMinScale(float minScale) { - _minScale = minScale; - } - /** - * Set max scale - * - * @param maxScale max scale - */ - void setMaxScale(float maxScale) { - _maxScale = maxScale; - } - - /** - * Returns the current container's minimum offset. You may want this while you animate scrolling by yourself - */ - Vec2 minContainerOffset(); - /** - * Returns the current container's maximum offset. You may want this while you animate scrolling by yourself - */ - Vec2 maxContainerOffset(); - /** - * Determines if a given node's bounding box is in visible bounds - * - * @returns true if it is in visible bounds - */ - bool isNodeVisible(Node * node); - /** - * Provided to make scroll view compatible with SWLayer's pause method - */ - using Layer::pause; // fix warning - void pause(Ref* sender); - /** - * Provided to make scroll view compatible with SWLayer's resume method - */ - using Layer::resume; // fix warning - void resume(Ref* sender); - - void setTouchEnabled(bool enabled); - bool isTouchEnabled() const; - bool isDragging() const {return _dragging;} - bool isTouchMoved() const { return _touchMoved; } - bool isBounceable() const { return _bounceable; } - void setBounceable(bool bBounceable) { _bounceable = bBounceable; } - - /** - * size to clip. Node boundingBox uses contentSize directly. - * It's semantically different what it actually means to common scroll views. - * Hence, this scroll view will use a separate size property. - */ - Size getViewSize() const { return _viewSize; } - void setViewSize(const Size& size); - - Node * getContainer(); - void setContainer(Node * pContainer); - - /** - * direction allowed to scroll. ScrollViewDirectionBoth by default. - */ - Direction getDirection() const { return _direction; } - virtual void setDirection(Direction eDirection) { _direction = eDirection; } - /** - * @js NA - * @lua NA - */ - ScrollViewDelegate* getDelegate() { return _delegate; } - /** - * @code - * when this function bound to js or lua,the input param are changed - * in js: var setDelegate(var jsObject) - * in lua: local setDelegate() - * @endcode - */ - void setDelegate(ScrollViewDelegate* pDelegate) { _delegate = pDelegate; } - - void updateInset(); - - /** - * Determines whether it clips its children or not. - */ - bool isClippingToBounds() { return _clippingToBounds; } - void setClippingToBounds(bool bClippingToBounds) { _clippingToBounds = bClippingToBounds; } - - virtual bool onTouchBegan(Touch *touch, Event *event); - virtual void onTouchMoved(Touch *touch, Event *event); - virtual void onTouchEnded(Touch *touch, Event *event); - virtual void onTouchCancelled(Touch *touch, Event *event); - - // Overrides - virtual void setContentSize(const Size & size) override; - virtual const Size& getContentSize() const override; - /** - * @js NA - * @lua NA - */ - virtual void visit(Renderer *renderer, const Mat4 &parentTransform, uint32_t parentFlags) override; - - using Node::addChild; - virtual void addChild(Node * child, int zOrder, int tag) override; - virtual void addChild(Node * child, int zOrder, const std::string &name) override; - - virtual void removeAllChildren() override; - virtual void removeAllChildrenWithCleanup(bool cleanup) override; - virtual void removeChild(Node* child, bool cleanup = true) override; - /** - * CCActionTweenDelegate - */ - void updateTweenAction(float value, const std::string& key) override; - - bool hasVisibleParents() const; -protected: - /** - * Relocates the container at the proper offset, in bounds of max/min offsets. - * - * @param animated If true, relocation is animated - */ - void relocateContainer(bool animated); - /** - * implements auto-scrolling behavior. change SCROLL_DEACCEL_RATE as needed to choose - * deacceleration speed. it must be less than 1.0f. - * - * @param dt delta - */ - void deaccelerateScrolling(float dt); - /** - * This method makes sure auto scrolling causes delegate to invoke its method - */ - void performedAnimatedScroll(float dt); - /** - * Expire animated scroll delegate calls - */ - void stoppedAnimatedScroll(Node* node); - /** - * clip this view so that outside of the visible bounds can be hidden. - */ - void beforeDraw(); - void onBeforeDraw(); - /** - * retract what's done in beforeDraw so that there's no side effect to - * other nodes. - */ - void afterDraw(); - void onAfterDraw(); - /** - * Zoom handling - */ - void handleZoom(); - - Rect getViewRect(); - - /** - * scroll view delegate - */ - ScrollViewDelegate* _delegate; - - Direction _direction; - /** - * If YES, the view is being dragged. - */ - bool _dragging; - - /** - * Content offset. Note that left-bottom point is the origin - */ - Vec2 _contentOffset; - - /** - * Container holds scroll view contents, Sets the scrollable container object of the scroll view - */ - Node* _container; - /** - * Determines whether user touch is moved after begin phase. - */ - bool _touchMoved; - /** - * max inset point to limit scrolling by touch - */ - Vec2 _maxInset; - /** - * min inset point to limit scrolling by touch - */ - Vec2 _minInset; - /** - * Determines whether the scroll view is allowed to bounce or not. - */ - bool _bounceable; - - bool _clippingToBounds; - - /** - * scroll speed - */ - Vec2 _scrollDistance; - /** - * Touch point - */ - Vec2 _touchPoint; - /** - * length between two fingers - */ - float _touchLength; - /** - * Touch objects to detect multitouch - */ - std::vector _touches; - /** - * size to clip. Node boundingBox uses contentSize directly. - * It's semantically different what it actually means to common scroll views. - * Hence, this scroll view will use a separate size property. - */ - Size _viewSize; - /** - * max and min scale - */ - float _minScale, _maxScale; - /** - * scissor rect for parent, just for restoring GL_SCISSOR_BOX - */ - Rect _parentScissorRect; - bool _scissorRestored; - - /** Touch listener */ - EventListenerTouchOneByOne* _touchListener; - - CustomCommand _beforeDrawCommand; - CustomCommand _afterDrawCommand; - - /** - * Action created with setContentOffsetInDuration(), saved so it can be halted - */ - Action* _animatedScrollAction; -}; - - -NS_CC_EXT_END -// end of ui group -/// @} - -#endif /* __CCSCROLLVIEW_H__ */ - diff --git a/native/extensions/GUI/CCScrollView/CCTableView.cpp b/native/extensions/GUI/CCScrollView/CCTableView.cpp deleted file mode 100644 index a6efe0e494..0000000000 --- a/native/extensions/GUI/CCScrollView/CCTableView.cpp +++ /dev/null @@ -1,673 +0,0 @@ -/**************************************************************************** - Copyright (c) 2012 cocos2d-x.org - Copyright (c) 2010 Sangwoo Im - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#include "CCTableView.h" -#include "CCTableViewCell.h" - -NS_CC_EXT_BEGIN - -TableView* TableView::create() -{ - return TableView::create(nullptr, Size::ZERO); -} - -TableView* TableView::create(TableViewDataSource* dataSource, Size size) -{ - return TableView::create(dataSource, size, nullptr); -} - -TableView* TableView::create(TableViewDataSource* dataSource, Size size, Node *container) -{ - TableView *table = new (std::nothrow) TableView(); - table->initWithViewSize(size, container); - table->autorelease(); - table->setDataSource(dataSource); - table->_updateCellPositions(); - table->_updateContentSize(); - - return table; -} - -bool TableView::initWithViewSize(const Size& size, Node* container/* = nullptr*/) -{ - if (ScrollView::initWithViewSize(size,container)) - { - CC_SAFE_DELETE(_indices); - _indices = new (std::nothrow) std::set(); - _vordering = VerticalFillOrder::BOTTOM_UP; - this->setDirection(Direction::VERTICAL); - - ScrollView::setDelegate(this); - return true; - } - return false; -} - -TableView::TableView() -: _touchedCell(nullptr) -, _indices(nullptr) -, _dataSource(nullptr) -, _tableViewDelegate(nullptr) -, _oldDirection(Direction::NONE) -, _isUsedCellsDirty(false) -{ - -} - -TableView::~TableView() -{ - CC_SAFE_DELETE(_indices); -} - -void TableView::setVerticalFillOrder(VerticalFillOrder fillOrder) -{ - if (_vordering != fillOrder) - { - _vordering = fillOrder; - if (!_cellsUsed.empty()) - { - this->reloadData(); - } - } -} - -TableView::VerticalFillOrder TableView::getVerticalFillOrder() -{ - return _vordering; -} - -void TableView::reloadData() -{ - _oldDirection = Direction::NONE; - - for(const auto &cell : _cellsUsed) { - if(_tableViewDelegate != nullptr) { - _tableViewDelegate->tableCellWillRecycle(this, cell); - } - - _cellsFreed.pushBack(cell); - - cell->reset(); - if (cell->getParent() == this->getContainer()) - { - this->getContainer()->removeChild(cell, true); - } - } - - _indices->clear(); - _cellsUsed.clear(); - - this->_updateCellPositions(); - this->_updateContentSize(); - if (_dataSource->numberOfCellsInTableView(this) > 0) - { - this->scrollViewDidScroll(this); - } -} - -TableViewCell *TableView::cellAtIndex(ssize_t idx) -{ - if (_indices->find(idx) != _indices->end()) - { - for (const auto& cell : _cellsUsed) - { - if (cell->getIdx() == idx) - { - return cell; - } - } - } - - return nullptr; -} - -void TableView::updateCellAtIndex(ssize_t idx) -{ - if (idx == CC_INVALID_INDEX) - { - return; - } - long countOfItems = _dataSource->numberOfCellsInTableView(this); - if (0 == countOfItems || idx > countOfItems-1) - { - return; - } - - TableViewCell* cell = cellAtIndex(idx); - if (cell) - { - _moveCellOutOfSight(cell); - } - cell = _dataSource->tableCellAtIndex(this, idx); - if (cell) - { - _setIndexForCell(idx, cell); - _addCellIfNecessary(cell); - } -} - -void TableView::insertCellAtIndex(ssize_t idx) -{ - if (idx == CC_INVALID_INDEX) - { - return; - } - - long countOfItems = _dataSource->numberOfCellsInTableView(this); - if (0 == countOfItems || idx > countOfItems-1) - { - return; - } - - long newIdx = 0; - - auto cell = cellAtIndex(idx); - if (cell) - { - newIdx = _cellsUsed.getIndex(cell); - // Move all cells behind the inserted position - for (long i = newIdx; i < _cellsUsed.size(); i++) - { - cell = _cellsUsed.at(i); - this->_setIndexForCell(cell->getIdx()+1, cell); - } - } - - //insert a new cell - cell = _dataSource->tableCellAtIndex(this, idx); - this->_setIndexForCell(idx, cell); - this->_addCellIfNecessary(cell); - - this->_updateCellPositions(); - this->_updateContentSize(); -} - -void TableView::removeCellAtIndex(ssize_t idx) -{ - if (idx == CC_INVALID_INDEX) - { - return; - } - - long uCountOfItems = _dataSource->numberOfCellsInTableView(this); - if (0 == uCountOfItems || idx > uCountOfItems-1) - { - return; - } - - ssize_t newIdx = 0; - - TableViewCell* cell = this->cellAtIndex(idx); - if (!cell) - { - return; - } - - newIdx = _cellsUsed.getIndex(cell); - - //remove first - this->_moveCellOutOfSight(cell); - - _indices->erase(idx); - this->_updateCellPositions(); - - for (ssize_t i = _cellsUsed.size()-1; i > newIdx; i--) - { - cell = _cellsUsed.at(i); - this->_setIndexForCell(cell->getIdx()-1, cell); - } -} - -TableViewCell *TableView::dequeueCell() -{ - TableViewCell *cell; - - if (_cellsFreed.empty()) { - cell = nullptr; - } else { - cell = _cellsFreed.at(0); - cell->retain(); - _cellsFreed.erase(0); - cell->autorelease(); - } - return cell; -} - -void TableView::_addCellIfNecessary(TableViewCell * cell) -{ - if (cell->getParent() != this->getContainer()) - { - this->getContainer()->addChild(cell); - } - _cellsUsed.pushBack(cell); - _indices->insert(cell->getIdx()); - _isUsedCellsDirty = true; -} - -void TableView::_updateContentSize() -{ - Size size = Size::ZERO; - ssize_t cellsCount = _dataSource->numberOfCellsInTableView(this); - - if (cellsCount > 0) - { - float maxPosition = _vCellsPositions[cellsCount]; - - switch (this->getDirection()) - { - case Direction::HORIZONTAL: - size = Size(maxPosition, _viewSize.height); - break; - default: - size = Size(_viewSize.width, maxPosition); - break; - } - } - - this->setContentSize(size); - - if (_oldDirection != _direction) - { - if (_direction == Direction::HORIZONTAL) - { - this->setContentOffset(Vec2::ZERO); - } - else - { - this->setContentOffset(Vec2(0,this->minContainerOffset().y)); - } - _oldDirection = _direction; - } - -} - -Vec2 TableView::_offsetFromIndex(ssize_t index) -{ - Vec2 offset = this->__offsetFromIndex(index); - - const Size cellSize = _dataSource->tableCellSizeForIndex(this, index); - if (_vordering == VerticalFillOrder::TOP_DOWN) - { - offset.y = this->getContainer()->getContentSize().height - offset.y - cellSize.height; - } - return offset; -} - -Vec2 TableView::__offsetFromIndex(ssize_t index) -{ - Vec2 offset; - Size cellSize; - - switch (this->getDirection()) - { - case Direction::HORIZONTAL: - offset.set(_vCellsPositions[index], 0.0f); - break; - default: - offset.set(0.0f, _vCellsPositions[index]); - break; - } - - return offset; -} - -long TableView::_indexFromOffset(Vec2 offset) -{ - long index = 0; - const long maxIdx = _dataSource->numberOfCellsInTableView(this) - 1; - - if (_vordering == VerticalFillOrder::TOP_DOWN) - { - offset.y = this->getContainer()->getContentSize().height - offset.y; - } - index = this->__indexFromOffset(offset); - if (index != -1) - { - index = MAX(0, index); - if (index > maxIdx) - { - index = CC_INVALID_INDEX; - } - } - - return index; -} - -long TableView::__indexFromOffset(Vec2 offset) -{ - long low = 0; - long high = _dataSource->numberOfCellsInTableView(this) - 1; - float search; - switch (this->getDirection()) - { - case Direction::HORIZONTAL: - search = offset.x; - break; - default: - search = offset.y; - break; - } - - while (high >= low) - { - long index = low + (high - low) / 2; - float cellStart = _vCellsPositions[index]; - float cellEnd = _vCellsPositions[index + 1]; - - if (search >= cellStart && search <= cellEnd) - { - return index; - } - else if (search < cellStart) - { - high = index - 1; - } - else - { - low = index + 1; - } - } - - if (low <= 0) { - return 0; - } - - return -1; -} - -void TableView::_moveCellOutOfSight(TableViewCell *cell) -{ - if(_tableViewDelegate != nullptr) { - _tableViewDelegate->tableCellWillRecycle(this, cell); - } - - _cellsFreed.pushBack(cell); - _cellsUsed.eraseObject(cell); - _isUsedCellsDirty = true; - - _indices->erase(cell->getIdx()); - cell->reset(); - - if (cell->getParent() == this->getContainer()) - { - this->getContainer()->removeChild(cell, true);; - } -} - -void TableView::_setIndexForCell(ssize_t index, TableViewCell *cell) -{ - cell->setAnchorPoint(Vec2::ANCHOR_BOTTOM_LEFT); - cell->setPosition(this->_offsetFromIndex(index)); - cell->setIdx(index); -} - -void TableView::_updateCellPositions() -{ - long cellsCount = _dataSource->numberOfCellsInTableView(this); - _vCellsPositions.resize(cellsCount + 1, 0.0); - - if (cellsCount > 0) - { - float currentPos = 0; - Size cellSize; - for (int i=0; i < cellsCount; i++) - { - _vCellsPositions[i] = currentPos; - cellSize = _dataSource->tableCellSizeForIndex(this, i); - switch (this->getDirection()) - { - case Direction::HORIZONTAL: - currentPos += cellSize.width; - break; - default: - currentPos += cellSize.height; - break; - } - } - _vCellsPositions[cellsCount] = currentPos;//1 extra value allows us to get right/bottom of the last cell - } - -} - -void TableView::scrollViewDidScroll(ScrollView* view) -{ - long countOfItems = _dataSource->numberOfCellsInTableView(this); - if (0 == countOfItems) - { - return; - } - - if (_isUsedCellsDirty) - { - _isUsedCellsDirty = false; - std::sort(_cellsUsed.begin(), _cellsUsed.end(), [](TableViewCell *a, TableViewCell *b) -> bool{ - return a->getIdx() < b->getIdx(); - }); - } - - if(_tableViewDelegate != nullptr) { - _tableViewDelegate->scrollViewDidScroll(this); - } - - ssize_t startIdx = 0, endIdx = 0, idx = 0, maxIdx = 0; - Vec2 offset = this->getContentOffset() * -1; - maxIdx = MAX(countOfItems-1, 0); - - if (_vordering == VerticalFillOrder::TOP_DOWN) - { - offset.y = offset.y + _viewSize.height/this->getContainer()->getScaleY(); - } - startIdx = this->_indexFromOffset(offset); - if (startIdx == CC_INVALID_INDEX) - { - startIdx = countOfItems - 1; - } - - if (_vordering == VerticalFillOrder::TOP_DOWN) - { - offset.y -= _viewSize.height/this->getContainer()->getScaleY(); - } - else - { - offset.y += _viewSize.height/this->getContainer()->getScaleY(); - } - offset.x += _viewSize.width/this->getContainer()->getScaleX(); - - endIdx = this->_indexFromOffset(offset); - if (endIdx == CC_INVALID_INDEX) - { - endIdx = countOfItems - 1; - } - -#if 0 // For Testing. - Ref* pObj; - int i = 0; - CCARRAY_FOREACH(_cellsUsed, pObj) - { - TableViewCell* pCell = static_cast(pObj); - log("cells Used index %d, value = %d", i, pCell->getIdx()); - i++; - } - log("---------------------------------------"); - i = 0; - CCARRAY_FOREACH(_cellsFreed, pObj) - { - TableViewCell* pCell = static_cast(pObj); - log("cells freed index %d, value = %d", i, pCell->getIdx()); - i++; - } - log("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); -#endif - - if (!_cellsUsed.empty()) - { - auto cell = _cellsUsed.at(0); - idx = cell->getIdx(); - - while(idx < startIdx) - { - this->_moveCellOutOfSight(cell); - if (!_cellsUsed.empty()) - { - cell = _cellsUsed.at(0); - idx = cell->getIdx(); - } - else - { - break; - } - } - } - if (!_cellsUsed.empty()) - { - auto cell = _cellsUsed.back(); - idx = cell->getIdx(); - - while(idx <= maxIdx && idx > endIdx) - { - this->_moveCellOutOfSight(cell); - if (!_cellsUsed.empty()) - { - cell = _cellsUsed.back(); - idx = cell->getIdx(); - } - else - { - break; - } - } - } - - for (long i = startIdx; i <= endIdx; i++) - { - if (_indices->find(i) != _indices->end()) - { - continue; - } - this->updateCellAtIndex(i); - } -} - -void TableView::onTouchEnded(Touch *pTouch, Event *pEvent) -{ - if (!this->isVisible()) { - return; - } - - if (_touchedCell){ - Rect bb = this->getBoundingBox(); - bb.origin = _parent->convertToWorldSpace(bb.origin); - - if (bb.containsPoint(pTouch->getLocation()) && _tableViewDelegate != nullptr) - { - _tableViewDelegate->tableCellUnhighlight(this, _touchedCell); - _tableViewDelegate->tableCellTouched(this, _touchedCell); - } - - _touchedCell = nullptr; - } - - ScrollView::onTouchEnded(pTouch, pEvent); -} - -bool TableView::onTouchBegan(Touch *pTouch, Event *pEvent) -{ - for (Node *c = this; c != nullptr; c = c->getParent()) - { - if (!c->isVisible()) - { - return false; - } - } - - bool touchResult = ScrollView::onTouchBegan(pTouch, pEvent); - - if(_touches.size() == 1) - { - long index; - Vec2 point; - - point = this->getContainer()->convertTouchToNodeSpace(pTouch); - - index = this->_indexFromOffset(point); - if (index == CC_INVALID_INDEX) - { - _touchedCell = nullptr; - } - else - { - _touchedCell = this->cellAtIndex(index); - } - - if (_touchedCell && _tableViewDelegate != nullptr) - { - _tableViewDelegate->tableCellHighlight(this, _touchedCell); - } - } - else if (_touchedCell) - { - if(_tableViewDelegate != nullptr) - { - _tableViewDelegate->tableCellUnhighlight(this, _touchedCell); - } - - _touchedCell = nullptr; - } - - return touchResult; -} - -void TableView::onTouchMoved(Touch *pTouch, Event *pEvent) -{ - ScrollView::onTouchMoved(pTouch, pEvent); - - if (_touchedCell && isTouchMoved()) - { - if(_tableViewDelegate != nullptr) - { - _tableViewDelegate->tableCellUnhighlight(this, _touchedCell); - } - - _touchedCell = nullptr; - } -} - -void TableView::onTouchCancelled(Touch *pTouch, Event *pEvent) -{ - ScrollView::onTouchCancelled(pTouch, pEvent); - - if (_touchedCell) - { - if(_tableViewDelegate != nullptr) - { - _tableViewDelegate->tableCellUnhighlight(this, _touchedCell); - } - - _touchedCell = nullptr; - } -} - -NS_CC_EXT_END - diff --git a/native/extensions/GUI/CCScrollView/CCTableView.h b/native/extensions/GUI/CCScrollView/CCTableView.h deleted file mode 100644 index c22c93ddfa..0000000000 --- a/native/extensions/GUI/CCScrollView/CCTableView.h +++ /dev/null @@ -1,341 +0,0 @@ -/**************************************************************************** - Copyright (c) 2012 cocos2d-x.org - Copyright (c) 2010 Sangwoo Im - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#ifndef __CCTABLEVIEW_H__ -#define __CCTABLEVIEW_H__ - -#include "CCScrollView.h" -#include "CCTableViewCell.h" -#include "extensions/ExtensionExport.h" - -#include -#include - -/** - * @addtogroup ui - * @{ - */ -NS_CC_EXT_BEGIN - -class TableView; - -/** - * Sole purpose of this delegate is to single touch event in this version. - */ -class CC_EX_DLL TableViewDelegate : public ScrollViewDelegate -{ -public: - /** - * Delegate to respond touch event - * - * @param table table contains the given cell - * @param cell cell that is touched - * @js NA - * @lua NA - */ - virtual void tableCellTouched(TableView* table, TableViewCell* cell) = 0; - - /** - * Delegate to respond a table cell press event. - * - * @param table table contains the given cell - * @param cell cell that is pressed - * @js NA - * @lua NA - */ - virtual void tableCellHighlight(TableView* table, TableViewCell* cell){}; - - /** - * Delegate to respond a table cell release event - * - * @param table table contains the given cell - * @param cell cell that is pressed - * @js NA - * @lua NA - */ - virtual void tableCellUnhighlight(TableView* table, TableViewCell* cell){}; - - /** - * Delegate called when the cell is about to be recycled. Immediately - * after this call the cell will be removed from the scene graph and - * recycled. - * - * @param table table contains the given cell - * @param cell cell that is pressed - * @js NA - * @lua NA - */ - virtual void tableCellWillRecycle(TableView* table, TableViewCell* cell){}; - -}; - - -/** - * Data source that governs table backend data. - */ -class CC_EX_DLL TableViewDataSource -{ -public: - /** - * @js NA - * @lua NA - */ - virtual ~TableViewDataSource() {} - - /** - * cell size for a given index - * - * @param idx the index of a cell to get a size - * @return size of a cell at given index - */ - virtual Size tableCellSizeForIndex(TableView *table, ssize_t idx) { - return cellSizeForTable(table); - }; - /** - * cell height for a given table. - * - * @param table table to hold the instances of Class - * @return cell size - */ - virtual Size cellSizeForTable(TableView *table) { - return Size::ZERO; - }; - /** - * a cell instance at a given index - * - * @param idx index to search for a cell - * @return cell found at idx - */ - virtual TableViewCell* tableCellAtIndex(TableView *table, ssize_t idx) = 0; - /** - * Returns number of cells in a given table view. - * - * @return number of cells - */ - virtual ssize_t numberOfCellsInTableView(TableView *table) = 0; - -}; - - -/** - * UITableView support for cocos2d-x. - * - * This is a very basic, minimal implementation to bring UITableView-like component into cocos2d world. - */ -class CC_EX_DLL TableView : public ScrollView, public ScrollViewDelegate -{ -public: - - enum class VerticalFillOrder - { - TOP_DOWN, - BOTTOM_UP - }; - - /** Empty contructor of TableView */ - static TableView* create(); - - /** - * An intialized table view object - * - * @param dataSource data source - * @param size view size - * @return table view - * @code - * when this function bound to js or lua,the input params are changed - * in js:var create(var jsObject,var size) - * in lua:local create(var size) - * in lua: - * @endcode - */ - static TableView* create(TableViewDataSource* dataSource, Size size); - /** - * An initialized table view object - * - * @param dataSource data source; - * @param size view size - * @param container parent object for cells - * @return table view - * @code - * when this function bound to js or lua,the input params are changed - * in js:var create(var jsObject,var size,var container) - * in lua:local create(var size, var container) - * in lua: - * @endcode - */ - static TableView* create(TableViewDataSource* dataSource, Size size, Node *container); - /** - * @js ctor - * @lua new - */ - TableView(); - /** - * @js NA - * @lua NA - */ - virtual ~TableView(); - - bool initWithViewSize(const Size& size, Node* container = NULL); - - /** - * data source - * @js NA - * @lua NA - */ - TableViewDataSource* getDataSource() { return _dataSource; } - /** - * when this function bound to js or lua,the input params are changed - * in js:var setDataSource(var jsSource) - * in lua:local setDataSource() - * @endcode - */ - void setDataSource(TableViewDataSource* source) { _dataSource = source; } - /** - * delegate - * @js NA - * @lua NA - */ - TableViewDelegate* getDelegate() { return _tableViewDelegate; } - /** - * @code - * when this function bound to js or lua,the input params are changed - * in js:var setDelegate(var jsDelegate) - * in lua:local setDelegate() - * @endcode - */ - void setDelegate(TableViewDelegate* pDelegate) { _tableViewDelegate = pDelegate; } - - /** - * determines how cell is ordered and filled in the view. - */ - void setVerticalFillOrder(VerticalFillOrder order); - VerticalFillOrder getVerticalFillOrder(); - - /** - * Updates the content of the cell at a given index. - * - * @param idx index to find a cell - */ - void updateCellAtIndex(ssize_t idx); - /** - * Inserts a new cell at a given index - * - * @param idx location to insert - */ - void insertCellAtIndex(ssize_t idx); - /** - * Removes a cell at a given index - * - * @param idx index to find a cell - */ - void removeCellAtIndex(ssize_t idx); - /** - * reloads data from data source. the view will be refreshed. - */ - void reloadData(); - /** - * Dequeues a free cell if available. nil if not. - * - * @return free cell - */ - TableViewCell *dequeueCell(); - - /** - * Returns an existing cell at a given index. Returns nil if a cell is nonexistent at the moment of query. - * - * @param idx index - * @return a cell at a given index - */ - TableViewCell *cellAtIndex(ssize_t idx); - - // Overrides - virtual void scrollViewDidScroll(ScrollView* view) override; - virtual void scrollViewDidZoom(ScrollView* view) override {} - virtual bool onTouchBegan(Touch *pTouch, Event *pEvent) override; - virtual void onTouchMoved(Touch *pTouch, Event *pEvent) override; - virtual void onTouchEnded(Touch *pTouch, Event *pEvent) override; - virtual void onTouchCancelled(Touch *pTouch, Event *pEvent) override; - -protected: - long __indexFromOffset(Vec2 offset); - long _indexFromOffset(Vec2 offset); - Vec2 __offsetFromIndex(ssize_t index); - Vec2 _offsetFromIndex(ssize_t index); - - void _moveCellOutOfSight(TableViewCell *cell); - void _setIndexForCell(ssize_t index, TableViewCell *cell); - void _addCellIfNecessary(TableViewCell * cell); - - void _updateCellPositions(); - - - TableViewCell *_touchedCell; - /** - * vertical direction of cell filling - */ - VerticalFillOrder _vordering; - - /** - * index set to query the indexes of the cells used. - */ - std::set* _indices; - - /** - * vector with all cell positions - */ - std::vector _vCellsPositions; - //NSMutableIndexSet *indices_; - /** - * cells that are currently in the table - */ - Vector _cellsUsed; - /** - * free list of cells - */ - Vector _cellsFreed; - /** - * weak link to the data source object - */ - TableViewDataSource* _dataSource; - /** - * weak link to the delegate object - */ - TableViewDelegate* _tableViewDelegate; - - Direction _oldDirection; - - bool _isUsedCellsDirty; - -public: - void _updateContentSize(); - -}; - -NS_CC_EXT_END -// end of ui group -/// @} - -#endif /* __CCTABLEVIEW_H__ */ - diff --git a/native/extensions/GUI/CCScrollView/CCTableViewCell.cpp b/native/extensions/GUI/CCScrollView/CCTableViewCell.cpp deleted file mode 100644 index 624e3f5aee..0000000000 --- a/native/extensions/GUI/CCScrollView/CCTableViewCell.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/**************************************************************************** - Copyright (c) 2012 cocos2d-x.org - Copyright (c) 2010 Sangwoo Im - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#include "CCTableViewCell.h" - -NS_CC_EXT_BEGIN - -void TableViewCell::reset() -{ - _idx = CC_INVALID_INDEX; -} - -ssize_t TableViewCell::getIdx() const -{ - return _idx; -} - -void TableViewCell::setIdx(ssize_t idx) -{ - _idx = idx; -} - -NS_CC_EXT_END - diff --git a/native/extensions/GUI/CCScrollView/CCTableViewCell.h b/native/extensions/GUI/CCScrollView/CCTableViewCell.h deleted file mode 100644 index d495224eea..0000000000 --- a/native/extensions/GUI/CCScrollView/CCTableViewCell.h +++ /dev/null @@ -1,68 +0,0 @@ -/**************************************************************************** - Copyright (c) 2012 cocos2d-x.org - Copyright (c) 2010 Sangwoo Im - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#ifndef __CCTABLEVIEWCELL_H__ -#define __CCTABLEVIEWCELL_H__ - -#include "extensions/ExtensionMacros.h" -#include "2d/CCNode.h" -#include "extensions/ExtensionExport.h" - -/** - * @addtogroup ui - * @{ - */ -NS_CC_EXT_BEGIN - - -/** - * Abstract class for SWTableView cell node - */ -class CC_EX_DLL TableViewCell: public Node -{ -public: - CREATE_FUNC(TableViewCell); - - TableViewCell() {} - /** - * The index used internally by SWTableView and its subclasses - */ - ssize_t getIdx() const; - void setIdx(ssize_t uIdx); - /** - * Cleans up any resources linked to this cell and resets idx property. - */ - void reset(); - -private: - ssize_t _idx; -}; - -NS_CC_EXT_END -// end of ui group -/// @} - -#endif /* __CCTABLEVIEWCELL_H__ */ - diff --git a/native/extensions/cocos-ext.h b/native/extensions/cocos-ext.h index e81e221125..33c4f871f7 100644 --- a/native/extensions/cocos-ext.h +++ b/native/extensions/cocos-ext.h @@ -8,11 +8,5 @@ #include "assets-manager/CCEventListenerAssetsManagerEx.h" #include "assets-manager/Manifest.h" -#include "GUI/CCControlExtension/CCControlExtensions.h" -#include "GUI/CCScrollView/CCScrollView.h" -#include "GUI/CCScrollView/CCTableView.h" -#include "physics-nodes/CCPhysicsSprite.h" -#include "physics-nodes/CCPhysicsDebugNode.h" - #endif /* __COCOS2D_EXT_H__ */ diff --git a/native/extensions/physics-nodes/CCPhysicsDebugNode.cpp b/native/extensions/physics-nodes/CCPhysicsDebugNode.cpp deleted file mode 100644 index 66e9289c2b..0000000000 --- a/native/extensions/physics-nodes/CCPhysicsDebugNode.cpp +++ /dev/null @@ -1,244 +0,0 @@ -/* Copyright (c) 2012 Scott Lembcke and Howling Moon Software - * Copyright (c) 2012 cocos2d-x.org - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ -#include "CCPhysicsDebugNode.h" - -#if CC_ENABLE_CHIPMUNK_INTEGRATION -#include "chipmunk/chipmunk_private.h" -#endif - -#include "base/ccTypes.h" -#include "math/CCGeometry.h" - - -#include -#include -#include -#include -#include - -NS_CC_EXT_BEGIN - -#if CC_ENABLE_CHIPMUNK_INTEGRATION -/* - IMPORTANT - READ ME! - - This file sets pokes around in the private API a lot to provide efficient - debug rendering given nothing more than reference to a Chipmunk space. - It is not recommended to write rendering code like this in your own games - as the private API may change with little or no warning. - */ - -static Color4F ColorForBody(cpBody *body) -{ - if (CP_BODY_TYPE_STATIC == cpBodyGetType(body) || cpBodyIsSleeping(body)) - { - return Color4F(0.5f, 0.5f, 0.5f ,0.5f); - } - else if (body->sleeping.idleTime > cpBodyGetSpace(body)->sleepTimeThreshold) - { - return Color4F(0.33f, 0.33f, 0.33f, 0.5f); - } - else - { - return Color4F(1.0f, 0.0f, 0.0f, 0.5f); - } -} - -static Vec2 cpVert2Point(const cpVect &vert) -{ - return Vec2(vert.x, vert.y); -} - -static Vec2* cpVertArray2ccpArrayN(const cpVect* cpVertArray, unsigned int count) -{ - if (count == 0) return nullptr; - Vec2* pPoints = new (std::nothrow) Vec2[count]; - - for (unsigned int i = 0; i < count; ++i) - { - pPoints[i].x = cpVertArray[i].x; - pPoints[i].y = cpVertArray[i].y; - } - return pPoints; -} - -static void DrawShape(cpShape *shape, DrawNode *renderer) -{ - cpBody *body = cpShapeGetBody(shape); - Color4F color = ColorForBody(body); - - switch (shape->CP_PRIVATE(klass)->type) - { - case CP_CIRCLE_SHAPE: - { - cpCircleShape *circle = (cpCircleShape *)shape; - cpVect center = circle->tc; - cpFloat radius = circle->r; - renderer->drawDot(cpVert2Point(center), cpfmax(radius, 1.0), color); - renderer->drawSegment(cpVert2Point(center), cpVert2Point(cpvadd(center, cpvmult(cpBodyGetRotation(body), radius))), 1.0, color); - } - break; - case CP_SEGMENT_SHAPE: - { - cpSegmentShape *seg = (cpSegmentShape *)shape; - renderer->drawSegment(cpVert2Point(seg->ta), cpVert2Point(seg->tb), cpfmax(seg->r, 2.0), color); - } - break; - case CP_POLY_SHAPE: - { - cpPolyShape* poly = (cpPolyShape*)shape; - Color4F line = color; - line.a = cpflerp(color.a, 1.0, 0.5); - int num = poly->count; - Vec2* pPoints = new (std::nothrow) Vec2[num]; - for(int i=0;iplanes[i].v0); - renderer->drawPolygon(pPoints, num, color, 1.0, line); - CC_SAFE_DELETE_ARRAY(pPoints); - } - break; - default: - cpAssertHard(false, "Bad assertion in DrawShape()"); - } -} - -static Color4F CONSTRAINT_COLOR(0, 1, 0, 0.5); - -static void DrawConstraint(cpConstraint *constraint, DrawNode *renderer) -{ - cpBody *body_a = cpConstraintGetBodyA(constraint); - cpBody *body_b = cpConstraintGetBodyB(constraint); - - if(cpConstraintIsPinJoint(constraint)) - { - cpVect a = cpvadd(cpBodyGetPosition(body_a), cpvrotate(cpPinJointGetAnchorA(constraint), cpBodyGetRotation(body_a))); - cpVect b = cpvadd(cpBodyGetPosition(body_b), cpvrotate(cpPinJointGetAnchorB(constraint), cpBodyGetRotation(body_b))); - - renderer->drawDot(cpVert2Point(a), 3.0, CONSTRAINT_COLOR); - renderer->drawDot(cpVert2Point(b), 3.0, CONSTRAINT_COLOR); - renderer->drawSegment(cpVert2Point(a), cpVert2Point(b), 1.0, CONSTRAINT_COLOR); - } - else if(cpConstraintIsSlideJoint(constraint)) - { - cpVect a = cpvadd(cpBodyGetPosition(body_a), cpvrotate(cpSlideJointGetAnchorA(constraint), cpBodyGetRotation(body_a))); - cpVect b = cpvadd(cpBodyGetPosition(body_b), cpvrotate(cpSlideJointGetAnchorB(constraint), cpBodyGetRotation(body_b))); - - renderer->drawDot(cpVert2Point(a), 3.0, CONSTRAINT_COLOR); - renderer->drawDot(cpVert2Point(b), 3.0, CONSTRAINT_COLOR); - renderer->drawSegment(cpVert2Point(a), cpVert2Point(b), 1.0, CONSTRAINT_COLOR); - } - else if(cpConstraintIsPivotJoint(constraint)) - { - cpVect a = cpvadd(cpBodyGetPosition(body_a), cpvrotate(cpPivotJointGetAnchorA(constraint), cpBodyGetRotation(body_a))); - cpVect b = cpvadd(cpBodyGetPosition(body_b), cpvrotate(cpPivotJointGetAnchorB(constraint), cpBodyGetRotation(body_b))); - - renderer->drawDot(cpVert2Point(a), 3.0, CONSTRAINT_COLOR); - renderer->drawDot(cpVert2Point(b), 3.0, CONSTRAINT_COLOR); - } - else if(cpConstraintIsGrooveJoint(constraint)) - { - cpVect a = cpvadd(cpBodyGetPosition(body_a), cpvrotate(cpGrooveJointGetGrooveA(constraint), cpBodyGetRotation(body_a))); - cpVect b = cpvadd(cpBodyGetPosition(body_a), cpvrotate(cpGrooveJointGetGrooveB(constraint), cpBodyGetRotation(body_a))); - cpVect c = cpvadd(cpBodyGetPosition(body_b), cpvrotate(cpGrooveJointGetAnchorB(constraint), cpBodyGetRotation(body_b))); - - renderer->drawDot(cpVert2Point(c), 3.0, CONSTRAINT_COLOR); - renderer->drawSegment(cpVert2Point(a), cpVert2Point(b), 1.0, CONSTRAINT_COLOR); - } - else if(cpConstraintIsDampedSpring(constraint)) - { - // TODO: uninplemented - } - else - { - // printf("Cannot draw constraint\n"); - } -} -#endif // #if CC_ENABLE_CHIPMUNK_INTEGRATION - -// implementation of PhysicsDebugNode - -void PhysicsDebugNode::draw(Renderer *renderer, const Mat4 &transform, uint32_t flags) -{ - if (! _spacePtr) - { - return; - } -#if CC_ENABLE_CHIPMUNK_INTEGRATION - // clear the shapes information before draw current shapes. - DrawNode::clear(); - - cpSpaceEachShape(_spacePtr, (cpSpaceShapeIteratorFunc)DrawShape, this); - cpSpaceEachConstraint(_spacePtr, (cpSpaceConstraintIteratorFunc)DrawConstraint, this); - - DrawNode::draw(renderer, transform, flags); -#endif -} - -PhysicsDebugNode::PhysicsDebugNode() -: _spacePtr(nullptr) -{} - -PhysicsDebugNode* PhysicsDebugNode::create(cpSpace *space) -{ - PhysicsDebugNode *node = new (std::nothrow) PhysicsDebugNode(); - if (node) - { - node->init(); -#if CC_ENABLE_CHIPMUNK_INTEGRATION - node->_spacePtr = space; -#else - CCASSERT(false, "CC_ENABLE_CHIPMUNK_INTEGRATION was not enabled!"); -#endif - node->autorelease(); - } - else - { - CC_SAFE_DELETE(node); - } - - return node; -} - -PhysicsDebugNode::~PhysicsDebugNode() -{ -} - -cpSpace* PhysicsDebugNode::getSpace() const -{ -#if CC_ENABLE_CHIPMUNK_INTEGRATION - return _spacePtr; -#else - CCASSERT(false, "Can't call chipmunk methods when Chipmunk is disabled"); - return nullptr; -#endif -} - -void PhysicsDebugNode::setSpace(cpSpace *space) -{ -#if CC_ENABLE_CHIPMUNK_INTEGRATION - _spacePtr = space; -#else - CCASSERT(false, "Can't call chipmunk methods when Chipmunk is disabled"); -#endif -} - -NS_CC_EXT_END diff --git a/native/extensions/physics-nodes/CCPhysicsDebugNode.h b/native/extensions/physics-nodes/CCPhysicsDebugNode.h deleted file mode 100644 index e711aab342..0000000000 --- a/native/extensions/physics-nodes/CCPhysicsDebugNode.h +++ /dev/null @@ -1,74 +0,0 @@ -/* Copyright (c) 2012 Scott Lembcke and Howling Moon Software - * Copyright (c) 2012 cocos2d-x.org - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#ifndef __PHYSICSNODES_DEBUGNODE_H__ -#define __PHYSICSNODES_DEBUGNODE_H__ - -#include "extensions/ExtensionMacros.h" -#include "2d/CCDrawNode.h" -#include "extensions/ExtensionExport.h" - -struct cpSpace; - -NS_CC_EXT_BEGIN - -/** - * A BaseData that draws the components of a physics engine. - - * Supported physics engines: - * - Chipmunk - * - Objective-Chipmunk - * @since v2.1 - * @lua NA - */ - -class CC_EX_DLL PhysicsDebugNode : public DrawNode -{ - -public: - /** Create a debug node for a regular Chipmunk space. */ - static PhysicsDebugNode* create(cpSpace *space); - /** - * @js ctor - */ - PhysicsDebugNode(); - /** - * @js NA - */ - virtual ~PhysicsDebugNode(); - - - cpSpace* getSpace() const; - void setSpace(cpSpace *space); - - // Overrides - virtual void draw(Renderer *renderer, const Mat4 &transform, uint32_t flags) override; - -protected: - cpSpace *_spacePtr; - -}; - -NS_CC_EXT_END - -#endif // __PHYSICSNODES_DEBUGNODE_H__ - diff --git a/native/extensions/physics-nodes/CCPhysicsSprite.cpp b/native/extensions/physics-nodes/CCPhysicsSprite.cpp deleted file mode 100644 index ce10708217..0000000000 --- a/native/extensions/physics-nodes/CCPhysicsSprite.cpp +++ /dev/null @@ -1,441 +0,0 @@ -/* Copyright (c) 2012 Scott Lembcke and Howling Moon Software - * Copyright (c) 2012 cocos2d-x.org - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "CCPhysicsSprite.h" -#include "base/CCDirector.h" -#include "base/CCEventDispatcher.h" - -#if (CC_ENABLE_CHIPMUNK_INTEGRATION || CC_ENABLE_BOX2D_INTEGRATION) - -#if (CC_ENABLE_CHIPMUNK_INTEGRATION && CC_ENABLE_BOX2D_INTEGRATION) -#error "Either Chipmunk or Box2d should be enabled, but not both at the same time" -#endif - -#if CC_ENABLE_CHIPMUNK_INTEGRATION -#include "chipmunk/chipmunk.h" -#elif CC_ENABLE_BOX2D_INTEGRATION -#include "Box2D/Box2D.h" -#endif - -NS_CC_EXT_BEGIN - -PhysicsSprite::PhysicsSprite() -: _ignoreBodyRotation(false) -, _CPBody(nullptr) -, _pB2Body(nullptr) -, _PTMRatio(0.0f) -, _syncTransform(nullptr) -{} - -PhysicsSprite* PhysicsSprite::create() -{ - PhysicsSprite* pRet = new (std::nothrow) PhysicsSprite(); - if (pRet && pRet->init()) - { - pRet->autorelease(); - } - else - { - CC_SAFE_DELETE(pRet); - } - - return pRet; -} - -PhysicsSprite* PhysicsSprite::createWithTexture(Texture2D *pTexture) -{ - PhysicsSprite* pRet = new (std::nothrow) PhysicsSprite(); - if (pRet && pRet->initWithTexture(pTexture)) - { - pRet->autorelease(); - } - else - { - CC_SAFE_DELETE(pRet); - } - - return pRet; -} - -PhysicsSprite* PhysicsSprite::createWithTexture(Texture2D *pTexture, const Rect& rect) -{ - PhysicsSprite* pRet = new (std::nothrow) PhysicsSprite(); - if (pRet && pRet->initWithTexture(pTexture, rect)) - { - pRet->autorelease(); - } - else - { - CC_SAFE_DELETE(pRet); - } - - return pRet; -} - -PhysicsSprite* PhysicsSprite::createWithSpriteFrame(SpriteFrame *pSpriteFrame) -{ - PhysicsSprite* pRet = new (std::nothrow) PhysicsSprite(); - if (pRet && pRet->initWithSpriteFrame(pSpriteFrame)) - { - pRet->autorelease(); - } - else - { - CC_SAFE_DELETE(pRet); - } - - return pRet; -} - -PhysicsSprite* PhysicsSprite::createWithSpriteFrameName(const char *pszSpriteFrameName) -{ - PhysicsSprite* pRet = new (std::nothrow) PhysicsSprite(); - if (pRet && pRet->initWithSpriteFrameName(pszSpriteFrameName)) - { - pRet->autorelease(); - } - else - { - CC_SAFE_DELETE(pRet); - } - - return pRet; -} - -PhysicsSprite* PhysicsSprite::create(const char *pszFileName) -{ - PhysicsSprite* pRet = new (std::nothrow) PhysicsSprite(); - if (pRet && pRet->initWithFile(pszFileName)) - { - pRet->autorelease(); - } - else - { - CC_SAFE_DELETE(pRet); - } - - return pRet; -} - -PhysicsSprite* PhysicsSprite::create(const char *pszFileName, const Rect& rect) -{ - PhysicsSprite* pRet = new (std::nothrow) PhysicsSprite(); - if (pRet && pRet->initWithFile(pszFileName, rect)) - { - pRet->autorelease(); - } - else - { - CC_SAFE_DELETE(pRet); - } - - return pRet; -} - -// this method will only get called if the sprite is batched. -// return YES if the physic's values (angles, position ) changed. -// If you return NO, then getNodeToParentTransform won't be called. -bool PhysicsSprite::isDirty() const -{ - return true; -} - -bool PhysicsSprite::isIgnoreBodyRotation() const -{ - return _ignoreBodyRotation; -} - -void PhysicsSprite::setIgnoreBodyRotation(bool bIgnoreBodyRotation) -{ - _ignoreBodyRotation = bIgnoreBodyRotation; -} - -// Override the setters and getters to always reflect the body's properties. -const Vec2& PhysicsSprite::getPosition() const -{ - return getPosFromPhysics(); -} - -void PhysicsSprite::getPosition(float* x, float* y) const -{ - if (x == nullptr || y == nullptr) { - return; - } - const Vec2& pos = getPosFromPhysics(); - *x = pos.x; - *y = pos.y; -} - -float PhysicsSprite::getPositionX() const -{ - return getPosFromPhysics().x; -} - -float PhysicsSprite::getPositionY() const -{ - return getPosFromPhysics().y; -} - -// -// Chipmunk only -// - - - -cpBody* PhysicsSprite::getCPBody() const -{ -#if CC_ENABLE_CHIPMUNK_INTEGRATION - return _CPBody; -#else - CCASSERT(false, "Can't call chipmunk methods when Chipmunk is disabled"); - return nullptr; -#endif -} - -void PhysicsSprite::setCPBody(cpBody *pBody) -{ -#if CC_ENABLE_CHIPMUNK_INTEGRATION - _CPBody = pBody; -#else - CCASSERT(false, "Can't call chipmunk methods when Chipmunk is disabled"); -#endif -} - -b2Body* PhysicsSprite::getB2Body() const -{ -#if CC_ENABLE_BOX2D_INTEGRATION - return _pB2Body; -#else - CCASSERT(false, "Can't call box2d methods when Box2d is disabled"); - return nullptr; -#endif -} - -void PhysicsSprite::setB2Body(b2Body *pBody) -{ -#if CC_ENABLE_BOX2D_INTEGRATION - _pB2Body = pBody; -#else - CCASSERT(false, "Can't call box2d methods when Box2d is disabled"); -#endif -} - -float PhysicsSprite::getPTMRatio() const -{ -#if CC_ENABLE_BOX2D_INTEGRATION - return _PTMRatio; -#else - CCASSERT(false, "Can't call box2d methods when Box2d is disabled"); - return 0; -#endif -} - -void PhysicsSprite::setPTMRatio(float fRatio) -{ -#if CC_ENABLE_BOX2D_INTEGRATION - _PTMRatio = fRatio; -#else - CCASSERT(false, "Can't call box2d methods when Box2d is disabled"); -#endif -} - -// -// Common to Box2d and Chipmunk -// - -const Vec2& PhysicsSprite::getPosFromPhysics() const -{ - static Vec2 s_physicPosion; -#if CC_ENABLE_CHIPMUNK_INTEGRATION - - cpVect cpPos = cpBodyGetPosition(_CPBody); - s_physicPosion = Vec2(cpPos.x, cpPos.y); - -#elif CC_ENABLE_BOX2D_INTEGRATION - - b2Vec2 pos = _pB2Body->GetPosition(); - float x = pos.x * _PTMRatio; - float y = pos.y * _PTMRatio; - s_physicPosion.set(x,y); -#endif - return s_physicPosion; -} - -void PhysicsSprite::setPosition(float x, float y) -{ -#if CC_ENABLE_CHIPMUNK_INTEGRATION - - cpVect cpPos = cpv(x, y); - cpBodySetPosition(_CPBody, cpPos); - -#elif CC_ENABLE_BOX2D_INTEGRATION - - float angle = _pB2Body->GetAngle(); - _pB2Body->SetTransform(b2Vec2(x / _PTMRatio, y / _PTMRatio), angle); -#endif -} - -void PhysicsSprite::setPosition(const Vec2 &pos) -{ - setPosition(pos.x, pos.y); -} - -void PhysicsSprite::setPositionX(float x) -{ - setPosition(x, getPositionY()); -} - -void PhysicsSprite::setPositionY(float y) -{ - setPosition(getPositionX(), y); -} - -float PhysicsSprite::getRotation() const -{ -#if CC_ENABLE_CHIPMUNK_INTEGRATION - - return (_ignoreBodyRotation ? Sprite::getRotation() : -CC_RADIANS_TO_DEGREES(cpBodyGetAngle(_CPBody))); - -#elif CC_ENABLE_BOX2D_INTEGRATION - - return (_ignoreBodyRotation ? Sprite::getRotation() : - CC_RADIANS_TO_DEGREES(_pB2Body->GetAngle())); -#else - return 0.0f; -#endif - -} - -void PhysicsSprite::setRotation(float fRotation) -{ - if (_ignoreBodyRotation) - { - Sprite::setRotation(fRotation); - } - -#if CC_ENABLE_CHIPMUNK_INTEGRATION - else - { - cpBodySetAngle(_CPBody, -CC_DEGREES_TO_RADIANS(fRotation)); - } - -#elif CC_ENABLE_BOX2D_INTEGRATION - else - { - b2Vec2 p = _pB2Body->GetPosition(); - float radians = CC_DEGREES_TO_RADIANS(fRotation); - _pB2Body->SetTransform(p, radians); - } -#endif - -} - -void PhysicsSprite::syncPhysicsTransform() const -{ - // Although scale is not used by physics engines, it is calculated just in case - // the sprite is animated (scaled up/down) using actions. - // For more info see: http://www.cocos2d-iphone.org/forum/topic/68990 - -#if CC_ENABLE_CHIPMUNK_INTEGRATION - - cpVect rot = (_ignoreBodyRotation ? cpvforangle(-CC_DEGREES_TO_RADIANS(_rotationX)) : cpBodyGetRotation(_CPBody)); - float x = cpBodyGetPosition(_CPBody).x + rot.x * -_anchorPointInPoints.x * _scaleX - rot.y * -_anchorPointInPoints.y * _scaleY; - float y = cpBodyGetPosition(_CPBody).y + rot.y * -_anchorPointInPoints.x * _scaleX + rot.x * -_anchorPointInPoints.y * _scaleY; - - if (_ignoreAnchorPointForPosition) - { - x += _anchorPointInPoints.x; - y += _anchorPointInPoints.y; - } - - float mat[] = { (float)rot.x * _scaleX, (float)rot.y * _scaleX, 0, 0, - (float)-rot.y * _scaleY, (float)rot.x * _scaleY, 0, 0, - 0, 0, 1, 0, - x, y, 0, 1}; - - - _transform.set(mat); - -#elif CC_ENABLE_BOX2D_INTEGRATION - - b2Vec2 pos = _pB2Body->GetPosition(); - - float x = pos.x * _PTMRatio; - float y = pos.y * _PTMRatio; - - if (_ignoreAnchorPointForPosition) - { - x += _anchorPointInPoints.x; - y += _anchorPointInPoints.y; - } - - // Make matrix - float radians = _pB2Body->GetAngle(); - float c = cosf(radians); - float s = sinf(radians); - - if (!_anchorPointInPoints.isZero()) - { - x += ((c * -_anchorPointInPoints.x * _scaleX) + (-s * -_anchorPointInPoints.y * _scaleY)); - y += ((s * -_anchorPointInPoints.x * _scaleX) + (c * -_anchorPointInPoints.y * _scaleY)); - } - - // Rot, Translate Matrix - - float mat[] = { (float)c * _scaleX, (float)s * _scaleX, 0, 0, - (float)-s * _scaleY, (float)c * _scaleY, 0, 0, - 0, 0, 1, 0, - x, y, 0, 1}; - - _transform.set(mat); -#endif -} - -void PhysicsSprite::onEnter() -{ - Node::onEnter(); - _syncTransform = Director::getInstance()->getEventDispatcher()->addCustomEventListener(Director::EVENT_AFTER_UPDATE, std::bind(&PhysicsSprite::afterUpdate, this, std::placeholders::_1)); - _syncTransform->retain(); -} - -void PhysicsSprite::onExit() -{ - if (_syncTransform != nullptr) - { - Director::getInstance()->getEventDispatcher()->removeEventListener(_syncTransform); - _syncTransform->release(); - } - Node::onExit(); -} - -void PhysicsSprite::afterUpdate(EventCustom *event) -{ - syncPhysicsTransform(); - - _transformDirty = false; - _transformUpdated = true; - setDirtyRecursively(true); -} - -NS_CC_EXT_END - -#endif // CC_ENABLE_CHIPMUNK_INTEGRATION || CC_ENABLE_BOX2D_INTEGRATION diff --git a/native/extensions/physics-nodes/CCPhysicsSprite.h b/native/extensions/physics-nodes/CCPhysicsSprite.h deleted file mode 100644 index 1ebd4c2bc3..0000000000 --- a/native/extensions/physics-nodes/CCPhysicsSprite.h +++ /dev/null @@ -1,152 +0,0 @@ -/* Copyright (c) 2012 Scott Lembcke and Howling Moon Software - * Copyright (c) 2012 cocos2d-x.org - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#ifndef __PHYSICSNODES_CCPHYSICSSPRITE_H__ -#define __PHYSICSNODES_CCPHYSICSSPRITE_H__ - -#include "2d/CCSprite.h" -#include "extensions/ExtensionMacros.h" -#include "extensions/ExtensionExport.h" -#include "base/CCEventListenerCustom.h" - -#if (CC_ENABLE_CHIPMUNK_INTEGRATION || CC_ENABLE_BOX2D_INTEGRATION) - -struct cpBody; -class b2Body; - -NS_CC_EXT_BEGIN - -/** A Sprite subclass that is bound to a physics body. - It works with: - - Chipmunk: Preprocessor macro CC_ENABLE_CHIPMUNK_INTEGRATION should be defined - - Objective-Chipmunk: Preprocessor macro CC_ENABLE_CHIPMUNK_INTEGRATION should be defined - - Box2d: Preprocessor macro CC_ENABLE_BOX2D_INTEGRATION should be defined - - Features and Limitations: - - Scale and Skew properties are ignored. - - Position and rotation are going to updated from the physics body - - If you update the rotation or position manually, the physics body will be updated - - You can't enble both Chipmunk support and Box2d support at the same time. Only one can be enabled at compile time - * @lua NA - */ -class CC_EX_DLL PhysicsSprite : public Sprite -{ -public: - - static PhysicsSprite* create(); - /** Creates an sprite with a texture. - The rect used will be the size of the texture. - The offset will be (0,0). - */ - static PhysicsSprite* createWithTexture(Texture2D *pTexture); - - /** Creates an sprite with a texture and a rect. - The offset will be (0,0). - */ - static PhysicsSprite* createWithTexture(Texture2D *pTexture, const Rect& rect); - - /** Creates an sprite with an sprite frame. */ - static PhysicsSprite* createWithSpriteFrame(SpriteFrame *pSpriteFrame); - - /** Creates an sprite with an sprite frame name. - An SpriteFrame will be fetched from the SpriteFrameCache by name. - If the SpriteFrame doesn't exist it will raise an exception. - @since v0.9 - */ - static PhysicsSprite* createWithSpriteFrameName(const char *pszSpriteFrameName); - - /** Creates an sprite with an image filename. - The rect used will be the size of the image. - The offset will be (0,0). - */ - static PhysicsSprite* create(const char *pszFileName); - - /** Creates an sprite with an image filename and a rect. - The offset will be (0,0). - */ - static PhysicsSprite* create(const char *pszFileName, const Rect& rect); - - PhysicsSprite(); - - virtual bool isDirty() const override; - - /** Keep the sprite's rotation separate from the body. */ - bool isIgnoreBodyRotation() const; - void setIgnoreBodyRotation(bool bIgnoreBodyRotation); - - // - // Chipmunk specific - // - /** Body accessor when using regular Chipmunk */ - cpBody* getCPBody() const; - void setCPBody(cpBody *pBody); - - // - // Box2d specific - // - /** Body accessor when using box2d */ - b2Body* getB2Body() const; - void setB2Body(b2Body *pBody); - - float getPTMRatio() const; - void setPTMRatio(float fPTMRatio); - virtual void syncPhysicsTransform() const; - - // overrides - virtual const Vec2& getPosition() const override; - virtual void getPosition(float* x, float* y) const override; - virtual float getPositionX() const override; - virtual float getPositionY() const override; - virtual void setPosition(const Vec2 &position) override; - virtual void setPosition(float x, float y) override; - virtual void setPositionX(float x) override; - virtual void setPositionY(float y) override; - virtual float getRotation() const override; - virtual void setRotation(float fRotation) override; - - virtual void onEnter() override; - virtual void onExit() override; - -protected: - const Vec2& getPosFromPhysics() const; - void afterUpdate(EventCustom *event); - -protected: - bool _ignoreBodyRotation; - - // chipmunk specific - cpBody *_CPBody; - - // box2d specific - b2Body *_pB2Body; - float _PTMRatio; - - // Event for update synchronise physic transform - cocos2d::EventListenerCustom* _syncTransform; -}; - -NS_CC_EXT_END - -#endif // CC_ENABLE_CHIPMUNK_INTEGRATION || CC_ENABLE_BOX2D_INTEGRATION - -#endif // __PHYSICSNODES_CCPHYSICSSPRITE_H__ - diff --git a/native/tools/tojs/cocos2dx_extension.ini b/native/tools/tojs/cocos2dx_extension.ini index e4e4647183..05f98594c5 100644 --- a/native/tools/tojs/cocos2dx_extension.ini +++ b/native/tools/tojs/cocos2dx_extension.ini @@ -29,7 +29,7 @@ replace_headers = cocos-ext.h::extensions/cocos-ext.h # what classes to produce code for. You can use regular expressions here. When testing the regular # expression, it will be enclosed in "^$", like this: "^Menu*$". -classes = AssetsManagerEx Manifest EventListenerAssetsManagerEx EventAssetsManagerEx Control.* ControlButton.* ScrollView$ TableView$ TableViewCell$ +classes = AssetsManagerEx Manifest EventListenerAssetsManagerEx EventAssetsManagerEx # what should we skip? in the format ClassName::[function function] # ClassName is a regular expression, but will be used like this: "^ClassName$" functions are also @@ -42,13 +42,6 @@ skip = ScrollView::[(g|s)etDelegate$], .*Delegate::[*], .*Loader.*::[*], *::[^visit$ copyWith.* onEnter.* onExit.* ^description$ getObjectType .*HSV onTouch.* onAcc.* onKey.* onRegisterTouchListener], - TableView::[create (g|s)etDataSource$ (g|s)etDelegate], - Control::[removeHandleOfControlEvent addHandleOfControlEvent], - ControlUtils::[*], - ControlSwitchSprite::[*], - ActionManagerEx::[initWithDictionary], - ActionNode::[initWithDictionary], - ActionObject::[initWithDictionary], Manifest::[getAssets], AssetsManagerEx::[getFailedAssets updateAssets] @@ -71,4 +64,4 @@ base_classes_to_skip = Ref # Set is special and we will use a hand-written constructor abstract_classes = -classes_need_extend = ScrollView TableView TableViewCell ControlButton ControlStepper ControlSwitch ControlSlider ControlColourPicker ControlPotentiometer +classes_need_extend =