comparison dstep/appkit/NSWindow.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.NSWindow;
8
9 import dstep.appkit.AppKitDefines;
10 import dstep.appkit.NSAnimation;
11 import dstep.appkit.NSButton;
12 import dstep.appkit.NSButtonCell;
13 import dstep.appkit.NSColor;
14 import dstep.appkit.NSDockTile;
15 import dstep.appkit.NSDrawer;
16 import dstep.appkit.NSEvent;
17 import dstep.appkit.NSGraphics;
18 import dstep.appkit.NSGraphicsContext;
19 import dstep.appkit.NSImage;
20 import dstep.appkit.NSMenu;
21 import dstep.appkit.NSPasteboard;
22 import dstep.appkit.NSResponder;
23 import dstep.appkit.NSScreen;
24 import dstep.appkit.NSText;
25 import dstep.appkit.NSToolbar;
26 import dstep.appkit.NSUserInterfaceValidation;
27 import dstep.appkit.NSView;
28 import dstep.appkit.NSWindowController;
29 import dstep.appkit.NSWindowScripting;
30 import dstep.applicationservices.ApplicationServices;
31 import dstep.foundation.NSArray;
32 import dstep.foundation.NSData;
33 import dstep.foundation.NSDate;
34 import dstep.foundation.NSDictionary;
35 import dstep.foundation.NSGeometry;
36 import dstep.foundation.NSNotification;
37 import dstep.foundation.NSObjCRuntime;
38 import dstep.foundation.NSScriptCommand;
39 import dstep.foundation.NSScriptStandardSuiteCommands;
40 import dstep.foundation.NSSet;
41 import dstep.foundation.NSString;
42 import dstep.foundation.NSURL;
43 import dstep.objc.bridge.Bridge;
44 import dstep.objc.objc;
45
46 import bindings = dstep.appkit.NSWindow_bindings;
47
48 typedef NSUInteger NSWindowSharingType;
49 typedef NSUInteger NSWindowBackingLocation;
50 typedef NSUInteger NSWindowCollectionBehavior;
51 typedef NSUInteger NSSelectionDirection;
52 typedef NSUInteger NSWindowButton;
53
54 private
55 {
56 NSString NSWindowDidBecomeKeyNotification_;
57 NSString NSWindowDidBecomeMainNotification_;
58 NSString NSWindowDidChangeScreenNotification_;
59 NSString NSWindowDidDeminiaturizeNotification_;
60 NSString NSWindowDidExposeNotification_;
61 NSString NSWindowDidMiniaturizeNotification_;
62 NSString NSWindowDidMoveNotification_;
63 NSString NSWindowDidResignKeyNotification_;
64 NSString NSWindowDidResignMainNotification_;
65 NSString NSWindowDidResizeNotification_;
66 NSString NSWindowDidUpdateNotification_;
67 NSString NSWindowWillCloseNotification_;
68 NSString NSWindowWillMiniaturizeNotification_;
69 NSString NSWindowWillMoveNotification_;
70 NSString NSWindowWillBeginSheetNotification_;
71 NSString NSWindowDidEndSheetNotification_;
72 NSString NSWindowDidChangeScreenProfileNotification_;
73 }
74
75 NSString NSWindowDidBecomeKeyNotification ()
76 {
77 if (NSWindowDidBecomeKeyNotification_)
78 return NSWindowDidBecomeKeyNotification_;
79
80 return NSWindowDidBecomeKeyNotification_ = new NSString(bindings.NSWindowDidBecomeKeyNotification);
81 }
82
83 NSString NSWindowDidBecomeMainNotification ()
84 {
85 if (NSWindowDidBecomeMainNotification_)
86 return NSWindowDidBecomeMainNotification_;
87
88 return NSWindowDidBecomeMainNotification_ = new NSString(bindings.NSWindowDidBecomeMainNotification);
89 }
90
91 NSString NSWindowDidChangeScreenNotification ()
92 {
93 if (NSWindowDidChangeScreenNotification_)
94 return NSWindowDidChangeScreenNotification_;
95
96 return NSWindowDidChangeScreenNotification_ = new NSString(bindings.NSWindowDidChangeScreenNotification);
97 }
98
99 NSString NSWindowDidDeminiaturizeNotification ()
100 {
101 if (NSWindowDidDeminiaturizeNotification_)
102 return NSWindowDidDeminiaturizeNotification_;
103
104 return NSWindowDidDeminiaturizeNotification_ = new NSString(bindings.NSWindowDidDeminiaturizeNotification);
105 }
106
107 NSString NSWindowDidExposeNotification ()
108 {
109 if (NSWindowDidExposeNotification_)
110 return NSWindowDidExposeNotification_;
111
112 return NSWindowDidExposeNotification_ = new NSString(bindings.NSWindowDidExposeNotification);
113 }
114
115 NSString NSWindowDidMiniaturizeNotification ()
116 {
117 if (NSWindowDidMiniaturizeNotification_)
118 return NSWindowDidMiniaturizeNotification_;
119
120 return NSWindowDidMiniaturizeNotification_ = new NSString(bindings.NSWindowDidMiniaturizeNotification);
121 }
122
123 NSString NSWindowDidMoveNotification ()
124 {
125 if (NSWindowDidMoveNotification_)
126 return NSWindowDidMoveNotification_;
127
128 return NSWindowDidMoveNotification_ = new NSString(bindings.NSWindowDidMoveNotification);
129 }
130
131 NSString NSWindowDidResignKeyNotification ()
132 {
133 if (NSWindowDidResignKeyNotification_)
134 return NSWindowDidResignKeyNotification_;
135
136 return NSWindowDidResignKeyNotification_ = new NSString(bindings.NSWindowDidResignKeyNotification);
137 }
138
139 NSString NSWindowDidResignMainNotification ()
140 {
141 if (NSWindowDidResignMainNotification_)
142 return NSWindowDidResignMainNotification_;
143
144 return NSWindowDidResignMainNotification_ = new NSString(bindings.NSWindowDidResignMainNotification);
145 }
146
147 NSString NSWindowDidResizeNotification ()
148 {
149 if (NSWindowDidResizeNotification_)
150 return NSWindowDidResizeNotification_;
151
152 return NSWindowDidResizeNotification_ = new NSString(bindings.NSWindowDidResizeNotification);
153 }
154
155 NSString NSWindowDidUpdateNotification ()
156 {
157 if (NSWindowDidUpdateNotification_)
158 return NSWindowDidUpdateNotification_;
159
160 return NSWindowDidUpdateNotification_ = new NSString(bindings.NSWindowDidUpdateNotification);
161 }
162
163 NSString NSWindowWillCloseNotification ()
164 {
165 if (NSWindowWillCloseNotification_)
166 return NSWindowWillCloseNotification_;
167
168 return NSWindowWillCloseNotification_ = new NSString(bindings.NSWindowWillCloseNotification);
169 }
170
171 NSString NSWindowWillMiniaturizeNotification ()
172 {
173 if (NSWindowWillMiniaturizeNotification_)
174 return NSWindowWillMiniaturizeNotification_;
175
176 return NSWindowWillMiniaturizeNotification_ = new NSString(bindings.NSWindowWillMiniaturizeNotification);
177 }
178
179 NSString NSWindowWillMoveNotification ()
180 {
181 if (NSWindowWillMoveNotification_)
182 return NSWindowWillMoveNotification_;
183
184 return NSWindowWillMoveNotification_ = new NSString(bindings.NSWindowWillMoveNotification);
185 }
186
187 NSString NSWindowWillBeginSheetNotification ()
188 {
189 if (NSWindowWillBeginSheetNotification_)
190 return NSWindowWillBeginSheetNotification_;
191
192 return NSWindowWillBeginSheetNotification_ = new NSString(bindings.NSWindowWillBeginSheetNotification);
193 }
194
195 NSString NSWindowDidEndSheetNotification ()
196 {
197 if (NSWindowDidEndSheetNotification_)
198 return NSWindowDidEndSheetNotification_;
199
200 return NSWindowDidEndSheetNotification_ = new NSString(bindings.NSWindowDidEndSheetNotification);
201 }
202
203 NSString NSWindowDidChangeScreenProfileNotification ()
204 {
205 if (NSWindowDidChangeScreenProfileNotification_)
206 return NSWindowDidChangeScreenProfileNotification_;
207
208 return NSWindowDidChangeScreenProfileNotification_ = new NSString(bindings.NSWindowDidChangeScreenProfileNotification);
209 }
210
211 enum
212 {
213 NSBorderlessWindowMask = 0,
214 NSTitledWindowMask = 1 << 0,
215 NSClosableWindowMask = 1 << 1,
216 NSMiniaturizableWindowMask = 1 << 2,
217 NSResizableWindowMask = 1 << 3
218 }
219
220 enum
221 {
222 NSTexturedBackgroundWindowMask = 1 << 8
223 }
224
225 enum
226 {
227 NSUnscaledWindowMask = 1 << 11
228 }
229
230 enum
231 {
232 NSUnifiedTitleAndToolbarWindowMask = 1 << 12
233 }
234
235 enum
236 {
237 NSDisplayWindowRunLoopOrdering = 600000,
238 NSResetCursorRectsRunLoopOrdering = 700000
239 }
240
241 enum : NSUInteger
242 {
243 NSWindowSharingNone = 0,
244 NSWindowSharingReadOnly = 1,
245 NSWindowSharingReadWrite = 2
246 }
247
248 enum : NSUInteger
249 {
250 NSWindowBackingLocationDefault = 0,
251 NSWindowBackingLocationVideoMemory = 1,
252 NSWindowBackingLocationMainMemory = 2
253 }
254
255 enum : NSUInteger
256 {
257 NSWindowCollectionBehaviorDefault = 0,
258 NSWindowCollectionBehaviorCanJoinAllSpaces = 1 << 0,
259 NSWindowCollectionBehaviorMoveToActiveSpace = 1 << 1
260 }
261
262 enum : NSUInteger
263 {
264 NSDirectSelection = 0,
265 NSSelectingNext,
266 NSSelectingPrevious
267 }
268
269 enum : NSUInteger
270 {
271 NSWindowCloseButton,
272 NSWindowMiniaturizeButton,
273 NSWindowZoomButton,
274 NSWindowToolbarButton,
275 NSWindowDocumentIconButton
276 }
277
278 const TNSWindowDelegate = `
279
280 bool windowShouldClose (Object sender)
281 {
282 return invokeObjcSelf!(bool, "windowShouldClose:", Object)(sender);
283 }
284
285 Object windowWillReturnFieldEditor (NSWindow sender, Object client)
286 {
287 return invokeObjcSelf!(Object, "windowWillReturnFieldEditor:toObject:", NSWindow, Object)(sender, client);
288 }
289
290 NSSize windowWillResize (NSWindow sender, NSSize frameSize)
291 {
292 return invokeObjcSelf!(NSSize, "windowWillResize:toSize:", NSWindow, NSSize)(sender, frameSize);
293 }
294
295 NSRect windowWillUseStandardFrame (NSWindow window, NSRect newFrame)
296 {
297 return invokeObjcSelf!(NSRect, "windowWillUseStandardFrame:defaultFrame:", NSWindow, NSRect)(window, newFrame);
298 }
299
300 bool windowShouldZoom (NSWindow window, NSRect newFrame)
301 {
302 return invokeObjcSelf!(bool, "windowShouldZoom:toFrame:", NSWindow, NSRect)(window, newFrame);
303 }
304
305 NSUndoManager windowWillReturnUndoManager (NSWindow window)
306 {
307 return invokeObjcSelf!(NSUndoManager, "windowWillReturnUndoManager:", NSWindow)(window);
308 }
309
310 NSRect window (NSWindow window, NSWindow sheet, NSRect rect)
311 {
312 return invokeObjcSelf!(NSRect, "window:willPositionSheet:usingRect:", NSWindow, NSWindow, NSRect)(window, sheet, rect);
313 }
314
315 bool window (NSWindow window, NSMenu menu)
316 {
317 return invokeObjcSelf!(bool, "window:shouldPopUpDocumentPathMenu:", NSWindow, NSMenu)(window, menu);
318 }
319
320 bool window (NSWindow window, NSEvent event, NSPoint dragImageLocation, NSPasteboard pasteboard)
321 {
322 return invokeObjcSelf!(bool, "window:shouldDragDocumentWithEvent:from:withPasteboard:", NSWindow, NSEvent, NSPoint, NSPasteboard)(window, event, dragImageLocation, pasteboard);
323 }
324
325 //mixin ObjcBindMethod!(windowShouldClose, "windowShouldClose:");
326 //mixin ObjcBindMethod!(windowWillReturnFieldEditor, "windowWillReturnFieldEditor:toObject:");
327 //mixin ObjcBindMethod!(windowWillResize, "windowWillResize:toSize:");
328 //mixin ObjcBindMethod!(windowWillUseStandardFrame, "windowWillUseStandardFrame:defaultFrame:");
329 //mixin ObjcBindMethod!(windowShouldZoom, "windowShouldZoom:toFrame:");
330 //mixin ObjcBindMethod!(windowWillReturnUndoManager, "windowWillReturnUndoManager:");
331 //mixin ObjcBindMethod!(window, "window:willPositionSheet:usingRect:");
332 //mixin ObjcBindMethod!(window, "window:shouldPopUpDocumentPathMenu:");
333 //mixin ObjcBindMethod!(window, "window:shouldDragDocumentWithEvent:from:withPasteboard:");
334
335 `;
336
337 const TNSCarbonExtensions = `
338
339 typeof(this) initWithWindowRef (void* windowRef)
340 {
341 id result = invokeObjcSelf!(id, "initWithWindowRef:", void*)(windowRef);
342 return result is this.objcObject ? this : (result !is null ? new typeof(this)(result) : null);
343 }
344
345 this (void* windowRef)
346 {
347 super(typeof(this).alloc.initWithWindowRef(windowRef).objcObject);
348 }
349
350 void* windowRef ()
351 {
352 return invokeObjcSelf!(void*, "windowRef");
353 }
354
355 //mixin ObjcBindMethod!(initWithWindowRef, "initWithWindowRef:");
356 //mixin ObjcBindMethod!(windowRef, "windowRef");
357
358 `;
359
360 const TNSWindowNotifications = `
361
362 void windowDidResize (NSNotification notification)
363 {
364 return invokeObjcSelf!(void, "windowDidResize:", NSNotification)(notification);
365 }
366
367 void windowDidExpose (NSNotification notification)
368 {
369 return invokeObjcSelf!(void, "windowDidExpose:", NSNotification)(notification);
370 }
371
372 void windowWillMove (NSNotification notification)
373 {
374 return invokeObjcSelf!(void, "windowWillMove:", NSNotification)(notification);
375 }
376
377 void windowDidMove (NSNotification notification)
378 {
379 return invokeObjcSelf!(void, "windowDidMove:", NSNotification)(notification);
380 }
381
382 void windowDidBecomeKey (NSNotification notification)
383 {
384 return invokeObjcSelf!(void, "windowDidBecomeKey:", NSNotification)(notification);
385 }
386
387 void windowDidResignKey (NSNotification notification)
388 {
389 return invokeObjcSelf!(void, "windowDidResignKey:", NSNotification)(notification);
390 }
391
392 void windowDidBecomeMain (NSNotification notification)
393 {
394 return invokeObjcSelf!(void, "windowDidBecomeMain:", NSNotification)(notification);
395 }
396
397 void windowDidResignMain (NSNotification notification)
398 {
399 return invokeObjcSelf!(void, "windowDidResignMain:", NSNotification)(notification);
400 }
401
402 void windowWillClose (NSNotification notification)
403 {
404 return invokeObjcSelf!(void, "windowWillClose:", NSNotification)(notification);
405 }
406
407 void windowWillMiniaturize (NSNotification notification)
408 {
409 return invokeObjcSelf!(void, "windowWillMiniaturize:", NSNotification)(notification);
410 }
411
412 void windowDidMiniaturize (NSNotification notification)
413 {
414 return invokeObjcSelf!(void, "windowDidMiniaturize:", NSNotification)(notification);
415 }
416
417 void windowDidDeminiaturize (NSNotification notification)
418 {
419 return invokeObjcSelf!(void, "windowDidDeminiaturize:", NSNotification)(notification);
420 }
421
422 void windowDidUpdate (NSNotification notification)
423 {
424 return invokeObjcSelf!(void, "windowDidUpdate:", NSNotification)(notification);
425 }
426
427 void windowDidChangeScreen (NSNotification notification)
428 {
429 return invokeObjcSelf!(void, "windowDidChangeScreen:", NSNotification)(notification);
430 }
431
432 void windowDidChangeScreenProfile (NSNotification notification)
433 {
434 return invokeObjcSelf!(void, "windowDidChangeScreenProfile:", NSNotification)(notification);
435 }
436
437 void windowWillBeginSheet (NSNotification notification)
438 {
439 return invokeObjcSelf!(void, "windowWillBeginSheet:", NSNotification)(notification);
440 }
441
442 void windowDidEndSheet (NSNotification notification)
443 {
444 return invokeObjcSelf!(void, "windowDidEndSheet:", NSNotification)(notification);
445 }
446
447 //mixin ObjcBindMethod!(windowDidResize, "windowDidResize:");
448 //mixin ObjcBindMethod!(windowDidExpose, "windowDidExpose:");
449 //mixin ObjcBindMethod!(windowWillMove, "windowWillMove:");
450 //mixin ObjcBindMethod!(windowDidMove, "windowDidMove:");
451 //mixin ObjcBindMethod!(windowDidBecomeKey, "windowDidBecomeKey:");
452 //mixin ObjcBindMethod!(windowDidResignKey, "windowDidResignKey:");
453 //mixin ObjcBindMethod!(windowDidBecomeMain, "windowDidBecomeMain:");
454 //mixin ObjcBindMethod!(windowDidResignMain, "windowDidResignMain:");
455 //mixin ObjcBindMethod!(windowWillClose, "windowWillClose:");
456 //mixin ObjcBindMethod!(windowWillMiniaturize, "windowWillMiniaturize:");
457 //mixin ObjcBindMethod!(windowDidMiniaturize, "windowDidMiniaturize:");
458 //mixin ObjcBindMethod!(windowDidDeminiaturize, "windowDidDeminiaturize:");
459 //mixin ObjcBindMethod!(windowDidUpdate, "windowDidUpdate:");
460 //mixin ObjcBindMethod!(windowDidChangeScreen, "windowDidChangeScreen:");
461 //mixin ObjcBindMethod!(windowDidChangeScreenProfile, "windowDidChangeScreenProfile:");
462 //mixin ObjcBindMethod!(windowWillBeginSheet, "windowWillBeginSheet:");
463 //mixin ObjcBindMethod!(windowDidEndSheet, "windowDidEndSheet:");
464
465 `;
466
467 const TNSToolbarSupport = `
468
469 void setToolbar (NSToolbar toolbar)
470 {
471 return invokeObjcSelf!(void, "setToolbar:", NSToolbar)(toolbar);
472 }
473
474 NSToolbar toolbar ()
475 {
476 return invokeObjcSelf!(NSToolbar, "toolbar");
477 }
478
479 void toggleToolbarShown (Object sender)
480 {
481 return invokeObjcSelf!(void, "toggleToolbarShown:", Object)(sender);
482 }
483
484 void runToolbarCustomizationPalette (Object sender)
485 {
486 return invokeObjcSelf!(void, "runToolbarCustomizationPalette:", Object)(sender);
487 }
488
489 void setShowsToolbarButton (bool show)
490 {
491 return invokeObjcSelf!(void, "setShowsToolbarButton:", bool)(show);
492 }
493
494 bool showsToolbarButton ()
495 {
496 return invokeObjcSelf!(bool, "showsToolbarButton");
497 }
498
499 //mixin ObjcBindMethod!(setToolbar, "setToolbar:");
500 //mixin ObjcBindMethod!(toolbar, "toolbar");
501 //mixin ObjcBindMethod!(toggleToolbarShown, "toggleToolbarShown:");
502 //mixin ObjcBindMethod!(runToolbarCustomizationPalette, "runToolbarCustomizationPalette:");
503 //mixin ObjcBindMethod!(setShowsToolbarButton, "setShowsToolbarButton:");
504 //mixin ObjcBindMethod!(showsToolbarButton, "showsToolbarButton");
505
506 `;
507
508 class NSWindow : NSResponder
509 {
510 mixin (ObjcWrap);
511
512 static NSRect frameRectForContentRect (NSRect cRect, NSUInteger aStyle)
513 {
514 return invokeObjcSelfClass!(NSRect, "frameRectForContentRect:styleMask:", NSRect, NSUInteger)(cRect, aStyle);
515 }
516
517 static NSRect contentRectForFrameRect (NSRect fRect, NSUInteger aStyle)
518 {
519 return invokeObjcSelfClass!(NSRect, "contentRectForFrameRect:styleMask:", NSRect, NSUInteger)(fRect, aStyle);
520 }
521
522 static CGFloat minFrameWidthWithTitle (NSString aTitle, NSUInteger aStyle)
523 {
524 return invokeObjcSelfClass!(CGFloat, "minFrameWidthWithTitle:styleMask:", NSString, NSUInteger)(aTitle, aStyle);
525 }
526
527 static int defaultDepthLimit ()
528 {
529 return invokeObjcSelfClass!(int, "defaultDepthLimit");
530 }
531
532 NSRect frameRectForContentRect (NSRect contentRect)
533 {
534 return invokeObjcSelf!(NSRect, "frameRectForContentRect:", NSRect)(contentRect);
535 }
536
537 NSRect contentRectForFrameRect (NSRect frameRect)
538 {
539 return invokeObjcSelf!(NSRect, "contentRectForFrameRect:", NSRect)(frameRect);
540 }
541
542 NSWindow initWithContentRect (NSRect contentRect, NSUInteger aStyle, uint bufferingType, bool flag)
543 {
544 id result = invokeObjcSelf!(id, "initWithContentRect:styleMask:backing:defer:", NSRect, NSUInteger, uint, bool)(contentRect, aStyle, bufferingType, flag);
545 return result is this.objcObject ? this : (result !is null ? new NSWindow(result) : null);
546 }
547
548 this (NSRect contentRect, NSUInteger aStyle, uint bufferingType, bool flag)
549 {
550 super(NSWindow.alloc.initWithContentRect(contentRect, aStyle, bufferingType, flag).objcObject);
551 }
552
553 NSWindow initWithContentRect (NSRect contentRect, NSUInteger aStyle, uint bufferingType, bool flag, NSScreen screen)
554 {
555 id result = invokeObjcSelf!(id, "initWithContentRect:styleMask:backing:defer:screen:", NSRect, NSUInteger, uint, bool, NSScreen)(contentRect, aStyle, bufferingType, flag, screen);
556 return result is this.objcObject ? this : (result !is null ? new NSWindow(result) : null);
557 }
558
559 this (NSRect contentRect, NSUInteger aStyle, uint bufferingType, bool flag, NSScreen screen)
560 {
561 super(NSWindow.alloc.initWithContentRect(contentRect, aStyle, bufferingType, flag, screen).objcObject);
562 }
563
564 NSString title ()
565 {
566 return invokeObjcSelf!(NSString, "title");
567 }
568
569 void setTitle (NSString aString)
570 {
571 return invokeObjcSelf!(void, "setTitle:", NSString)(aString);
572 }
573
574 void setRepresentedURL (NSURL url)
575 {
576 return invokeObjcSelf!(void, "setRepresentedURL:", NSURL)(url);
577 }
578
579 NSURL representedURL ()
580 {
581 return invokeObjcSelf!(NSURL, "representedURL");
582 }
583
584 NSString representedFilename ()
585 {
586 return invokeObjcSelf!(NSString, "representedFilename");
587 }
588
589 void setRepresentedFilename (NSString aString)
590 {
591 return invokeObjcSelf!(void, "setRepresentedFilename:", NSString)(aString);
592 }
593
594 void setTitleWithRepresentedFilename (NSString filename)
595 {
596 return invokeObjcSelf!(void, "setTitleWithRepresentedFilename:", NSString)(filename);
597 }
598
599 void setExcludedFromWindowsMenu (bool flag)
600 {
601 return invokeObjcSelf!(void, "setExcludedFromWindowsMenu:", bool)(flag);
602 }
603
604 bool isExcludedFromWindowsMenu ()
605 {
606 return invokeObjcSelf!(bool, "isExcludedFromWindowsMenu");
607 }
608
609 void setContentView (NSView aView)
610 {
611 return invokeObjcSelf!(void, "setContentView:", NSView)(aView);
612 }
613
614 Object contentView ()
615 {
616 return invokeObjcSelf!(Object, "contentView");
617 }
618
619 void setDelegate (Object anObject)
620 {
621 return invokeObjcSelf!(void, "setDelegate:", Object)(anObject);
622 }
623
624 Object delegate_ ()
625 {
626 return invokeObjcSelf!(Object, "delegate");
627 }
628
629 NSInteger windowNumber ()
630 {
631 return invokeObjcSelf!(NSInteger, "windowNumber");
632 }
633
634 NSUInteger styleMask ()
635 {
636 return invokeObjcSelf!(NSUInteger, "styleMask");
637 }
638
639 NSText fieldEditor (bool createFlag, Object anObject)
640 {
641 return invokeObjcSelf!(NSText, "fieldEditor:forObject:", bool, Object)(createFlag, anObject);
642 }
643
644 void endEditingFor (Object anObject)
645 {
646 return invokeObjcSelf!(void, "endEditingFor:", Object)(anObject);
647 }
648
649 NSRect constrainFrameRect (NSRect frameRect, NSScreen screen)
650 {
651 return invokeObjcSelf!(NSRect, "constrainFrameRect:toScreen:", NSRect, NSScreen)(frameRect, screen);
652 }
653
654 void setFrame (NSRect frameRect, bool flag)
655 {
656 return invokeObjcSelf!(void, "setFrame:display:", NSRect, bool)(frameRect, flag);
657 }
658
659 void setContentSize (NSSize aSize)
660 {
661 return invokeObjcSelf!(void, "setContentSize:", NSSize)(aSize);
662 }
663
664 void setFrameOrigin (NSPoint aPoint)
665 {
666 return invokeObjcSelf!(void, "setFrameOrigin:", NSPoint)(aPoint);
667 }
668
669 void setFrameTopLeftPoint (NSPoint aPoint)
670 {
671 return invokeObjcSelf!(void, "setFrameTopLeftPoint:", NSPoint)(aPoint);
672 }
673
674 NSPoint cascadeTopLeftFromPoint (NSPoint topLeftPoint)
675 {
676 return invokeObjcSelf!(NSPoint, "cascadeTopLeftFromPoint:", NSPoint)(topLeftPoint);
677 }
678
679 NSRect frame ()
680 {
681 return invokeObjcSelf!(NSRect, "frame");
682 }
683
684 double animationResizeTime (NSRect newFrame)
685 {
686 return invokeObjcSelf!(double, "animationResizeTime:", NSRect)(newFrame);
687 }
688
689 void setFrame (NSRect frameRect, bool displayFlag, bool animateFlag)
690 {
691 return invokeObjcSelf!(void, "setFrame:display:animate:", NSRect, bool, bool)(frameRect, displayFlag, animateFlag);
692 }
693
694 void setShowsResizeIndicator (bool show)
695 {
696 return invokeObjcSelf!(void, "setShowsResizeIndicator:", bool)(show);
697 }
698
699 bool showsResizeIndicator ()
700 {
701 return invokeObjcSelf!(bool, "showsResizeIndicator");
702 }
703
704 void setResizeIncrements (NSSize increments)
705 {
706 return invokeObjcSelf!(void, "setResizeIncrements:", NSSize)(increments);
707 }
708
709 NSSize resizeIncrements ()
710 {
711 return invokeObjcSelf!(NSSize, "resizeIncrements");
712 }
713
714 void setAspectRatio (NSSize ratio)
715 {
716 return invokeObjcSelf!(void, "setAspectRatio:", NSSize)(ratio);
717 }
718
719 NSSize aspectRatio ()
720 {
721 return invokeObjcSelf!(NSSize, "aspectRatio");
722 }
723
724 void setContentResizeIncrements (NSSize increments)
725 {
726 return invokeObjcSelf!(void, "setContentResizeIncrements:", NSSize)(increments);
727 }
728
729 NSSize contentResizeIncrements ()
730 {
731 return invokeObjcSelf!(NSSize, "contentResizeIncrements");
732 }
733
734 void setContentAspectRatio (NSSize ratio)
735 {
736 return invokeObjcSelf!(void, "setContentAspectRatio:", NSSize)(ratio);
737 }
738
739 NSSize contentAspectRatio ()
740 {
741 return invokeObjcSelf!(NSSize, "contentAspectRatio");
742 }
743
744 void useOptimizedDrawing (bool flag)
745 {
746 return invokeObjcSelf!(void, "useOptimizedDrawing:", bool)(flag);
747 }
748
749 void disableFlushWindow ()
750 {
751 return invokeObjcSelf!(void, "disableFlushWindow");
752 }
753
754 void enableFlushWindow ()
755 {
756 return invokeObjcSelf!(void, "enableFlushWindow");
757 }
758
759 bool isFlushWindowDisabled ()
760 {
761 return invokeObjcSelf!(bool, "isFlushWindowDisabled");
762 }
763
764 void flushWindow ()
765 {
766 return invokeObjcSelf!(void, "flushWindow");
767 }
768
769 void flushWindowIfNeeded ()
770 {
771 return invokeObjcSelf!(void, "flushWindowIfNeeded");
772 }
773
774 void setViewsNeedDisplay (bool flag)
775 {
776 return invokeObjcSelf!(void, "setViewsNeedDisplay:", bool)(flag);
777 }
778
779 bool viewsNeedDisplay ()
780 {
781 return invokeObjcSelf!(bool, "viewsNeedDisplay");
782 }
783
784 void displayIfNeeded ()
785 {
786 return invokeObjcSelf!(void, "displayIfNeeded");
787 }
788
789 void display ()
790 {
791 return invokeObjcSelf!(void, "display");
792 }
793
794 void setAutodisplay (bool flag)
795 {
796 return invokeObjcSelf!(void, "setAutodisplay:", bool)(flag);
797 }
798
799 bool isAutodisplay ()
800 {
801 return invokeObjcSelf!(bool, "isAutodisplay");
802 }
803
804 bool preservesContentDuringLiveResize ()
805 {
806 return invokeObjcSelf!(bool, "preservesContentDuringLiveResize");
807 }
808
809 void setPreservesContentDuringLiveResize (bool flag)
810 {
811 return invokeObjcSelf!(void, "setPreservesContentDuringLiveResize:", bool)(flag);
812 }
813
814 void update ()
815 {
816 return invokeObjcSelf!(void, "update");
817 }
818
819 bool makeFirstResponder (NSResponder aResponder)
820 {
821 return invokeObjcSelf!(bool, "makeFirstResponder:", NSResponder)(aResponder);
822 }
823
824 NSResponder firstResponder ()
825 {
826 return invokeObjcSelf!(NSResponder, "firstResponder");
827 }
828
829 NSInteger resizeFlags ()
830 {
831 return invokeObjcSelf!(NSInteger, "resizeFlags");
832 }
833
834 void keyDown (NSEvent theEvent)
835 {
836 return invokeObjcSelf!(void, "keyDown:", NSEvent)(theEvent);
837 }
838
839 void close ()
840 {
841 return invokeObjcSelf!(void, "close");
842 }
843
844 void setReleasedWhenClosed (bool flag)
845 {
846 return invokeObjcSelf!(void, "setReleasedWhenClosed:", bool)(flag);
847 }
848
849 bool isReleasedWhenClosed ()
850 {
851 return invokeObjcSelf!(bool, "isReleasedWhenClosed");
852 }
853
854 void miniaturize (Object sender)
855 {
856 return invokeObjcSelf!(void, "miniaturize:", Object)(sender);
857 }
858
859 void deminiaturize (Object sender)
860 {
861 return invokeObjcSelf!(void, "deminiaturize:", Object)(sender);
862 }
863
864 bool isZoomed ()
865 {
866 return invokeObjcSelf!(bool, "isZoomed");
867 }
868
869 void zoom (Object sender)
870 {
871 return invokeObjcSelf!(void, "zoom:", Object)(sender);
872 }
873
874 bool isMiniaturized ()
875 {
876 return invokeObjcSelf!(bool, "isMiniaturized");
877 }
878
879 bool tryToPerform (SEL anAction, Object anObject)
880 {
881 return invokeObjcSelf!(bool, "tryToPerform:with:", SEL, Object)(anAction, anObject);
882 }
883
884 Object validRequestorForSendType (NSString sendType, NSString returnType)
885 {
886 return invokeObjcSelf!(Object, "validRequestorForSendType:returnType:", NSString, NSString)(sendType, returnType);
887 }
888
889 void setBackgroundColor (NSColor color)
890 {
891 return invokeObjcSelf!(void, "setBackgroundColor:", NSColor)(color);
892 }
893
894 NSColor backgroundColor ()
895 {
896 return invokeObjcSelf!(NSColor, "backgroundColor");
897 }
898
899 void setContentBorderThickness (CGFloat thickness, int edge)
900 {
901 return invokeObjcSelf!(void, "setContentBorderThickness:forEdge:", CGFloat, int)(thickness, edge);
902 }
903
904 CGFloat contentBorderThicknessForEdge (int edge)
905 {
906 return invokeObjcSelf!(CGFloat, "contentBorderThicknessForEdge:", int)(edge);
907 }
908
909 void setAutorecalculatesContentBorderThickness (bool flag, int edge)
910 {
911 return invokeObjcSelf!(void, "setAutorecalculatesContentBorderThickness:forEdge:", bool, int)(flag, edge);
912 }
913
914 bool autorecalculatesContentBorderThicknessForEdge (int edge)
915 {
916 return invokeObjcSelf!(bool, "autorecalculatesContentBorderThicknessForEdge:", int)(edge);
917 }
918
919 void setMovableByWindowBackground (bool flag)
920 {
921 return invokeObjcSelf!(void, "setMovableByWindowBackground:", bool)(flag);
922 }
923
924 bool isMovableByWindowBackground ()
925 {
926 return invokeObjcSelf!(bool, "isMovableByWindowBackground");
927 }
928
929 void setHidesOnDeactivate (bool flag)
930 {
931 return invokeObjcSelf!(void, "setHidesOnDeactivate:", bool)(flag);
932 }
933
934 bool hidesOnDeactivate ()
935 {
936 return invokeObjcSelf!(bool, "hidesOnDeactivate");
937 }
938
939 void setCanHide (bool flag)
940 {
941 return invokeObjcSelf!(void, "setCanHide:", bool)(flag);
942 }
943
944 bool canHide ()
945 {
946 return invokeObjcSelf!(bool, "canHide");
947 }
948
949 void center ()
950 {
951 return invokeObjcSelf!(void, "center");
952 }
953
954 void makeKeyAndOrderFront (Object sender)
955 {
956 return invokeObjcSelf!(void, "makeKeyAndOrderFront:", Object)(sender);
957 }
958
959 void orderFront (Object sender)
960 {
961 return invokeObjcSelf!(void, "orderFront:", Object)(sender);
962 }
963
964 void orderBack (Object sender)
965 {
966 return invokeObjcSelf!(void, "orderBack:", Object)(sender);
967 }
968
969 void orderOut (Object sender)
970 {
971 return invokeObjcSelf!(void, "orderOut:", Object)(sender);
972 }
973
974 void orderWindow (int place, NSInteger otherWin)
975 {
976 return invokeObjcSelf!(void, "orderWindow:relativeTo:", int, NSInteger)(place, otherWin);
977 }
978
979 void orderFrontRegardless ()
980 {
981 return invokeObjcSelf!(void, "orderFrontRegardless");
982 }
983
984 void setMiniwindowImage (NSImage image)
985 {
986 return invokeObjcSelf!(void, "setMiniwindowImage:", NSImage)(image);
987 }
988
989 void setMiniwindowTitle (NSString title)
990 {
991 return invokeObjcSelf!(void, "setMiniwindowTitle:", NSString)(title);
992 }
993
994 NSImage miniwindowImage ()
995 {
996 return invokeObjcSelf!(NSImage, "miniwindowImage");
997 }
998
999 NSString miniwindowTitle ()
1000 {
1001 return invokeObjcSelf!(NSString, "miniwindowTitle");
1002 }
1003
1004 NSDockTile dockTile ()
1005 {
1006 return invokeObjcSelf!(NSDockTile, "dockTile");
1007 }
1008
1009 void setDocumentEdited (bool flag)
1010 {
1011 return invokeObjcSelf!(void, "setDocumentEdited:", bool)(flag);
1012 }
1013
1014 bool isDocumentEdited ()
1015 {
1016 return invokeObjcSelf!(bool, "isDocumentEdited");
1017 }
1018
1019 bool isVisible ()
1020 {
1021 return invokeObjcSelf!(bool, "isVisible");
1022 }
1023
1024 bool isKeyWindow ()
1025 {
1026 return invokeObjcSelf!(bool, "isKeyWindow");
1027 }
1028
1029 bool isMainWindow ()
1030 {
1031 return invokeObjcSelf!(bool, "isMainWindow");
1032 }
1033
1034 bool canBecomeKeyWindow ()
1035 {
1036 return invokeObjcSelf!(bool, "canBecomeKeyWindow");
1037 }
1038
1039 bool canBecomeMainWindow ()
1040 {
1041 return invokeObjcSelf!(bool, "canBecomeMainWindow");
1042 }
1043
1044 void makeKeyWindow ()
1045 {
1046 return invokeObjcSelf!(void, "makeKeyWindow");
1047 }
1048
1049 void makeMainWindow ()
1050 {
1051 return invokeObjcSelf!(void, "makeMainWindow");
1052 }
1053
1054 void becomeKeyWindow ()
1055 {
1056 return invokeObjcSelf!(void, "becomeKeyWindow");
1057 }
1058
1059 void resignKeyWindow ()
1060 {
1061 return invokeObjcSelf!(void, "resignKeyWindow");
1062 }
1063
1064 void becomeMainWindow ()
1065 {
1066 return invokeObjcSelf!(void, "becomeMainWindow");
1067 }
1068
1069 void resignMainWindow ()
1070 {
1071 return invokeObjcSelf!(void, "resignMainWindow");
1072 }
1073
1074 bool worksWhenModal ()
1075 {
1076 return invokeObjcSelf!(bool, "worksWhenModal");
1077 }
1078
1079 NSPoint convertBaseToScreen (NSPoint aPoint)
1080 {
1081 return invokeObjcSelf!(NSPoint, "convertBaseToScreen:", NSPoint)(aPoint);
1082 }
1083
1084 NSPoint convertScreenToBase (NSPoint aPoint)
1085 {
1086 return invokeObjcSelf!(NSPoint, "convertScreenToBase:", NSPoint)(aPoint);
1087 }
1088
1089 void performClose (Object sender)
1090 {
1091 return invokeObjcSelf!(void, "performClose:", Object)(sender);
1092 }
1093
1094 void performMiniaturize (Object sender)
1095 {
1096 return invokeObjcSelf!(void, "performMiniaturize:", Object)(sender);
1097 }
1098
1099 void performZoom (Object sender)
1100 {
1101 return invokeObjcSelf!(void, "performZoom:", Object)(sender);
1102 }
1103
1104 NSInteger gState ()
1105 {
1106 return invokeObjcSelf!(NSInteger, "gState");
1107 }
1108
1109 void setOneShot (bool flag)
1110 {
1111 return invokeObjcSelf!(void, "setOneShot:", bool)(flag);
1112 }
1113
1114 bool isOneShot ()
1115 {
1116 return invokeObjcSelf!(bool, "isOneShot");
1117 }
1118
1119 NSData dataWithEPSInsideRect (NSRect rect)
1120 {
1121 return invokeObjcSelf!(NSData, "dataWithEPSInsideRect:", NSRect)(rect);
1122 }
1123
1124 NSData dataWithPDFInsideRect (NSRect rect)
1125 {
1126 return invokeObjcSelf!(NSData, "dataWithPDFInsideRect:", NSRect)(rect);
1127 }
1128
1129 void print (Object sender)
1130 {
1131 return invokeObjcSelf!(void, "print:", Object)(sender);
1132 }
1133
1134 void disableCursorRects ()
1135 {
1136 return invokeObjcSelf!(void, "disableCursorRects");
1137 }
1138
1139 void enableCursorRects ()
1140 {
1141 return invokeObjcSelf!(void, "enableCursorRects");
1142 }
1143
1144 void discardCursorRects ()
1145 {
1146 return invokeObjcSelf!(void, "discardCursorRects");
1147 }
1148
1149 bool areCursorRectsEnabled ()
1150 {
1151 return invokeObjcSelf!(bool, "areCursorRectsEnabled");
1152 }
1153
1154 void invalidateCursorRectsForView (NSView aView)
1155 {
1156 return invokeObjcSelf!(void, "invalidateCursorRectsForView:", NSView)(aView);
1157 }
1158
1159 void resetCursorRects ()
1160 {
1161 return invokeObjcSelf!(void, "resetCursorRects");
1162 }
1163
1164 void setAllowsToolTipsWhenApplicationIsInactive (bool allowWhenInactive)
1165 {
1166 return invokeObjcSelf!(void, "setAllowsToolTipsWhenApplicationIsInactive:", bool)(allowWhenInactive);
1167 }
1168
1169 bool allowsToolTipsWhenApplicationIsInactive ()
1170 {
1171 return invokeObjcSelf!(bool, "allowsToolTipsWhenApplicationIsInactive");
1172 }
1173
1174 void setBackingType (uint bufferingType)
1175 {
1176 return invokeObjcSelf!(void, "setBackingType:", uint)(bufferingType);
1177 }
1178
1179 uint backingType ()
1180 {
1181 return invokeObjcSelf!(uint, "backingType");
1182 }
1183
1184 void setLevel (NSInteger newLevel)
1185 {
1186 return invokeObjcSelf!(void, "setLevel:", NSInteger)(newLevel);
1187 }
1188
1189 NSInteger level ()
1190 {
1191 return invokeObjcSelf!(NSInteger, "level");
1192 }
1193
1194 void setDepthLimit (int limit)
1195 {
1196 return invokeObjcSelf!(void, "setDepthLimit:", int)(limit);
1197 }
1198
1199 int depthLimit ()
1200 {
1201 return invokeObjcSelf!(int, "depthLimit");
1202 }
1203
1204 void setDynamicDepthLimit (bool flag)
1205 {
1206 return invokeObjcSelf!(void, "setDynamicDepthLimit:", bool)(flag);
1207 }
1208
1209 bool hasDynamicDepthLimit ()
1210 {
1211 return invokeObjcSelf!(bool, "hasDynamicDepthLimit");
1212 }
1213
1214 NSScreen screen ()
1215 {
1216 return invokeObjcSelf!(NSScreen, "screen");
1217 }
1218
1219 NSScreen deepestScreen ()
1220 {
1221 return invokeObjcSelf!(NSScreen, "deepestScreen");
1222 }
1223
1224 bool canStoreColor ()
1225 {
1226 return invokeObjcSelf!(bool, "canStoreColor");
1227 }
1228
1229 void setHasShadow (bool hasShadow)
1230 {
1231 return invokeObjcSelf!(void, "setHasShadow:", bool)(hasShadow);
1232 }
1233
1234 bool hasShadow ()
1235 {
1236 return invokeObjcSelf!(bool, "hasShadow");
1237 }
1238
1239 void invalidateShadow ()
1240 {
1241 return invokeObjcSelf!(void, "invalidateShadow");
1242 }
1243
1244 void setAlphaValue (CGFloat windowAlpha)
1245 {
1246 return invokeObjcSelf!(void, "setAlphaValue:", CGFloat)(windowAlpha);
1247 }
1248
1249 CGFloat alphaValue ()
1250 {
1251 return invokeObjcSelf!(CGFloat, "alphaValue");
1252 }
1253
1254 void setOpaque (bool isOpaque)
1255 {
1256 return invokeObjcSelf!(void, "setOpaque:", bool)(isOpaque);
1257 }
1258
1259 bool isOpaque ()
1260 {
1261 return invokeObjcSelf!(bool, "isOpaque");
1262 }
1263
1264 void setSharingType (uint type)
1265 {
1266 return invokeObjcSelf!(void, "setSharingType:", uint)(type);
1267 }
1268
1269 uint sharingType ()
1270 {
1271 return invokeObjcSelf!(uint, "sharingType");
1272 }
1273
1274 void setPreferredBackingLocation (uint backingLocation)
1275 {
1276 return invokeObjcSelf!(void, "setPreferredBackingLocation:", uint)(backingLocation);
1277 }
1278
1279 uint preferredBackingLocation ()
1280 {
1281 return invokeObjcSelf!(uint, "preferredBackingLocation");
1282 }
1283
1284 uint backingLocation ()
1285 {
1286 return invokeObjcSelf!(uint, "backingLocation");
1287 }
1288
1289 bool displaysWhenScreenProfileChanges ()
1290 {
1291 return invokeObjcSelf!(bool, "displaysWhenScreenProfileChanges");
1292 }
1293
1294 void setDisplaysWhenScreenProfileChanges (bool flag)
1295 {
1296 return invokeObjcSelf!(void, "setDisplaysWhenScreenProfileChanges:", bool)(flag);
1297 }
1298
1299 void disableScreenUpdatesUntilFlush ()
1300 {
1301 return invokeObjcSelf!(void, "disableScreenUpdatesUntilFlush");
1302 }
1303
1304 bool canBecomeVisibleWithoutLogin ()
1305 {
1306 return invokeObjcSelf!(bool, "canBecomeVisibleWithoutLogin");
1307 }
1308
1309 void setCanBecomeVisibleWithoutLogin (bool flag)
1310 {
1311 return invokeObjcSelf!(void, "setCanBecomeVisibleWithoutLogin:", bool)(flag);
1312 }
1313
1314 void setCollectionBehavior (uint behavior)
1315 {
1316 return invokeObjcSelf!(void, "setCollectionBehavior:", uint)(behavior);
1317 }
1318
1319 uint collectionBehavior ()
1320 {
1321 return invokeObjcSelf!(uint, "collectionBehavior");
1322 }
1323
1324 bool canBeVisibleOnAllSpaces ()
1325 {
1326 return invokeObjcSelf!(bool, "canBeVisibleOnAllSpaces");
1327 }
1328
1329 void setCanBeVisibleOnAllSpaces (bool flag)
1330 {
1331 return invokeObjcSelf!(void, "setCanBeVisibleOnAllSpaces:", bool)(flag);
1332 }
1333
1334 NSString stringWithSavedFrame ()
1335 {
1336 return invokeObjcSelf!(NSString, "stringWithSavedFrame");
1337 }
1338
1339 void setFrameFromString (NSString string)
1340 {
1341 return invokeObjcSelf!(void, "setFrameFromString:", NSString)(string);
1342 }
1343
1344 void saveFrameUsingName (NSString name)
1345 {
1346 return invokeObjcSelf!(void, "saveFrameUsingName:", NSString)(name);
1347 }
1348
1349 bool setFrameUsingName (NSString name, bool force)
1350 {
1351 return invokeObjcSelf!(bool, "setFrameUsingName:force:", NSString, bool)(name, force);
1352 }
1353
1354 bool setFrameUsingName (NSString name)
1355 {
1356 return invokeObjcSelf!(bool, "setFrameUsingName:", NSString)(name);
1357 }
1358
1359 bool setFrameAutosaveName (NSString name)
1360 {
1361 return invokeObjcSelf!(bool, "setFrameAutosaveName:", NSString)(name);
1362 }
1363
1364 NSString frameAutosaveName ()
1365 {
1366 return invokeObjcSelf!(NSString, "frameAutosaveName");
1367 }
1368
1369 static void removeFrameUsingName (NSString name)
1370 {
1371 return invokeObjcSelfClass!(void, "removeFrameUsingName:", NSString)(name);
1372 }
1373
1374 void cacheImageInRect (NSRect aRect)
1375 {
1376 return invokeObjcSelf!(void, "cacheImageInRect:", NSRect)(aRect);
1377 }
1378
1379 void restoreCachedImage ()
1380 {
1381 return invokeObjcSelf!(void, "restoreCachedImage");
1382 }
1383
1384 void discardCachedImage ()
1385 {
1386 return invokeObjcSelf!(void, "discardCachedImage");
1387 }
1388
1389 NSSize minSize ()
1390 {
1391 return invokeObjcSelf!(NSSize, "minSize");
1392 }
1393
1394 NSSize maxSize ()
1395 {
1396 return invokeObjcSelf!(NSSize, "maxSize");
1397 }
1398
1399 void setMinSize (NSSize size)
1400 {
1401 return invokeObjcSelf!(void, "setMinSize:", NSSize)(size);
1402 }
1403
1404 void setMaxSize (NSSize size)
1405 {
1406 return invokeObjcSelf!(void, "setMaxSize:", NSSize)(size);
1407 }
1408
1409 NSSize contentMinSize ()
1410 {
1411 return invokeObjcSelf!(NSSize, "contentMinSize");
1412 }
1413
1414 NSSize contentMaxSize ()
1415 {
1416 return invokeObjcSelf!(NSSize, "contentMaxSize");
1417 }
1418
1419 void setContentMinSize (NSSize size)
1420 {
1421 return invokeObjcSelf!(void, "setContentMinSize:", NSSize)(size);
1422 }
1423
1424 void setContentMaxSize (NSSize size)
1425 {
1426 return invokeObjcSelf!(void, "setContentMaxSize:", NSSize)(size);
1427 }
1428
1429 NSEvent nextEventMatchingMask (NSUInteger mask)
1430 {
1431 return invokeObjcSelf!(NSEvent, "nextEventMatchingMask:", NSUInteger)(mask);
1432 }
1433
1434 NSEvent nextEventMatchingMask (NSUInteger mask, NSDate expiration, NSString mode, bool deqFlag)
1435 {
1436 return invokeObjcSelf!(NSEvent, "nextEventMatchingMask:untilDate:inMode:dequeue:", NSUInteger, NSDate, NSString, bool)(mask, expiration, mode, deqFlag);
1437 }
1438
1439 void discardEventsMatchingMask (NSUInteger mask, NSEvent lastEvent)
1440 {
1441 return invokeObjcSelf!(void, "discardEventsMatchingMask:beforeEvent:", NSUInteger, NSEvent)(mask, lastEvent);
1442 }
1443
1444 void postEvent (NSEvent event, bool flag)
1445 {
1446 return invokeObjcSelf!(void, "postEvent:atStart:", NSEvent, bool)(event, flag);
1447 }
1448
1449 NSEvent currentEvent ()
1450 {
1451 return invokeObjcSelf!(NSEvent, "currentEvent");
1452 }
1453
1454 void setAcceptsMouseMovedEvents (bool flag)
1455 {
1456 return invokeObjcSelf!(void, "setAcceptsMouseMovedEvents:", bool)(flag);
1457 }
1458
1459 bool acceptsMouseMovedEvents ()
1460 {
1461 return invokeObjcSelf!(bool, "acceptsMouseMovedEvents");
1462 }
1463
1464 void setIgnoresMouseEvents (bool flag)
1465 {
1466 return invokeObjcSelf!(void, "setIgnoresMouseEvents:", bool)(flag);
1467 }
1468
1469 bool ignoresMouseEvents ()
1470 {
1471 return invokeObjcSelf!(bool, "ignoresMouseEvents");
1472 }
1473
1474 NSDictionary deviceDescription ()
1475 {
1476 return invokeObjcSelf!(NSDictionary, "deviceDescription");
1477 }
1478
1479 void sendEvent (NSEvent theEvent)
1480 {
1481 return invokeObjcSelf!(void, "sendEvent:", NSEvent)(theEvent);
1482 }
1483
1484 NSPoint mouseLocationOutsideOfEventStream ()
1485 {
1486 return invokeObjcSelf!(NSPoint, "mouseLocationOutsideOfEventStream");
1487 }
1488
1489 static void menuChanged (NSMenu menu)
1490 {
1491 return invokeObjcSelfClass!(void, "menuChanged:", NSMenu)(menu);
1492 }
1493
1494 Object windowController ()
1495 {
1496 return invokeObjcSelf!(Object, "windowController");
1497 }
1498
1499 void setWindowController (NSWindowController windowController)
1500 {
1501 return invokeObjcSelf!(void, "setWindowController:", NSWindowController)(windowController);
1502 }
1503
1504 bool isSheet ()
1505 {
1506 return invokeObjcSelf!(bool, "isSheet");
1507 }
1508
1509 NSWindow attachedSheet ()
1510 {
1511 id result = invokeObjcSelf!(id, "attachedSheet");
1512 return result is this.objcObject ? this : (result !is null ? new NSWindow(result) : null);
1513 }
1514
1515 static NSButton standardWindowButton (uint b, NSUInteger styleMask)
1516 {
1517 return invokeObjcSelfClass!(NSButton, "standardWindowButton:forStyleMask:", uint, NSUInteger)(b, styleMask);
1518 }
1519
1520 NSButton standardWindowButton (uint b)
1521 {
1522 return invokeObjcSelf!(NSButton, "standardWindowButton:", uint)(b);
1523 }
1524
1525 void addChildWindow (NSWindow childWin, int place)
1526 {
1527 return invokeObjcSelf!(void, "addChildWindow:ordered:", NSWindow, int)(childWin, place);
1528 }
1529
1530 void removeChildWindow (NSWindow childWin)
1531 {
1532 return invokeObjcSelf!(void, "removeChildWindow:", NSWindow)(childWin);
1533 }
1534
1535 NSArray childWindows ()
1536 {
1537 return invokeObjcSelf!(NSArray, "childWindows");
1538 }
1539
1540 NSWindow parentWindow ()
1541 {
1542 id result = invokeObjcSelf!(id, "parentWindow");
1543 return result is this.objcObject ? this : (result !is null ? new NSWindow(result) : null);
1544 }
1545
1546 void setParentWindow (NSWindow window)
1547 {
1548 return invokeObjcSelf!(void, "setParentWindow:", NSWindow)(window);
1549 }
1550
1551 NSGraphicsContext graphicsContext ()
1552 {
1553 return invokeObjcSelf!(NSGraphicsContext, "graphicsContext");
1554 }
1555
1556 CGFloat userSpaceScaleFactor ()
1557 {
1558 return invokeObjcSelf!(CGFloat, "userSpaceScaleFactor");
1559 }
1560
1561 // Drawers
1562 NSArray drawers ()
1563 {
1564 return invokeObjcSelf!(NSArray, "drawers");
1565 }
1566
1567 // NSScripting
1568 bool hasCloseBox ()
1569 {
1570 return invokeObjcSelf!(bool, "hasCloseBox");
1571 }
1572
1573 bool hasTitleBar ()
1574 {
1575 return invokeObjcSelf!(bool, "hasTitleBar");
1576 }
1577
1578 bool isFloatingPanel ()
1579 {
1580 return invokeObjcSelf!(bool, "isFloatingPanel");
1581 }
1582
1583 bool isMiniaturizable ()
1584 {
1585 return invokeObjcSelf!(bool, "isMiniaturizable");
1586 }
1587
1588 bool isModalPanel ()
1589 {
1590 return invokeObjcSelf!(bool, "isModalPanel");
1591 }
1592
1593 bool isResizable ()
1594 {
1595 return invokeObjcSelf!(bool, "isResizable");
1596 }
1597
1598 bool isZoomable ()
1599 {
1600 return invokeObjcSelf!(bool, "isZoomable");
1601 }
1602
1603 NSInteger orderedIndex ()
1604 {
1605 return invokeObjcSelf!(NSInteger, "orderedIndex");
1606 }
1607
1608 void setIsMiniaturized (bool flag)
1609 {
1610 return invokeObjcSelf!(void, "setIsMiniaturized:", bool)(flag);
1611 }
1612
1613 void setIsVisible (bool flag)
1614 {
1615 return invokeObjcSelf!(void, "setIsVisible:", bool)(flag);
1616 }
1617
1618 void setIsZoomed (bool flag)
1619 {
1620 return invokeObjcSelf!(void, "setIsZoomed:", bool)(flag);
1621 }
1622
1623 void setOrderedIndex (NSInteger index)
1624 {
1625 return invokeObjcSelf!(void, "setOrderedIndex:", NSInteger)(index);
1626 }
1627
1628 Object handleCloseScriptCommand (NSCloseCommand command)
1629 {
1630 return invokeObjcSelf!(Object, "handleCloseScriptCommand:", NSCloseCommand)(command);
1631 }
1632
1633 Object handlePrintScriptCommand (NSScriptCommand command)
1634 {
1635 return invokeObjcSelf!(Object, "handlePrintScriptCommand:", NSScriptCommand)(command);
1636 }
1637
1638 Object handleSaveScriptCommand (NSScriptCommand command)
1639 {
1640 return invokeObjcSelf!(Object, "handleSaveScriptCommand:", NSScriptCommand)(command);
1641 }
1642
1643 // NSCarbonExtensions
1644 typeof(this) initWithWindowRef (void* windowRef)
1645 {
1646 id result = invokeObjcSelf!(id, "initWithWindowRef:", void*)(windowRef);
1647 return result is this.objcObject ? this : (result !is null ? new typeof(this)(result) : null);
1648 }
1649
1650 this (void* windowRef)
1651 {
1652 super(typeof(this).alloc.initWithWindowRef(windowRef).objcObject);
1653 }
1654
1655 void* windowRef ()
1656 {
1657 return invokeObjcSelf!(void*, "windowRef");
1658 }
1659
1660 // NSToolbarSupport
1661 void setToolbar (NSToolbar toolbar)
1662 {
1663 return invokeObjcSelf!(void, "setToolbar:", NSToolbar)(toolbar);
1664 }
1665
1666 NSToolbar toolbar ()
1667 {
1668 return invokeObjcSelf!(NSToolbar, "toolbar");
1669 }
1670
1671 void toggleToolbarShown (Object sender)
1672 {
1673 return invokeObjcSelf!(void, "toggleToolbarShown:", Object)(sender);
1674 }
1675
1676 void runToolbarCustomizationPalette (Object sender)
1677 {
1678 return invokeObjcSelf!(void, "runToolbarCustomizationPalette:", Object)(sender);
1679 }
1680
1681 void setShowsToolbarButton (bool show)
1682 {
1683 return invokeObjcSelf!(void, "setShowsToolbarButton:", bool)(show);
1684 }
1685
1686 bool showsToolbarButton ()
1687 {
1688 return invokeObjcSelf!(bool, "showsToolbarButton");
1689 }
1690 }