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
|
/*******************************************************************************
* Copyright (c) 2000, 2012 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 NSGraphicsContext extends NSObject {
public NSGraphicsContext() {
super();
}
public NSGraphicsContext(long /*int*/ id) {
super(id);
}
public NSGraphicsContext(id id) {
super(id);
}
public static NSGraphicsContext currentContext() {
long /*int*/ result = OS.objc_msgSend(OS.class_NSGraphicsContext, OS.sel_currentContext);
return result != 0 ? new NSGraphicsContext(result) : null;
}
public void flushGraphics() {
OS.objc_msgSend(this.id, OS.sel_flushGraphics);
}
public static NSGraphicsContext graphicsContextWithBitmapImageRep(NSBitmapImageRep bitmapRep) {
long /*int*/ result = OS.objc_msgSend(OS.class_NSGraphicsContext, OS.sel_graphicsContextWithBitmapImageRep_, bitmapRep != null ? bitmapRep.id : 0);
return result != 0 ? new NSGraphicsContext(result) : null;
}
public static NSGraphicsContext graphicsContextWithGraphicsPort(long /*int*/ graphicsPort, boolean initialFlippedState) {
long /*int*/ result = OS.objc_msgSend(OS.class_NSGraphicsContext, OS.sel_graphicsContextWithGraphicsPort_flipped_, graphicsPort, initialFlippedState);
return result != 0 ? new NSGraphicsContext(result) : null;
}
public static NSGraphicsContext graphicsContextWithWindow(NSWindow window) {
long /*int*/ result = OS.objc_msgSend(OS.class_NSGraphicsContext, OS.sel_graphicsContextWithWindow_, window != null ? window.id : 0);
return result != 0 ? new NSGraphicsContext(result) : null;
}
public long /*int*/ graphicsPort() {
return OS.objc_msgSend(this.id, OS.sel_graphicsPort);
}
public long /*int*/ imageInterpolation() {
return OS.objc_msgSend(this.id, OS.sel_imageInterpolation);
}
public boolean isDrawingToScreen() {
return OS.objc_msgSend_bool(this.id, OS.sel_isDrawingToScreen);
}
public boolean isFlipped() {
return OS.objc_msgSend_bool(this.id, OS.sel_isFlipped);
}
public static void static_restoreGraphicsState() {
OS.objc_msgSend(OS.class_NSGraphicsContext, OS.sel_restoreGraphicsState);
}
public void restoreGraphicsState() {
OS.objc_msgSend(this.id, OS.sel_restoreGraphicsState);
}
public static void static_saveGraphicsState() {
OS.objc_msgSend(OS.class_NSGraphicsContext, OS.sel_saveGraphicsState);
}
public void saveGraphicsState() {
OS.objc_msgSend(this.id, OS.sel_saveGraphicsState);
}
public void setCompositingOperation(long /*int*/ operation) {
OS.objc_msgSend(this.id, OS.sel_setCompositingOperation_, operation);
}
public static void setCurrentContext(NSGraphicsContext context) {
OS.objc_msgSend(OS.class_NSGraphicsContext, OS.sel_setCurrentContext_, context != null ? context.id : 0);
}
public void setImageInterpolation(long /*int*/ interpolation) {
OS.objc_msgSend(this.id, OS.sel_setImageInterpolation_, interpolation);
}
public void setPatternPhase(NSPoint phase) {
OS.objc_msgSend(this.id, OS.sel_setPatternPhase_, phase);
}
public void setShouldAntialias(boolean antialias) {
OS.objc_msgSend(this.id, OS.sel_setShouldAntialias_, antialias);
}
public boolean shouldAntialias() {
return OS.objc_msgSend_bool(this.id, OS.sel_shouldAntialias);
}
}
|