mirror of
git://gcc.gnu.org/git/gcc.git
synced 2024-12-25 20:49:48 +08:00
2622c79d2d
* Makefile.am: Added rules for libgcjx library. * Makefile.in: Rebuilt. * configure.in: Added check for X. * configure: Rebuilt. * gnu/awt/LightweightRedirector.java: New file. * gnu/awt/j2d/AbstractGraphicsState.java: New file. * gnu/awt/j2d/DirectRasterGraphics.java: New file. * gnu/awt/j2d/Graphics2DImpl.java: New file. * gnu/awt/j2d/IntegerGraphicsState.java: New file. * gnu/awt/j2d/MappedRaster.java: New file. * gnu/awt/xlib/XCanvasPeer.java: New file. * gnu/awt/xlib/XEventLoop.java: New file. * gnu/awt/xlib/XEventQueue.java: New file. * gnu/awt/xlib/XFontMetrics.java: New file. * gnu/awt/xlib/XFramePeer.java: New file. * gnu/awt/xlib/XGraphics.java: New file. * gnu/awt/xlib/XGraphicsConfiguration.java: New file. * gnu/awt/xlib/XPanelPeer.java: New file. * gnu/awt/xlib/XToolkit.java: New file. * gnu/gcj/xlib/Clip.java: New file. * gnu/gcj/xlib/Colormap.java: New file. * gnu/gcj/xlib/Display.java: New file. * gnu/gcj/xlib/Drawable.java: New file. * gnu/gcj/xlib/Font.java: New file. * gnu/gcj/xlib/GC.java: New file. * gnu/gcj/xlib/Pixmap.java: New file. * gnu/gcj/xlib/Screen.java: New file. * gnu/gcj/xlib/Visual.java: New file. * gnu/gcj/xlib/WMSizeHints.java: New file. * gnu/gcj/xlib/Window.java: New file. * gnu/gcj/xlib/WindowAttributes.java: New file. * gnu/gcj/xlib/XAnyEvent.java: New file. * gnu/gcj/xlib/XButtonEvent.java: New file. * gnu/gcj/xlib/XColor.java: New file. * gnu/gcj/xlib/XConfigureEvent.java: New file. * gnu/gcj/xlib/XConnectException.java: New file. * gnu/gcj/xlib/XEvent.java: New file. * gnu/gcj/xlib/XException.java: New file. * gnu/gcj/xlib/XExposeEvent.java: New file. * gnu/gcj/xlib/XID.java: New file. * gnu/gcj/xlib/XImage.java: New file. * gnu/gcj/xlib/XUnmapEvent.java: New file. * gnu/gcj/xlib/natClip.cc: New file. * gnu/gcj/xlib/natColormap.cc: New file. * gnu/gcj/xlib/natDisplay.cc: New file. * gnu/gcj/xlib/natDrawable.cc: New file. * gnu/gcj/xlib/natFont.cc: New file. * gnu/gcj/xlib/natGC.cc: New file. * gnu/gcj/xlib/natPixmap.cc: New file. * gnu/gcj/xlib/natScreen.cc: New file. * gnu/gcj/xlib/natVisual.cc: New file. * gnu/gcj/xlib/natWMSizeHints.cc: New file. * gnu/gcj/xlib/natWindow.cc: New file. * gnu/gcj/xlib/natWindowAttributes.cc: New file. * gnu/gcj/xlib/natXAnyEvent.cc: New file. * gnu/gcj/xlib/natXButtonEvent.cc: New file. * gnu/gcj/xlib/natXColor.cc: New file. * gnu/gcj/xlib/natXConfigureEvent.cc: New file. * gnu/gcj/xlib/natXException.cc: New file. * gnu/gcj/xlib/natXExposeEvent.cc: New file. * gnu/gcj/xlib/natXImage.cc: New file. * gnu/gcj/xlib/natXUnmapEvent.cc: New file. * java/awt/EventDispatchThread.java: Start thead on creation. From-SVN: r37005
105 lines
2.5 KiB
Java
105 lines
2.5 KiB
Java
/* 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. */
|
|
|
|
package gnu.gcj.xlib;
|
|
|
|
import gnu.gcj.RawData;
|
|
import java.awt.Rectangle;
|
|
|
|
/**
|
|
* An X11 window.
|
|
*
|
|
* @author Rolf W. Rasmussen <rolfwr@ii.uib.no>
|
|
*/
|
|
public class Window extends Drawable
|
|
{
|
|
// Must correspond with X.h definitions:
|
|
public static final int COPY_FROM_PARENT = 0;
|
|
public static final int INPUT_OUTPUT = 1;
|
|
public static final int INPUT_ONLY = 2;
|
|
|
|
public Window(Window parent, Rectangle bounds,
|
|
WindowAttributes attributes)
|
|
{
|
|
this(parent, bounds, attributes, null);
|
|
}
|
|
|
|
public Window(Window parent, Rectangle bounds,
|
|
WindowAttributes attributes, Visual visual)
|
|
{
|
|
this(parent, bounds, 0, attributes, COPY_FROM_PARENT, visual);
|
|
}
|
|
|
|
public Window(Window parent, Rectangle bounds, int borderWidth,
|
|
WindowAttributes attributes, int windowIOClass,
|
|
Visual visual)
|
|
{
|
|
this(parent.display,
|
|
parent.createChildXID(bounds, borderWidth, attributes,
|
|
windowIOClass, visual));
|
|
this.owned = true;
|
|
}
|
|
|
|
protected Window(Display display, int xid)
|
|
{
|
|
super(display, xid);
|
|
display.addXID(xid, this);
|
|
}
|
|
|
|
protected void finalize()
|
|
{
|
|
display.removeXID(xid);
|
|
if (owned)
|
|
{
|
|
destroy();
|
|
owned = false;
|
|
}
|
|
}
|
|
|
|
protected native void destroy();
|
|
|
|
protected native int createChildXID(Rectangle bounds,
|
|
int borderWidth,
|
|
WindowAttributes attributes,
|
|
int windowIOClass,
|
|
Visual visual);
|
|
|
|
public native void setAttributes(WindowAttributes attributes);
|
|
|
|
public native void map();
|
|
public native void unmap();
|
|
|
|
protected boolean owned = false;
|
|
|
|
public native void setProperty(int nameAtom, int typeAtom, byte[] data);
|
|
|
|
public void setProperty(int nameAtom, int typeAtom, String data)
|
|
{
|
|
int length = data.length();
|
|
byte[] byteData = new byte[length];
|
|
|
|
for (int i=0; i<length; i++)
|
|
byteData[i] = (byte) data.charAt(i);
|
|
|
|
setProperty(nameAtom, typeAtom, byteData);
|
|
}
|
|
|
|
public native void setWMProtocols(int[] atoms);
|
|
public native int[] getWMProtocols();
|
|
|
|
public void setProperty(String nameAtom, String typeAtom, String data)
|
|
{
|
|
int xaName = display.getAtom(nameAtom);
|
|
int xaType = display.getAtom(typeAtom);
|
|
|
|
setProperty(xaName, xaType, data);
|
|
}
|
|
|
|
public native void setBounds(int x, int y, int width, int height);
|
|
}
|