--- old/src/java.desktop/unix/native/libawt_xawt/awt/awt_GraphicsEnv.c 2020-03-02 01:41:29.681093100 -0800 +++ new/src/java.desktop/unix/native/libawt_xawt/awt/awt_GraphicsEnv.c 2020-03-02 01:41:29.245996000 -0800 @@ -23,6 +23,10 @@ * questions. */ +#ifdef HEADLESS + #error This file should not be included in headless library +#endif + #include "jni_util.h" #include "awt_p.h" #include "awt.h" @@ -31,14 +35,13 @@ #include #include #include -#ifndef HEADLESS + #include #include #ifndef NO_XRANDR #include #endif #include "GLXGraphicsConfig.h" -#endif /* !HEADLESS */ #include #include @@ -54,8 +57,6 @@ #include #include "Trace.h" -#ifndef HEADLESS - int awt_numScreens; /* Xinerama-aware number of screens */ AwtScreenDataPtr x11Screens; @@ -66,12 +67,6 @@ */ static jboolean glxRequested = JNI_FALSE; -#endif /* !HEADLESS */ - -#ifdef HEADLESS -#define Display void -#endif /* HEADLESS */ - Display *awt_display; jclass tkClass = NULL; @@ -92,9 +87,7 @@ struct X11GraphicsConfigIDs x11GraphicsConfigIDs; -#ifndef HEADLESS int awtCreateX11Colormap(AwtGraphicsConfigDataPtr adata); -#endif /* HEADLESS */ static char *x11GraphicsConfigClassName = "sun/awt/X11GraphicsConfig"; @@ -134,8 +127,6 @@ CHECK_NULL(x11GraphicsConfigIDs.bitsPerPixel); } -#ifndef HEADLESS - /* * XIOErrorHandler */ @@ -405,15 +396,8 @@ DTRACE_PRINTLN("RENDER extension available"); xrenderLibHandle = dlopen("libXrender.so.1", RTLD_LAZY | RTLD_GLOBAL); -#ifdef MACOSX -#define XRENDER_LIB "/usr/X11/lib/libXrender.dylib" -#else -#define XRENDER_LIB "libXrender.so" -#endif - if (xrenderLibHandle == NULL) { - xrenderLibHandle = dlopen(XRENDER_LIB, - RTLD_LAZY | RTLD_GLOBAL); + xrenderLibHandle = dlopen("libXrender.so", RTLD_LAZY | RTLD_GLOBAL); } #if defined(__solaris__) @@ -605,8 +589,6 @@ AWT_UNLOCK (); } -#ifndef HEADLESS - /* * Checks if Xinerama is running and perform Xinerama-related initialization. */ @@ -668,7 +650,6 @@ DTRACE_PRINTLN1("\ncouldn't open shared library: %s\n", dlerror()); } } -#endif /* HEADLESS */ Display * awt_init_Display(JNIEnv *env, jobject this) @@ -745,7 +726,6 @@ return dpy; } -#endif /* !HEADLESS */ /* * Class: sun_awt_X11GraphicsEnvironment @@ -756,14 +736,9 @@ Java_sun_awt_X11GraphicsEnvironment_getDefaultScreenNum( JNIEnv *env, jobject this) { -#ifdef HEADLESS - return (jint)0; -#else return DefaultScreen(awt_display); -#endif /* !HEADLESS */ } -#ifndef HEADLESS static void ensureConfigsInited(JNIEnv* env, int screen) { if (x11Screens[screen].numConfigs == 0) { if (env == NULL) { @@ -772,19 +747,12 @@ getAllConfigs (env, screen, &(x11Screens[screen])); } } -#endif -#ifdef HEADLESS -void* getDefaultConfig(int screen) { - return NULL; -} -#else AwtGraphicsConfigDataPtr getDefaultConfig(int screen) { ensureConfigsInited(NULL, screen); return x11Screens[screen].defaultConfig; } -#endif /* !HEADLESS */ /* * Class: sun_awt_X11GraphicsEnvironment @@ -795,10 +763,8 @@ Java_sun_awt_X11GraphicsEnvironment_initDisplay(JNIEnv *env, jobject this, jboolean glxReq) { -#ifndef HEADLESS glxRequested = glxReq; (void) awt_init_Display(env, this); -#endif /* !HEADLESS */ } /* @@ -809,7 +775,6 @@ JNIEXPORT jboolean JNICALL Java_sun_awt_X11GraphicsEnvironment_initGLX(JNIEnv *env, jclass x11ge) { -#ifndef HEADLESS jboolean glxAvailable; AWT_LOCK(); @@ -817,9 +782,6 @@ AWT_UNLOCK(); return glxAvailable; -#else - return JNI_FALSE; -#endif /* !HEADLESS */ } /* @@ -830,11 +792,7 @@ JNIEXPORT jint JNICALL Java_sun_awt_X11GraphicsEnvironment_getNumScreens(JNIEnv *env, jobject this) { -#ifdef HEADLESS - return (jint)0; -#else return awt_numScreens; -#endif /* !HEADLESS */ } /* @@ -845,11 +803,7 @@ JNIEXPORT jlong JNICALL Java_sun_awt_X11GraphicsDevice_getDisplay(JNIEnv *env, jobject this) { -#ifdef HEADLESS - return NULL; -#else return ptr_to_jlong(awt_display); -#endif /* !HEADLESS */ } #ifdef MITSHM @@ -976,11 +930,7 @@ Java_sun_awt_X11GraphicsEnvironment_getDisplayString (JNIEnv *env, jobject this) { -#ifdef HEADLESS - return (jstring)NULL; -#else return (*env)->NewStringUTF(env, DisplayString(awt_display)); -#endif /* HEADLESS */ } @@ -993,12 +943,8 @@ Java_sun_awt_X11GraphicsDevice_getNumConfigs( JNIEnv *env, jobject this, jint screen) { -#ifdef HEADLESS - return (jint)0; -#else ensureConfigsInited(env, screen); return x11Screens[screen].numConfigs; -#endif /* !HEADLESS */ } /* @@ -1010,9 +956,6 @@ Java_sun_awt_X11GraphicsDevice_getConfigVisualId( JNIEnv *env, jobject this, jint index, jint screen) { -#ifdef HEADLESS - return (jint)0; -#else int visNum; ensureConfigsInited(env, screen); @@ -1021,7 +964,6 @@ } else { return ((jint)x11Screens[screen].configs[index]->awt_visInfo.visualid); } -#endif /* !HEADLESS */ } /* @@ -1033,9 +975,6 @@ Java_sun_awt_X11GraphicsDevice_getConfigDepth( JNIEnv *env, jobject this, jint index, jint screen) { -#ifdef HEADLESS - return (jint)0; -#else int visNum; ensureConfigsInited(env, screen); @@ -1044,7 +983,6 @@ } else { return ((jint)x11Screens[screen].configs[index]->awt_visInfo.depth); } -#endif /* !HEADLESS */ } /* @@ -1056,9 +994,6 @@ Java_sun_awt_X11GraphicsDevice_getConfigColormap( JNIEnv *env, jobject this, jint index, jint screen) { -#ifdef HEADLESS - return (jint)0; -#else int visNum; ensureConfigsInited(env, screen); @@ -1067,7 +1002,6 @@ } else { return ((jint)x11Screens[screen].configs[index]->awt_cmap); } -#endif /* !HEADLESS */ } /* @@ -1079,7 +1013,6 @@ Java_sun_awt_X11GraphicsDevice_resetNativeData (JNIEnv *env, jclass x11gd, jint screen) { -#ifndef HEADLESS /* * Reset references to the various configs; the actual native config data * will be free'd later by the Disposer mechanism when the Java-level @@ -1093,7 +1026,6 @@ } x11Screens[screen].defaultConfig = NULL; x11Screens[screen].numConfigs = 0; -#endif /* !HEADLESS */ } /* @@ -1105,7 +1037,6 @@ Java_sun_awt_X11GraphicsConfig_dispose (JNIEnv *env, jclass x11gc, jlong configData) { -#ifndef HEADLESS AwtGraphicsConfigDataPtr aData = (AwtGraphicsConfigDataPtr) jlong_to_ptr(configData); @@ -1147,7 +1078,6 @@ } free(aData); -#endif /* !HEADLESS */ } /* @@ -1159,12 +1089,8 @@ Java_sun_awt_X11GraphicsConfig_getXResolution( JNIEnv *env, jobject this, jint screen) { -#ifdef HEADLESS - return (jdouble)0; -#else return ((DisplayWidth(awt_display, screen) * 25.4) / DisplayWidthMM(awt_display, screen)); -#endif /* !HEADLESS */ } /* @@ -1176,12 +1102,8 @@ Java_sun_awt_X11GraphicsConfig_getYResolution( JNIEnv *env, jobject this, jint screen) { -#ifdef HEADLESS - return (jdouble)0; -#else return ((DisplayHeight(awt_display, screen) * 25.4) / DisplayHeightMM(awt_display, screen)); -#endif /* !HEADLESS */ } @@ -1194,16 +1116,12 @@ Java_sun_awt_X11GraphicsConfig_getNumColors( JNIEnv *env, jobject this) { -#ifdef HEADLESS - return (jint)0; -#else AwtGraphicsConfigData *adata; adata = (AwtGraphicsConfigData *) JNU_GetLongFieldAsPtr(env, this, x11GraphicsConfigIDs.aData); return adata->awt_num_colors; -#endif /* !HEADLESS */ } /* @@ -1215,7 +1133,6 @@ Java_sun_awt_X11GraphicsConfig_init( JNIEnv *env, jobject this, jint visualNum, jint screen) { -#ifndef HEADLESS AwtGraphicsConfigData *adata = NULL; AwtScreenData asd = x11Screens[screen]; int i, n; @@ -1256,11 +1173,8 @@ (*env)->SetIntField(env, this, x11GraphicsConfigIDs.bitsPerPixel, (jint)tempImage->bits_per_pixel); XDestroyImage(tempImage); -#endif /* !HEADLESS */ } - - /* * Class: sun_awt_X11GraphicsConfig * Method: makeColorModel @@ -1270,9 +1184,6 @@ Java_sun_awt_X11GraphicsConfig_makeColorModel( JNIEnv *env, jobject this) { -#ifdef HEADLESS - return NULL; -#else AwtGraphicsConfigData *adata; jobject colorModel; @@ -1301,10 +1212,8 @@ AWT_UNLOCK (); return colorModel; -#endif /* !HEADLESS */ } - /* * Class: sun_awt_X11GraphicsConfig * Method: getBounds @@ -1313,9 +1222,6 @@ JNIEXPORT jobject JNICALL Java_sun_awt_X11GraphicsConfig_pGetBounds(JNIEnv *env, jobject this, jint screen) { -#ifdef HEADLESS - return NULL; -#else jclass clazz; jmethodID mid; jobject bounds = NULL; @@ -1374,7 +1280,6 @@ } } return bounds; -#endif /* !HEADLESS */ } /* @@ -1450,15 +1355,11 @@ Java_sun_awt_X11GraphicsConfig_isTranslucencyCapable (JNIEnv *env, jobject this, jlong configData) { -#ifdef HEADLESS - return JNI_FALSE; -#else AwtGraphicsConfigDataPtr aData = (AwtGraphicsConfigDataPtr)jlong_to_ptr(configData); if (aData == NULL) { return JNI_FALSE; } return aData->isTranslucencySupported ? JNI_TRUE : JNI_FALSE; -#endif } /* @@ -1469,9 +1370,6 @@ JNIEXPORT jboolean JNICALL Java_sun_awt_X11GraphicsDevice_isDBESupported(JNIEnv *env, jobject this) { -#ifdef HEADLESS - return JNI_FALSE; -#else int opcode = 0, firstEvent = 0, firstError = 0; jboolean ret; @@ -1480,7 +1378,6 @@ &opcode, &firstEvent, &firstError); AWT_FLUSH_UNLOCK(); return ret; -#endif /* !HEADLESS */ } /* @@ -1492,7 +1389,6 @@ Java_sun_awt_X11GraphicsDevice_getDoubleBufferVisuals(JNIEnv *env, jobject this, jint screen) { -#ifndef HEADLESS jclass clazz; jmethodID midAddVisual; Window rootWindow; @@ -1527,7 +1423,6 @@ break; } } -#endif /* !HEADLESS */ } /* @@ -1539,19 +1434,13 @@ Java_sun_awt_X11GraphicsEnvironment_pRunningXinerama(JNIEnv *env, jobject this) { -#ifdef HEADLESS - return JNI_FALSE; -#else return usingXinerama ? JNI_TRUE : JNI_FALSE; -#endif /* HEADLESS */ } /** * Begin DisplayMode/FullScreen support */ -#ifndef HEADLESS - #ifndef NO_XRANDR #define BIT_DEPTH_MULTI java_awt_DisplayMode_BIT_DEPTH_MULTI @@ -1789,7 +1678,6 @@ &event); XSync(awt_display, False); } -#endif /* !HEADLESS */ /* * Class: sun_awt_X11GraphicsDevice @@ -1800,7 +1688,7 @@ Java_sun_awt_X11GraphicsDevice_initXrandrExtension (JNIEnv *env, jclass x11gd) { -#if defined(HEADLESS) || defined(NO_XRANDR) +#if defined(NO_XRANDR) return JNI_FALSE; #else int opcode = 0, firstEvent = 0, firstError = 0; @@ -1815,7 +1703,7 @@ AWT_FLUSH_UNLOCK(); return ret; -#endif /* HEADLESS */ +#endif /* NO_XRANDR */ } /* @@ -1827,7 +1715,7 @@ Java_sun_awt_X11GraphicsDevice_getCurrentDisplayMode (JNIEnv* env, jclass x11gd, jint screen) { -#if defined(HEADLESS) || defined(NO_XRANDR) +#if defined(NO_XRANDR) return NULL; #else XRRScreenConfiguration *config; @@ -1910,7 +1798,7 @@ AWT_FLUSH_UNLOCK(); return displayMode; -#endif /* HEADLESS */ +#endif /* NO_XRANDR */ } /* @@ -1923,7 +1811,7 @@ (JNIEnv* env, jclass x11gd, jint screen, jobject arrayList) { -#if !defined(HEADLESS) && !defined(NO_XRANDR) +#if !defined(NO_XRANDR) AWT_LOCK(); @@ -1998,7 +1886,7 @@ } AWT_FLUSH_UNLOCK(); -#endif /* !HEADLESS */ +#endif /* !NO_XRANDR */ } /* @@ -2011,7 +1899,7 @@ (JNIEnv* env, jclass x11gd, jint screen, jint width, jint height, jint refreshRate) { -#if !defined(HEADLESS) && !defined(NO_XRANDR) +#if !defined(NO_XRANDR) jboolean success = JNI_FALSE; XRRScreenConfiguration *config; Drawable root; @@ -2081,7 +1969,7 @@ if (!success && !(*env)->ExceptionCheck(env)) { JNU_ThrowInternalError(env, "Could not set display mode"); } -#endif /* !HEADLESS */ +#endif /* !NO_XRANDR */ } /* @@ -2094,14 +1982,12 @@ (JNIEnv* env, jclass x11gd, jlong window) { -#ifndef HEADLESS Window win = (Window)window; AWT_LOCK(); XSync(awt_display, False); /* ensures window is visible first */ X11GD_SetFullscreenMode(win, JNI_TRUE); AWT_UNLOCK(); -#endif /* !HEADLESS */ } /* @@ -2114,13 +2000,11 @@ (JNIEnv* env, jclass x11gd, jlong window) { -#ifndef HEADLESS Window win = (Window)window; AWT_LOCK(); X11GD_SetFullscreenMode(win, JNI_FALSE); AWT_UNLOCK(); -#endif /* !HEADLESS */ } /** --- old/src/java.desktop/unix/native/libawt_xawt/awt/awt_InputMethod.c 2020-03-02 01:41:32.095806600 -0800 +++ new/src/java.desktop/unix/native/libawt_xawt/awt/awt_InputMethod.c 2020-03-02 01:41:31.666548800 -0800 @@ -52,7 +52,7 @@ XIMPreeditDrawCallbackStruct *); static void PreeditCaretCallback(XIC, XPointer, XIMPreeditCaretCallbackStruct *); -#if defined(__linux__) || defined(MACOSX) +#if defined(__linux__) static void StatusStartCallback(XIC, XPointer, XPointer); static void StatusDoneCallback(XIC, XPointer, XPointer); static void StatusDrawCallback(XIC, XPointer, @@ -66,7 +66,7 @@ #define PreeditDoneIndex 1 #define PreeditDrawIndex 2 #define PreeditCaretIndex 3 -#if defined(__linux__) || defined(MACOSX) +#if defined(__linux__) #define StatusStartIndex 4 #define StatusDoneIndex 5 #define StatusDrawIndex 6 @@ -84,14 +84,14 @@ (XIMProc)PreeditDoneCallback, (XIMProc)PreeditDrawCallback, (XIMProc)PreeditCaretCallback, -#if defined(__linux__) || defined(MACOSX) +#if defined(__linux__) (XIMProc)StatusStartCallback, (XIMProc)StatusDoneCallback, (XIMProc)StatusDrawCallback, #endif }; -#if defined(__linux__) || defined(MACOSX) +#if defined(__linux__) #define MAX_STATUS_LEN 100 typedef struct { Window w; /*status window id */ @@ -124,7 +124,7 @@ XIMCallback *callbacks; /* callback parameters */ jobject x11inputmethod; /* global ref to X11InputMethod instance */ /* associated with the XIC */ -#if defined(__linux__) || defined(MACOSX) +#if defined(__linux__) StatusWindow *statusWindow; /* our own status window */ #endif char *lookup_buf; /* buffer used for XmbLookupString */ @@ -175,7 +175,7 @@ static void setX11InputMethodData(JNIEnv *, jobject, X11InputMethodData *); static void destroyX11InputMethodData(JNIEnv *, X11InputMethodData *); static void freeX11InputMethodData(JNIEnv *, X11InputMethodData *); -#if defined(__linux__) || defined(MACOSX) +#if defined(__linux__) static Window getParentWindow(Window); #endif @@ -375,7 +375,7 @@ static void freeX11InputMethodData(JNIEnv *env, X11InputMethodData *pX11IMData) { -#if defined(__linux__) || defined(MACOSX) +#if defined(__linux__) if (pX11IMData->statusWindow != NULL){ StatusWindow *sw = pX11IMData->statusWindow; XFreeGC(awt_display, sw->lightGC); @@ -478,7 +478,7 @@ pX11IMData = getX11InputMethodData(env, currentX11InputMethodInstance); if (pX11IMData == NULL) { -#if defined(__linux__) || defined(MACOSX) +#if defined(__linux__) return False; #else return result; @@ -486,7 +486,7 @@ } if ((ic = pX11IMData->current_ic) == (XIC)0){ -#if defined(__linux__) || defined(MACOSX) +#if defined(__linux__) return False; #else return result; @@ -578,7 +578,7 @@ return result; } -#if defined(__linux__) || defined(MACOSX) +#if defined(__linux__) static StatusWindow *createStatusWindow(Window parent) { StatusWindow *statusWindow; XSetWindowAttributes attrib; @@ -852,7 +852,7 @@ } } } -#endif /* __linux__ || MACOSX */ +#endif /* __linux__ */ /* * Creates two XICs, one for active clients and the other for passive @@ -898,7 +898,7 @@ on_the_spot_styles |= XIMStatusNothing; -#if defined(__linux__) || defined(MACOSX) +#if defined(__linux__) /*kinput does not support XIMPreeditCallbacks and XIMStatusArea at the same time, so use StatusCallback to draw the status ourself @@ -909,7 +909,7 @@ break; } } -#endif /* __linux__ || MACOSX */ +#endif /* __linux__ */ for (i = 0; i < im_styles->count_styles; i++) { active_styles |= im_styles->supported_styles[i] & on_the_spot_styles; @@ -963,7 +963,7 @@ NULL); if (preedit == (XVaNestedList)NULL) goto err; -#if defined(__linux__) || defined(MACOSX) +#if defined(__linux__) /*always try XIMStatusCallbacks for active client...*/ { status = (XVaNestedList)XVaCreateNestedList(0, @@ -985,7 +985,7 @@ XFree((void *)status); XFree((void *)preedit); } -#else /* !__linux__ && !MACOSX */ +#else /* !__linux__ */ pX11IMData->ic_active = XCreateIC(X11im, XNClientWindow, w, XNFocusWindow, w, @@ -993,7 +993,7 @@ XNPreeditAttributes, preedit, NULL); XFree((void *)preedit); -#endif /* __linux__ || MACOSX */ +#endif /* __linux__ */ } else { pX11IMData->ic_active = XCreateIC(X11im, XNClientWindow, w, @@ -1173,7 +1173,7 @@ /* printf("Native: PreeditCaretCallback\n"); */ } -#if defined(__linux__) || defined(MACOSX) +#if defined(__linux__) static void StatusStartCallback(XIC ic, XPointer client_data, XPointer call_data) { @@ -1262,7 +1262,7 @@ finally: AWT_UNLOCK(); } -#endif /* __linux__ || MACOSX */ +#endif /* __linux__ */ static void CommitStringCallback(XIC ic, XPointer client_data, XPointer call_data) { JNIEnv *env = GetJNIEnv(); @@ -1356,14 +1356,14 @@ /* Use IMInstantiate call back only on Linux, as there is a bug in Solaris (4768335) */ -#if defined(__linux__) || defined(MACOSX) +#if defined(__linux__) registered = XRegisterIMInstantiateCallback(dpy, NULL, NULL, NULL, (XIDProc)OpenXIMCallback, NULL); if (!registered) { /* directly call openXIM callback */ #endif OpenXIMCallback(dpy, NULL, NULL); -#if defined(__linux__) || defined(MACOSX) +#if defined(__linux__) } #endif @@ -1398,9 +1398,9 @@ globalRef = (*env)->NewGlobalRef(env, this); pX11IMData->x11inputmethod = globalRef; -#if defined(__linux__) || defined(MACOSX) +#if defined(__linux__) pX11IMData->statusWindow = NULL; -#endif /* __linux__ || MACOSX */ +#endif /* __linux__ */ pX11IMData->lookup_buf = 0; pX11IMData->lookup_buf_len = 0; @@ -1450,14 +1450,14 @@ setXICFocus(pX11IMData->current_ic, req); currentX11InputMethodInstance = pX11IMData->x11inputmethod; currentFocusWindow = w; -#if defined(__linux__) || defined(MACOSX) +#if defined(__linux__) if (active && pX11IMData->statusWindow && pX11IMData->statusWindow->on) onoffStatusWindow(pX11IMData, w, True); #endif } else { currentX11InputMethodInstance = NULL; currentFocusWindow = 0; -#if defined(__linux__) || defined(MACOSX) +#if defined(__linux__) onoffStatusWindow(pX11IMData, 0, False); if (pX11IMData->current_ic != NULL) #endif @@ -1492,7 +1492,7 @@ JNIEXPORT void JNICALL Java_sun_awt_X11InputMethodBase_turnoffStatusWindow (JNIEnv *env, jobject this) { -#if defined(__linux__) || defined(MACOSX) +#if defined(__linux__) X11InputMethodData *pX11IMData; StatusWindow *statusWindow; @@ -1607,7 +1607,7 @@ X11InputMethodData *pX11IMData; char * ret = NULL; XVaNestedList pr_atrb; -#if defined(__linux__) || defined(MACOSX) +#if defined(__linux__) Boolean calledXSetICFocus = False; #endif @@ -1619,7 +1619,7 @@ return JNI_FALSE; } -#if defined(__linux__) || defined(MACOSX) +#if defined(__linux__) if (NULL != pX11IMData->statusWindow) { Window focus = 0; int revert_to; @@ -1647,7 +1647,7 @@ NULL); ret = XSetICValues(pX11IMData->current_ic, XNPreeditAttributes, pr_atrb, NULL); XFree((void *)pr_atrb); -#if defined(__linux__) || defined(MACOSX) +#if defined(__linux__) if (calledXSetICFocus) { XSetICFocus(pX11IMData->ic_active); } @@ -1714,14 +1714,14 @@ JNIEXPORT void JNICALL Java_sun_awt_X11_XInputMethod_adjustStatusWindow (JNIEnv *env, jobject this, jlong window) { -#if defined(__linux__) || defined(MACOSX) +#if defined(__linux__) AWT_LOCK(); adjustStatusWindow(window); AWT_UNLOCK(); #endif } -#if defined(__linux__) || defined(MACOSX) +#if defined(__linux__) static Window getParentWindow(Window w) { Window root=None, parent=None, *ignore_children=NULL; --- old/src/java.desktop/unix/native/libawt_xawt/awt/awt_Insets.c 2020-03-02 01:41:34.488186500 -0800 +++ new/src/java.desktop/unix/native/libawt_xawt/awt/awt_Insets.c 2020-03-02 01:41:34.056077300 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2020, 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 @@ -23,6 +23,10 @@ * questions. */ +#ifdef HEADLESS + #error This file should not be included in headless library +#endif + #include "java_awt_Insets.h" JNIEXPORT void JNICALL --- old/src/java.desktop/unix/native/libawt_xawt/awt/awt_MenuComponent.h 2020-03-02 01:41:36.797702400 -0800 +++ new/src/java.desktop/unix/native/libawt_xawt/awt/awt_MenuComponent.h 2020-03-02 01:41:36.366597200 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2020, 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 @@ -23,6 +23,10 @@ * questions. */ +#ifdef HEADLESS + #error This file should not be included in headless library +#endif + #include "jni_util.h" struct MenuComponentIDs { --- old/src/java.desktop/unix/native/libawt_xawt/awt/awt_Robot.c 2020-03-02 01:41:39.104221500 -0800 +++ new/src/java.desktop/unix/native/libawt_xawt/awt/awt_Robot.c 2020-03-02 01:41:38.675115900 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2020, 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 @@ -50,7 +50,7 @@ #include "java_awt_event_InputEvent.h" -#if defined(__linux__) || defined(MACOSX) +#if defined(__linux__) #include #endif --- old/src/java.desktop/unix/native/libawt_xawt/awt/awt_UNIXToolkit.c 2020-03-02 01:41:41.454749100 -0800 +++ new/src/java.desktop/unix/native/libawt_xawt/awt/awt_UNIXToolkit.c 2020-03-02 01:41:41.023643700 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2020, 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 @@ -23,6 +23,10 @@ * questions. */ +#ifdef HEADLESS + #error This file should not be included in headless library +#endif + #include #include #include @@ -32,11 +36,8 @@ #include #include "sun_awt_UNIXToolkit.h" -#ifndef HEADLESS #include "awt.h" #include "gtk_interface.h" -#endif /* !HEADLESS */ - static jclass this_class = NULL; static jmethodID icon_upcall_method = NULL; @@ -49,11 +50,7 @@ */ JNIEXPORT jboolean JNICALL Java_sun_awt_UNIXToolkit_check_1gtk(JNIEnv *env, jclass klass, jint version) { -#ifndef HEADLESS return (jboolean)gtk_check_version(version); -#else - return JNI_FALSE; -#endif /* !HEADLESS */ } @@ -65,14 +62,9 @@ JNIEXPORT jboolean JNICALL Java_sun_awt_UNIXToolkit_load_1gtk(JNIEnv *env, jclass klass, jint version, jboolean verbose) { -#ifndef HEADLESS return (jboolean)gtk_load(env, version, verbose); -#else - return JNI_FALSE; -#endif /* !HEADLESS */ } - /* * Class: sun_awt_UNIXToolkit * Method: unload_gtk @@ -81,11 +73,7 @@ JNIEXPORT jboolean JNICALL Java_sun_awt_UNIXToolkit_unload_1gtk(JNIEnv *env, jclass klass) { -#ifndef HEADLESS return (jboolean)gtk->unload(); -#else - return JNI_FALSE; -#endif /* !HEADLESS */ } jboolean init_method(JNIEnv *env, jobject this) @@ -111,7 +99,6 @@ Java_sun_awt_UNIXToolkit_load_1gtk_1icon(JNIEnv *env, jobject this, jstring filename) { -#ifndef HEADLESS int len; jsize jlen; char *filename_str = NULL; @@ -142,9 +129,6 @@ free(filename_str); return result; -#else /* HEADLESS */ - return JNI_FALSE; -#endif /* !HEADLESS */ } /* @@ -159,7 +143,6 @@ jint widget_type, jstring stock_id, jint icon_size, jint text_direction, jstring detail) { -#ifndef HEADLESS int len; jsize jlen; char *stock_id_str = NULL; @@ -206,9 +189,6 @@ free(detail_str); return result; -#else /* HEADLESS */ - return JNI_FALSE; -#endif /* !HEADLESS */ } /* @@ -219,11 +199,9 @@ JNIEXPORT void JNICALL Java_sun_awt_UNIXToolkit_nativeSync(JNIEnv *env, jobject this) { -#ifndef HEADLESS AWT_LOCK(); XSync(awt_display, False); AWT_UNLOCK(); -#endif /* !HEADLESS */ } /* @@ -275,9 +253,5 @@ JNIEXPORT jint JNICALL Java_sun_awt_UNIXToolkit_get_1gtk_1version(JNIEnv *env, jclass klass) { -#ifndef HEADLESS return gtk ? gtk->version : GTK_ANY; -#else - return GTK_ANY; -#endif /* !HEADLESS */ } --- old/src/java.desktop/unix/native/libawt_xawt/awt/canvas.h 2020-03-02 01:41:43.767269100 -0800 +++ new/src/java.desktop/unix/native/libawt_xawt/awt/canvas.h 2020-03-02 01:41:43.335172100 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2020, 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 @@ -22,11 +22,14 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + +#ifdef HEADLESS + #error This file should not be included in headless library +#endif + #ifndef _CANVAS_H_ #define _CANVAS_H_ -#ifndef HEADLESS KeySym awt_getX11KeySym(jint awtKey); -#endif /* !HEADLESS */ #endif /* _CANVAS_H_ */ --- old/src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.c 2020-03-02 01:41:46.057784000 -0800 +++ new/src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.c 2020-03-02 01:41:45.626678500 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2020, 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 @@ -22,6 +22,11 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + +#ifdef HEADLESS + #error This file should not be included in headless library +#endif + #include #include #include --- old/src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.h 2020-03-02 01:41:48.453560600 -0800 +++ new/src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.h 2020-03-02 01:41:48.024217400 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2020, 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 @@ -22,6 +22,11 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + +#ifdef HEADLESS + #error This file should not be included in headless library +#endif + #ifndef _GTK2_INTERFACE_H #define _GTK2_INTERFACE_H --- old/src/java.desktop/unix/native/libawt_xawt/awt/gtk3_interface.c 2020-03-02 01:41:50.753845100 -0800 +++ new/src/java.desktop/unix/native/libawt_xawt/awt/gtk3_interface.c 2020-03-02 01:41:50.329749900 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2020, 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 @@ -22,6 +22,11 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + +#ifdef HEADLESS + #error This file should not be included in headless library +#endif + #include #include #include --- old/src/java.desktop/unix/native/libawt_xawt/awt/gtk3_interface.h 2020-03-02 01:41:53.161398200 -0800 +++ new/src/java.desktop/unix/native/libawt_xawt/awt/gtk3_interface.h 2020-03-02 01:41:52.729289100 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2020, 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 @@ -22,6 +22,11 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + +#ifdef HEADLESS + #error This file should not be included in headless library +#endif + #ifndef _GTK3_INTERFACE_H #define _GTK3_INTERFACE_H --- old/src/java.desktop/unix/native/libawt_xawt/awt/gtk_interface.c 2020-03-02 01:41:55.496919900 -0800 +++ new/src/java.desktop/unix/native/libawt_xawt/awt/gtk_interface.c 2020-03-02 01:41:55.065814500 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2020, 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 @@ -22,6 +22,11 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + +#ifdef HEADLESS + #error This file should not be included in headless library +#endif + #include #include #include "jvm_md.h" --- old/src/java.desktop/unix/native/libawt_xawt/awt/gtk_interface.h 2020-03-02 01:41:57.797437100 -0800 +++ new/src/java.desktop/unix/native/libawt_xawt/awt/gtk_interface.h 2020-03-02 01:41:57.366331800 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2020, 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 @@ -22,6 +22,11 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + +#ifdef HEADLESS + #error This file should not be included in headless library +#endif + #ifndef _GTK_INTERFACE_H #define _GTK_INTERFACE_H --- old/src/java.desktop/unix/native/libawt_xawt/awt/list.c 2020-03-02 01:42:00.108956800 -0800 +++ new/src/java.desktop/unix/native/libawt_xawt/awt/list.c 2020-03-02 01:41:59.679860300 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2020, 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 @@ -63,6 +63,10 @@ ----------------------------------------------------------------------- **/ +#ifdef HEADLESS + #error This file should not be included in headless library +#endif + #include #include --- old/src/java.desktop/unix/native/libawt_xawt/awt/list.h 2020-03-02 01:42:02.382459100 -0800 +++ new/src/java.desktop/unix/native/libawt_xawt/awt/list.h 2020-03-02 01:42:01.961365700 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2020, 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 @@ -63,6 +63,10 @@ -------------------------------------------------------------------- **/ +#ifdef HEADLESS + #error This file should not be included in headless library +#endif + #ifndef LIST_DEF #define LIST_DEF --- old/src/java.desktop/unix/native/libawt_xawt/awt/multiVis.c 2020-03-02 01:42:04.660983600 -0800 +++ new/src/java.desktop/unix/native/libawt_xawt/awt/multiVis.c 2020-03-02 01:42:04.230875000 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2020, 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 @@ -63,6 +63,10 @@ ------------------------------------------------------------------------ **/ +#ifdef HEADLESS + #error This file should not be included in headless library +#endif + #include #include #include --- old/src/java.desktop/unix/native/libawt_xawt/awt/multiVis.h 2020-03-02 01:42:07.015512600 -0800 +++ new/src/java.desktop/unix/native/libawt_xawt/awt/multiVis.h 2020-03-02 01:42:06.586405200 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2020, 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 @@ -63,6 +63,10 @@ ------------------------------------------------------------------------ **/ +#ifdef HEADLESS + #error This file should not be included in headless library +#endif + extern int GetMultiVisualRegions( Display *, Window, int, int, unsigned int, unsigned int, int *, int *, XVisualInfo **, int *, --- old/src/java.desktop/unix/native/libawt_xawt/awt/sun_awt_X11_GtkFileDialogPeer.c 2020-03-02 01:42:09.325028700 -0800 +++ new/src/java.desktop/unix/native/libawt_xawt/awt/sun_awt_X11_GtkFileDialogPeer.c 2020-03-02 01:42:08.895932200 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2020, 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 @@ -23,6 +23,10 @@ * questions. */ +#ifdef HEADLESS + #error This file should not be included in headless library +#endif + #include #include #include --- old/src/java.desktop/unix/native/libawt_xawt/awt/swing_GTKEngine.c 2020-03-02 01:42:11.633539100 -0800 +++ new/src/java.desktop/unix/native/libawt_xawt/awt/swing_GTKEngine.c 2020-03-02 01:42:11.199441200 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2020, 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 @@ -23,6 +23,10 @@ * questions. */ +#ifdef HEADLESS + #error This file should not be included in headless library +#endif + #include #include #include "gtk_interface.h" --- old/src/java.desktop/unix/native/libawt_xawt/awt/swing_GTKStyle.c 2020-03-02 01:42:13.924062600 -0800 +++ new/src/java.desktop/unix/native/libawt_xawt/awt/swing_GTKStyle.c 2020-03-02 01:42:13.504960000 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2020, 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 @@ -23,6 +23,10 @@ * questions. */ +#ifdef HEADLESS + #error This file should not be included in headless library +#endif + #include #include #include "gtk_interface.h" --- old/src/java.desktop/unix/native/libawt_xawt/awt/wsutils.h 2020-03-02 01:42:16.213568900 -0800 +++ new/src/java.desktop/unix/native/libawt_xawt/awt/wsutils.h 2020-03-02 01:42:15.792476300 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2020, 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 @@ -70,6 +70,10 @@ * ******************************************************************************/ +#ifdef HEADLESS + #error This file should not be included in headless library +#endif + typedef unsigned long Pixel; /* This is the actual structure returned by the X server describing the --- old/src/java.desktop/unix/native/libawt_xawt/java2d/x11/XRBackendNative.c 2020-03-02 01:42:18.500090700 -0800 +++ new/src/java.desktop/unix/native/libawt_xawt/java2d/x11/XRBackendNative.c 2020-03-02 01:42:18.077987700 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2020, 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 @@ -23,6 +23,10 @@ * questions. */ +#ifdef HEADLESS + #error This file should not be included in headless library +#endif + #include "X11SurfaceData.h" #include #include @@ -308,7 +312,6 @@ Java_sun_awt_X11GraphicsEnvironment_initXRender (JNIEnv *env, jclass x11ge, jboolean verbose, jboolean ignoreLinuxVersion) { -#ifndef HEADLESS static jboolean xrenderAvailable = JNI_FALSE; static jboolean firstTime = JNI_TRUE; @@ -326,12 +329,8 @@ firstTime = JNI_FALSE; } return xrenderAvailable; -#else - return JNI_FALSE; -#endif /* !HEADLESS */ } - JNIEXPORT void JNICALL Java_sun_java2d_xr_XRBackendNative_initIDs(JNIEnv *env, jclass cls) { char *maskData; --- old/src/java.desktop/unix/native/libawt_xawt/java2d/x11/XRSurfaceData.c 2020-03-02 01:42:20.863622000 -0800 +++ new/src/java.desktop/unix/native/libawt_xawt/java2d/x11/XRSurfaceData.c 2020-03-02 01:42:20.439519500 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2020, 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 @@ -23,6 +23,10 @@ * questions. */ +#ifdef HEADLESS + #error This file should not be included in headless library +#endif + #include "GraphicsPrimitiveMgr.h" #include "Region.h" #include "Trace.h" @@ -43,20 +47,16 @@ #include #include -#ifndef HEADLESS jfieldID pictID; jfieldID xidID; jfieldID blitMaskPMID; jfieldID blitMaskPictID; -#endif /* !HEADLESS */ JNIEXPORT void JNICALL Java_sun_java2d_xr_XRSurfaceData_initXRPicture(JNIEnv *env, jobject xsd, jlong pXSData, jint pictFormat) { -#ifndef HEADLESS - X11SDOps *xsdo; XRenderPictFormat *fmt; @@ -78,13 +78,11 @@ (*env)->SetIntField (env, xsd, pictID, xsdo->xrPic); (*env)->SetIntField (env, xsd, xidID, xsdo->drawable); -#endif /* !HEADLESS */ } JNIEXPORT void JNICALL Java_sun_java2d_xr_XRSurfaceData_initIDs(JNIEnv *env, jclass xsd) { -#ifndef HEADLESS J2dTraceLn(J2D_TRACE_INFO, "in XRSurfaceData_initIDs"); pictID = (*env)->GetFieldID(env, xsd, "picture", "I"); @@ -97,17 +95,14 @@ } XShared_initIDs(env, JNI_FALSE); -#endif /* !HEADLESS */ } - JNIEXPORT void JNICALL Java_sun_java2d_xr_XRSurfaceData_XRInitSurface(JNIEnv *env, jclass xsd, jint depth, jint width, jint height, jlong drawable, jint pictFormat) { -#ifndef HEADLESS X11SDOps *xsdo; J2dTraceLn(J2D_TRACE_INFO, "in XRSurfaceData_initSurface"); @@ -118,16 +113,12 @@ } XShared_initSurface(env, xsdo, depth, width, height, drawable); -#endif /* !HEADLESS */ } - - JNIEXPORT void JNICALL Java_sun_java2d_xr_XRSurfaceData_freeXSDOPicture(JNIEnv *env, jobject xsd, jlong pXSData) { -#ifndef HEADLESS X11SDOps *xsdo; J2dTraceLn(J2D_TRACE_INFO, "in XRSurfaceData_freeXSDOPicture"); @@ -141,5 +132,4 @@ XRenderFreePicture(awt_display, xsdo->xrPic); xsdo->xrPic = None; } -#endif /* !HEADLESS */ } --- old/src/java.desktop/unix/native/libawt_xawt/xawt/XToolkit.c 2020-03-02 01:42:23.141138200 -0800 +++ new/src/java.desktop/unix/native/libawt_xawt/xawt/XToolkit.c 2020-03-02 01:42:22.714030000 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2020, 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 @@ -23,6 +23,10 @@ * questions. */ +#ifdef HEADLESS + #error This file should not be included in headless library +#endif + #include #include #include @@ -73,12 +77,9 @@ struct MenuComponentIDs menuComponentIDs; -#ifndef HEADLESS - extern Display* awt_init_Display(JNIEnv *env, jobject this); extern void freeNativeStringArray(char **array, jsize length); extern char** stringArrayToNative(JNIEnv *env, jobjectArray array, jsize * ret_length); -#endif /* !HEADLESS */ /* This function gets called from the static initializer for FileDialog.java to initialize the fieldIDs for fields that may be accessed from C */ @@ -310,11 +311,7 @@ } JNIEXPORT jboolean JNICALL AWTIsHeadless() { -#ifdef HEADLESS - return JNI_TRUE; -#else return JNI_FALSE; -#endif } JNIEXPORT void JNICALL Java_java_awt_Dialog_initIDs (JNIEnv *env, jclass cls) --- old/src/java.desktop/unix/native/libawt_xawt/xawt/XWindow.c 2020-03-02 01:42:25.477664400 -0800 +++ new/src/java.desktop/unix/native/libawt_xawt/xawt/XWindow.c 2020-03-02 01:42:25.057570200 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2020, 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 @@ -86,7 +86,6 @@ extern jobject currentX11InputMethodInstance; extern Boolean awt_x11inputmethod_lookupString(XKeyPressedEvent *, KeySym *); Boolean awt_UseType4Patch = False; -/* how about HEADLESS */ Boolean awt_ServerDetected = False; Boolean awt_XKBDetected = False; Boolean awt_IsXsun = False; @@ -906,7 +905,7 @@ { KeySym originalKeysym = *keysym; -#if !defined(__linux__) && !defined(MACOSX) +#if !defined(__linux__) /* The following code on Linux will cause the keypad keys * not to echo on JTextField when the NumLock is on. The * keysyms will be 0, because the last parameter 2 is not defined. --- old/src/java.desktop/unix/native/libawt_xawt/xawt/XlibWrapper.c 2020-03-02 01:42:27.850206500 -0800 +++ new/src/java.desktop/unix/native/libawt_xawt/xawt/XlibWrapper.c 2020-03-02 01:42:27.414100200 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2020, 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 @@ -23,6 +23,10 @@ * questions. */ +#ifdef HEADLESS + #error This file should not be included in headless library +#endif + #include "awt.h" #include "awt_util.h" #include "jni.h" --- old/src/java.desktop/unix/native/libawt_xawt/xawt/awt_Desktop.c 2020-03-02 01:42:30.304750000 -0800 +++ new/src/java.desktop/unix/native/libawt_xawt/xawt/awt_Desktop.c 2020-03-02 01:42:29.856648400 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2020, 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 @@ -23,6 +23,10 @@ * questions. */ +#ifdef HEADLESS + #error This file should not be included in headless library +#endif + #include "jni_util.h" #include "gtk_interface.h" #include "gnome_interface.h" --- old/src/java.desktop/unix/native/libawt_xawt/xawt/awt_Taskbar.c 2020-03-02 01:42:32.695288700 -0800 +++ new/src/java.desktop/unix/native/libawt_xawt/xawt/awt_Taskbar.c 2020-03-02 01:42:32.250187200 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2020, 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 @@ -23,6 +23,10 @@ * questions. */ +#ifdef HEADLESS + #error This file should not be included in headless library +#endif + #include #include "jvm_md.h" #include --- old/src/java.desktop/unix/native/libawt_xawt/xawt/awt_Taskbar.h 2020-03-02 01:42:35.049795700 -0800 +++ new/src/java.desktop/unix/native/libawt_xawt/xawt/awt_Taskbar.h 2020-03-02 01:42:34.622691300 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2020, 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 @@ -23,6 +23,10 @@ * questions. */ +#ifdef HEADLESS + #error This file should not be included in headless library +#endif + #ifndef AWT_TASKBAR_H #define AWT_TASKBAR_H --- old/src/java.desktop/unix/native/libawt_xawt/xawt/gnome_interface.c 2020-03-02 01:42:37.341311100 -0800 +++ new/src/java.desktop/unix/native/libawt_xawt/xawt/gnome_interface.c 2020-03-02 01:42:36.913206100 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2020, 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 @@ -23,6 +23,10 @@ * questions. */ +#ifdef HEADLESS + #error This file should not be included in headless library +#endif + #include "gnome_interface.h" GNOME_URL_SHOW_TYPE *gnome_url_show = NULL; --- old/src/java.desktop/unix/native/libawt_xawt/xawt/gnome_interface.h 2020-03-02 01:42:39.730848300 -0800 +++ new/src/java.desktop/unix/native/libawt_xawt/xawt/gnome_interface.h 2020-03-02 01:42:39.270737500 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2020, 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 @@ -23,6 +23,10 @@ * questions. */ +#ifdef HEADLESS + #error This file should not be included in headless library +#endif + #ifndef _GNOME_INTERFACE_H #define _GNOME_INTERFACE_H #include "gtk_interface.h"