2000-10-23 01:46:09 +08:00
|
|
|
/* 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;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* An X11 Pixmap. A pixmap is an offscreen drawable that resides on
|
|
|
|
* the X server. A pixmap is bound to the screen it was created for.
|
|
|
|
*
|
|
|
|
* @author Rolf W. Rasmussen <rolfwr@ii.uib.no>
|
|
|
|
*/
|
|
|
|
public class Pixmap extends Drawable
|
|
|
|
{
|
|
|
|
public Pixmap(XImage image, Screen screen)
|
|
|
|
{
|
|
|
|
this(screen.getRootWindow(),
|
|
|
|
image.getWidth(), image.getHeight(),
|
|
|
|
image.getDepth());
|
|
|
|
|
|
|
|
/* FIXME: don't create a new GC all the time. This might actually
|
|
|
|
not be as bad as initially believed. The GC cache of Xlib makes
|
HACKING, [...]: Fix spelling errors.
* HACKING, gnu/gcj/xlib/Pixmap.java, gnu/gcj/xlib/XException.java,
gnu/java/rmi/rmic/RMIC.java, java/awt/Window.java,
java/awt/AWTEvent.java, java/io/ByteArrayOutputStream.java,
java/io/CharConversionException.java,
java/io/PipedInputStream.java, java/io/PipedReader.java,
java/io/PrintWriter.java, java/io/WriteAbortedException.java,
java/io/natFileWin32.cc, java/lang/Class.h,
java/lang/natClassLoader.cc, java/lang/natObject.cc,
java/lang/Package.java, java/net/BindException.java,
java/net/ConnectException.java, java/net/ProtocolException.java,
java/net/SocketException.java,
java/net/UnknownServiceException.java,
java/security/cert/X509Certificate.java,
java/security/interfaces/DSAKey.java,
java/security/SecureRandom.java, java/security/SignedObject.java,
java/sql/DatabaseMetaData.java,
java/text/DecimalFormatSymbols.java,
java/util/jar/Attributes.java, java/util/jar/JarEntry.java,
java/util/jar/JarInputStream.java,
java/util/jar/JarOutputStream.java, java/util/Calendar.java,
java/util/Collections.java, java/util/GregorianCalendar.java,
java/util/HashMap.java, java/util/List.java,
java/util/Properties.java, java/util/Timer.java,
java/util/Vector.java, java/util/WeakHashMap.java,
javax/naming/NamingException.java,
testsuite/libjava.lang/Thread_Wait.java,
org/xml/sax/helpers/DefaultHandler.java,
org/xml/sax/HandlerBase.java, org/xml/sax/SAXParseException.java,
ChangeLog, acinclude.m4, aclocal.m4, posix-threads.cc: Fix
spelling errors.
* configure: Regenerate.
From-SVN: r46665
2001-10-31 08:48:17 +08:00
|
|
|
this operation less costly. */
|
2000-10-23 01:46:09 +08:00
|
|
|
GC gc = new GC(this);
|
|
|
|
|
|
|
|
gc.putImage(image, 0, 0, 0, 0, image.getWidth(), image.getHeight());
|
|
|
|
}
|
|
|
|
|
|
|
|
public Pixmap(Drawable sameScreenAs, int width, int height, int depth)
|
|
|
|
{
|
|
|
|
super(sameScreenAs.getDisplay(),
|
|
|
|
createXID(sameScreenAs, width, height, depth));
|
|
|
|
}
|
|
|
|
|
|
|
|
protected static native int createXID(Drawable sameScreenAs,
|
|
|
|
int width, int height, int depth);
|
|
|
|
|
|
|
|
protected native void finalize();
|
|
|
|
}
|