6447N/A * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. Oracle designates this 0N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 0N/A * Motif DnD protocol global constants and convenience routines. 94N/A // utility class can not be instantiated 0N/A // Note that offsets in all native structures below do not depend on the 0N/A /* Supported protocol styles */ 0N/A /* Info structure sizes */ 0N/A /* Message flags masks and shifts */ 0N/A /* message type constants */ 0N/A /* drop action constants */ 0N/A /* drop site status constants */ 0N/A -
10, -
10,
1,
1,
0,
0,
0N/A * Note: it is unsafe to cache the motif drag window handle, as another 0N/A * client can change the _MOTIF_DRAG_WINDOW property on the root, the handle 0N/A * becomes out-of-sync and all subsequent drag operations will fail. 94N/A // utility class can not be instantiated 0N/A public static short swap(
short s) {
0N/A return (
short)(((s &
0xFF00) >>>
8) | ((s &
0xFF) <<
8));
0N/A return ((i &
0xFF000000) >>>
24) | ((i &
0x00FF0000) >>>
8) |
0N/A ((i &
0x0000FF00) <<
8) | ((i &
0x000000FF) <<
24);
0N/A * BYTE protocol_version; 0N/A * CARD16 num_target_lists B16; 0N/A * CARD32 heap_offset B32; 0N/A * } xmMotifTargetsPropertyRec; 0N/A // NOTE: cannot use Unsafe.getInt(), since it crashes on 0N/A // NOTE: don't need to swap, since we read it in the proper 0N/A int tableSize =
8;
/* The size of leading xmMotifTargetsPropertyRec. */ 0N/A // BYTE protocol_version; 0N/A // CARD16 num_target_lists B16; 0N/A // CARD32 heap_offset B32; 0N/A // NOTE: cannot use Unsafe.putInt(), since it crashes on 0N/A // Create a new motif window and retry. 0N/A throw new XException(
"Cannot write motif drag targets property.");
0N/A // Make a defensive copy. 0N/A // NOTE: getMotifWindow() should never be called if the server is 0N/A // grabbed. This will lock up the application as it grabs the server 0N/A // Since we don't grab the server before getMotifWindow(), another 0N/A // client might replace motif window after we read it from the root, but 0N/A // before we grab the server. 0N/A // We cannot resolve this problem, but we believe that this scenario is 0N/A // very unlikely to happen. 0N/A // Create a new table. 0N/A // The first two entries must always be the same. 0N/A /* Index not found - expand the targets table. */ 0N/A /* Copy the old contents to the new table. */ 0N/A /* Fill in the new entry */ 0N/A // 'l' - for little endian, 'B' - for big endian. 0N/A (
byte)
0x6C : (
byte)
0x42;
0N/A // BYTE protocol_version 0N/A // CARD16 protocol_version 0N/A // CARD32 icc_handle 0N/A throw new XException(
"Cannot write Motif receiver info property");