diff options
author | Paul Fisher <rao@gnu.org> | 1999-11-17 02:05:25 +0000 |
---|---|---|
committer | Paul Fisher <rao@gnu.org> | 1999-11-17 02:05:25 +0000 |
commit | ae23f9fb9311cb4db6e4bfb859d388124d335ef5 (patch) | |
tree | b3c59da0dcd51516461f08c208e715c2fa27c591 /gnu | |
parent | 7e3b72a9dcb58102880966697d9df2421a08d7ed (diff) | |
download | classpath-ae23f9fb9311cb4db6e4bfb859d388124d335ef5.tar.gz |
Make peers build with toplevel build environment.
Diffstat (limited to 'gnu')
-rw-r--r-- | gnu/java/awt/peer/gtk/GtkToolkit.java | 11 | ||||
-rw-r--r-- | gnu/java/awt/peer/gtk/Makefile | 217 | ||||
-rw-r--r-- | gnu/java/awt/peer/gtk/Test.java | 135 | ||||
-rw-r--r-- | gnu/java/awt/peer/gtk/TestAWT.java | 29 |
4 files changed, 330 insertions, 62 deletions
diff --git a/gnu/java/awt/peer/gtk/GtkToolkit.java b/gnu/java/awt/peer/gtk/GtkToolkit.java index 1133aafc9..111835c5f 100644 --- a/gnu/java/awt/peer/gtk/GtkToolkit.java +++ b/gnu/java/awt/peer/gtk/GtkToolkit.java @@ -21,7 +21,9 @@ package gnu.java.awt.peer.gtk; import java.awt.*; import java.net.*; -import java.util.*; +import java.util.Hashtable; +import java.util.Properties; +import java.util.MissingResourceException; import java.awt.datatransfer.*; import java.awt.image.*; import java.awt.peer.*; @@ -53,8 +55,8 @@ public class GtkToolkit extends java.awt.Toolkit GtkGenericPeer.enableQueue (q); } - native public void beep(); - native private void getScreenSizeDimensions(int[] xy); + native public void beep (); + native private void getScreenSizeDimensions (int[] xy); public int checkImage (Image image, int width, int height, ImageObserver observer) @@ -102,8 +104,7 @@ public class GtkToolkit extends java.awt.Toolkit return null; } - public PrintJob getPrintJob (Frame frame, String jobtitle, - Properties props) + public PrintJob getPrintJob (Frame frame, String jobtitle, Properties props) { return null; } diff --git a/gnu/java/awt/peer/gtk/Makefile b/gnu/java/awt/peer/gtk/Makefile new file mode 100644 index 000000000..f48ec8c79 --- /dev/null +++ b/gnu/java/awt/peer/gtk/Makefile @@ -0,0 +1,217 @@ +# Generated automatically from Makefile.in by configure. +# Makefile.in generated automatically by automake 1.4 from Makefile.am + +# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +# used by automake to generate Makefile.in + + +SHELL = /bin/sh + +srcdir = . +top_srcdir = ../../../../.. +prefix = /usr/local/japhar +exec_prefix = ${prefix} + +bindir = /usr/local/japhar/bin +sbindir = ${exec_prefix}/sbin +libexecdir = ${exec_prefix}/libexec +datadir = /usr/local/japhar/share +sysconfdir = ${prefix}/etc +sharedstatedir = ${prefix}/com +localstatedir = ${prefix}/var +libdir = ${exec_prefix}/lib +infodir = ${prefix}/info +mandir = ${prefix}/man +includedir = ${prefix}/include +oldincludedir = /usr/include + +DESTDIR = + +pkgdatadir = $(datadir)/classpath +pkglibdir = $(libdir)/classpath +pkgincludedir = $(includedir)/classpath + +top_builddir = ../../../../.. + +ACLOCAL = aclocal +AUTOCONF = autoconf +AUTOMAKE = automake +AUTOHEADER = autoheader + +INSTALL = /usr/bin/install -c +INSTALL_PROGRAM = ${INSTALL} $(AM_INSTALL_PROGRAM_FLAGS) +INSTALL_DATA = ${INSTALL} -m 644 +INSTALL_SCRIPT = ${INSTALL_PROGRAM} +transform = s,x,x, + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = i586-pc-linux-gnu +host_triplet = i586-pc-linux-gnu +AS = @AS@ +AWK = gawk +CC = gcc +CPP = gcc -E +DLLTOOL = @DLLTOOL@ +FIND = /usr/bin/find +GLIB_CFLAGS = -I/usr/lib/glib/include -D_REENTRANT +GLIB_CONFIG = /usr/bin/glib-config +GLIB_LIBS = -L/usr/lib -lgthread -lglib -lpthread +GTK_CFLAGS = -I/usr/X11R6/include -I/usr/lib/glib/include +GTK_CONFIG = /usr/bin/gtk-config +GTK_LIBS = -L/usr/lib -L/usr/X11R6/lib -lgtk -lgdk -rdynamic -lgmodule -lglib -ldl -lXext -lX11 -lm +JAPHAR_CFLAGS = -I/usr/local/japhar/include -I/usr/local/japhar/include/japhar +JAPHAR_CLASSLIB = /usr/local/japhar/share/classes.zip +JAPHAR_CONFIG = /usr/local/japhar/bin/japhar-config +JAPHAR_JABBA = /usr/local/japhar/bin/japhar +JAPHAR_JAVAC = /usr/local/japhar/bin/javac +JAPHAR_JAVAH = /usr/local/japhar/bin/javah +JAPHAR_LIBS = -L/usr/local/japhar/lib -ldl -lpthread -lm -ljni -lruntime -lffi -larch -lz +JAPHAR_PREFIX = /usr/local/japhar +JIKES = /usr/bin/jikes +JVM = yes +LD = /usr/bin/ld +LIBART_CFLAGS = +LIBART_CONFIG = /usr/bin/libart-config +LIBART_LIBS = -L/usr/lib -lart_lgpl -lm +LIBTOOL = $(SHELL) $(top_builddir)/libtool +LIBVERSION = 0:0 +LN_S = ln -s +MAKEINFO = makeinfo +NM = /usr/bin/nm -B +OBJDUMP = @OBJDUMP@ +PACKAGE = classpath +PERL = /usr/bin/perl +RANLIB = ranlib +REMOVE = +SH = /bin/sh +USER_CLASSLIB = /opt/jdk/lib/classes.zip +USER_JABBA = +USER_JAVAH = /opt/jdk/bin/javah +VERSION = 0.01 +ZIP = /usr/bin/zip +prefix = /usr/local/japhar + +EXTRA_DIST = GdkGraphics.java GtkButtonPeer.java GtkCanvasPeer.java GtkCheckboxMenuItemPeer.java GtkCheckboxPeer.java GtkChoicePeer.java GtkClipboard.java GtkComponentPeer.java GtkContainerPeer.java GtkDialogPeer.java GtkFileDialogPeer.java GtkFramePeer.java GtkGenericPeer.java GtkImage.java GtkImagePainter.java GtkLabelPeer.java GtkListPeer.java GtkMainThread.java GtkMenuBarPeer.java GtkMenuComponentPeer.java GtkMenuItemPeer.java GtkMenuPeer.java GtkPanelPeer.java GtkScrollPanePeer.java GtkScrollbarPeer.java GtkTextAreaPeer.java GtkTextComponentPeer.java GtkTextFieldPeer.java GtkToolkit.java GtkWindowPeer.java + +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = ../../../../../include/config.h +CONFIG_CLEAN_FILES = +DIST_COMMON = Makefile.am Makefile.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = gtar +GZIP_ENV = --best +all: all-redirect +.SUFFIXES: +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --gnu gnu/java/awt/peer/gtk/Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + +tags: TAGS +TAGS: + + +distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) + +subdir = gnu/java/awt/peer/gtk + +distdir: $(DISTFILES) + here=`cd $(top_builddir) && pwd`; \ + top_distdir=`cd $(top_distdir) && pwd`; \ + distdir=`cd $(distdir) && pwd`; \ + cd $(top_srcdir) \ + && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu gnu/java/awt/peer/gtk/Makefile + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done +info-am: +info: info-am +dvi-am: +dvi: dvi-am +check-am: all-am +check: check-am +installcheck-am: +installcheck: installcheck-am +install-exec-am: +install-exec: install-exec-am + +install-data-am: +install-data: install-data-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-am +uninstall-am: +uninstall: uninstall-am +all-am: Makefile +all-redirect: all-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: + + +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + +maintainer-clean-generic: +mostlyclean-am: mostlyclean-generic + +mostlyclean: mostlyclean-am + +clean-am: clean-generic mostlyclean-am + +clean: clean-am + +distclean-am: distclean-generic clean-am + -rm -f libtool + +distclean: distclean-am + +maintainer-clean-am: maintainer-clean-generic distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-am + +.PHONY: tags distdir info-am info dvi-am dvi check check-am \ +installcheck-am installcheck install-exec-am install-exec \ +install-data-am install-data install-am install uninstall-am uninstall \ +all-redirect all-am all installdirs mostlyclean-generic \ +distclean-generic clean-generic maintainer-clean-generic clean \ +mostlyclean distclean maintainer-clean + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/gnu/java/awt/peer/gtk/Test.java b/gnu/java/awt/peer/gtk/Test.java index c56512b59..516ea8323 100644 --- a/gnu/java/awt/peer/gtk/Test.java +++ b/gnu/java/awt/peer/gtk/Test.java @@ -33,10 +33,14 @@ class Test public static void main(String args[]) { - Properties prop=System.getProperties (); - prop.put ("awt.toolkit","gnu.java.awt.peer.gtk.GtkToolkit"); + if (args.length == 0) + { + Properties prop=System.getProperties (); + prop.put ("awt.toolkit","gnu.java.awt.peer.gtk.GtkToolkit"); + } final Frame f=new Frame(); + f.setTitle ("Red Hat Classpath"); // f.addComponentListener (new ComponentAdapter() { // public void componentMoved (ComponentEvent e) { @@ -50,7 +54,7 @@ class Test Panel pan=new Panel(); - Label l = new Label ("Pithy Message:"); + final Label l = new Label ("Pithy Message:"); l.setCursor (Cursor.getPredefinedCursor (Cursor.WAIT_CURSOR)); pan.add (l); @@ -59,17 +63,38 @@ class Test final Image img; try { - img = Toolkit.getDefaultToolkit ().createImage (new XBMDecoder (new FileInputStream ("/home/rao/fvwm.xbm"))); + img = Toolkit.getDefaultToolkit ().createImage (new XBMDecoder (new FileInputStream ("fvwm.xbm"))); } catch (FileNotFoundException ex) { img = null; } final Canvas ch = new Canvas () { + + public void update (Graphics g) + { + System.out.println ("update called"); + super.update (g); + } public void paint (Graphics g) { -// g.setColor (Color.blue); -// g.drawLine (xs,ys,xs+20,ys+20); + g.drawString("Hello world!", xs+5, ys+10); + g.setColor (Color.blue); + g.drawLine (xs,ys,xs+20,ys+20); + + System.out.println (TextArea.SCROLLBARS_BOTH); + System.out.println (TextArea.SCROLLBARS_HORIZONTAL_ONLY); + System.out.println (TextArea.SCROLLBARS_VERTICAL_ONLY); + +// Font f1 = new Font ("TimesRoman", Font.PLAIN, 10); +// System.out.println (f1.getName ()); +// System.out.println (f1.getFamily ()); + +// Font font = new Font ("Serif", Font.PLAIN, 18); +// g.setFont (font); +// g.setXORMode (Color.red); - System.out.println (g.drawImage (img, 0, 0, this)); +// System.out.println (g.getFontMetrics (font).stringWidth ("foobar")); + +// System.out.println (g.drawImage (img, 0, 0, this)); } }; @@ -120,57 +145,75 @@ class Test Panel east_panel = new Panel(); east_panel.setLayout(new GridLayout (0,1)); - CheckboxGroup group = new CheckboxGroup(); - - Checkbox cb=new Checkbox("one", group, true); - east_panel.add(cb); - cb=new Checkbox("two", group, false); - east_panel.add(cb); - - cb.addMouseListener(new MouseAdapter() { - public void mousePressed(MouseEvent e) { - System.out.println("mouse pressed cb"); - System.out.println("shift = " + e.isShiftDown()); - System.out.println("meta = " + e.isMetaDown()); - System.out.println("alt = " + e.isAltDown()); - System.out.println("ctrl = " + e.isControlDown()); - System.out.println("x = " + e.getX()); - System.out.println("y = " + e.getY()); - System.out.println("clickcount = " + e.getClickCount()); - System.out.println("when = " + e.getWhen()); - System.out.println(); - } - public void mouseReleased(MouseEvent e) { - System.out.println("mouse released cb"); - } - public void mouseClicked(MouseEvent e) { - System.out.println("mouse clicked cb"); - } - public void mouseEntered(MouseEvent e) { - System.out.println("mouse entered cb"); - } - public void mouseExited(MouseEvent e) { - System.out.println("mouse exited cb"); - } - }); +// CheckboxGroup group = new CheckboxGroup(); + +// Checkbox cb=new Checkbox("one", group, true); +// east_panel.add(cb); +// cb=new Checkbox("two", group, false); +// east_panel.add(cb); + +// cb.addMouseListener(new MouseAdapter() { +// public void mousePressed(MouseEvent e) { +// System.out.println("mouse pressed cb"); +// System.out.println("shift = " + e.isShiftDown()); +// System.out.println("meta = " + e.isMetaDown()); +// System.out.println("alt = " + e.isAltDown()); +// System.out.println("ctrl = " + e.isControlDown()); +// System.out.println("x = " + e.getX()); +// System.out.println("y = " + e.getY()); +// System.out.println("clickcount = " + e.getClickCount()); +// System.out.println("when = " + e.getWhen()); +// System.out.println(); +// } +// public void mouseReleased(MouseEvent e) { +// System.out.println("mouse released cb"); +// } +// public void mouseClicked(MouseEvent e) { +// System.out.println("mouse clicked cb"); +// } +// public void mouseEntered(MouseEvent e) { +// System.out.println("mouse entered cb"); +// } +// public void mouseExited(MouseEvent e) { +// System.out.println("mouse exited cb"); +// } +// }); f.add(east_panel,"East"); - Button wb=new Button(); + final Button wb=new Button(); wb.setLabel("Destroy Frame on Click"); wb.addActionListener (new ActionListener () { public void actionPerformed (ActionEvent e) { - System.out.println ("action listener on wb called"); - Clipboard clip = Toolkit.getDefaultToolkit ().getSystemClipboard (); - StringSelection ss = new StringSelection("123456789"); - clip.setContents (ss, ss); + l.setText ("Hello World!"); + final Dialog d = new Dialog (f); + d.setModal (true); + Button b = new Button ("foobar"); + b.addMouseListener (new MouseAdapter () { + public void mousePressed (MouseEvent e) { + System.out.println ("I got called"); + d.hide (); + + System.out.println (ScrollPane.SCROLLBARS_ALWAYS); + System.out.println (ScrollPane.SCROLLBARS_AS_NEEDED); + System.out.println (ScrollPane.SCROLLBARS_NEVER); + } + }); + d.add (b); + d.pack (); + d.show (); + System.out.println ("hello world"); +// System.out.println ("action listener on wb called"); +// Clipboard clip = Toolkit.getDefaultToolkit ().getSystemClipboard (); +// StringSelection ss = new StringSelection("123456789"); +// clip.setContents (ss, ss); // Transferable t = clip.getContents (this); // try { // System.out.println (t.getTransferData (DataFlavor.stringFlavor)); // } catch (Exception ex) { // ex.printStackTrace (); // } - System.exit (0); +// System.exit (0); } }); diff --git a/gnu/java/awt/peer/gtk/TestAWT.java b/gnu/java/awt/peer/gtk/TestAWT.java index 16faa22a7..94a5af463 100644 --- a/gnu/java/awt/peer/gtk/TestAWT.java +++ b/gnu/java/awt/peer/gtk/TestAWT.java @@ -65,14 +65,14 @@ abstract class PrettyFrame extends Frame ((BorderLayout) getLayout ()).setVgap (5); } - public Insets getInsets() - { - Insets oldInsets = super.getInsets (); - return new Insets (oldInsets.top+10, - oldInsets.left+10, - oldInsets.bottom+10, - oldInsets.right+10); - } +// public Insets getInsets() +// { +// Insets oldInsets = super.getInsets (); +// return new Insets (oldInsets.top+10, +// oldInsets.left+10, +// oldInsets.bottom+10, +// oldInsets.right+10); +// } } abstract class SubFrame extends PrettyFrame implements SubWindow @@ -105,11 +105,13 @@ class MainWindow extends PrettyFrame implements ActionListener MainWindow () { - System.out.println (getInsets ()); + System.out.println ("INSET:" + getInsets ()); MenuBar mb = new MenuBar (); Menu menu = new Menu ("File"); - menu.add (new MenuItem ("Foobar")); + Menu submenu = new Menu ("Testing"); + submenu.add (new CheckboxMenuItem ("Foobar")); + menu.add (submenu); mb.add (menu); setMenuBar (mb); @@ -118,6 +120,7 @@ class MainWindow extends PrettyFrame implements ActionListener closeButton = new Button ("Close"); closeButton.addActionListener (this); + closeButton.setFont (new Font ("Serif", Font.BOLD | Font.ITALIC, 18)); add (closeButton, "South"); windows = new Hashtable (); @@ -144,6 +147,7 @@ class MainWindow extends PrettyFrame implements ActionListener sp.add (p); add (sp, "Center"); + System.out.println (86 + (windows.size ()*22)); setSize (200, 86 + (windows.size ()*22)); setTitle ("TestAWT"); } @@ -157,6 +161,9 @@ class MainWindow extends PrettyFrame implements ActionListener if (source==closeButton) { + System.out.println ("INSET:" + getInsets ()); + System.out.println ("BOUNDS:" + getBounds ()); + System.getProperties ().list (System.out); dispose(); System.exit (0); } @@ -234,7 +241,7 @@ class DialogWindow extends Dialog implements SubWindow public DialogWindow (Frame f) { - super (f); + super (f, true); } public void setVisible (boolean visible) |