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