jdk/src/solaris/classes/sun/awt/X11/XToolkit.java
changeset 439 3488710b02f8
parent 107 ed0c7cfb3666
child 1190 f27065d0d9f0
child 1969 07500c30ab46
--- 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();