/*
* 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 class is a collection of utility methods that operate
* with native windows.
*/
public class XlibUtil
{
/**
* The constructor is made private to eliminate any
* instances of this class
*/
private XlibUtil()
{
}
/**
* Xinerama-aware version of XlibWrapper.RootWindow method.
*/
{
try
{
if (x11ge.runningXinerama())
{
// all the Xinerama windows share the same root window
}
else
{
}
}
finally
{
}
}
/**
* Checks if the given window is a root window for the given screen
*/
{
long root;
try
{
}
finally
{
}
return root == rootCandidate;
}
/**
* Returns the bounds of the given window, in absolute coordinates
*/
{
try
{
if (res == 0)
{
return null;
}
}
finally
{
}
}
/**
* Translates the given point from one window to another. Returns
* null if the translation is failed
*/
{
try
{
try
{
if ((status != 0) &&
{
}
}
finally
{
}
}
finally
{
}
return translated;
}
/**
* Translates the given rectangle from one window to another.
* Returns null if the translation is failed
*/
{
if (translatedLoc == null)
{
return null;
}
else
{
}
}
/**
* Returns the parent for the given window
*/
{
try
{
{
{
}
}
try
{
{
return 0;
}
else
{
return qt.get_parent();
}
}
finally
{
}
}
finally
{
}
}
/**
* Returns all the children for the given window
*/
{
try
{
{
return bw.getChildren();
}
try
{
if (status == 0)
{
return Collections.emptySet();
}
if (children == 0)
{
return Collections.emptySet();
}
for (int i = 0; i < childrenCount; i++)
{
}
return childrenSet;
}
finally
{
}
}
finally
{
}
}
/**
* Checks if the given window is a Java window and is an
* instance of XWindowPeer
*/
{
}
/**
* NOTICE: Right now returns only decorated top-levels (not Window)
*/
{
{
return true;
}
try
{
try
{
{
return true;
}
}
finally
{
}
return false;
}
finally
{
}
}
/**
* The same as isToplevelWindow(window), but doesn't treat
* XEmbeddedFramePeer as toplevel.
*/
{
{
return false;
}
return isToplevelWindow(window);
}
{
try
{
if ((status != 0) &&
{
return wattr.get_map_state();
}
}
finally
{
}
return XConstants.IsUnmapped;
}
/**
* XSHAPE extension support.
*/
// The variable is declared static as the XSHAPE extension cannot
// be disabled at run-time, and thus is available all the time
// once the check is passed.
/**
* Returns whether the XSHAPE extension available
* @since 1.7
*/
static synchronized boolean isShapingSupported() {
if (isShapingSupported == null) {
try {
} finally {
}
}
return isShapingSupported.booleanValue();
}
}