001: /*
002: * Copyright 2003-2005 Sun Microsystems, Inc. All Rights Reserved.
003: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
004: *
005: * This code is free software; you can redistribute it and/or modify it
006: * under the terms of the GNU General Public License version 2 only, as
007: * published by the Free Software Foundation. Sun designates this
008: * particular file as subject to the "Classpath" exception as provided
009: * by Sun in the LICENSE file that accompanied this code.
010: *
011: * This code is distributed in the hope that it will be useful, but WITHOUT
012: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
013: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
014: * version 2 for more details (a copy is included in the LICENSE file that
015: * accompanied this code).
016: *
017: * You should have received a copy of the GNU General Public License version
018: * 2 along with this work; if not, write to the Free Software Foundation,
019: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
020: *
021: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
022: * CA 95054 USA or visit www.sun.com if you need additional information or
023: * have any questions.
024: */
025:
026: // This file is an automatically generated file, please do not edit this file, modify the WrapperGenerator.java file instead !
027: package sun.awt.X11;
028:
029: import sun.misc.Unsafe;
030:
031: public class XTranslateCoordinates {
032: private static Unsafe unsafe = XlibWrapper.unsafe;
033: private boolean __executed = false;
034: long _scr_w;
035: long _dest_w;
036: int _src_x;
037: int _src_y;
038: long dest_x_ptr = unsafe.allocateMemory(Native.getIntSize());
039: long dest_y_ptr = unsafe.allocateMemory(Native.getIntSize());
040: long child_ptr = unsafe.allocateMemory(Native.getLongSize());
041:
042: public XTranslateCoordinates(long scr_w, long dest_w, int src_x,
043: int src_y) {
044: set_scr_w(scr_w);
045: set_dest_w(dest_w);
046: set_src_x(src_x);
047: set_src_y(src_y);
048:
049: sun.java2d.Disposer.addRecord(this ,
050: disposer = new UnsafeXDisposerRecord(
051: "XTranslateCoordinates", dest_x_ptr,
052: dest_y_ptr, child_ptr));
053: }
054:
055: UnsafeXDisposerRecord disposer;
056:
057: public int execute() {
058: return execute(null);
059: }
060:
061: public int execute(XToolkit.XErrorHandler errorHandler) {
062: XToolkit.awtLock();
063: try {
064: if (isDisposed()) {
065: throw new IllegalStateException("Disposed");
066: }
067: if (__executed) {
068: throw new IllegalStateException("Already executed");
069: }
070: __executed = true;
071: if (errorHandler != null) {
072: XToolkit.WITH_XERROR_HANDLER(errorHandler);
073: }
074: int status = XlibWrapper.XTranslateCoordinates(XToolkit
075: .getDisplay(), get_scr_w(), get_dest_w(),
076: get_src_x(), get_src_y(), dest_x_ptr, dest_y_ptr,
077: child_ptr);
078: if (errorHandler != null) {
079: XToolkit.RESTORE_XERROR_HANDLER();
080: }
081: return status;
082: } finally {
083: XToolkit.awtUnlock();
084: }
085: }
086:
087: public boolean isExecuted() {
088: return __executed;
089: }
090:
091: public boolean isDisposed() {
092: return disposer.disposed;
093: }
094:
095: public void dispose() {
096: XToolkit.awtLock();
097: try {
098: if (isDisposed()) {
099: return;
100: }
101: disposer.dispose();
102: } finally {
103: XToolkit.awtUnlock();
104: }
105: }
106:
107: public long get_scr_w() {
108: if (isDisposed()) {
109: throw new IllegalStateException("Disposed");
110: }
111: if (!__executed) {
112: throw new IllegalStateException("Not executed");
113: }
114: return _scr_w;
115: }
116:
117: public void set_scr_w(long data) {
118: _scr_w = data;
119: }
120:
121: public long get_dest_w() {
122: if (isDisposed()) {
123: throw new IllegalStateException("Disposed");
124: }
125: if (!__executed) {
126: throw new IllegalStateException("Not executed");
127: }
128: return _dest_w;
129: }
130:
131: public void set_dest_w(long data) {
132: _dest_w = data;
133: }
134:
135: public int get_src_x() {
136: if (isDisposed()) {
137: throw new IllegalStateException("Disposed");
138: }
139: if (!__executed) {
140: throw new IllegalStateException("Not executed");
141: }
142: return _src_x;
143: }
144:
145: public void set_src_x(int data) {
146: _src_x = data;
147: }
148:
149: public int get_src_y() {
150: if (isDisposed()) {
151: throw new IllegalStateException("Disposed");
152: }
153: if (!__executed) {
154: throw new IllegalStateException("Not executed");
155: }
156: return _src_y;
157: }
158:
159: public void set_src_y(int data) {
160: _src_y = data;
161: }
162:
163: public int get_dest_x() {
164: if (isDisposed()) {
165: throw new IllegalStateException("Disposed");
166: }
167: if (!__executed) {
168: throw new IllegalStateException("Not executed");
169: }
170: return Native.getInt(dest_x_ptr);
171: }
172:
173: public void set_dest_x(int data) {
174: Native.putInt(dest_x_ptr, data);
175: }
176:
177: public int get_dest_y() {
178: if (isDisposed()) {
179: throw new IllegalStateException("Disposed");
180: }
181: if (!__executed) {
182: throw new IllegalStateException("Not executed");
183: }
184: return Native.getInt(dest_y_ptr);
185: }
186:
187: public void set_dest_y(int data) {
188: Native.putInt(dest_y_ptr, data);
189: }
190:
191: public long get_child() {
192: if (isDisposed()) {
193: throw new IllegalStateException("Disposed");
194: }
195: if (!__executed) {
196: throw new IllegalStateException("Not executed");
197: }
198: return Native.getLong(child_ptr);
199: }
200:
201: public void set_child(long data) {
202: Native.putLong(child_ptr, data);
203: }
204: }
|