NSAnimation.inc 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. { Parsed from Appkit.framework NSAnimation.h }
  2. {$ifdef TYPES}
  3. {$ifndef NSANIMATION_PAS_T}
  4. {$define NSANIMATION_PAS_T}
  5. { Constants }
  6. const
  7. NSAnimationEaseInOut = 0;
  8. NSAnimationEaseIn = 1;
  9. NSAnimationEaseOut = 2;
  10. NSAnimationLinear = 3;
  11. const
  12. NSAnimationBlocking = 0;
  13. NSAnimationNonblocking = 1;
  14. NSAnimationNonblockingThreaded = 2;
  15. { Types }
  16. type
  17. NSAnimationCurve = NSUInteger;
  18. NSAnimationCurvePtr = ^NSAnimationCurve;
  19. NSAnimationBlockingMode = NSUInteger;
  20. NSAnimationBlockingModePtr = ^NSAnimationBlockingMode;
  21. NSAnimationProgress = single;
  22. NSAnimationProgressPtr = ^NSAnimationProgress;
  23. {$endif}
  24. {$endif}
  25. {$ifdef RECORDS}
  26. {$ifndef NSANIMATION_PAS_R}
  27. {$define NSANIMATION_PAS_R}
  28. {$endif}
  29. {$endif}
  30. {$ifdef FUNCTIONS}
  31. {$ifndef NSANIMATION_PAS_F}
  32. {$define NSANIMATION_PAS_F}
  33. {$endif}
  34. {$endif}
  35. {$ifdef EXTERNAL_SYMBOLS}
  36. {$ifndef NSANIMATION_PAS_S}
  37. {$define NSANIMATION_PAS_S}
  38. { External string constants }
  39. var
  40. NSAnimationProgressMarkNotification: NSString; cvar; external;
  41. NSAnimationProgressMark: NSString; cvar; external;
  42. NSViewAnimationTargetKey: NSString; cvar; external;
  43. NSViewAnimationStartFrameKey: NSString; cvar; external;
  44. NSViewAnimationEndFrameKey: NSString; cvar; external;
  45. NSViewAnimationEffectKey: NSString; cvar; external;
  46. NSViewAnimationFadeInEffect: NSString; cvar; external;
  47. NSViewAnimationFadeOutEffect: NSString; cvar; external;
  48. NSAnimationTriggerOrderIn: NSString; cvar; external;
  49. NSAnimationTriggerOrderOut: NSString; cvar; external;
  50. {$endif}
  51. {$endif}
  52. {$ifdef FORWARD}
  53. NSAnimationDelegateProtocol = objcprotocol;
  54. NSAnimatablePropertyContainerProtocol = objcprotocol;
  55. NSAnimation = objcclass;
  56. NSAnimationPointer = ^NSAnimation;
  57. NSAnimationPtr = NSAnimationPointer;
  58. NSViewAnimation = objcclass;
  59. NSViewAnimationPointer = ^NSViewAnimation;
  60. NSViewAnimationPtr = NSViewAnimationPointer;
  61. {$endif}
  62. {$ifdef CLASSES}
  63. {$ifndef NSANIMATION_PAS_C}
  64. {$define NSANIMATION_PAS_C}
  65. { NSAnimation }
  66. NSAnimation = objcclass external (NSObject, NSCopyingProtocol, NSCodingProtocol)
  67. private
  68. _duration: NSTimeInterval;
  69. _currentProgress: NSAnimationProgress;
  70. _framesPerSecond: single;
  71. _delegate: id;
  72. _timer: NSTimer;
  73. _startTime: NSTimeInterval;
  74. _progressMarks: NSMutableArray;
  75. _startAnimation: NSAnimation;
  76. _stopAnimation: NSAnimation;
  77. _nextProgressMark: cint;
  78. __aFlags: record
  79. case byte of
  80. 0: (_anonbitfield_NSAnimation0: cuint);
  81. 1: (data: bitpacked record
  82. delegateAnimationShouldStart: 0..1;
  83. delegateAnimationDidStop: 0..1;
  84. delegateAnimationDidEnd: 0..1;
  85. delegateAnimationValueForProgress: 0..1;
  86. delegateAnimationDidReachProgressMark: 0..1;
  87. animating: 0..1;
  88. blocking: 0..1;
  89. reserved: 0..((1 shl 25)-1);
  90. end;
  91. );
  92. end;
  93. __aSettings: record
  94. case byte of
  95. 0: (_anonbitfield_NSAnimation1: cuint);
  96. 1: (data: bitpacked record
  97. _animationCurve: 0..((1 shl 8)-1);
  98. _animationBlockingMode: 0..((1 shl 2)-1);
  99. reserved: 0..((1 shl 22)-1);
  100. end;
  101. );
  102. end;
  103. _scheduledRunLoop: NSRunLoop;
  104. _reserved2: NSInteger;
  105. _reserved3: NSInteger;
  106. _reserved4: NSInteger;
  107. public
  108. function initWithDuration_animationCurve(duration_: NSTimeInterval; animationCurve_: NSAnimationCurve): id; message 'initWithDuration:animationCurve:';
  109. procedure startAnimation; message 'startAnimation';
  110. procedure stopAnimation; message 'stopAnimation';
  111. function isAnimating: Boolean; message 'isAnimating';
  112. function currentProgress: NSAnimationProgress; message 'currentProgress';
  113. procedure setCurrentProgress(progress: NSAnimationProgress); message 'setCurrentProgress:';
  114. procedure setDuration(duration_: NSTimeInterval); message 'setDuration:';
  115. function duration: NSTimeInterval; message 'duration';
  116. function animationBlockingMode: NSAnimationBlockingMode; message 'animationBlockingMode';
  117. procedure setAnimationBlockingMode(animationBlockingMode_: NSAnimationBlockingMode); message 'setAnimationBlockingMode:';
  118. procedure setFrameRate(framesPerSecond: single); message 'setFrameRate:';
  119. function frameRate: single; message 'frameRate';
  120. procedure setAnimationCurve(curve: NSAnimationCurve); message 'setAnimationCurve:';
  121. function animationCurve: NSAnimationCurve; message 'animationCurve';
  122. function currentValue: single; message 'currentValue';
  123. procedure setDelegate(delegate_: NSAnimationDelegateProtocol); message 'setDelegate:';
  124. function delegate: NSAnimationDelegateProtocol; message 'delegate';
  125. function progressMarks: NSArray; message 'progressMarks';
  126. procedure setProgressMarks(progressMarks_: NSArray); message 'setProgressMarks:';
  127. procedure addProgressMark(progressMark: NSAnimationProgress); message 'addProgressMark:';
  128. procedure removeProgressMark(progressMark: NSAnimationProgress); message 'removeProgressMark:';
  129. procedure startWhenAnimation_reachesProgress(animation: NSAnimation; startProgress: NSAnimationProgress); message 'startWhenAnimation:reachesProgress:';
  130. procedure stopWhenAnimation_reachesProgress(animation: NSAnimation; stopProgress: NSAnimationProgress); message 'stopWhenAnimation:reachesProgress:';
  131. procedure clearStartAnimation; message 'clearStartAnimation';
  132. procedure clearStopAnimation; message 'clearStopAnimation';
  133. function runLoopModesForAnimating: NSArray; message 'runLoopModesForAnimating';
  134. { Adopted Protocols }
  135. function copyWithZone(zone_: NSZonePtr): id;
  136. procedure encodeWithCoder(aCoder: NSCoder);
  137. function initWithCoder(aDecoder: NSCoder): id;
  138. end;
  139. { NSViewAnimation }
  140. NSViewAnimation = objcclass external (NSAnimation)
  141. private
  142. _viewAnimations: NSArray;
  143. _viewAnimationInfo: CFMutableDictionaryRef;
  144. _windowAnimationInfo: CFMutableDictionaryRef;
  145. _reserved4a: NSUInteger;
  146. _reserved4b: NSUInteger;
  147. _reserved4c: NSUInteger;
  148. __vaFlags: record
  149. case byte of
  150. 0: (_anonbitfield_NSAnimation2: cuint);
  151. 1: (data: bitpacked record
  152. reserved: 0..((1 shl 32)-1);
  153. end;
  154. );
  155. end;
  156. _reserved5: NSUInteger;
  157. _reserved6: NSUInteger;
  158. _reserved7: NSUInteger;
  159. _reserved8: NSUInteger;
  160. public
  161. function initWithViewAnimations(viewAnimations_: NSArray): id; message 'initWithViewAnimations:';
  162. function viewAnimations: NSArray; message 'viewAnimations';
  163. procedure setViewAnimations(viewAnimations_: NSArray); message 'setViewAnimations:';
  164. end;
  165. {$endif}
  166. {$endif}
  167. {$ifdef PROTOCOLS}
  168. {$ifndef NSANIMATION_PAS_P}
  169. {$define NSANIMATION_PAS_P}
  170. { NSAnimationDelegate Protocol }
  171. NSAnimationDelegateProtocol = objcprotocol external name 'NSAnimationDelegate'
  172. optional
  173. function animationShouldStart(animation: NSAnimation): Boolean; message 'animationShouldStart:';
  174. procedure animationDidStop(animation: NSAnimation); message 'animationDidStop:';
  175. procedure animationDidEnd(animation: NSAnimation); message 'animationDidEnd:';
  176. function animation_valueForProgress(animation: NSAnimation; progress: NSAnimationProgress): single; message 'animation:valueForProgress:';
  177. procedure animation_didReachProgressMark(animation: NSAnimation; progress: NSAnimationProgress); message 'animation:didReachProgressMark:';
  178. end;
  179. { NSAnimatablePropertyContainer Protocol }
  180. NSAnimatablePropertyContainerProtocol = objcprotocol external name 'NSAnimatablePropertyContainer'
  181. optional
  182. function animator: id; message 'animator';
  183. function animations: NSDictionary; message 'animations';
  184. procedure setAnimations(dict: NSDictionary); message 'setAnimations:';
  185. function animationForKey(key: NSString): id; message 'animationForKey:';
  186. end;
  187. {$endif}
  188. {$endif}