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
10 import gnu
.gcj
.RawData
;
14 * Collection of attributes that can be applied to or read from an
17 * <p>TODO: Split this class into two classes. One for the structure
18 * XSetWindowAttributes and one for the XWindowAttributes. However
19 * they should still share this common base class.
21 * @author Rolf W. Rasmussen <rolfwr@ii.uib.no> */
22 public class WindowAttributes
24 // Must match definitions in X.h:
25 public final static long MASK_BUTTON_PRESS
= 1L<< 2,
26 MASK_BUTTON_RELEASE
= 1L<< 3,
27 MASK_EXPOSURE
= 1L<<15,
28 MASK_STRUCTURE_NOTIFY
= 1L<<17;
30 public WindowAttributes()
35 public WindowAttributes(Window from
)
40 private native void initFromWindow(Window from
);
41 private native void init(WindowAttributes copyFrom
);
42 protected native void finalize();
48 WindowAttributes attributes
= (WindowAttributes
) super.clone();
49 // In case of an exception before the stucture is copied.
51 attributes
.out
= null;
53 // FIXME: do anything else?
55 attributes
.init(this);
58 catch (CloneNotSupportedException ex
)
60 // This should never happen.
61 throw new InternalError ();
65 public native void setBackground(long pixel
);
66 public native void setBackground(Pixmap pixmap
);
67 public native void setEventMask(long eventMask
);
69 public void setVisual(Visual visual
)
75 * Retrieve the visual.
77 * @return the visual that is or should be used by a window. null
78 * means CopyFormParent.
80 public native Visual
getVisual();
85 * Reference to XWindowAttribute structure containing attributes
91 * Reference to XSetWindowAttribute structure containing attributes
92 * to be applied to a window.
98 /** null means CopyFromParent during window creation. */
101 public native void apply(Window window
);
103 final RawData
getXSetWindowAttributesStructure()
112 throw new UnsupportedOperationException("not implemented yet");