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 * XDropTargetProtocol implementation for XDnD protocol. 0N/A * Creates an instance associated with the specified listener. 0N/A * @throws NullPointerException if listener is <code>null</code>. 0N/A /* XdndProxy is not supported for prior to XDnD version 4 */ 0N/A // Embedder already registered. 0N/A /* The proxy window must have the XdndAware set, as XDnD protocol 0N/A prescribes to check the proxy window for XdndAware. */ 0N/A /* The proxy window must have the XdndProxy set to point to itself.*/ 0N/A * Gets and stores in the registry the embedder's XDnD drop site info 0N/A * from the embedded. 0N/A /* XdndProxy is not supported for prior to XDnD version 4 */ 0N/A /* XDnD compliance only requires supporting version 3 and up. */ 0N/A /* Ignore the source if the protocol version is higher than we support. */ 0N/A /* Extract the list of supported actions. */ 0N/A /* Prior to XDnD version 2 only COPY action was supported. */ 0N/A * According to XDnD protocol, XdndActionList is optional. 0N/A * If XdndActionList is not set we try to guess which actions are 0N/A /* Extract the available data types. */ 0N/A for (
int i =
0; i <
3; i++) {
0N/A * Select for StructureNotifyMask to receive DestroyNotify in case of source 0N/A /* Ignore XDnD messages from all other windows. */ 0N/A /* Translate mouse position from root coordinates 0N/A to the target window coordinates. */ 0N/A /* Time stamp - new in XDnD version 1. */ 0N/A /* User action - new in XDnD version 2. */ 0N/A /* The default action is XdndActionCopy */ 0N/A /* Ignore XDnD messages from all other windows. */ 0N/A /* Ignore XDnD messages from all other windows. */ 0N/A /* XID of the source window */ 0N/A /* XID of the source window */ 0N/A /* specify an empty rectangle */ 0N/A /* action accepted by the target */ 0N/A // NOTE: we assume that the source supports at least version 1, so we 0N/A // can use the time stamp 0N/A // X server time is an unsigned 32-bit number! 0N/A // X server time is an unsigned 32-bit number! 0N/A * The XDnD protocol recommends that the target requests the special 0N/A * target DELETE in case if the drop action is XdndActionMove. 0N/A /* specify an empty rectangle */ 0N/A /* action performed by the target */ 0N/A * Flush the buffer to guarantee that the drop completion event is sent 0N/A * to the source before the method returns. 0N/A /* Trick to prevent cleanup() from posting dragExit */ 0N/A /* Cannot do cleanup before the drop finishes as we may need 0N/A source protocol version to send drop finished message. */ 0N/A * Reset the state of the object. 0N/A // Clear the reference to this protocol. 0N/A /* Adjust the event to match the XDnD protocol version. */ 0N/A +
" sourceProtocolVersion=" +
0N/A +
" sourceFormats.length=" +
0N/A // Make a copy of the passed XClientMessageEvent structure, since 0N/A // the original structure can be freed before this 0N/A // SunDropTargetEvent is dispatched. 0N/A // Append information from the latest XdndEnter event. 0N/A * the toolkit thread. 0N/A // The size of XClientMessageEvent structure. 0N/A // Copy XdndTypeList from source to proxy. 0N/A /* Make a copy of the original event, since we are going to modify the 0N/A event while it still can be referenced from other Java events. */ 0N/A // Last chance to send XdndLeave to the XEmbed client. 0N/A // We have to clear the proxy mode source window here, 0N/A // when the drag exits the XEmbedCanvasPeer. 0N/A // NOTE: at this point the XEmbed client still might have some 0N/A // drag notifications to process and it will send responses to 0N/A // us. With the proxy mode source window cleared we won't be 0N/A // able to forward these responses to the actual source. This is 0N/A // not a problem if the drag operation was initiated in this 0N/A // JVM. However, if it was initiated in another processes the 0N/A // responses will be lost. We bear with it for now, as it seems 0N/A // there is no other reliable point to clear.