Mercurial > projects > dstep
comparison dstep/appkit/NSCell.d @ 16:19885b43130e
Huge update, the bridge actually works now
author | Jacob Carlborg <doob@me.com> |
---|---|
date | Sun, 03 Jan 2010 22:06:11 +0100 |
parents | |
children | b9de51448c6b |
comparison
equal
deleted
inserted
replaced
15:7ff919f595d5 | 16:19885b43130e |
---|---|
1 /** | |
2 * Copyright: Copyright (c) 2009 Jacob Carlborg. | |
3 * Authors: Jacob Carlborg | |
4 * Version: Initial created: Sep 24, 2009 | |
5 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0) | |
6 */ | |
7 module dstep.appkit.NSCell; | |
8 | |
9 import dstep.appkit.NSAttributedString; | |
10 import dstep.appkit.NSColor; | |
11 import dstep.appkit.NSEvent; | |
12 import dstep.appkit.NSFont; | |
13 import dstep.appkit.NSImage; | |
14 import dstep.appkit.NSMenu; | |
15 import dstep.appkit.NSParagraphStyle; | |
16 import dstep.appkit.NSText; | |
17 import dstep.appkit.NSView; | |
18 import dstep.applicationservices.coregraphics.CGBase; | |
19 import dstep.foundation.NSAttributedString; | |
20 import dstep.foundation.NSCoder; | |
21 import dstep.foundation.NSFormatter; | |
22 import dstep.foundation.NSGeometry; | |
23 import dstep.foundation.NSObjCRuntime; | |
24 import dstep.foundation.NSObject; | |
25 import dstep.foundation.NSString; | |
26 import dstep.foundation.NSZone; | |
27 import dstep.objc.bridge.Bridge; | |
28 import dstep.objc.objc; | |
29 | |
30 import bindings = dstep.appkit.NSCell_bindings; | |
31 | |
32 alias NSUInteger NSCellType; | |
33 alias NSUInteger NSCellAttribute; | |
34 alias NSUInteger NSCellImagePosition; | |
35 alias NSUInteger NSImageScaling; | |
36 alias NSInteger NSCellStateValue; | |
37 alias NSUInteger NSControlTint; | |
38 alias NSUInteger NSControlSize; | |
39 alias NSInteger NSBackgroundStyle; | |
40 | |
41 private | |
42 { | |
43 NSString NSControlTintDidChangeNotification_; | |
44 } | |
45 | |
46 NSString NSControlTintDidChangeNotification () | |
47 { | |
48 if (NSControlTintDidChangeNotification_) | |
49 return NSControlTintDidChangeNotification_; | |
50 | |
51 return NSControlTintDidChangeNotification_ = new NSString(bindings.NSControlTintDidChangeNotification); | |
52 } | |
53 | |
54 enum | |
55 { | |
56 NSAnyType = 0, | |
57 NSIntType = 1, | |
58 NSPositiveIntType = 2, | |
59 NSFloatType = 3, | |
60 NSPositiveFloatType = 4, | |
61 NSDoubleType = 6, | |
62 NSPositiveDoubleType = 7 | |
63 } | |
64 | |
65 enum | |
66 { | |
67 NSNullCellType = 0, | |
68 NSTextCellType = 1, | |
69 NSImageCellType = 2 | |
70 } | |
71 | |
72 enum | |
73 { | |
74 NSCellDisabled = 0, | |
75 NSCellState = 1, | |
76 NSPushInCell = 2, | |
77 NSCellEditable = 3, | |
78 NSChangeGrayCell = 4, | |
79 NSCellHighlighted = 5, | |
80 NSCellLightsByContents = 6, | |
81 NSCellLightsByGray = 7, | |
82 NSChangeBackgroundCell = 8, | |
83 NSCellLightsByBackground = 9, | |
84 NSCellIsBordered = 10, | |
85 NSCellHasOverlappingImage = 11, | |
86 NSCellHasImageHorizontal = 12, | |
87 NSCellHasImageOnLeftOrBottom = 13, | |
88 NSCellChangesContents = 14, | |
89 NSCellIsInsetButton = 15, | |
90 NSCellAllowsMixedState = 16 | |
91 } | |
92 | |
93 enum | |
94 { | |
95 NSNoImage = 0, | |
96 NSImageOnly = 1, | |
97 NSImageLeft = 2, | |
98 NSImageRight = 3, | |
99 NSImageBelow = 4, | |
100 NSImageAbove = 5, | |
101 NSImageOverlaps = 6 | |
102 } | |
103 | |
104 enum | |
105 { | |
106 NSScaleProportionally = 0, | |
107 NSScaleToFit, | |
108 NSScaleNone | |
109 } | |
110 | |
111 enum | |
112 { | |
113 NSImageScaleProportionallyDown = 0, | |
114 NSImageScaleAxesIndependently, | |
115 NSImageScaleNone, | |
116 NSImageScaleProportionallyUpOrDown | |
117 } | |
118 | |
119 enum | |
120 { | |
121 NSMixedState = -1, | |
122 NSOffState = 0, | |
123 NSOnState = 1 | |
124 } | |
125 | |
126 enum | |
127 { | |
128 NSNoCellMask = 0, | |
129 NSContentsCellMask = 1, | |
130 NSPushInCellMask = 2, | |
131 NSChangeGrayCellMask = 4, | |
132 NSChangeBackgroundCellMask = 8 | |
133 } | |
134 | |
135 enum | |
136 { | |
137 NSDefaultControlTint = 0, | |
138 NSBlueControlTint = 1, | |
139 NSGraphiteControlTint = 6, | |
140 NSClearControlTint = 7 | |
141 } | |
142 | |
143 enum | |
144 { | |
145 NSRegularControlSize, | |
146 NSSmallControlSize, | |
147 NSMiniControlSize | |
148 } | |
149 | |
150 enum | |
151 { | |
152 NSCellHitNone = 0, | |
153 NSCellHitContentArea = 1 << 0, | |
154 NSCellHitEditableTextArea = 1 << 1, | |
155 NSCellHitTrackableArea = 1 << 2 | |
156 } | |
157 | |
158 enum | |
159 { | |
160 NSBackgroundStyleLight = 0, | |
161 NSBackgroundStyleDark, | |
162 NSBackgroundStyleRaised, | |
163 NSBackgroundStyleLowered | |
164 } | |
165 | |
166 struct _CFlags | |
167 { | |
168 uint state; | |
169 uint highlighted; | |
170 uint disabled; | |
171 uint editable; | |
172 uint type; | |
173 uint vCentered; | |
174 uint hCentered; | |
175 uint bordered; | |
176 uint bezeled; | |
177 uint selectable; | |
178 uint scrollable; | |
179 uint continuous; | |
180 uint actOnMouseDown; | |
181 uint isLeaf; | |
182 uint invalidObjectValue; | |
183 uint invalidFont; | |
184 uint lineBreakMode; | |
185 uint backgroundStyle; | |
186 uint reserved1; | |
187 uint actOnMouseDragged; | |
188 uint isLoaded; | |
189 uint truncateLastLine; | |
190 uint dontActOnMouseUp; | |
191 uint isWhite; | |
192 uint useUserKeyEquivalent; | |
193 uint showsFirstResponder; | |
194 uint focusRingType; | |
195 uint wasSelectable; | |
196 uint hasInvalidObject; | |
197 uint allowsEditingTextAttributes; | |
198 uint importsGraphics; | |
199 uint alignment; | |
200 uint reserved; | |
201 uint refusesFirstResponder; | |
202 uint needsHighlightedText; | |
203 uint dontAllowsUndo; | |
204 uint currentlyEditing; | |
205 uint allowsMixedState; | |
206 uint inMixedState; | |
207 uint sendsActionOnEndEditing; | |
208 uint inSendAction; | |
209 uint menuWasSet; | |
210 uint controlTint; | |
211 uint controlSize; | |
212 uint branchImageDisabled; | |
213 uint drawingInRevealover; | |
214 uint needsHighlightedTextHint; | |
215 } | |
216 | |
217 const TNSCellMixedState = ` | |
218 | |
219 void setAllowsMixedState (bool flag) | |
220 { | |
221 return invokeObjcSelf!(void, "setAllowsMixedState:", bool)(flag); | |
222 } | |
223 | |
224 bool allowsMixedState () | |
225 { | |
226 return invokeObjcSelf!(bool, "allowsMixedState"); | |
227 } | |
228 | |
229 NSInteger nextState () | |
230 { | |
231 return invokeObjcSelf!(NSInteger, "nextState"); | |
232 } | |
233 | |
234 void setNextState () | |
235 { | |
236 return invokeObjcSelf!(void, "setNextState"); | |
237 } | |
238 | |
239 //mixin ObjcBindMethod!(setAllowsMixedState, "setAllowsMixedState:"); | |
240 //mixin ObjcBindMethod!(allowsMixedState, "allowsMixedState"); | |
241 //mixin ObjcBindMethod!(nextState, "nextState"); | |
242 //mixin ObjcBindMethod!(setNextState, "setNextState"); | |
243 | |
244 `; | |
245 | |
246 const TNSCellBackgroundStyle = ` | |
247 | |
248 int backgroundStyle () | |
249 { | |
250 return invokeObjcSelf!(int, "backgroundStyle"); | |
251 } | |
252 | |
253 void setBackgroundStyle (int style) | |
254 { | |
255 return invokeObjcSelf!(void, "setBackgroundStyle:", int)(style); | |
256 } | |
257 | |
258 int interiorBackgroundStyle () | |
259 { | |
260 return invokeObjcSelf!(int, "interiorBackgroundStyle"); | |
261 } | |
262 | |
263 //mixin ObjcBindMethod!(backgroundStyle, "backgroundStyle"); | |
264 //mixin ObjcBindMethod!(setBackgroundStyle, "setBackgroundStyle:"); | |
265 //mixin ObjcBindMethod!(interiorBackgroundStyle, "interiorBackgroundStyle"); | |
266 | |
267 `; | |
268 | |
269 const TNSCellExpansion = ` | |
270 | |
271 NSRect expansionFrameWithFrame (NSRect cellFrame, NSView view) | |
272 { | |
273 return invokeObjcSelf!(NSRect, "expansionFrameWithFrame:inView:", NSRect, NSView)(cellFrame, view); | |
274 } | |
275 | |
276 void drawWithExpansionFrame (NSRect cellFrame, NSView view) | |
277 { | |
278 return invokeObjcSelf!(void, "drawWithExpansionFrame:inView:", NSRect, NSView)(cellFrame, view); | |
279 } | |
280 | |
281 //mixin ObjcBindMethod!(expansionFrameWithFrame, "expansionFrameWithFrame:inView:"); | |
282 //mixin ObjcBindMethod!(drawWithExpansionFrame, "drawWithExpansionFrame:inView:"); | |
283 | |
284 `; | |
285 | |
286 const TNSCellHitTest = ` | |
287 | |
288 NSUInteger hitTestForEvent (NSEvent event, NSRect cellFrame, NSView controlView) | |
289 { | |
290 return invokeObjcSelf!(NSUInteger, "hitTestForEvent:inRect:ofView:", NSEvent, NSRect, NSView)(event, cellFrame, controlView); | |
291 } | |
292 | |
293 //mixin ObjcBindMethod!(hitTestForEvent, "hitTestForEvent:inRect:ofView:"); | |
294 | |
295 `; | |
296 | |
297 const TNSCellAttributedStringMethods = ` | |
298 | |
299 NSAttributedString attributedStringValue () | |
300 { | |
301 return invokeObjcSelf!(NSAttributedString, "attributedStringValue"); | |
302 } | |
303 | |
304 void setAttributedStringValue (NSAttributedString obj) | |
305 { | |
306 return invokeObjcSelf!(void, "setAttributedStringValue:", NSAttributedString)(obj); | |
307 } | |
308 | |
309 bool allowsEditingTextAttributes () | |
310 { | |
311 return invokeObjcSelf!(bool, "allowsEditingTextAttributes"); | |
312 } | |
313 | |
314 void setAllowsEditingTextAttributes (bool flag) | |
315 { | |
316 return invokeObjcSelf!(void, "setAllowsEditingTextAttributes:", bool)(flag); | |
317 } | |
318 | |
319 bool importsGraphics () | |
320 { | |
321 return invokeObjcSelf!(bool, "importsGraphics"); | |
322 } | |
323 | |
324 void setImportsGraphics (bool flag) | |
325 { | |
326 return invokeObjcSelf!(void, "setImportsGraphics:", bool)(flag); | |
327 } | |
328 | |
329 //mixin ObjcBindMethod!(attributedStringValue, "attributedStringValue"); | |
330 //mixin ObjcBindMethod!(setAttributedStringValue, "setAttributedStringValue:"); | |
331 //mixin ObjcBindMethod!(allowsEditingTextAttributes, "allowsEditingTextAttributes"); | |
332 //mixin ObjcBindMethod!(setAllowsEditingTextAttributes, "setAllowsEditingTextAttributes:"); | |
333 //mixin ObjcBindMethod!(importsGraphics, "importsGraphics"); | |
334 //mixin ObjcBindMethod!(setImportsGraphics, "setImportsGraphics:"); | |
335 | |
336 `; | |
337 | |
338 class NSCell : NSObject, INSCopying, INSCoding | |
339 { | |
340 mixin (ObjcWrap); | |
341 | |
342 this (NSCoder aDecoder) | |
343 { | |
344 super(typeof(this).alloc.initWithCoder(aDecoder).objcObject); | |
345 } | |
346 | |
347 void encodeWithCoder (NSCoder aCoder) | |
348 { | |
349 return invokeObjcSelf!(void, "encodeWithCoder:", NSCoder)(aCoder); | |
350 } | |
351 | |
352 typeof(this) initWithCoder (NSCoder aDecoder) | |
353 { | |
354 return invokeObjcSelf!(typeof(this), "initWithCoder:", NSCoder)(aDecoder); | |
355 } | |
356 | |
357 typeof(this) copyWithZone (NSZone* zone) | |
358 { | |
359 return invokeObjcSelf!(typeof(this), "copyWithZone:", NSZone*)(zone); | |
360 } | |
361 | |
362 static bool prefersTrackingUntilMouseUp () | |
363 { | |
364 return invokeObjcSelfClass!(bool, "prefersTrackingUntilMouseUp"); | |
365 } | |
366 | |
367 NSCell initTextCell (NSString aString) | |
368 { | |
369 id result = invokeObjcSelf!(id, "initTextCell:", NSString)(aString); | |
370 return result is this.objcObject ? this : (result !is null ? new NSCell(result) : null); | |
371 } | |
372 | |
373 this (NSString aString) | |
374 { | |
375 super(NSCell.alloc.initTextCell(aString).objcObject); | |
376 } | |
377 | |
378 NSCell initImageCell (NSImage image) | |
379 { | |
380 id result = invokeObjcSelf!(id, "initImageCell:", NSImage)(image); | |
381 return result is this.objcObject ? this : (result !is null ? new NSCell(result) : null); | |
382 } | |
383 | |
384 this (NSImage image) | |
385 { | |
386 super(NSCell.alloc.initImageCell(image).objcObject); | |
387 } | |
388 | |
389 NSView controlView () | |
390 { | |
391 return invokeObjcSelf!(NSView, "controlView"); | |
392 } | |
393 | |
394 void setControlView (NSView view) | |
395 { | |
396 return invokeObjcSelf!(void, "setControlView:", NSView)(view); | |
397 } | |
398 | |
399 uint type () | |
400 { | |
401 return invokeObjcSelf!(uint, "type"); | |
402 } | |
403 | |
404 void setType (uint aType) | |
405 { | |
406 return invokeObjcSelf!(void, "setType:", uint)(aType); | |
407 } | |
408 | |
409 NSInteger state () | |
410 { | |
411 return invokeObjcSelf!(NSInteger, "state"); | |
412 } | |
413 | |
414 void setState (NSInteger value) | |
415 { | |
416 return invokeObjcSelf!(void, "setState:", NSInteger)(value); | |
417 } | |
418 | |
419 Object target () | |
420 { | |
421 return invokeObjcSelf!(Object, "target"); | |
422 } | |
423 | |
424 void setTarget (Object anObject) | |
425 { | |
426 return invokeObjcSelf!(void, "setTarget:", Object)(anObject); | |
427 } | |
428 | |
429 SEL action () | |
430 { | |
431 return invokeObjcSelf!(SEL, "action"); | |
432 } | |
433 | |
434 void setAction (SEL aSelector) | |
435 { | |
436 return invokeObjcSelf!(void, "setAction:", SEL)(aSelector); | |
437 } | |
438 | |
439 NSInteger tag () | |
440 { | |
441 return invokeObjcSelf!(NSInteger, "tag"); | |
442 } | |
443 | |
444 void setTag (NSInteger anInt) | |
445 { | |
446 return invokeObjcSelf!(void, "setTag:", NSInteger)(anInt); | |
447 } | |
448 | |
449 NSString title () | |
450 { | |
451 return invokeObjcSelf!(NSString, "title"); | |
452 } | |
453 | |
454 void setTitle (NSString aString) | |
455 { | |
456 return invokeObjcSelf!(void, "setTitle:", NSString)(aString); | |
457 } | |
458 | |
459 bool isOpaque () | |
460 { | |
461 return invokeObjcSelf!(bool, "isOpaque"); | |
462 } | |
463 | |
464 bool isEnabled () | |
465 { | |
466 return invokeObjcSelf!(bool, "isEnabled"); | |
467 } | |
468 | |
469 void setEnabled (bool flag) | |
470 { | |
471 return invokeObjcSelf!(void, "setEnabled:", bool)(flag); | |
472 } | |
473 | |
474 NSInteger sendActionOn (NSInteger mask) | |
475 { | |
476 return invokeObjcSelf!(NSInteger, "sendActionOn:", NSInteger)(mask); | |
477 } | |
478 | |
479 bool isContinuous () | |
480 { | |
481 return invokeObjcSelf!(bool, "isContinuous"); | |
482 } | |
483 | |
484 void setContinuous (bool flag) | |
485 { | |
486 return invokeObjcSelf!(void, "setContinuous:", bool)(flag); | |
487 } | |
488 | |
489 bool isEditable () | |
490 { | |
491 return invokeObjcSelf!(bool, "isEditable"); | |
492 } | |
493 | |
494 void setEditable (bool flag) | |
495 { | |
496 return invokeObjcSelf!(void, "setEditable:", bool)(flag); | |
497 } | |
498 | |
499 bool isSelectable () | |
500 { | |
501 return invokeObjcSelf!(bool, "isSelectable"); | |
502 } | |
503 | |
504 void setSelectable (bool flag) | |
505 { | |
506 return invokeObjcSelf!(void, "setSelectable:", bool)(flag); | |
507 } | |
508 | |
509 bool isBordered () | |
510 { | |
511 return invokeObjcSelf!(bool, "isBordered"); | |
512 } | |
513 | |
514 void setBordered (bool flag) | |
515 { | |
516 return invokeObjcSelf!(void, "setBordered:", bool)(flag); | |
517 } | |
518 | |
519 bool isBezeled () | |
520 { | |
521 return invokeObjcSelf!(bool, "isBezeled"); | |
522 } | |
523 | |
524 void setBezeled (bool flag) | |
525 { | |
526 return invokeObjcSelf!(void, "setBezeled:", bool)(flag); | |
527 } | |
528 | |
529 bool isScrollable () | |
530 { | |
531 return invokeObjcSelf!(bool, "isScrollable"); | |
532 } | |
533 | |
534 void setScrollable (bool flag) | |
535 { | |
536 return invokeObjcSelf!(void, "setScrollable:", bool)(flag); | |
537 } | |
538 | |
539 bool isHighlighted () | |
540 { | |
541 return invokeObjcSelf!(bool, "isHighlighted"); | |
542 } | |
543 | |
544 void setHighlighted (bool flag) | |
545 { | |
546 return invokeObjcSelf!(void, "setHighlighted:", bool)(flag); | |
547 } | |
548 | |
549 uint alignment () | |
550 { | |
551 return invokeObjcSelf!(uint, "alignment"); | |
552 } | |
553 | |
554 void setAlignment (uint mode) | |
555 { | |
556 return invokeObjcSelf!(void, "setAlignment:", uint)(mode); | |
557 } | |
558 | |
559 bool wraps () | |
560 { | |
561 return invokeObjcSelf!(bool, "wraps"); | |
562 } | |
563 | |
564 void setWraps (bool flag) | |
565 { | |
566 return invokeObjcSelf!(void, "setWraps:", bool)(flag); | |
567 } | |
568 | |
569 NSFont font () | |
570 { | |
571 return invokeObjcSelf!(NSFont, "font"); | |
572 } | |
573 | |
574 void setFont (NSFont fontObj) | |
575 { | |
576 return invokeObjcSelf!(void, "setFont:", NSFont)(fontObj); | |
577 } | |
578 | |
579 NSInteger entryType () | |
580 { | |
581 return invokeObjcSelf!(NSInteger, "entryType"); | |
582 } | |
583 | |
584 void setEntryType (NSInteger aType) | |
585 { | |
586 return invokeObjcSelf!(void, "setEntryType:", NSInteger)(aType); | |
587 } | |
588 | |
589 bool isEntryAcceptable (NSString aString) | |
590 { | |
591 return invokeObjcSelf!(bool, "isEntryAcceptable:", NSString)(aString); | |
592 } | |
593 | |
594 void setFloatingPointFormat (bool autoRange, NSUInteger leftDigits, NSUInteger rightDigits) | |
595 { | |
596 return invokeObjcSelf!(void, "setFloatingPointFormat:left:right:", bool, NSUInteger, NSUInteger)(autoRange, leftDigits, rightDigits); | |
597 } | |
598 | |
599 NSString keyEquivalent () | |
600 { | |
601 return invokeObjcSelf!(NSString, "keyEquivalent"); | |
602 } | |
603 | |
604 void setFormatter (NSFormatter newFormatter) | |
605 { | |
606 return invokeObjcSelf!(void, "setFormatter:", NSFormatter)(newFormatter); | |
607 } | |
608 | |
609 Object formatter () | |
610 { | |
611 return invokeObjcSelf!(Object, "formatter"); | |
612 } | |
613 | |
614 Object objectValue () | |
615 { | |
616 return invokeObjcSelf!(Object, "objectValue"); | |
617 } | |
618 | |
619 void setObjectValue (INSCopying obj) | |
620 { | |
621 return invokeObjcSelf!(void, "setObjectValue:", INSCopying)(obj); | |
622 } | |
623 | |
624 bool hasValidObjectValue () | |
625 { | |
626 return invokeObjcSelf!(bool, "hasValidObjectValue"); | |
627 } | |
628 | |
629 NSString stringValue () | |
630 { | |
631 return invokeObjcSelf!(NSString, "stringValue"); | |
632 } | |
633 | |
634 void setStringValue (NSString aString) | |
635 { | |
636 return invokeObjcSelf!(void, "setStringValue:", NSString)(aString); | |
637 } | |
638 | |
639 int compare (Object otherCell) | |
640 { | |
641 return invokeObjcSelf!(int, "compare:", Object)(otherCell); | |
642 } | |
643 | |
644 int intValue () | |
645 { | |
646 return invokeObjcSelf!(int, "intValue"); | |
647 } | |
648 | |
649 void setIntValue (int anInt) | |
650 { | |
651 return invokeObjcSelf!(void, "setIntValue:", int)(anInt); | |
652 } | |
653 | |
654 float floatValue () | |
655 { | |
656 return invokeObjcSelf!(float, "floatValue"); | |
657 } | |
658 | |
659 void setFloatValue (float aFloat) | |
660 { | |
661 return invokeObjcSelf!(void, "setFloatValue:", float)(aFloat); | |
662 } | |
663 | |
664 double doubleValue () | |
665 { | |
666 return invokeObjcSelf!(double, "doubleValue"); | |
667 } | |
668 | |
669 void setDoubleValue (double aDouble) | |
670 { | |
671 return invokeObjcSelf!(void, "setDoubleValue:", double)(aDouble); | |
672 } | |
673 | |
674 void takeIntValueFrom (Object sender) | |
675 { | |
676 return invokeObjcSelf!(void, "takeIntValueFrom:", Object)(sender); | |
677 } | |
678 | |
679 void takeFloatValueFrom (Object sender) | |
680 { | |
681 return invokeObjcSelf!(void, "takeFloatValueFrom:", Object)(sender); | |
682 } | |
683 | |
684 void takeDoubleValueFrom (Object sender) | |
685 { | |
686 return invokeObjcSelf!(void, "takeDoubleValueFrom:", Object)(sender); | |
687 } | |
688 | |
689 void takeStringValueFrom (Object sender) | |
690 { | |
691 return invokeObjcSelf!(void, "takeStringValueFrom:", Object)(sender); | |
692 } | |
693 | |
694 void takeObjectValueFrom (Object sender) | |
695 { | |
696 return invokeObjcSelf!(void, "takeObjectValueFrom:", Object)(sender); | |
697 } | |
698 | |
699 NSImage image () | |
700 { | |
701 return invokeObjcSelf!(NSImage, "image"); | |
702 } | |
703 | |
704 void setImage (NSImage image) | |
705 { | |
706 return invokeObjcSelf!(void, "setImage:", NSImage)(image); | |
707 } | |
708 | |
709 void setControlTint (uint controlTint) | |
710 { | |
711 return invokeObjcSelf!(void, "setControlTint:", uint)(controlTint); | |
712 } | |
713 | |
714 uint controlTint () | |
715 { | |
716 return invokeObjcSelf!(uint, "controlTint"); | |
717 } | |
718 | |
719 void setControlSize (uint size) | |
720 { | |
721 return invokeObjcSelf!(void, "setControlSize:", uint)(size); | |
722 } | |
723 | |
724 uint controlSize () | |
725 { | |
726 return invokeObjcSelf!(uint, "controlSize"); | |
727 } | |
728 | |
729 Object representedObject () | |
730 { | |
731 return invokeObjcSelf!(Object, "representedObject"); | |
732 } | |
733 | |
734 void setRepresentedObject (Object anObject) | |
735 { | |
736 return invokeObjcSelf!(void, "setRepresentedObject:", Object)(anObject); | |
737 } | |
738 | |
739 NSInteger cellAttribute (uint aParameter) | |
740 { | |
741 return invokeObjcSelf!(NSInteger, "cellAttribute:", uint)(aParameter); | |
742 } | |
743 | |
744 void setCellAttribute (uint aParameter, NSInteger value) | |
745 { | |
746 return invokeObjcSelf!(void, "setCellAttribute:to:", uint, NSInteger)(aParameter, value); | |
747 } | |
748 | |
749 NSRect imageRectForBounds (NSRect theRect) | |
750 { | |
751 return invokeObjcSelf!(NSRect, "imageRectForBounds:", NSRect)(theRect); | |
752 } | |
753 | |
754 NSRect titleRectForBounds (NSRect theRect) | |
755 { | |
756 return invokeObjcSelf!(NSRect, "titleRectForBounds:", NSRect)(theRect); | |
757 } | |
758 | |
759 NSRect drawingRectForBounds (NSRect theRect) | |
760 { | |
761 return invokeObjcSelf!(NSRect, "drawingRectForBounds:", NSRect)(theRect); | |
762 } | |
763 | |
764 NSSize cellSize () | |
765 { | |
766 return invokeObjcSelf!(NSSize, "cellSize"); | |
767 } | |
768 | |
769 NSSize cellSizeForBounds (NSRect aRect) | |
770 { | |
771 return invokeObjcSelf!(NSSize, "cellSizeForBounds:", NSRect)(aRect); | |
772 } | |
773 | |
774 NSColor highlightColorWithFrame (NSRect cellFrame, NSView controlView) | |
775 { | |
776 return invokeObjcSelf!(NSColor, "highlightColorWithFrame:inView:", NSRect, NSView)(cellFrame, controlView); | |
777 } | |
778 | |
779 void calcDrawInfo (NSRect aRect) | |
780 { | |
781 return invokeObjcSelf!(void, "calcDrawInfo:", NSRect)(aRect); | |
782 } | |
783 | |
784 NSText setUpFieldEditorAttributes (NSText textObj) | |
785 { | |
786 return invokeObjcSelf!(NSText, "setUpFieldEditorAttributes:", NSText)(textObj); | |
787 } | |
788 | |
789 void drawInteriorWithFrame (NSRect cellFrame, NSView controlView) | |
790 { | |
791 return invokeObjcSelf!(void, "drawInteriorWithFrame:inView:", NSRect, NSView)(cellFrame, controlView); | |
792 } | |
793 | |
794 void drawWithFrame (NSRect cellFrame, NSView controlView) | |
795 { | |
796 return invokeObjcSelf!(void, "drawWithFrame:inView:", NSRect, NSView)(cellFrame, controlView); | |
797 } | |
798 | |
799 void highlight (bool flag, NSRect cellFrame, NSView controlView) | |
800 { | |
801 return invokeObjcSelf!(void, "highlight:withFrame:inView:", bool, NSRect, NSView)(flag, cellFrame, controlView); | |
802 } | |
803 | |
804 NSInteger mouseDownFlags () | |
805 { | |
806 return invokeObjcSelf!(NSInteger, "mouseDownFlags"); | |
807 } | |
808 | |
809 void getPeriodicDelay (float* delay, float* interval) | |
810 { | |
811 return invokeObjcSelf!(void, "getPeriodicDelay:interval:", float*, float*)(delay, interval); | |
812 } | |
813 | |
814 bool startTrackingAt (NSPoint startPoint, NSView controlView) | |
815 { | |
816 return invokeObjcSelf!(bool, "startTrackingAt:inView:", NSPoint, NSView)(startPoint, controlView); | |
817 } | |
818 | |
819 bool continueTracking (NSPoint lastPoint, NSPoint currentPoint, NSView controlView) | |
820 { | |
821 return invokeObjcSelf!(bool, "continueTracking:at:inView:", NSPoint, NSPoint, NSView)(lastPoint, currentPoint, controlView); | |
822 } | |
823 | |
824 void stopTracking (NSPoint lastPoint, NSPoint stopPoint, NSView controlView, bool flag) | |
825 { | |
826 return invokeObjcSelf!(void, "stopTracking:at:inView:mouseIsUp:", NSPoint, NSPoint, NSView, bool)(lastPoint, stopPoint, controlView, flag); | |
827 } | |
828 | |
829 bool trackMouse (NSEvent theEvent, NSRect cellFrame, NSView controlView, bool flag) | |
830 { | |
831 return invokeObjcSelf!(bool, "trackMouse:inRect:ofView:untilMouseUp:", NSEvent, NSRect, NSView, bool)(theEvent, cellFrame, controlView, flag); | |
832 } | |
833 | |
834 void editWithFrame (NSRect aRect, NSView controlView, NSText textObj, Object anObject, NSEvent theEvent) | |
835 { | |
836 return invokeObjcSelf!(void, "editWithFrame:inView:editor:delegate:event:", NSRect, NSView, NSText, Object, NSEvent)(aRect, controlView, textObj, anObject, theEvent); | |
837 } | |
838 | |
839 void selectWithFrame (NSRect aRect, NSView controlView, NSText textObj, Object anObject, NSInteger selStart, NSInteger selLength) | |
840 { | |
841 return invokeObjcSelf!(void, "selectWithFrame:inView:editor:delegate:start:length:", NSRect, NSView, NSText, Object, NSInteger, NSInteger)(aRect, controlView, textObj, anObject, selStart, selLength); | |
842 } | |
843 | |
844 void endEditing (NSText textObj) | |
845 { | |
846 return invokeObjcSelf!(void, "endEditing:", NSText)(textObj); | |
847 } | |
848 | |
849 void resetCursorRect (NSRect cellFrame, NSView controlView) | |
850 { | |
851 return invokeObjcSelf!(void, "resetCursorRect:inView:", NSRect, NSView)(cellFrame, controlView); | |
852 } | |
853 | |
854 void setMenu (NSMenu aMenu) | |
855 { | |
856 return invokeObjcSelf!(void, "setMenu:", NSMenu)(aMenu); | |
857 } | |
858 | |
859 NSMenu menu () | |
860 { | |
861 return invokeObjcSelf!(NSMenu, "menu"); | |
862 } | |
863 | |
864 NSMenu menuForEvent (NSEvent event, NSRect cellFrame, NSView view) | |
865 { | |
866 return invokeObjcSelf!(NSMenu, "menuForEvent:inRect:ofView:", NSEvent, NSRect, NSView)(event, cellFrame, view); | |
867 } | |
868 | |
869 static NSMenu defaultMenu () | |
870 { | |
871 return invokeObjcSelfClass!(NSMenu, "defaultMenu"); | |
872 } | |
873 | |
874 void setSendsActionOnEndEditing (bool flag) | |
875 { | |
876 return invokeObjcSelf!(void, "setSendsActionOnEndEditing:", bool)(flag); | |
877 } | |
878 | |
879 bool sendsActionOnEndEditing () | |
880 { | |
881 return invokeObjcSelf!(bool, "sendsActionOnEndEditing"); | |
882 } | |
883 | |
884 int baseWritingDirection () | |
885 { | |
886 return invokeObjcSelf!(int, "baseWritingDirection"); | |
887 } | |
888 | |
889 void setBaseWritingDirection (int writingDirection) | |
890 { | |
891 return invokeObjcSelf!(void, "setBaseWritingDirection:", int)(writingDirection); | |
892 } | |
893 | |
894 void setLineBreakMode (uint mode) | |
895 { | |
896 return invokeObjcSelf!(void, "setLineBreakMode:", uint)(mode); | |
897 } | |
898 | |
899 uint lineBreakMode () | |
900 { | |
901 return invokeObjcSelf!(uint, "lineBreakMode"); | |
902 } | |
903 | |
904 void setAllowsUndo (bool allowsUndo) | |
905 { | |
906 return invokeObjcSelf!(void, "setAllowsUndo:", bool)(allowsUndo); | |
907 } | |
908 | |
909 bool allowsUndo () | |
910 { | |
911 return invokeObjcSelf!(bool, "allowsUndo"); | |
912 } | |
913 | |
914 NSInteger integerValue () | |
915 { | |
916 return invokeObjcSelf!(NSInteger, "integerValue"); | |
917 } | |
918 | |
919 void setIntegerValue (NSInteger anInteger) | |
920 { | |
921 return invokeObjcSelf!(void, "setIntegerValue:", NSInteger)(anInteger); | |
922 } | |
923 | |
924 void takeIntegerValueFrom (Object sender) | |
925 { | |
926 return invokeObjcSelf!(void, "takeIntegerValueFrom:", Object)(sender); | |
927 } | |
928 | |
929 bool truncatesLastVisibleLine () | |
930 { | |
931 return invokeObjcSelf!(bool, "truncatesLastVisibleLine"); | |
932 } | |
933 | |
934 void setTruncatesLastVisibleLine (bool flag) | |
935 { | |
936 return invokeObjcSelf!(void, "setTruncatesLastVisibleLine:", bool)(flag); | |
937 } | |
938 | |
939 // NSCellMixedState | |
940 void setAllowsMixedState (bool flag) | |
941 { | |
942 return invokeObjcSelf!(void, "setAllowsMixedState:", bool)(flag); | |
943 } | |
944 | |
945 bool allowsMixedState () | |
946 { | |
947 return invokeObjcSelf!(bool, "allowsMixedState"); | |
948 } | |
949 | |
950 NSInteger nextState () | |
951 { | |
952 return invokeObjcSelf!(NSInteger, "nextState"); | |
953 } | |
954 | |
955 void setNextState () | |
956 { | |
957 return invokeObjcSelf!(void, "setNextState"); | |
958 } | |
959 | |
960 // NSCellBackgroundStyle | |
961 int backgroundStyle () | |
962 { | |
963 return invokeObjcSelf!(int, "backgroundStyle"); | |
964 } | |
965 | |
966 void setBackgroundStyle (int style) | |
967 { | |
968 return invokeObjcSelf!(void, "setBackgroundStyle:", int)(style); | |
969 } | |
970 | |
971 int interiorBackgroundStyle () | |
972 { | |
973 return invokeObjcSelf!(int, "interiorBackgroundStyle"); | |
974 } | |
975 | |
976 // NSCellExpansion | |
977 NSRect expansionFrameWithFrame (NSRect cellFrame, NSView view) | |
978 { | |
979 return invokeObjcSelf!(NSRect, "expansionFrameWithFrame:inView:", NSRect, NSView)(cellFrame, view); | |
980 } | |
981 | |
982 void drawWithExpansionFrame (NSRect cellFrame, NSView view) | |
983 { | |
984 return invokeObjcSelf!(void, "drawWithExpansionFrame:inView:", NSRect, NSView)(cellFrame, view); | |
985 } | |
986 | |
987 // NSCellHitTest | |
988 NSUInteger hitTestForEvent (NSEvent event, NSRect cellFrame, NSView controlView) | |
989 { | |
990 return invokeObjcSelf!(NSUInteger, "hitTestForEvent:inRect:ofView:", NSEvent, NSRect, NSView)(event, cellFrame, controlView); | |
991 } | |
992 | |
993 // NSCellAttributedStringMethods | |
994 NSAttributedString attributedStringValue () | |
995 { | |
996 return invokeObjcSelf!(NSAttributedString, "attributedStringValue"); | |
997 } | |
998 | |
999 void setAttributedStringValue (NSAttributedString obj) | |
1000 { | |
1001 return invokeObjcSelf!(void, "setAttributedStringValue:", NSAttributedString)(obj); | |
1002 } | |
1003 | |
1004 bool allowsEditingTextAttributes () | |
1005 { | |
1006 return invokeObjcSelf!(bool, "allowsEditingTextAttributes"); | |
1007 } | |
1008 | |
1009 void setAllowsEditingTextAttributes (bool flag) | |
1010 { | |
1011 return invokeObjcSelf!(void, "setAllowsEditingTextAttributes:", bool)(flag); | |
1012 } | |
1013 | |
1014 bool importsGraphics () | |
1015 { | |
1016 return invokeObjcSelf!(bool, "importsGraphics"); | |
1017 } | |
1018 | |
1019 void setImportsGraphics (bool flag) | |
1020 { | |
1021 return invokeObjcSelf!(void, "setImportsGraphics:", bool)(flag); | |
1022 } | |
1023 } | |
1024 | |
1025 void NSDrawThreePartImage (NSRect frame, NSImage startCap, NSImage centerFill, NSImage endCap, bool vertical, uint op, CGFloat alphaFraction, bool flipped) | |
1026 { | |
1027 return Bridge.invokeObjcFunction!(void, bindings.NSDrawThreePartImage, NSRect, NSImage, NSImage, NSImage, bool, uint, CGFloat, bool)(frame, startCap, centerFill, endCap, vertical, op, alphaFraction, flipped); | |
1028 } | |
1029 | |
1030 void NSDrawNinePartImage (NSRect frame, NSImage topLeftCorner, NSImage topEdgeFill, NSImage topRightCorner, NSImage leftEdgeFill, NSImage centerFill, NSImage rightEdgeFill, NSImage bottomLeftCorner, NSImage bottomEdgeFill, NSImage bottomRightCorner, uint op, CGFloat alphaFraction, bool flipped) | |
1031 { | |
1032 return Bridge.invokeObjcFunction!(void, bindings.NSDrawNinePartImage, NSRect, NSImage, NSImage, NSImage, NSImage, NSImage, NSImage, NSImage, NSImage, NSImage, uint, CGFloat, bool)(frame, topLeftCorner, topEdgeFill, topRightCorner, leftEdgeFill, centerFill, rightEdgeFill, bottomLeftCorner, bottomEdgeFill, bottomRightCorner, op, alphaFraction, flipped); | |
1033 } |