Compare commits

..

3 Commits

Author SHA1 Message Date
Elena Sayapina
4f7ad5d4b2 updated JTreg exclude list
(cherry picked from commit f5fad072a7)
2019-11-07 16:46:49 +07:00
Denis Fokin
a48f76e7b1 JBR-1932 Dialogs leak via CPlatformWindow 2019-11-05 13:49:19 +03:00
Elena Sayapina
c16d4dbefb updated JTreg exclude list
(cherry picked from commit 911b6b128d)
2019-10-30 18:22:13 +07:00
14 changed files with 10 additions and 688 deletions

View File

@@ -1,6 +1,6 @@
#
#
# Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -38,7 +38,6 @@ allfonts.chinese-hkscs=MingLiU_HKSCS
allfonts.chinese-ms950-extb=MingLiU-ExtB
allfonts.devanagari=Mangal
allfonts.kannada=Tunga
allfonts.myanmar=Myanmar Text
allfonts.dingbats=Wingdings
allfonts.symbol=Symbol
allfonts.symbols=Segoe UI Symbol
@@ -240,8 +239,7 @@ sequence.allfonts.x-windows-874=alphabetic,thai,dingbats,symbol
sequence.fallback=symbols,\
chinese-ms950,chinese-hkscs,chinese-ms936,chinese-gb18030,\
japanese,korean,chinese-ms950-extb,chinese-ms936-extb,\
georgian,kannada,myanmar
japanese,korean,chinese-ms950-extb,chinese-ms936-extb,georgian,kannada
# Exclusion Ranges
@@ -298,7 +296,6 @@ filename.GulimChe=gulim.TTC
filename.DokChampa=dokchamp.ttf
filename.Mangal=MANGAL.TTF
filename.Tunga=TUNGA.TTF
filename.Myanmar_Text=mmrtext.ttf
filename.Symbol=SYMBOL.TTF
filename.Wingdings=WINGDING.TTF

View File

@@ -272,14 +272,12 @@ XEvent.xclient 0
XEvent.xcolormap 0
XEvent.xconfigure 0
XEvent.xconfigurerequest 0
XEvent.xcookie 0
XEvent.xcreatewindow 0
XEvent.xcrossing 0
XEvent.xdestroywindow 0
XEvent.xerror 0
XEvent.xexpose 0
XEvent.xfocus 0
XEvent.xgeneric 0
XEvent.xgraphicsexpose 0
XEvent.xgravity 0
XEvent.xkey 0
@@ -372,22 +370,6 @@ XGCValues.subwindow_mode 96
XGCValues.tile 64
XGCValues.ts_x_origin 80
XGCValues.ts_y_origin 84
XGenericEvent 40
XGenericEventCookie 56
XGenericEventCookie.cookie 40
XGenericEventCookie.data 48
XGenericEventCookie.display 24
XGenericEventCookie.evtype 36
XGenericEventCookie.extension 32
XGenericEventCookie.send_event 16
XGenericEventCookie.serial 8
XGenericEventCookie.type 0
XGenericEvent.display 24
XGenericEvent.evtype 36
XGenericEvent.extension 32
XGenericEvent.send_event 16
XGenericEvent.serial 8
XGenericEvent.type 0
XGraphicsExposeEvent 72
XGraphicsExposeEvent.count 56
XGraphicsExposeEvent.display 24
@@ -414,9 +396,6 @@ XHostAddress 16
XHostAddress.address 8
XHostAddress.family 0
XHostAddress.length 4
XIButtonState 16
XIButtonState.mask 8
XIButtonState.mask_len 0
XIconSize 24
XIconSize.height_inc 20
XIconSize.max_height 12
@@ -424,29 +403,6 @@ XIconSize.max_width 8
XIconSize.min_height 4
XIconSize.min_width 0
XIconSize.width_inc 16
XIDeviceEvent 200
XIDeviceEvent.buttons 128
XIDeviceEvent.child 80
XIDeviceEvent.detail 56
XIDeviceEvent.deviceid 48
XIDeviceEvent.display 24
XIDeviceEvent.event 72
XIDeviceEvent.event_x 104
XIDeviceEvent.event_y 112
XIDeviceEvent.evtype 36
XIDeviceEvent.extension 32
XIDeviceEvent.flags 120
XIDeviceEvent.group 184
XIDeviceEvent.mods 168
XIDeviceEvent.root 64
XIDeviceEvent.root_x 88
XIDeviceEvent.root_y 96
XIDeviceEvent.send_event 16
XIDeviceEvent.serial 8
XIDeviceEvent.sourceid 52
XIDeviceEvent.time 40
XIDeviceEvent.type 0
XIDeviceEvent.valuators 144
XImage 136
XImage.bitmap_bit_order 32
XImage.bitmap_pad 36
@@ -480,11 +436,6 @@ XIMHotKeyTrigger.modifier_mask 12
XIMHotKeyTriggers 16
XIMHotKeyTriggers.key 8
XIMHotKeyTriggers.num_hot_key 0
XIModifierState 16
XIModifierState.base 0
XIModifierState.effective 12
XIModifierState.latched 4
XIModifierState.locked 8
XIMPreeditCaretCallbackStruct 12
XIMPreeditCaretCallbackStruct.direction 4
XIMPreeditCaretCallbackStruct.position 0
@@ -521,10 +472,6 @@ XIMText.string 24
XIMValuesList 16
XIMValuesList.count_values 0
XIMValuesList.supported_values 8
XIValuatorState 24
XIValuatorState.mask 8
XIValuatorState.mask_len 0
XIValuatorState.values 16
XkbAccessXNotifyEvent 64
XkbAccessXNotifyEvent.debounce_delay 60
XkbAccessXNotifyEvent.detail 48

View File

@@ -127,22 +127,6 @@ XKeymapEvent
display long
window long
key_vector array byte 32
XGenericEvent
type int
serial long
send_event Bool
display long
extension int
evtype int
XGenericEventCookie
type int
serial long
send_event Bool
display long
extension int
evtype int
cookie int
data pointer
XDestroyWindowEvent
type int
serial long
@@ -830,8 +814,6 @@ XEvent
xmapping struct XMappingEvent
xerror struct XErrorEvent
xkeymap struct XKeymapEvent
xgeneric struct XGenericEvent
xcookie struct XGenericEventCookie
pad array long 24
XkbAnyEvent
@@ -1057,42 +1039,3 @@ XkbEvent
accessx struct XkbAccessXNotifyEvent
device struct XkbExtensionDeviceNotifyEvent
core struct XEvent
XIButtonState
mask_len int
mask pointer byte
XIValuatorState
mask_len int
mask pointer byte
values pointer double
XIModifierState
base int
latched int
locked int
effective int
XIDeviceEvent
type int
serial long
send_event Bool
display long
extension int
evtype int
time ulong
deviceid int
sourceid int
detail int
root long
event long
child long
root_x double
root_y double
event_x double
event_y double
flags int
buttons struct XIButtonState
valuators struct XIValuatorState
mods struct XIModifierState
group struct XIModifierState

View File

@@ -1142,8 +1142,6 @@ public class WrapperGenerator {
pw.println("/* This file is an automatically generated file, please do not edit this file, modify the XlibParser.java file instead !*/\n" );
pw.println("#include <X11/Xlib.h>\n#include <X11/Xutil.h>\n#include <X11/Xos.h>\n#include <X11/Xatom.h>\n#include <stdio.h>\n");
pw.println("#include <X11/extensions/Xdbe.h>");
pw.println("#include <X11/extensions/XI2.h>");
pw.println("#include <X11/extensions/XInput2.h>");
pw.println("#include <X11/XKBlib.h>");
pw.println("#include \"awt_p.h\"");
pw.println("#include \"color.h\"");

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -269,10 +269,9 @@ public final class FontUtilities {
else if (code < 0x0f00) {
return false;
}
else if (code <= 0x0fff) { // U+0F00 - U+0FFF Tibetan
return true;
}
else if (code < 0x10A0) { // U+1000 - U+109F Myanmar
else if (code <= 0x109f) {
// U+0F00 - U+0FFF Tibetan
// U+1000 - U+109F Myanmar
return true;
}
else if (code < 0x1100) {

View File

@@ -374,20 +374,6 @@ class Native {
return res;
}
/**
* Access to C double data(eight bytes)
*/
static final int DOUBLE_SIZE = 8;
static double getDouble(long ptr) { return unsafe.getDouble(ptr); }
static double getDouble(long ptr, int index) { return getDouble(ptr + DOUBLE_SIZE * index); }
/**
* Stores to C double data(eight bytes)
*/
static void putDouble(long ptr, double data) { unsafe.putDouble(ptr, data); }
static void putDouble(long ptr, int index, double data) {
putDouble(ptr + index * DOUBLE_SIZE, data);
}
/**
* Access to C "unsigned long" date type, which is XID in X

View File

@@ -55,9 +55,7 @@ public class XBaseWindow {
VISIBLE = "visible", // whether it is visible by default
SAVE_UNDER = "save under", // save content under this window
BACKING_STORE = "backing store", // enables double buffering
BIT_GRAVITY = "bit gravity", // copy old content on geometry change
XI_EVENT_MASK = "xi event mask", // xi event mask, Long
XI_DEVICE_ID = "xi device id"; // xi device id, Integer
BIT_GRAVITY = "bit gravity"; // copy old content on geometry change
private XCreateWindowParams delayedParams;
Set<Long> children = new HashSet<Long>();
@@ -396,19 +394,6 @@ public class XBaseWindow {
throw new IllegalStateException("Couldn't create window because of wrong parameters. Run with NOISY_AWT to see details");
}
XToolkit.addToWinMap(window, this);
Long xiEventMask = (Long) params.get(XI_EVENT_MASK);
if (xiEventMask != null && XToolkit.isXInputEnabled()) {
Integer xiDeviceId = (Integer) params.get(XI_DEVICE_ID);
if (xiDeviceId == null) {
xiDeviceId = XConstants.XIAllDevices;
}
int status = XToolkit.XISelectEvents(XToolkit.getDisplay(), window, xiEventMask, xiDeviceId);
if (status != XConstants.Success) {
throw new IllegalStateException("Couldn't select XI events. Status: " + status);
}
}
} finally {
xattr.dispose();
}
@@ -1080,10 +1065,6 @@ public class XBaseWindow {
width = scaleDown(xe.get_width());
height = scaleDown(xe.get_height());
}
public void handleTouchEvent(XEvent xev) {
}
/**
* Checks ButtonRelease released all Mouse buttons
*/
@@ -1123,12 +1104,6 @@ public class XBaseWindow {
if (target == null || !isGrabbedEvent(ev, target)) {
target = XToolkit.windowToXWindow(ev.get_xany().get_window());
}
if (target == null && ev.get_type() == XConstants.GenericEvent &&
XlibWrapper.XGetEventData(ev.get_xgeneric().get_display(), ev.pData)) {
target = XToolkit.windowToXWindow(XToolkit.GetXIDeviceEvent(ev.get_xcookie()).get_event());
}
if (target != null && target.checkInitialised()) {
target.dispatchEvent(ev);
}
@@ -1195,17 +1170,6 @@ public class XBaseWindow {
case XConstants.CreateNotify:
handleCreateNotify(xev);
break;
case XConstants.GenericEvent:
switch (xev.get_xgeneric().get_evtype()) {
case XConstants.XI_TouchBegin:
case XConstants.XI_TouchUpdate:
case XConstants.XI_TouchEnd:
handleTouchEvent(xev);
break;
default:
break;
}
break;
}
}
protected boolean isEventDisabled(XEvent e) {

View File

@@ -170,8 +170,7 @@ public final class XConstants {
public static final int ColormapNotify = 32 ;
public static final int ClientMessage = 33 ;
public static final int MappingNotify = 34 ;
public static final int GenericEvent = 35 ;
public static final int LASTEvent = 36 ; /* must be bigger than any event # */
public static final int LASTEvent = 35 ; /* must be bigger than any event # */
/* Key masks. Used as modifiers to GrabButton and GrabKey, results of QueryPointer,
@@ -675,70 +674,4 @@ public final class XConstants {
public static final long XkbModifierMapMask = (1L<<2);
public static final long XkbVirtualModsMask = (1L<<6); //server map
/* Fake device ID's for event selection */
public static final int XIAllDevices = 0;
public static final int XIAllMasterDevices = 1;
/* XI Event types */
public static final int XI_DeviceChanged = 1;
public static final int XI_KeyPress = 2;
public static final int XI_KeyRelease = 3;
public static final int XI_ButtonPress = 4;
public static final int XI_ButtonRelease = 5;
public static final int XI_Motion = 6;
public static final int XI_Enter = 7;
public static final int XI_Leave = 8;
public static final int XI_FocusIn = 9;
public static final int XI_FocusOut = 10;
public static final int XI_HierarchyChanged = 11;
public static final int XI_PropertyEvent = 12;
public static final int XI_RawKeyPress = 13;
public static final int XI_RawKeyRelease = 14;
public static final int XI_RawButtonPress = 15;
public static final int XI_RawButtonRelease = 16;
public static final int XI_RawMotion = 17;
public static final int XI_TouchBegin = 18;/* XI 2.2 */
public static final int XI_TouchUpdate = 19;
public static final int XI_TouchEnd = 20;
public static final int XI_TouchOwnership = 21;
public static final int XI_RawTouchBegin = 22;
public static final int XI_RawTouchUpdate = 23;
public static final int XI_RawTouchEnd = 24;
public static final int XI_BarrierHit = 25;/* XI 2.3 */
public static final int XI_BarrierLeave = 26;
public static final int XI_LASTEVENT = XI_BarrierLeave;
/* NOTE: XI2LASTEVENT in xserver/include/inputstr.h must be the same value
* as XI_LASTEVENT if the server is supposed to handle masks etc. for this
* type of event. */
/* Event masks.
* Note: the protocol spec defines a mask to be of (1 << type). Clients are
* free to create masks by bitshifting instead of using these defines.
*/
public static final long XI_DeviceChangedMask = 1L << XI_DeviceChanged;
public static final long XI_KeyPressMask = 1L << XI_KeyPress;
public static final long XI_KeyReleaseMask = 1L << XI_KeyRelease;
public static final long XI_ButtonPressMask = 1L << XI_ButtonPress;
public static final long XI_ButtonReleaseMask = 1L << XI_ButtonRelease;
public static final long XI_MotionMask = 1L << XI_Motion;
public static final long XI_EnterMask = 1L << XI_Enter;
public static final long XI_LeaveMask = 1L << XI_Leave;
public static final long XI_FocusInMask = 1L << XI_FocusIn;
public static final long XI_FocusOutMask = 1L << XI_FocusOut;
public static final long XI_HierarchyChangedMask = 1L << XI_HierarchyChanged;
public static final long XI_PropertyEventMask = 1L << XI_PropertyEvent;
public static final long XI_RawKeyPressMask = 1L << XI_RawKeyPress;
public static final long XI_RawKeyReleaseMask = 1L << XI_RawKeyRelease;
public static final long XI_RawButtonPressMask = 1L << XI_RawButtonPress;
public static final long XI_RawButtonReleaseMask = 1L << XI_RawButtonRelease;
public static final long XI_RawMotionMask = 1L << XI_RawMotion;
public static final long XI_TouchBeginMask = 1L << XI_TouchBegin;
public static final long XI_TouchEndMask = 1L << XI_TouchEnd;
public static final long XI_TouchOwnershipChangedMask = 1L << XI_TouchOwnership;
public static final long XI_TouchUpdateMask = 1L << XI_TouchUpdate;
public static final long XI_RawTouchBeginMask = 1L << XI_RawTouchBegin;
public static final long XI_RawTouchEndMask = 1L << XI_RawTouchEnd;
public static final long XI_RawTouchUpdateMask = 1L << XI_RawTouchUpdate;
public static final long XI_BarrierHitMask = 1L << XI_BarrierHit;
public static final long XI_BarrierLeaveMask = 1L << XI_BarrierLeave;
}

View File

@@ -340,7 +340,6 @@ public final class XToolkit extends UNIXToolkit implements Runnable {
log.finer("X locale modifiers are not supported, using default");
}
tryXKB();
checkXInput();
AwtScreenData defaultScreen = new AwtScreenData(XToolkit.getDefaultScreenData());
awt_defaultFg = defaultScreen.get_blackpixel();
@@ -742,8 +741,6 @@ public final class XToolkit extends UNIXToolkit implements Runnable {
XBaseWindow.ungrabInput();
processException(thr);
} finally {
// free event data if XGetEventData was called
XlibWrapper.XFreeEventData(getDisplay(), ev.pData);
awtUnlock();
}
}
@@ -2576,58 +2573,6 @@ public final class XToolkit extends UNIXToolkit implements Runnable {
}
}
private static volatile boolean hasXInputExtension = false;
public static boolean isXInputEnabled() {
return hasXInputExtension;
}
public static void checkXInput() {
awtLock();
try {
String extensionName = "XInputExtension";
boolean hasExtension = XlibWrapper.XQueryExtension(XToolkit.getDisplay(), extensionName,
XlibWrapper.iarg1, XlibWrapper.iarg2, XlibWrapper.iarg3);
if (!hasExtension) {
log.warning("X Input extension isn't available, error: {0}", Native.getInt(XlibWrapper.iarg1));
return;
}
final int requiredMajor = 2;
final int requiredMinor = 2;
Native.putInt(XlibWrapper.iarg1, requiredMajor);
Native.putInt(XlibWrapper.iarg2, requiredMinor);
int status = XlibWrapper.XIQueryVersion(XToolkit.getDisplay(), XlibWrapper.iarg1, XlibWrapper.iarg2);
if (status == XConstants.BadRequest) {
log.warning("X Input2 not supported in the server");
return;
}
int major = Native.getInt(XlibWrapper.iarg1);
int minor = Native.getInt(XlibWrapper.iarg2);
if (major >= requiredMajor && minor >= requiredMinor) {
hasXInputExtension = true;
} else {
log.warning("Desired version is 2.2, server version is {0}.{1}", major, minor);
}
} finally {
awtUnlock();
}
}
public static XIDeviceEvent GetXIDeviceEvent(XGenericEventCookie cookie) {
return new XIDeviceEvent(cookie.get_data());
}
public static int XISelectEvents(long display, long window, long mask, int deviceid) {
if (isXInputEnabled()) {
return XlibWrapper.XISelectEvents(display, window, mask, deviceid);
} else {
log.warning("Attempting to select xi events while xinput isn't available");
return XConstants.BadRequest;
}
}
private static long eventNumber;
public static long getEventNumber() {
awtLock();

View File

@@ -37,6 +37,8 @@ import sun.util.logging.PlatformLogger;
import sun.awt.*;
import sun.awt.image.PixelConverter;
import sun.java2d.SunGraphics2D;
import sun.java2d.SurfaceData;
@@ -57,14 +59,6 @@ class XWindow extends XBaseWindow implements X11ComponentPeer {
static long lastButton = 0;
static WeakReference<XWindow> lastWindowRef = null;
static int clickCount = 0;
private static int touchBeginX = 0, touchBeginY = 0;
private static int trackingId = 0;
private static boolean isTouchScroll = false;
private static final int TOUCH_CLICK_RADIUS = 3;
// all touch scrolls are measured in pixels
private static final int TOUCH_BEGIN = 2;
private static final int TOUCH_UPDATE = 3;
private static final int TOUCH_END = 4;
// used to check if we need to re-create surfaceData.
int oldWidth = -1;
@@ -229,11 +223,6 @@ class XWindow extends XBaseWindow implements X11ComponentPeer {
params.putIfNull(BACKING_STORE, XToolkit.getBackingStoreType());
params.putIfNull(XI_EVENT_MASK, XConstants.XI_TouchBeginMask |
XConstants.XI_TouchUpdateMask |
XConstants.XI_TouchEndMask);
params.putIfNull(XI_DEVICE_ID, XConstants.XIAllMasterDevices);
XToolkit.awtLock();
try {
if (wm_protocols == null) {
@@ -780,112 +769,6 @@ class XWindow extends XBaseWindow implements X11ComponentPeer {
}
}
public void handleTouchEvent(XEvent xev) {
super.handleTouchEvent(xev);
XIDeviceEvent dev = XToolkit.GetXIDeviceEvent(xev.get_xcookie());
// TODO remove this after TouchEvents support
// own touch processing by tracking id
if (isTouchReleased()) {
trackingId = dev.get_detail();
} else if (!isOwningTouch(dev.get_detail())) {
return;
}
int x = scaleDown((int) dev.get_event_x());
int y = scaleDown((int) dev.get_event_y());
if (dev.get_event() != window) {
Point localXY = toLocal(x, y);
x = localXY.x;
y = localXY.y;
}
int button = XConstants.buttons[0];
int modifiers = getModifiers(dev.get_mods().get_effective(), button, 0);
// turning off shift modifier
modifiers &= ~InputEvent.SHIFT_DOWN_MASK;
long jWhen = XToolkit.nowMillisUTC_offset(dev.get_time());
switch (dev.get_evtype()) {
case XConstants.XI_TouchBegin:
isTouchScroll = false;
touchBeginX = x;
touchBeginY = y;
break;
case XConstants.XI_TouchUpdate:
if (isInsideTouchClickBoundaries(x, y)) {
return;
}
if (!isTouchScroll) {
sendWheelEventFromTouch(dev, jWhen, modifiers, touchBeginX, touchBeginY, TOUCH_BEGIN, 1);
isTouchScroll = true;
}
if (lastY - y != 0) {
sendWheelEventFromTouch(dev, jWhen, modifiers, x, y, TOUCH_UPDATE, lastY - y);
}
// horizontal scroll
if (lastX - x != 0) {
modifiers |= InputEvent.SHIFT_DOWN_MASK;
sendWheelEventFromTouch(dev, jWhen, modifiers, x, y, TOUCH_UPDATE, lastX - x);
}
break;
case XConstants.XI_TouchEnd:
if (isTouchScroll) {
sendWheelEventFromTouch(dev, jWhen, modifiers, x, y, TOUCH_END, 1);
} else {
sendMouseEventFromTouch(dev, MouseEvent.MOUSE_PRESSED, jWhen, modifiers, touchBeginX, touchBeginY, button);
sendMouseEventFromTouch(dev, MouseEvent.MOUSE_RELEASED, jWhen, modifiers, touchBeginX, touchBeginY, button);
sendMouseEventFromTouch(dev, MouseEvent.MOUSE_CLICKED, jWhen, modifiers, touchBeginX, touchBeginY, button);
}
// release touch processing
trackingId = 0;
break;
}
lastX = x;
lastY = y;
}
private boolean isInsideTouchClickBoundaries(int x, int y) {
return Math.abs(touchBeginX - x) <= TOUCH_CLICK_RADIUS &&
Math.abs(touchBeginY - y) <= TOUCH_CLICK_RADIUS;
}
private static boolean isOwningTouch(int fingerId) {
return trackingId == fingerId;
}
private static boolean isTouchReleased() {
return trackingId == 0;
}
private void sendWheelEventFromTouch(XIDeviceEvent dev, long jWhen, int modifiers, int x, int y, int type, int delta) {
postEventToEventQueue(
new MouseWheelEvent(getEventSource(), MouseEvent.MOUSE_WHEEL, jWhen,
modifiers,
x, y,
scaleDown((int) dev.get_root_x()),
scaleDown((int) dev.get_root_y()),
0, false, type,
1, delta));
}
private void sendMouseEventFromTouch(XIDeviceEvent dev, int type, long jWhen, int modifiers, int x, int y, int button) {
postEventToEventQueue(
new MouseEvent(getEventSource(), type, jWhen,
modifiers,
x, y,
scaleDown((int) dev.get_root_x()),
scaleDown((int) dev.get_root_y()),
1,
false, button));
}
public void handleMotionNotify(XEvent xev) {
super.handleMotionNotify(xev);
XMotionEvent xme = xev.get_xmotion();

View File

@@ -564,12 +564,6 @@ static native String XSetLocaleModifiers(String modifier_list);
static native void SetZOrder(long display, long window, long above);
static native int XIQueryVersion(long display, long major_version_iptr, long minor_version_iptr);
static native int XISelectEvents(long display, long window, long mask, int deviceid);
static native boolean XGetEventData(long display, long ptr);
static native void XFreeEventData(long display, long ptr);
/* Global memory area used for X lib parameter passing */
static final long lbuffer = unsafe.allocateMemory(64); // array to hold 8 longs

View File

@@ -37,8 +37,6 @@
#include <string.h>
#include <X11/extensions/Xdbe.h>
#include <X11/extensions/shape.h>
#include <X11/extensions/XI2.h>
#include <X11/extensions/XInput2.h>
#include <X11/keysym.h>
#include <X11/Sunkeysym.h>
#include <X11/Xlib.h>
@@ -2319,63 +2317,6 @@ Java_sun_awt_X11_XlibWrapper_SetZOrder
value_mask, &wc );
}
/*
* Class: XlibWrapper
* Method: XIQueryVersion
*/
JNIEXPORT jint JNICALL
Java_sun_awt_X11_XlibWrapper_XIQueryVersion
(JNIEnv *env, jclass clazz, jlong display, jlong major_version_iptr, jlong minor_version_iptr)
{
return XIQueryVersion((Display *)jlong_to_ptr(display),
jlong_to_ptr(major_version_iptr), jlong_to_ptr(minor_version_iptr));
}
/*
* Class: XlibWrapper
* Method: XISelectEvents
*/
JNIEXPORT jint JNICALL
Java_sun_awt_X11_XlibWrapper_XISelectEvents
(JNIEnv *env, jclass clazz, jlong display, jlong window, jlong mask, jint deviceid)
{
XIEventMask evmask;
evmask.deviceid = (int)deviceid;
evmask.mask_len = XIMaskLen(XI_LASTEVENT);
union jlong_to_char_ptr
{
jlong value;
unsigned char mask[8];
} converter;
converter.value = mask;
evmask.mask = &converter.mask;
return XISelectEvents((Display *)jlong_to_ptr(display), (Window)jlong_to_ptr(window),
&evmask, /*num masks*/ 1);
}
/*
* Class: XlibWrapper
* Method: XGetEventData
*/
JNIEXPORT jboolean JNICALL
Java_sun_awt_X11_XlibWrapper_XGetEventData
(JNIEnv *env, jclass clazz, jlong display, jlong ptr)
{
return XGetEventData((Display *)jlong_to_ptr(display),
(XGenericEventCookie *)ptr_to_jlong(ptr)) ? JNI_TRUE : JNI_FALSE;
}
/*
* Class: XlibWrapper
* Method: XFreeEventData
*/
JNIEXPORT void JNICALL
Java_sun_awt_X11_XlibWrapper_XFreeEventData
(JNIEnv *env, jclass clazz, jlong display, jlong ptr)
{
return XFreeEventData((Display *)jlong_to_ptr(display), (XGenericEventCookie *)ptr_to_jlong(ptr));
}
/*
* Class: XlibWrapper
* Method: SetBitmapShape

View File

@@ -1,57 +0,0 @@
/*
* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* 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.
*/
/*
* @test
* @bug 8223558
* @summary Verifies Dialog logical font falls back to "Myanmar Text"
* @requires (os.family == "windows")
*/
import java.awt.Font;
import java.awt.GraphicsEnvironment;
import java.util.Arrays;
public class MyanmarFallbackTest {
public static void main(String[] args) {
if (!System.getProperty("os.name").toLowerCase().contains("windows")) {
System.err.println("This test is for Windows only");
return;
}
String[] fontFamilyNames = GraphicsEnvironment
.getLocalGraphicsEnvironment()
.getAvailableFontFamilyNames();
if (Arrays.stream(fontFamilyNames)
.noneMatch("Myanmar Text"::equals)) {
System.err.println("Myanmar Text font is not installed");
return;
}
Font dialog = new Font(Font.DIALOG, Font.PLAIN, 12);
if (-1 != dialog.canDisplayUpTo("\u1000\u103C")) {
throw new RuntimeException("Cannot display Myanmar characters");
}
}
}

View File

@@ -1,151 +0,0 @@
/*
* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* 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.
*/
/*
* @test
* @bug 8223558
* @key headful
* @summary Verifies that Myanmar script is rendered correctly:
* two characters combined into one glyph
* @run main MyanmarTextTest
*/
import java.awt.Font;
import java.awt.GraphicsEnvironment;
import java.util.Arrays;
import javax.swing.BorderFactory;
import javax.swing.BoxLayout;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.SwingConstants;
import javax.swing.SwingUtilities;
import javax.swing.WindowConstants;
import javax.swing.plaf.TextUI;
import javax.swing.text.BadLocationException;
import javax.swing.text.Position;
public class MyanmarTextTest {
private static final String TEXT = "\u1000\u103C";
private static final String FONT_WINDOWS = "Myanmar Text";
private static final String FONT_LINUX = "Padauk";
private static final String FONT_MACOS = "Myanmar MN";
private static final String FONT_NAME = selectFontName();
private final JFrame frame;
private final JTextField myanmarTF;
private static volatile MyanmarTextTest mtt;
public static void main(String[] args) throws Exception {
if (FONT_NAME == null) {
System.err.println("Unsupported OS: exiting");
return;
}
if (!fontExists()) {
System.err.println("Required font is not installed: " + FONT_NAME);
return;
}
try {
SwingUtilities.invokeAndWait(MyanmarTextTest::createUI);
SwingUtilities.invokeAndWait(mtt::checkPositions);
} finally {
SwingUtilities.invokeAndWait(mtt::dispose);
}
}
private static void createUI() {
mtt = new MyanmarTextTest();
mtt.show();
}
private MyanmarTextTest() {
frame = new JFrame("Myanmar Text");
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
myanmarTF = new JTextField(TEXT);
myanmarTF.setFont(new Font(FONT_NAME, Font.PLAIN, 40));
JPanel main = new JPanel();
main.setLayout(new BoxLayout(main, BoxLayout.Y_AXIS));
main.add(myanmarTF);
main.setBorder(BorderFactory.createEmptyBorder(7, 7, 7, 7));
frame.getContentPane().add(main);
}
private void show() {
frame.pack();
frame.setLocationByPlatform(true);
frame.setVisible(true);
}
private void dispose() {
frame.dispose();
}
private void checkPositions() {
final TextUI ui = myanmarTF.getUI();
final Position.Bias[] biasRet = new Position.Bias[1];
try {
if (2 != ui.getNextVisualPositionFrom(myanmarTF, 0,
Position.Bias.Forward, SwingConstants.EAST, biasRet)) {
throw new RuntimeException("For 0, next position should be 2");
}
if (2 != ui.getNextVisualPositionFrom(myanmarTF, 1,
Position.Bias.Forward, SwingConstants.EAST, biasRet)) {
throw new RuntimeException("For 1, next position should be 2");
}
if (0 != ui.getNextVisualPositionFrom(myanmarTF, 2,
Position.Bias.Forward, SwingConstants.WEST, biasRet)) {
throw new RuntimeException("For 2, prev position should be 0");
}
} catch (BadLocationException e) {
throw new RuntimeException(e);
}
}
private static String selectFontName() {
String osName = System.getProperty("os.name").toLowerCase();
if (osName.contains("windows")) {
return FONT_WINDOWS;
} else if (osName.contains("linux")) {
return FONT_LINUX;
} else if (osName.contains("mac")) {
return FONT_MACOS;
} else {
return null;
}
}
private static boolean fontExists() {
String[] fontFamilyNames = GraphicsEnvironment
.getLocalGraphicsEnvironment()
.getAvailableFontFamilyNames();
return Arrays.asList(fontFamilyNames).contains(FONT_NAME);
}
}