NSScrollView.inc 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. { Parsed from AppKit.framework NSScrollView.h }
  2. {$ifdef TYPES}
  3. type
  4. NSScrollViewPtr = ^NSScrollView;
  5. {$endif}
  6. {$ifdef TYPES}
  7. type
  8. NSScrollElasticity = NSInteger;
  9. NSScrollElasticityPtr = ^NSScrollElasticity;
  10. const
  11. NSScrollElasticityAutomatic = 0;
  12. NSScrollElasticityNone = 1;
  13. NSScrollElasticityAllowed = 2;
  14. type
  15. __SFlags = bitpacked record
  16. case byte of
  17. 0: (_anonBitField___SFlags0: cuint);
  18. 1: (
  19. {$ifdef __BIG_ENDIAN__}
  20. vScrollerRequired: 0..1;
  21. hScrollerRequired: 0..1;
  22. vScrollerStatus: 0..1;
  23. hScrollerStatus: 0..1;
  24. noDynamicScrolling: 0..1;
  25. borderType: 0..((1 shl 2)-1);
  26. oldRulerInstalled: 0..1;
  27. showRulers: 0..1;
  28. hasHorizontalRuler: 0..1;
  29. hasVerticalRuler: 0..1;
  30. needsTile: 0..1;
  31. doesNotDrawBackground: 0..1;
  32. skipRemoveSuperviewCheck: 0..1;
  33. focusRingNeedsRedisplay: 0..1;
  34. hasCustomLineBorderColor: 0..1;
  35. autohidesScrollers: 0..1;
  36. autoforwardsScrollWheelEvents: 0..1;
  37. findBarVisible: 0..1;
  38. unused: 0..1;
  39. vContentElasticity: 0..((1 shl 2)-1);
  40. hContentElasticity: 0..((1 shl 2)-1);
  41. predominantAxisScrolling: 0..1;
  42. findBarPosition: 0..((1 shl 2)-1);
  43. registeredForWindowWillClose: 0..1;
  44. unarchiving: 0..1;
  45. RESERVED: 0..((1 shl 3)-1);
  46. {$else}
  47. RESERVED_: 0..((1 shl 3)-1);
  48. unarchiving_: 0..1;
  49. registeredForWindowWillClose_: 0..1;
  50. findBarPosition_: 0..((1 shl 2)-1);
  51. predominantAxisScrolling_: 0..1;
  52. hContentElasticity_: 0..((1 shl 2)-1);
  53. vContentElasticity_: 0..((1 shl 2)-1);
  54. unused_: 0..1;
  55. findBarVisible_: 0..1;
  56. autoforwardsScrollWheelEvents_: 0..1;
  57. autohidesScrollers_: 0..1;
  58. hasCustomLineBorderColor_: 0..1;
  59. focusRingNeedsRedisplay_: 0..1;
  60. skipRemoveSuperviewCheck_: 0..1;
  61. doesNotDrawBackground_: 0..1;
  62. needsTile_: 0..1;
  63. hasVerticalRuler_: 0..1;
  64. hasHorizontalRuler_: 0..1;
  65. showRulers_: 0..1;
  66. oldRulerInstalled_: 0..1;
  67. borderType_: 0..((1 shl 2)-1);
  68. noDynamicScrolling_: 0..1;
  69. hScrollerStatus_: 0..1;
  70. vScrollerStatus_: 0..1;
  71. hScrollerRequired_: 0..1;
  72. vScrollerRequired_: 0..1;
  73. {$endif}
  74. );
  75. end;
  76. type
  77. _SFlags = __SFlags;
  78. type
  79. _SFlagsPtr = ^__SFlags;
  80. type
  81. __SFlagsPtr = ^__SFlags;
  82. {$endif}
  83. {$ifdef CLASSES}
  84. type
  85. NSScrollView = objcclass external (NSView, NSTextFinderBarContainerProtocol)
  86. private
  87. _vScroller: NSScroller;
  88. _hScroller: NSScroller;
  89. _contentView: NSClipView;
  90. _headerClipView: NSClipView;
  91. _cornerView: NSView;
  92. _ruler: id;
  93. _sFlags: _SFlags;
  94. _extraIvars: pointer;
  95. _horizontalRuler: NSRulerView;
  96. _verticalRuler: NSRulerView;
  97. public
  98. function initWithFrame (frameRect: NSRect): instancetype; message 'initWithFrame:'; { NS_DESIGNATED_INITIALIZER }
  99. function initWithCoder (coder: NSCoder): instancetype; message 'initWithCoder:'; { NS_DESIGNATED_INITIALIZER }
  100. class function frameSizeForContentSize_horizontalScrollerClass_verticalScrollerClass_borderType_controlSize_scrollerStyle (cSize: NSSize; horizontalScrollerClass: pobjc_class; verticalScrollerClass: pobjc_class; aType: NSBorderType; controlSize: NSControlSize; scrollerStyle: NSScrollerStyle): NSSize; message 'frameSizeForContentSize:horizontalScrollerClass:verticalScrollerClass:borderType:controlSize:scrollerStyle:'; { available in 10_7 }
  101. class function contentSizeForFrameSize_horizontalScrollerClass_verticalScrollerClass_borderType_controlSize_scrollerStyle (fSize: NSSize; horizontalScrollerClass: pobjc_class; verticalScrollerClass: pobjc_class; aType: NSBorderType; controlSize: NSControlSize; scrollerStyle: NSScrollerStyle): NSSize; message 'contentSizeForFrameSize:horizontalScrollerClass:verticalScrollerClass:borderType:controlSize:scrollerStyle:'; { available in 10_7 }
  102. class function frameSizeForContentSize_hasHorizontalScroller_hasVerticalScroller_borderType (cSize: NSSize; hFlag: ObjCBOOL; vFlag: ObjCBOOL; aType: NSBorderType): NSSize; message 'frameSizeForContentSize:hasHorizontalScroller:hasVerticalScroller:borderType:'; deprecated 'in 10_0, 10_7, "Use +frameSizeForContentSize:horizontalScrollerClass:verticalScrollerClass:borderType:controlSize:scrollerStyle: instead"';
  103. class function contentSizeForFrameSize_hasHorizontalScroller_hasVerticalScroller_borderType (fSize: NSSize; hFlag: ObjCBOOL; vFlag: ObjCBOOL; aType: NSBorderType): NSSize; message 'contentSizeForFrameSize:hasHorizontalScroller:hasVerticalScroller:borderType:'; deprecated 'in 10_0, 10_7, "+contentSizeForFrameSize:horizontalScrollerClass:verticalScrollerClass:borderType:controlSize:scrollerStyle: instead"';
  104. function documentVisibleRect: NSRect; message 'documentVisibleRect';
  105. function contentSize: NSSize; message 'contentSize';
  106. procedure setDocumentView(newValue: NSView); message 'setDocumentView:';
  107. function documentView: NSView; message 'documentView';
  108. procedure setContentView(newValue: NSClipView); message 'setContentView:';
  109. function contentView: NSClipView; message 'contentView';
  110. procedure setDocumentCursor(newValue: NSCursor); message 'setDocumentCursor:';
  111. function documentCursor: NSCursor; message 'documentCursor';
  112. procedure setBorderType(newValue: NSBorderType); message 'setBorderType:';
  113. function borderType: NSBorderType; message 'borderType';
  114. procedure setBackgroundColor(newValue: NSColor); message 'setBackgroundColor:';
  115. function backgroundColor: NSColor; message 'backgroundColor';
  116. procedure setDrawsBackground(newValue: ObjCBOOL); message 'setDrawsBackground:';
  117. function drawsBackground: ObjCBOOL; message 'drawsBackground';
  118. procedure setHasVerticalScroller(newValue: ObjCBOOL); message 'setHasVerticalScroller:';
  119. function hasVerticalScroller: ObjCBOOL; message 'hasVerticalScroller';
  120. procedure setHasHorizontalScroller(newValue: ObjCBOOL); message 'setHasHorizontalScroller:';
  121. function hasHorizontalScroller: ObjCBOOL; message 'hasHorizontalScroller';
  122. procedure setVerticalScroller(newValue: NSScroller); message 'setVerticalScroller:';
  123. function verticalScroller: NSScroller; message 'verticalScroller';
  124. procedure setHorizontalScroller(newValue: NSScroller); message 'setHorizontalScroller:';
  125. function horizontalScroller: NSScroller; message 'horizontalScroller';
  126. procedure setAutohidesScrollers(newValue: ObjCBOOL); message 'setAutohidesScrollers:';
  127. function autohidesScrollers: ObjCBOOL; message 'autohidesScrollers';
  128. procedure setHorizontalLineScroll(newValue: CGFloat); message 'setHorizontalLineScroll:';
  129. function horizontalLineScroll: CGFloat; message 'horizontalLineScroll';
  130. procedure setVerticalLineScroll(newValue: CGFloat); message 'setVerticalLineScroll:';
  131. function verticalLineScroll: CGFloat; message 'verticalLineScroll';
  132. procedure setLineScroll(newValue: CGFloat); message 'setLineScroll:';
  133. function lineScroll: CGFloat; message 'lineScroll';
  134. procedure setHorizontalPageScroll(newValue: CGFloat); message 'setHorizontalPageScroll:';
  135. function horizontalPageScroll: CGFloat; message 'horizontalPageScroll';
  136. procedure setVerticalPageScroll(newValue: CGFloat); message 'setVerticalPageScroll:';
  137. function verticalPageScroll: CGFloat; message 'verticalPageScroll';
  138. procedure setPageScroll(newValue: CGFloat); message 'setPageScroll:';
  139. function pageScroll: CGFloat; message 'pageScroll';
  140. procedure setScrollsDynamically(newValue: ObjCBOOL); message 'setScrollsDynamically:';
  141. function scrollsDynamically: ObjCBOOL; message 'scrollsDynamically';
  142. procedure tile; message 'tile';
  143. procedure reflectScrolledClipView (cView: NSClipView); message 'reflectScrolledClipView:';
  144. procedure scrollWheel (theEvent: NSEvent); message 'scrollWheel:';
  145. procedure setScrollerStyle(newValue: NSScrollerStyle); message 'setScrollerStyle:';
  146. function scrollerStyle: NSScrollerStyle; message 'scrollerStyle';
  147. procedure setScrollerKnobStyle(newValue: NSScrollerKnobStyle); message 'setScrollerKnobStyle:';
  148. function scrollerKnobStyle: NSScrollerKnobStyle; message 'scrollerKnobStyle';
  149. procedure flashScrollers; message 'flashScrollers'; { available in 10_7 }
  150. procedure setHorizontalScrollElasticity(newValue: NSScrollElasticity); message 'setHorizontalScrollElasticity:';
  151. function horizontalScrollElasticity: NSScrollElasticity; message 'horizontalScrollElasticity';
  152. procedure setVerticalScrollElasticity(newValue: NSScrollElasticity); message 'setVerticalScrollElasticity:';
  153. function verticalScrollElasticity: NSScrollElasticity; message 'verticalScrollElasticity';
  154. procedure setUsesPredominantAxisScrolling(newValue: ObjCBOOL); message 'setUsesPredominantAxisScrolling:';
  155. function usesPredominantAxisScrolling: ObjCBOOL; message 'usesPredominantAxisScrolling';
  156. procedure setAllowsMagnification(newValue: ObjCBOOL); message 'setAllowsMagnification:';
  157. function allowsMagnification: ObjCBOOL; message 'allowsMagnification';
  158. procedure setMagnification(newValue: CGFloat); message 'setMagnification:';
  159. function magnification: CGFloat; message 'magnification';
  160. procedure setMaxMagnification(newValue: CGFloat); message 'setMaxMagnification:';
  161. function maxMagnification: CGFloat; message 'maxMagnification';
  162. procedure setMinMagnification(newValue: CGFloat); message 'setMinMagnification:';
  163. function minMagnification: CGFloat; message 'minMagnification';
  164. procedure magnifyToFitRect (rect: NSRect); message 'magnifyToFitRect:'; { available in 10_8 }
  165. procedure setMagnification_centeredAtPoint (magnification_: CGFloat; point: NSPoint); message 'setMagnification:centeredAtPoint:'; { available in 10_8 }
  166. procedure addFloatingSubview_forAxis (view: NSView; axis: NSEventGestureAxis); message 'addFloatingSubview:forAxis:'; { available in 10_9 }
  167. procedure setAutomaticallyAdjustsContentInsets(newValue: ObjCBOOL); message 'setAutomaticallyAdjustsContentInsets:';
  168. function automaticallyAdjustsContentInsets: ObjCBOOL; message 'automaticallyAdjustsContentInsets';
  169. procedure setContentInsets(newValue: NSEdgeInsets); message 'setContentInsets:';
  170. function contentInsets: NSEdgeInsets; message 'contentInsets';
  171. procedure setScrollerInsets(newValue: NSEdgeInsets); message 'setScrollerInsets:';
  172. function scrollerInsets: NSEdgeInsets; message 'scrollerInsets';
  173. { Adopted protocols }
  174. procedure setFindBarView(newValue: NSView); message 'setFindBarView:';
  175. function findBarView: NSView; message 'findBarView';
  176. procedure findBarViewDidChangeHeight; message 'findBarViewDidChangeHeight';
  177. procedure setFindBarVisible(newValue: ObjCBOOL); message 'setFindBarVisible:';
  178. function isFindBarVisible: ObjCBOOL; message 'isFindBarVisible';
  179. end;
  180. {$endif}
  181. {$ifdef EXTERNAL_SYMBOLS}
  182. var
  183. NSScrollViewWillStartLiveMagnifyNotification: NSString { available in 10_8 }; cvar; external;
  184. NSScrollViewDidEndLiveMagnifyNotification: NSString { available in 10_8 }; cvar; external;
  185. NSScrollViewWillStartLiveScrollNotification: NSString { available in 10_9 }; cvar; external;
  186. NSScrollViewDidLiveScrollNotification: NSString { available in 10_9 }; cvar; external;
  187. NSScrollViewDidEndLiveScrollNotification: NSString { available in 10_9 }; cvar; external;
  188. {$endif}
  189. {$ifdef CLASSES}
  190. type
  191. NSRulerSupport = objccategory external (NSScrollView)
  192. class procedure setRulerViewClass (rulerViewClass: pobjc_class); message 'setRulerViewClass:';
  193. class function rulerViewClass: pobjc_class; message 'rulerViewClass';
  194. procedure setRulersVisible(newValue: ObjCBOOL); message 'setRulersVisible:';
  195. function rulersVisible: ObjCBOOL; message 'rulersVisible';
  196. procedure setHasHorizontalRuler(newValue: ObjCBOOL); message 'setHasHorizontalRuler:';
  197. function hasHorizontalRuler: ObjCBOOL; message 'hasHorizontalRuler';
  198. procedure setHasVerticalRuler(newValue: ObjCBOOL); message 'setHasVerticalRuler:';
  199. function hasVerticalRuler: ObjCBOOL; message 'hasVerticalRuler';
  200. procedure setHorizontalRulerView(newValue: NSRulerView); message 'setHorizontalRulerView:';
  201. function horizontalRulerView: NSRulerView; message 'horizontalRulerView';
  202. procedure setVerticalRulerView(newValue: NSRulerView); message 'setVerticalRulerView:';
  203. function verticalRulerView: NSRulerView; message 'verticalRulerView';
  204. end;
  205. {$endif}
  206. {$ifdef TYPES}
  207. type
  208. NSScrollViewFindBarPosition = NSInteger;
  209. NSScrollViewFindBarPositionPtr = ^NSScrollViewFindBarPosition;
  210. const
  211. NSScrollViewFindBarPositionAboveHorizontalRuler = 0;
  212. NSScrollViewFindBarPositionAboveContent = 1;
  213. NSScrollViewFindBarPositionBelowContent = 2;
  214. {$endif}
  215. {$ifdef CLASSES}
  216. type
  217. NSFindBarSupport = objccategory external (NSScrollView)
  218. procedure setFindBarPosition(newValue: NSScrollViewFindBarPosition); message 'setFindBarPosition:';
  219. function findBarPosition: NSScrollViewFindBarPosition; message 'findBarPosition';
  220. end;
  221. {$endif}