From 554fd8c5195424bdbcabf5de30fdc183aba391bd Mon Sep 17 00:00:00 2001 From: upstream source tree Date: Sun, 15 Mar 2015 20:14:05 -0400 Subject: obtained gcc-4.6.4.tar.bz2 from upstream website; verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository. --- libjava/gnu/gcj/xlib/WindowAttributes.java | 114 +++++++++++++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 libjava/gnu/gcj/xlib/WindowAttributes.java (limited to 'libjava/gnu/gcj/xlib/WindowAttributes.java') diff --git a/libjava/gnu/gcj/xlib/WindowAttributes.java b/libjava/gnu/gcj/xlib/WindowAttributes.java new file mode 100644 index 000000000..23be37d63 --- /dev/null +++ b/libjava/gnu/gcj/xlib/WindowAttributes.java @@ -0,0 +1,114 @@ +/* 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; +import gnu.gcj.RawData; + +/** + * + * Collection of attributes that can be applied to or read from an + * X11 window. + * + *

TODO: Split this class into two classes. One for the structure + * XSetWindowAttributes and one for the XWindowAttributes. However + * they should still share this common base class. + * + * @author Rolf W. Rasmussen */ +public class WindowAttributes +{ + // Must match definitions in X.h: + public final static long MASK_BUTTON_PRESS = 1L<< 2, + MASK_BUTTON_RELEASE = 1L<< 3, + MASK_EXPOSURE = 1L<<15, + MASK_STRUCTURE_NOTIFY = 1L<<17; + + public WindowAttributes() + { + init(null); + } + + public WindowAttributes(Window from) + { + initFromWindow(from); + } + + private native void initFromWindow(Window from); + private native void init(WindowAttributes copyFrom); + protected native void finalize(); + + public Object clone() + { + try + { + WindowAttributes attributes = (WindowAttributes) super.clone(); + // In case of an exception before the stucture is copied. + attributes.in = null; + attributes.out = null; + + // FIXME: do anything else? + + attributes.init(this); + return attributes; + } + catch (CloneNotSupportedException ex) + { + // This should never happen. + throw new InternalError (); + } + } + + public native void setBackground(long pixel); + public native void setBackground(Pixmap pixmap); + public native void setEventMask(long eventMask); + + public void setVisual(Visual visual) + { + this.visual = visual; + } + + /** + * Retrieve the visual. + * + * @return the visual that is or should be used by a window. null + * means CopyFormParent. + */ + public native Visual getVisual(); + + Display display; + + /** + * Reference to XWindowAttribute structure containing attributes + * read from a window. + */ + RawData in = null; + + /** + * Reference to XSetWindowAttribute structure containing attributes + * to be applied to a window. + */ + RawData out = null; + + long mask; + + /** null means CopyFromParent during window creation. */ + Visual visual = null; + + public native void apply(Window window); + + final RawData getXSetWindowAttributesStructure() + { + if (out == null) + initOut(); + return out; + } + + void initOut() + { + throw new UnsupportedOperationException("not implemented yet"); + } +} -- cgit v1.2.3