/*
* 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.
*/
/**
* An abstract class for drop protocols on X11 systems.
* Contains protocol-independent drop target code.
*
* @since 1.5
*/
abstract class XDropTargetProtocol {
throw new NullPointerException("Null XDropTargetProtocolListener");
}
}
return listener;
}
/**
* Returns the protocol name. The protocol name cannot be null.
*/
/* The caller must hold AWT_LOCK. */
/* The caller must hold AWT_LOCK. */
/* The caller must hold AWT_LOCK. */
/* The caller must hold AWT_LOCK. */
/* The caller must hold AWT_LOCK. */
/* The caller must hold AWT_LOCK. */
}
/* The caller must hold AWT_LOCK. */
/* The caller must hold AWT_LOCK. */
return processed;
}
/* The caller must hold AWT_LOCK. */
/*
* Forwards a drag notification to the embedding toplevel modifying the event
* to match the protocol version supported by the toplevel.
* The caller must hold AWT_LOCK.
* Returns True if the event is sent, False otherwise.
*/
}
// Window not registered as an embedder for this protocol.
return false;
}
}
// Window didn't have an associated drop site, so there is no need
// to forward the message.
if (!entry.isOverriden()) {
return false;
}
}
if (proxy == 0) {
}
try {
} finally {
}
return true;
}
/* True iff the previous notification was MotionEvent and it was
forwarded to the browser. */
private boolean motionPassedAlong = false;
boolean processed,
int type) {
/*
* This code forwards drag notifications to the browser according to the
* following rules:
* - the messages that we failed to process are always forwarded to the
* browser;
* - MotionEvents and DropEvents are forwarded if and only if the drag
* is not over a plugin window;
* - XDnD: EnterEvents and LeaveEvents are never forwarded, instead, we
* send synthesized EnterEvents or LeaveEvents when the drag
* respectively exits or enters plugin windows;
* - Motif DnD: EnterEvents and LeaveEvents are always forwarded.
* Synthetic EnterEvents and LeaveEvents are needed, because the XDnD drop
* site implemented Netscape 6.2 has a nice feature: when it receives
* the first XdndPosition it continuously sends XdndStatus messages to
* the source (every 100ms) until the drag terminates or leaves the drop
* site. When the mouse is dragged over plugin window embedded in the
* browser frame, these XdndStatus messages are mixed with the XdndStatus
* messages sent from the plugin.
* For Motif DnD, synthetic events cause Motif warnings being displayed,
* so these events are always forwarded. However, Motif DnD drop site in
* Netscape 6.2 is implemented in the same way, so there could be similar
* problems if the drag source choose Motif DnD for communication.
*/
if (!processed) {
} else {
boolean motifProtocol =
xclient.get_message_type() ==
switch (type) {
if (!isDragOverComponent()) {
if (!motionPassedAlong && !motifProtocol) {
}
motionPassedAlong = true;
} else {
if (motionPassedAlong && !motifProtocol) {
}
motionPassedAlong = false;
}
break;
if (!isDragOverComponent()) {
}
motionPassedAlong = false;
break;
if (motifProtocol) {
}
motionPassedAlong = false;
break;
}
}
}
}
/*
* Retrieves the data from the drag source in the specified format.
*
* @param ctxt a pointer to the XClientMessageEvent structure for this
* protocol's drop message.
* @param format the format in which the data should be retrieved.
*
* @throws IllegalArgumentException if ctxt doesn't point to the
* XClientMessageEvent structure for this protocol's drop message.
* @throws IOException if data retrieval failed.
*/
throws IllegalArgumentException, IOException;
int dropAction);
public abstract long getSourceWindow();
public abstract void cleanup();
public abstract boolean isDragOverComponent();
int eventID);
/*
* Returns true if the XEmbed protocol prescribes that an XEmbed server must
* support this DnD protocol for drop sites associated with XEmbed clients.
*/
public abstract boolean isXEmbedSupported();
protected static final class EmbedderRegistryEntry {
private final boolean overriden;
private final int version;
private final long proxy;
}
public boolean isOverriden() {
return overriden;
}
public int getVersion() {
return version;
}
public long getProxy() {
return proxy;
}
}
/* Access to HashMap is synchronized on this XDropTargetProtocol instance. */
boolean overriden,
int version,
long proxy) {
synchronized (this) {
proxy));
}
}
synchronized (this) {
return
}
}
synchronized (this) {
}
}
}