Daily bump.
[official-gcc.git] / libjava / gnu / gcj / xlib / Pixmap.java
bloba514d95d52b876f91eebffaadf5f2c76f73b1234
1 /* Copyright (C) 2000 Free Software Foundation
3 This file is part of libgcj.
5 This software is copyrighted work licensed under the terms of the
6 Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
7 details. */
9 package gnu.gcj.xlib;
11 /**
12 * An X11 Pixmap. A pixmap is an offscreen drawable that resides on
13 * the X server. A pixmap is bound to the screen it was created for.
15 * @author Rolf W. Rasmussen <rolfwr@ii.uib.no>
17 public class Pixmap extends Drawable
19 public Pixmap(XImage image, Screen screen)
21 this(screen.getRootWindow(),
22 image.getWidth(), image.getHeight(),
23 image.getDepth());
25 /* FIXME: don't create a new GC all the time. This might actually
26 not be as bad as initially believed. The GC cache of Xlib makes
27 this operation less costly. */
28 GC gc = new GC(this);
30 gc.putImage(image, 0, 0, 0, 0, image.getWidth(), image.getHeight());
33 public Pixmap(Drawable sameScreenAs, int width, int height, int depth)
35 super(sameScreenAs.getDisplay(),
36 createXID(sameScreenAs, width, height, depth));
39 protected static native int createXID(Drawable sameScreenAs,
40 int width, int height, int depth);
42 protected native void finalize();