src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java

Print this page




  46 
  47 class NamedCursor extends Cursor {
  48     NamedCursor(String name) {
  49         super(name);
  50     }
  51 }
  52 
  53 /**
  54  * Mac OS X Cocoa-based AWT Toolkit.
  55  */
  56 public class LWCToolkit extends LWToolkit {
  57     // While it is possible to enumerate all mouse devices
  58     // and query them for the number of buttons, the code
  59     // that does it is rather complex. Instead, we opt for
  60     // the easy way and just support up to 5 mouse buttons,
  61     // like Windows.
  62     private static final int BUTTONS = 5;
  63 
  64     private static native void initIDs();
  65 




  66     private static CInputMethodDescriptor sInputMethodDescriptor;
  67 
  68     static {
  69         System.err.flush();
  70         java.security.AccessController.doPrivileged(new java.security.PrivilegedAction<Object>() {
  71             public Object run() {
  72                 System.loadLibrary("awt");
  73                 System.loadLibrary("fontmanager");
  74                 return null;
  75             }
  76         });
  77         if (!GraphicsEnvironment.isHeadless()) {
  78             initIDs();
  79         }
  80     }
  81 
  82     static String getSystemProperty(final String name, final String deflt) {
  83         return AccessController.doPrivileged (new PrivilegedAction<String>() {
  84             public String run() {
  85                 return System.getProperty(name, deflt);




  46 
  47 class NamedCursor extends Cursor {
  48     NamedCursor(String name) {
  49         super(name);
  50     }
  51 }
  52 
  53 /**
  54  * Mac OS X Cocoa-based AWT Toolkit.
  55  */
  56 public class LWCToolkit extends LWToolkit {
  57     // While it is possible to enumerate all mouse devices
  58     // and query them for the number of buttons, the code
  59     // that does it is rather complex. Instead, we opt for
  60     // the easy way and just support up to 5 mouse buttons,
  61     // like Windows.
  62     private static final int BUTTONS = 5;
  63 
  64     private static native void initIDs();
  65 
  66     static native void startNativeNestedEventLoop();
  67 
  68     static native void stopNativeNestedEventLoop();
  69 
  70     private static CInputMethodDescriptor sInputMethodDescriptor;
  71 
  72     static {
  73         System.err.flush();
  74         java.security.AccessController.doPrivileged(new java.security.PrivilegedAction<Object>() {
  75             public Object run() {
  76                 System.loadLibrary("awt");
  77                 System.loadLibrary("fontmanager");
  78                 return null;
  79             }
  80         });
  81         if (!GraphicsEnvironment.isHeadless()) {
  82             initIDs();
  83         }
  84     }
  85 
  86     static String getSystemProperty(final String name, final String deflt) {
  87         return AccessController.doPrivileged (new PrivilegedAction<String>() {
  88             public String run() {
  89                 return System.getProperty(name, deflt);