< prev index next >

src/java.desktop/unix/classes/sun/awt/X11/MotifDnDDragSourceProtocol.java

Print this page




  79             MotifDnDConstants.writeDragInitiatorInfoStruct(window, index);
  80         } catch (XException xe) {
  81             cleanup();
  82             throw xe;
  83         } catch (InvalidDnDOperationException idoe) {
  84             cleanup();
  85             throw idoe;
  86         }
  87 
  88         if (!MotifDnDConstants.MotifDnDSelection.setOwner(contents, formatMap,
  89                                                           formats,
  90                                                           XConstants.CurrentTime)) {
  91             cleanup();
  92             throw new InvalidDnDOperationException("Cannot acquire selection ownership");
  93         }
  94     }
  95 
  96     /**
  97      * Processes the specified client message event.
  98      *
  99      * @returns true if the event was successfully processed.
 100      */
 101     public boolean processClientMessage(XClientMessageEvent xclient) {
 102         if (xclient.get_message_type() !=
 103             MotifDnDConstants.XA_MOTIF_DRAG_AND_DROP_MESSAGE.getAtom()) {
 104             return false;
 105         }
 106 
 107         long data = xclient.get_data();
 108         byte reason = (byte)(unsafe.getByte(data) &
 109             MotifDnDConstants.MOTIF_MESSAGE_REASON_MASK);
 110         byte origin = (byte)(unsafe.getByte(data) &
 111             MotifDnDConstants.MOTIF_MESSAGE_SENDER_MASK);
 112         byte byteOrder = unsafe.getByte(data + 1);
 113         boolean swapNeeded = byteOrder != MotifDnDConstants.getByteOrderByte();
 114         int action = DnDConstants.ACTION_NONE;
 115         int x = 0;
 116         int y = 0;
 117 
 118         /* Only receiver messages should be handled. */
 119         if (origin != MotifDnDConstants.MOTIF_MESSAGE_FROM_RECEIVER) {




  79             MotifDnDConstants.writeDragInitiatorInfoStruct(window, index);
  80         } catch (XException xe) {
  81             cleanup();
  82             throw xe;
  83         } catch (InvalidDnDOperationException idoe) {
  84             cleanup();
  85             throw idoe;
  86         }
  87 
  88         if (!MotifDnDConstants.MotifDnDSelection.setOwner(contents, formatMap,
  89                                                           formats,
  90                                                           XConstants.CurrentTime)) {
  91             cleanup();
  92             throw new InvalidDnDOperationException("Cannot acquire selection ownership");
  93         }
  94     }
  95 
  96     /**
  97      * Processes the specified client message event.
  98      *
  99      * @return true if the event was successfully processed.
 100      */
 101     public boolean processClientMessage(XClientMessageEvent xclient) {
 102         if (xclient.get_message_type() !=
 103             MotifDnDConstants.XA_MOTIF_DRAG_AND_DROP_MESSAGE.getAtom()) {
 104             return false;
 105         }
 106 
 107         long data = xclient.get_data();
 108         byte reason = (byte)(unsafe.getByte(data) &
 109             MotifDnDConstants.MOTIF_MESSAGE_REASON_MASK);
 110         byte origin = (byte)(unsafe.getByte(data) &
 111             MotifDnDConstants.MOTIF_MESSAGE_SENDER_MASK);
 112         byte byteOrder = unsafe.getByte(data + 1);
 113         boolean swapNeeded = byteOrder != MotifDnDConstants.getByteOrderByte();
 114         int action = DnDConstants.ACTION_NONE;
 115         int x = 0;
 116         int y = 0;
 117 
 118         /* Only receiver messages should be handled. */
 119         if (origin != MotifDnDConstants.MOTIF_MESSAGE_FROM_RECEIVER) {


< prev index next >