XQueryTree.java revision 2362
4632N/A/*
4632N/A * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
4632N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4632N/A *
4632N/A * This code is free software; you can redistribute it and/or modify it
4632N/A * under the terms of the GNU General Public License version 2 only, as
4632N/A * published by the Free Software Foundation. Oracle designates this
4632N/A * particular file as subject to the "Classpath" exception as provided
4632N/A * by Oracle in the LICENSE file that accompanied this code.
4632N/A *
4632N/A * This code is distributed in the hope that it will be useful, but WITHOUT
4632N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
4632N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
4632N/A * version 2 for more details (a copy is included in the LICENSE file that
4632N/A * accompanied this code).
4632N/A *
4632N/A * You should have received a copy of the GNU General Public License version
4632N/A * 2 along with this work; if not, write to the Free Software Foundation,
4632N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
4632N/A *
4632N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
4632N/A * or visit www.oracle.com if you need additional information or have any
4632N/A * questions.
4632N/A */
4632N/A
4632N/A// This file is an automatically generated file, please do not edit this file, modify the WrapperGenerator.java file instead !
4632N/A
4632N/Apackage sun.awt.X11;
4632N/A
4632N/Aimport sun.misc.Unsafe;
4632N/A
4632N/Apublic class XQueryTree {
4632N/A private static Unsafe unsafe = XlibWrapper.unsafe;
4632N/A private boolean __executed = false;
4632N/A long _w;
4632N/A long root_ptr = unsafe.allocateMemory(Native.getLongSize());
4632N/A long parent_ptr = unsafe.allocateMemory(Native.getLongSize());
5010N/A long children_ptr = unsafe.allocateMemory(Native.getLongSize());
4632N/A long nchildren_ptr = unsafe.allocateMemory(Native.getIntSize());
4632N/A UnsafeXDisposerRecord disposer;
4632N/A public XQueryTree(
4632N/A long w )
4632N/A {
4632N/A set_w(w);
4632N/A sun.java2d.Disposer.addRecord(this, disposer = new UnsafeXDisposerRecord("XQueryTree",
4996N/A new long[]{root_ptr, parent_ptr, nchildren_ptr},
5064N/A new long[] {children_ptr}));
4632N/A set_children(0);
4632N/A }
5010N/A public int execute() {
5010N/A return execute(null);
5010N/A }
4632N/A public int execute(XErrorHandler errorHandler) {
4632N/A XToolkit.awtLock();
4632N/A try {
4632N/A if (isDisposed()) {
4632N/A throw new IllegalStateException("Disposed");
4632N/A }
4996N/A if (__executed) {
4632N/A throw new IllegalStateException("Already executed");
4632N/A }
4632N/A __executed = true;
4632N/A if (errorHandler != null) {
4632N/A XToolkit.WITH_XERROR_HANDLER(errorHandler);
4632N/A }
4639N/A Native.putLong(children_ptr, 0);
5124N/A int status =
5010N/A XlibWrapper.XQueryTree(XToolkit.getDisplay(),
5010N/A get_w(),
5010N/A root_ptr,
5010N/A parent_ptr,
5010N/A children_ptr,
5010N/A nchildren_ptr );
5010N/A if (errorHandler != null) {
6078N/A XToolkit.RESTORE_XERROR_HANDLER();
6078N/A }
6078N/A return status;
5010N/A } finally {
5010N/A XToolkit.awtUnlock();
5010N/A }
5010N/A }
5010N/A public boolean isExecuted() {
5010N/A return __executed;
5010N/A }
5010N/A
5010N/A public boolean isDisposed() {
5010N/A return disposer.disposed;
5010N/A }
5010N/A public void dispose() {
5010N/A XToolkit.awtLock();
5010N/A try {
4632N/A if (isDisposed()) {
4632N/A return;
4632N/A }
disposer.dispose();
} finally {
XToolkit.awtUnlock();
}
}
public long get_w() {
if (isDisposed()) {
throw new IllegalStateException("Disposed");
}
if (!__executed) {
throw new IllegalStateException("Not executed");
}
return _w;
}
public void set_w(long data) {
_w = data;
}
public long get_root() {
if (isDisposed()) {
throw new IllegalStateException("Disposed");
}
if (!__executed) {
throw new IllegalStateException("Not executed");
}
return Native.getLong(root_ptr);
}
public void set_root(long data) {
Native.putLong(root_ptr, data);
}
public long get_parent() {
if (isDisposed()) {
throw new IllegalStateException("Disposed");
}
if (!__executed) {
throw new IllegalStateException("Not executed");
}
return Native.getLong(parent_ptr);
}
public void set_parent(long data) {
Native.putLong(parent_ptr, data);
}
public long get_children() {
if (isDisposed()) {
throw new IllegalStateException("Disposed");
}
if (!__executed) {
throw new IllegalStateException("Not executed");
}
return Native.getLong(children_ptr);
}
public void set_children(long data) {
Native.putLong(children_ptr, data);
}
public int get_nchildren() {
if (isDisposed()) {
throw new IllegalStateException("Disposed");
}
if (!__executed) {
throw new IllegalStateException("Not executed");
}
return Native.getInt(nchildren_ptr);
}
public void set_nchildren(int data) {
Native.putInt(nchildren_ptr, data);
}
}