summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSGraphicsContext.java
blob: a26be04126870bd21bce5bc19fe083aa39964cf3 (plain)
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
package org.eclipse.swt.internal.cocoa;

public class NSGraphicsContext extends NSObject {

public NSGraphicsContext() {
	super();
}

public NSGraphicsContext(int id) {
	super(id);
}

//public CIContext CIContext() {
//	int result = OS.objc_msgSend(this.id, OS.sel_CIContext);
//	return result != 0 ? new CIContext(result) : null;
//}

public NSDictionary attributes() {
	int result = OS.objc_msgSend(this.id, OS.sel_attributes);
	return result != 0 ? new NSDictionary(result) : null;
}

public int colorRenderingIntent() {
	return OS.objc_msgSend(this.id, OS.sel_colorRenderingIntent);
}

public int compositingOperation() {
	return OS.objc_msgSend(this.id, OS.sel_compositingOperation);
}

public static NSGraphicsContext currentContext() {
	int result = OS.objc_msgSend(OS.class_NSGraphicsContext, OS.sel_currentContext);
	return result != 0 ? new NSGraphicsContext(result) : null;
}

public static boolean currentContextDrawingToScreen() {
	return OS.objc_msgSend(OS.class_NSGraphicsContext, OS.sel_currentContextDrawingToScreen) != 0;
}

public void flushGraphics() {
	OS.objc_msgSend(this.id, OS.sel_flushGraphics);
}

public id focusStack() {
	int result = OS.objc_msgSend(this.id, OS.sel_focusStack);
	return result != 0 ? new id(result) : null;
}

public static NSGraphicsContext graphicsContextWithAttributes(NSDictionary attributes) {
	int result = OS.objc_msgSend(OS.class_NSGraphicsContext, OS.sel_graphicsContextWithAttributes_1, attributes != null ? attributes.id : 0);
	return result != 0 ? new NSGraphicsContext(result) : null;
}

public static NSGraphicsContext graphicsContextWithBitmapImageRep(NSBitmapImageRep bitmapRep) {
	int result = OS.objc_msgSend(OS.class_NSGraphicsContext, OS.sel_graphicsContextWithBitmapImageRep_1, bitmapRep != null ? bitmapRep.id : 0);
	return result != 0 ? new NSGraphicsContext(result) : null;
}

public static NSGraphicsContext graphicsContextWithGraphicsPort(int graphicsPort, boolean initialFlippedState) {
	int result = OS.objc_msgSend(OS.class_NSGraphicsContext, OS.sel_graphicsContextWithGraphicsPort_1flipped_1, graphicsPort, initialFlippedState);
	return result != 0 ? new NSGraphicsContext(result) : null;
}

public static NSGraphicsContext graphicsContextWithWindow(NSWindow window) {
	int result = OS.objc_msgSend(OS.class_NSGraphicsContext, OS.sel_graphicsContextWithWindow_1, window != null ? window.id : 0);
	return result != 0 ? new NSGraphicsContext(result) : null;
}

public int graphicsPort() {
	return OS.objc_msgSend(this.id, OS.sel_graphicsPort);
}

public int imageInterpolation() {
	return OS.objc_msgSend(this.id, OS.sel_imageInterpolation);
}

public boolean isDrawingToScreen() {
	return OS.objc_msgSend(this.id, OS.sel_isDrawingToScreen) != 0;
}

public boolean isFlipped() {
	return OS.objc_msgSend(this.id, OS.sel_isFlipped) != 0;
}

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

public void restoreGraphicsState() {
	OS.objc_msgSend(this.id, OS.sel_restoreGraphicsState);
}

public static void static_restoreGraphicsState() {
	OS.objc_msgSend(OS.class_NSGraphicsContext, OS.sel_restoreGraphicsState);
}

public void saveGraphicsState() {
	OS.objc_msgSend(this.id, OS.sel_saveGraphicsState);
}

public static void static_saveGraphicsState() {
	OS.objc_msgSend(OS.class_NSGraphicsContext, OS.sel_saveGraphicsState);
}

public void setColorRenderingIntent(int renderingIntent) {
	OS.objc_msgSend(this.id, OS.sel_setColorRenderingIntent_1, renderingIntent);
}

public void setCompositingOperation(int operation) {
	OS.objc_msgSend(this.id, OS.sel_setCompositingOperation_1, operation);
}

public static void setCurrentContext(NSGraphicsContext context) {
	OS.objc_msgSend(OS.class_NSGraphicsContext, OS.sel_setCurrentContext_1, context != null ? context.id : 0);
}

public void setFocusStack(id stack) {
	OS.objc_msgSend(this.id, OS.sel_setFocusStack_1, stack != null ? stack.id : 0);
}

public static void setGraphicsState(int gState) {
	OS.objc_msgSend(OS.class_NSGraphicsContext, OS.sel_setGraphicsState_1, gState);
}

public void setImageInterpolation(int interpolation) {
	OS.objc_msgSend(this.id, OS.sel_setImageInterpolation_1, interpolation);
}

public void setPatternPhase(NSPoint phase) {
	OS.objc_msgSend(this.id, OS.sel_setPatternPhase_1, phase);
}

public void setShouldAntialias(boolean antialias) {
	OS.objc_msgSend(this.id, OS.sel_setShouldAntialias_1, antialias);
}

public boolean shouldAntialias() {
	return OS.objc_msgSend(this.id, OS.sel_shouldAntialias) != 0;
}

}