NSCell.inc 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412
  1. { Parsed from Appkit.framework NSCell.h }
  2. {$ifdef TYPES}
  3. {$ifndef NSCELL_PAS_T}
  4. {$define NSCELL_PAS_T}
  5. { Constants }
  6. const
  7. NSAnyType = 0;
  8. NSIntType = 1;
  9. NSPositiveIntType = 2;
  10. NSFloatType = 3;
  11. NSPositiveFloatType = 4;
  12. NSDoubleType = 6;
  13. NSPositiveDoubleType = 7;
  14. const
  15. NSNullCellType = 0;
  16. NSTextCellType = 1;
  17. NSImageCellType = 2;
  18. const
  19. NSCellDisabled = 0;
  20. NSCellState = 1;
  21. NSPushInCell = 2;
  22. NSCellEditable = 3;
  23. NSChangeGrayCell = 4;
  24. NSCellHighlighted = 5;
  25. NSCellLightsByContents = 6;
  26. NSCellLightsByGray = 7;
  27. NSChangeBackgroundCell = 8;
  28. NSCellLightsByBackground = 9;
  29. NSCellIsBordered = 10;
  30. NSCellHasOverlappingImage = 11;
  31. NSCellHasImageHorizontal = 12;
  32. NSCellHasImageOnLeftOrBottom = 13;
  33. NSCellChangesContents = 14;
  34. NSCellIsInsetButton = 15;
  35. NSCellAllowsMixedState = 16;
  36. const
  37. NSNoImage = 0;
  38. NSImageOnly = 1;
  39. NSImageLeft = 2;
  40. NSImageRight = 3;
  41. NSImageBelow = 4;
  42. NSImageAbove = 5;
  43. NSImageOverlaps = 6;
  44. const
  45. NSImageScaleProportionallyDown = 0;
  46. NSImageScaleAxesIndependently = 0;
  47. NSImageScaleNone = 1;
  48. NSImageScaleProportionallyUpOrDown = 2;
  49. const
  50. NSMixedState = -1;
  51. NSOffState = 0;
  52. NSOnState = 1;
  53. const
  54. NSNoCellMask = 0;
  55. NSContentsCellMask = 1;
  56. NSPushInCellMask = 2;
  57. NSChangeGrayCellMask = 4;
  58. NSChangeBackgroundCellMask = 8;
  59. const
  60. NSDefaultControlTint = 0;
  61. NSBlueControlTint = 1;
  62. NSGraphiteControlTint = 6;
  63. NSClearControlTint = 7;
  64. const
  65. NSRegularControlSize = 0;
  66. NSSmallControlSize = 1;
  67. NSMiniControlSize = 2;
  68. const
  69. NSCellHitNone = 0;
  70. NSCellHitContentArea = 1 shl 0;
  71. NSCellHitEditableTextArea = 1 shl 1;
  72. NSCellHitTrackableArea = 1 shl 2;
  73. const
  74. NSBackgroundStyleLight = 0;
  75. NSBackgroundStyleDark = 0;
  76. NSBackgroundStyleRaised = 1;
  77. NSBackgroundStyleLowered = 2;
  78. const
  79. NSScaleProportionally = 0;
  80. NSScaleToFit = 0;
  81. NSScaleNone = 1;
  82. { Types }
  83. type
  84. NSCellType = NSUInteger;
  85. NSCellTypePtr = ^NSCellType;
  86. NSCellAttribute = NSUInteger;
  87. NSCellAttributePtr = ^NSCellAttribute;
  88. NSCellImagePosition = NSUInteger;
  89. NSCellImagePositionPtr = ^NSCellImagePosition;
  90. NSImageScaling = NSUInteger;
  91. NSImageScalingPtr = ^NSImageScaling;
  92. NSCellStateValue = NSInteger;
  93. NSCellStateValuePtr = ^NSCellStateValue;
  94. NSControlTint = NSUInteger;
  95. NSControlTintPtr = ^NSControlTint;
  96. NSControlSize = NSUInteger;
  97. NSControlSizePtr = ^NSControlSize;
  98. NSBackgroundStyle = NSInteger;
  99. NSBackgroundStylePtr = ^NSBackgroundStyle;
  100. {$endif}
  101. {$endif}
  102. {$ifdef RECORDS}
  103. {$ifndef NSCELL_PAS_R}
  104. {$define NSCELL_PAS_R}
  105. { Records }
  106. type
  107. __CFlags = bitpacked record
  108. case byte of
  109. 0: (_anonbitfield_NSCell0: cuint);
  110. 1: (
  111. state: 0..1;
  112. highlighted: 0..1;
  113. disabled: 0..1;
  114. editable: 0..1;
  115. _type: 0..((1 shl 2)-1);
  116. vCentered: 0..1;
  117. hCentered: 0..1;
  118. bordered: 0..1;
  119. bezeled: 0..1;
  120. selectable: 0..1;
  121. scrollable: 0..1;
  122. continuous: 0..1;
  123. actOnMouseDown: 0..1;
  124. isLeaf: 0..1;
  125. invalidObjectValue: 0..1;
  126. invalidFont: 0..1;
  127. lineBreakMode: 0..((1 shl 3)-1);
  128. cellReserved1: 0..((1 shl 2)-1);
  129. singleLineMode: 0..1;
  130. actOnMouseDragged: 0..1;
  131. isLoaded: 0..1;
  132. truncateLastLine: 0..1;
  133. dontActOnMouseUp: 0..1;
  134. isWhite: 0..1;
  135. useUserKeyEquivalent: 0..1;
  136. showsFirstResponder: 0..1;
  137. focusRingType: 0..((1 shl 2)-1);
  138. wasSelectable: 0..1;
  139. hasInvalidObject: 0..1;
  140. allowsEditingTextAttributes: 0..1;
  141. importsGraphics: 0..1;
  142. alignment: 0..((1 shl 3)-1);
  143. layoutDirectionRTL: 0..1;
  144. backgroundStyle: 0..((1 shl 3)-1);
  145. cellReserved2: 0..((1 shl 4)-1);
  146. refusesFirstResponder: 0..1;
  147. needsHighlightedText: 0..1;
  148. dontAllowsUndo: 0..1;
  149. currentlyEditing: 0..1;
  150. allowsMixedState: 0..1;
  151. inMixedState: 0..1;
  152. sendsActionOnEndEditing: 0..1;
  153. inSendAction: 0..1;
  154. menuWasSet: 0..1;
  155. controlTint: 0..((1 shl 3)-1);
  156. controlSize: 0..((1 shl 2)-1);
  157. branchImageDisabled: 0..1;
  158. drawingInRevealover: 0..1;
  159. needsHighlightedTextHint: 0..1;
  160. );
  161. end;
  162. _CFlags = __CFlags;
  163. __CFlagsPtr = ^__CFlags;
  164. {$endif}
  165. {$endif}
  166. {$ifdef FUNCTIONS}
  167. {$ifndef NSCELL_PAS_F}
  168. {$define NSCELL_PAS_F}
  169. { Functions }
  170. procedure NSDrawThreePartImage(frame: NSRect; startCap: NSImage; centerFill: NSImage; endCap: NSImage; vertical: Boolean; op: NSCompositingOperation; alphaFraction: CGFloat; flipped: Boolean); cdecl; external;
  171. procedure NSDrawNinePartImage(frame: NSRect; topLeftCorner: NSImage; topEdgeFill: NSImage; topRightCorner: NSImage; leftEdgeFill: NSImage; centerFill: NSImage; rightEdgeFill: NSImage; bottomLeftCorner: NSImage; bottomEdgeFill: NSImage; bottomRightCorner: NSImage; op: NSCompositingOperation; alphaFraction: CGFloat; flipped: Boolean); cdecl; external;
  172. {$endif}
  173. {$endif}
  174. {$ifdef EXTERNAL_SYMBOLS}
  175. {$ifndef NSCELL_PAS_S}
  176. {$define NSCELL_PAS_S}
  177. { External string constants }
  178. var
  179. NSControlTintDidChangeNotification: NSString; cvar; external;
  180. {$endif}
  181. {$endif}
  182. {$ifdef FORWARD}
  183. NSCell = objcclass;
  184. NSCellPointer = ^NSCell;
  185. NSCellPtr = NSCellPointer;
  186. {$endif}
  187. {$ifdef CLASSES}
  188. {$ifndef NSCELL_PAS_C}
  189. {$define NSCELL_PAS_C}
  190. { NSCell }
  191. NSCell = objcclass external (NSObject, NSCopyingProtocol, NSCodingProtocol)
  192. private
  193. _contents: id;
  194. _cFlags: _CFlags;
  195. _support: id;
  196. public
  197. class function prefersTrackingUntilMouseUp: Boolean; message 'prefersTrackingUntilMouseUp';
  198. function initTextCell(aString: NSString): id; message 'initTextCell:';
  199. function initImageCell(image_: NSImage): id; message 'initImageCell:';
  200. function controlView: NSView; message 'controlView';
  201. procedure setControlView(view: NSView); message 'setControlView:';
  202. function type_: NSCellType; message 'type';
  203. procedure setType(aType: NSCellType); message 'setType:';
  204. function state: NSInteger; message 'state';
  205. procedure setState(value: NSInteger); message 'setState:';
  206. function target: id; message 'target';
  207. procedure setTarget(anObject: id); message 'setTarget:';
  208. function action: SEL; message 'action';
  209. procedure setAction(aSelector: SEL); message 'setAction:';
  210. function tag: NSInteger; message 'tag';
  211. procedure setTag(anInt: NSInteger); message 'setTag:';
  212. function title: NSString; message 'title';
  213. procedure setTitle(aString: NSString); message 'setTitle:';
  214. function isOpaque: Boolean; message 'isOpaque';
  215. function isEnabled: Boolean; message 'isEnabled';
  216. procedure setEnabled(flag: Boolean); message 'setEnabled:';
  217. function sendActionOn(mask: NSInteger): NSInteger; message 'sendActionOn:';
  218. function isContinuous: Boolean; message 'isContinuous';
  219. procedure setContinuous(flag: Boolean); message 'setContinuous:';
  220. function isEditable: Boolean; message 'isEditable';
  221. procedure setEditable(flag: Boolean); message 'setEditable:';
  222. function isSelectable: Boolean; message 'isSelectable';
  223. procedure setSelectable(flag: Boolean); message 'setSelectable:';
  224. function isBordered: Boolean; message 'isBordered';
  225. procedure setBordered(flag: Boolean); message 'setBordered:';
  226. function isBezeled: Boolean; message 'isBezeled';
  227. procedure setBezeled(flag: Boolean); message 'setBezeled:';
  228. function isScrollable: Boolean; message 'isScrollable';
  229. procedure setScrollable(flag: Boolean); message 'setScrollable:';
  230. function isHighlighted: Boolean; message 'isHighlighted';
  231. procedure setHighlighted(flag: Boolean); message 'setHighlighted:';
  232. function alignment: NSTextAlignment; message 'alignment';
  233. procedure setAlignment(mode: NSTextAlignment); message 'setAlignment:';
  234. function wraps: Boolean; message 'wraps';
  235. procedure setWraps(flag: Boolean); message 'setWraps:';
  236. function font: NSFont; message 'font';
  237. procedure setFont(fontObj: NSFont); message 'setFont:';
  238. function isEntryAcceptable(aString: NSString): Boolean; message 'isEntryAcceptable:';
  239. function keyEquivalent: NSString; message 'keyEquivalent';
  240. procedure setFormatter(newFormatter: NSFormatter); message 'setFormatter:';
  241. function formatter: id; message 'formatter';
  242. function objectValue: id; message 'objectValue';
  243. procedure setObjectValue(obj: NSCopyingProtocol); message 'setObjectValue:';
  244. function hasValidObjectValue: Boolean; message 'hasValidObjectValue';
  245. function stringValue: NSString; message 'stringValue';
  246. procedure setStringValue(aString: NSString); message 'setStringValue:';
  247. function compare(otherCell: id): NSComparisonResult; message 'compare:';
  248. function intValue: cint; message 'intValue';
  249. procedure setIntValue(anInt: cint); message 'setIntValue:';
  250. function floatValue: single; message 'floatValue';
  251. procedure setFloatValue(aFloat: single); message 'setFloatValue:';
  252. function doubleValue: double; message 'doubleValue';
  253. procedure setDoubleValue(aDouble: double); message 'setDoubleValue:';
  254. procedure takeIntValueFrom(sender: id); message 'takeIntValueFrom:';
  255. procedure takeFloatValueFrom(sender: id); message 'takeFloatValueFrom:';
  256. procedure takeDoubleValueFrom(sender: id); message 'takeDoubleValueFrom:';
  257. procedure takeStringValueFrom(sender: id); message 'takeStringValueFrom:';
  258. procedure takeObjectValueFrom(sender: id); message 'takeObjectValueFrom:';
  259. function image: NSImage; message 'image';
  260. procedure setImage(image_: NSImage); message 'setImage:';
  261. procedure setControlTint(controlTint_: NSControlTint); message 'setControlTint:';
  262. function controlTint: NSControlTint; message 'controlTint';
  263. procedure setControlSize(size: NSControlSize); message 'setControlSize:';
  264. function controlSize: NSControlSize; message 'controlSize';
  265. function representedObject: id; message 'representedObject';
  266. procedure setRepresentedObject(anObject: id); message 'setRepresentedObject:';
  267. function cellAttribute(aParameter: NSCellAttribute): NSInteger; message 'cellAttribute:';
  268. procedure setCellAttribute_to(aParameter: NSCellAttribute; value: NSInteger); message 'setCellAttribute:to:';
  269. function imageRectForBounds(theRect: NSRect): NSRect; message 'imageRectForBounds:';
  270. function titleRectForBounds(theRect: NSRect): NSRect; message 'titleRectForBounds:';
  271. function drawingRectForBounds(theRect: NSRect): NSRect; message 'drawingRectForBounds:';
  272. function cellSize: NSSize; message 'cellSize';
  273. function cellSizeForBounds(aRect: NSRect): NSSize; message 'cellSizeForBounds:';
  274. function highlightColorWithFrame_inView(cellFrame: NSRect; controlView_: NSView): NSColor; message 'highlightColorWithFrame:inView:';
  275. procedure calcDrawInfo(aRect: NSRect); message 'calcDrawInfo:';
  276. function setUpFieldEditorAttributes(textObj: NSText): NSText; message 'setUpFieldEditorAttributes:';
  277. procedure drawInteriorWithFrame_inView(cellFrame: NSRect; controlView_: NSView); message 'drawInteriorWithFrame:inView:';
  278. procedure drawWithFrame_inView(cellFrame: NSRect; controlView_: NSView); message 'drawWithFrame:inView:';
  279. procedure highlight_withFrame_inView(flag: Boolean; cellFrame: NSRect; controlView_: NSView); message 'highlight:withFrame:inView:';
  280. function mouseDownFlags: NSInteger; message 'mouseDownFlags';
  281. procedure getPeriodicDelay_interval(delay: psingle; interval: psingle); message 'getPeriodicDelay:interval:';
  282. function startTrackingAt_inView(startPoint: NSPoint; controlView_: NSView): Boolean; message 'startTrackingAt:inView:';
  283. function continueTracking_at_inView(lastPoint: NSPoint; currentPoint: NSPoint; controlView_: NSView): Boolean; message 'continueTracking:at:inView:';
  284. procedure stopTracking_at_inView_mouseIsUp(lastPoint: NSPoint; stopPoint: NSPoint; controlView_: NSView; flag: Boolean); message 'stopTracking:at:inView:mouseIsUp:';
  285. function trackMouse_inRect_ofView_untilMouseUp(theEvent: NSEvent; cellFrame: NSRect; controlView_: NSView; flag: Boolean): Boolean; message 'trackMouse:inRect:ofView:untilMouseUp:';
  286. procedure editWithFrame_inView_editor_delegate_event(aRect: NSRect; controlView_: NSView; textObj: NSText; anObject: id; theEvent: NSEvent); message 'editWithFrame:inView:editor:delegate:event:';
  287. procedure selectWithFrame_inView_editor_delegate_start_length(aRect: NSRect; controlView_: NSView; textObj: NSText; anObject: id; selStart: NSInteger; selLength: NSInteger); message 'selectWithFrame:inView:editor:delegate:start:length:';
  288. procedure endEditing(textObj: NSText); message 'endEditing:';
  289. procedure resetCursorRect_inView(cellFrame: NSRect; controlView_: NSView); message 'resetCursorRect:inView:';
  290. procedure setMenu(aMenu: NSMenu); message 'setMenu:';
  291. function menu: NSMenu; message 'menu';
  292. function menuForEvent_inRect_ofView(event: NSEvent; cellFrame: NSRect; view: NSView): NSMenu; message 'menuForEvent:inRect:ofView:';
  293. class function defaultMenu: NSMenu; message 'defaultMenu';
  294. procedure setSendsActionOnEndEditing(flag: Boolean); message 'setSendsActionOnEndEditing:';
  295. function sendsActionOnEndEditing: Boolean; message 'sendsActionOnEndEditing';
  296. function baseWritingDirection: NSWritingDirection; message 'baseWritingDirection';
  297. procedure setBaseWritingDirection(writingDirection: NSWritingDirection); message 'setBaseWritingDirection:';
  298. procedure setLineBreakMode(mode: NSLineBreakMode); message 'setLineBreakMode:';
  299. function lineBreakMode: NSLineBreakMode; message 'lineBreakMode';
  300. procedure setAllowsUndo(allowsUndo_: Boolean); message 'setAllowsUndo:';
  301. function allowsUndo: Boolean; message 'allowsUndo';
  302. function integerValue: NSInteger; message 'integerValue';
  303. procedure setIntegerValue(anInteger: NSInteger); message 'setIntegerValue:';
  304. procedure takeIntegerValueFrom(sender: id); message 'takeIntegerValueFrom:';
  305. function truncatesLastVisibleLine: Boolean; message 'truncatesLastVisibleLine';
  306. procedure setTruncatesLastVisibleLine(flag: Boolean); message 'setTruncatesLastVisibleLine:';
  307. function userInterfaceLayoutDirection: NSUserInterfaceLayoutDirection; message 'userInterfaceLayoutDirection';
  308. procedure setUserInterfaceLayoutDirection(layoutDirection: NSUserInterfaceLayoutDirection); message 'setUserInterfaceLayoutDirection:';
  309. function fieldEditorForView(aControlView: NSView): NSTextView; message 'fieldEditorForView:';
  310. function usesSingleLineMode: Boolean; message 'usesSingleLineMode';
  311. procedure setUsesSingleLineMode(flag: Boolean); message 'setUsesSingleLineMode:';
  312. { Adopted Protocols }
  313. function copyWithZone(zone_: NSZonePtr): id;
  314. procedure encodeWithCoder(aCoder: NSCoder);
  315. function initWithCoder(aDecoder: NSCoder): id;
  316. end;
  317. { NSKeyboardUI_NSCellCategory }
  318. NSKeyboardUI_NSCellCategory = objccategory external name 'NSKeyboardUI' (NSCell)
  319. procedure setRefusesFirstResponder(flag: Boolean); message 'setRefusesFirstResponder:';
  320. function refusesFirstResponder: Boolean; message 'refusesFirstResponder';
  321. function acceptsFirstResponder: Boolean; message 'acceptsFirstResponder';
  322. procedure setShowsFirstResponder(showFR: Boolean); message 'setShowsFirstResponder:';
  323. function showsFirstResponder: Boolean; message 'showsFirstResponder';
  324. procedure setMnemonicLocation(location: NSUInteger); message 'setMnemonicLocation:';
  325. function mnemonicLocation: NSUInteger; message 'mnemonicLocation';
  326. function mnemonic: NSString; message 'mnemonic';
  327. procedure setTitleWithMnemonic(stringWithAmpersand: NSString); message 'setTitleWithMnemonic:';
  328. procedure performClick(sender: id); message 'performClick:';
  329. procedure setFocusRingType(focusRingType_: NSFocusRingType); message 'setFocusRingType:';
  330. function focusRingType: NSFocusRingType; message 'focusRingType';
  331. class function defaultFocusRingType: NSFocusRingType; message 'defaultFocusRingType';
  332. function wantsNotificationForMarkedText: Boolean; message 'wantsNotificationForMarkedText';
  333. end;
  334. { NSCellAttributedStringMethodsCategory }
  335. NSCellAttributedStringMethodsCategory = objccategory external (NSCell)
  336. function attributedStringValue: NSAttributedString; message 'attributedStringValue';
  337. procedure setAttributedStringValue(obj: NSAttributedString); message 'setAttributedStringValue:';
  338. function allowsEditingTextAttributes: Boolean; message 'allowsEditingTextAttributes';
  339. procedure setAllowsEditingTextAttributes(flag: Boolean); message 'setAllowsEditingTextAttributes:';
  340. function importsGraphics: Boolean; message 'importsGraphics';
  341. procedure setImportsGraphics(flag: Boolean); message 'setImportsGraphics:';
  342. end;
  343. { NSCellMixedStateCategory }
  344. NSCellMixedStateCategory = objccategory external (NSCell)
  345. procedure setAllowsMixedState(flag: Boolean); message 'setAllowsMixedState:';
  346. function allowsMixedState: Boolean; message 'allowsMixedState';
  347. function nextState: NSInteger; message 'nextState';
  348. procedure setNextState; message 'setNextState';
  349. end;
  350. { NSCellHitTestCategory }
  351. NSCellHitTestCategory = objccategory external (NSCell)
  352. function hitTestForEvent_inRect_ofView(event: NSEvent; cellFrame: NSRect; controlView_: NSView): NSUInteger; message 'hitTestForEvent:inRect:ofView:';
  353. end;
  354. { NSCellExpansionCategory }
  355. NSCellExpansionCategory = objccategory external (NSCell)
  356. function expansionFrameWithFrame_inView(cellFrame: NSRect; view: NSView): NSRect; message 'expansionFrameWithFrame:inView:';
  357. procedure drawWithExpansionFrame_inView(cellFrame: NSRect; view: NSView); message 'drawWithExpansionFrame:inView:';
  358. end;
  359. { NSCellBackgroundStyleCategory }
  360. NSCellBackgroundStyleCategory = objccategory external (NSCell)
  361. function backgroundStyle: NSBackgroundStyle; message 'backgroundStyle';
  362. procedure setBackgroundStyle(style: NSBackgroundStyle); message 'setBackgroundStyle:';
  363. function interiorBackgroundStyle: NSBackgroundStyle; message 'interiorBackgroundStyle';
  364. end;
  365. { NSDeprecated_NSCellCategory }
  366. NSDeprecated_NSCellCategory = objccategory external name 'NSDeprecated' (NSCell)
  367. function entryType: NSInteger; message 'entryType'; deprecated 'in Mac OS X 10 and later';
  368. procedure setEntryType(aType: NSInteger); message 'setEntryType:'; deprecated 'in Mac OS X 10 and later';
  369. procedure setFloatingPointFormat_left_right(autoRange: Boolean; leftDigits: NSUInteger; rightDigits: NSUInteger); message 'setFloatingPointFormat:left:right:'; deprecated 'in Mac OS X 10 and later';
  370. end;
  371. {$endif}
  372. {$endif}