< prev index next >

src/java.desktop/unix/classes/sun/awt/UNIXToolkit.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 2004, 2014, Oracle and/or its affiliates. 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 * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this --- 1,7 ---- /* ! * Copyright (c) 2004, 2015, Oracle and/or its affiliates. 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 * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this
*** 27,41 **** import java.awt.RenderingHints; import static java.awt.RenderingHints.*; import java.awt.color.ColorSpace; import java.awt.image.*; import java.security.AccessController; - import java.security.PrivilegedAction; import sun.security.action.GetIntegerAction; import com.sun.java.swing.plaf.gtk.GTKConstants.TextDirection; import sun.java2d.opengl.OGLRenderQueue; - import java.lang.reflect.InvocationTargetException; public abstract class UNIXToolkit extends SunToolkit { /** All calls into GTK should be synchronized on this lock */ public static final Object GTK_LOCK = new Object(); --- 27,40 ---- import java.awt.RenderingHints; import static java.awt.RenderingHints.*; import java.awt.color.ColorSpace; import java.awt.image.*; import java.security.AccessController; import sun.security.action.GetIntegerAction; import com.sun.java.swing.plaf.gtk.GTKConstants.TextDirection; + import sun.awt.X11.XToolkit; import sun.java2d.opengl.OGLRenderQueue; public abstract class UNIXToolkit extends SunToolkit { /** All calls into GTK should be synchronized on this lock */ public static final Object GTK_LOCK = new Object();
*** 71,90 **** public boolean isNativeGTKAvailable() { synchronized (GTK_LOCK) { if (nativeGTKLoaded != null) { // We've already attempted to load GTK, so just return the // status of that attempt. ! return nativeGTKLoaded.booleanValue(); } else if (nativeGTKAvailable != null) { // We've already checked the availability of the native GTK // libraries, so just return the status of that attempt. ! return nativeGTKAvailable.booleanValue(); } else { boolean success = check_gtk(); ! nativeGTKAvailable = Boolean.valueOf(success); return success; } } } --- 70,89 ---- public boolean isNativeGTKAvailable() { synchronized (GTK_LOCK) { if (nativeGTKLoaded != null) { // We've already attempted to load GTK, so just return the // status of that attempt. ! return nativeGTKLoaded; } else if (nativeGTKAvailable != null) { // We've already checked the availability of the native GTK // libraries, so just return the status of that attempt. ! return nativeGTKAvailable; } else { boolean success = check_gtk(); ! nativeGTKAvailable = success; return success; } } }
*** 97,111 **** * lightweight boolean check, no native calls required). */ public boolean loadGTK() { synchronized (GTK_LOCK) { if (nativeGTKLoaded == null) { ! boolean success = load_gtk(); ! nativeGTKLoaded = Boolean.valueOf(success); } } ! return nativeGTKLoaded.booleanValue(); } /** * Overridden to handle GTK icon loading */ --- 96,114 ---- * lightweight boolean check, no native calls required). */ public boolean loadGTK() { synchronized (GTK_LOCK) { if (nativeGTKLoaded == null) { ! XToolkit.awtLock(); ! try { ! nativeGTKLoaded = load_gtk(); ! } finally { ! XToolkit.awtUnlock(); ! } } } ! return nativeGTKLoaded; } /** * Overridden to handle GTK icon loading */
*** 250,259 **** --- 253,263 ---- private native boolean load_stock_icon(int widget_type, String stock_id, int iconSize, int textDirection, String detail); private native void nativeSync(); + @Override public void sync() { // flush the X11 buffer nativeSync(); // now flush the OGL pipeline (this is a no-op if OGL is not enabled) OGLRenderQueue.sync();
*** 264,273 **** --- 268,279 ---- * It builds this by querying the Gnome desktop properties to return * them as platform independent hints. * This requires that the Gnome properties have already been gathered. */ public static final String FONTCONFIGAAHINT = "fontconfig/Antialias"; + + @Override protected RenderingHints getDesktopAAHints() { Object aaValue = getDesktopProperty("gnome.Xft/Antialias"); if (aaValue == null) {
*** 286,297 **** /* 0 means off, 1 means some ON. What would any other value mean? * If we require "1" to enable AA then some new value would cause * us to default to "OFF". I don't think that's the best guess. * So if its !=0 then lets assume AA. */ ! boolean aa = Boolean.valueOf(((aaValue instanceof Number) && ! ((Number)aaValue).intValue() != 0)); Object aaHint; if (aa) { String subpixOrder = (String)getDesktopProperty("gnome.Xft/RGBA"); --- 292,303 ---- /* 0 means off, 1 means some ON. What would any other value mean? * If we require "1" to enable AA then some new value would cause * us to default to "OFF". I don't think that's the best guess. * So if its !=0 then lets assume AA. */ ! boolean aa = ((aaValue instanceof Number) ! && ((Number) aaValue).intValue() != 0); Object aaHint; if (aa) { String subpixOrder = (String)getDesktopProperty("gnome.Xft/RGBA");
< prev index next >