forked from CinemaMod/java-cef
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCefPrintSettings_N.java
More file actions
286 lines (254 loc) · 7.91 KB
/
CefPrintSettings_N.java
File metadata and controls
286 lines (254 loc) · 7.91 KB
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
// Copyright (c) 2014 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
package org.cef.misc;
import org.cef.callback.CefNative;
import java.awt.Dimension;
import java.awt.Rectangle;
import java.util.Vector;
class CefPrintSettings_N extends CefPrintSettings implements CefNative {
// Used internally to store a pointer to the CEF object.
private long N_CefHandle = 0;
@Override
public void setNativeRef(String identifer, long nativeRef) {
N_CefHandle = nativeRef;
}
@Override
public long getNativeRef(String identifer) {
return N_CefHandle;
}
CefPrintSettings_N() {
super();
}
public static CefPrintSettings createNative() {
try {
return CefPrintSettings_N.N_Create();
} catch (UnsatisfiedLinkError ule) {
ule.printStackTrace();
return null;
}
}
@Override
public void dispose() {
try {
N_Dispose(N_CefHandle);
} catch (UnsatisfiedLinkError ule) {
ule.printStackTrace();
}
}
@Override
public boolean isValid() {
try {
return N_IsValid(N_CefHandle);
} catch (UnsatisfiedLinkError ule) {
ule.printStackTrace();
}
return false;
}
@Override
public boolean isReadOnly() {
try {
return N_IsReadOnly(N_CefHandle);
} catch (UnsatisfiedLinkError ule) {
ule.printStackTrace();
}
return false;
}
@Override
public void setOrientation(boolean landscape) {
try {
N_SetOrientation(N_CefHandle, landscape);
} catch (UnsatisfiedLinkError ule) {
ule.printStackTrace();
}
}
@Override
public boolean isLandscape() {
try {
return N_IsLandscape(N_CefHandle);
} catch (UnsatisfiedLinkError ule) {
ule.printStackTrace();
}
return false;
}
@Override
public void setPrinterPrintableArea(Dimension physical_size_device_units,
Rectangle printable_area_device_units, boolean landscape_needs_flip) {
try {
N_SetPrinterPrintableArea(N_CefHandle, physical_size_device_units,
printable_area_device_units, landscape_needs_flip);
} catch (UnsatisfiedLinkError ule) {
ule.printStackTrace();
}
}
@Override
public void setDeviceName(String name) {
try {
N_SetDeviceName(N_CefHandle, name);
} catch (UnsatisfiedLinkError ule) {
ule.printStackTrace();
}
}
@Override
public String getDeviceName() {
try {
return N_GetDeviceName(N_CefHandle);
} catch (UnsatisfiedLinkError ule) {
ule.printStackTrace();
}
return null;
}
@Override
public void setDPI(int dpi) {
try {
N_SetDPI(N_CefHandle, dpi);
} catch (UnsatisfiedLinkError ule) {
ule.printStackTrace();
}
}
@Override
public int getDPI() {
try {
return N_GetDPI(N_CefHandle);
} catch (UnsatisfiedLinkError ule) {
ule.printStackTrace();
}
return 0;
}
@Override
public void setPageRanges(Vector<CefPageRange> ranges) {
try {
N_SetPageRanges(N_CefHandle, ranges);
} catch (UnsatisfiedLinkError ule) {
ule.printStackTrace();
}
}
@Override
public int getPageRangesCount() {
try {
return N_GetPageRangesCount(N_CefHandle);
} catch (UnsatisfiedLinkError ule) {
ule.printStackTrace();
}
return 0;
}
@Override
public void getPageRanges(Vector<CefPageRange> ranges) {
try {
N_GetPageRanges(N_CefHandle, ranges);
} catch (UnsatisfiedLinkError ule) {
ule.printStackTrace();
}
}
@Override
public void setSelectionOnly(boolean selection_only) {
try {
N_SetSelectionOnly(N_CefHandle, selection_only);
} catch (UnsatisfiedLinkError ule) {
ule.printStackTrace();
}
}
@Override
public boolean isSelectionOnly() {
try {
return N_IsSelectionOnly(N_CefHandle);
} catch (UnsatisfiedLinkError ule) {
ule.printStackTrace();
}
return false;
}
@Override
public void setCollate(boolean collate) {
try {
N_SetCollate(N_CefHandle, collate);
} catch (UnsatisfiedLinkError ule) {
ule.printStackTrace();
}
}
@Override
public boolean willCollate() {
try {
return N_WillCollate(N_CefHandle);
} catch (UnsatisfiedLinkError ule) {
ule.printStackTrace();
}
return false;
}
@Override
public void setColorModel(ColorModel model) {
try {
N_SetColorModel(N_CefHandle, model);
} catch (UnsatisfiedLinkError ule) {
ule.printStackTrace();
}
}
@Override
public ColorModel getColorModel() {
try {
return N_GetColorModel(N_CefHandle);
} catch (UnsatisfiedLinkError ule) {
ule.printStackTrace();
}
return null;
}
@Override
public void setCopies(int copies) {
try {
N_SetCopies(N_CefHandle, copies);
} catch (UnsatisfiedLinkError ule) {
ule.printStackTrace();
}
}
@Override
public int getCopies() {
try {
return N_GetCopies(N_CefHandle);
} catch (UnsatisfiedLinkError ule) {
ule.printStackTrace();
}
return 0;
}
@Override
public void setDuplexMode(DuplexMode mode) {
try {
N_SetDuplexMode(N_CefHandle, mode);
} catch (UnsatisfiedLinkError ule) {
ule.printStackTrace();
}
}
@Override
public DuplexMode getDuplexMode() {
try {
return N_GetDuplexMode(N_CefHandle);
} catch (UnsatisfiedLinkError ule) {
ule.printStackTrace();
}
return null;
}
private final native static CefPrintSettings_N N_Create();
private final native void N_Dispose(long self);
private final native boolean N_IsValid(long self);
private final native boolean N_IsReadOnly(long self);
private final native void N_SetOrientation(long self, boolean landscape);
private final native boolean N_IsLandscape(long self);
private final native void N_SetPrinterPrintableArea(long self,
Dimension physical_size_device_units, Rectangle printable_area_device_units,
boolean landscape_needs_flip);
private final native void N_SetDeviceName(long self, String name);
private final native String N_GetDeviceName(long self);
private final native void N_SetDPI(long self, int dpi);
private final native int N_GetDPI(long self);
private final native void N_SetPageRanges(long self, Vector<CefPageRange> ranges);
private final native int N_GetPageRangesCount(long self);
private final native void N_GetPageRanges(long self, Vector<CefPageRange> ranges);
private final native void N_SetSelectionOnly(long self, boolean selection_only);
private final native boolean N_IsSelectionOnly(long self);
private final native void N_SetCollate(long self, boolean collate);
private final native boolean N_WillCollate(long self);
private final native void N_SetColorModel(long self, ColorModel model);
private final native ColorModel N_GetColorModel(long self);
private final native void N_SetCopies(long self, int copies);
private final native int N_GetCopies(long self);
private final native void N_SetDuplexMode(long self, DuplexMode mode);
private final native DuplexMode N_GetDuplexMode(long self);
}