70 |
import java.util.Map; |
import java.util.Map; |
71 |
import java.util.MissingResourceException; |
import java.util.MissingResourceException; |
72 |
import java.util.Properties; |
import java.util.Properties; |
73 |
|
import javax.imageio.spi.IIORegistry; |
74 |
|
|
75 |
/* This class uses a deprecated method java.awt.peer.ComponentPeer.getPeer(). |
/* This class uses a deprecated method java.awt.peer.ComponentPeer.getPeer(). |
76 |
This merits comment. We are basically calling Sun's bluff on this one. |
This merits comment. We are basically calling Sun's bluff on this one. |
89 |
public class GtkToolkit extends gnu.java.awt.ClasspathToolkit |
public class GtkToolkit extends gnu.java.awt.ClasspathToolkit |
90 |
implements EmbeddedWindowSupport |
implements EmbeddedWindowSupport |
91 |
{ |
{ |
|
GtkMainThread main; |
|
92 |
Hashtable containers = new Hashtable(); |
Hashtable containers = new Hashtable(); |
93 |
static EventQueue q = new EventQueue(); |
static EventQueue q; |
94 |
static Clipboard systemClipboard; |
static Clipboard systemClipboard; |
95 |
static boolean useGraphics2dSet; |
static boolean useGraphics2dSet; |
96 |
static boolean useGraphics2d; |
static boolean useGraphics2d; |
105 |
return useGraphics2d; |
return useGraphics2d; |
106 |
} |
} |
107 |
|
|
108 |
|
static native void gtkInit(int portableNativeSync); |
109 |
|
|
110 |
static |
static |
111 |
{ |
{ |
112 |
if (Configuration.INIT_LOAD_LIBRARY) |
if (Configuration.INIT_LOAD_LIBRARY) |
113 |
System.loadLibrary("gtkpeer"); |
System.loadLibrary("gtkpeer"); |
114 |
|
|
115 |
|
int portableNativeSync; |
116 |
|
String portNatSyncProp = |
117 |
|
System.getProperty("gnu.classpath.awt.gtk.portable.native.sync"); |
118 |
|
|
119 |
|
if (portNatSyncProp == null) |
120 |
|
portableNativeSync = -1; // unset |
121 |
|
else if (Boolean.valueOf(portNatSyncProp).booleanValue()) |
122 |
|
portableNativeSync = 1; // true |
123 |
|
else |
124 |
|
portableNativeSync = 0; // false |
125 |
|
|
126 |
|
gtkInit(portableNativeSync); |
127 |
} |
} |
128 |
|
|
129 |
public GtkToolkit () |
public GtkToolkit () |
130 |
{ |
{ |
|
main = new GtkMainThread (); |
|
131 |
systemClipboard = new GtkClipboard (); |
systemClipboard = new GtkClipboard (); |
|
GtkGenericPeer.enableQueue (q); |
|
132 |
} |
} |
133 |
|
|
134 |
native public void beep (); |
native public void beep (); |
135 |
native private void getScreenSizeDimensions (int[] xy); |
native private void getScreenSizeDimensions (int[] xy); |
136 |
|
|
609 |
|
|
610 |
protected EventQueue getSystemEventQueueImpl() |
protected EventQueue getSystemEventQueueImpl() |
611 |
{ |
{ |
612 |
|
synchronized (GtkToolkit.class) |
613 |
|
{ |
614 |
|
if (q == null) |
615 |
|
{ |
616 |
|
q = new EventQueue(); |
617 |
|
GtkGenericPeer.enableQueue (q); |
618 |
|
} |
619 |
|
} |
620 |
return q; |
return q; |
621 |
} |
} |
622 |
|
|
648 |
{ |
{ |
649 |
return new GdkRobotPeer (screen); |
return new GdkRobotPeer (screen); |
650 |
} |
} |
651 |
} |
|
652 |
|
public native boolean nativeQueueEmpty(); |
653 |
|
public native void wakeNativeQueue(); |
654 |
|
public native void iterateNativeQueue(EventQueue locked); |
655 |
|
|
656 |
|
} // class GtkToolkit |