* doesn't support this property or property has unexpected formats
*/
Insets getNativeInsets(long windowId, long property) {
Insets insets = null;
CLongPointer actualTypeReturn = bridge.createCLongPointer(1, false);
Int32Pointer actualFormatReturn = bridge.createInt32Pointer(1, false);
CLongPointer nitemsReturn = bridge.createCLongPointer(1, false);
CLongPointer bytesAfterReturn = bridge.createCLongPointer(1, false);
PointerPointer propReturn = bridge.createPointerPointer(1, false);
int result = x11.XGetWindowProperty(factory.getDisplay(), windowId,
property, 0, 4, X11Defs.FALSE,
X11Defs.AnyPropertyType, actualTypeReturn, actualFormatReturn,
nitemsReturn, bytesAfterReturn, propReturn);
if (result == X11Defs.Success) {
long nItems = nitemsReturn.get(0);
long actualType = actualTypeReturn.get(0);
int actualFormat = actualFormatReturn.get(0);
CLongPointer ptrData = bridge.createCLongPointer(propReturn.get(0));
if (ptrData == null) {
return insets;
}
if ((nItems == 4) && (actualType == XA_CARDINAL)
&& (actualFormat == 32)) {
insets = new Insets(0, 0, 0, 0);
insets.left = (int)ptrData.get(0);
insets.right = (int)ptrData.get(1);
insets.top = (int)ptrData.get(2);
insets.bottom = (int)ptrData.get(3);
}
x11.XFree(ptrData);
}
return insets;