source: trunk/gcc/libjava/gnu/gcj/xlib/Pixmap.java

Last change on this file was 2, checked in by bird, 22 years ago

Initial revision

  • Property cvs2svn:cvs-rev set to 1.1
  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 1.2 KB
Line 
1/* Copyright (C) 2000 Free Software Foundation
2
3 This file is part of libgcj.
4
5This software is copyrighted work licensed under the terms of the
6Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
7details. */
8
9package gnu.gcj.xlib;
10
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.
14 *
15 * @author Rolf W. Rasmussen <rolfwr@ii.uib.no>
16 */
17public class Pixmap extends Drawable
18{
19 public Pixmap(XImage image, Screen screen)
20 {
21 this(screen.getRootWindow(),
22 image.getWidth(), image.getHeight(),
23 image.getDepth());
24
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);
29
30 gc.putImage(image, 0, 0, 0, 0, image.getWidth(), image.getHeight());
31 }
32
33 public Pixmap(Drawable sameScreenAs, int width, int height, int depth)
34 {
35 super(sameScreenAs.getDisplay(),
36 createXID(sameScreenAs, width, height, depth));
37 }
38
39 protected static native int createXID(Drawable sameScreenAs,
40 int width, int height, int depth);
41
42 protected native void finalize();
43}
Note: See TracBrowser for help on using the repository browser.