/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* Motif DnD protocol global constants and convenience routines.
*
* @since 1.5
*/
class MotifDnDConstants {
// utility class can not be instantiated
private MotifDnDConstants() {}
// Note that offsets in all native structures below do not depend on the
// architecture.
/* Supported protocol styles */
/* Info structure sizes */
/* Message flags masks and shifts */
/* message type constants */
/* drop action constants */
/* drop site status constants */
long defaultRootWindow =
long motifWindow = 0;
0, 1,
false,
try {
// XID is CARD32.
}
return motifWindow;
} finally {
}
}
assert XToolkit.isAWTLockHeldByCurrentThread();
long defaultScreenNumber =
long defaultRootWindow =
long motifWindow = 0;
if (displayString == 0) {
throw new XException("XDisplayString returns NULL");
}
if (newDisplay == 0) {
throw new XException("XOpenDisplay returns NULL");
}
try {
try {
xwa.set_override_redirect(true);
-10, -10, 1, 1, 0, 0,
if (motifWindow == 0) {
throw new XException("XCreateWindow returns NULL");
}
try {
data, 1);
throw new XException("Cannot write motif drag window handle.");
}
return motifWindow;
} finally {
}
} finally {
}
} finally {
}
}
/*
* Note: it is unsafe to cache the motif drag window handle, as another
* client can change the _MOTIF_DRAG_WINDOW property on the root, the handle
* becomes out-of-sync and all subsequent drag operations will fail.
*/
long motifWindow = readMotifWindow();
if (motifWindow == 0) {
}
return motifWindow;
}
public static final class Swapper {
// utility class can not be instantiated
private Swapper() {}
public static short swap(short s) {
return (short)(((s & 0xFF00) >>> 8) | ((s & 0xFF) << 8));
}
public static int swap(int i) {
return ((i & 0xFF000000) >>> 24) | ((i & 0x00FF0000) >>> 8) |
((i & 0x0000FF00) << 8) | ((i & 0x000000FF) << 24);
}
return swap(s);
} else {
return s;
}
}
return swap(i);
} else {
return i;
}
}
}
/**
* DragBSI.h:
*
* typedef struct {
* BYTE byte_order;
* BYTE protocol_version;
* CARD16 num_target_lists B16;
* CARD32 heap_offset B32;
* } xmMotifTargetsPropertyRec;
*/
throws XException {
0, 100000L,
false,
try {
return null;
}
return null;
}
if (swapNeeded) {
}
long[][] table = new long[numTargetLists][];
if (swapNeeded) {
}
for (short i = 0; i < numTargetLists; i++) {
bufptr += 2;
if (swapNeeded) {
}
table[i] = new long[numTargets];
for (short j = 0; j < numTargets; j++) {
// NOTE: cannot use Unsafe.getInt(), since it crashes on
int target = 0;
}
} else {
}
}
// NOTE: don't need to swap, since we read it in the proper
// order already.
bufptr += 4;
}
}
return table;
} finally {
}
}
throws XException {
assert XToolkit.isAWTLockHeldByCurrentThread();
}
try {
// BYTE byte_order;
// BYTE protocol_version;
// CARD16 num_target_lists B16;
// CARD32 heap_offset B32;
bufptr += 2;
// NOTE: cannot use Unsafe.putInt(), since it crashes on
}
} else {
}
}
bufptr += 4;
}
}
// Create a new motif window and retry.
throw new XException("Cannot write motif drag targets property.");
}
}
} finally {
}
}
assert XToolkit.isAWTLockHeldByCurrentThread();
// Make a defensive copy.
}
// NOTE: getMotifWindow() should never be called if the server is
// grabbed. This will lock up the application as it grabs the server
// itself.
// Since we don't grab the server before getMotifWindow(), another
// client might replace motif window after we read it from the root, but
// before we grab the server.
// We cannot resolve this problem, but we believe that this scenario is
// very unlikely to happen.
long motifWindow = getMotifWindow();
try {
boolean equals = true;
equals = false;
break;
}
}
} else {
equals = false;
}
if (equals) {
return i;
}
}
} else {
// Create a new table.
// The first two entries must always be the same.
// (see DragBS.c)
table = new long[2][];
}
/* Index not found - expand the targets table. */
/* Copy the old contents to the new table. */
}
/* Fill in the new entry */
} finally {
}
}
long motifWindow = getMotifWindow();
return new long[0];
} else {
}
}
static byte getByteOrderByte() {
// 'l' - for little endian, 'B' - for big endian.
(byte)0x6C : (byte)0x42;
}
assert XToolkit.isAWTLockHeldByCurrentThread();
try {
// BYTE byte_order
// BYTE protocol_version
// CARD16 protocol_version
// CARD32 icc_handle
throw new XException("Cannot write drag initiator info");
}
} finally {
}
}
assert XToolkit.isAWTLockHeldByCurrentThread();
try {
throw new XException("Cannot write Motif receiver info property");
}
} finally {
}
}
int motifActions = MOTIF_DND_NOOP;
}
}
}
return motifActions;
}
}
}
}
return javaActions;
}
}