libjava/ 2007-08-04 Matthias Klose <doko@ubuntu.com> Import GNU Classpath (libgcj-import-20070727). * Regenerate class and header files. * Regenerate auto* files. * include/jvm.h: * jni-libjvm.cc (Jv_JNI_InvokeFunctions): Rename type. * jni.cc (_Jv_JNIFunctions, _Jv_JNI_InvokeFunctions): Likewise. * jni.cc (_Jv_JNI_CallAnyMethodA, _Jv_JNI_CallAnyVoidMethodA, _Jv_JNI_CallMethodA, _Jv_JNI_CallVoidMethodA, _Jv_JNI_CallStaticMethodA, _Jv_JNI_CallStaticVoidMethodA, _Jv_JNI_NewObjectA, _Jv_JNI_SetPrimitiveArrayRegion): Constify jvalue parameter. * java/lang/reflect/natMethod.cc (_Jv_CallAnyMethodA): Likewise. * java/lang/VMFloat.java (toString, parseFloat): New. * gnu/awt/xlib/XToolkit.java (setAlwaysOnTop, isModalityTypeSupported, isModalExclusionTypeSupported): New (stub only). * gnu/awt/xlib/XCanvasPeer.java (requestFocus): Likewise. * gnu/awt/xlib/XFramePeer.java (updateMinimumSize, updateIconImages, updateFocusableWindowState, setModalBlocked, getBoundsPrivate, setAlwaysOnTop): Likewise. * gnu/awt/xlib/XFontPeer.java (canDisplay): Update signature. * scripts/makemake.tcl: Ignore gnu/javax/sound/sampled/gstreamer, ignore javax.sound.sampled.spi.MixerProvider, ignore .in files. * HACKING: Mention --enable-gstreamer-peer, removal of generated files. libjava/classpath/ 2007-08-04 Matthias Klose <doko@ubuntu.com> * java/util/EnumMap.java (clone): Add cast. From-SVN: r127204
63 lines
1.4 KiB
Java
63 lines
1.4 KiB
Java
package gnu.java.awt.peer.x;
|
|
|
|
import gnu.x11.Display;
|
|
import gnu.x11.image.ZPixmap;
|
|
|
|
import java.awt.GraphicsEnvironment;
|
|
import java.awt.image.DataBuffer;
|
|
|
|
/**
|
|
* A DataBuffer implementation that is based on a ZPixmap. This is used
|
|
* as backing store for BufferedImages.
|
|
*/
|
|
class ZPixmapDataBuffer
|
|
extends DataBuffer
|
|
{
|
|
|
|
/**
|
|
* The backing ZPixmap.
|
|
*/
|
|
private ZPixmap zpixmap;
|
|
|
|
/**
|
|
* Creates a new ZPixmapDataBuffer with a specified width and height.
|
|
*
|
|
* @param d the X display
|
|
* @param w the width
|
|
* @param h the height
|
|
*/
|
|
ZPixmapDataBuffer(int w, int h)
|
|
{
|
|
super(TYPE_BYTE, w * h * 3); // TODO: Support non-24-bit-resolutions.
|
|
GraphicsEnvironment env =
|
|
GraphicsEnvironment.getLocalGraphicsEnvironment();
|
|
XGraphicsDevice dev = (XGraphicsDevice) env.getDefaultScreenDevice();
|
|
Display d = dev.getDisplay();
|
|
zpixmap = new ZPixmap(d, w, h, d.default_pixmap_format);
|
|
}
|
|
|
|
/**
|
|
* Creates a ZPixmapDataBuffer from an existing ZPixmap.
|
|
*
|
|
* @param zpixmap the ZPixmap to wrap
|
|
*/
|
|
ZPixmapDataBuffer(ZPixmap zpixmap)
|
|
{
|
|
super(TYPE_BYTE, zpixmap.get_data_length());
|
|
this.zpixmap = zpixmap;
|
|
}
|
|
|
|
@Override
|
|
public int getElem(int bank, int i)
|
|
{
|
|
return 0xff & zpixmap.get_data_element(i);
|
|
}
|
|
|
|
@Override
|
|
public void setElem(int bank, int i, int val)
|
|
{
|
|
zpixmap.set_data_element(i, (byte) val);
|
|
}
|
|
|
|
}
|