/*
* 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.
*/
/**
* XDropTargetProtocol implementation for Motif DnD protocol.
*
* @since 1.5
*/
private boolean topLevelLeavePostponed = false;
super(listener);
}
/**
* Creates an instance associated with the specified listener.
*
* @throws NullPointerException if listener is <code>null</code>.
*/
return new MotifDnDDropTargetProtocol(listener);
}
return XDragAndDropProtocols.MotifDnD;
}
assert XToolkit.isAWTLockHeldByCurrentThread();
}
assert XToolkit.isAWTLockHeldByCurrentThread();
}
assert XToolkit.isAWTLockHeldByCurrentThread();
boolean overriden = false;
int version = 0;
long proxy = 0;
int status = 0;
long data = 0;
0, 0xFFFF, false,
try {
/*
* DragICCI.h:
*
* typedef struct _xmDragReceiverInfoStruct{
* BYTE byte_order;
* BYTE protocol_version;
* BYTE drag_protocol_style;
* BYTE pad1;
* CARD32 proxy_window B32;
* CARD16 num_drop_sites B16;
* CARD16 pad2 B16;
* CARD32 heap_offset B32;
* } xmDragReceiverInfoStruct;
*/
wpg.getNumberOfItems() >=
overriden = true;
{
}
}
// Embedder already registered.
return;
}
{
}
}
} else {
}
throw new XException("Cannot write Motif receiver info property");
}
} finally {
if (!overriden) {
data = 0;
}
}
}
assert XToolkit.isAWTLockHeldByCurrentThread();
return;
}
if (entry.isOverriden()) {
int status = 0;
0, 0xFFFF, false,
try {
/*
* DragICCI.h:
*
* typedef struct _xmDragReceiverInfoStruct{
* BYTE byte_order;
* BYTE protocol_version;
* BYTE drag_protocol_style;
* BYTE pad1;
* CARD32 proxy_window B32;
* CARD16 num_drop_sites B16;
* CARD16 pad2 B16;
* CARD32 heap_offset B32;
* } xmDragReceiverInfoStruct;
*/
wpg.getNumberOfItems() >=
}
throw new XException("Cannot write Motif receiver info property");
}
}
} finally {
}
} else {
}
}
/*
* Gets and stores in the registry the embedder's Motif DnD drop site info
* from the embedded.
*/
assert XToolkit.isAWTLockHeldByCurrentThread();
boolean overriden = false;
int version = 0;
long proxy = 0;
int status = 0;
0, 0xFFFF, false,
try {
/*
* DragICCI.h:
*
* typedef struct _xmDragReceiverInfoStruct{
* BYTE byte_order;
* BYTE protocol_version;
* BYTE drag_protocol_style;
* BYTE pad1;
* CARD32 proxy_window B32;
* CARD16 num_drop_sites B16;
* CARD16 pad2 B16;
* CARD32 heap_offset B32;
* } xmDragReceiverInfoStruct;
*/
wpg.getNumberOfItems() >=
overriden = true;
{
}
}
}
} finally {
}
}
0, 0xFFFF, false,
try {
wpg.getNumberOfItems() >=
return true;
} else {
return false;
}
} finally {
}
}
assert XToolkit.isAWTLockHeldByCurrentThread();
return false;
}
return false;
}
long source_win = 0;
long source_win_mask = 0;
int protocol_version = 0;
long property_atom = 0;
{
}
/* Extract the available data types. */
{
0, 0xFFFF,
false,
try {
wpg.getActualType() ==
wpg.getNumberOfItems() ==
if (protocol_version !=
return false;
}
int index =
} else {
formats = new long[0];
}
} finally {
}
}
/*
* Select for StructureNotifyMask to receive DestroyNotify in case of source
* crash.
*/
try {
if ((status == 0) ||
throw new XException("XGetWindowAttributes failed");
}
} finally {
}
throw new XException("XSelectInput failed");
}
/*
* TOP_LEVEL_ENTER doesn't communicate the list of supported actions
* They are provided in DRAG_MOTION.
*/
return true;
}
int x = 0;
int y = 0;
/* Append source window id to the event data, so that we can send the
response properly. */
{
int win = (int)sourceWindow;
}
}
{
if (xbasewindow instanceof XWindow) {
}
}
/* OPERATION_CHANGED event doesn't provide coordinates, so we use
previously stored position and component ref. */
x = sourceX;
y = sourceY;
}
} else {
long receiver =
xclient.get_window(), x, y);
if (receiver != 0) {
if (xbasewindow instanceof XWindow) {
}
}
}
x = p.x;
y = p.y;
}
}
if (targetXWindow != null) {
}
} else {
int java_event_id = 0;
if (targetXWindow == null) {
} else {
}
}
sourceX = x;
sourceY = y;
return true;
}
assert XToolkit.isAWTLockHeldByCurrentThread();
/* Ignore Motif DnD messages from all other windows. */
if (source_win != sourceWindow) {
return false;
}
/*
* Postpone upcall to java, so that we can abort it in case
* if drop immediatelly follows (see BugTraq ID 4395290).
* Send a dummy ClientMessage event to guarantee that a postponed java
* upcall will be processed.
*/
topLevelLeavePostponed = true;
{
long proxy;
/*
* If this is an embedded drop site, the event should go to the
* awt_root_window as this is a proxy for all embedded drop sites.
* Otherwise the event should go to the event->window, as we don't use
* proxies for normal drop sites.
*/
} else {
}
try {
} finally {
}
}
return true;
}
long source_win =
/* Ignore Motif DnD messages from all other windows. */
if (source_win != sourceWindow) {
return false;
}
long property_atom =
short flags =
{
if (xbasewindow instanceof XWindow) {
}
}
long receiver =
xclient.get_window(), x, y);
if (receiver != 0) {
if (xbasewindow instanceof XWindow) {
}
}
}
x = p.x;
y = p.y;
}
} else if (targetXWindow != null) {
}
return true;
}
if (xclient.get_message_type() !=
return UNKNOWN_MESSAGE;
}
switch (reason) {
case MotifDnDConstants.TOP_LEVEL_ENTER :
return ENTER_MESSAGE;
case MotifDnDConstants.DRAG_MOTION :
return MOTION_MESSAGE;
case MotifDnDConstants.TOP_LEVEL_LEAVE :
return LEAVE_MESSAGE;
case MotifDnDConstants.DROP_START :
return DROP_MESSAGE;
default:
return UNKNOWN_MESSAGE;
}
}
if (xclient.get_message_type() !=
if (topLevelLeavePostponed) {
topLevelLeavePostponed = false;
cleanup();
}
return false;
}
if (topLevelLeavePostponed) {
topLevelLeavePostponed = false;
cleanup();
}
}
/* Only initiator messages should be handled. */
return false;
}
switch (reason) {
case MotifDnDConstants.TOP_LEVEL_ENTER :
return processTopLevelEnter(xclient);
case MotifDnDConstants.DRAG_MOTION :
return processDragMotion(xclient);
case MotifDnDConstants.TOP_LEVEL_LEAVE :
return processTopLevelLeave(xclient);
case MotifDnDConstants.DROP_START :
return processDropStart(xclient);
default:
return false;
}
}
/*
* protocol. See comments in XDropTargetProtocol.postProcessClientMessage.
*/
throw new Error("UNIMPLEMENTED");
}
throw new Error("UNIMPLEMENTED");
}
int eventID) {
// UNIMPLEMENTED.
return false;
}
public boolean isXEmbedSupported() {
return false;
}
if (xclient.get_message_type() !=
return false;
}
byte response_reason = (byte)0;
/* Only initiator messages should be handled. */
return false;
}
switch (reason) {
/* Receiver shouldn't rely to these messages. */
return false;
case MotifDnDConstants.DRAG_MOTION:
switch (eventID) {
case MouseEvent.MOUSE_ENTERED:
break;
case MouseEvent.MOUSE_DRAGGED:
break;
case MouseEvent.MOUSE_EXITED:
break;
}
break;
case MotifDnDConstants.DROP_START:
break;
default:
// Unknown reason. Shouldn't get here.
assert false;
}
try {
int response_flags = 0;
/* Clear action and drop site status bits. */
response_flags = flags &
/* Fill in new action and drop site status. */
} else {
response_flags = 0;
}
/* Write time stamp. */
/* Write coordinates. */
} else {
}
try {
msg.get_window(),
false, XConstants.NoEventMask,
} finally {
}
} finally {
}
return true;
}
throws IllegalArgumentException, IOException {
if (xclient.get_message_type() !=
throw new IllegalArgumentException();
}
throw new IOException("Cannot get data: corrupted context");
}
long selatom = 0;
switch (reason) {
case MotifDnDConstants.DRAG_MOTION :
break;
case MotifDnDConstants.DROP_START :
break;
default:
throw new IOException("Cannot get data: invalid message reason");
}
if (selatom == 0) {
throw new IOException("Cannot get data: drag source property atom unavailable");
}
// with correction of (32-bit unsigned to 64-bit signed) implicit conversion.
}
}
if (xclient.get_message_type() !=
return false;
}
return false;
}
return false;
}
// with correction of (32-bit unsigned to 64-bit signed) implicit conversion.
long status_atom = 0;
if (success) {
} else {
}
try {
/*
* Flush the buffer to guarantee that the drop completion event is sent
* to the source before the method returns.
*/
} finally {
}
/* Trick to prevent cleanup() from posting dragExit */
/* Cannot do cleanup before the drop finishes as we may need
source protocol version to send drop finished message. */
cleanup();
return true;
}
public final long getSourceWindow() {
return sourceWindow;
}
/**
* Reset the state of the object.
*/
public void cleanup() {
// Clear the reference to this protocol.
if (targetXWindow != null) {
}
if (sourceWindow != 0) {
try {
} finally {
}
}
sourceWindow = 0;
sourceWindowMask = 0;
sourceAtom = 0;
sourceX = 0;
sourceY = 0;
topLevelLeavePostponed = false;
}
public boolean isDragOverComponent() {
return targetXWindow != null;
}
int dropAction, int actions,
int eventID) {
long nativeCtxt = 0;
// Make a copy of the passed XClientMessageEvent structure, since
// the original structure can be freed before this
// SunDropTargetEvent is dispatched.
}
eventID);
}
}