diff options
| author | James E. Blair <corvus@gnu.org> | 1998-11-25 06:17:12 +0000 |
|---|---|---|
| committer | James E. Blair <corvus@gnu.org> | 1998-11-25 06:17:12 +0000 |
| commit | bc3b75041352b408da507680813351203aa6b29a (patch) | |
| tree | 9258b217d784de92928e08cd9d2aa3691476559d /gnu/java/awt/peer/gtk/GtkMainThread.java | |
| parent | 7c31cc845a8aa0bc3d01900885caecf3423214c0 (diff) | |
| download | classpath-bc3b75041352b408da507680813351203aa6b29a.tar.gz | |
Initial commit of GTK peers.
Diffstat (limited to 'gnu/java/awt/peer/gtk/GtkMainThread.java')
| -rw-r--r-- | gnu/java/awt/peer/gtk/GtkMainThread.java | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/gnu/java/awt/peer/gtk/GtkMainThread.java b/gnu/java/awt/peer/gtk/GtkMainThread.java new file mode 100644 index 000000000..b06540511 --- /dev/null +++ b/gnu/java/awt/peer/gtk/GtkMainThread.java @@ -0,0 +1,63 @@ +/* + * GtkMainThread.java -- Runs gtk_main() + * + * Copyright (c) 1998 Free Software Foundation, Inc. + * Written by James E. Blair <corvus@gnu.org> + * + * This library is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as published + * by the Free Software Foundation, either version 2 of the License, or + * (at your option) any later verion. + * + * This library is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; if not, write to the Free Software Foundation + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 USA + */ +package gnu.java.awt.peer.gtk; + +public class GtkMainThread extends GtkGenericPeer + implements Runnable +{ + private static Thread mainThread = null; + + native static void GtkInitTable(); + static native void GtkInit(); + native void GtkMain(); + + public GtkMainThread() + { + start(); + } + + public void start() + { + if (mainThread == null) + { + mainThread = new Thread(this, "GtkMain"); + synchronized (this) { + mainThread.start(); + try { + wait(); + } catch (InterruptedException e) { } + } + } + } + + public void run() + { + synchronized (this) { + GtkInitTable(); + GtkInit(); + notify(); + } + GtkMain(); + } +} + + + |
