Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 5f4f4d66149cb1bf0757b6fcc628bee3b64d7ebc (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
/*******************************************************************************
 * Copyright (c) 2000, 2017 IBM Corporation and others.
 *
 * This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License 2.0
 * which accompanies this distribution, and is available at
 * https://www.eclipse.org/legal/epl-2.0/
 *
 * SPDX-License-Identifier: EPL-2.0
 *
 * Contributors:
 *    IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.swt.internal.cocoa;

public class NSView extends NSResponder {

public NSView() {
	super();
}

public NSView(long id) {
	super(id);
}

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

public boolean acceptsFirstMouse(NSEvent theEvent) {
	return OS.objc_msgSend_bool(this.id, OS.sel_acceptsFirstMouse_, theEvent != null ? theEvent.id : 0);
}

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

public void addSubview(NSView aView, long place, NSView otherView) {
	OS.objc_msgSend(this.id, OS.sel_addSubview_positioned_relativeTo_, aView != null ? aView.id : 0, place, otherView != null ? otherView.id : 0);
}

public long addToolTipRect(NSRect aRect, id anObject, long data) {
	return OS.objc_msgSend(this.id, OS.sel_addToolTipRect_owner_userData_, aRect, anObject != null ? anObject.id : 0, data);
}

public void beginDocument() {
	OS.objc_msgSend(this.id, OS.sel_beginDocument);
}

public void beginPageInRect(NSRect aRect, NSPoint location) {
	OS.objc_msgSend(this.id, OS.sel_beginPageInRect_atPlacement_, aRect, location);
}

public NSBitmapImageRep bitmapImageRepForCachingDisplayInRect(NSRect rect) {
	long result = OS.objc_msgSend(this.id, OS.sel_bitmapImageRepForCachingDisplayInRect_, rect);
	return result != 0 ? new NSBitmapImageRep(result) : null;
}

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

public void cacheDisplayInRect(NSRect rect, NSBitmapImageRep bitmapImageRep) {
	OS.objc_msgSend(this.id, OS.sel_cacheDisplayInRect_toBitmapImageRep_, rect, bitmapImageRep != null ? bitmapImageRep.id : 0);
}

public boolean canBecomeKeyView() {
	return OS.objc_msgSend_bool(this.id, OS.sel_canBecomeKeyView);
}

public NSPoint convertPoint_fromView_(NSPoint aPoint, NSView aView) {
	NSPoint result = new NSPoint();
	OS.objc_msgSend_stret(result, this.id, OS.sel_convertPoint_fromView_, aPoint, aView != null ? aView.id : 0);
	return result;
}

public NSPoint convertPoint_toView_(NSPoint aPoint, NSView aView) {
	NSPoint result = new NSPoint();
	OS.objc_msgSend_stret(result, this.id, OS.sel_convertPoint_toView_, aPoint, aView != null ? aView.id : 0);
	return result;
}

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

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

public NSRect convertRect_fromView_(NSRect aRect, NSView aView) {
	NSRect result = new NSRect();
	OS.objc_msgSend_stret(result, this.id, OS.sel_convertRect_fromView_, aRect, aView != null ? aView.id : 0);
	return result;
}

public NSRect convertRect_toView_(NSRect aRect, NSView aView) {
	NSRect result = new NSRect();
	OS.objc_msgSend_stret(result, this.id, OS.sel_convertRect_toView_, aRect, aView != null ? aView.id : 0);
	return result;
}

public NSRect convertRectFromBase(NSRect aRect) {
	NSRect result = new NSRect();
	OS.objc_msgSend_stret(result, this.id, OS.sel_convertRectFromBase_, aRect);
	return result;
}

public NSRect convertRectToBase(NSRect aRect) {
	NSRect result = new NSRect();
	OS.objc_msgSend_stret(result, this.id, OS.sel_convertRectToBase_, aRect);
	return result;
}

public NSSize convertSize_fromView_(NSSize aSize, NSView aView) {
	NSSize result = new NSSize();
	OS.objc_msgSend_stret(result, this.id, OS.sel_convertSize_fromView_, aSize, aView != null ? aView.id : 0);
	return result;
}

public NSSize convertSize_toView_(NSSize aSize, NSView aView) {
	NSSize result = new NSSize();
	OS.objc_msgSend_stret(result, this.id, OS.sel_convertSize_toView_, aSize, aView != null ? aView.id : 0);
	return result;
}

public NSSize convertSizeFromBase(NSSize aSize) {
	NSSize result = new NSSize();
	OS.objc_msgSend_stret(result, this.id, OS.sel_convertSizeFromBase_, aSize);
	return result;
}

public NSSize convertSizeToBase(NSSize aSize) {
	NSSize result = new NSSize();
	OS.objc_msgSend_stret(result, this.id, OS.sel_convertSizeToBase_, aSize);
	return result;
}

public void discardCursorRects() {
	OS.objc_msgSend(this.id, OS.sel_discardCursorRects);
}

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

public void displayIfNeeded() {
	OS.objc_msgSend(this.id, OS.sel_displayIfNeeded);
}

public void displayRectIgnoringOpacity(NSRect aRect, NSGraphicsContext context) {
	OS.objc_msgSend(this.id, OS.sel_displayRectIgnoringOpacity_inContext_, aRect, context != null ? context.id : 0);
}

public void dragImage(NSImage anImage, NSPoint viewLocation, NSSize initialOffset, NSEvent event, NSPasteboard pboard, id sourceObj, boolean slideFlag) {
	OS.objc_msgSend(this.id, OS.sel_dragImage_at_offset_event_pasteboard_source_slideBack_, anImage != null ? anImage.id : 0, viewLocation, initialOffset, event != null ? event.id : 0, pboard != null ? pboard.id : 0, sourceObj != null ? sourceObj.id : 0, slideFlag);
}

public void drawRect(NSRect rect) {
	OS.objc_msgSend(this.id, OS.sel_drawRect_, rect);
}

public void endDocument() {
	OS.objc_msgSend(this.id, OS.sel_endDocument);
}

public void endPage() {
	OS.objc_msgSend(this.id, OS.sel_endPage);
}

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

public NSView hitTest(NSPoint aPoint) {
	long result = OS.objc_msgSend(this.id, OS.sel_hitTest_, aPoint);
	return result == this.id ? this : (result != 0 ? new NSView(result) : null);
}

public NSView initWithFrame(NSRect frameRect) {
	long result = OS.objc_msgSend(this.id, OS.sel_initWithFrame_, frameRect);
	return result == this.id ? this : (result != 0 ? new NSView(result) : null);
}

public boolean isDescendantOf(NSView aView) {
	return OS.objc_msgSend_bool(this.id, OS.sel_isDescendantOf_, aView != null ? aView.id : 0);
}

public boolean isFlipped() {
	return OS.objc_msgSend_bool(this.id, OS.sel_isFlipped);
}

public boolean isHidden() {
	return OS.objc_msgSend_bool(this.id, OS.sel_isHidden);
}

public boolean isHiddenOrHasHiddenAncestor() {
	return OS.objc_msgSend_bool(this.id, OS.sel_isHiddenOrHasHiddenAncestor);
}

public boolean isOpaque() {
	return OS.objc_msgSend_bool(this.id, OS.sel_isOpaque);
}

public void lockFocus() {
	OS.objc_msgSend(this.id, OS.sel_lockFocus);
}

public NSMenu menuForEvent(NSEvent event) {
	long result = OS.objc_msgSend(this.id, OS.sel_menuForEvent_, event != null ? event.id : 0);
	return result != 0 ? new NSMenu(result) : null;
}

public boolean mouse(NSPoint aPoint, NSRect aRect) {
	return OS.objc_msgSend_bool(this.id, OS.sel_mouse_inRect_, aPoint, aRect);
}

public boolean mouseDownCanMoveWindow() {
	return OS.objc_msgSend_bool(this.id, OS.sel_mouseDownCanMoveWindow);
}

public boolean needsPanelToBecomeKey() {
	return OS.objc_msgSend_bool(this.id, OS.sel_needsPanelToBecomeKey);
}

public void registerForDraggedTypes(NSArray newTypes) {
	OS.objc_msgSend(this.id, OS.sel_registerForDraggedTypes_, newTypes != null ? newTypes.id : 0);
}

public void removeFromSuperview() {
	OS.objc_msgSend(this.id, OS.sel_removeFromSuperview);
}

public void removeToolTip(long tag) {
	OS.objc_msgSend(this.id, OS.sel_removeToolTip_, tag);
}

public void removeTrackingArea(NSTrackingArea trackingArea) {
	OS.objc_msgSend(this.id, OS.sel_removeTrackingArea_, trackingArea != null ? trackingArea.id : 0);
}

public void resetCursorRects() {
	OS.objc_msgSend(this.id, OS.sel_resetCursorRects);
}

public void scrollClipView(NSClipView aClipView, NSPoint aPoint) {
	OS.objc_msgSend(this.id, OS.sel_scrollClipView_toPoint_, aClipView != null ? aClipView.id : 0, aPoint);
}

public void scrollPoint(NSPoint aPoint) {
	OS.objc_msgSend(this.id, OS.sel_scrollPoint_, aPoint);
}

public void scrollRect(NSRect aRect, NSSize delta) {
	OS.objc_msgSend(this.id, OS.sel_scrollRect_by_, aRect, delta);
}

public boolean scrollRectToVisible(NSRect aRect) {
	return OS.objc_msgSend_bool(this.id, OS.sel_scrollRectToVisible_, aRect);
}

public void setAcceptsTouchEvents(boolean acceptsTouchEvents) {
	OS.objc_msgSend(this.id, OS.sel_setAcceptsTouchEvents_, acceptsTouchEvents);
}

public void setAutoresizesSubviews(boolean autoresizesSubviews) {
	OS.objc_msgSend(this.id, OS.sel_setAutoresizesSubviews_, autoresizesSubviews);
}

public void setAutoresizingMask(long autoresizingMask) {
	OS.objc_msgSend(this.id, OS.sel_setAutoresizingMask_, autoresizingMask);
}

public void setBoundsRotation(double boundsRotation) {
	OS.objc_msgSend(this.id, OS.sel_setBoundsRotation_, boundsRotation);
}

public void setFocusRingType(long focusRingType) {
	OS.objc_msgSend(this.id, OS.sel_setFocusRingType_, focusRingType);
}

public void setFrame(NSRect frame) {
	OS.objc_msgSend(this.id, OS.sel_setFrame_, frame);
}

public void setFrameOrigin(NSPoint newOrigin) {
	OS.objc_msgSend(this.id, OS.sel_setFrameOrigin_, newOrigin);
}

public void setFrameSize(NSSize newSize) {
	OS.objc_msgSend(this.id, OS.sel_setFrameSize_, newSize);
}

public void setHidden(boolean hidden) {
	OS.objc_msgSend(this.id, OS.sel_setHidden_, hidden);
}

public void setNeedsDisplay(boolean needsDisplay) {
	OS.objc_msgSend(this.id, OS.sel_setNeedsDisplay_, needsDisplay);
}

public void setNeedsDisplayInRect(NSRect invalidRect) {
	OS.objc_msgSend(this.id, OS.sel_setNeedsDisplayInRect_, invalidRect);
}

public void setToolTip(NSString toolTip) {
	OS.objc_msgSend(this.id, OS.sel_setToolTip_, toolTip != null ? toolTip.id : 0);
}

public void setWantsRestingTouches(boolean wantsRestingTouches) {
	OS.objc_msgSend(this.id, OS.sel_setWantsRestingTouches_, wantsRestingTouches);
}

public boolean shouldDelayWindowOrderingForEvent(NSEvent theEvent) {
	return OS.objc_msgSend_bool(this.id, OS.sel_shouldDelayWindowOrderingForEvent_, theEvent != null ? theEvent.id : 0);
}

public NSArray subviews() {
	long result = OS.objc_msgSend(this.id, OS.sel_subviews);
	return result != 0 ? new NSArray(result) : null;
}

public NSView superview() {
	long result = OS.objc_msgSend(this.id, OS.sel_superview);
	return result == this.id ? this : (result != 0 ? new NSView(result) : null);
}

public NSArray trackingAreas() {
	long result = OS.objc_msgSend(this.id, OS.sel_trackingAreas);
	return result != 0 ? new NSArray(result) : null;
}

public void unlockFocus() {
	OS.objc_msgSend(this.id, OS.sel_unlockFocus);
}

public void unregisterDraggedTypes() {
	OS.objc_msgSend(this.id, OS.sel_unregisterDraggedTypes);
}

public void updateTrackingAreas() {
	OS.objc_msgSend(this.id, OS.sel_updateTrackingAreas);
}

public void viewDidMoveToWindow() {
	OS.objc_msgSend(this.id, OS.sel_viewDidMoveToWindow);
}

public void viewWillMoveToWindow(NSWindow newWindow) {
	OS.objc_msgSend(this.id, OS.sel_viewWillMoveToWindow_, newWindow != null ? newWindow.id : 0);
}

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

public NSWindow window() {
	long result = OS.objc_msgSend(this.id, OS.sel_window);
	return result != 0 ? new NSWindow(result) : null;
}

}

Back to the top