6623459: Get rid of XConstant, XProtocolConstants and XUtilConstants antipattern
Summary: Access to interface's fiels via their name rather then implementation
Reviewed-by: volk, son
--- a/jdk/src/solaris/classes/sun/awt/X11/MWMConstants.java Mon Apr 07 14:53:51 2008 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/MWMConstants.java Mon Apr 07 16:52:51 2008 +0400
@@ -1,5 +1,5 @@
/*
- * Copyright 2003 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2003-2008 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,9 @@
package sun.awt.X11;
-public interface MWMConstants {
+final public class MWMConstants {
+
+ private MWMConstants(){}
/* bit definitions for MwmHints.flags */
static final int MWM_HINTS_FUNCTIONS= (1 << 0);
--- a/jdk/src/solaris/classes/sun/awt/X11/MotifDnDConstants.java Mon Apr 07 14:53:51 2008 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/MotifDnDConstants.java Mon Apr 07 16:52:51 2008 +0400
@@ -118,11 +118,11 @@
XA_MOTIF_DRAG_WINDOW,
0, 1,
false,
- XlibWrapper.AnyPropertyType);
+ XConstants.AnyPropertyType);
try {
int status = wpg.execute(XToolkit.IgnoreBadWindowHandler);
- if (status == XlibWrapper.Success &&
+ if (status == XConstants.Success &&
wpg.getData() != 0 &&
wpg.getActualType() == XAtom.XA_WINDOW &&
wpg.getActualFormat() == 32 &&
@@ -163,20 +163,20 @@
XlibWrapper.XGrabServer(newDisplay);
try {
- XlibWrapper.XSetCloseDownMode(newDisplay, (int)XlibWrapper.RetainPermanent);
+ XlibWrapper.XSetCloseDownMode(newDisplay, (int)XConstants.RetainPermanent);
XSetWindowAttributes xwa = new XSetWindowAttributes();
try {
xwa.set_override_redirect(true);
- xwa.set_event_mask(XlibWrapper.PropertyChangeMask);
+ xwa.set_event_mask(XConstants.PropertyChangeMask);
motifWindow = XlibWrapper.XCreateWindow(newDisplay, defaultRootWindow,
-10, -10, 1, 1, 0, 0,
- XlibWrapper.InputOnly,
- XlibWrapper.CopyFromParent,
- (XlibWrapper.CWOverrideRedirect |
- XlibWrapper.CWEventMask),
+ XConstants.InputOnly,
+ XConstants.CopyFromParent,
+ (XConstants.CWOverrideRedirect |
+ XConstants.CWEventMask),
xwa.pData);
if (motifWindow == 0) {
@@ -195,13 +195,13 @@
defaultRootWindow,
XA_MOTIF_DRAG_WINDOW.getAtom(),
XAtom.XA_WINDOW, 32,
- XlibWrapper.PropModeReplace,
+ XConstants.PropModeReplace,
data, 1);
XToolkit.RESTORE_XERROR_HANDLER();
if (XToolkit.saved_error != null &&
- XToolkit.saved_error.get_error_code() != XlibWrapper.Success) {
+ XToolkit.saved_error.get_error_code() != XConstants.Success) {
throw new XException("Cannot write motif drag window handle.");
}
@@ -282,7 +282,7 @@
try {
int status = wpg.execute(XToolkit.IgnoreBadWindowHandler);
- if (status != XlibWrapper.Success
+ if (status != XConstants.Success
|| wpg.getActualType() != XA_MOTIF_DRAG_TARGETS.getAtom()
|| wpg.getData() == 0) {
@@ -399,13 +399,13 @@
motifWindow,
XA_MOTIF_DRAG_TARGETS.getAtom(),
XA_MOTIF_DRAG_TARGETS.getAtom(), 8,
- XlibWrapper.PropModeReplace,
+ XConstants.PropModeReplace,
data, tableSize);
XToolkit.RESTORE_XERROR_HANDLER();
if (XToolkit.saved_error != null &&
- XToolkit.saved_error.get_error_code() != XlibWrapper.Success) {
+ XToolkit.saved_error.get_error_code() != XConstants.Success) {
// Create a new motif window and retry.
motifWindow = createMotifWindow();
@@ -415,13 +415,13 @@
motifWindow,
XA_MOTIF_DRAG_TARGETS.getAtom(),
XA_MOTIF_DRAG_TARGETS.getAtom(), 8,
- XlibWrapper.PropModeReplace,
+ XConstants.PropModeReplace,
data, tableSize);
XToolkit.RESTORE_XERROR_HANDLER();
if (XToolkit.saved_error != null &&
- XToolkit.saved_error.get_error_code() != XlibWrapper.Success) {
+ XToolkit.saved_error.get_error_code() != XConstants.Success) {
throw new XException("Cannot write motif drag targets property.");
}
}
@@ -538,12 +538,12 @@
XlibWrapper.XChangeProperty(XToolkit.getDisplay(), window,
XA_MOTIF_ATOM_0.getAtom(),
XA_MOTIF_DRAG_INITIATOR_INFO.getAtom(),
- 8, XlibWrapper.PropModeReplace,
+ 8, XConstants.PropModeReplace,
structData, MOTIF_INITIATOR_INFO_SIZE);
XToolkit.RESTORE_XERROR_HANDLER();
if (XToolkit.saved_error != null &&
- XToolkit.saved_error.get_error_code() != XlibWrapper.Success) {
+ XToolkit.saved_error.get_error_code() != XConstants.Success) {
throw new XException("Cannot write drag initiator info");
}
} finally {
@@ -571,12 +571,12 @@
XlibWrapper.XChangeProperty(XToolkit.getDisplay(), window,
XA_MOTIF_DRAG_RECEIVER_INFO.getAtom(),
XA_MOTIF_DRAG_RECEIVER_INFO.getAtom(),
- 8, XlibWrapper.PropModeReplace,
+ 8, XConstants.PropModeReplace,
data, dataSize);
XToolkit.RESTORE_XERROR_HANDLER();
if (XToolkit.saved_error != null &&
- XToolkit.saved_error.get_error_code() != XlibWrapper.Success) {
+ XToolkit.saved_error.get_error_code() != XConstants.Success) {
throw new XException("Cannot write Motif receiver info property");
}
} finally {
--- a/jdk/src/solaris/classes/sun/awt/X11/MotifDnDDragSourceProtocol.java Mon Apr 07 14:53:51 2008 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/MotifDnDDragSourceProtocol.java Mon Apr 07 16:52:51 2008 +0400
@@ -1,5 +1,5 @@
/*
- * Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2003-2008 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -44,7 +44,7 @@
private static final Unsafe unsafe = XlibWrapper.unsafe;
- private long targetEnterServerTime = XlibWrapper.CurrentTime;
+ private long targetEnterServerTime = XConstants.CurrentTime;
protected MotifDnDDragSourceProtocol(XDragSourceProtocolListener listener) {
super(listener);
@@ -86,7 +86,7 @@
if (!MotifDnDConstants.MotifDnDSelection.setOwner(contents, formatMap,
formats,
- XlibWrapper.CurrentTime)) {
+ XConstants.CurrentTime)) {
cleanup();
throw new InvalidDnDOperationException("Cannot acquire selection ownership");
}
@@ -137,7 +137,7 @@
long time = t;
/* Discard events from the previous receiver. */
- if (targetEnterServerTime == XlibWrapper.CurrentTime ||
+ if (targetEnterServerTime == XConstants.CurrentTime ||
time < targetEnterServerTime) {
return true;
}
@@ -181,7 +181,7 @@
new WindowPropertyGetter(window,
MotifDnDConstants.XA_MOTIF_DRAG_RECEIVER_INFO,
0, 0xFFFF, false,
- XlibWrapper.AnyPropertyType);
+ XConstants.AnyPropertyType);
try {
int status = wpg.execute(XToolkit.IgnoreBadWindowHandler);
@@ -200,7 +200,7 @@
* CARD32 heap_offset B32;
* } xmDragReceiverInfoStruct;
*/
- if (status == (int)XlibWrapper.Success && wpg.getData() != 0 &&
+ if (status == (int)XConstants.Success && wpg.getData() != 0 &&
wpg.getActualType() != 0 && wpg.getActualFormat() == 8 &&
wpg.getNumberOfItems() >=
MotifDnDConstants.MOTIF_RECEIVER_INFO_SIZE) {
@@ -243,7 +243,7 @@
XClientMessageEvent msg = new XClientMessageEvent();
try {
- msg.set_type(XlibWrapper.ClientMessage);
+ msg.set_type(XConstants.ClientMessage);
msg.set_window(getTargetWindow());
msg.set_format(8);
msg.set_message_type(MotifDnDConstants.XA_MOTIF_DRAG_AND_DROP_MESSAGE.getAtom());
@@ -267,7 +267,7 @@
XlibWrapper.XSendEvent(XToolkit.getDisplay(),
getTargetProxyWindow(),
- false, XlibWrapper.NoEventMask,
+ false, XConstants.NoEventMask,
msg.pData);
} finally {
msg.dispose();
@@ -281,7 +281,7 @@
XClientMessageEvent msg = new XClientMessageEvent();
try {
- msg.set_type(XlibWrapper.ClientMessage);
+ msg.set_type(XConstants.ClientMessage);
msg.set_window(getTargetWindow());
msg.set_format(8);
msg.set_message_type(MotifDnDConstants.XA_MOTIF_DRAG_AND_DROP_MESSAGE.getAtom());
@@ -305,7 +305,7 @@
XlibWrapper.XSendEvent(XToolkit.getDisplay(),
getTargetProxyWindow(),
- false, XlibWrapper.NoEventMask,
+ false, XConstants.NoEventMask,
msg.pData);
} finally {
msg.dispose();
@@ -318,7 +318,7 @@
XClientMessageEvent msg = new XClientMessageEvent();
try {
- msg.set_type(XlibWrapper.ClientMessage);
+ msg.set_type(XConstants.ClientMessage);
msg.set_window(getTargetWindow());
msg.set_format(8);
msg.set_message_type(MotifDnDConstants.XA_MOTIF_DRAG_AND_DROP_MESSAGE.getAtom());
@@ -336,7 +336,7 @@
XlibWrapper.XSendEvent(XToolkit.getDisplay(),
getTargetProxyWindow(),
- false, XlibWrapper.NoEventMask,
+ false, XConstants.NoEventMask,
msg.pData);
} finally {
msg.dispose();
@@ -356,7 +356,7 @@
XClientMessageEvent msg = new XClientMessageEvent();
try {
- msg.set_type(XlibWrapper.ClientMessage);
+ msg.set_type(XConstants.ClientMessage);
msg.set_window(getTargetWindow());
msg.set_format(8);
msg.set_message_type(MotifDnDConstants.XA_MOTIF_DRAG_AND_DROP_MESSAGE.getAtom());
@@ -382,7 +382,7 @@
XlibWrapper.XSendEvent(XToolkit.getDisplay(),
getTargetProxyWindow(),
- false, XlibWrapper.NoEventMask,
+ false, XConstants.NoEventMask,
msg.pData);
} finally {
msg.dispose();
@@ -397,12 +397,12 @@
public void cleanupTargetInfo() {
super.cleanupTargetInfo();
- targetEnterServerTime = XlibWrapper.CurrentTime;
+ targetEnterServerTime = XConstants.CurrentTime;
}
public void dispatchEvent(XEvent ev) {
switch (ev.get_type()) {
- case XlibWrapper.SelectionRequest:
+ case XConstants.SelectionRequest:
XSelectionRequestEvent xsre = ev.get_xselectionrequest();
long atom = xsre.get_selection();
--- a/jdk/src/solaris/classes/sun/awt/X11/MotifDnDDropTargetProtocol.java Mon Apr 07 14:53:51 2008 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/MotifDnDDropTargetProtocol.java Mon Apr 07 16:52:51 2008 +0400
@@ -99,7 +99,7 @@
new WindowPropertyGetter(embedder,
MotifDnDConstants.XA_MOTIF_DRAG_RECEIVER_INFO,
0, 0xFFFF, false,
- XlibWrapper.AnyPropertyType);
+ XConstants.AnyPropertyType);
try {
status = wpg.execute(XToolkit.IgnoreBadWindowHandler);
@@ -118,7 +118,7 @@
* CARD32 heap_offset B32;
* } xmDragReceiverInfoStruct;
*/
- if (status == (int)XlibWrapper.Success && wpg.getData() != 0 &&
+ if (status == (int)XConstants.Success && wpg.getData() != 0 &&
wpg.getActualType() != 0 && wpg.getActualFormat() == 8 &&
wpg.getNumberOfItems() >=
MotifDnDConstants.MOTIF_RECEIVER_INFO_SIZE) {
@@ -166,12 +166,12 @@
XlibWrapper.XChangeProperty(XToolkit.getDisplay(), embedder,
MotifDnDConstants.XA_MOTIF_DRAG_RECEIVER_INFO.getAtom(),
MotifDnDConstants.XA_MOTIF_DRAG_RECEIVER_INFO.getAtom(),
- 8, XlibWrapper.PropModeReplace,
+ 8, XConstants.PropModeReplace,
data, dataSize);
XToolkit.RESTORE_XERROR_HANDLER();
if (XToolkit.saved_error != null &&
- XToolkit.saved_error.get_error_code() != XlibWrapper.Success) {
+ XToolkit.saved_error.get_error_code() != XConstants.Success) {
throw new XException("Cannot write Motif receiver info property");
}
} finally {
@@ -201,7 +201,7 @@
new WindowPropertyGetter(embedder,
MotifDnDConstants.XA_MOTIF_DRAG_RECEIVER_INFO,
0, 0xFFFF, false,
- XlibWrapper.AnyPropertyType);
+ XConstants.AnyPropertyType);
try {
status = wpg.execute(XToolkit.IgnoreBadWindowHandler);
@@ -220,7 +220,7 @@
* CARD32 heap_offset B32;
* } xmDragReceiverInfoStruct;
*/
- if (status == (int)XlibWrapper.Success && wpg.getData() != 0 &&
+ if (status == (int)XConstants.Success && wpg.getData() != 0 &&
wpg.getActualType() != 0 && wpg.getActualFormat() == 8 &&
wpg.getNumberOfItems() >=
MotifDnDConstants.MOTIF_RECEIVER_INFO_SIZE) {
@@ -240,12 +240,12 @@
XlibWrapper.XChangeProperty(XToolkit.getDisplay(), embedder,
MotifDnDConstants.XA_MOTIF_DRAG_RECEIVER_INFO.getAtom(),
MotifDnDConstants.XA_MOTIF_DRAG_RECEIVER_INFO.getAtom(),
- 8, XlibWrapper.PropModeReplace,
+ 8, XConstants.PropModeReplace,
data, dataSize);
XToolkit.RESTORE_XERROR_HANDLER();
if (XToolkit.saved_error != null &&
- XToolkit.saved_error.get_error_code() != XlibWrapper.Success) {
+ XToolkit.saved_error.get_error_code() != XConstants.Success) {
throw new XException("Cannot write Motif receiver info property");
}
}
@@ -273,7 +273,7 @@
new WindowPropertyGetter(embedded,
MotifDnDConstants.XA_MOTIF_DRAG_RECEIVER_INFO,
0, 0xFFFF, false,
- XlibWrapper.AnyPropertyType);
+ XConstants.AnyPropertyType);
try {
status = wpg.execute(XToolkit.IgnoreBadWindowHandler);
@@ -292,7 +292,7 @@
* CARD32 heap_offset B32;
* } xmDragReceiverInfoStruct;
*/
- if (status == (int)XlibWrapper.Success && wpg.getData() != 0 &&
+ if (status == (int)XConstants.Success && wpg.getData() != 0 &&
wpg.getActualType() != 0 && wpg.getActualFormat() == 8 &&
wpg.getNumberOfItems() >=
MotifDnDConstants.MOTIF_RECEIVER_INFO_SIZE) {
@@ -322,12 +322,12 @@
new WindowPropertyGetter(window,
MotifDnDConstants.XA_MOTIF_DRAG_RECEIVER_INFO,
0, 0xFFFF, false,
- XlibWrapper.AnyPropertyType);
+ XConstants.AnyPropertyType);
try {
int status = wpg.execute(XToolkit.IgnoreBadWindowHandler);
- if (status == (int)XlibWrapper.Success && wpg.getData() != 0 &&
+ if (status == (int)XConstants.Success && wpg.getData() != 0 &&
wpg.getActualType() != 0 && wpg.getActualFormat() == 8 &&
wpg.getNumberOfItems() >=
MotifDnDConstants.MOTIF_RECEIVER_INFO_SIZE) {
@@ -377,7 +377,7 @@
try {
int status = wpg.execute(XToolkit.IgnoreBadWindowHandler);
- if (status == XlibWrapper.Success && wpg.getData() != 0 &&
+ if (status == XConstants.Success && wpg.getData() != 0 &&
wpg.getActualType() ==
MotifDnDConstants.XA_MOTIF_DRAG_INITIATOR_INFO.getAtom() &&
wpg.getActualFormat() == 8 &&
@@ -420,7 +420,7 @@
if (status == 0 ||
(XToolkit.saved_error != null &&
- XToolkit.saved_error.get_error_code() != XlibWrapper.Success)) {
+ XToolkit.saved_error.get_error_code() != XConstants.Success)) {
throw new XException("XGetWindowAttributes failed");
}
@@ -432,12 +432,12 @@
XToolkit.WITH_XERROR_HANDLER(XToolkit.IgnoreBadWindowHandler);
XlibWrapper.XSelectInput(XToolkit.getDisplay(), source_win,
source_win_mask |
- XlibWrapper.StructureNotifyMask);
+ XConstants.StructureNotifyMask);
XToolkit.RESTORE_XERROR_HANDLER();
if (XToolkit.saved_error != null &&
- XToolkit.saved_error.get_error_code() != XlibWrapper.Success) {
+ XToolkit.saved_error.get_error_code() != XConstants.Success) {
throw new XException("XSelectInput failed");
}
@@ -590,7 +590,7 @@
XClientMessageEvent dummy = new XClientMessageEvent();
try {
- dummy.set_type(XlibWrapper.ClientMessage);
+ dummy.set_type(XConstants.ClientMessage);
dummy.set_window(xclient.get_window());
dummy.set_format(32);
dummy.set_message_type(0);
@@ -600,7 +600,7 @@
dummy.set_data(3, 0);
dummy.set_data(4, 0);
XlibWrapper.XSendEvent(XToolkit.getDisplay(),
- proxy, false, XlibWrapper.NoEventMask,
+ proxy, false, XConstants.NoEventMask,
dummy.pData);
} finally {
dummy.dispose();
@@ -821,7 +821,7 @@
XClientMessageEvent msg = new XClientMessageEvent();
try {
- msg.set_type(XlibWrapper.ClientMessage);
+ msg.set_type(XConstants.ClientMessage);
msg.set_window(MotifDnDConstants.Swapper.getInt(data + 12, eventByteOrder));
msg.set_format(8);
msg.set_message_type(MotifDnDConstants.XA_MOTIF_DRAG_AND_DROP_MESSAGE.getAtom());
@@ -878,7 +878,7 @@
try {
XlibWrapper.XSendEvent(XToolkit.getDisplay(),
msg.get_window(),
- false, XlibWrapper.NoEventMask,
+ false, XConstants.NoEventMask,
msg.pData);
} finally {
XToolkit.awtUnlock();
--- a/jdk/src/solaris/classes/sun/awt/X11/WindowPropertyGetter.java Mon Apr 07 14:53:51 2008 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/WindowPropertyGetter.java Mon Apr 07 16:52:51 2008 +0400
@@ -1,5 +1,5 @@
/*
- * Copyright 2003-2005 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2003-2008 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -89,7 +89,7 @@
if (isCachingSupported() && isCached()) {
readFromCache();
- return XlibWrapper.Success;
+ return XConstants.Success;
}
// Fix for performance problem - IgnodeBadWindowHandler is
@@ -106,7 +106,7 @@
offset, length, (auto_delete?1:0), type,
actual_type, actual_format, nitems_ptr,
bytes_after, data);
- if (isCachingSupported() && status == XlibWrapper.Success && getData() != 0 && isCacheableProperty(property)) {
+ if (isCachingSupported() && status == XConstants.Success && getData() != 0 && isCacheableProperty(property)) {
// Property has some data, we cache them
cacheProperty();
}
--- a/jdk/src/solaris/classes/sun/awt/X11/XAWTXSettings.java Mon Apr 07 14:53:51 2008 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XAWTXSettings.java Mon Apr 07 16:52:51 2008 +0400
@@ -1,5 +1,5 @@
/*
- * Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2003-2008 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -128,7 +128,7 @@
try {
int status = getter.execute(XToolkit.IgnoreBadWindowHandler);
- if (status != XlibWrapper.Success || getter.getData() == 0) {
+ if (status != XConstants.Success || getter.getData() == 0) {
if (log.isLoggable(Level.FINE)) log.fine("OH OH : getter failed status = " + status );
settings = null;
}
--- a/jdk/src/solaris/classes/sun/awt/X11/XAtom.java Mon Apr 07 14:53:51 2008 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XAtom.java Mon Apr 07 16:52:51 2008 +0400
@@ -370,7 +370,7 @@
false, property_type);
try {
int status = getter.execute();
- if (status != XlibWrapper.Success || getter.getData() == 0) {
+ if (status != XConstants.Success || getter.getData() == 0) {
return 0;
}
if (getter.getActualType() != property_type || getter.getActualFormat() != 32) {
@@ -401,7 +401,7 @@
try {
Native.putCard32(XlibWrapper.larg1, value);
XlibWrapper.XChangeProperty(XToolkit.getDisplay(), window,
- atom, XA_CARDINAL, 32, XlibWrapper.PropModeReplace,
+ atom, XA_CARDINAL, 32, XConstants.PropModeReplace,
XlibWrapper.larg1, 1);
} finally {
XToolkit.awtUnlock();
@@ -432,7 +432,7 @@
false, this);
try {
int status = getter.execute();
- if (status != XlibWrapper.Success || getter.getData() == 0) {
+ if (status != XConstants.Success || getter.getData() == 0) {
return false;
}
if (getter.getActualType() != atom
@@ -466,7 +466,7 @@
false, type);
try {
int status = getter.execute();
- if (status != XlibWrapper.Success || getter.getData() == 0) {
+ if (status != XConstants.Success || getter.getData() == 0) {
return false;
}
if (getter.getActualType() != type
@@ -497,7 +497,7 @@
XToolkit.awtLock();
try {
XlibWrapper.XChangeProperty(XToolkit.getDisplay(), window,
- atom, atom, 32, XlibWrapper.PropModeReplace,
+ atom, atom, 32, XConstants.PropModeReplace,
data_ptr, length);
} finally {
XToolkit.awtUnlock();
@@ -518,7 +518,7 @@
XToolkit.awtLock();
try {
XlibWrapper.XChangeProperty(XToolkit.getDisplay(), window,
- atom, type, 32, XlibWrapper.PropModeReplace,
+ atom, type, 32, XConstants.PropModeReplace,
data_ptr, length);
} finally {
XToolkit.awtUnlock();
@@ -539,7 +539,7 @@
XToolkit.awtLock();
try {
XlibWrapper.XChangeProperty(XToolkit.getDisplay(), window,
- atom, type, 8, XlibWrapper.PropModeReplace,
+ atom, type, 8, XConstants.PropModeReplace,
data_ptr, length);
} finally {
XToolkit.awtUnlock();
@@ -602,7 +602,7 @@
false, property_type);
try {
int status = getter.execute();
- if (status != XlibWrapper.Success || getter.getData() == 0) {
+ if (status != XConstants.Success || getter.getData() == 0) {
return null;
}
if (getter.getActualType() != property_type || getter.getActualFormat() != 8) {
@@ -674,7 +674,7 @@
false, XA_ATOM);
try {
int status = getter.execute();
- if (status != XlibWrapper.Success || getter.getData() == 0) {
+ if (status != XConstants.Success || getter.getData() == 0) {
return emptyList;
}
if (getter.getActualType() != XA_ATOM || getter.getActualFormat() != 32) {
@@ -797,7 +797,7 @@
try {
Native.putWindow(XlibWrapper.larg1, window_value);
XlibWrapper.XChangeProperty(XToolkit.getDisplay(), window,
- atom, XA_WINDOW, 32, XlibWrapper.PropModeReplace,
+ atom, XA_WINDOW, 32, XConstants.PropModeReplace,
XlibWrapper.larg1, 1);
} finally {
XToolkit.awtUnlock();
@@ -821,7 +821,7 @@
false, XA_WINDOW);
try {
int status = getter.execute();
- if (status != XlibWrapper.Success || getter.getData() == 0) {
+ if (status != XConstants.Success || getter.getData() == 0) {
return 0;
}
if (getter.getActualType() != XA_WINDOW || getter.getActualFormat() != 32) {
--- a/jdk/src/solaris/classes/sun/awt/X11/XBaseMenuWindow.java Mon Apr 07 14:53:51 2008 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XBaseMenuWindow.java Mon Apr 07 16:52:51 2008 +0400
@@ -1,5 +1,5 @@
/*
- * Copyright 2005-2007 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2008 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -885,14 +885,14 @@
*/
protected boolean isEventDisabled(XEvent e) {
switch (e.get_type()) {
- case XlibWrapper.Expose :
- case XlibWrapper.GraphicsExpose :
- case XlibWrapper.ButtonPress:
- case XlibWrapper.ButtonRelease:
- case XlibWrapper.MotionNotify:
- case XlibWrapper.KeyPress:
- case XlibWrapper.KeyRelease:
- case XlibWrapper.DestroyNotify:
+ case XConstants.Expose :
+ case XConstants.GraphicsExpose :
+ case XConstants.ButtonPress:
+ case XConstants.ButtonRelease:
+ case XConstants.MotionNotify:
+ case XConstants.KeyPress:
+ case XConstants.KeyRelease:
+ case XConstants.DestroyNotify:
return super.isEventDisabled(e);
default:
return true;
--- a/jdk/src/solaris/classes/sun/awt/X11/XBaseWindow.java Mon Apr 07 14:53:51 2008 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XBaseWindow.java Mon Apr 07 16:52:51 2008 +0400
@@ -1,5 +1,5 @@
/*
- * Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2003-2008 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -30,7 +30,7 @@
import java.util.logging.*;
import java.util.*;
-public class XBaseWindow implements XConstants, XUtilConstants {
+public class XBaseWindow {
private static final Logger log = Logger.getLogger("sun.awt.X11.XBaseWindow");
private static final Logger insLog = Logger.getLogger("sun.awt.X11.insets.XBaseWindow");
private static final Logger eventLog = Logger.getLogger("sun.awt.X11.event.XBaseWindow");
@@ -148,7 +148,7 @@
Long eventMask = (Long)params.get(EVENT_MASK);
if (eventMask != null) {
long mask = eventMask.longValue();
- mask |= SubstructureNotifyMask;
+ mask |= XConstants.SubstructureNotifyMask;
params.put(EVENT_MASK, mask);
}
@@ -281,10 +281,10 @@
}
params.putIfNull(PARENT_WINDOW, Long.valueOf(XToolkit.getDefaultRootWindow()));
params.putIfNull(BOUNDS, new Rectangle(DEF_LOCATION, DEF_LOCATION, MIN_SIZE, MIN_SIZE));
- params.putIfNull(DEPTH, Integer.valueOf((int)XlibWrapper.CopyFromParent));
- params.putIfNull(VISUAL, Long.valueOf(XlibWrapper.CopyFromParent));
- params.putIfNull(VISUAL_CLASS, Integer.valueOf((int)XlibWrapper.InputOnly));
- params.putIfNull(VALUE_MASK, Long.valueOf(XlibWrapper.CWEventMask));
+ params.putIfNull(DEPTH, Integer.valueOf((int)XConstants.CopyFromParent));
+ params.putIfNull(VISUAL, Long.valueOf(XConstants.CopyFromParent));
+ params.putIfNull(VISUAL_CLASS, Integer.valueOf((int)XConstants.InputOnly));
+ params.putIfNull(VALUE_MASK, Long.valueOf(XConstants.CWEventMask));
Rectangle bounds = (Rectangle)params.get(BOUNDS);
bounds.width = Math.max(MIN_SIZE, bounds.width);
bounds.height = Math.max(MIN_SIZE, bounds.height);
@@ -293,7 +293,7 @@
long eventMask = eventMaskObj != null ? eventMaskObj.longValue() : 0;
// We use our own synthetic grab see XAwtState.getGrabWindow()
// (see X vol. 1, 8.3.3.2)
- eventMask |= PropertyChangeMask | OwnerGrabButtonMask;
+ eventMask |= XConstants.PropertyChangeMask | XConstants.OwnerGrabButtonMask;
params.put(EVENT_MASK, Long.valueOf(eventMask));
}
@@ -312,23 +312,23 @@
Long eventMask = (Long)params.get(EVENT_MASK);
xattr.set_event_mask(eventMask.longValue());
- value_mask |= XlibWrapper.CWEventMask;
+ value_mask |= XConstants.CWEventMask;
Long border_pixel = (Long)params.get(BORDER_PIXEL);
if (border_pixel != null) {
xattr.set_border_pixel(border_pixel.longValue());
- value_mask |= XlibWrapper.CWBorderPixel;
+ value_mask |= XConstants.CWBorderPixel;
}
Long colormap = (Long)params.get(COLORMAP);
if (colormap != null) {
xattr.set_colormap(colormap.longValue());
- value_mask |= XlibWrapper.CWColormap;
+ value_mask |= XConstants.CWColormap;
}
Long background_pixmap = (Long)params.get(BACKGROUND_PIXMAP);
if (background_pixmap != null) {
xattr.set_background_pixmap(background_pixmap.longValue());
- value_mask |= XlibWrapper.CWBackPixmap;
+ value_mask |= XConstants.CWBackPixmap;
}
Long parentWindow = (Long)params.get(PARENT_WINDOW);
@@ -339,25 +339,25 @@
Boolean overrideRedirect = (Boolean)params.get(OVERRIDE_REDIRECT);
if (overrideRedirect != null) {
xattr.set_override_redirect(overrideRedirect.booleanValue());
- value_mask |= XlibWrapper.CWOverrideRedirect;
+ value_mask |= XConstants.CWOverrideRedirect;
}
Boolean saveUnder = (Boolean)params.get(SAVE_UNDER);
if (saveUnder != null) {
xattr.set_save_under(saveUnder.booleanValue());
- value_mask |= XlibWrapper.CWSaveUnder;
+ value_mask |= XConstants.CWSaveUnder;
}
Integer backingStore = (Integer)params.get(BACKING_STORE);
if (backingStore != null) {
xattr.set_backing_store(backingStore.intValue());
- value_mask |= XlibWrapper.CWBackingStore;
+ value_mask |= XConstants.CWBackingStore;
}
Integer bitGravity = (Integer)params.get(BIT_GRAVITY);
if (bitGravity != null) {
xattr.set_bit_gravity(bitGravity.intValue());
- value_mask |= XlibWrapper.CWBitGravity;
+ value_mask |= XConstants.CWBitGravity;
}
if (log.isLoggable(Level.FINE)) {
@@ -487,25 +487,25 @@
// Note: if PPosition is not set in flags this means that
// we want to reset PPosition in hints. This is necessary
// for locationByPlatform functionality
- if ((flags & XlibWrapper.PPosition) != 0) {
+ if ((flags & XUtilConstants.PPosition) != 0) {
hints.set_x(x);
hints.set_y(y);
}
- if ((flags & XlibWrapper.PSize) != 0) {
+ if ((flags & XUtilConstants.PSize) != 0) {
hints.set_width(width);
hints.set_height(height);
- } else if ((hints.get_flags() & XlibWrapper.PSize) != 0) {
- flags |= XlibWrapper.PSize;
+ } else if ((hints.get_flags() & XUtilConstants.PSize) != 0) {
+ flags |= XUtilConstants.PSize;
}
- if ((flags & XlibWrapper.PMinSize) != 0) {
+ if ((flags & XUtilConstants.PMinSize) != 0) {
hints.set_min_width(width);
hints.set_min_height(height);
- } else if ((hints.get_flags() & XlibWrapper.PMinSize) != 0) {
- flags |= XlibWrapper.PMinSize;
+ } else if ((hints.get_flags() & XUtilConstants.PMinSize) != 0) {
+ flags |= XUtilConstants.PMinSize;
//Fix for 4320050: Minimum size for java.awt.Frame is not being enforced.
//We don't need to reset minimum size if it's already set
}
- if ((flags & XlibWrapper.PMaxSize) != 0) {
+ if ((flags & XUtilConstants.PMaxSize) != 0) {
if (maxBounds != null) {
if (maxBounds.width != Integer.MAX_VALUE) {
hints.set_max_width(maxBounds.width);
@@ -521,8 +521,8 @@
hints.set_max_width(width);
hints.set_max_height(height);
}
- } else if ((hints.get_flags() & XlibWrapper.PMaxSize) != 0) {
- flags |= XlibWrapper.PMaxSize;
+ } else if ((hints.get_flags() & XUtilConstants.PMaxSize) != 0) {
+ flags |= XUtilConstants.PMaxSize;
if (maxBounds != null) {
if (maxBounds.width != Integer.MAX_VALUE) {
hints.set_max_width(maxBounds.width);
@@ -538,9 +538,9 @@
// Leave intact
}
}
- flags |= XlibWrapper.PWinGravity;
+ flags |= XUtilConstants.PWinGravity;
hints.set_flags(flags);
- hints.set_win_gravity((int)XlibWrapper.NorthWestGravity);
+ hints.set_win_gravity((int)XConstants.NorthWestGravity);
if (insLog.isLoggable(Level.FINER)) insLog.finer("Setting hints, resulted flags " + XlibWrapper.hintsToString(flags) +
", values " + hints);
XlibWrapper.XSetWMNormalHints(XToolkit.getDisplay(), getWindow(), hints.pData);
@@ -552,7 +552,7 @@
public boolean isMinSizeSet() {
XSizeHints hints = getHints();
long flags = hints.get_flags();
- return ((flags & XlibWrapper.PMinSize) == XlibWrapper.PMinSize);
+ return ((flags & XUtilConstants.PMinSize) == XUtilConstants.PMinSize);
}
/**
@@ -837,29 +837,29 @@
//6273031: PIT. Choice drop down does not close once it is right clicked to show a popup menu
//remember previous window having grab and if it's not null ungrab it.
XBaseWindow prevGrabWindow = XAwtState.getGrabWindow();
- final int eventMask = (int) (ButtonPressMask | ButtonReleaseMask
- | EnterWindowMask | LeaveWindowMask | PointerMotionMask
- | ButtonMotionMask);
+ final int eventMask = (int) (XConstants.ButtonPressMask | XConstants.ButtonReleaseMask
+ | XConstants.EnterWindowMask | XConstants.LeaveWindowMask | XConstants.PointerMotionMask
+ | XConstants.ButtonMotionMask);
final int ownerEvents = 1;
int ptrGrab = XlibWrapper.XGrabPointer(XToolkit.getDisplay(),
- getContentWindow(), ownerEvents, eventMask, GrabModeAsync,
- GrabModeAsync, None, (XWM.isMotif() ? XToolkit.arrowCursor : None),
- CurrentTime);
+ getContentWindow(), ownerEvents, eventMask, XConstants.GrabModeAsync,
+ XConstants.GrabModeAsync, XConstants.None, (XWM.isMotif() ? XToolkit.arrowCursor : XConstants.None),
+ XConstants.CurrentTime);
// Check grab results to be consistent with X server grab
- if (ptrGrab != GrabSuccess) {
- XlibWrapper.XUngrabPointer(XToolkit.getDisplay(), CurrentTime);
+ if (ptrGrab != XConstants.GrabSuccess) {
+ XlibWrapper.XUngrabPointer(XToolkit.getDisplay(), XConstants.CurrentTime);
XAwtState.setGrabWindow(null);
grabLog.fine(" Grab Failure - mouse");
return false;
}
int keyGrab = XlibWrapper.XGrabKeyboard(XToolkit.getDisplay(),
- getContentWindow(), ownerEvents, GrabModeAsync, GrabModeAsync,
- CurrentTime);
- if (keyGrab != GrabSuccess) {
- XlibWrapper.XUngrabPointer(XToolkit.getDisplay(), CurrentTime);
- XlibWrapper.XUngrabKeyboard(XToolkit.getDisplay(), CurrentTime);
+ getContentWindow(), ownerEvents, XConstants.GrabModeAsync, XConstants.GrabModeAsync,
+ XConstants.CurrentTime);
+ if (keyGrab != XConstants.GrabSuccess) {
+ XlibWrapper.XUngrabPointer(XToolkit.getDisplay(), XConstants.CurrentTime);
+ XlibWrapper.XUngrabKeyboard(XToolkit.getDisplay(), XConstants.CurrentTime);
XAwtState.setGrabWindow(null);
grabLog.fine(" Grab Failure - keyboard");
return false;
@@ -882,8 +882,8 @@
grabLog.log(Level.FINE, "UnGrab input on {0}", new Object[] {grabWindow});
if (grabWindow != null) {
grabWindow.ungrabInputImpl();
- XlibWrapper.XUngrabPointer(XToolkit.getDisplay(), CurrentTime);
- XlibWrapper.XUngrabKeyboard(XToolkit.getDisplay(), CurrentTime);
+ XlibWrapper.XUngrabPointer(XToolkit.getDisplay(), XConstants.CurrentTime);
+ XlibWrapper.XUngrabKeyboard(XToolkit.getDisplay(), XConstants.CurrentTime);
XAwtState.setGrabWindow(null);
// we need to call XFlush() here to force ungrab
// see 6384219 for details
@@ -979,15 +979,15 @@
*/
public void handleButtonPressRelease(XEvent xev) {
XButtonEvent xbe = xev.get_xbutton();
- final int buttonState = xbe.get_state() & (Button1Mask | Button2Mask
- | Button3Mask | Button4Mask | Button5Mask);
+ final int buttonState = xbe.get_state() & (XConstants.Button1Mask | XConstants.Button2Mask
+ | XConstants.Button3Mask | XConstants.Button4Mask | XConstants.Button5Mask);
switch (xev.get_type()) {
- case ButtonPress:
+ case XConstants.ButtonPress:
if (buttonState == 0) {
XAwtState.setAutoGrabWindow(this);
}
break;
- case ButtonRelease:
+ case XConstants.ButtonRelease:
if (isFullRelease(buttonState, xbe.get_button())) {
XAwtState.setAutoGrabWindow(null);
}
@@ -1012,30 +1012,30 @@
*/
static boolean isFullRelease(int buttonState, int button) {
switch (button) {
- case Button1:
- return buttonState == Button1Mask;
- case Button2:
- return buttonState == Button2Mask;
- case Button3:
- return buttonState == Button3Mask;
- case Button4:
- return buttonState == Button4Mask;
- case Button5:
- return buttonState == Button5Mask;
+ case XConstants.Button1:
+ return buttonState == XConstants.Button1Mask;
+ case XConstants.Button2:
+ return buttonState == XConstants.Button2Mask;
+ case XConstants.Button3:
+ return buttonState == XConstants.Button3Mask;
+ case XConstants.Button4:
+ return buttonState == XConstants.Button4Mask;
+ case XConstants.Button5:
+ return buttonState == XConstants.Button5Mask;
}
return buttonState == 0;
}
static boolean isGrabbedEvent(XEvent ev, XBaseWindow target) {
switch (ev.get_type()) {
- case ButtonPress:
- case ButtonRelease:
- case MotionNotify:
- case KeyPress:
- case KeyRelease:
+ case XConstants.ButtonPress:
+ case XConstants.ButtonRelease:
+ case XConstants.MotionNotify:
+ case XConstants.KeyPress:
+ case XConstants.KeyRelease:
return true;
- case LeaveNotify:
- case EnterNotify:
+ case XConstants.LeaveNotify:
+ case XConstants.EnterNotify:
// We shouldn't dispatch this events to the grabbed components (see 6317481)
// But this logic is important if the grabbed component is top-level (see realSync)
return (target instanceof XWindowPeer);
@@ -1067,53 +1067,53 @@
switch (type)
{
- case VisibilityNotify:
+ case XConstants.VisibilityNotify:
handleVisibilityEvent(xev);
break;
- case ClientMessage:
+ case XConstants.ClientMessage:
handleClientMessage(xev);
break;
- case Expose :
- case GraphicsExpose :
+ case XConstants.Expose :
+ case XConstants.GraphicsExpose :
handleExposeEvent(xev);
break;
- case ButtonPress:
- case ButtonRelease:
+ case XConstants.ButtonPress:
+ case XConstants.ButtonRelease:
handleButtonPressRelease(xev);
break;
- case MotionNotify:
+ case XConstants.MotionNotify:
handleMotionNotify(xev);
break;
- case KeyPress:
+ case XConstants.KeyPress:
handleKeyPress(xev);
break;
- case KeyRelease:
+ case XConstants.KeyRelease:
handleKeyRelease(xev);
break;
- case EnterNotify:
- case LeaveNotify:
+ case XConstants.EnterNotify:
+ case XConstants.LeaveNotify:
handleXCrossingEvent(xev);
break;
- case ConfigureNotify:
+ case XConstants.ConfigureNotify:
handleConfigureNotifyEvent(xev);
break;
- case MapNotify:
+ case XConstants.MapNotify:
handleMapNotifyEvent(xev);
break;
- case UnmapNotify:
+ case XConstants.UnmapNotify:
handleUnmapNotifyEvent(xev);
break;
- case ReparentNotify:
+ case XConstants.ReparentNotify:
handleReparentNotifyEvent(xev);
break;
- case PropertyNotify:
+ case XConstants.PropertyNotify:
handlePropertyNotify(xev);
break;
- case DestroyNotify:
+ case XConstants.DestroyNotify:
handleDestroyNotify(xev);
break;
- case CreateNotify:
+ case XConstants.CreateNotify:
handleCreateNotify(xev);
break;
}
--- a/jdk/src/solaris/classes/sun/awt/X11/XClipboard.java Mon Apr 07 14:53:51 2008 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XClipboard.java Mon Apr 07 16:52:51 2008 +0400
@@ -185,7 +185,7 @@
private static class SelectionNotifyHandler implements XEventDispatcher {
public void dispatchEvent(XEvent ev) {
- if (ev.get_type() == XlibWrapper.SelectionNotify) {
+ if (ev.get_type() == XConstants.SelectionNotify) {
final XSelectionEvent xse = ev.get_xselection();
XClipboard clipboard = null;
synchronized (XClipboard.classLock) {
@@ -223,7 +223,7 @@
XDataTransferer.TARGETS_ATOM.getAtom(),
getTargetsPropertyAtom().getAtom(),
XWindow.getXAWTRootWindow().getWindow(),
- XlibWrapper.CurrentTime);
+ XConstants.CurrentTime);
isSelectionNotifyProcessed = false;
}
} finally {
@@ -260,7 +260,7 @@
long[] formats = null;
- if (propertyAtom == XlibWrapper.None) {
+ if (propertyAtom == XConstants.None) {
// We treat None property atom as "empty selection".
formats = new long[0];
} else {
@@ -268,7 +268,7 @@
new WindowPropertyGetter(XWindow.getXAWTRootWindow().getWindow(),
XAtom.get(propertyAtom), 0,
XSelection.MAX_LENGTH, true,
- XlibWrapper.AnyPropertyType);
+ XConstants.AnyPropertyType);
try {
targetsGetter.execute();
formats = XSelection.getFormats(targetsGetter);
--- a/jdk/src/solaris/classes/sun/awt/X11/XComponentPeer.java Mon Apr 07 14:53:51 2008 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XComponentPeer.java Mon Apr 07 16:52:51 2008 +0400
@@ -72,7 +72,7 @@
import sun.awt.image.ToolkitImage;
import sun.java2d.pipe.Region;
-public class XComponentPeer extends XWindow implements ComponentPeer, DropTargetPeer, XConstants {
+public class XComponentPeer extends XWindow implements ComponentPeer, DropTargetPeer {
/* FIX ME: these constants copied from java.awt.KeyboardFocusManager */
static final int SNFH_FAILURE = 0;
static final int SNFH_SUCCESS_HANDLED = 1;
@@ -718,7 +718,7 @@
* handleJavaMouseEvent() would be more suitable place to do this
* but we want Swing to have this functionality also.
*/
- if (xev.get_type() == ButtonPress) {
+ if (xev.get_type() == XConstants.ButtonPress) {
final XWindowPeer parentXWindow = getParentTopLevel();
Window parentWindow = (Window)parentXWindow.getTarget();
if (parentXWindow.isFocusableWindow() && parentXWindow.isSimpleWindow() &&
@@ -841,7 +841,7 @@
XSetWindowAttributes xwa = new XSetWindowAttributes();
xwa.set_cursor(xcursor);
- long valuemask = XlibWrapper.CWCursor;
+ long valuemask = XConstants.CWCursor;
XlibWrapper.XChangeWindowAttributes(XToolkit.getDisplay(),getWindow(),valuemask,xwa.pData);
XlibWrapper.XFlush(XToolkit.getDisplay());
@@ -1342,20 +1342,20 @@
enableLog.log(Level.FINEST, "Component is {1}, checking for disabled event {0}", new Object[] {e, (isEnabled()?"enabled":"disable")});
if (!isEnabled()) {
switch (e.get_type()) {
- case ButtonPress:
- case ButtonRelease:
- case KeyPress:
- case KeyRelease:
- case EnterNotify:
- case LeaveNotify:
- case MotionNotify:
+ case XConstants.ButtonPress:
+ case XConstants.ButtonRelease:
+ case XConstants.KeyPress:
+ case XConstants.KeyRelease:
+ case XConstants.EnterNotify:
+ case XConstants.LeaveNotify:
+ case XConstants.MotionNotify:
enableLog.log(Level.FINER, "Event {0} is disable", new Object[] {e});
return true;
}
}
switch(e.get_type()) {
- case MapNotify:
- case UnmapNotify:
+ case XConstants.MapNotify:
+ case XConstants.UnmapNotify:
return true;
}
return super.isEventDisabled(e);
--- a/jdk/src/solaris/classes/sun/awt/X11/XConstants.java Mon Apr 07 14:53:51 2008 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XConstants.java Mon Apr 07 16:52:51 2008 +0400
@@ -1,5 +1,5 @@
/*
- * Copyright 2003 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2003-2008 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,10 @@
package sun.awt.X11;
-public interface XConstants {
+final public class XConstants {
+
+ private XConstants(){}
+
public static final int X_PROTOCOL = 11 ; /* current protocol version */
public static final int X_PROTOCOL_REVISION = 0 ; /* current minor version */
@@ -292,9 +295,9 @@
public static final int RevertToParent = 2 ;
/* Used in XEventsQueued */
- int QueuedAlready = 0;
- int QueuedAfterReading = 1;
- int QueuedAfterFlush = 2;
+ public static final int QueuedAlready = 0;
+ public static final int QueuedAfterReading = 1;
+ public static final int QueuedAfterFlush = 2;
/*****************************************************************
--- a/jdk/src/solaris/classes/sun/awt/X11/XContentWindow.java Mon Apr 07 14:53:51 2008 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XContentWindow.java Mon Apr 07 16:52:51 2008 +0400
@@ -43,7 +43,7 @@
* It should always be located at (- left inset, - top inset) in the associated
* decorated window. So coordinates in it would be the same as java coordinates.
*/
-public final class XContentWindow extends XWindow implements XConstants {
+public final class XContentWindow extends XWindow {
private static Logger insLog = Logger.getLogger("sun.awt.X11.insets.XContentWindow");
static XContentWindow createContent(XDecoratedPeer parentFrame) {
@@ -76,10 +76,10 @@
void preInit(XCreateWindowParams params) {
super.preInit(params);
- params.putIfNull(BIT_GRAVITY, Integer.valueOf(NorthWestGravity));
+ params.putIfNull(BIT_GRAVITY, Integer.valueOf(XConstants.NorthWestGravity));
Long eventMask = (Long)params.get(EVENT_MASK);
if (eventMask != null) {
- eventMask = eventMask & ~(StructureNotifyMask);
+ eventMask = eventMask & ~(XConstants.StructureNotifyMask);
params.put(EVENT_MASK, eventMask);
}
}
@@ -90,15 +90,15 @@
protected boolean isEventDisabled(XEvent e) {
switch (e.get_type()) {
// Override parentFrame to receive MouseEnter/Exit
- case EnterNotify:
- case LeaveNotify:
+ case XConstants.EnterNotify:
+ case XConstants.LeaveNotify:
return false;
// We handle ConfigureNotify specifically in XDecoratedPeer
- case ConfigureNotify:
+ case XConstants.ConfigureNotify:
return true;
// We don't want SHOWN/HIDDEN on content window since it will duplicate XDecoratedPeer
- case MapNotify:
- case UnmapNotify:
+ case XConstants.MapNotify:
+ case XConstants.UnmapNotify:
return true;
default:
return super.isEventDisabled(e) || parentFrame.isEventDisabled(e);
--- a/jdk/src/solaris/classes/sun/awt/X11/XCursorFontConstants.java Mon Apr 07 14:53:51 2008 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XCursorFontConstants.java Mon Apr 07 16:52:51 2008 +0400
@@ -1,5 +1,5 @@
/*
- * Copyright 2003 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2003-2008 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,10 @@
package sun.awt.X11;
-public interface XCursorFontConstants {
+final public class XCursorFontConstants {
+
+ private XCursorFontConstants(){}
+
/* cursorfont defines */
static final int XC_num_glyphs=154;
static final int XC_X_cursor=0;
--- a/jdk/src/solaris/classes/sun/awt/X11/XCustomCursor.java Mon Apr 07 14:53:51 2008 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XCustomCursor.java Mon Apr 07 16:52:51 2008 +0400
@@ -1,5 +1,5 @@
/*
- * Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2003-2008 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -83,7 +83,7 @@
long colormap = XToolkit.getDefaultXColormap();
XColor fore_color = new XColor();
- fore_color.set_flags((byte) (XlibWrapper.DoRed | XlibWrapper.DoGreen | XlibWrapper.DoBlue));
+ fore_color.set_flags((byte) (XConstants.DoRed | XConstants.DoGreen | XConstants.DoBlue));
fore_color.set_red((short)(((fcolor >> 16) & 0x000000ff) << 8));
fore_color.set_green((short) (((fcolor >> 8) & 0x000000ff) << 8));
fore_color.set_blue((short)(((fcolor >> 0) & 0x000000ff) << 8));
@@ -92,7 +92,7 @@
XColor back_color = new XColor();
- back_color.set_flags((byte) (XlibWrapper.DoRed | XlibWrapper.DoGreen | XlibWrapper.DoBlue));
+ back_color.set_flags((byte) (XConstants.DoRed | XConstants.DoGreen | XConstants.DoBlue));
back_color.set_red((short) (((bcolor >> 16) & 0x000000ff) << 8));
back_color.set_green((short) (((bcolor >> 8) & 0x000000ff) << 8));
--- a/jdk/src/solaris/classes/sun/awt/X11/XDecoratedPeer.java Mon Apr 07 14:53:51 2008 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XDecoratedPeer.java Mon Apr 07 16:52:51 2008 +0400
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2007 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2002-2008 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -89,7 +89,7 @@
// Deny default processing of these events on the shell - proxy will take care of
// them instead
Long eventMask = (Long)params.get(EVENT_MASK);
- params.add(EVENT_MASK, Long.valueOf(eventMask.longValue() & ~(FocusChangeMask | KeyPressMask | KeyReleaseMask)));
+ params.add(EVENT_MASK, Long.valueOf(eventMask.longValue() & ~(XConstants.FocusChangeMask | XConstants.KeyPressMask | XConstants.KeyReleaseMask)));
}
void postInit(XCreateWindowParams params) {
@@ -131,7 +131,7 @@
int minHeight = minimumSize.height - insets.top - insets.bottom;
if (minWidth < 0) minWidth = 0;
if (minHeight < 0) minHeight = 0;
- setSizeHints(XlibWrapper.PMinSize | (isLocationByPlatform()?0:(XlibWrapper.PPosition | XlibWrapper.USPosition)),
+ setSizeHints(XUtilConstants.PMinSize | (isLocationByPlatform()?0:(XUtilConstants.PPosition | XUtilConstants.USPosition)),
getX(), getY(), minWidth, minHeight);
if (isVisible()) {
Rectangle bounds = getShellBounds();
@@ -143,7 +143,7 @@
}
} else {
boolean isMinSizeSet = isMinSizeSet();
- XWM.removeSizeHints(this, XlibWrapper.PMinSize);
+ XWM.removeSizeHints(this, XUtilConstants.PMinSize);
/* Some WMs need remap to redecorate the window */
if (isMinSizeSet && isShowing() && XWM.needRemap(this)) {
/*
@@ -365,7 +365,7 @@
return;
}
- if ((getHints().get_flags() & (USPosition | PPosition)) != 0) {
+ if ((getHints().get_flags() & (XUtilConstants.USPosition | XUtilConstants.PPosition)) != 0) {
reshape(dimensions, SET_BOUNDS, false);
} else {
reshape(dimensions, SET_SIZE, false);
@@ -841,10 +841,10 @@
setReparented(false);
}
winAttr.isResizable = resizable;
- if ((fs & MWM_FUNC_ALL) != 0) {
- fs &= ~(MWM_FUNC_RESIZE | MWM_FUNC_MAXIMIZE);
+ if ((fs & MWMConstants.MWM_FUNC_ALL) != 0) {
+ fs &= ~(MWMConstants.MWM_FUNC_RESIZE | MWMConstants.MWM_FUNC_MAXIMIZE);
} else {
- fs |= (MWM_FUNC_RESIZE | MWM_FUNC_MAXIMIZE);
+ fs |= (MWMConstants.MWM_FUNC_RESIZE | MWMConstants.MWM_FUNC_MAXIMIZE);
}
winAttr.functions = fs;
XWM.setShellResizable(this);
@@ -855,10 +855,10 @@
setReparented(false);
}
winAttr.isResizable = resizable;
- if ((fs & MWM_FUNC_ALL) != 0) {
- fs |= (MWM_FUNC_RESIZE | MWM_FUNC_MAXIMIZE);
+ if ((fs & MWMConstants.MWM_FUNC_ALL) != 0) {
+ fs |= (MWMConstants.MWM_FUNC_RESIZE | MWMConstants.MWM_FUNC_MAXIMIZE);
} else {
- fs &= ~(MWM_FUNC_RESIZE | MWM_FUNC_MAXIMIZE);
+ fs &= ~(MWMConstants.MWM_FUNC_RESIZE | MWMConstants.MWM_FUNC_MAXIMIZE);
}
winAttr.functions = fs;
XWM.setShellNotResizable(this, dimensions, dimensions.getBounds(), false);
@@ -936,10 +936,10 @@
protected boolean isEventDisabled(XEvent e) {
switch (e.get_type()) {
// Do not generate MOVED/RESIZED events since we generate them by ourselves
- case ConfigureNotify:
+ case XConstants.ConfigureNotify:
return true;
- case EnterNotify:
- case LeaveNotify:
+ case XConstants.EnterNotify:
+ case XConstants.LeaveNotify:
// Disable crossing event on outer borders of Frame so
// we receive only one set of cross notifications(first set is from content window)
return true;
@@ -964,7 +964,7 @@
if (winAttr.isResizable) {
//Fix for 4320050: Minimum size for java.awt.Frame is not being enforced.
//We need to update frame's minimum size, not to reset it
- XWM.removeSizeHints(this, XlibWrapper.PMaxSize);
+ XWM.removeSizeHints(this, XUtilConstants.PMaxSize);
updateMinimumSize();
}
} else {
--- a/jdk/src/solaris/classes/sun/awt/X11/XDialogPeer.java Mon Apr 07 14:53:51 2008 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XDialogPeer.java Mon Apr 07 16:52:51 2008 +0400
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2007 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2002-2008 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -51,7 +51,7 @@
} else {
winAttr.decorations = winAttr.AWT_DECOR_NONE;
}
- winAttr.functions = MWM_FUNC_ALL;
+ winAttr.functions = MWMConstants.MWM_FUNC_ALL;
winAttr.isResizable = true; //target.isResizable();
winAttr.initialResizability = target.isResizable();
winAttr.title = target.getTitle();
@@ -100,10 +100,10 @@
int getDecorations() {
int d = super.getDecorations();
// remove minimize and maximize buttons for dialogs
- if ((d & MWM_DECOR_ALL) != 0) {
- d |= (MWM_DECOR_MINIMIZE | MWM_DECOR_MAXIMIZE);
+ if ((d & MWMConstants.MWM_DECOR_ALL) != 0) {
+ d |= (MWMConstants.MWM_DECOR_MINIMIZE | MWMConstants.MWM_DECOR_MAXIMIZE);
} else {
- d &= ~(MWM_DECOR_MINIMIZE | MWM_DECOR_MAXIMIZE);
+ d &= ~(MWMConstants.MWM_DECOR_MINIMIZE | MWMConstants.MWM_DECOR_MAXIMIZE);
}
return d;
}
@@ -111,10 +111,10 @@
int getFunctions() {
int f = super.getFunctions();
// remove minimize and maximize functions for dialogs
- if ((f & MWM_FUNC_ALL) != 0) {
- f |= (MWM_FUNC_MINIMIZE | MWM_FUNC_MAXIMIZE);
+ if ((f & MWMConstants.MWM_FUNC_ALL) != 0) {
+ f |= (MWMConstants.MWM_FUNC_MINIMIZE | MWMConstants.MWM_FUNC_MAXIMIZE);
} else {
- f &= ~(MWM_FUNC_MINIMIZE | MWM_FUNC_MAXIMIZE);
+ f &= ~(MWMConstants.MWM_FUNC_MINIMIZE | MWMConstants.MWM_FUNC_MAXIMIZE);
}
return f;
}
--- a/jdk/src/solaris/classes/sun/awt/X11/XDnDDragSourceProtocol.java Mon Apr 07 14:53:51 2008 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XDnDDragSourceProtocol.java Mon Apr 07 16:52:51 2008 +0400
@@ -1,5 +1,5 @@
/*
- * Copyright 2003-2005 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2003-2008 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -103,7 +103,7 @@
XToolkit.RESTORE_XERROR_HANDLER();
if (XToolkit.saved_error != null &&
- XToolkit.saved_error.get_error_code() != XlibWrapper.Success) {
+ XToolkit.saved_error.get_error_code() != XConstants.Success) {
cleanup();
throw new XException("Cannot write XdndActionList property");
}
@@ -124,7 +124,7 @@
XToolkit.RESTORE_XERROR_HANDLER();
if (XToolkit.saved_error != null &&
- XToolkit.saved_error.get_error_code() != XlibWrapper.Success) {
+ XToolkit.saved_error.get_error_code() != XConstants.Success) {
cleanup();
throw new XException("Cannot write XdndActionList property");
}
@@ -134,7 +134,7 @@
}
if (!XDnDConstants.XDnDSelection.setOwner(contents, formatMap, formats,
- XlibWrapper.CurrentTime)) {
+ XConstants.CurrentTime)) {
cleanup();
throw new InvalidDnDOperationException("Cannot acquire selection ownership");
}
@@ -193,11 +193,11 @@
WindowPropertyGetter wpg1 =
new WindowPropertyGetter(window, XDnDConstants.XA_XdndAware, 0, 1,
- false, XlibWrapper.AnyPropertyType);
+ false, XConstants.AnyPropertyType);
int status = wpg1.execute(XToolkit.IgnoreBadWindowHandler);
- if (status == XlibWrapper.Success &&
+ if (status == XConstants.Success &&
wpg1.getData() != 0 && wpg1.getActualType() == XAtom.XA_ATOM) {
int targetVersion = (int)Native.getLong(wpg1.getData());
@@ -217,7 +217,7 @@
try {
status = wpg2.execute(XToolkit.IgnoreBadWindowHandler);
- if (status == XlibWrapper.Success &&
+ if (status == XConstants.Success &&
wpg2.getData() != 0 &&
wpg2.getActualType() == XAtom.XA_WINDOW) {
@@ -235,7 +235,7 @@
try {
status = wpg3.execute(XToolkit.IgnoreBadWindowHandler);
- if (status != XlibWrapper.Success ||
+ if (status != XConstants.Success ||
wpg3.getData() == 0 ||
wpg3.getActualType() != XAtom.XA_WINDOW ||
Native.getLong(wpg3.getData()) != proxy) {
@@ -246,12 +246,12 @@
new WindowPropertyGetter(proxy,
XDnDConstants.XA_XdndAware,
0, 1, false,
- XlibWrapper.AnyPropertyType);
+ XConstants.AnyPropertyType);
try {
status = wpg4.execute(XToolkit.IgnoreBadWindowHandler);
- if (status != XlibWrapper.Success ||
+ if (status != XConstants.Success ||
wpg4.getData() == 0 ||
wpg4.getActualType() != XAtom.XA_ATOM) {
@@ -283,7 +283,7 @@
XClientMessageEvent msg = new XClientMessageEvent();
try {
- msg.set_type((int)XlibWrapper.ClientMessage);
+ msg.set_type((int)XConstants.ClientMessage);
msg.set_window(getTargetWindow());
msg.set_format(32);
msg.set_message_type(XDnDConstants.XA_XdndEnter.getAtom());
@@ -297,7 +297,7 @@
msg.set_data(4, formats.length > 2 ? formats[2] : 0);
XlibWrapper.XSendEvent(XToolkit.getDisplay(),
getTargetProxyWindow(),
- false, XlibWrapper.NoEventMask,
+ false, XConstants.NoEventMask,
msg.pData);
} finally {
msg.dispose();
@@ -311,7 +311,7 @@
XClientMessageEvent msg = new XClientMessageEvent();
try {
- msg.set_type((int)XlibWrapper.ClientMessage);
+ msg.set_type((int)XConstants.ClientMessage);
msg.set_window(getTargetWindow());
msg.set_format(32);
msg.set_message_type(XDnDConstants.XA_XdndPosition.getAtom());
@@ -322,7 +322,7 @@
msg.set_data(4, XDnDConstants.getXDnDActionForJavaAction(sourceAction));
XlibWrapper.XSendEvent(XToolkit.getDisplay(),
getTargetProxyWindow(),
- false, XlibWrapper.NoEventMask,
+ false, XConstants.NoEventMask,
msg.pData);
} finally {
msg.dispose();
@@ -335,7 +335,7 @@
XClientMessageEvent msg = new XClientMessageEvent();
try {
- msg.set_type((int)XlibWrapper.ClientMessage);
+ msg.set_type((int)XConstants.ClientMessage);
msg.set_window(getTargetWindow());
msg.set_format(32);
msg.set_message_type(XDnDConstants.XA_XdndLeave.getAtom());
@@ -346,7 +346,7 @@
msg.set_data(4, 0);
XlibWrapper.XSendEvent(XToolkit.getDisplay(),
getTargetProxyWindow(),
- false, XlibWrapper.NoEventMask,
+ false, XConstants.NoEventMask,
msg.pData);
} finally {
msg.dispose();
@@ -361,7 +361,7 @@
XClientMessageEvent msg = new XClientMessageEvent();
try {
- msg.set_type((int)XlibWrapper.ClientMessage);
+ msg.set_type((int)XConstants.ClientMessage);
msg.set_window(getTargetWindow());
msg.set_format(32);
msg.set_message_type(XDnDConstants.XA_XdndDrop.getAtom());
@@ -372,7 +372,7 @@
msg.set_data(4, 0);
XlibWrapper.XSendEvent(XToolkit.getDisplay(),
getTargetProxyWindow(),
- false, XlibWrapper.NoEventMask,
+ false, XConstants.NoEventMask,
msg.pData);
} finally {
msg.dispose();
@@ -406,7 +406,7 @@
assert XToolkit.isAWTLockHeldByCurrentThread();
XlibWrapper.XSendEvent(XToolkit.getDisplay(), sourceWindow,
- false, XlibWrapper.NoEventMask,
+ false, XConstants.NoEventMask,
xclient.pData);
return true;
--- a/jdk/src/solaris/classes/sun/awt/X11/XDnDDropTargetProtocol.java Mon Apr 07 14:53:51 2008 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XDnDDropTargetProtocol.java Mon Apr 07 16:52:51 2008 +0400
@@ -1,5 +1,5 @@
/*
- * Copyright 2003-2005 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2003-2008 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -93,7 +93,7 @@
XToolkit.RESTORE_XERROR_HANDLER();
if (XToolkit.saved_error != null &&
- XToolkit.saved_error.get_error_code() != XlibWrapper.Success) {
+ XToolkit.saved_error.get_error_code() != XConstants.Success) {
throw new XException("Cannot write XdndAware property");
}
} finally {
@@ -119,12 +119,12 @@
WindowPropertyGetter wpg1 =
new WindowPropertyGetter(embedder, XDnDConstants.XA_XdndAware, 0, 1,
- false, XlibWrapper.AnyPropertyType);
+ false, XConstants.AnyPropertyType);
try {
status = wpg1.execute(XToolkit.IgnoreBadWindowHandler);
- if (status == XlibWrapper.Success &&
+ if (status == XConstants.Success &&
wpg1.getData() != 0 && wpg1.getActualType() == XAtom.XA_ATOM) {
overriden = true;
@@ -143,7 +143,7 @@
try {
status = wpg2.execute(XToolkit.IgnoreBadWindowHandler);
- if (status == XlibWrapper.Success &&
+ if (status == XConstants.Success &&
wpg2.getData() != 0 &&
wpg2.getActualType() == XAtom.XA_WINDOW) {
@@ -161,7 +161,7 @@
try {
status = wpg3.execute(XToolkit.IgnoreBadWindowHandler);
- if (status != XlibWrapper.Success ||
+ if (status != XConstants.Success ||
wpg3.getData() == 0 ||
wpg3.getActualType() != XAtom.XA_WINDOW ||
Native.getLong(wpg3.getData()) != proxy) {
@@ -172,12 +172,12 @@
new WindowPropertyGetter(proxy,
XDnDConstants.XA_XdndAware,
0, 1, false,
- XlibWrapper.AnyPropertyType);
+ XConstants.AnyPropertyType);
try {
status = wpg4.execute(XToolkit.IgnoreBadWindowHandler);
- if (status != XlibWrapper.Success ||
+ if (status != XConstants.Success ||
wpg4.getData() == 0 ||
wpg4.getActualType() != XAtom.XA_ATOM) {
@@ -212,7 +212,7 @@
if (XToolkit.saved_error != null &&
XToolkit.saved_error.get_error_code() !=
- XlibWrapper.Success) {
+ XConstants.Success) {
throw new XException("Cannot write XdndAware property");
}
@@ -226,7 +226,7 @@
if (XToolkit.saved_error != null &&
XToolkit.saved_error.get_error_code() !=
- XlibWrapper.Success) {
+ XConstants.Success) {
throw new XException("Cannot write XdndProxy property");
}
@@ -239,7 +239,7 @@
if (XToolkit.saved_error != null &&
XToolkit.saved_error.get_error_code() !=
- XlibWrapper.Success) {
+ XConstants.Success) {
throw new XException("Cannot write XdndAware property");
}
@@ -252,7 +252,7 @@
if (XToolkit.saved_error != null &&
XToolkit.saved_error.get_error_code() !=
- XlibWrapper.Success) {
+ XConstants.Success) {
throw new XException("Cannot write XdndProxy property");
}
} finally {
@@ -285,7 +285,7 @@
if (XToolkit.saved_error != null &&
XToolkit.saved_error.get_error_code() !=
- XlibWrapper.Success) {
+ XConstants.Success) {
throw new XException("Cannot write XdndAware property");
}
@@ -298,7 +298,7 @@
if (XToolkit.saved_error != null &&
XToolkit.saved_error.get_error_code() !=
- XlibWrapper.Success) {
+ XConstants.Success) {
throw new XException("Cannot write XdndProxy property");
}
} finally {
@@ -326,12 +326,12 @@
WindowPropertyGetter wpg1 =
new WindowPropertyGetter(embedded, XDnDConstants.XA_XdndAware, 0, 1,
- false, XlibWrapper.AnyPropertyType);
+ false, XConstants.AnyPropertyType);
try {
status = wpg1.execute(XToolkit.IgnoreBadWindowHandler);
- if (status == XlibWrapper.Success &&
+ if (status == XConstants.Success &&
wpg1.getData() != 0 && wpg1.getActualType() == XAtom.XA_ATOM) {
overriden = true;
@@ -350,7 +350,7 @@
try {
status = wpg2.execute(XToolkit.IgnoreBadWindowHandler);
- if (status == XlibWrapper.Success &&
+ if (status == XConstants.Success &&
wpg2.getData() != 0 &&
wpg2.getActualType() == XAtom.XA_WINDOW) {
@@ -368,7 +368,7 @@
try {
status = wpg3.execute(XToolkit.IgnoreBadWindowHandler);
- if (status != XlibWrapper.Success ||
+ if (status != XConstants.Success ||
wpg3.getData() == 0 ||
wpg3.getActualType() != XAtom.XA_WINDOW ||
Native.getLong(wpg3.getData()) != proxy) {
@@ -379,12 +379,12 @@
new WindowPropertyGetter(proxy,
XDnDConstants.XA_XdndAware,
0, 1, false,
- XlibWrapper.AnyPropertyType);
+ XConstants.AnyPropertyType);
try {
status = wpg4.execute(XToolkit.IgnoreBadWindowHandler);
- if (status != XlibWrapper.Success ||
+ if (status != XConstants.Success ||
wpg4.getData() == 0 ||
wpg4.getActualType() != XAtom.XA_ATOM) {
@@ -408,12 +408,12 @@
WindowPropertyGetter wpg1 =
new WindowPropertyGetter(window, XDnDConstants.XA_XdndAware, 0, 1,
- false, XlibWrapper.AnyPropertyType);
+ false, XConstants.AnyPropertyType);
try {
int status = wpg1.execute(XToolkit.IgnoreBadWindowHandler);
- if (status == XlibWrapper.Success &&
+ if (status == XConstants.Success &&
wpg1.getData() != 0 && wpg1.getActualType() == XAtom.XA_ATOM) {
return true;
@@ -523,7 +523,7 @@
for (int i = 0; i < 3; i++) {
long j;
- if ((j = xclient.get_data(2 + i)) != XlibWrapper.None) {
+ if ((j = xclient.get_data(2 + i)) != XConstants.None) {
formats3[countFormats++] = j;
}
}
@@ -549,7 +549,7 @@
if (status == 0 ||
(XToolkit.saved_error != null &&
- XToolkit.saved_error.get_error_code() != XlibWrapper.Success)) {
+ XToolkit.saved_error.get_error_code() != XConstants.Success)) {
throw new XException("XGetWindowAttributes failed");
}
@@ -561,12 +561,12 @@
XToolkit.WITH_XERROR_HANDLER(XToolkit.IgnoreBadWindowHandler);
XlibWrapper.XSelectInput(XToolkit.getDisplay(), source_win,
source_win_mask |
- XlibWrapper.StructureNotifyMask);
+ XConstants.StructureNotifyMask);
XToolkit.RESTORE_XERROR_HANDLER();
if (XToolkit.saved_error != null &&
- XToolkit.saved_error.get_error_code() != XlibWrapper.Success) {
+ XToolkit.saved_error.get_error_code() != XConstants.Success) {
throw new XException("XSelectInput failed");
}
@@ -581,7 +581,7 @@
}
private boolean processXdndPosition(XClientMessageEvent xclient) {
- long time_stamp = (int)XlibWrapper.CurrentTime;
+ long time_stamp = (int)XConstants.CurrentTime;
long xdnd_action = 0;
int java_action = DnDConstants.ACTION_NONE;
int x = 0;
@@ -748,7 +748,7 @@
long data3, long data4) {
XClientMessageEvent enter = new XClientMessageEvent();
try {
- enter.set_type((int)XlibWrapper.ClientMessage);
+ enter.set_type((int)XConstants.ClientMessage);
enter.set_window(toplevel);
enter.set_format(32);
enter.set_message_type(XDnDConstants.XA_XdndEnter.getAtom());
@@ -774,7 +774,7 @@
long sourceWindow) {
XClientMessageEvent leave = new XClientMessageEvent();
try {
- leave.set_type((int)XlibWrapper.ClientMessage);
+ leave.set_type((int)XConstants.ClientMessage);
leave.set_window(toplevel);
leave.set_format(32);
leave.set_message_type(XDnDConstants.XA_XdndLeave.getAtom());
@@ -804,7 +804,7 @@
XClientMessageEvent msg = new XClientMessageEvent();
try {
- msg.set_type((int)XlibWrapper.ClientMessage);
+ msg.set_type((int)XConstants.ClientMessage);
msg.set_window(xclient.get_data(0));
msg.set_format(32);
msg.set_message_type(XDnDConstants.XA_XdndStatus.getAtom());
@@ -826,7 +826,7 @@
try {
XlibWrapper.XSendEvent(XToolkit.getDisplay(),
xclient.get_data(0),
- false, XlibWrapper.NoEventMask,
+ false, XConstants.NoEventMask,
msg.pData);
} finally {
XToolkit.awtUnlock();
@@ -842,7 +842,7 @@
throws IllegalArgumentException, IOException {
XClientMessageEvent xclient = new XClientMessageEvent(ctxt);
long message_type = xclient.get_message_type();
- long time_stamp = XlibWrapper.CurrentTime;
+ long time_stamp = XConstants.CurrentTime;
// NOTE: we assume that the source supports at least version 1, so we
// can use the time stamp
@@ -892,7 +892,7 @@
XClientMessageEvent msg = new XClientMessageEvent();
try {
- msg.set_type((int)XlibWrapper.ClientMessage);
+ msg.set_type((int)XConstants.ClientMessage);
msg.set_window(xclient.get_data(0));
msg.set_format(32);
msg.set_message_type(XDnDConstants.XA_XdndFinished.getAtom());
@@ -914,7 +914,7 @@
try {
XlibWrapper.XSendEvent(XToolkit.getDisplay(),
xclient.get_data(0),
- false, XlibWrapper.NoEventMask,
+ false, XConstants.NoEventMask,
msg.pData);
} finally {
XToolkit.awtUnlock();
@@ -1119,7 +1119,7 @@
XToolkit.RESTORE_XERROR_HANDLER();
if (XToolkit.saved_error != null &&
- XToolkit.saved_error.get_error_code() != XlibWrapper.Success) {
+ XToolkit.saved_error.get_error_code() != XConstants.Success) {
if (logger.isLoggable(Level.WARNING)) {
logger.warning("Cannot set XdndTypeList on the proxy window");
}
--- a/jdk/src/solaris/classes/sun/awt/X11/XDragSourceContextPeer.java Mon Apr 07 14:53:51 2008 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XDragSourceContextPeer.java Mon Apr 07 16:52:51 2008 +0400
@@ -1,5 +1,5 @@
/*
- * Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2003-2008 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -55,11 +55,11 @@
Logger.getLogger("sun.awt.X11.xembed.xdnd.XDragSourceContextPeer");
/* The events selected on the root window when the drag begins. */
- private static final int ROOT_EVENT_MASK = (int)XlibWrapper.ButtonMotionMask |
- (int)XlibWrapper.KeyPressMask | (int)XlibWrapper.KeyReleaseMask;
+ private static final int ROOT_EVENT_MASK = (int)XConstants.ButtonMotionMask |
+ (int)XConstants.KeyPressMask | (int)XConstants.KeyReleaseMask;
/* The events to be delivered during grab. */
- private static final int GRAB_EVENT_MASK = (int)XlibWrapper.ButtonPressMask |
- (int)XlibWrapper.ButtonMotionMask | (int)XlibWrapper.ButtonReleaseMask;
+ private static final int GRAB_EVENT_MASK = (int)XConstants.ButtonPressMask |
+ (int)XConstants.ButtonMotionMask | (int)XConstants.ButtonReleaseMask;
/* The event mask of the root window before the drag operation starts. */
private long rootEventMask = 0;
@@ -196,11 +196,11 @@
status = XlibWrapper.XGrabPointer(XToolkit.getDisplay(), rootWindow,
0, GRAB_EVENT_MASK,
- XlibWrapper.GrabModeAsync,
- XlibWrapper.GrabModeAsync,
- XlibWrapper.None, xcursor, timeStamp);
+ XConstants.GrabModeAsync,
+ XConstants.GrabModeAsync,
+ XConstants.None, xcursor, timeStamp);
- if (status != XlibWrapper.GrabSuccess) {
+ if (status != XConstants.GrabSuccess) {
cleanup(timeStamp);
throwGrabFailureException("Cannot grab pointer", status);
return;
@@ -208,11 +208,11 @@
status = XlibWrapper.XGrabKeyboard(XToolkit.getDisplay(), rootWindow,
0,
- XlibWrapper.GrabModeAsync,
- XlibWrapper.GrabModeAsync,
+ XConstants.GrabModeAsync,
+ XConstants.GrabModeAsync,
timeStamp);
- if (status != XlibWrapper.GrabSuccess) {
+ if (status != XConstants.GrabSuccess) {
cleanup(timeStamp);
throwGrabFailureException("Cannot grab keyboard", status);
return;
@@ -276,7 +276,7 @@
XlibWrapper.XChangeActivePointerGrab(XToolkit.getDisplay(),
GRAB_EVENT_MASK,
xcursor,
- XlibWrapper.CurrentTime);
+ XConstants.CurrentTime);
}
protected boolean needsBogusExitBeforeDrop() {
@@ -287,10 +287,10 @@
throws InvalidDnDOperationException {
String msgCause = "";
switch (grabStatus) {
- case XlibWrapper.GrabNotViewable: msgCause = "not viewable"; break;
- case XlibWrapper.AlreadyGrabbed: msgCause = "already grabbed"; break;
- case XlibWrapper.GrabInvalidTime: msgCause = "invalid time"; break;
- case XlibWrapper.GrabFrozen: msgCause = "grab frozen"; break;
+ case XConstants.GrabNotViewable: msgCause = "not viewable"; break;
+ case XConstants.AlreadyGrabbed: msgCause = "already grabbed"; break;
+ case XConstants.GrabInvalidTime: msgCause = "invalid time"; break;
+ case XConstants.GrabFrozen: msgCause = "grab frozen"; break;
default: msgCause = "unknown failure"; break;
}
throw new InvalidDnDOperationException(msg + ": " + msgCause);
@@ -537,7 +537,7 @@
return false;
}
- if (ev.get_type() != (int)XlibWrapper.ClientMessage) {
+ if (ev.get_type() != (int)XConstants.ClientMessage) {
return false;
}
@@ -579,18 +579,18 @@
}
switch (ev.get_type()) {
- case XlibWrapper.ClientMessage: {
+ case XConstants.ClientMessage: {
XClientMessageEvent xclient = ev.get_xclient();
return processClientMessage(xclient);
}
- case XlibWrapper.DestroyNotify: {
+ case XConstants.DestroyNotify: {
XDestroyWindowEvent xde = ev.get_xdestroywindow();
/* Target crashed during drop processing - cleanup. */
if (!dragInProgress &&
dragProtocol != null &&
xde.get_window() == dragProtocol.getTargetWindow()) {
- cleanup(XlibWrapper.CurrentTime);
+ cleanup(XConstants.CurrentTime);
return true;
}
/* Pass along */
@@ -604,14 +604,14 @@
/* Process drag-only messages. */
switch (ev.get_type()) {
- case XlibWrapper.KeyRelease:
- case XlibWrapper.KeyPress: {
+ case XConstants.KeyRelease:
+ case XConstants.KeyPress: {
XKeyEvent xkey = ev.get_xkey();
long keysym = XlibWrapper.XKeycodeToKeysym(XToolkit.getDisplay(),
xkey.get_keycode(), 0);
switch ((int)keysym) {
case (int)XKeySymConstants.XK_Escape: {
- if (ev.get_type() == (int)XlibWrapper.KeyRelease) {
+ if (ev.get_type() == (int)XConstants.KeyRelease) {
cleanup(xkey.get_time());
}
break;
@@ -631,7 +631,7 @@
XlibWrapper.larg7); // modifiers
XMotionEvent xmotion = new XMotionEvent();
try {
- xmotion.set_type(XlibWrapper.MotionNotify);
+ xmotion.set_type(XConstants.MotionNotify);
xmotion.set_serial(xkey.get_serial());
xmotion.set_send_event(xkey.get_send_event());
xmotion.set_display(xkey.get_display());
@@ -658,12 +658,12 @@
}
return true;
}
- case XlibWrapper.ButtonPress:
+ case XConstants.ButtonPress:
return true;
- case XlibWrapper.MotionNotify:
+ case XConstants.MotionNotify:
processMouseMove(ev.get_xmotion());
return true;
- case XlibWrapper.ButtonRelease: {
+ case XConstants.ButtonRelease: {
XButtonEvent xbutton = ev.get_xbutton();
/*
* On some X servers it could happen that ButtonRelease coordinates
@@ -672,7 +672,7 @@
*/
XMotionEvent xmotion = new XMotionEvent();
try {
- xmotion.set_type(XlibWrapper.MotionNotify);
+ xmotion.set_type(XConstants.MotionNotify);
xmotion.set_serial(xbutton.get_serial());
xmotion.set_send_event(xbutton.get_send_event());
xmotion.set_display(xbutton.get_display());
@@ -694,8 +694,8 @@
} finally {
xmotion.dispose();
}
- if (xbutton.get_button() == XlibWrapper.Button1
- || xbutton.get_button() == XlibWrapper.Button2) {
+ if (xbutton.get_button() == XConstants.Button1
+ || xbutton.get_button() == XConstants.Button2) {
// drag is initiated with Button1 or Button2 pressed and
// ended on release of either of these buttons (as the same
// behavior was with our old Motif DnD-based implementation)
@@ -789,6 +789,6 @@
dragDropFinished(success, action, x, y);
dndInProgress = false;
- cleanup(XlibWrapper.CurrentTime);
+ cleanup(XConstants.CurrentTime);
}
}
--- a/jdk/src/solaris/classes/sun/awt/X11/XDragSourceProtocol.java Mon Apr 07 14:53:51 2008 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XDragSourceProtocol.java Mon Apr 07 16:52:51 2008 +0400
@@ -1,5 +1,5 @@
/*
- * Copyright 2003-2005 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2003-2008 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -189,7 +189,7 @@
if (status == 0 ||
(XToolkit.saved_error != null &&
- XToolkit.saved_error.get_error_code() != XlibWrapper.Success)) {
+ XToolkit.saved_error.get_error_code() != XConstants.Success)) {
throw new XException("XGetWindowAttributes failed");
}
@@ -201,12 +201,12 @@
XToolkit.WITH_XERROR_HANDLER(XToolkit.IgnoreBadWindowHandler);
XlibWrapper.XSelectInput(XToolkit.getDisplay(), targetWindow,
targetWindowMask |
- XlibWrapper.StructureNotifyMask);
+ XConstants.StructureNotifyMask);
XToolkit.RESTORE_XERROR_HANDLER();
if (XToolkit.saved_error != null &&
- XToolkit.saved_error.get_error_code() != XlibWrapper.Success) {
+ XToolkit.saved_error.get_error_code() != XConstants.Success) {
throw new XException("XSelectInput failed");
}
--- a/jdk/src/solaris/classes/sun/awt/X11/XDropTargetEventProcessor.java Mon Apr 07 14:53:51 2008 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XDropTargetEventProcessor.java Mon Apr 07 16:52:51 2008 +0400
@@ -1,5 +1,5 @@
/*
- * Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2003-2008 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -43,7 +43,7 @@
private XDropTargetEventProcessor() {}
private boolean doProcessEvent(XEvent ev) {
- if (ev.get_type() == (int)XlibWrapper.DestroyNotify &&
+ if (ev.get_type() == (int)XConstants.DestroyNotify &&
protocol != null &&
ev.get_xany().get_window() == protocol.getSourceWindow()) {
protocol.cleanup();
@@ -51,7 +51,7 @@
return false;
}
- if (ev.get_type() == (int)XlibWrapper.PropertyNotify) {
+ if (ev.get_type() == (int)XConstants.PropertyNotify) {
XPropertyEvent xproperty = ev.get_xproperty();
if (xproperty.get_atom() ==
MotifDnDConstants.XA_MOTIF_DRAG_RECEIVER_INFO.getAtom()) {
@@ -60,7 +60,7 @@
}
}
- if (ev.get_type() != (int)XlibWrapper.ClientMessage) {
+ if (ev.get_type() != (int)XConstants.ClientMessage) {
return false;
}
--- a/jdk/src/solaris/classes/sun/awt/X11/XDropTargetProtocol.java Mon Apr 07 14:53:51 2008 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XDropTargetProtocol.java Mon Apr 07 16:52:51 2008 +0400
@@ -1,5 +1,5 @@
/*
- * Copyright 2003-2005 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2003-2008 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -149,7 +149,7 @@
XToolkit.awtLock();
try {
XlibWrapper.XSendEvent(XToolkit.getDisplay(), proxy, false,
- XlibWrapper.NoEventMask, xclient.pData);
+ XConstants.NoEventMask, xclient.pData);
} finally {
XToolkit.awtUnlock();
}
--- a/jdk/src/solaris/classes/sun/awt/X11/XDropTargetRegistry.java Mon Apr 07 14:53:51 2008 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XDropTargetRegistry.java Mon Apr 07 16:52:51 2008 +0400
@@ -1,5 +1,5 @@
/*
- * Copyright 2003-2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2003-2008 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -27,18 +27,14 @@
import java.util.ArrayList;
import java.util.Collections;
-import java.util.Enumeration;
import java.util.HashMap;
import java.util.HashSet;
-import java.util.Hashtable;
import java.util.Iterator;
import java.util.List;
import java.util.logging.*;
import java.awt.Point;
-import sun.awt.dnd.SunDropTargetContextPeer;
-import sun.awt.dnd.SunDropTargetEvent;
/**
* The class responsible for registration/deregistration of drop sites.
@@ -179,11 +175,11 @@
if (status == 0 ||
(XToolkit.saved_error != null &&
- XToolkit.saved_error.get_error_code() != XlibWrapper.Success)) {
+ XToolkit.saved_error.get_error_code() != XConstants.Success)) {
continue;
}
- if (wattr.get_map_state() != XlibWrapper.IsUnmapped
+ if (wattr.get_map_state() != XConstants.IsUnmapped
&& dest_x < wattr.get_width()
&& dest_y < wattr.get_height()) {
return window;
@@ -233,7 +229,7 @@
if (status == 0 ||
(XToolkit.saved_error != null &&
- XToolkit.saved_error.get_error_code() != XlibWrapper.Success)) {
+ XToolkit.saved_error.get_error_code() != XConstants.Success)) {
throw new XException("XGetWindowAttributes failed");
}
@@ -243,14 +239,14 @@
wattr.dispose();
}
- if ((event_mask & XlibWrapper.PropertyChangeMask) == 0) {
+ if ((event_mask & XConstants.PropertyChangeMask) == 0) {
XToolkit.WITH_XERROR_HANDLER(XToolkit.IgnoreBadWindowHandler);
XlibWrapper.XSelectInput(XToolkit.getDisplay(), embedder,
- event_mask | XlibWrapper.PropertyChangeMask);
+ event_mask | XConstants.PropertyChangeMask);
XToolkit.RESTORE_XERROR_HANDLER();
if (XToolkit.saved_error != null &&
- XToolkit.saved_error.get_error_code() != XlibWrapper.Success) {
+ XToolkit.saved_error.get_error_code() != XConstants.Success) {
throw new XException("XSelectInput failed");
}
}
@@ -397,14 +393,14 @@
long event_mask = entry.getEventMask();
/* Restore the original event mask for the embedder. */
- if ((event_mask & XlibWrapper.PropertyChangeMask) == 0) {
+ if ((event_mask & XConstants.PropertyChangeMask) == 0) {
XToolkit.WITH_XERROR_HANDLER(XToolkit.IgnoreBadWindowHandler);
XlibWrapper.XSelectInput(XToolkit.getDisplay(), embedder,
event_mask);
XToolkit.RESTORE_XERROR_HANDLER();
if (XToolkit.saved_error != null &&
- XToolkit.saved_error.get_error_code() != XlibWrapper.Success) {
+ XToolkit.saved_error.get_error_code() != XConstants.Success) {
throw new XException("XSelectInput failed");
}
}
--- a/jdk/src/solaris/classes/sun/awt/X11/XEmbedCanvasPeer.java Mon Apr 07 14:53:51 2008 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XEmbedCanvasPeer.java Mon Apr 07 16:52:51 2008 +0400
@@ -1,5 +1,5 @@
/*
- * Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2003-2008 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -81,10 +81,10 @@
super.preInit(params);
params.put(EVENT_MASK,
- KeyPressMask | KeyReleaseMask
- | FocusChangeMask | ButtonPressMask | ButtonReleaseMask
- | EnterWindowMask | LeaveWindowMask | PointerMotionMask
- | ButtonMotionMask | ExposureMask | StructureNotifyMask | SubstructureNotifyMask);
+ XConstants.KeyPressMask | XConstants.KeyReleaseMask
+ | XConstants.FocusChangeMask | XConstants.ButtonPressMask | XConstants.ButtonReleaseMask
+ | XConstants.EnterWindowMask | XConstants.LeaveWindowMask | XConstants.PointerMotionMask
+ | XConstants.ButtonMotionMask | XConstants.ExposureMask | XConstants.StructureNotifyMask | XConstants.SubstructureNotifyMask);
}
@@ -134,7 +134,7 @@
try {
XToolkit.addEventDispatcher(xembed.handle, xembed);
XlibWrapper.XSelectInput(XToolkit.getDisplay(), xembed.handle,
- XlibWrapper.StructureNotifyMask | XlibWrapper.PropertyChangeMask);
+ XConstants.StructureNotifyMask | XConstants.PropertyChangeMask);
XDropTargetRegistry.getRegistry().registerXEmbedClient(getWindow(), xembed.handle);
} finally {
@@ -194,7 +194,7 @@
public void dispatchEvent(XEvent ev) {
super.dispatchEvent(ev);
switch (ev.get_type()) {
- case CreateNotify:
+ case XConstants.CreateNotify:
XCreateWindowEvent cr = ev.get_xcreatewindow();
if (xembedLog.isLoggable(Level.FINEST)) {
xembedLog.finest("Message on embedder: " + cr);
@@ -205,7 +205,7 @@
}
embedChild(cr.get_window());
break;
- case DestroyNotify:
+ case XConstants.DestroyNotify:
XDestroyWindowEvent dn = ev.get_xdestroywindow();
if (xembedLog.isLoggable(Level.FINEST)) {
xembedLog.finest("Message on embedder: " + dn);
@@ -215,7 +215,7 @@
}
childDestroyed();
break;
- case ReparentNotify:
+ case XConstants.ReparentNotify:
XReparentEvent rep = ev.get_xreparent();
if (xembedLog.isLoggable(Level.FINEST)) {
xembedLog.finest("Message on embedder: " + rep);
@@ -309,7 +309,7 @@
if (status == 0 ||
(XToolkit.saved_error != null &&
- XToolkit.saved_error.get_error_code() != XlibWrapper.Success)) {
+ XToolkit.saved_error.get_error_code() != XConstants.Success)) {
return null;
}
@@ -480,7 +480,7 @@
if (xembedLog.isLoggable(Level.FINE)) xembedLog.fine("Forwarding native key event: " + ke);
XToolkit.awtLock();
try {
- XlibWrapper.XSendEvent(XToolkit.getDisplay(), xembed.handle, false, XlibWrapper.NoEventMask, data);
+ XlibWrapper.XSendEvent(XToolkit.getDisplay(), xembed.handle, false, XConstants.NoEventMask, data);
} finally {
XToolkit.awtUnlock();
}
@@ -742,7 +742,7 @@
version = Native.getCard32(xembed_info_data, 0);
flags = Native.getCard32(xembed_info_data, 1);
boolean new_mapped = (flags & XEMBED_MAPPED) != 0;
- boolean currently_mapped = XlibUtil.getWindowMapState(handle) != XlibWrapper.IsUnmapped;
+ boolean currently_mapped = XlibUtil.getWindowMapState(handle) != XConstants.IsUnmapped;
if (new_mapped != currently_mapped) {
if (xembedLog.isLoggable(Level.FINER))
xembedLog.fine("Mapping state of the client has changed, old state: " + currently_mapped + ", new state: " + new_mapped);
@@ -803,13 +803,13 @@
public void dispatchEvent(XEvent xev) {
int type = xev.get_type();
switch (type) {
- case PropertyNotify:
+ case XConstants.PropertyNotify:
handlePropertyNotify(xev);
break;
- case ConfigureNotify:
+ case XConstants.ConfigureNotify:
handleConfigureNotify(xev);
break;
- case ClientMessage:
+ case XConstants.ClientMessage:
handleClientMessage(xev);
break;
}
@@ -844,7 +844,7 @@
XKeyEvent ke = new XKeyEvent(data);
// We recognize only these masks
- modifiers = ke.get_state() & (ShiftMask | ControlMask | LockMask);
+ modifiers = ke.get_state() & (XConstants.ShiftMask | XConstants.ControlMask | XConstants.LockMask);
if (xembedLog.isLoggable(Level.FINEST)) xembedLog.finest("Mapped " + e + " to " + this);
} finally {
XlibWrapper.unsafe.freeMemory(data);
--- a/jdk/src/solaris/classes/sun/awt/X11/XEmbedChildProxyPeer.java Mon Apr 07 14:53:51 2008 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XEmbedChildProxyPeer.java Mon Apr 07 16:52:51 2008 +0400
@@ -1,5 +1,5 @@
/*
- * Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2003-2008 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -53,7 +53,7 @@
try {
XToolkit.addEventDispatcher(handle, this);
XlibWrapper.XSelectInput(XToolkit.getDisplay(), handle,
- XlibWrapper.StructureNotifyMask | XlibWrapper.PropertyChangeMask);
+ XConstants.StructureNotifyMask | XConstants.PropertyChangeMask);
}
finally {
XToolkit.awtUnlock();
@@ -341,10 +341,10 @@
public void dispatchEvent(XEvent xev) {
int type = xev.get_type();
switch (type) {
- case XlibWrapper.PropertyNotify:
+ case XConstants.PropertyNotify:
handlePropertyNotify(xev);
break;
- case XlibWrapper.ConfigureNotify:
+ case XConstants.ConfigureNotify:
handleConfigureNotify(xev);
break;
}
--- a/jdk/src/solaris/classes/sun/awt/X11/XEmbedClientHelper.java Mon Apr 07 14:53:51 2008 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XEmbedClientHelper.java Mon Apr 07 16:52:51 2008 +0400
@@ -1,5 +1,5 @@
/*
- * Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2003-2008 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -145,10 +145,10 @@
public void dispatchEvent(XEvent xev) {
switch(xev.get_type()) {
- case XlibWrapper.ClientMessage:
+ case XConstants.ClientMessage:
handleClientMessage(xev);
break;
- case XlibWrapper.ReparentNotify:
+ case XConstants.ReparentNotify:
handleReparentNotify(xev);
break;
}
--- a/jdk/src/solaris/classes/sun/awt/X11/XEmbedHelper.java Mon Apr 07 14:53:51 2008 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XEmbedHelper.java Mon Apr 07 16:52:51 2008 +0400
@@ -1,5 +1,5 @@
/*
- * Copyright 2003-2005 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2003-2008 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -94,7 +94,7 @@
}
void sendMessage(long window, int message, long detail, long data1, long data2) {
XClientMessageEvent msg = new XClientMessageEvent();
- msg.set_type((int)XlibWrapper.ClientMessage);
+ msg.set_type((int)XConstants.ClientMessage);
msg.set_window(window);
msg.set_message_type(XEmbed.getAtom());
msg.set_format(32);
@@ -106,7 +106,7 @@
XToolkit.awtLock();
try {
if (xembedLog.isLoggable(Level.FINE)) xembedLog.fine("Sending " + XEmbedMessageToString(msg));
- XlibWrapper.XSendEvent(XToolkit.getDisplay(), window, false, XlibWrapper.NoEventMask, msg.pData);
+ XlibWrapper.XSendEvent(XToolkit.getDisplay(), window, false, XConstants.NoEventMask, msg.pData);
}
finally {
XToolkit.awtUnlock();
--- a/jdk/src/solaris/classes/sun/awt/X11/XEmbedServerTester.java Mon Apr 07 14:53:51 2008 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XEmbedServerTester.java Mon Apr 07 16:52:51 2008 +0400
@@ -1,5 +1,5 @@
/*
- * Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2003-2008 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -260,7 +260,7 @@
mapped = 0;
embedCompletely();
sleep(1000);
- if (XlibUtil.getWindowMapState(window.getWindow()) != XlibWrapper.IsUnmapped) {
+ if (XlibUtil.getWindowMapState(window.getWindow()) != IsUnmapped) {
throw new RuntimeException("Client has been mapped");
}
}
@@ -613,12 +613,12 @@
}
}
private void checkMapped() {
- if (XlibUtil.getWindowMapState(window.getWindow()) == XlibWrapper.IsUnmapped) {
+ if (XlibUtil.getWindowMapState(window.getWindow()) == IsUnmapped) {
throw new RuntimeException("Client is not mapped");
}
}
private void checkNotMapped() {
- if (XlibUtil.getWindowMapState(window.getWindow()) != XlibWrapper.IsUnmapped) {
+ if (XlibUtil.getWindowMapState(window.getWindow()) != IsUnmapped) {
throw new RuntimeException("Client is mapped");
}
}
--- a/jdk/src/solaris/classes/sun/awt/X11/XEmbeddedFramePeer.java Mon Apr 07 14:53:51 2008 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XEmbeddedFramePeer.java Mon Apr 07 16:52:51 2008 +0400
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2007 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2002-2008 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -114,8 +114,8 @@
protected boolean isEventDisabled(XEvent e) {
if (embedder != null && embedder.isActive()) {
switch (e.get_type()) {
- case FocusIn:
- case FocusOut:
+ case XConstants.FocusIn:
+ case XConstants.FocusOut:
return true;
}
}
--- a/jdk/src/solaris/classes/sun/awt/X11/XEmbeddingContainer.java Mon Apr 07 14:53:51 2008 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XEmbeddingContainer.java Mon Apr 07 16:52:51 2008 +0400
@@ -1,5 +1,5 @@
/*
- * Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2003-2008 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -121,7 +121,7 @@
}
public void dispatchEvent(XEvent xev) {
switch(xev.get_type()) {
- case XlibWrapper.ClientMessage:
+ case XConstants.ClientMessage:
handleClientMessage(xev);
break;
}
@@ -149,7 +149,7 @@
ke.set_window(child);
XToolkit.awtLock();
try {
- XlibWrapper.XSendEvent(XToolkit.getDisplay(), child, false, XlibWrapper.NoEventMask, data);
+ XlibWrapper.XSendEvent(XToolkit.getDisplay(), child, false, XConstants.NoEventMask, data);
}
finally {
XToolkit.awtUnlock();
--- a/jdk/src/solaris/classes/sun/awt/X11/XFocusProxyWindow.java Mon Apr 07 14:53:51 2008 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XFocusProxyWindow.java Mon Apr 07 16:52:51 2008 +0400
@@ -1,5 +1,5 @@
/*
- * Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2003-2008 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -41,7 +41,7 @@
super(new XCreateWindowParams(new Object[] {
BOUNDS, new Rectangle(-1, -1, 1, 1),
PARENT_WINDOW, new Long(owner.getWindow()),
- EVENT_MASK, new Long(FocusChangeMask | KeyPressMask | KeyReleaseMask)
+ EVENT_MASK, new Long(XConstants.FocusChangeMask | XConstants.KeyPressMask | XConstants.KeyReleaseMask)
}));
this.owner = owner;
}
@@ -67,8 +67,8 @@
int type = ev.get_type();
switch (type)
{
- case XlibWrapper.FocusIn:
- case XlibWrapper.FocusOut:
+ case XConstants.FocusIn:
+ case XConstants.FocusOut:
handleFocusEvent(ev);
break;
}
--- a/jdk/src/solaris/classes/sun/awt/X11/XFramePeer.java Mon Apr 07 14:53:51 2008 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XFramePeer.java Mon Apr 07 16:52:51 2008 +0400
@@ -37,7 +37,7 @@
import java.util.logging.Level;
import java.util.logging.Logger;
-class XFramePeer extends XDecoratedPeer implements FramePeer, XConstants {
+class XFramePeer extends XDecoratedPeer implements FramePeer {
private static Logger log = Logger.getLogger("sun.awt.X11.XFramePeer");
private static Logger stateLog = Logger.getLogger("sun.awt.X11.states");
private static Logger insLog = Logger.getLogger("sun.awt.X11.insets.XFramePeer");
@@ -71,7 +71,7 @@
} else {
winAttr.decorations = winAttr.AWT_DECOR_NONE;
}
- winAttr.functions = MWM_FUNC_ALL;
+ winAttr.functions = MWMConstants.MWM_FUNC_ALL;
winAttr.isResizable = true; // target.isResizable();
winAttr.title = target.getTitle();
winAttr.initialResizability = target.isResizable();
@@ -109,9 +109,9 @@
state = winAttr.initialState;
}
if ((state & Frame.ICONIFIED) != 0) {
- setInitialState(IconicState);
+ setInitialState(XUtilConstants.IconicState);
} else {
- setInitialState(NormalState);
+ setInitialState(XUtilConstants.NormalState);
}
setExtendedState(state);
}
@@ -221,7 +221,7 @@
XToolkit.awtLock();
try {
XSizeHints hints = getHints();
- hints.set_flags(hints.get_flags() | (int)XlibWrapper.PMaxSize);
+ hints.set_flags(hints.get_flags() | (int)XUtilConstants.PMaxSize);
if (b.width != Integer.MAX_VALUE) {
hints.set_max_width(b.width);
} else {
@@ -344,7 +344,7 @@
XToolkit.awtLock();
try {
XWMHints hints = getWMHints();
- hints.set_flags((int)XlibWrapper.StateHint | hints.get_flags());
+ hints.set_flags((int)XUtilConstants.StateHint | hints.get_flags());
hints.set_initial_state(wm_state);
if (stateLog.isLoggable(Level.FINE)) stateLog.fine("Setting initial WM state on " + this + " to " + wm_state);
XlibWrapper.XSetWMHints(XToolkit.getDisplay(), getWindow(), hints.pData);
--- a/jdk/src/solaris/classes/sun/awt/X11/XGlobalCursorManager.java Mon Apr 07 14:53:51 2008 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XGlobalCursorManager.java Mon Apr 07 16:52:51 2008 +0400
@@ -1,5 +1,5 @@
/*
- * Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2003-2008 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -229,46 +229,46 @@
int cursorType = 0;
switch (type) {
case Cursor.DEFAULT_CURSOR:
- cursorType = XlibWrapper.XC_left_ptr;
+ cursorType = XCursorFontConstants.XC_left_ptr;
break;
case Cursor.CROSSHAIR_CURSOR:
- cursorType = XlibWrapper.XC_crosshair;
+ cursorType = XCursorFontConstants.XC_crosshair;
break;
case Cursor.TEXT_CURSOR:
- cursorType = XlibWrapper.XC_xterm;
+ cursorType = XCursorFontConstants.XC_xterm;
break;
case Cursor.WAIT_CURSOR:
- cursorType = XlibWrapper.XC_watch;
+ cursorType = XCursorFontConstants.XC_watch;
break;
case Cursor.SW_RESIZE_CURSOR:
- cursorType = XlibWrapper.XC_bottom_left_corner;
+ cursorType = XCursorFontConstants.XC_bottom_left_corner;
break;
case Cursor.NW_RESIZE_CURSOR:
- cursorType = XlibWrapper.XC_top_left_corner;
+ cursorType = XCursorFontConstants.XC_top_left_corner;
break;
case Cursor.SE_RESIZE_CURSOR:
- cursorType = XlibWrapper.XC_bottom_right_corner;
+ cursorType = XCursorFontConstants.XC_bottom_right_corner;
break;
case Cursor.NE_RESIZE_CURSOR:
- cursorType = XlibWrapper.XC_top_right_corner;
+ cursorType = XCursorFontConstants.XC_top_right_corner;
break;
case Cursor.S_RESIZE_CURSOR:
- cursorType = XlibWrapper.XC_bottom_side;
+ cursorType = XCursorFontConstants.XC_bottom_side;
break;
case Cursor.N_RESIZE_CURSOR:
- cursorType = XlibWrapper.XC_top_side;
+ cursorType = XCursorFontConstants.XC_top_side;
break;
case Cursor.W_RESIZE_CURSOR:
- cursorType = XlibWrapper.XC_left_side;
+ cursorType = XCursorFontConstants.XC_left_side;
break;
case Cursor.E_RESIZE_CURSOR:
- cursorType = XlibWrapper.XC_right_side;
+ cursorType = XCursorFontConstants.XC_right_side;
break;
case Cursor.HAND_CURSOR:
- cursorType = XlibWrapper.XC_hand2;
+ cursorType = XCursorFontConstants.XC_hand2;
break;
case Cursor.MOVE_CURSOR:
- cursorType = XlibWrapper.XC_fleur;
+ cursorType = XCursorFontConstants.XC_fleur;
break;
}
--- a/jdk/src/solaris/classes/sun/awt/X11/XIconWindow.java Mon Apr 07 14:53:51 2008 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XIconWindow.java Mon Apr 07 16:52:51 2008 +0400
@@ -1,5 +1,5 @@
/*
- * Copyright 2003-2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2003-2008 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -293,7 +293,7 @@
long dst = XlibWrapper.XCreateImage(XToolkit.getDisplay(),
visInfo.get_visual(),
(int)awtImage.get_Depth(),
- (int)XlibWrapper.ZPixmap,
+ (int)XConstants.ZPixmap,
0,
bytes,
iconWidth,
@@ -470,9 +470,9 @@
params.add(BACKGROUND_PIXMAP, iconPixmap);
params.add(COLORMAP, adata.get_awt_cmap());
params.add(DEPTH, awtImage.get_Depth());
- params.add(VISUAL_CLASS, (int)XlibWrapper.InputOutput);
+ params.add(VISUAL_CLASS, (int)XConstants.InputOutput);
params.add(VISUAL, visInfo.get_visual());
- params.add(VALUE_MASK, XlibWrapper.CWBorderPixel | XlibWrapper.CWColormap | XlibWrapper.CWBackPixmap);
+ params.add(VALUE_MASK, XConstants.CWBorderPixel | XConstants.CWColormap | XConstants.CWBackPixmap);
params.add(PARENT_WINDOW, XlibWrapper.RootWindow(XToolkit.getDisplay(), visInfo.get_screen()));
params.add(BOUNDS, new Rectangle(0, 0, iconWidth, iconHeight));
params.remove(DELAYED);
@@ -488,9 +488,9 @@
XlibWrapper.XClearWindow(XToolkit.getDisplay(), getWindow());
}
// Provide both pixmap and window, WM or Taskbar will use the one they find more appropriate
- long newFlags = hints.get_flags() | XlibWrapper.IconPixmapHint | XlibWrapper.IconMaskHint;
+ long newFlags = hints.get_flags() | XUtilConstants.IconPixmapHint | XUtilConstants.IconMaskHint;
if (getWindow() != 0) {
- newFlags |= XlibWrapper.IconWindowHint;
+ newFlags |= XUtilConstants.IconWindowHint;
}
hints.set_flags(newFlags);
hints.set_icon_pixmap(iconPixmap);
--- a/jdk/src/solaris/classes/sun/awt/X11/XMSelection.java Mon Apr 07 14:53:51 2008 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XMSelection.java Mon Apr 07 16:52:51 2008 +0400
@@ -1,5 +1,5 @@
/*
- * Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2003-2008 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -98,7 +98,7 @@
XToolkit.awtLock();
try {
long root = XlibWrapper.RootWindow(display,screen);
- XlibWrapper.XSelectInput(display, root, XlibWrapper.StructureNotifyMask);
+ XlibWrapper.XSelectInput(display, root, XConstants.StructureNotifyMask);
XToolkit.addEventDispatcher(root,
new XEventDispatcher() {
public void dispatchEvent(XEvent ev) {
@@ -130,7 +130,7 @@
synchronized(this) {
setOwner(owner, screen);
if (log.isLoggable(Level.FINE)) log.fine("New Selection Owner for screen " + screen + " = " + owner );
- XlibWrapper.XSelectInput(display, owner, XlibWrapper.StructureNotifyMask | eventMask);
+ XlibWrapper.XSelectInput(display, owner, XConstants.StructureNotifyMask | eventMask);
XToolkit.addEventDispatcher(owner,
new XEventDispatcher() {
public void dispatchEvent(XEvent ev) {
@@ -162,7 +162,7 @@
if (owner != 0) {
setOwner(owner, screen);
if (log.isLoggable(Level.FINE)) log.fine("Selection Owner for screen " + screen + " = " + owner );
- XlibWrapper.XSelectInput(display, owner, XlibWrapper.StructureNotifyMask | extra_mask);
+ XlibWrapper.XSelectInput(display, owner, XConstants.StructureNotifyMask | extra_mask);
XToolkit.addEventDispatcher(owner,
new XEventDispatcher() {
public void dispatchEvent(XEvent ev) {
@@ -205,7 +205,7 @@
static boolean processRootEvent(XEvent xev, int screen) {
switch (xev.get_type()) {
- case XlibWrapper.ClientMessage: {
+ case XConstants.ClientMessage: {
return processClientMessage(xev, screen);
}
}
@@ -225,7 +225,7 @@
*/
public XMSelection (String selname) {
- this(selname, XlibWrapper.PropertyChangeMask);
+ this(selname, XConstants.PropertyChangeMask);
}
@@ -319,11 +319,11 @@
void dispatchSelectionEvent(XEvent xev, int screen) {
if (log.isLoggable(Level.FINE)) log.fine("Event =" + xev);
- if (xev.get_type() == XlibWrapper.DestroyNotify) {
+ if (xev.get_type() == XConstants.DestroyNotify) {
XDestroyWindowEvent de = xev.get_xdestroywindow();
dispatchOwnerDeath( de, screen);
}
- else if (xev.get_type() == XlibWrapper.PropertyNotify) {
+ else if (xev.get_type() == XConstants.PropertyNotify) {
XPropertyEvent xpe = xev.get_xproperty();
dispatchSelectionChanged( xpe, screen);
}
--- a/jdk/src/solaris/classes/sun/awt/X11/XNETProtocol.java Mon Apr 07 14:53:51 2008 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XNETProtocol.java Mon Apr 07 16:52:51 2008 +0400
@@ -99,7 +99,7 @@
return;
}
if (log.isLoggable(Level.FINE)) log.fine("Requesting state on " + window + " for " + state);
- req.set_type((int)XlibWrapper.ClientMessage);
+ req.set_type((int)XConstants.ClientMessage);
req.set_window(window.getWindow());
req.set_message_type(XA_NET_WM_STATE.getAtom());
req.set_format(32);
@@ -109,7 +109,7 @@
XlibWrapper.XSendEvent(XToolkit.getDisplay(),
XlibWrapper.RootWindow(XToolkit.getDisplay(), window.getScreenNumber()),
false,
- XlibWrapper.SubstructureRedirectMask | XlibWrapper.SubstructureNotifyMask,
+ XConstants.SubstructureRedirectMask | XConstants.SubstructureNotifyMask,
req.pData);
}
finally {
@@ -183,7 +183,7 @@
if (window.isShowing()) {
XClientMessageEvent req = new XClientMessageEvent();
try {
- req.set_type((int)XlibWrapper.ClientMessage);
+ req.set_type((int)XConstants.ClientMessage);
req.set_window(window.getWindow());
req.set_message_type(XA_NET_WM_STATE.getAtom());
req.set_format(32);
@@ -195,7 +195,7 @@
XlibWrapper.XSendEvent(XToolkit.getDisplay(),
XlibWrapper.RootWindow(XToolkit.getDisplay(), window.getScreenNumber()),
false,
- XlibWrapper.SubstructureRedirectMask | XlibWrapper.SubstructureNotifyMask,
+ XConstants.SubstructureRedirectMask | XConstants.SubstructureNotifyMask,
req.pData);
}
finally {
--- a/jdk/src/solaris/classes/sun/awt/X11/XProtocol.java Mon Apr 07 14:53:51 2008 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XProtocol.java Mon Apr 07 16:52:51 2008 +0400
@@ -1,5 +1,5 @@
/*
- * Copyright 2003-2005 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2003-2008 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -42,7 +42,7 @@
static XToolkit.XErrorHandler VerifyChangePropertyHandler = new XToolkit.XErrorHandler() {
public int handleError(long display, XErrorEvent err) {
XToolkit.XERROR_SAVE(err);
- if (err.get_request_code() == XlibWrapper.X_ChangeProperty) {
+ if (err.get_request_code() == XProtocolConstants.X_ChangeProperty) {
return 0;
} else {
return XToolkit.SAVED_ERROR_HANDLER(display, err);
--- a/jdk/src/solaris/classes/sun/awt/X11/XProtocolConstants.java Mon Apr 07 14:53:51 2008 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XProtocolConstants.java Mon Apr 07 16:52:51 2008 +0400
@@ -1,5 +1,5 @@
/*
- * Copyright 2003 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2003-2008 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,10 @@
package sun.awt.X11;
-public interface XProtocolConstants {
+final public class XProtocolConstants {
+
+ private XProtocolConstants(){}
+
/* Reply codes */
public static final int X_Reply = 1 ; /* Normal reply */
public static final int X_Error = 0 ; /* Error */
--- a/jdk/src/solaris/classes/sun/awt/X11/XSelection.java Mon Apr 07 14:53:51 2008 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XSelection.java Mon Apr 07 16:52:51 2008 +0400
@@ -141,7 +141,7 @@
long selection = selectionAtom.getAtom();
// ICCCM prescribes that CurrentTime should not be used for SetSelectionOwner.
- if (time == XlibWrapper.CurrentTime) {
+ if (time == XConstants.CurrentTime) {
time = XToolkit.getCurrentServerTime();
}
@@ -199,7 +199,7 @@
WindowPropertyGetter targetsGetter =
new WindowPropertyGetter(XWindow.getXAWTRootWindow().getWindow(),
selectionPropertyAtom, 0, MAX_LENGTH,
- true, XlibWrapper.AnyPropertyType);
+ true, XConstants.AnyPropertyType);
try {
XToolkit.awtLock();
@@ -274,7 +274,7 @@
new WindowPropertyGetter(XWindow.getXAWTRootWindow().getWindow(),
selectionPropertyAtom, 0, MAX_LENGTH,
false, // don't delete to handle INCR properly.
- XlibWrapper.AnyPropertyType);
+ XConstants.AnyPropertyType);
try {
XToolkit.awtLock();
@@ -353,7 +353,7 @@
new WindowPropertyGetter(XWindow.getXAWTRootWindow().getWindow(),
selectionPropertyAtom,
0, MAX_LENGTH, false,
- XlibWrapper.AnyPropertyType);
+ XConstants.AnyPropertyType);
try {
XToolkit.awtLock();
@@ -520,7 +520,7 @@
try {
XlibWrapper.XChangeProperty(XToolkit.getDisplay(), requestor, property,
format, dataFormat,
- XlibWrapper.PropModeReplace,
+ XConstants.PropModeReplace,
nativeDataPtr, count);
} finally {
XToolkit.awtUnlock();
@@ -543,14 +543,14 @@
boolean conversionSucceeded = false;
if (ownershipTime != 0 &&
- (requestTime == XlibWrapper.CurrentTime || requestTime >= ownershipTime))
+ (requestTime == XConstants.CurrentTime || requestTime >= ownershipTime))
{
// Handle MULTIPLE requests as per ICCCM.
if (format == XDataTransferer.MULTIPLE_ATOM.getAtom()) {
conversionSucceeded = handleMultipleRequest(requestor, property);
} else {
// Support for obsolete clients as per ICCCM.
- if (property == XlibWrapper.None) {
+ if (property == XConstants.None) {
property = format;
}
@@ -564,12 +564,12 @@
if (!conversionSucceeded) {
// None property indicates conversion failure.
- property = XlibWrapper.None;
+ property = XConstants.None;
}
XSelectionEvent xse = new XSelectionEvent();
try {
- xse.set_type(XlibWrapper.SelectionNotify);
+ xse.set_type(XConstants.SelectionNotify);
xse.set_send_event(true);
xse.set_requestor(requestor);
xse.set_selection(selectionAtom.getAtom());
@@ -580,7 +580,7 @@
XToolkit.awtLock();
try {
XlibWrapper.XSendEvent(XToolkit.getDisplay(), requestor, false,
- XlibWrapper.NoEventMask, xse.pData);
+ XConstants.NoEventMask, xse.pData);
} finally {
XToolkit.awtUnlock();
}
@@ -590,7 +590,7 @@
}
private boolean handleMultipleRequest(final long requestor, long property) {
- if (XlibWrapper.None == property) {
+ if (XConstants.None == property) {
// The property cannot be None for a MULTIPLE request.
return false;
}
@@ -601,7 +601,7 @@
WindowPropertyGetter wpg =
new WindowPropertyGetter(requestor, XAtom.get(property),
0, MAX_LENGTH, false,
- XlibWrapper.AnyPropertyType);
+ XConstants.AnyPropertyType);
try {
wpg.execute();
@@ -629,7 +629,7 @@
property,
wpg.getActualType(),
wpg.getActualFormat(),
- XlibWrapper.PropModeReplace,
+ XConstants.PropModeReplace,
wpg.getData(),
wpg.getNumberOfItems());
} finally {
@@ -673,7 +673,7 @@
try {
XlibWrapper.XChangeProperty(XToolkit.getDisplay(), requestor,
property, XAtom.XA_ATOM, dataFormat,
- XlibWrapper.PropModeReplace,
+ XConstants.PropModeReplace,
nativeDataPtr, count);
} finally {
XToolkit.awtUnlock();
@@ -712,7 +712,7 @@
private static class SelectionEventHandler implements XEventDispatcher {
public void dispatchEvent(XEvent ev) {
switch (ev.get_type()) {
- case XlibWrapper.SelectionNotify: {
+ case XConstants.SelectionNotify: {
XToolkit.awtLock();
try {
XSelectionEvent xse = ev.get_xselection();
@@ -733,7 +733,7 @@
}
break;
}
- case XlibWrapper.SelectionRequest: {
+ case XConstants.SelectionRequest: {
XSelectionRequestEvent xsre = ev.get_xselectionrequest();
long atom = xsre.get_selection();
XSelection selection = XSelection.getSelection(XAtom.get(atom));
@@ -743,7 +743,7 @@
}
break;
}
- case XlibWrapper.SelectionClear: {
+ case XConstants.SelectionClear: {
XSelectionClearEvent xsce = ev.get_xselectionclear();
long atom = xsce.get_selection();
XSelection selection = XSelection.getSelection(XAtom.get(atom));
@@ -793,7 +793,7 @@
wattr.pData);
XlibWrapper.XSelectInput(XToolkit.getDisplay(), requestor,
wattr.get_your_event_mask() |
- XlibWrapper.PropertyChangeMask);
+ XConstants.PropertyChangeMask);
} finally {
XToolkit.awtUnlock();
}
@@ -805,10 +805,10 @@
public void dispatchEvent(XEvent ev) {
switch (ev.get_type()) {
- case XlibWrapper.PropertyNotify:
+ case XConstants.PropertyNotify:
XPropertyEvent xpe = ev.get_xproperty();
if (xpe.get_window() == requestor &&
- xpe.get_state() == XlibWrapper.PropertyDelete &&
+ xpe.get_state() == XConstants.PropertyDelete &&
xpe.get_atom() == property) {
int count = data.length - offset;
@@ -834,7 +834,7 @@
XlibWrapper.XChangeProperty(XToolkit.getDisplay(),
requestor, property,
target, format,
- XlibWrapper.PropModeReplace,
+ XConstants.PropModeReplace,
nativeDataPtr, count);
} finally {
XToolkit.awtUnlock();
@@ -853,9 +853,9 @@
private static class IncrementalTransferHandler implements XEventDispatcher {
public void dispatchEvent(XEvent ev) {
switch (ev.get_type()) {
- case XlibWrapper.PropertyNotify:
+ case XConstants.PropertyNotify:
XPropertyEvent xpe = ev.get_xproperty();
- if (xpe.get_state() == XlibWrapper.PropertyNewValue &&
+ if (xpe.get_state() == XConstants.PropertyNewValue &&
xpe.get_atom() == selectionPropertyAtom.getAtom()) {
XToolkit.awtLock();
try {
--- a/jdk/src/solaris/classes/sun/awt/X11/XSystemTrayPeer.java Mon Apr 07 14:53:51 2008 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XSystemTrayPeer.java Mon Apr 07 16:52:51 2008 +0400
@@ -1,5 +1,5 @@
/*
- * Copyright 2005-2007 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2008 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -131,7 +131,7 @@
XClientMessageEvent xev = new XClientMessageEvent();
try {
- xev.set_type(XlibWrapper.ClientMessage);
+ xev.set_type(XConstants.ClientMessage);
xev.set_window(win);
xev.set_format(32);
xev.set_message_type(_NET_SYSTEM_TRAY_OPCODE.getAtom());
@@ -144,7 +144,7 @@
XToolkit.awtLock();
try {
XlibWrapper.XSendEvent(XToolkit.getDisplay(), win, false,
- XlibWrapper.NoEventMask, xev.pData);
+ XConstants.NoEventMask, xev.pData);
} finally {
XToolkit.awtUnlock();
}
--- a/jdk/src/solaris/classes/sun/awt/X11/XToolkit.java Mon Apr 07 14:53:51 2008 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XToolkit.java Mon Apr 07 16:52:51 2008 +0400
@@ -54,8 +54,7 @@
import sun.misc.PerformanceLogger;
import sun.print.PrintJob2D;
-public final class XToolkit extends UNIXToolkit implements Runnable, XConstants
-{
+public final class XToolkit extends UNIXToolkit implements Runnable {
private static Logger log = Logger.getLogger("sun.awt.X11.XToolkit");
private static Logger eventLog = Logger.getLogger("sun.awt.X11.event.XToolkit");
private static final Logger timeoutTaskLog = Logger.getLogger("sun.awt.X11.timeoutTask.XToolkit");
@@ -169,7 +168,7 @@
static XErrorHandler IgnoreBadWindowHandler = new XErrorHandler() {
public int handleError(long display, XErrorEvent err) {
XERROR_SAVE(err);
- if (err.get_error_code() == BadWindow) {
+ if (err.get_error_code() == XConstants.BadWindow) {
return 0;
} else {
return SAVED_ERROR_HANDLER(display, err);
@@ -425,7 +424,7 @@
// Only our windows guaranteely generate MotionNotify, so we
// should track enter/leave, to catch the moment when to
// switch to XQueryPointer
- if (e.get_type() == MotionNotify) {
+ if (e.get_type() == XConstants.MotionNotify) {
XMotionEvent ev = e.get_xmotion();
awtLock();
try {
@@ -437,7 +436,7 @@
} finally {
awtUnlock();
}
- } else if (e.get_type() == LeaveNotify) {
+ } else if (e.get_type() == XConstants.LeaveNotify) {
// Leave from our window
awtLock();
try {
@@ -445,7 +444,7 @@
} finally {
awtUnlock();
}
- } else if (e.get_type() == EnterNotify) {
+ } else if (e.get_type() == XConstants.EnterNotify) {
// Entrance into our window
XCrossingEvent ev = e.get_xcrossing();
awtLock();
@@ -492,7 +491,7 @@
final XAnyEvent xany = ev.get_xany();
if (windowToXWindow(xany.get_window()) != null &&
- (ev.get_type() == MotionNotify || ev.get_type() == EnterNotify || ev.get_type() == LeaveNotify))
+ (ev.get_type() == XConstants.MotionNotify || ev.get_type() == XConstants.EnterNotify || ev.get_type() == XConstants.LeaveNotify))
{
processGlobalMotionEvent(ev);
}
@@ -549,15 +548,15 @@
// If no events are queued, waitForEvents() causes calls to
// awtUnlock(), awtJNI_ThreadYield, poll, awtLock(),
// so it spends most of its time in poll, without holding the lock.
- while ((XlibWrapper.XEventsQueued(getDisplay(), XlibWrapper.QueuedAfterReading) == 0) &&
- (XlibWrapper.XEventsQueued(getDisplay(), XlibWrapper.QueuedAfterFlush) == 0)) {
+ while ((XlibWrapper.XEventsQueued(getDisplay(), XConstants.QueuedAfterReading) == 0) &&
+ (XlibWrapper.XEventsQueued(getDisplay(), XConstants.QueuedAfterFlush) == 0)) {
callTimeoutTasks();
waitForEvents(getNextTaskTime());
}
XlibWrapper.XNextEvent(getDisplay(),ev.pData);
}
- if (ev.get_type() != NoExpose) {
+ if (ev.get_type() != XConstants.NoExpose) {
eventNumber++;
}
@@ -582,13 +581,13 @@
}
}
}
- if( keyEventLog.isLoggable(Level.FINE) && (ev.get_type() == KeyPress || ev.get_type() == KeyRelease) ) {
+ if( keyEventLog.isLoggable(Level.FINE) && (ev.get_type() == XConstants.KeyPress || ev.get_type() == XConstants.KeyRelease) ) {
keyEventLog.fine("before XFilterEvent:"+ev);
}
if (XlibWrapper.XFilterEvent(ev.getPData(), w)) {
continue;
}
- if( keyEventLog.isLoggable(Level.FINE) && (ev.get_type() == KeyPress || ev.get_type() == KeyRelease) ) {
+ if( keyEventLog.isLoggable(Level.FINE) && (ev.get_type() == XConstants.KeyPress || ev.get_type() == XConstants.KeyRelease) ) {
keyEventLog.fine("after XFilterEvent:"+ev); // IS THIS CORRECT?
}
@@ -750,7 +749,7 @@
* _NET_WM_STRUT[_PARTIAL] hints for iconified windows
* are not included to the screen insets.
*/
- if (XlibUtil.getWindowMapState(window) == XlibWrapper.IsUnmapped)
+ if (XlibUtil.getWindowMapState(window) == XConstants.IsUnmapped)
{
continue;
}
@@ -1289,7 +1288,7 @@
new XEventDispatcher() {
public void dispatchEvent(XEvent ev) {
switch (ev.get_type()) {
- case PropertyNotify:
+ case XConstants.PropertyNotify:
XPropertyEvent xpe = ev.get_xproperty();
awtLock();
@@ -1322,7 +1321,7 @@
XlibWrapper.XChangeProperty(XToolkit.getDisplay(),
XBaseWindow.getXAWTRootWindow().getWindow(),
_XA_JAVA_TIME_PROPERTY_ATOM.getAtom(), XAtom.XA_ATOM, 32,
- PropModeAppend,
+ XConstants.PropModeAppend,
0, 0);
XlibWrapper.XFlush(XToolkit.getDisplay());
@@ -1539,8 +1538,8 @@
final int shiftLock = keysymToPrimaryKeycode(XKeySymConstants.XK_Shift_Lock);
final int capsLock = keysymToPrimaryKeycode(XKeySymConstants.XK_Caps_Lock);
- final int modmask[] = { ShiftMask, LockMask, ControlMask, Mod1Mask,
- Mod2Mask, Mod3Mask, Mod4Mask, Mod5Mask };
+ final int modmask[] = { XConstants.ShiftMask, XConstants.LockMask, XConstants.ControlMask, XConstants.Mod1Mask,
+ XConstants.Mod2Mask, XConstants.Mod3Mask, XConstants.Mod4Mask, XConstants.Mod5Mask };
log.fine("In setupModifierMap");
awtLock();
@@ -2047,7 +2046,7 @@
if (oops_waiter == null) {
oops_waiter = new XEventDispatcher() {
public void dispatchEvent(XEvent e) {
- if (e.get_type() == SelectionNotify) {
+ if (e.get_type() == XConstants.SelectionNotify) {
XSelectionEvent pe = e.get_xselection();
if (pe.get_property() == oops.getAtom()) {
oops_updated = true;
@@ -2083,7 +2082,7 @@
eventLog.log(Level.FINER, "WM_S0 selection owner {0}", new Object[] {XlibWrapper.XGetSelectionOwner(getDisplay(), atom.getAtom())});
XlibWrapper.XConvertSelection(getDisplay(), atom.getAtom(),
XAtom.get("VERSION").getAtom(), oops.getAtom(),
- win.getWindow(), XlibWrapper.CurrentTime);
+ win.getWindow(), XConstants.CurrentTime);
XSync();
--- a/jdk/src/solaris/classes/sun/awt/X11/XTrayIconPeer.java Mon Apr 07 14:53:51 2008 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XTrayIconPeer.java Mon Apr 07 16:52:51 2008 +0400
@@ -98,7 +98,7 @@
parentXED = new XEventDispatcher() {
// It's executed under AWTLock.
public void dispatchEvent(XEvent ev) {
- if (isDisposed() || ev.get_type() != XlibWrapper.ConfigureNotify) {
+ if (isDisposed() || ev.get_type() != XConstants.ConfigureNotify) {
return;
}
@@ -194,7 +194,7 @@
XTrayIconPeer xtiPeer = XTrayIconPeer.this;
public void dispatchEvent(XEvent ev) {
- if (isDisposed() || ev.get_type() != XlibWrapper.ReparentNotify) {
+ if (isDisposed() || ev.get_type() != XConstants.ReparentNotify) {
return;
}
@@ -214,7 +214,7 @@
}
if (!isTrayIconDisplayed) {
- addXED(eframeParentID, parentXED, XlibWrapper.StructureNotifyMask);
+ addXED(eframeParentID, parentXED, XConstants.StructureNotifyMask);
isTrayIconDisplayed = true;
XToolkit.awtLockNotifyAll();
@@ -222,7 +222,7 @@
}
};
- addXED(getWindow(), eframeXED, XlibWrapper.StructureNotifyMask);
+ addXED(getWindow(), eframeXED, XConstants.StructureNotifyMask);
XSystemTrayPeer.getPeerInstance().addTrayIcon(this); // throws AWTException
--- a/jdk/src/solaris/classes/sun/awt/X11/XUtilConstants.java Mon Apr 07 14:53:51 2008 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XUtilConstants.java Mon Apr 07 16:52:51 2008 +0400
@@ -1,5 +1,5 @@
/*
- * Copyright 2003 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2003-2008 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,10 @@
package sun.awt.X11;
-public interface XUtilConstants {
+final public class XUtilConstants {
+
+ private XUtilConstants(){}
+
/*
* Bitmask returned by XParseGeometry(). Each bit tells if the corresponding
* value (x, y, width, height) was found in the parsed string.
--- a/jdk/src/solaris/classes/sun/awt/X11/XWINProtocol.java Mon Apr 07 14:53:51 2008 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XWINProtocol.java Mon Apr 07 16:52:51 2008 +0400
@@ -1,5 +1,5 @@
/*
- * Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2003-2008 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -58,7 +58,7 @@
}
XClientMessageEvent req = new XClientMessageEvent();
- req.set_type(XlibWrapper.ClientMessage);
+ req.set_type(XConstants.ClientMessage);
req.set_window(window.getWindow());
req.set_message_type(XA_WIN_STATE.getAtom());
req.set_format(32);
@@ -71,7 +71,7 @@
XlibWrapper.RootWindow(XToolkit.getDisplay(),
window.getScreenNumber()),
false,
- XlibWrapper.SubstructureRedirectMask | XlibWrapper.SubstructureNotifyMask,
+ XConstants.SubstructureRedirectMask | XConstants.SubstructureNotifyMask,
req.pData);
}
finally {
@@ -150,7 +150,7 @@
public void setLayer(XWindowPeer window, int layer) {
if (window.isShowing()) {
XClientMessageEvent req = new XClientMessageEvent();
- req.set_type(XlibWrapper.ClientMessage);
+ req.set_type(XConstants.ClientMessage);
req.set_window(window.getWindow());
req.set_message_type(XA_WIN_LAYER.getAtom());
req.set_format(32);
@@ -164,7 +164,7 @@
XlibWrapper.RootWindow(XToolkit.getDisplay(),
window.getScreenNumber()),
false,
- /*XlibWrapper.SubstructureRedirectMask | */XlibWrapper.SubstructureNotifyMask,
+ /*XConstants.SubstructureRedirectMask | */XConstants.SubstructureNotifyMask,
req.pData);
}
finally {
--- a/jdk/src/solaris/classes/sun/awt/X11/XWM.java Mon Apr 07 14:53:51 2008 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XWM.java Mon Apr 07 16:52:51 2008 +0400
@@ -46,7 +46,7 @@
* Class incapsulating knowledge about window managers in general
* Descendants should provide some information about specific window manager.
*/
-final class XWM implements MWMConstants, XUtilConstants
+final class XWM
{
private final static Logger log = Logger.getLogger("sun.awt.X11.XWM");
@@ -274,12 +274,12 @@
}
winmgr_running = false;
- substruct.set_event_mask(XlibWrapper.SubstructureRedirectMask);
+ substruct.set_event_mask(XConstants.SubstructureRedirectMask);
XToolkit.WITH_XERROR_HANDLER(DetectWMHandler);
XlibWrapper.XChangeWindowAttributes(XToolkit.getDisplay(),
XToolkit.getDefaultRootWindow(),
- XlibWrapper.CWEventMask,
+ XConstants.CWEventMask,
substruct.pData);
XToolkit.RESTORE_XERROR_HANDLER();
@@ -291,7 +291,7 @@
substruct.set_event_mask(0);
XlibWrapper.XChangeWindowAttributes(XToolkit.getDisplay(),
XToolkit.getDefaultRootWindow(),
- XlibWrapper.CWEventMask,
+ XConstants.CWEventMask,
substruct.pData);
if (insLog.isLoggable(Level.FINE)) {
insLog.finer("It looks like there is no WM thus NO_WM");
@@ -322,7 +322,7 @@
XAtom.XA_STRING);
try {
int status = getter.execute(XToolkit.IgnoreBadWindowHandler);
- if (status != XlibWrapper.Success || getter.getData() == 0) {
+ if (status != XConstants.Success || getter.getData() == 0) {
return 0;
}
@@ -411,7 +411,7 @@
false, XA_DT_SM_WINDOW_INFO);
try {
int status = getter.execute();
- if (status != XlibWrapper.Success || getter.getData() == 0) {
+ if (status != XConstants.Success || getter.getData() == 0) {
log.finer("Getting of _DT_SM_WINDOW_INFO is not successfull");
return false;
}
@@ -442,7 +442,7 @@
status = getter2.execute(XToolkit.IgnoreBadWindowHandler);
- if (status != XlibWrapper.Success || getter2.getData() == 0) {
+ if (status != XConstants.Success || getter2.getData() == 0) {
log.finer("Getting of _DT_SM_STATE_INFO is not successfull");
return false;
}
@@ -480,18 +480,18 @@
WindowPropertyGetter getter =
new WindowPropertyGetter(XToolkit.getDefaultRootWindow(),
XA_MOTIF_WM_INFO, 0,
- PROP_MOTIF_WM_INFO_ELEMENTS,
+ MWMConstants.PROP_MOTIF_WM_INFO_ELEMENTS,
false, XA_MOTIF_WM_INFO);
try {
int status = getter.execute();
- if (status != XlibWrapper.Success || getter.getData() == 0) {
+ if (status != XConstants.Success || getter.getData() == 0) {
return false;
}
if (getter.getActualType() != XA_MOTIF_WM_INFO.getAtom()
|| getter.getActualFormat() != 32
- || getter.getNumberOfItems() != PROP_MOTIF_WM_INFO_ELEMENTS
+ || getter.getNumberOfItems() != MWMConstants.PROP_MOTIF_WM_INFO_ELEMENTS
|| getter.getBytesAfter() != 0)
{
return false;
@@ -516,7 +516,7 @@
0, 1, false,
XA_WM_STATE);
try {
- if (state_getter.execute() == XlibWrapper.Success &&
+ if (state_getter.execute() == XConstants.Success &&
state_getter.getData() != 0 &&
state_getter.getActualType() == XA_WM_STATE.getAtom())
{
@@ -577,7 +577,7 @@
static XToolkit.XErrorHandler VerifyChangePropertyHandler = new XToolkit.XErrorHandler() {
public int handleError(long display, XErrorEvent err) {
XToolkit.XERROR_SAVE(err);
- if (err.get_request_code() == XlibWrapper.X_ChangeProperty) {
+ if (err.get_request_code() == XProtocolConstants.X_ChangeProperty) {
return 0;
} else {
return XToolkit.SAVED_ERROR_HANDLER(display, err);
@@ -621,11 +621,11 @@
XlibWrapper.XChangePropertyS(XToolkit.getDisplay(), XToolkit.getDefaultRootWindow(),
XA_ICEWM_WINOPTHINT.getAtom(),
XA_ICEWM_WINOPTHINT.getAtom(),
- 8, XlibWrapper.PropModeReplace,
+ 8, XConstants.PropModeReplace,
new String(opt));
XToolkit.RESTORE_XERROR_HANDLER();
- if (XToolkit.saved_error != null && XToolkit.saved_error.get_error_code() != XlibWrapper.Success) {
+ if (XToolkit.saved_error != null && XToolkit.saved_error.get_error_code() != XConstants.Success) {
log.finer("Erorr getting XA_ICEWM_WINOPTHINT property");
return false;
}
@@ -654,7 +654,7 @@
true, XA_ICEWM_WINOPTHINT);
try {
int status = getter.execute();
- boolean res = (status == XlibWrapper.Success && getter.getActualType() != 0);
+ boolean res = (status == XConstants.Success && getter.getActualType() != 0);
log.finer("Status getting XA_ICEWM_WINOPTHINT: " + !res);
return !res || isNetWMName("IceWM");
} finally {
@@ -686,8 +686,8 @@
static XToolkit.XErrorHandler DetectWMHandler = new XToolkit.XErrorHandler() {
public int handleError(long display, XErrorEvent err) {
XToolkit.XERROR_SAVE(err);
- if (err.get_request_code() == XlibWrapper.X_ChangeWindowAttributes
- && err.get_error_code() == XlibWrapper.BadAccess)
+ if (err.get_request_code() == XProtocolConstants.X_ChangeWindowAttributes
+ && err.get_error_code() == XConstants.BadAccess)
{
winmgr_running = true;
return 0;
@@ -804,7 +804,7 @@
* XXX: Why do we need this in the first place???
*/
static void removeSizeHints(XDecoratedPeer window, long mask) {
- mask &= PMaxSize | PMinSize;
+ mask &= XUtilConstants.PMaxSize | XUtilConstants.PMinSize;
XToolkit.awtLock();
try {
@@ -830,13 +830,13 @@
* rest of the code.
*/
static int normalizeMotifDecor(int decorations) {
- if ((decorations & MWM_DECOR_ALL) == 0) {
+ if ((decorations & MWMConstants.MWM_DECOR_ALL) == 0) {
return decorations;
}
- int d = MWM_DECOR_BORDER | MWM_DECOR_RESIZEH
- | MWM_DECOR_TITLE
- | MWM_DECOR_MENU | MWM_DECOR_MINIMIZE
- | MWM_DECOR_MAXIMIZE;
+ int d = MWMConstants.MWM_DECOR_BORDER | MWMConstants.MWM_DECOR_RESIZEH
+ | MWMConstants.MWM_DECOR_TITLE
+ | MWMConstants.MWM_DECOR_MENU | MWMConstants.MWM_DECOR_MINIMIZE
+ | MWMConstants.MWM_DECOR_MAXIMIZE;
d &= ~decorations;
return d;
}
@@ -848,14 +848,14 @@
* rest of the code.
*/
static int normalizeMotifFunc(int functions) {
- if ((functions & MWM_FUNC_ALL) == 0) {
+ if ((functions & MWMConstants.MWM_FUNC_ALL) == 0) {
return functions;
}
- int f = MWM_FUNC_RESIZE |
- MWM_FUNC_MOVE |
- MWM_FUNC_MAXIMIZE |
- MWM_FUNC_MINIMIZE |
- MWM_FUNC_CLOSE;
+ int f = MWMConstants.MWM_FUNC_RESIZE |
+ MWMConstants.MWM_FUNC_MOVE |
+ MWMConstants.MWM_FUNC_MAXIMIZE |
+ MWMConstants.MWM_FUNC_MINIMIZE |
+ MWMConstants.MWM_FUNC_CLOSE;
f &= ~functions;
return f;
}
@@ -872,15 +872,15 @@
XAtomList decorDel = new XAtomList();
decorations = normalizeMotifDecor(decorations);
if (insLog.isLoggable(Level.FINER)) insLog.finer("Setting OL_DECOR to " + Integer.toBinaryString(decorations));
- if ((decorations & MWM_DECOR_TITLE) == 0) {
+ if ((decorations & MWMConstants.MWM_DECOR_TITLE) == 0) {
decorDel.add(XA_OL_DECOR_HEADER);
}
- if ((decorations & (MWM_DECOR_RESIZEH | MWM_DECOR_MAXIMIZE)) == 0) {
+ if ((decorations & (MWMConstants.MWM_DECOR_RESIZEH | MWMConstants.MWM_DECOR_MAXIMIZE)) == 0) {
decorDel.add(XA_OL_DECOR_RESIZE);
}
- if ((decorations & (MWM_DECOR_MENU |
- MWM_DECOR_MAXIMIZE |
- MWM_DECOR_MINIMIZE)) == 0)
+ if ((decorations & (MWMConstants.MWM_DECOR_MENU |
+ MWMConstants.MWM_DECOR_MAXIMIZE |
+ MWMConstants.MWM_DECOR_MINIMIZE)) == 0)
{
decorDel.add(XA_OL_DECOR_CLOSE);
}
@@ -898,19 +898,21 @@
*/
static void setMotifDecor(XWindowPeer window, boolean resizable, int decorations, int functions) {
/* Apparently some WMs don't implement MWM_*_ALL semantic correctly */
- if ((decorations & MWM_DECOR_ALL) != 0
- && (decorations != MWM_DECOR_ALL))
+ if ((decorations & MWMConstants.MWM_DECOR_ALL) != 0
+ && (decorations != MWMConstants.MWM_DECOR_ALL))
{
decorations = normalizeMotifDecor(decorations);
}
- if ((functions & MWM_FUNC_ALL) != 0
- && (functions != MWM_FUNC_ALL))
+ if ((functions & MWMConstants.MWM_FUNC_ALL) != 0
+ && (functions != MWMConstants.MWM_FUNC_ALL))
{
functions = normalizeMotifFunc(functions);
}
PropMwmHints hints = window.getMWMHints();
- hints.set_flags(hints.get_flags() | MWM_HINTS_FUNCTIONS | MWM_HINTS_DECORATIONS);
+ hints.set_flags(hints.get_flags() |
+ MWMConstants.MWM_HINTS_FUNCTIONS |
+ MWMConstants.MWM_HINTS_DECORATIONS);
hints.set_functions(functions);
hints.set_decorations(decorations);
@@ -950,10 +952,10 @@
boolean resizable = window.isResizable();
if (!resizable) {
- if ((decorations & MWM_DECOR_ALL) != 0) {
- decorations |= MWM_DECOR_RESIZEH | MWM_DECOR_MAXIMIZE;
+ if ((decorations & MWMConstants.MWM_DECOR_ALL) != 0) {
+ decorations |= MWMConstants.MWM_DECOR_RESIZEH | MWMConstants.MWM_DECOR_MAXIMIZE;
} else {
- decorations &= ~(MWM_DECOR_RESIZEH | MWM_DECOR_MAXIMIZE);
+ decorations &= ~(MWMConstants.MWM_DECOR_RESIZEH | MWMConstants.MWM_DECOR_MAXIMIZE);
}
}
setMotifDecor(window, resizable, decorations, functions);
@@ -988,7 +990,7 @@
/* REMINDER: will need to revisit when setExtendedStateBounds is added */
//Fix for 4320050: Minimum size for java.awt.Frame is not being enforced.
//We need to update frame's minimum size, not to reset it
- removeSizeHints(window, PMaxSize);
+ removeSizeHints(window, XUtilConstants.PMaxSize);
window.updateMinimumSize();
/* Restore decorations */
@@ -1134,7 +1136,7 @@
}
int wm_state = window.getWMState();
- if (wm_state == XlibWrapper.WithdrawnState) {
+ if (wm_state == XUtilConstants.WithdrawnState) {
stateLog.finer("WithdrawnState");
return false;
} else {
@@ -1158,7 +1160,7 @@
int getState(XDecoratedPeer window) {
int res = 0;
final int wm_state = window.getWMState();
- if (wm_state == XlibWrapper.IconicState) {
+ if (wm_state == XUtilConstants.IconicState) {
res = Frame.ICONIFIED;
} else {
res = Frame.NORMAL;
@@ -1397,7 +1399,7 @@
new WindowPropertyGetter(window, atom,
0, 4, false, XAtom.XA_CARDINAL);
try {
- if (getter.execute() != XlibWrapper.Success
+ if (getter.execute() != XConstants.Success
|| getter.getData() == 0
|| getter.getActualType() != XAtom.XA_CARDINAL
|| getter.getActualFormat() != 32)
@@ -1426,7 +1428,7 @@
XClientMessageEvent msg = new XClientMessageEvent();
msg.zero();
- msg.set_type(XlibWrapper.ClientMessage);
+ msg.set_type(XConstants.ClientMessage);
msg.set_display(XToolkit.getDisplay());
msg.set_window(window);
msg.set_format(32);
@@ -1436,13 +1438,15 @@
if (net_protocol != null && net_protocol.active()) {
msg.set_message_type(XA_NET_REQUEST_FRAME_EXTENTS.getAtom());
XlibWrapper.XSendEvent(XToolkit.getDisplay(), XToolkit.getDefaultRootWindow(),
- false, XlibWrapper.SubstructureRedirectMask | XlibWrapper.SubstructureNotifyMask,
+ false,
+ XConstants.SubstructureRedirectMask | XConstants.SubstructureNotifyMask,
msg.getPData());
}
if (getWMID() == XWM.KDE2_WM) {
msg.set_message_type(XA_KDE_NET_WM_FRAME_STRUT.getAtom());
XlibWrapper.XSendEvent(XToolkit.getDisplay(), XToolkit.getDefaultRootWindow(),
- false, XlibWrapper.SubstructureRedirectMask | XlibWrapper.SubstructureNotifyMask,
+ false,
+ XConstants.SubstructureRedirectMask | XConstants.SubstructureNotifyMask,
msg.getPData());
}
// XXX: should we wait for response? XIfEvent() would be useful here :)
--- a/jdk/src/solaris/classes/sun/awt/X11/XWindow.java Mon Apr 07 14:53:51 2008 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XWindow.java Mon Apr 07 16:52:51 2008 +0400
@@ -178,10 +178,10 @@
AwtGraphicsConfigData gData = getGraphicsConfigurationData();
X11GraphicsConfig config = (X11GraphicsConfig) getGraphicsConfiguration();
XVisualInfo visInfo = gData.get_awt_visInfo();
- params.putIfNull(EVENT_MASK, KeyPressMask | KeyReleaseMask
- | FocusChangeMask | ButtonPressMask | ButtonReleaseMask
- | EnterWindowMask | LeaveWindowMask | PointerMotionMask
- | ButtonMotionMask | ExposureMask | StructureNotifyMask);
+ params.putIfNull(EVENT_MASK, XConstants.KeyPressMask | XConstants.KeyReleaseMask
+ | XConstants.FocusChangeMask | XConstants.ButtonPressMask | XConstants.ButtonReleaseMask
+ | XConstants.EnterWindowMask | XConstants.LeaveWindowMask | XConstants.PointerMotionMask
+ | XConstants.ButtonMotionMask | XConstants.ExposureMask | XConstants.StructureNotifyMask);
if (target != null) {
params.putIfNull(BOUNDS, target.getBounds());
@@ -192,9 +192,9 @@
getColorModel(); // fix 4948833: this call forces the color map to be initialized
params.putIfNull(COLORMAP, gData.get_awt_cmap());
params.putIfNull(DEPTH, gData.get_awt_depth());
- params.putIfNull(VISUAL_CLASS, Integer.valueOf((int)XlibWrapper.InputOutput));
+ params.putIfNull(VISUAL_CLASS, Integer.valueOf((int)XConstants.InputOutput));
params.putIfNull(VISUAL, visInfo.get_visual());
- params.putIfNull(VALUE_MASK, XlibWrapper.CWBorderPixel | XlibWrapper.CWEventMask | XlibWrapper.CWColormap);
+ params.putIfNull(VALUE_MASK, XConstants.CWBorderPixel | XConstants.CWEventMask | XConstants.CWColormap);
Long parentWindow = (Long)params.get(PARENT_WINDOW);
if (parentWindow == null || parentWindow.longValue() == 0) {
XToolkit.awtLock();
@@ -553,10 +553,10 @@
static int getModifiers(int state, int button, int keyCode) {
int modifiers = 0;
- if (((state & XlibWrapper.ShiftMask) != 0) ^ (keyCode == KeyEvent.VK_SHIFT)) {
+ if (((state & XConstants.ShiftMask) != 0) ^ (keyCode == KeyEvent.VK_SHIFT)) {
modifiers |= InputEvent.SHIFT_DOWN_MASK;
}
- if (((state & XlibWrapper.ControlMask) != 0) ^ (keyCode == KeyEvent.VK_CONTROL)) {
+ if (((state & XConstants.ControlMask) != 0) ^ (keyCode == KeyEvent.VK_CONTROL)) {
modifiers |= InputEvent.CTRL_DOWN_MASK;
}
if (((state & XToolkit.metaMask) != 0) ^ (keyCode == KeyEvent.VK_META)) {
@@ -568,13 +568,13 @@
if (((state & XToolkit.modeSwitchMask) != 0) ^ (keyCode == KeyEvent.VK_ALT_GRAPH)) {
modifiers |= InputEvent.ALT_GRAPH_DOWN_MASK;
}
- if (((state & XlibWrapper.Button1Mask) != 0) ^ (button == MouseEvent.BUTTON1)) {
+ if (((state & XConstants.Button1Mask) != 0) ^ (button == MouseEvent.BUTTON1)) {
modifiers |= InputEvent.BUTTON1_DOWN_MASK;
}
- if (((state & XlibWrapper.Button2Mask) != 0) ^ (button == MouseEvent.BUTTON2)) {
+ if (((state & XConstants.Button2Mask) != 0) ^ (button == MouseEvent.BUTTON2)) {
modifiers |= InputEvent.BUTTON2_DOWN_MASK;
}
- if (((state & XlibWrapper.Button3Mask) != 0) ^ (button == MouseEvent.BUTTON3)) {
+ if (((state & XConstants.Button3Mask) != 0) ^ (button == MouseEvent.BUTTON3)) {
modifiers |= InputEvent.BUTTON3_DOWN_MASK;
}
return modifiers;
@@ -584,10 +584,10 @@
int mods = stroke.getModifiers();
int res = 0;
if ((mods & (InputEvent.SHIFT_DOWN_MASK | InputEvent.SHIFT_MASK)) != 0) {
- res |= XToolkit.ShiftMask;
+ res |= XConstants.ShiftMask;
}
if ((mods & (InputEvent.CTRL_DOWN_MASK | InputEvent.CTRL_MASK)) != 0) {
- res |= XToolkit.ControlMask;
+ res |= XConstants.ControlMask;
}
if ((mods & (InputEvent.ALT_DOWN_MASK | InputEvent.ALT_MASK)) != 0) {
res |= XToolkit.altMask;
@@ -602,12 +602,12 @@
}
private static int getButtonMask(long mouseButton) {
- if (mouseButton == XlibWrapper.Button1) {
- return XlibWrapper.Button1Mask;
- } else if (mouseButton == XlibWrapper.Button2) {
- return XlibWrapper.Button2Mask;
- } else if (mouseButton == XlibWrapper.Button3) {
- return XlibWrapper.Button3Mask;
+ if (mouseButton == XConstants.Button1) {
+ return XConstants.Button1Mask;
+ } else if (mouseButton == XConstants.Button2) {
+ return XConstants.Button2Mask;
+ } else if (mouseButton == XConstants.Button3) {
+ return XConstants.Button3Mask;
}
return 0;
}
@@ -659,7 +659,7 @@
y = localXY.y;
}
- if (type == XlibWrapper.ButtonPress) {
+ if (type == XConstants.ButtonPress) {
XWindow lastWindow = (lastWindowRef != null) ? ((XWindow)lastWindowRef.get()):(null);
/*
multiclick checking
@@ -689,16 +689,16 @@
}
}
- if (lbutton == XlibWrapper.Button1)
+ if (lbutton == XConstants.Button1)
button = MouseEvent.BUTTON1;
- else if (lbutton == XlibWrapper.Button2 )
+ else if (lbutton == XConstants.Button2 )
button = MouseEvent.BUTTON2;
- else if (lbutton == XlibWrapper.Button3)
+ else if (lbutton == XConstants.Button3)
button = MouseEvent.BUTTON3;
- else if (lbutton == XlibWrapper.Button4) {
+ else if (lbutton == XConstants.Button4) {
button = 4;
wheel_mouse = true;
- } else if (lbutton == XlibWrapper.Button5) {
+ } else if (lbutton == XConstants.Button5) {
button = 5;
wheel_mouse = true;
}
@@ -707,7 +707,7 @@
if (!wheel_mouse) {
MouseEvent me = new MouseEvent((Component)getEventSource(),
- type == XlibWrapper.ButtonPress ? MouseEvent.MOUSE_PRESSED : MouseEvent.MOUSE_RELEASED,
+ type == XConstants.ButtonPress ? MouseEvent.MOUSE_PRESSED : MouseEvent.MOUSE_RELEASED,
jWhen,modifiers, x, y,
xbe.get_x_root(),
xbe.get_y_root(),
@@ -716,7 +716,7 @@
postEventToEventQueue(me);
if (((mouseDragState & getButtonMask(lbutton)) == 0) && // No up-button in the drag-state
- (type == XlibWrapper.ButtonRelease))
+ (type == XConstants.ButtonRelease))
{
postEventToEventQueue(me = new MouseEvent((Component)getEventSource(),
MouseEvent.MOUSE_CLICKED,
@@ -731,7 +731,7 @@
}
else {
- if (xev.get_type() == XlibWrapper.ButtonPress) {
+ if (xev.get_type() == XConstants.ButtonPress) {
MouseWheelEvent mwe = new MouseWheelEvent((Component)getEventSource(),MouseEvent.MOUSE_WHEEL, jWhen,
modifiers,
x, y,
@@ -753,7 +753,7 @@
return;
}
- int mouseKeyState = (xme.get_state() & (Button1Mask | Button2Mask | Button3Mask));
+ int mouseKeyState = (xme.get_state() & (XConstants.Button1Mask | XConstants.Button2Mask | XConstants.Button3Mask));
boolean isDragging = (mouseKeyState != 0);
int mouseEventType = 0;
@@ -823,10 +823,10 @@
// accordingly. This leads to impossibility to make a double click on Component (6404708)
XWindowPeer toplevel = getToplevelXWindow();
if (toplevel != null && !toplevel.isModalBlocked()){
- if (xce.get_mode() != NotifyNormal) {
+ if (xce.get_mode() != XConstants.NotifyNormal) {
// 6404708 : need update cursor in accordance with skipping Leave/EnterNotify event
// whereas it doesn't need to handled further.
- if (xce.get_type() == EnterNotify) {
+ if (xce.get_type() == XConstants.EnterNotify) {
XAwtState.setComponentMouseEntered(getEventSource());
XGlobalCursorManager.nativeUpdateCursor(getEventSource());
} else { // LeaveNotify:
@@ -840,7 +840,7 @@
// From java point the event is bogus as ancestor is obscured, so if
// the child can get java event itself, we skip it on ancestor.
long childWnd = xce.get_subwindow();
- if (childWnd != None) {
+ if (childWnd != XConstants.None) {
XBaseWindow child = XToolkit.windowToXWindow(childWnd);
if (child != null && child instanceof XWindow &&
!child.isEventDisabled(xev))
@@ -853,7 +853,7 @@
final Component compWithMouse = XAwtState.getComponentMouseEntered();
if (toplevel != null) {
if(!toplevel.isModalBlocked()){
- if (xce.get_type() == EnterNotify) {
+ if (xce.get_type() == XConstants.EnterNotify) {
// Change XAwtState's component mouse entered to the up-to-date one before requesting
// to update the cursor since XAwtState.getComponentMouseEntered() is used when the
// cursor is updated (in XGlobalCursorManager.findHeavyweightUnderCursor()).
@@ -895,7 +895,7 @@
eventLog.finest("Clearing last window ref");
lastWindowRef = null;
}
- if (xce.get_type() == EnterNotify) {
+ if (xce.get_type() == XConstants.EnterNotify) {
MouseEvent me = new MouseEvent(getEventSource(), MouseEvent.MOUSE_ENTERED,
jWhen, modifiers, xce.get_x(), xce.get_y(), xce.get_x_root(), xce.get_y_root(), clickCount,
popupTrigger, MouseEvent.NOBUTTON);
@@ -990,7 +990,7 @@
final void handleKeyPress(XKeyEvent ev) {
long keysym[] = new long[2];
char unicodeKey = 0;
- keysym[0] = NoSymbol;
+ keysym[0] = XConstants.NoSymbol;
if (keyEventLog.isLoggable(Level.FINE)) {
logIncomingKeyEvent( ev );
@@ -1073,7 +1073,7 @@
private void handleKeyRelease(XKeyEvent ev) {
long keysym[] = new long[2];
char unicodeKey = 0;
- keysym[0] = NoSymbol;
+ keysym[0] = XConstants.NoSymbol;
if (keyEventLog.isLoggable(Level.FINE)) {
logIncomingKeyEvent( ev );
@@ -1153,10 +1153,10 @@
}
void updateSizeHints(int x, int y, int width, int height) {
- long flags = XlibWrapper.PSize | (isLocationByPlatform() ? 0 : (XlibWrapper.PPosition | XlibWrapper.USPosition));
+ long flags = XUtilConstants.PSize | (isLocationByPlatform() ? 0 : (XUtilConstants.PPosition | XUtilConstants.USPosition));
if (!isResizable()) {
log.log(Level.FINER, "Window {0} is not resizable", new Object[] {this});
- flags |= XlibWrapper.PMinSize | XlibWrapper.PMaxSize;
+ flags |= XUtilConstants.PMinSize | XUtilConstants.PMaxSize;
} else {
log.log(Level.FINER, "Window {0} is resizable", new Object[] {this});
}
@@ -1164,10 +1164,10 @@
}
void updateSizeHints(int x, int y) {
- long flags = isLocationByPlatform() ? 0 : (XlibWrapper.PPosition | XlibWrapper.USPosition);
+ long flags = isLocationByPlatform() ? 0 : (XUtilConstants.PPosition | XUtilConstants.USPosition);
if (!isResizable()) {
log.log(Level.FINER, "Window {0} is not resizable", new Object[] {this});
- flags |= XlibWrapper.PMinSize | XlibWrapper.PMaxSize | XlibWrapper.PSize;
+ flags |= XUtilConstants.PMinSize | XUtilConstants.PMaxSize | XUtilConstants.PSize;
} else {
log.log(Level.FINER, "Window {0} is resizable", new Object[] {this});
}
--- a/jdk/src/solaris/classes/sun/awt/X11/XWindowPeer.java Mon Apr 07 14:53:51 2008 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XWindowPeer.java Mon Apr 07 16:52:51 2008 +0400
@@ -50,7 +50,7 @@
import sun.awt.X11GraphicsEnvironment;
class XWindowPeer extends XPanelPeer implements WindowPeer,
- DisplayChangedListener, MWMConstants {
+ DisplayChangedListener {
private static final Logger log = Logger.getLogger("sun.awt.X11.XWindowPeer");
private static final Logger focusLog = Logger.getLogger("sun.awt.X11.focus.XWindowPeer");
@@ -133,9 +133,9 @@
params.put(REPARENTED,
Boolean.valueOf(isOverrideRedirect() || isSimpleWindow()));
super.preInit(params);
- params.putIfNull(BIT_GRAVITY, Integer.valueOf(NorthWestGravity));
+ params.putIfNull(BIT_GRAVITY, Integer.valueOf(XConstants.NorthWestGravity));
- savedState = WithdrawnState;
+ savedState = XUtilConstants.WithdrawnState;
XA_NET_WM_STATE = XAtom.get("_NET_WM_STATE");
winAttr = new XWindowAttributesData();
@@ -239,7 +239,7 @@
// Set group leader
XWMHints hints = getWMHints();
- hints.set_flags(hints.get_flags() | (int)XlibWrapper.WindowGroupHint);
+ hints.set_flags(hints.get_flags() | (int)XUtilConstants.WindowGroupHint);
hints.set_window_group(ownerWindow);
XlibWrapper.XSetWMHints(XToolkit.getDisplay(), getWindow(), hints.pData);
}
@@ -503,7 +503,7 @@
Rectangle bounds = getBounds();
XSizeHints hints = getHints();
- setSizeHints(hints.get_flags() | XlibWrapper.PPosition | XlibWrapper.PSize,
+ setSizeHints(hints.get_flags() | XUtilConstants.PPosition | XUtilConstants.PSize,
bounds.x, bounds.y, bounds.width, bounds.height);
XWM.setMotifDecor(this, false, 0, 0);
@@ -531,7 +531,7 @@
XToolkit.awtLock();
try {
XWMHints hints = getWMHints();
- hints.set_flags(hints.get_flags() | (int)XlibWrapper.InputHint);
+ hints.set_flags(hints.get_flags() | (int)XUtilConstants.InputHint);
hints.set_input(false/*isNativelyNonFocusableWindow() ? (0):(1)*/);
XlibWrapper.XSetWMHints(XToolkit.getDisplay(), getWindow(), hints.pData);
}
@@ -821,12 +821,12 @@
if (isEventDisabled(xev)) {
return;
}
- if (xev.get_type() == XlibWrapper.FocusIn)
+ if (xev.get_type() == XConstants.FocusIn)
{
// If this window is non-focusable don't post any java focus event
if (focusAllowedFor()) {
- if (xfe.get_mode() == XlibWrapper.NotifyNormal // Normal notify
- || xfe.get_mode() == XlibWrapper.NotifyWhileGrabbed) // Alt-Tab notify
+ if (xfe.get_mode() == XConstants.NotifyNormal // Normal notify
+ || xfe.get_mode() == XConstants.NotifyWhileGrabbed) // Alt-Tab notify
{
handleWindowFocusIn(xfe.get_serial());
}
@@ -834,8 +834,8 @@
}
else
{
- if (xfe.get_mode() == XlibWrapper.NotifyNormal // Normal notify
- || xfe.get_mode() == XlibWrapper.NotifyWhileGrabbed) // Alt-Tab notify
+ if (xfe.get_mode() == XConstants.NotifyNormal // Normal notify
+ || xfe.get_mode() == XConstants.NotifyWhileGrabbed) // Alt-Tab notify
{
// If this window is non-focusable don't post any java focus event
if (!isNativelyNonFocusableWindow()) {
@@ -1022,7 +1022,7 @@
try {
Rectangle bounds = getBounds();
XSizeHints hints = getHints();
- setSizeHints(hints.get_flags() & ~(USPosition | PPosition),
+ setSizeHints(hints.get_flags() & ~(XUtilConstants.USPosition | XUtilConstants.PPosition),
bounds.x, bounds.y, bounds.width, bounds.height);
} finally {
XToolkit.awtUnlock();
@@ -1059,10 +1059,10 @@
XUnmapEvent unmap = new XUnmapEvent();
unmap.set_window(window);
unmap.set_event(XToolkit.getDefaultRootWindow());
- unmap.set_type((int)XlibWrapper.UnmapNotify);
+ unmap.set_type((int)XConstants.UnmapNotify);
unmap.set_from_configure(false);
XlibWrapper.XSendEvent(XToolkit.getDisplay(), XToolkit.getDefaultRootWindow(),
- false, XlibWrapper.SubstructureNotifyMask | XlibWrapper.SubstructureRedirectMask,
+ false, XConstants.SubstructureNotifyMask | XConstants.SubstructureRedirectMask,
unmap.pData);
unmap.dispose();
}
@@ -1305,12 +1305,12 @@
XWM.XA_WM_STATE);
try {
int status = getter.execute();
- if (status != XlibWrapper.Success || getter.getData() == 0) {
- return savedState = XlibWrapper.WithdrawnState;
+ if (status != XConstants.Success || getter.getData() == 0) {
+ return savedState = XUtilConstants.WithdrawnState;
}
if (getter.getActualType() != XWM.XA_WM_STATE.getAtom() && getter.getActualFormat() != 32) {
- return savedState = XlibWrapper.WithdrawnState;
+ return savedState = XUtilConstants.WithdrawnState;
}
savedState = (int)Native.getCard32(getter.getData());
} finally {
@@ -1321,7 +1321,7 @@
}
boolean isWithdrawn() {
- return getWMState() == XlibWrapper.WithdrawnState;
+ return getWMState() == XUtilConstants.WithdrawnState;
}
boolean hasDecorations(int decor) {
@@ -1818,14 +1818,14 @@
if( rootPropertyEventDispatcher == null ) {
rootPropertyEventDispatcher = new XEventDispatcher() {
public void dispatchEvent(XEvent ev) {
- if( ev.get_type() == PropertyNotify ) {
+ if( ev.get_type() == XConstants.PropertyNotify ) {
handleRootPropertyNotify( ev );
}
}
};
XlibWrapper.XSelectInput( XToolkit.getDisplay(),
XToolkit.getDefaultRootWindow(),
- XlibWrapper.PropertyChangeMask);
+ XConstants.PropertyChangeMask);
XToolkit.addEventDispatcher(XToolkit.getDefaultRootWindow(),
rootPropertyEventDispatcher);
}
@@ -1860,7 +1860,7 @@
public PropMwmHints getMWMHints() {
if (mwm_hints == null) {
mwm_hints = new PropMwmHints();
- if (!XWM.XA_MWM_HINTS.getAtomData(getWindow(), mwm_hints.pData, PROP_MWM_HINTS_ELEMENTS)) {
+ if (!XWM.XA_MWM_HINTS.getAtomData(getWindow(), mwm_hints.pData, MWMConstants.PROP_MWM_HINTS_ELEMENTS)) {
mwm_hints.zero();
}
}
@@ -1870,7 +1870,7 @@
public void setMWMHints(PropMwmHints hints) {
mwm_hints = hints;
if (hints != null) {
- XWM.XA_MWM_HINTS.setAtomData(getWindow(), mwm_hints.pData, PROP_MWM_HINTS_ELEMENTS);
+ XWM.XA_MWM_HINTS.setAtomData(getWindow(), mwm_hints.pData, MWMConstants.PROP_MWM_HINTS_ELEMENTS);
}
}
@@ -1960,7 +1960,7 @@
new Object[] {xme, isGrabbed(), containsGlobal(xme.get_x_root(), xme.get_y_root())});
}
if (isGrabbed()) {
- boolean dragging = (xme.get_state() & (Button1Mask | Button2Mask | Button3Mask)) != 0;
+ boolean dragging = (xme.get_state() & (XConstants.Button1Mask | XConstants.Button2Mask | XConstants.Button3Mask)) != 0;
// When window is grabbed, all events are dispatched to
// it. Retarget them to the corresponding windows (notice
// that XBaseWindow.dispatchEvent does the opposite
@@ -2014,12 +2014,12 @@
try {
grabLog.log(Level.FINER, " - Grab event target {0} (press target {1})", new Object[] {target, pressTarget});
if (xbe.get_type() == XConstants.ButtonPress
- && xbe.get_button() == XlibWrapper.Button1)
+ && xbe.get_button() == XConstants.Button1)
{
// need to keep it to retarget mouse release
pressTarget = target;
} else if (xbe.get_type() == XConstants.ButtonRelease
- && xbe.get_button() == XlibWrapper.Button1
+ && xbe.get_button() == XConstants.Button1
&& pressTarget != target)
{
// during grab we do receive mouse release on different component (not on the source
--- a/jdk/src/solaris/classes/sun/awt/X11/XlibUtil.java Mon Apr 07 14:53:51 2008 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XlibUtil.java Mon Apr 07 16:52:51 2008 +0400
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2007 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2006-2008 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -152,7 +152,7 @@
int status = xtc.execute(XToolkit.IgnoreBadWindowHandler);
if ((status != 0) &&
((XToolkit.saved_error == null) ||
- (XToolkit.saved_error.get_error_code() == XlibWrapper.Success)))
+ (XToolkit.saved_error.get_error_code() == XConstants.Success)))
{
translated = new Point(xtc.get_dest_x(), xtc.get_dest_y());
}
@@ -351,7 +351,7 @@
XToolkit.RESTORE_XERROR_HANDLER();
if ((status != 0) &&
((XToolkit.saved_error == null) ||
- (XToolkit.saved_error.get_error_code() == XlibWrapper.Success)))
+ (XToolkit.saved_error.get_error_code() == XConstants.Success)))
{
return wattr.get_map_state();
}
@@ -362,7 +362,7 @@
XToolkit.awtUnlock();
}
- return XlibWrapper.IsUnmapped;
+ return XConstants.IsUnmapped;
}
/**
--- a/jdk/src/solaris/classes/sun/awt/X11/XlibWrapper.java Mon Apr 07 14:53:51 2008 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XlibWrapper.java Mon Apr 07 16:52:51 2008 +0400
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2007 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2002-2008 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -29,8 +29,7 @@
import java.security.PrivilegedAction;
import sun.misc.*;
-public class XlibWrapper implements XConstants, XUtilConstants, XProtocolConstants,
- XCursorFontConstants
+final public class XlibWrapper
{
static Unsafe unsafe = Unsafe.getUnsafe();
// strange constants
@@ -321,7 +320,7 @@
if (XPropertyCache.isCachingSupported() &&
XToolkit.windowToXWindow(window) != null &&
WindowPropertyGetter.isCacheableProperty(XAtom.get(atom)) &&
- mode == PropModeReplace)
+ mode == XConstants.PropModeReplace)
{
int length = (format / 8) * nelements;
XPropertyCache.storeCache(
@@ -585,25 +584,25 @@
static String hintsToString(long flags) {
StringBuffer buf = new StringBuffer();
- if ((flags & PMaxSize) != 0) {
+ if ((flags & XUtilConstants.PMaxSize) != 0) {
buf.append("PMaxSize ");
}
- if ((flags & PMinSize) != 0) {
+ if ((flags & XUtilConstants.PMinSize) != 0) {
buf.append("PMinSize ");
}
- if ((flags & USSize) != 0) {
+ if ((flags & XUtilConstants.USSize) != 0) {
buf.append("USSize ");
}
- if ((flags & USPosition) != 0) {
+ if ((flags & XUtilConstants.USPosition) != 0) {
buf.append("USPosition ");
}
- if ((flags & PPosition) != 0) {
+ if ((flags & XUtilConstants.PPosition) != 0) {
buf.append("PPosition ");
}
- if ((flags & PSize) != 0) {
+ if ((flags & XUtilConstants.PSize) != 0) {
buf.append("PSize ");
}
- if ((flags & PWinGravity) != 0) {
+ if ((flags & XUtilConstants.PWinGravity) != 0) {
buf.append("PWinGravity ");
}
return buf.toString();