equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright 2003-2005 Sun Microsystems, Inc. All Rights Reserved. |
2 * Copyright 2003-2008 Sun Microsystems, Inc. All Rights Reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Sun designates this |
7 * published by the Free Software Foundation. Sun designates this |
37 * Motif DnD protocol global constants and convenience routines. |
37 * Motif DnD protocol global constants and convenience routines. |
38 * |
38 * |
39 * @since 1.5 |
39 * @since 1.5 |
40 */ |
40 */ |
41 class MotifDnDConstants { |
41 class MotifDnDConstants { |
|
42 // utility class can not be instantiated |
|
43 private MotifDnDConstants() {} |
42 // Note that offsets in all native structures below do not depend on the |
44 // Note that offsets in all native structures below do not depend on the |
43 // architecture. |
45 // architecture. |
44 private static final Unsafe unsafe = XlibWrapper.unsafe; |
46 private static final Unsafe unsafe = XlibWrapper.unsafe; |
45 static final XAtom XA_MOTIF_ATOM_0 = XAtom.get("_MOTIF_ATOM_0"); |
47 static final XAtom XA_MOTIF_ATOM_0 = XAtom.get("_MOTIF_ATOM_0"); |
46 static final XAtom XA_MOTIF_DRAG_WINDOW = XAtom.get("_MOTIF_DRAG_WINDOW"); |
48 static final XAtom XA_MOTIF_DRAG_WINDOW = XAtom.get("_MOTIF_DRAG_WINDOW"); |
53 XAtom.get("_MOTIF_DRAG_AND_DROP_MESSAGE"); |
55 XAtom.get("_MOTIF_DRAG_AND_DROP_MESSAGE"); |
54 static final XAtom XA_XmTRANSFER_SUCCESS = |
56 static final XAtom XA_XmTRANSFER_SUCCESS = |
55 XAtom.get("XmTRANSFER_SUCCESS"); |
57 XAtom.get("XmTRANSFER_SUCCESS"); |
56 static final XAtom XA_XmTRANSFER_FAILURE = |
58 static final XAtom XA_XmTRANSFER_FAILURE = |
57 XAtom.get("XmTRANSFER_FAILURE"); |
59 XAtom.get("XmTRANSFER_FAILURE"); |
58 static final XSelection MotifDnDSelection = |
60 static final XSelection MotifDnDSelection = new XSelection(XA_MOTIF_ATOM_0); |
59 new XSelection(XA_MOTIF_ATOM_0, null); |
|
60 |
61 |
61 public static final byte MOTIF_DND_PROTOCOL_VERSION = 0; |
62 public static final byte MOTIF_DND_PROTOCOL_VERSION = 0; |
62 |
63 |
63 /* Supported protocol styles */ |
64 /* Supported protocol styles */ |
64 public static final int MOTIF_PREFER_PREREGISTER_STYLE = 2; |
65 public static final int MOTIF_PREFER_PREREGISTER_STYLE = 2; |
229 } |
230 } |
230 return motifWindow; |
231 return motifWindow; |
231 } |
232 } |
232 |
233 |
233 public static final class Swapper { |
234 public static final class Swapper { |
|
235 // utility class can not be instantiated |
|
236 private Swapper() {} |
|
237 |
234 public static short swap(short s) { |
238 public static short swap(short s) { |
235 return (short)(((s & 0xFF00) >>> 8) | ((s & 0xFF) << 8)); |
239 return (short)(((s & 0xFF00) >>> 8) | ((s & 0xFF) << 8)); |
236 } |
240 } |
237 public static int swap(int i) { |
241 public static int swap(int i) { |
238 return ((i & 0xFF000000) >>> 24) | ((i & 0x00FF0000) >>> 8) | |
242 return ((i & 0xFF000000) >>> 24) | ((i & 0x00FF0000) >>> 8) | |