Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 4ae0424c1950a6dcb38f96b1ebe5223e1bd4943b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
/*******************************************************************************
 * Copyright (c) 2000, 2011 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *    IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.swt.internal.cocoa;

public class NSWindow extends NSResponder {

public NSWindow() {
	super();
}

public NSWindow(int /*long*/ id) {
	super(id);
}

public NSWindow(id id) {
	super(id);
}

public void addChildWindow(NSWindow childWin, int /*long*/ place) {
	OS.objc_msgSend(this.id, OS.sel_addChildWindow_ordered_, childWin != null ? childWin.id : 0, place);
}

public float /*double*/ alphaValue() {
	return (float /*double*/)OS.objc_msgSend_fpret(this.id, OS.sel_alphaValue);
}

public boolean areCursorRectsEnabled() {
	return OS.objc_msgSend_bool(this.id, OS.sel_areCursorRectsEnabled);
}

public void becomeKeyWindow() {
	OS.objc_msgSend(this.id, OS.sel_becomeKeyWindow);
}

public boolean canBecomeKeyWindow() {
	return OS.objc_msgSend_bool(this.id, OS.sel_canBecomeKeyWindow);
}

public NSPoint cascadeTopLeftFromPoint(NSPoint topLeftPoint) {
	NSPoint result = new NSPoint();
	OS.objc_msgSend_stret(result, this.id, OS.sel_cascadeTopLeftFromPoint_, topLeftPoint);
	return result;
}

public void close() {
	OS.objc_msgSend(this.id, OS.sel_close);
}

public NSView contentView() {
	int /*long*/ result = OS.objc_msgSend(this.id, OS.sel_contentView);
	return result != 0 ? new NSView(result) : null;
}

public NSPoint convertBaseToScreen(NSPoint aPoint) {
	NSPoint result = new NSPoint();
	OS.objc_msgSend_stret(result, this.id, OS.sel_convertBaseToScreen_, aPoint);
	return result;
}

public NSPoint convertScreenToBase(NSPoint aPoint) {
	NSPoint result = new NSPoint();
	OS.objc_msgSend_stret(result, this.id, OS.sel_convertScreenToBase_, aPoint);
	return result;
}

public NSButtonCell defaultButtonCell() {
	int /*long*/ result = OS.objc_msgSend(this.id, OS.sel_defaultButtonCell);
	return result != 0 ? new NSButtonCell(result) : null;
}

public id delegate() {
	int /*long*/ result = OS.objc_msgSend(this.id, OS.sel_delegate);
	return result != 0 ? new id(result) : null;
}

public void deminiaturize(id sender) {
	OS.objc_msgSend(this.id, OS.sel_deminiaturize_, sender != null ? sender.id : 0);
}

public void disableCursorRects() {
	OS.objc_msgSend(this.id, OS.sel_disableCursorRects);
}

public void disableFlushWindow() {
	OS.objc_msgSend(this.id, OS.sel_disableFlushWindow);
}

public void display() {
	OS.objc_msgSend(this.id, OS.sel_display);
}

public void enableCursorRects() {
	OS.objc_msgSend(this.id, OS.sel_enableCursorRects);
}

public void enableFlushWindow() {
	OS.objc_msgSend(this.id, OS.sel_enableFlushWindow);
}

public void endEditingFor(id anObject) {
	OS.objc_msgSend(this.id, OS.sel_endEditingFor_, anObject != null ? anObject.id : 0);
}

public NSText fieldEditor(boolean createFlag, id anObject) {
	int /*long*/ result = OS.objc_msgSend(this.id, OS.sel_fieldEditor_forObject_, createFlag, anObject != null ? anObject.id : 0);
	return result != 0 ? new NSText(result) : null;
}

public NSResponder firstResponder() {
	int /*long*/ result = OS.objc_msgSend(this.id, OS.sel_firstResponder);
	return result != 0 ? new NSResponder(result) : null;
}

public void flushWindowIfNeeded() {
	OS.objc_msgSend(this.id, OS.sel_flushWindowIfNeeded);
}

public NSRect frame() {
	NSRect result = new NSRect();
	OS.objc_msgSend_stret(result, this.id, OS.sel_frame);
	return result;
}

public NSRect frameRectForContentRect(NSRect contentRect) {
	NSRect result = new NSRect();
	OS.objc_msgSend_stret(result, this.id, OS.sel_frameRectForContentRect_, contentRect);
	return result;
}

public NSGraphicsContext graphicsContext() {
	int /*long*/ result = OS.objc_msgSend(this.id, OS.sel_graphicsContext);
	return result != 0 ? new NSGraphicsContext(result) : null;
}

public boolean hasShadow() {
	return OS.objc_msgSend_bool(this.id, OS.sel_hasShadow);
}

public NSWindow initWithContentRect(NSRect contentRect, int /*long*/ aStyle, int /*long*/ bufferingType, boolean flag) {
	int /*long*/ result = OS.objc_msgSend(this.id, OS.sel_initWithContentRect_styleMask_backing_defer_, contentRect, aStyle, bufferingType, flag);
	return result == this.id ? this : (result != 0 ? new NSWindow(result) : null);
}

public NSWindow initWithContentRect(NSRect contentRect, int /*long*/ aStyle, int /*long*/ bufferingType, boolean flag, NSScreen screen) {
	int /*long*/ result = OS.objc_msgSend(this.id, OS.sel_initWithContentRect_styleMask_backing_defer_screen_, contentRect, aStyle, bufferingType, flag, screen != null ? screen.id : 0);
	return result == this.id ? this : (result != 0 ? new NSWindow(result) : null);
}

public void invalidateShadow() {
	OS.objc_msgSend(this.id, OS.sel_invalidateShadow);
}

public boolean isDocumentEdited() {
	return OS.objc_msgSend_bool(this.id, OS.sel_isDocumentEdited);
}

public boolean isKeyWindow() {
	return OS.objc_msgSend_bool(this.id, OS.sel_isKeyWindow);
}

public boolean isMainWindow() {
	return OS.objc_msgSend_bool(this.id, OS.sel_isMainWindow);
}

public boolean isMiniaturized() {
	return OS.objc_msgSend_bool(this.id, OS.sel_isMiniaturized);
}

public boolean isSheet() {
	return OS.objc_msgSend_bool(this.id, OS.sel_isSheet);
}

public boolean isVisible() {
	return OS.objc_msgSend_bool(this.id, OS.sel_isVisible);
}

public boolean isZoomed() {
	return OS.objc_msgSend_bool(this.id, OS.sel_isZoomed);
}

public int /*long*/ level() {
	return OS.objc_msgSend(this.id, OS.sel_level);
}

public boolean makeFirstResponder(NSResponder aResponder) {
	return OS.objc_msgSend_bool(this.id, OS.sel_makeFirstResponder_, aResponder != null ? aResponder.id : 0);
}

public void makeKeyAndOrderFront(id sender) {
	OS.objc_msgSend(this.id, OS.sel_makeKeyAndOrderFront_, sender != null ? sender.id : 0);
}

public static float /*double*/ minFrameWidthWithTitle(NSString aTitle, int /*long*/ aStyle) {
	return (float /*double*/)OS.objc_msgSend_fpret(OS.class_NSWindow, OS.sel_minFrameWidthWithTitle_styleMask_, aTitle != null ? aTitle.id : 0, aStyle);
}

public NSSize minSize() {
	NSSize result = new NSSize();
	OS.objc_msgSend_stret(result, this.id, OS.sel_minSize);
	return result;
}

public void miniaturize(id sender) {
	OS.objc_msgSend(this.id, OS.sel_miniaturize_, sender != null ? sender.id : 0);
}

public NSPoint mouseLocationOutsideOfEventStream() {
	NSPoint result = new NSPoint();
	OS.objc_msgSend_stret(result, this.id, OS.sel_mouseLocationOutsideOfEventStream);
	return result;
}

public void orderBack(id sender) {
	OS.objc_msgSend(this.id, OS.sel_orderBack_, sender != null ? sender.id : 0);
}

public void orderFront(id sender) {
	OS.objc_msgSend(this.id, OS.sel_orderFront_, sender != null ? sender.id : 0);
}

public void orderFrontRegardless() {
	OS.objc_msgSend(this.id, OS.sel_orderFrontRegardless);
}

public void orderOut(id sender) {
	OS.objc_msgSend(this.id, OS.sel_orderOut_, sender != null ? sender.id : 0);
}

public void orderWindow(int /*long*/ place, int /*long*/ otherWin) {
	OS.objc_msgSend(this.id, OS.sel_orderWindow_relativeTo_, place, otherWin);
}

public NSWindow parentWindow() {
	int /*long*/ result = OS.objc_msgSend(this.id, OS.sel_parentWindow);
	return result == this.id ? this : (result != 0 ? new NSWindow(result) : null);
}

public void removeChildWindow(NSWindow childWin) {
	OS.objc_msgSend(this.id, OS.sel_removeChildWindow_, childWin != null ? childWin.id : 0);
}

public NSScreen screen() {
	int /*long*/ result = OS.objc_msgSend(this.id, OS.sel_screen);
	return result != 0 ? new NSScreen(result) : null;
}

public void sendEvent(NSEvent theEvent) {
	OS.objc_msgSend(this.id, OS.sel_sendEvent_, theEvent != null ? theEvent.id : 0);
}

public void setAcceptsMouseMovedEvents(boolean flag) {
	OS.objc_msgSend(this.id, OS.sel_setAcceptsMouseMovedEvents_, flag);
}

public void setAlphaValue(float /*double*/ windowAlpha) {
	OS.objc_msgSend(this.id, OS.sel_setAlphaValue_, windowAlpha);
}

public void setBackgroundColor(NSColor color) {
	OS.objc_msgSend(this.id, OS.sel_setBackgroundColor_, color != null ? color.id : 0);
}

public void setCollectionBehavior(int /*long*/ behavior) {
	OS.objc_msgSend(this.id, OS.sel_setCollectionBehavior_, behavior);
}

public void setContentView(NSView aView) {
	OS.objc_msgSend(this.id, OS.sel_setContentView_, aView != null ? aView.id : 0);
}

public void setDefaultButtonCell(NSButtonCell defButt) {
	OS.objc_msgSend(this.id, OS.sel_setDefaultButtonCell_, defButt != null ? defButt.id : 0);
}

public void setDelegate(id anObject) {
	OS.objc_msgSend(this.id, OS.sel_setDelegate_, anObject != null ? anObject.id : 0);
}

public void setDocumentEdited(boolean flag) {
	OS.objc_msgSend(this.id, OS.sel_setDocumentEdited_, flag);
}

public void setFrame(NSRect frameRect, boolean flag) {
	OS.objc_msgSend(this.id, OS.sel_setFrame_display_, frameRect, flag);
}

public void setFrame(NSRect frameRect, boolean displayFlag, boolean animateFlag) {
	OS.objc_msgSend(this.id, OS.sel_setFrame_display_animate_, frameRect, displayFlag, animateFlag);
}

public void setHasShadow(boolean hasShadow) {
	OS.objc_msgSend(this.id, OS.sel_setHasShadow_, hasShadow);
}

public void setHidesOnDeactivate(boolean flag) {
	OS.objc_msgSend(this.id, OS.sel_setHidesOnDeactivate_, flag);
}

public void setLevel(int /*long*/ newLevel) {
	OS.objc_msgSend(this.id, OS.sel_setLevel_, newLevel);
}

public void setMinSize(NSSize size) {
	OS.objc_msgSend(this.id, OS.sel_setMinSize_, size);
}

public void setOpaque(boolean isOpaque) {
	OS.objc_msgSend(this.id, OS.sel_setOpaque_, isOpaque);
}

public void setReleasedWhenClosed(boolean flag) {
	OS.objc_msgSend(this.id, OS.sel_setReleasedWhenClosed_, flag);
}

public void setRepresentedFilename(NSString aString) {
	OS.objc_msgSend(this.id, OS.sel_setRepresentedFilename_, aString != null ? aString.id : 0);
}

public void setRepresentedURL(NSURL url) {
	OS.objc_msgSend(this.id, OS.sel_setRepresentedURL_, url != null ? url.id : 0);
}

public void setShowsResizeIndicator(boolean show) {
	OS.objc_msgSend(this.id, OS.sel_setShowsResizeIndicator_, show);
}

public void setShowsToolbarButton(boolean show) {
	OS.objc_msgSend(this.id, OS.sel_setShowsToolbarButton_, show);
}

public void setTitle(NSString aString) {
	OS.objc_msgSend(this.id, OS.sel_setTitle_, aString != null ? aString.id : 0);
}

public void setToolbar(NSToolbar toolbar) {
	OS.objc_msgSend(this.id, OS.sel_setToolbar_, toolbar != null ? toolbar.id : 0);
}

public NSButton standardWindowButton(int /*long*/ b) {
	int /*long*/ result = OS.objc_msgSend(this.id, OS.sel_standardWindowButton_, b);
	return result != 0 ? new NSButton(result) : null;
}

public int /*long*/ styleMask() {
	return OS.objc_msgSend(this.id, OS.sel_styleMask);
}

public void toggleToolbarShown(id sender) {
	OS.objc_msgSend(this.id, OS.sel_toggleToolbarShown_, sender != null ? sender.id : 0);
}

public NSToolbar toolbar() {
	int /*long*/ result = OS.objc_msgSend(this.id, OS.sel_toolbar);
	return result != 0 ? new NSToolbar(result) : null;
}

public float /*double*/ userSpaceScaleFactor() {
	return (float /*double*/)OS.objc_msgSend_fpret(this.id, OS.sel_userSpaceScaleFactor);
}

public int /*long*/ windowNumber() {
	return OS.objc_msgSend(this.id, OS.sel_windowNumber);
}

public static int /*long*/ windowNumberAtPoint(NSPoint point, int /*long*/ windowNumber) {
	return OS.objc_msgSend(OS.class_NSWindow, OS.sel_windowNumberAtPoint_belowWindowWithWindowNumber_, point, windowNumber);
}

public int /*long*/ windowRef() {
	return OS.objc_msgSend(this.id, OS.sel_windowRef);
}

public void zoom(id sender) {
	OS.objc_msgSend(this.id, OS.sel_zoom_, sender != null ? sender.id : 0);
}

}

Back to the top