001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */
017: /**
018: * @author Pavel Dolgov
019: * @version $Revision$
020: */package org.apache.harmony.awt.nativebridge.linux;
021:
022: import org.apache.harmony.awt.nativebridge.*;
023:
024: /**
025: * This file has been generated by a program.
026: *
027: *
028: */
029: public class Xft extends BasicLibWrapper {
030: static Xft instance;
031:
032: public static synchronized Xft getInstance() {
033: if (instance == null) {
034: instance = new Xft();
035: }
036: return instance;
037: }
038:
039: private Xft() {
040: System.loadLibrary("X11Wrapper"); //$NON-NLS-1$
041: init();
042: }
043:
044: private static native void init();
045:
046: public final native void XftDrawDestroy(long draw);
047:
048: public final native int XftDrawSetClip(long draw, long r);
049:
050: public final int XftDrawSetClipRectangles(long draw, int xOrigin,
051: int yOrigin, X11.XRectangle rects, int n) {
052: long tmp_0 = rects == null ? 0 : rects.longLockPointer();
053: int tmp_ret = XftDrawSetClipRectangles(draw, xOrigin, yOrigin,
054: tmp_0, n);
055: if (rects != null) {
056: rects.unlock();
057: }
058: return tmp_ret;
059: }
060:
061: public final native int XftDrawSetClipRectangles(long draw,
062: int xOrigin, int yOrigin, long rects, int n);
063:
064: public static class FT_Vector extends CommonStructWrapper {
065:
066: public static final int sizeof = NativeBridge.is64 ? 16 : 8;
067:
068: FT_Vector(boolean direct) {
069: super (sizeof, direct);
070: }
071:
072: FT_Vector(VoidPointer base) {
073: super (base);
074: }
075:
076: FT_Vector(long addr) {
077: super (addr);
078: }
079:
080: public final void set_x(long val) {
081: byteBase.setCLong(0, val);
082: }
083:
084: public final long get_x() {
085: return byteBase.getCLong(0);
086: }
087:
088: public final void set_y(long val) {
089: byteBase.setCLong(NativeBridge.is64 ? 8 : 4, val);
090: }
091:
092: public final long get_y() {
093: return byteBase.getCLong(NativeBridge.is64 ? 8 : 4);
094: }
095:
096: public int size() {
097: return sizeof;
098: }
099: }
100:
101: public final FT_Vector createFT_Vector(boolean direct) {
102: return new FT_Vector(direct);
103: }
104:
105: public final FT_Vector createFT_Vector(VoidPointer base) {
106: return new FT_Vector(base);
107: }
108:
109: public final FT_Vector createFT_Vector(long addr) {
110: return new FT_Vector(addr);
111: }
112:
113: public static class FT_Bitmap extends CommonStructWrapper {
114:
115: public static final int sizeof = NativeBridge.is64 ? 40 : 24;
116:
117: FT_Bitmap(boolean direct) {
118: super (sizeof, direct);
119: }
120:
121: FT_Bitmap(VoidPointer base) {
122: super (base);
123: }
124:
125: FT_Bitmap(long addr) {
126: super (addr);
127: }
128:
129: public final void set_rows(int val) {
130: byteBase.setInt32(0, val);
131: }
132:
133: public final int get_rows() {
134: return byteBase.getInt32(0);
135: }
136:
137: public final void set_width(int val) {
138: byteBase.setInt32(4, val);
139: }
140:
141: public final int get_width() {
142: return byteBase.getInt32(4);
143: }
144:
145: public final void set_pitch(int val) {
146: byteBase.setInt32(8, val);
147: }
148:
149: public final int get_pitch() {
150: return byteBase.getInt32(8);
151: }
152:
153: public final void set_buffer(Int8Pointer val) {
154: byteBase.setPointer(NativeBridge.is64 ? 16 : 12, val);
155: }
156:
157: public final Int8Pointer get_buffer() {
158: return nb.createInt8Pointer(byteBase
159: .getAddress(NativeBridge.is64 ? 16 : 12));
160: }
161:
162: public final void set_num_grays(short val) {
163: byteBase.setInt16(NativeBridge.is64 ? 24 : 16, val);
164: }
165:
166: public final short get_num_grays() {
167: return byteBase.getInt16(NativeBridge.is64 ? 24 : 16);
168: }
169:
170: public final void set_pixel_mode(byte val) {
171: byteBase.set(NativeBridge.is64 ? 26 : 18, val);
172: }
173:
174: public final byte get_pixel_mode() {
175: return byteBase.get(NativeBridge.is64 ? 26 : 18);
176: }
177:
178: public final void set_palette_mode(byte val) {
179: byteBase.set(NativeBridge.is64 ? 27 : 19, val);
180: }
181:
182: public final byte get_palette_mode() {
183: return byteBase.get(NativeBridge.is64 ? 27 : 19);
184: }
185:
186: public final void set_palette(VoidPointer val) {
187: byteBase.setPointer(NativeBridge.is64 ? 32 : 20, val);
188: }
189:
190: public final VoidPointer get_palette() {
191: return nb.createInt8Pointer(byteBase
192: .getAddress(NativeBridge.is64 ? 32 : 20));
193: }
194:
195: public int size() {
196: return sizeof;
197: }
198: }
199:
200: public final FT_Bitmap createFT_Bitmap(boolean direct) {
201: return new FT_Bitmap(direct);
202: }
203:
204: public final FT_Bitmap createFT_Bitmap(VoidPointer base) {
205: return new FT_Bitmap(base);
206: }
207:
208: public final FT_Bitmap createFT_Bitmap(long addr) {
209: return new FT_Bitmap(addr);
210: }
211:
212: public static class FT_Outline extends CommonStructWrapper {
213:
214: public static final int sizeof = NativeBridge.is64 ? 40 : 20;
215:
216: FT_Outline(boolean direct) {
217: super (sizeof, direct);
218: }
219:
220: FT_Outline(VoidPointer base) {
221: super (base);
222: }
223:
224: FT_Outline(long addr) {
225: super (addr);
226: }
227:
228: public final void set_n_contours(short val) {
229: byteBase.setInt16(0, val);
230: }
231:
232: public final short get_n_contours() {
233: return byteBase.getInt16(0);
234: }
235:
236: public final void set_n_points(short val) {
237: byteBase.setInt16(2, val);
238: }
239:
240: public final short get_n_points() {
241: return byteBase.getInt16(2);
242: }
243:
244: public final Xft.FT_Vector get_points() {
245: return Xft.instance.createFT_Vector(byteBase
246: .getAddress(NativeBridge.is64 ? 8 : 4));
247: }
248:
249: public final void set_tags(Int8Pointer val) {
250: byteBase.setPointer(NativeBridge.is64 ? 16 : 8, val);
251: }
252:
253: public final Int8Pointer get_tags() {
254: return nb.createInt8Pointer(byteBase
255: .getAddress(NativeBridge.is64 ? 16 : 8));
256: }
257:
258: public final void set_contours(Int16Pointer val) {
259: byteBase.setPointer(NativeBridge.is64 ? 24 : 12, val);
260: }
261:
262: public final Int16Pointer get_contours() {
263: return nb.createInt16Pointer(byteBase
264: .getAddress(NativeBridge.is64 ? 24 : 12));
265: }
266:
267: public final void set_flags(int val) {
268: byteBase.setInt32(NativeBridge.is64 ? 32 : 16, val);
269: }
270:
271: public final int get_flags() {
272: return byteBase.getInt32(NativeBridge.is64 ? 32 : 16);
273: }
274:
275: public int size() {
276: return sizeof;
277: }
278: }
279:
280: public final FT_Outline createFT_Outline(boolean direct) {
281: return new FT_Outline(direct);
282: }
283:
284: public final FT_Outline createFT_Outline(VoidPointer base) {
285: return new FT_Outline(base);
286: }
287:
288: public final FT_Outline createFT_Outline(long addr) {
289: return new FT_Outline(addr);
290: }
291:
292: }
|