/*
* 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.
*/
/*
* This code is ported to XAWT from MAWT based on awt_mgrsel.c
* code written originally by Valeriy Ushakov
* Author : Bino George
*/
public class XMSelection {
/*
* A method for a subsytem to express its interest in a certain
* manager selection.
*
* If owner changes, the ownerChanged of the XMSelectionListener
* will be called with the screen
* number and the new owning window when onwership is established, or
* None if the owner is gone.
*
* Events in extra_mask are selected for on owning windows (exsiting
* ones and on new owners when established) and otherEvent of the
* XMWSelectionListener will be called with the screen number and an event.
*
* The function returns an array of current owners. The size of the
* array is ScreenCount(awt_display). The array is "owned" by this
* module and should be considered by the caller as read-only.
*/
/* Name of the selection */
/* list of listeners to be called for events */
/* X atom array (one per screen) for this selection */
/* Window ids of selection owners */
long owners[];
/* event mask to set */
long eventMask;
static int numScreens;
static {
try {
} finally {
}
}
selectionMap = new HashMap();
}
try {
new XEventDispatcher() {
}
});
} finally {
}
}
public int getNumberOfScreens() {
return numScreens;
}
}
}
try {
synchronized(this) {
if (log.isLoggable(PlatformLogger.FINE)) log.fine("New Selection Owner for screen " + screen + " = " + owner );
new XEventDispatcher() {
}
});
}
} finally {
}
}
try {
try {
synchronized(this) {
if (log.isLoggable(PlatformLogger.FINE)) log.fine("Screen = " + screen + " selection name = " + selection_name);
selectionMap.put(Long.valueOf(atom.getAtom()),this); // add mapping from atom to the instance of XMSelection
if (owner != 0) {
if (log.isLoggable(PlatformLogger.FINE)) log.fine("Selection Owner for screen " + screen + " = " + owner );
new XEventDispatcher() {
}
});
}
}
}
catch (Exception e) {
e.printStackTrace();
}
finally {
}
} finally {
}
}
}
}
return false;
}
case XConstants.ClientMessage: {
}
}
return false;
}
}
/*
* Default constructor specifies PropertyChangeMask as well
*/
}
/*
* Some users may not need to know about selection changes,
* just owner ship changes, They would specify a zero extra mask.
*/
synchronized (this) {
owners = new long[getNumberOfScreens()];
}
}
}
}
}
}
return listeners;
}
}
return null;
}
}
}
}
return 0;
}
}
}
return selectionName;
}
if (log.isLoggable(PlatformLogger.FINE)) log.fine("Selection Changed : Screen = " + screen + "Event =" + ev);
}
}
}
if (log.isLoggable(PlatformLogger.FINE)) log.fine("Owner dead : Screen = " + screen + "Event =" + de);
}
}
}
}
}
}
synchronized void dispatchOwnerChangedEvent(XEvent ev, int screen, long owner, long data, long timestamp) {
}
}
}
}