mesh_attachment.dart 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. //
  2. // Spine Runtimes License Agreement
  3. // Last updated April 5, 2025. Replaces all prior versions.
  4. //
  5. // Copyright (c) 2013-2025, Esoteric Software LLC
  6. //
  7. // Integration of the Spine Runtimes into software or otherwise creating
  8. // derivative works of the Spine Runtimes is permitted under the terms and
  9. // conditions of Section 2 of the Spine Editor License Agreement:
  10. // http://esotericsoftware.com/spine-editor-license
  11. //
  12. // Otherwise, it is permitted to integrate the Spine Runtimes into software
  13. // or otherwise create derivative works of the Spine Runtimes (collectively,
  14. // "Products"), provided that each user of the Products must obtain their own
  15. // Spine Editor license and redistribution of the Products in any form must
  16. // include this license and copyright notice.
  17. //
  18. // THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
  19. // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  20. // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  21. // DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
  22. // DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  23. // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
  24. // BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
  25. // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  26. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  27. // THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  28. //
  29. // AUTO GENERATED FILE, DO NOT EDIT.
  30. import 'dart:ffi';
  31. import 'package:ffi/ffi.dart';
  32. import 'spine_dart_bindings_generated.dart';
  33. import '../spine_bindings.dart';
  34. import 'arrays.dart';
  35. import 'color.dart';
  36. import 'sequence.dart';
  37. import 'texture_region.dart';
  38. import 'vertex_attachment.dart';
  39. /// MeshAttachment wrapper
  40. class MeshAttachment extends VertexAttachment {
  41. final Pointer<spine_mesh_attachment_wrapper> _ptr;
  42. MeshAttachment.fromPointer(this._ptr) : super.fromPointer(_ptr.cast());
  43. /// Get the native pointer for FFI calls
  44. @override
  45. Pointer get nativePtr => _ptr;
  46. factory MeshAttachment(String name) {
  47. final ptr = SpineBindings.bindings.spine_mesh_attachment_create(name.toNativeUtf8().cast<Char>());
  48. return MeshAttachment.fromPointer(ptr);
  49. }
  50. void dispose() {
  51. SpineBindings.bindings.spine_mesh_attachment_dispose(_ptr);
  52. }
  53. void updateRegion() {
  54. SpineBindings.bindings.spine_mesh_attachment_update_region(_ptr);
  55. }
  56. int get hullLength {
  57. final result = SpineBindings.bindings.spine_mesh_attachment_get_hull_length(_ptr);
  58. return result;
  59. }
  60. set hullLength(int value) {
  61. SpineBindings.bindings.spine_mesh_attachment_set_hull_length(_ptr, value);
  62. }
  63. ArrayFloat get regionUVs {
  64. final result = SpineBindings.bindings.spine_mesh_attachment_get_region_u_vs(_ptr);
  65. return ArrayFloat.fromPointer(result);
  66. }
  67. set regionUVs(ArrayFloat value) {
  68. SpineBindings.bindings.spine_mesh_attachment_set_region_u_vs(_ptr, value.nativePtr.cast());
  69. }
  70. ArrayFloat get uVs {
  71. final result = SpineBindings.bindings.spine_mesh_attachment_get_u_vs(_ptr);
  72. return ArrayFloat.fromPointer(result);
  73. }
  74. ArrayUnsignedShort get triangles {
  75. final result = SpineBindings.bindings.spine_mesh_attachment_get_triangles(_ptr);
  76. return ArrayUnsignedShort.fromPointer(result);
  77. }
  78. set triangles(ArrayUnsignedShort value) {
  79. SpineBindings.bindings.spine_mesh_attachment_set_triangles(_ptr, value.nativePtr.cast());
  80. }
  81. Color get color {
  82. final result = SpineBindings.bindings.spine_mesh_attachment_get_color(_ptr);
  83. return Color.fromPointer(result);
  84. }
  85. String get path {
  86. final result = SpineBindings.bindings.spine_mesh_attachment_get_path(_ptr);
  87. return result.cast<Utf8>().toDartString();
  88. }
  89. set path(String value) {
  90. SpineBindings.bindings.spine_mesh_attachment_set_path(_ptr, value.toNativeUtf8().cast<Char>());
  91. }
  92. TextureRegion? get region {
  93. final result = SpineBindings.bindings.spine_mesh_attachment_get_region(_ptr);
  94. return result.address == 0 ? null : TextureRegion.fromPointer(result);
  95. }
  96. set region(TextureRegion? value) {
  97. SpineBindings.bindings.spine_mesh_attachment_set_region(_ptr, value?.nativePtr.cast() ?? Pointer.fromAddress(0));
  98. }
  99. Sequence? get sequence {
  100. final result = SpineBindings.bindings.spine_mesh_attachment_get_sequence(_ptr);
  101. return result.address == 0 ? null : Sequence.fromPointer(result);
  102. }
  103. set sequence(Sequence? value) {
  104. SpineBindings.bindings.spine_mesh_attachment_set_sequence(_ptr, value?.nativePtr.cast() ?? Pointer.fromAddress(0));
  105. }
  106. MeshAttachment? get parentMesh {
  107. final result = SpineBindings.bindings.spine_mesh_attachment_get_parent_mesh(_ptr);
  108. return result.address == 0 ? null : MeshAttachment.fromPointer(result);
  109. }
  110. set parentMesh(MeshAttachment? value) {
  111. SpineBindings.bindings
  112. .spine_mesh_attachment_set_parent_mesh(_ptr, value?.nativePtr.cast() ?? Pointer.fromAddress(0));
  113. }
  114. ArrayUnsignedShort get edges {
  115. final result = SpineBindings.bindings.spine_mesh_attachment_get_edges(_ptr);
  116. return ArrayUnsignedShort.fromPointer(result);
  117. }
  118. set edges(ArrayUnsignedShort value) {
  119. SpineBindings.bindings.spine_mesh_attachment_set_edges(_ptr, value.nativePtr.cast());
  120. }
  121. double get width {
  122. final result = SpineBindings.bindings.spine_mesh_attachment_get_width(_ptr);
  123. return result;
  124. }
  125. set width(double value) {
  126. SpineBindings.bindings.spine_mesh_attachment_set_width(_ptr, value);
  127. }
  128. double get height {
  129. final result = SpineBindings.bindings.spine_mesh_attachment_get_height(_ptr);
  130. return result;
  131. }
  132. set height(double value) {
  133. SpineBindings.bindings.spine_mesh_attachment_set_height(_ptr, value);
  134. }
  135. MeshAttachment newLinkedMesh() {
  136. final result = SpineBindings.bindings.spine_mesh_attachment_new_linked_mesh(_ptr);
  137. return MeshAttachment.fromPointer(result);
  138. }
  139. }