+ protected boolean _needsAutoDoubleClick() { return false; }
+
+ /** Returns the ATSUStyle associated with the given XWT font spec.
+ * This method first checks its internal cache before creating the
+ * ATSUStyle object from scratch. */
+ protected RawData _getATSUStyle( String fontSpec ) {
+ WrappedRawData ret = null;
+ ret = (WrappedRawData) atsuStyleCache.get( fontSpec );
+ if (ret != null) return ret.wrapee;
+
+ Platform.ParsedFont pf = new Platform.ParsedFont( fontSpec );
+
+ // Find the font
+ if (pf.name.equals("serif")) pf.name = "lucida_grande";
+ else if (pf.name.equals("sansserif")) pf.name = "helvetica";
+ else if (pf.name.equals("monospace")) pf.name = "courier";
+ else if (pf.name.equals("dialog")) pf.name = "lucida_grande";
+ else if (pf.name.equals("tty")) pf.name = "courier";
+
+ // Find the ATSFontRef
+ WrappedRawData fontRef = (WrappedRawData) nativeFontCache.get( pf.name );
+ // If we couldn't find the font, use the default font
+ if ( fontRef == null ) fontRef = (WrappedRawData) nativeFontCache.get( defaultFontName );
+ if ( fontRef == null ) throw new Error( "Default font cannot be found" );
+
+ // Create the ATSUStyle object
+ ret = new WrappedRawData( _createATSUStyle( fontRef.wrapee, pf.size, pf.bold, pf.italic, pf.underline ) );
+
+ // Map this font spec to the ATSFontRef to optimize future requests
+ atsuStyleCache.put( fontSpec, ret );
+
+ return ret.wrapee;
+ }
+
+ /** Creates an ATSUStyle object with the specified attributes. */
+ protected native RawData _createATSUStyle( RawData fontRef, int fontSize, boolean isBold, boolean isItalic, boolean isUnderline );
+
+ /** Called once XWT is initialized and the application is running. On Mac OS X this calls
+ * RunApplicationEventLoop(). */
+ protected native void _running();
+
+ /** dumps a list of Mac OS X font strings. TODO: Will this be sufficient? */
+ //private native String[] listNativeFonts();
+ /** translates a font string into an ATSUFontRef? TODO: Will this be sufficient? */
+ //public static native gnu.gcj.RawData fontStringToStruct(String s);