From aa66a642c1fc139f3a7db4d98dd033bc47d84e05 Mon Sep 17 00:00:00 2001 From: Thomas Fitzsimmons Date: Mon, 1 Dec 2003 18:40:39 +0000 Subject: [PATCH] GtkButtonPeer.java, [...]: Remove files. 2003-12-01 Thomas Fitzsimmons * gnu/awt/gtk/GtkButtonPeer.java, gnu/awt/gtk/gtkcommon.cc, gnu/awt/gtk/gtkcommon.h, gnu/awt/gtk/GtkComponentPeer.java, gnu/awt/gtk/GtkContainerPeer.java, gnu/awt/gtk/GtkFramePeer.java, gnu/awt/gtk/GtkLabelPeer.java, gnu/awt/gtk/GtkMainThread.java, gnu/awt/gtk/GtkToolkit.java, gnu/awt/gtk/GtkWindowPeer.java, gnu/awt/gtk/natGtkButtonPeer.cc, gnu/awt/gtk/natGtkComponentPeer.cc, gnu/awt/gtk/natGtkContainerPeer.cc, gnu/awt/gtk/natGtkFramePeer.cc, gnu/awt/gtk/natGtkLabelPeer.cc, gnu/awt/gtk/natGtkMainThread.cc, gnu/awt/gtk/natGtkToolkit.cc, gnu/awt/gtk/natGtkWindowPeer.cc: Remove files. From-SVN: r74118 --- libjava/ChangeLog | 12 + libjava/gnu/awt/gtk/GtkButtonPeer.java | 61 ---- libjava/gnu/awt/gtk/GtkComponentPeer.java | 269 ------------------ libjava/gnu/awt/gtk/GtkContainerPeer.java | 55 ---- libjava/gnu/awt/gtk/GtkFramePeer.java | 42 --- libjava/gnu/awt/gtk/GtkLabelPeer.java | 37 --- libjava/gnu/awt/gtk/GtkMainThread.java | 36 --- libjava/gnu/awt/gtk/GtkToolkit.java | 314 --------------------- libjava/gnu/awt/gtk/GtkWindowPeer.java | 39 --- libjava/gnu/awt/gtk/gtkcommon.cc | 14 - libjava/gnu/awt/gtk/gtkcommon.h | 85 ------ libjava/gnu/awt/gtk/natGtkButtonPeer.cc | 52 ---- libjava/gnu/awt/gtk/natGtkComponentPeer.cc | 265 ----------------- libjava/gnu/awt/gtk/natGtkContainerPeer.cc | 15 - libjava/gnu/awt/gtk/natGtkFramePeer.cc | 51 ---- libjava/gnu/awt/gtk/natGtkLabelPeer.cc | 59 ---- libjava/gnu/awt/gtk/natGtkMainThread.cc | 22 -- libjava/gnu/awt/gtk/natGtkToolkit.cc | 75 ----- libjava/gnu/awt/gtk/natGtkWindowPeer.cc | 40 --- 19 files changed, 12 insertions(+), 1531 deletions(-) delete mode 100644 libjava/gnu/awt/gtk/GtkButtonPeer.java delete mode 100644 libjava/gnu/awt/gtk/GtkComponentPeer.java delete mode 100644 libjava/gnu/awt/gtk/GtkContainerPeer.java delete mode 100644 libjava/gnu/awt/gtk/GtkFramePeer.java delete mode 100644 libjava/gnu/awt/gtk/GtkLabelPeer.java delete mode 100644 libjava/gnu/awt/gtk/GtkMainThread.java delete mode 100644 libjava/gnu/awt/gtk/GtkToolkit.java delete mode 100644 libjava/gnu/awt/gtk/GtkWindowPeer.java delete mode 100644 libjava/gnu/awt/gtk/gtkcommon.cc delete mode 100644 libjava/gnu/awt/gtk/gtkcommon.h delete mode 100644 libjava/gnu/awt/gtk/natGtkButtonPeer.cc delete mode 100644 libjava/gnu/awt/gtk/natGtkComponentPeer.cc delete mode 100644 libjava/gnu/awt/gtk/natGtkContainerPeer.cc delete mode 100644 libjava/gnu/awt/gtk/natGtkFramePeer.cc delete mode 100644 libjava/gnu/awt/gtk/natGtkLabelPeer.cc delete mode 100644 libjava/gnu/awt/gtk/natGtkMainThread.cc delete mode 100644 libjava/gnu/awt/gtk/natGtkToolkit.cc delete mode 100644 libjava/gnu/awt/gtk/natGtkWindowPeer.cc diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 99942b47361..0b541eb2a21 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,5 +1,17 @@ 2003-12-01 Thomas Fitzsimmons + * gnu/awt/gtk/GtkButtonPeer.java, gnu/awt/gtk/gtkcommon.cc, + gnu/awt/gtk/gtkcommon.h, gnu/awt/gtk/GtkComponentPeer.java, + gnu/awt/gtk/GtkContainerPeer.java, + gnu/awt/gtk/GtkFramePeer.java, gnu/awt/gtk/GtkLabelPeer.java, + gnu/awt/gtk/GtkMainThread.java, gnu/awt/gtk/GtkToolkit.java, + gnu/awt/gtk/GtkWindowPeer.java, gnu/awt/gtk/natGtkButtonPeer.cc, + gnu/awt/gtk/natGtkComponentPeer.cc, + gnu/awt/gtk/natGtkContainerPeer.cc, + gnu/awt/gtk/natGtkFramePeer.cc, gnu/awt/gtk/natGtkLabelPeer.cc, + gnu/awt/gtk/natGtkMainThread.cc, gnu/awt/gtk/natGtkToolkit.cc, + gnu/awt/gtk/natGtkWindowPeer.cc: Remove files. + * jni/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.c (closed): Mark loader parameter as unused. diff --git a/libjava/gnu/awt/gtk/GtkButtonPeer.java b/libjava/gnu/awt/gtk/GtkButtonPeer.java deleted file mode 100644 index 62ad4199da9..00000000000 --- a/libjava/gnu/awt/gtk/GtkButtonPeer.java +++ /dev/null @@ -1,61 +0,0 @@ -/* GtkButtonPeer.java -- Implements ButtonPeer with GTK - Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc. - -This file is part of the peer AWT libraries of GNU Classpath. - -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 version. - -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.awt.gtk; - -import java.awt.*; -import java.awt.event.MouseEvent; -import java.awt.event.KeyEvent; -import java.awt.peer.*; - -public class GtkButtonPeer extends GtkComponentPeer - implements ButtonPeer -{ - protected native void create (); - public native void setLabel (String label); - - public GtkButtonPeer (Button b) - { - super (b); - } - - public void handleEvent (AWTEvent e) - { -// if (e.getID () == MouseEvent.MOUSE_CLICKED && isEnabled () -// && !modalHasGrab ()) -// { -// MouseEvent me = (MouseEvent) e; -// if (!me.isConsumed () -// && (me.getModifiers () & MouseEvent.BUTTON1_MASK) != 0) -// postActionEvent (((Button)awtComponent).getActionCommand (), -// me.getModifiers ()); -// } - -// if (e.getID () == KeyEvent.KEY_PRESSED) -// { -// KeyEvent ke = (KeyEvent) e; -// if (!ke.isConsumed () && ke.getKeyCode () == KeyEvent.VK_SPACE) -// postActionEvent (((Button)awtComponent).getActionCommand (), -// ke.getModifiers ()); -// } - - super.handleEvent (e); - } -} diff --git a/libjava/gnu/awt/gtk/GtkComponentPeer.java b/libjava/gnu/awt/gtk/GtkComponentPeer.java deleted file mode 100644 index 82d2714c81e..00000000000 --- a/libjava/gnu/awt/gtk/GtkComponentPeer.java +++ /dev/null @@ -1,269 +0,0 @@ -/* GtkComponentPeer.java -- Implements ComponentPeer with GTK - Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc. - -This file is part of the peer AWT libraries of GNU Classpath. - -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 version. - -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.awt.gtk; - -import java.awt.*; -import java.awt.event.*; -import java.awt.image.*; -import java.awt.peer.ComponentPeer; - -public abstract class GtkComponentPeer implements ComponentPeer -{ - // We need to put a reference to the Event Queue somewhere. This seems like - // a convenient place. - static EventQueue eventQueue = new EventQueue(); - - Component awtComponent; - gnu.gcj.RawData ptr; // Actual gtk object. - - static - { - // This will start the main toolkit thread. - GtkToolkit.instance.init(); - } - - public int checkImage (Image image, int width, int height, - ImageObserver observer) - { - return -1; - /* - GtkImage i = (GtkImage) image; - return i.checkImage (); - */ - } - - public Image createImage (ImageProducer producer) - { - return null; - //return new GtkImage (producer, null); - } - - public Image createImage (int width, int height) - { - return null; - /* - GdkGraphics g = new GdkGraphics (width, height); - return new GtkOffScreenImage (null, g, width, height); - */ - } - - public void disable () - { - setEnabled (false); - } - - native public void dispose (); - - public void enable () - { - setEnabled (true); - } - - /** - * Get the graphics configuration of the component. The color model - * of the component can be derived from the configuration. - */ - public GraphicsConfiguration getGraphicsConfiguration () - { - return null; - } - - public FontMetrics getFontMetrics (Font font) - { - return null; - //return new GdkFontMetrics (font); - } - - public Graphics getGraphics () - { - throw new InternalError (); - } - - public native Point getLocationOnScreen (); - public native Dimension getMinimumSize(); - public native Dimension getPreferredSize(); - - public Toolkit getToolkit () - { - return GtkToolkit.instance; - } - - public void handleEvent(AWTEvent e) - { - } - - public void hide () - { - setVisible (false); - } - - public void show () - { - setVisible (true); - } - - public boolean isFocusTraversable () - { - return true; - } - - public Dimension minimumSize () - { - return getMinimumSize(); - } - - public Dimension preferredSize() - { - return getPreferredSize(); - } - - public void paint (Graphics g) - { - awtComponent.paint (g); // ??? - } - - public boolean prepareImage (Image image, int width, int height, - ImageObserver observer) - { - /* - GtkImage i = (GtkImage) image; - - if (i.isLoaded ()) return true; - - class PrepareImage extends Thread - { - GtkImage image; - ImageObserver observer; - - PrepareImage (GtkImage image, ImageObserver observer) - { - this.image = image; - this.observer = observer; - } - - public void run () - { - // XXX: need to return data to image observer - image.source.startProduction (null); - } - } - - new PrepareImage (i, observer).start (); - */ - return false; - } - - public void print (Graphics g) - { - throw new RuntimeException (); - } - - native public void requestFocus (); - - public void repaint (long tm, int x, int y, int width, int height) - { - // ??? - eventQueue.postEvent (new PaintEvent ( - awtComponent, PaintEvent.UPDATE, new Rectangle (x, y, width, height))); - } - - - public void reshape (int x, int y, int width, int height) - { - setBounds (x, y, width, height); - } - - public native void setBounds (int x, int y, int width, int height); - public native void setCursor (Cursor cursor); - - public native void setEnabled (boolean b); - - public native void setEventMask(long eventMask); - public native void setFont(Font font); - public native void setForeground(Color color); - public native void setBackground (Color c); - public native void setVisible(boolean visible); - - native void realize(); - - protected GtkComponentPeer (Component awtComponent) - { - this.awtComponent = awtComponent; - create(); - - // TODO: Each of these calls will currently perform a separate native lock. - // It may be desirable to use our own, recusive mutex implementation by - // passing our threads implementation to g_threads_init(). - // This would greatly reduce locking calls in the peer code, and allow us - // to aquire the lock from java code. - Rectangle r = awtComponent.getBounds(); - setBounds (r.x, r.y, r.width, r.height); - - Color c = awtComponent.getForeground(); - if (c != null) - setForeground (c); - c = awtComponent.getBackground(); - if (c != null) - setBackground (c); - setEnabled (awtComponent.isEnabled()); - Font f = awtComponent.getFont(); - if (f != null) - setFont (awtComponent.getFont()); - - realize(); - } - - protected native void create (); - - // FIXME: It may make sense to do the following directly from the native - // code. - protected void postMouseEvent(int id, long when, int mods, int x, int y, - int clickCount, boolean popupTrigger) - { - eventQueue.postEvent(new MouseEvent(awtComponent, id, when, mods, x, y, - clickCount, popupTrigger)); - } - - protected void postExposeEvent (int x, int y, int width, int height) - { - eventQueue.postEvent (new PaintEvent (awtComponent, PaintEvent.PAINT, - new Rectangle (x, y, width, height))); - } - - protected void postKeyEvent (int id, long when, int mods, - int keyCode, char keyChar) - { - eventQueue.postEvent (new KeyEvent (awtComponent, id, when, mods, - keyCode, keyChar)); - } - - protected void postFocusEvent (int id, boolean temporary) - { - eventQueue.postEvent (new FocusEvent (awtComponent, id, temporary)); - } - - protected void postItemEvent (Object item, int stateChange) - { - eventQueue.postEvent (new ItemEvent ((ItemSelectable)awtComponent, - ItemEvent.ITEM_STATE_CHANGED, - item, stateChange)); - } -} diff --git a/libjava/gnu/awt/gtk/GtkContainerPeer.java b/libjava/gnu/awt/gtk/GtkContainerPeer.java deleted file mode 100644 index 18f4f6b75ea..00000000000 --- a/libjava/gnu/awt/gtk/GtkContainerPeer.java +++ /dev/null @@ -1,55 +0,0 @@ -/* GtkContainerPeer.java -- Implements ContainerPeer with GTK - Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc. - -This file is part of the peer AWT libraries of GNU Classpath. - -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 version. - -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.awt.gtk; - -import java.awt.*; -import java.awt.event.*; -import java.awt.peer.ContainerPeer; - -public abstract class GtkContainerPeer extends GtkComponentPeer - implements ContainerPeer -{ - // FIXME? - static Insets insets = new Insets(0,0,0,0); - - protected GtkContainerPeer (Container awtContainer) - { - super (awtContainer); - } - - public Insets getInsets() - { - // FIXME? - return insets; - } - - public void beginValidate() - { - // FIXME - } - - public void endValidate() - { - // FIXME - } - - protected native void create(); -} diff --git a/libjava/gnu/awt/gtk/GtkFramePeer.java b/libjava/gnu/awt/gtk/GtkFramePeer.java deleted file mode 100644 index e73a55bea7f..00000000000 --- a/libjava/gnu/awt/gtk/GtkFramePeer.java +++ /dev/null @@ -1,42 +0,0 @@ -/* GtkFramePeer.java -- Implements FramePeer with GTK - Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc. - -This file is part of the peer AWT libraries of GNU Classpath. - -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 version. - -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.awt.gtk; - -import java.awt.*; -import java.awt.event.*; -import java.awt.peer.FramePeer; - -public class GtkFramePeer extends GtkWindowPeer - implements FramePeer -{ - protected GtkFramePeer (Frame awtFrame) - { - super (awtFrame); - //init (); - } - - public native void setIconImage(Image image); - public native void setMenuBar(MenuBar mb); - public native void setResizable(boolean resizable); - public native void setTitle(String title); - - protected native void create(); -} diff --git a/libjava/gnu/awt/gtk/GtkLabelPeer.java b/libjava/gnu/awt/gtk/GtkLabelPeer.java deleted file mode 100644 index 46743c61923..00000000000 --- a/libjava/gnu/awt/gtk/GtkLabelPeer.java +++ /dev/null @@ -1,37 +0,0 @@ -/* GtkLabelPeer.java -- Implements LabelPeer with GTK - Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc. - -This file is part of the peer AWT libraries of GNU Classpath. - -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 version. - -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.awt.gtk; - -import java.awt.*; -import java.awt.peer.*; - -public class GtkLabelPeer extends GtkComponentPeer - implements LabelPeer -{ - public GtkLabelPeer (Label l) - { - super (l); - } - - public native void setText (String text); - public native void setAlignment (int alignment); - protected native void create (); -} diff --git a/libjava/gnu/awt/gtk/GtkMainThread.java b/libjava/gnu/awt/gtk/GtkMainThread.java deleted file mode 100644 index efe22153ed1..00000000000 --- a/libjava/gnu/awt/gtk/GtkMainThread.java +++ /dev/null @@ -1,36 +0,0 @@ -/* GtkMainThread.java -- Runs gtk_main() - Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc. - -This file is part of the peer AWT libraries of GNU Classpath. - -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 version. - -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.awt.gtk; - -public class GtkMainThread extends Thread -{ - native void gtkMain(); - - public GtkMainThread() - { - super ("GtkMain"); - } - - public void run() - { - gtkMain(); - } -} diff --git a/libjava/gnu/awt/gtk/GtkToolkit.java b/libjava/gnu/awt/gtk/GtkToolkit.java deleted file mode 100644 index 4173e5e9b40..00000000000 --- a/libjava/gnu/awt/gtk/GtkToolkit.java +++ /dev/null @@ -1,314 +0,0 @@ -/* GtkToolkit.java -- Implements an AWT Toolkit using GTK for peers - Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc. - -This file is part of the peer AWT libraries of GNU Classpath. - -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 version. - -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.awt.gtk; - -import java.awt.*; -import java.net.*; -import java.util.Hashtable; -import java.util.Properties; -import java.util.MissingResourceException; -import java.awt.datatransfer.*; -import java.awt.image.*; -import java.awt.peer.*; - -public class GtkToolkit extends java.awt.Toolkit -{ - static GtkMainThread gtkthread; - static EventQueue evtqueue; - static Hashtable containers = new Hashtable(); - static Clipboard systemClipboard; - static GtkToolkit instance = null; - - public GtkToolkit () - { - gtkInit(); - instance = this; - //systemClipboard = new GtkClipboard (); - } - - // Start the thread to run the GTK event loop. This is called from - // a GtkComponentPeer static initializer. - void init () - { - gtkthread = new GtkMainThread (); - gtkthread.start(); - } - - static native void gtkInit(); - - native public void beep (); - - public int checkImage (Image image, int width, int height, - ImageObserver observer) - { - return ImageObserver.ALLBITS; - -// GtkImage i = (GtkImage) image; -// return i.checkImage (); - } - - public Image createImage(String filename) - { - return null; - } - - public Image createImage(URL url) - { - return null; - } - - public Image createImage (ImageProducer producer) - { -// return new GtkImage (producer, null); - return null; - } - - public Image createImage (byte[] imagedata, int imageoffset, - int imagelength) - { - System.out.println ("createImage byte[] NOT SUPPORTED"); - return null; - } - - public ColorModel getColorModel () - { - return ColorModel.getRGBdefault (); - } - - public String[] getFontList () - { - return (new String[] { "Dialog", - "DialogInput", - "Monospaced", - "Serif", - "SansSerif" }); - } - - public FontMetrics getFontMetrics (Font font) - { -// return new GdkFontMetrics (font); - return null; - } - - public Image getImage (String filename) - { -// return new GtkImage (new GdkPixbufDecoder (filename), null); - return null; - } - - public Image getImage (URL url) - { -// return new GtkImage (new GdkPixbufDecoder (url), null); - return null; - } - - /* - public PrintJob getPrintJob (Frame frame, String jobtitle, Properties props) - { - return null; - } - */ - native public int getScreenResolution(); - - native public Dimension getScreenSize (); - - public Clipboard getSystemClipboard() - { - return systemClipboard; - } - - public boolean prepareImage (Image image, int width, int height, - ImageObserver observer) - { - return false; - } - - native public void sync (); - - protected void setComponentState (Component c, GtkComponentPeer cp) - { - /* Make the Peer reflect the state of the Component */ - if (! (c instanceof Window)) - { - cp.setCursor (c.getCursor ()); - - Rectangle bounds = c.getBounds (); - cp.setBounds (bounds.x, bounds.y, bounds.width, bounds.height); - if (c instanceof Canvas) - System.out.println ("width " + bounds.width + " height " + bounds.height); - - cp.setVisible (c.isVisible ()); - } - } - - protected ButtonPeer createButton (Button b) - { - return null; - /* - GtkButtonPeer bp = new GtkButtonPeer (b); - Rectangle bounds = b.getBounds (); - bp.setBounds (bounds.x, bounds.y, bounds.width, bounds.height); - return bp; - */ - } - - protected CanvasPeer createCanvas (Canvas c) - { -// return new GtkCanvasPeer (c); - return null; - } - - protected CheckboxPeer createCheckbox (Checkbox cb) - { - return null; - /* - if (cb.getCheckboxGroup () != null) - return new GtkRadioButtonPeer (cb); - else - return new GtkCheckButtonPeer (cb); - */ - } - - protected CheckboxMenuItemPeer createCheckboxMenuItem (CheckboxMenuItem cmi) - { - return null; - //return new GtkCheckboxMenuItemPeer (cmi); - } - - protected ChoicePeer createChoice (Choice c) - { - return null; - //return new GtkChoicePeer (c); - } - - protected DialogPeer createDialog (Dialog d) - { - return null; - //return new GtkDialogPeer (d); - } - - protected FileDialogPeer createFileDialog (FileDialog fd) - { - return null; - //return new GtkFileDialogPeer (fd); - } - - protected FramePeer createFrame (Frame f) - { - return new GtkFramePeer (f); - } - - protected LabelPeer createLabel (Label label) - { - return null; - //return new GtkLabelPeer (label); - } - - protected ListPeer createList (List list) - { - return null; - //return new GtkListPeer (list); - } - - protected MenuPeer createMenu (Menu m) - { - return null; - //return new GtkMenuPeer (m); - } - - protected MenuBarPeer createMenuBar (MenuBar mb) - { - return null; - //return new GtkMenuBarPeer (mb); - } - - protected MenuItemPeer createMenuItem (MenuItem mi) - { - return null; - //return new GtkMenuItemPeer (mi); - } - - protected PanelPeer createPanel (Panel p) - { - return null; - //return new GtkPanelPeer (p); - } - - protected PopupMenuPeer createPopupMenu (PopupMenu target) - { - return null; - //return new GtkPopupMenuPeer (target); - } - - protected ScrollPanePeer createScrollPane (ScrollPane sp) - { - return null; - //return new GtkScrollPanePeer (sp); - } - - protected ScrollbarPeer createScrollbar (Scrollbar sb) - { - return null; - //return new GtkScrollbarPeer (sb); - } - - protected TextAreaPeer createTextArea (TextArea ta) - { - return null; - //return new GtkTextAreaPeer (ta); - } - - protected TextFieldPeer createTextField (TextField tf) - { - return null; - //return new GtkTextFieldPeer (tf); - } - - protected WindowPeer createWindow (Window w) - { - return new GtkWindowPeer (w); - } - - protected FontPeer getFontPeer (String name, int style) - { - return null; - /* - try - { - GtkFontPeer fp = new GtkFontPeer (name, style); - return fp; - } - catch (MissingResourceException ex) - { - return null; - } - */ - } - - protected EventQueue getSystemEventQueueImpl() - { - return GtkComponentPeer.eventQueue; - } - - protected void loadSystemColors (int[] systemColors) - { - } -} diff --git a/libjava/gnu/awt/gtk/GtkWindowPeer.java b/libjava/gnu/awt/gtk/GtkWindowPeer.java deleted file mode 100644 index a2428362d1d..00000000000 --- a/libjava/gnu/awt/gtk/GtkWindowPeer.java +++ /dev/null @@ -1,39 +0,0 @@ -/* GtkWindowPeer.java -- Implements WindowPeer with GTK - Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc. - -This file is part of the peer AWT libraries of GNU Classpath. - -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 version. - -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.awt.gtk; - -import java.awt.*; -import java.awt.event.*; -import java.awt.peer.WindowPeer; - -public class GtkWindowPeer extends GtkContainerPeer - implements WindowPeer -{ - protected GtkWindowPeer (Window awtWindow) - { - super (awtWindow); - } - - public native void toBack(); - public native void toFront(); - - protected native void create(); -} diff --git a/libjava/gnu/awt/gtk/gtkcommon.cc b/libjava/gnu/awt/gtk/gtkcommon.cc deleted file mode 100644 index 6a12130da89..00000000000 --- a/libjava/gnu/awt/gtk/gtkcommon.cc +++ /dev/null @@ -1,14 +0,0 @@ -// -*- c++ -*- -// gtkutils.cc - Common functions for the gtk AWT peers. - -/* Copyright (C) 2000 Free Software Foundation - - This file is part of libgcj. - -This software is copyrighted work licensed under the terms of the -Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -details. */ - -#include - -#include "gtkcommon.h" diff --git a/libjava/gnu/awt/gtk/gtkcommon.h b/libjava/gnu/awt/gtk/gtkcommon.h deleted file mode 100644 index 207d2cf1f0e..00000000000 --- a/libjava/gnu/awt/gtk/gtkcommon.h +++ /dev/null @@ -1,85 +0,0 @@ -// -*- c++ -*- -// gtkutils.h - Common defines and inline functions for the gtk AWT peers. - -/* Copyright (C) 2000 Free Software Foundation - - This file is part of libgcj. - -This software is copyrighted work licensed under the terms of the -Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -details. */ - -#ifndef __GTKCOMMON_H__ -#define __GTKCOMMON_H__ - -#include -#include - -#include - -class _Jv_GdkThreadLock -{ -public: - _Jv_GdkThreadLock () - { - GDK_THREADS_ENTER (); - } - - ~_Jv_GdkThreadLock () - { - GDK_THREADS_LEAVE (); - } -}; - -// Convert AWT Color to gdk color value. -static inline void -_Jv_ConvertAwtColor(java::awt::Color* awtcolor, GdkColor* gdkcolor) -{ - jint rgb = awtcolor->getRGB(); - gushort r = (rgb >> 16) & 0xFF; - gushort g = (rgb >> 8) & 0xFF; - gushort b = rgb & 0xFF; - - gdkcolor->red = (r << 8) + r; - gdkcolor->green = (g << 8) + g; - gdkcolor->blue = (b << 8) + b; - - // FIXME: Deal with colormap? gdk_color_alloc()? -} - -// Convert gdk color value to AWT Color. -static inline java::awt::Color* -_Jv_ConvertGtkColor (GdkColor* gdkcolor) -{ - jint r = gdkcolor->red >> 8; - jint g = gdkcolor->green >> 8; - jint b = gdkcolor->blue >> 8; - - java::awt::Color *c = new java::awt::Color(r,g,b); - - return c; -} - -static inline void -_Jv_GdkScaleColor (GdkColor* oldc, GdkColor* newc, gfloat scale) -{ - // FIXME: Need to deal with overflows or find a better way - *newc = *oldc; - newc->red += (gushort) (newc->red * scale); - newc->green += (gushort) (newc->green * scale); - newc->blue += (gushort) (newc->blue * scale); -} - -// Normally the X queue gets flushed automatically when gtk's event loop goes -// idle. However, some calls do not cause any activitity on the event loop, -// so we need to occasionally flush pending requests manually because we arn't -// running from the gtk_main thread. Note that gdk_flush calls XSync(), which -// is more than what is needed here. -static inline void -_Jv_FlushRequests () -{ - // FIXME: What about platforms that arn't X? - XFlush (GDK_DISPLAY ()); -} - -#endif /* __GTKUTILS_H__ */ diff --git a/libjava/gnu/awt/gtk/natGtkButtonPeer.cc b/libjava/gnu/awt/gtk/natGtkButtonPeer.cc deleted file mode 100644 index bc1c79a0e1f..00000000000 --- a/libjava/gnu/awt/gtk/natGtkButtonPeer.cc +++ /dev/null @@ -1,52 +0,0 @@ -// Native Gtk AWT button code - -#include - -#include - -#include "gtkcommon.h" -#include -#include - -void -gnu::awt::gtk::GtkButtonPeer::setLabel (java::lang::String *label) -{ - _Jv_GdkThreadLock sync; - jsize len = 0; - if (label) - len = JvGetStringUTFLength (label); - char buf[len + 1]; - // FIXME: this can allocate an unbounded amount. Should use heap - // even though it is slower. - if (label) - JvGetStringUTFRegion (label, 0, label->length(), buf); - buf[len] = '\0'; - // The button child is a label. - GtkBin *bin = GTK_BIN (ptr); - gtk_label_set_text (GTK_LABEL (bin->child), buf); -} - -void -gnu::awt::gtk::GtkButtonPeer::create () -{ - if (! ptr) - { - _Jv_GdkThreadLock sync; - // This is a little inefficient. - ptr = (gnu::gcj::RawData *) gtk_button_new_with_label (""); - - using namespace ::java::awt; - Button *button = reinterpret_cast