/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* XAtom is a class that allows you to create and modify X Window properties.
* An X Atom is an identifier for a property that you can set on any X Window.
* Standard X Atom are defined by X11 and these atoms are defined in this class
* for convenience. Common X Atoms like <code>XA_WM_NAME</code> are used to communicate with the
* Window manager to let it know the Window name. The use and protocol for these
* atoms are defined in the Inter client communications converntions manual.
* User specified XAtoms are defined by specifying a name that gets Interned
* by the XServer and an <code>XAtom</code> object is returned. An <code>XAtom</code> can also be created
* by using a pre-exisiting atom like <code>XA_WM_CLASS</code>. A <code>display</code> has to be specified
* in order to create an <code>XAtom</code>. <p> <p>
*
* Once an <code>XAtom</code> instance is created, you can call get and set property methods to
* set the values for a particular window. <p> <p>
*
*
* Example usage : To set the window name for a top level: <p>
* <code>
* XAtom xa = new XAtom(display,XAtom.XA_WM_NAME); <p>
* xa.setProperty(window,"Hello World");<p></code>
*<p>
*<p>
* To get the cut buffer :<p>
* <p><code>
* XAtom xa = new XAtom(display,XAtom.XA_CUT_BUFFER0);<p>
* String selection = xa.getProperty(root_window);<p></code>
* @author Bino George
* @since JDK1.5
*/
public final class XAtom {
// Order of lock: XAWTLock -> XAtom.class
/* Predefined Atoms - automatically extracted from XAtom.h */
return;
}
synchronized (XAtom.class) {
}
}
}
}
synchronized (XAtom.class) {
}
}
synchronized (XAtom.class) {
}
}
/*
* [das]Suggestion:
* 1.Make XAtom immutable.
* 2.Replace public ctors with factory methods (e.g. get() below).
*/
}
return xatom;
}
}
return xatom;
}
try {
} finally {
}
register();
}
return name;
}
} else {
}
}
void register() {
register(this);
}
} else {
}
}
/* interned value of Atom */
/* name of atom */
/* display for X connection */
long display;
/** This constructor will create and intern a new XAtom that is specified
* by the supplied name.
*
* @param display X display to use
* @param name name of the XAtom to create.
* @since 1.5
*/
}
}
/** This constructor will create an instance of XAtom that is specified
* by the predefined XAtom specified by u <code> latom </code>
*
* @param display X display to use.
* @param atom a predefined XAtom.
* @since 1.5
*/
register();
}
/** This constructor will create the instance,
* and if <code>autoIntern</code> is true intern a new XAtom that is specified
* by the supplied name.
*
* @param display X display to use
* @param name name of the XAtom to create.
* @since 1.5
*/
if (autoIntern) {
try {
} finally {
}
}
register();
}
/**
* Creates uninitialized instance of
*/
public XAtom() {
}
/** Sets the window property for the specified window
* @param window window id to use
* @param str value to set to.
* @since 1.5
*/
if (atom == 0) {
throw new IllegalStateException("Atom should be initialized");
}
try {
} finally {
}
}
/**
* Sets UTF8_STRING type property. Explicitly converts str to UTF-8 byte sequence.
*/
if (atom == 0) {
throw new IllegalStateException("Atom should be initialized");
}
try {
}
}
}
/**
* Sets STRING/8 type property. Explicitly converts str to Latin-1 byte sequence.
*/
if (atom == 0) {
throw new IllegalStateException("Atom should be initialized");
}
try {
}
}
}
/** Gets the window property for the specified window
* @param window window id to use
* @param str value to set to.
* @return string with the property.
* @since 1.5
*/
if (atom == 0) {
throw new IllegalStateException("Atom should be initialized");
}
try {
} finally {
}
}
/*
* Auxiliary function that returns the value of 'property' of type
* 'property_type' on window 'window'. Format of the property must be 32.
*/
if (atom == 0) {
throw new IllegalStateException("Atom should be initialized");
}
false, property_type);
try {
return 0;
}
return 0;
}
} finally {
}
}
/**
* Returns value of property of type CARDINAL/32 of this window
*/
}
/**
* Sets property of type CARDINAL on the window
*/
if (atom == 0) {
throw new IllegalStateException("Atom should be initialized");
}
try {
} finally {
}
}
/**
* Sets property of type CARDINAL/32 on the window
*/
}
/**
* Gets uninterpreted set of data from property and stores them in data_ptr.
* Property type is the same as current atom, property is current atom.
* Property format is 32. Property 'delete' is false.
* Returns boolean if requested type, format, length match returned values
* and returned data pointer is not null.
*/
if (atom == 0) {
throw new IllegalStateException("Atom should be initialized");
}
false, this);
try {
return false;
}
)
{
return false;
}
return true;
} finally {
}
}
/**
* Gets uninterpreted set of data from property and stores them in data_ptr.
* Property type is <code>type</code>, property is current atom.
* Property format is 32. Property 'delete' is false.
* Returns boolean if requested type, format, length match returned values
* and returned data pointer is not null.
*/
if (atom == 0) {
throw new IllegalStateException("Atom should be initialized");
}
false, type);
try {
return false;
}
)
{
return false;
}
return true;
} finally {
}
}
/**
* Sets uninterpreted set of data into property from data_ptr.
* Property type is the same as current atom, property is current atom.
* Property format is 32. Mode is PropModeReplace. length is a number
* of items pointer by data_ptr.
*/
if (atom == 0) {
throw new IllegalStateException("Atom should be initialized");
}
try {
} finally {
}
}
/**
* Sets uninterpreted set of data into property from data_ptr.
* Property type is <code>type</code>, property is current atom.
* Property format is 32. Mode is PropModeReplace. length is a number
* of items pointer by data_ptr.
*/
if (atom == 0) {
throw new IllegalStateException("Atom should be initialized");
}
try {
} finally {
}
}
/**
* Sets uninterpreted set of data into property from data_ptr.
* Property type is <code>type</code>, property is current atom.
* Property format is 8. Mode is PropModeReplace. length is a number
* of bytes pointer by data_ptr.
*/
if (atom == 0) {
throw new IllegalStateException("Atom should be initialized");
}
try {
} finally {
}
}
/**
* Deletes property specified by this item on the window.
*/
if (atom == 0) {
throw new IllegalStateException("Atom should be initialized");
}
try {
} finally {
}
}
/**
* Deletes property specified by this item on the window.
*/
if (atom == 0) {
throw new IllegalStateException("Atom should be initialized");
}
try {
} finally {
}
}
try {
} finally {
}
}
/*
* Auxiliary function that returns the value of 'property' of type
* 'property_type' on window 'window'. Format of the property must be 8.
*/
if (atom == 0) {
throw new IllegalStateException("Atom should be initialized");
}
false, property_type);
try {
return null;
}
return null;
}
return res;
} finally {
}
}
/**
* Interns the XAtom
*/
try {
} finally {
}
register();
}
public boolean isInterned() {
if (atom == 0) {
try {
} finally {
}
if (atom == 0) {
return false;
} else {
register();
return true;
}
} else {
return true;
}
}
register();
}
static int getAtomSize() {
return Native.getLongSize();
}
/*
* Returns the value of property ATOM[]/32 as array of XAtom objects
* @return array of atoms, array of length 0 if the atom list is empty
* or has different format
*/
if (atom == 0) {
throw new IllegalStateException("Atom should be initialized");
}
false, XA_ATOM);
try {
return emptyList;
}
return emptyList;
}
if (count == 0) {
return emptyList;
}
}
return res;
} finally {
}
}
/*
* Returns the value of property of type ATOM[]/32 as XAtomList
* @return list of atoms, empty list if the atom list is empty
* or has different format
*/
}
}
}
/**
* Sets property value of type ATOM list to the list of atoms.
*/
}
/**
* Sets property value of type ATOM list to the list of atoms specified by XAtomList
*/
}
/**
* Sets property value of type ATOM list to the list of atoms.
*/
}
/**
* Sets property value of type ATOM list to the list of atoms specified by XAtomList
*/
}
long getAtom() {
return atom;
}
}
}
/**
* Allocated memory to hold the list of native atom data and returns unsafe pointer to it
* Caller should free the memory by himself.
*/
}
}
return data;
}
if (window == 0) {
throw new IllegalArgumentException("Window must not be zero");
}
}
if (!(o instanceof XAtom)) {
return false;
}
}
public int hashCode() {
}
/**
* Sets property on the <code>window</code> to the value <code>window_value</window>
* Property is assumed to be of type WINDOW/32
*/
if (atom == 0) {
throw new IllegalStateException("Atom should be initialized");
}
try {
} finally {
}
}
}
/**
* Gets property on the <code>window</code>. Property is assumed to be
* of type WINDOW/32.
*/
if (atom == 0) {
throw new IllegalStateException("Atom should be initialized");
}
false, XA_WINDOW);
try {
return 0;
}
return 0;
}
} finally {
}
}
}