Mercurial > projects > dwt-mac
comparison dwt/internal/cocoa/NSWindow.d @ 37:642f460a0908
Fixed a lot of compile errors, a "hello world" app compiles now
author | Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com> |
---|---|
date | Fri, 10 Oct 2008 12:29:48 +0200 |
parents | f565d3a95c0a |
children | d8635bb48c7c |
comparison
equal
deleted
inserted
replaced
36:db5a898b2119 | 37:642f460a0908 |
---|---|
43 import dwt.internal.cocoa.NSView; | 43 import dwt.internal.cocoa.NSView; |
44 import dwt.internal.cocoa.NSWindowController; | 44 import dwt.internal.cocoa.NSWindowController; |
45 import dwt.internal.cocoa.OS; | 45 import dwt.internal.cocoa.OS; |
46 import objc = dwt.internal.objc.runtime; | 46 import objc = dwt.internal.objc.runtime; |
47 | 47 |
48 alias int NSWindowDepth; | 48 extern (C) |
49 | |
50 enum NSWindowOrderingMode : NSInteger | |
51 { | 49 { |
50 alias int NSWindowDepth; | |
51 | |
52 enum NSWindowOrderingMode : NSInteger | |
53 { | |
52 NSWindowAbove = 1, | 54 NSWindowAbove = 1, |
53 NSWindowBelow = -1, | 55 NSWindowBelow = -1, |
54 NSWindowOut = 0 | 56 NSWindowOut = 0 |
55 } | 57 } |
56 | 58 |
57 alias NSWindowOrderingMode.NSWindowAbove NSWindowAbove; | 59 alias NSWindowOrderingMode.NSWindowAbove NSWindowAbove; |
58 alias NSWindowOrderingMode.NSWindowBelow NSWindowBelow; | 60 alias NSWindowOrderingMode.NSWindowBelow NSWindowBelow; |
59 alias NSWindowOrderingMode.NSWindowOut NSWindowOut; | 61 alias NSWindowOrderingMode.NSWindowOut NSWindowOut; |
60 | 62 |
61 enum NSWindowBackingLocation : NSUInteger | 63 enum NSWindowBackingLocation : NSUInteger |
62 { | 64 { |
63 NSWindowBackingLocationDefault = 0, | 65 NSWindowBackingLocationDefault = 0, |
64 NSWindowBackingLocationVideoMemory = 1, | 66 NSWindowBackingLocationVideoMemory = 1, |
65 NSWindowBackingLocationMainMemory = 2 | 67 NSWindowBackingLocationMainMemory = 2 |
66 } | 68 } |
67 | 69 |
68 alias NSWindowBackingLocation.NSWindowBackingLocationDefault NSWindowBackingLocationDefault; | 70 alias NSWindowBackingLocation.NSWindowBackingLocationDefault NSWindowBackingLocationDefault; |
69 alias NSWindowBackingLocation.NSWindowBackingLocationVideoMemory NSWindowBackingLocationVideoMemory; | 71 alias NSWindowBackingLocation.NSWindowBackingLocationVideoMemory NSWindowBackingLocationVideoMemory; |
70 alias NSWindowBackingLocation.NSWindowBackingLocationMainMemory NSWindowBackingLocationMainMemory; | 72 alias NSWindowBackingLocation.NSWindowBackingLocationMainMemory NSWindowBackingLocationMainMemory; |
71 | 73 |
72 enum NSBackingStoreType | 74 enum NSBackingStoreType |
73 { | 75 { |
74 NSBackingStoreRetained = 0, | 76 NSBackingStoreRetained = 0, |
75 NSBackingStoreNonretained = 1, | 77 NSBackingStoreNonretained = 1, |
76 NSBackingStoreBuffered = 2 | 78 NSBackingStoreBuffered = 2 |
77 } | 79 } |
78 | 80 |
79 alias NSBackingStoreType.NSBackingStoreRetained NSBackingStoreRetained; | 81 alias NSBackingStoreType.NSBackingStoreRetained NSBackingStoreRetained; |
80 alias NSBackingStoreType.NSBackingStoreNonretained NSBackingStoreNonretained; | 82 alias NSBackingStoreType.NSBackingStoreNonretained NSBackingStoreNonretained; |
81 alias NSBackingStoreType.NSBackingStoreBuffered NSBackingStoreBuffered; | 83 alias NSBackingStoreType.NSBackingStoreBuffered NSBackingStoreBuffered; |
82 | 84 |
83 enum NSWindowCollectionBehavior : NSUInteger | 85 enum NSWindowCollectionBehavior : NSUInteger |
84 { | 86 { |
85 NSWindowCollectionBehaviorDefault = 0, | 87 NSWindowCollectionBehaviorDefault = 0, |
86 NSWindowCollectionBehaviorCanJoinAllSpaces = 1 << 0, | 88 NSWindowCollectionBehaviorCanJoinAllSpaces = 1 << 0, |
87 NSWindowCollectionBehaviorMoveToActiveSpace = 1 << 1 | 89 NSWindowCollectionBehaviorMoveToActiveSpace = 1 << 1 |
88 } | 90 } |
89 | 91 |
90 alias NSWindowCollectionBehavior.NSWindowCollectionBehaviorDefault NSWindowCollectionBehaviorDefault; | 92 alias NSWindowCollectionBehavior.NSWindowCollectionBehaviorDefault NSWindowCollectionBehaviorDefault; |
91 alias NSWindowCollectionBehavior.NSWindowCollectionBehaviorCanJoinAllSpaces NSWindowCollectionBehaviorCanJoinAllSpaces; | 93 alias NSWindowCollectionBehavior.NSWindowCollectionBehaviorCanJoinAllSpaces NSWindowCollectionBehaviorCanJoinAllSpaces; |
92 alias NSWindowCollectionBehavior.NSWindowCollectionBehaviorMoveToActiveSpace NSWindowCollectionBehaviorMoveToActiveSpace; | 94 alias NSWindowCollectionBehavior.NSWindowCollectionBehaviorMoveToActiveSpace NSWindowCollectionBehaviorMoveToActiveSpace; |
93 | 95 |
94 enum NSSelectionDirection | 96 enum NSSelectionDirection |
95 { | 97 { |
96 NSDirectSelection = 0, | 98 NSDirectSelection = 0, |
97 NSSelectingNext, | 99 NSSelectingNext, |
98 NSSelectingPrevious | 100 NSSelectingPrevious |
99 } | 101 } |
100 | 102 |
101 alias NSSelectionDirection.NSDirectSelection NSDirectSelection; | 103 alias NSSelectionDirection.NSDirectSelection NSDirectSelection; |
102 alias NSSelectionDirection.NSSelectingNext NSSelectingNext; | 104 alias NSSelectionDirection.NSSelectingNext NSSelectingNext; |
103 alias NSSelectionDirection.NSSelectingPrevious NSSelectingPrevious; | 105 alias NSSelectionDirection.NSSelectingPrevious NSSelectingPrevious; |
104 | 106 |
105 enum NSWindowSharingType : NSUInteger | 107 enum NSWindowSharingType : NSUInteger |
106 { | 108 { |
107 NSWindowSharingNone = 0, | 109 NSWindowSharingNone = 0, |
108 NSWindowSharingReadOnly = 1, | 110 NSWindowSharingReadOnly = 1, |
109 NSWindowSharingReadWrite = 2 | 111 NSWindowSharingReadWrite = 2 |
110 } | 112 } |
111 | 113 |
112 alias NSWindowSharingType.NSWindowSharingNone NSWindowSharingNone; | 114 alias NSWindowSharingType.NSWindowSharingNone NSWindowSharingNone; |
113 alias NSWindowSharingType.NSWindowSharingReadOnly NSWindowSharingReadOnly; | 115 alias NSWindowSharingType.NSWindowSharingReadOnly NSWindowSharingReadOnly; |
114 alias NSWindowSharingType.NSWindowSharingReadWrite NSWindowSharingReadWrite; | 116 alias NSWindowSharingType.NSWindowSharingReadWrite NSWindowSharingReadWrite; |
115 | 117 |
116 enum NSWindowButton | 118 enum NSWindowButton |
117 { | 119 { |
118 NSWindowCloseButton, | 120 NSWindowCloseButton, |
119 NSWindowMiniaturizeButton, | 121 NSWindowMiniaturizeButton, |
120 NSWindowZoomButton, | 122 NSWindowZoomButton, |
121 NSWindowToolbarButton, | 123 NSWindowToolbarButton, |
122 NSWindowDocumentIconButton | 124 NSWindowDocumentIconButton |
123 } | 125 } |
124 | 126 |
125 alias NSWindowButton.NSWindowCloseButton NSWindowCloseButton; | 127 alias NSWindowButton.NSWindowCloseButton NSWindowCloseButton; |
126 alias NSWindowButton.NSWindowMiniaturizeButton NSWindowMiniaturizeButton; | 128 alias NSWindowButton.NSWindowMiniaturizeButton NSWindowMiniaturizeButton; |
127 alias NSWindowButton.NSWindowZoomButton NSWindowZoomButton; | 129 alias NSWindowButton.NSWindowZoomButton NSWindowZoomButton; |
128 alias NSWindowButton.NSWindowToolbarButton NSWindowToolbarButton; | 130 alias NSWindowButton.NSWindowToolbarButton NSWindowToolbarButton; |
129 alias NSWindowButton.NSWindowDocumentIconButton NSWindowDocumentIconButton; | 131 alias NSWindowButton.NSWindowDocumentIconButton NSWindowDocumentIconButton; |
130 | 132 |
131 | 133 |
132 enum | 134 enum |
133 { | 135 { |
134 NSBorderlessWindowMask = 0, | 136 NSBorderlessWindowMask = 0, |
135 NSTitledWindowMask = 1 << 0, | 137 NSTitledWindowMask = 1 << 0, |
136 NSClosableWindowMask = 1 << 1, | 138 NSClosableWindowMask = 1 << 1, |
137 NSMiniaturizableWindowMask = 1 << 2, | 139 NSMiniaturizableWindowMask = 1 << 2, |
138 NSResizableWindowMask = 1 << 3, | 140 NSResizableWindowMask = 1 << 3, |
139 NSTexturedBackgroundWindowMask = 1 << 8 | 141 NSTexturedBackgroundWindowMask = 1 << 8 |
142 } | |
140 } | 143 } |
144 | |
141 | 145 |
142 public class NSWindow : NSResponder | 146 public class NSWindow : NSResponder |
143 { | 147 { |
144 | 148 |
145 public this () | 149 public this () |
267 } | 271 } |
268 | 272 |
269 public NSPoint cascadeTopLeftFromPoint (NSPoint topLeftPoint) | 273 public NSPoint cascadeTopLeftFromPoint (NSPoint topLeftPoint) |
270 { | 274 { |
271 NSPoint result; | 275 NSPoint result; |
272 OS.objc_msgSend_struct(&result, this.id_, OS.sel_cascadeTopLeftFromPoint_1, &topLeftPoint); | 276 OS.objc_msgSend_struct(&result, this.id_, OS.sel_cascadeTopLeftFromPoint_1, topLeftPoint); |
273 return result; | 277 return result; |
274 } | 278 } |
275 | 279 |
276 public void center () | 280 public void center () |
277 { | 281 { |
362 } | 366 } |
363 | 367 |
364 public NSPoint convertScreenToBase (NSPoint aPoint) | 368 public NSPoint convertScreenToBase (NSPoint aPoint) |
365 { | 369 { |
366 NSPoint result; | 370 NSPoint result; |
367 OS.objc_msgSend_struct(&result, this.id_, OS.sel_convertScreenToBase_1, &aPoint); | 371 OS.objc_msgSend_struct(&result, this.id_, OS.sel_convertScreenToBase_1, aPoint); |
368 return result; | 372 return result; |
369 } | 373 } |
370 | 374 |
371 public NSEvent currentEvent () | 375 public NSEvent currentEvent () |
372 { | 376 { |