equal
deleted
inserted
replaced
32 #include <sun_awt_X11GraphicsDevice.h> |
32 #include <sun_awt_X11GraphicsDevice.h> |
33 #include <sun_awt_X11GraphicsConfig.h> |
33 #include <sun_awt_X11GraphicsConfig.h> |
34 #ifndef HEADLESS |
34 #ifndef HEADLESS |
35 #include <X11/extensions/Xdbe.h> |
35 #include <X11/extensions/Xdbe.h> |
36 #include <X11/XKBlib.h> |
36 #include <X11/XKBlib.h> |
37 #ifndef _AIX |
37 #ifndef NO_XRANDR |
38 #include <X11/extensions/Xrandr.h> |
38 #include <X11/extensions/Xrandr.h> |
39 #endif |
39 #endif |
40 #include "GLXGraphicsConfig.h" |
40 #include "GLXGraphicsConfig.h" |
41 #endif /* !HEADLESS */ |
41 #endif /* !HEADLESS */ |
42 |
42 |
1625 * Begin DisplayMode/FullScreen support |
1625 * Begin DisplayMode/FullScreen support |
1626 */ |
1626 */ |
1627 |
1627 |
1628 #ifndef HEADLESS |
1628 #ifndef HEADLESS |
1629 |
1629 |
1630 #ifndef _AIX |
1630 #ifndef NO_XRANDR |
1631 |
1631 |
1632 #define BIT_DEPTH_MULTI java_awt_DisplayMode_BIT_DEPTH_MULTI |
1632 #define BIT_DEPTH_MULTI java_awt_DisplayMode_BIT_DEPTH_MULTI |
1633 #define REFRESH_RATE_UNKNOWN java_awt_DisplayMode_REFRESH_RATE_UNKNOWN |
1633 #define REFRESH_RATE_UNKNOWN java_awt_DisplayMode_REFRESH_RATE_UNKNOWN |
1634 |
1634 |
1635 typedef Status |
1635 typedef Status |
1832 (*env)->CallObjectMethod(env, arrayList, mid, displayMode); |
1832 (*env)->CallObjectMethod(env, arrayList, mid, displayMode); |
1833 (*env)->DeleteLocalRef(env, displayMode); |
1833 (*env)->DeleteLocalRef(env, displayMode); |
1834 } |
1834 } |
1835 } |
1835 } |
1836 |
1836 |
1837 #endif /* !_AIX */ |
1837 #endif /* !NO_XRANDR */ |
1838 |
1838 |
1839 static void |
1839 static void |
1840 X11GD_SetFullscreenMode(Window win, jboolean enabled) |
1840 X11GD_SetFullscreenMode(Window win, jboolean enabled) |
1841 { |
1841 { |
1842 Atom wmState = XInternAtom(awt_display, "_NET_WM_STATE", False); |
1842 Atom wmState = XInternAtom(awt_display, "_NET_WM_STATE", False); |
1873 */ |
1873 */ |
1874 JNIEXPORT jboolean JNICALL |
1874 JNIEXPORT jboolean JNICALL |
1875 Java_sun_awt_X11GraphicsDevice_initXrandrExtension |
1875 Java_sun_awt_X11GraphicsDevice_initXrandrExtension |
1876 (JNIEnv *env, jclass x11gd) |
1876 (JNIEnv *env, jclass x11gd) |
1877 { |
1877 { |
1878 #if defined(HEADLESS) || defined(_AIX) |
1878 #if defined(HEADLESS) || defined(NO_XRANDR) |
1879 return JNI_FALSE; |
1879 return JNI_FALSE; |
1880 #else |
1880 #else |
1881 int opcode = 0, firstEvent = 0, firstError = 0; |
1881 int opcode = 0, firstEvent = 0, firstError = 0; |
1882 jboolean ret; |
1882 jboolean ret; |
1883 |
1883 |
1900 */ |
1900 */ |
1901 JNIEXPORT jobject JNICALL |
1901 JNIEXPORT jobject JNICALL |
1902 Java_sun_awt_X11GraphicsDevice_getCurrentDisplayMode |
1902 Java_sun_awt_X11GraphicsDevice_getCurrentDisplayMode |
1903 (JNIEnv* env, jclass x11gd, jint screen) |
1903 (JNIEnv* env, jclass x11gd, jint screen) |
1904 { |
1904 { |
1905 #if defined(HEADLESS) || defined(_AIX) |
1905 #if defined(HEADLESS) || defined(NO_XRANDR) |
1906 return NULL; |
1906 return NULL; |
1907 #else |
1907 #else |
1908 XRRScreenConfiguration *config; |
1908 XRRScreenConfiguration *config; |
1909 jobject displayMode = NULL; |
1909 jobject displayMode = NULL; |
1910 |
1910 |
1996 JNIEXPORT void JNICALL |
1996 JNIEXPORT void JNICALL |
1997 Java_sun_awt_X11GraphicsDevice_enumDisplayModes |
1997 Java_sun_awt_X11GraphicsDevice_enumDisplayModes |
1998 (JNIEnv* env, jclass x11gd, |
1998 (JNIEnv* env, jclass x11gd, |
1999 jint screen, jobject arrayList) |
1999 jint screen, jobject arrayList) |
2000 { |
2000 { |
2001 #if !defined(HEADLESS) && !defined(_AIX) |
2001 #if !defined(HEADLESS) && !defined(NO_XRANDR) |
2002 |
2002 |
2003 AWT_LOCK(); |
2003 AWT_LOCK(); |
2004 |
2004 |
2005 if (usingXinerama && XScreenCount(awt_display) > 0) { |
2005 if (usingXinerama && XScreenCount(awt_display) > 0) { |
2006 XRRScreenResources *res = awt_XRRGetScreenResources(awt_display, |
2006 XRRScreenResources *res = awt_XRRGetScreenResources(awt_display, |
2084 JNIEXPORT void JNICALL |
2084 JNIEXPORT void JNICALL |
2085 Java_sun_awt_X11GraphicsDevice_configDisplayMode |
2085 Java_sun_awt_X11GraphicsDevice_configDisplayMode |
2086 (JNIEnv* env, jclass x11gd, |
2086 (JNIEnv* env, jclass x11gd, |
2087 jint screen, jint width, jint height, jint refreshRate) |
2087 jint screen, jint width, jint height, jint refreshRate) |
2088 { |
2088 { |
2089 #if !defined(HEADLESS) && !defined(_AIX) |
2089 #if !defined(HEADLESS) && !defined(NO_XRANDR) |
2090 jboolean success = JNI_FALSE; |
2090 jboolean success = JNI_FALSE; |
2091 XRRScreenConfiguration *config; |
2091 XRRScreenConfiguration *config; |
2092 Drawable root; |
2092 Drawable root; |
2093 Rotation currentRotation = RR_Rotate_0; |
2093 Rotation currentRotation = RR_Rotate_0; |
2094 |
2094 |
2201 /** |
2201 /** |
2202 * End DisplayMode/FullScreen support |
2202 * End DisplayMode/FullScreen support |
2203 */ |
2203 */ |
2204 |
2204 |
2205 static char *get_output_screen_name(JNIEnv *env, int screen) { |
2205 static char *get_output_screen_name(JNIEnv *env, int screen) { |
2206 #ifdef _AIX |
2206 #ifdef NO_XRANDR |
2207 return NULL; |
2207 return NULL; |
2208 #else |
2208 #else |
2209 if (!awt_XRRGetScreenResources || !awt_XRRGetOutputInfo) { |
2209 if (!awt_XRRGetScreenResources || !awt_XRRGetOutputInfo) { |
2210 return NULL; |
2210 return NULL; |
2211 } |
2211 } |
2233 } |
2233 } |
2234 awt_XRRFreeScreenResources(res); |
2234 awt_XRRFreeScreenResources(res); |
2235 } |
2235 } |
2236 AWT_UNLOCK(); |
2236 AWT_UNLOCK(); |
2237 return name; |
2237 return name; |
2238 #endif /* _AIX */ |
2238 #endif /* NO_XRANDR */ |
2239 } |
2239 } |
2240 |
2240 |
2241 /* |
2241 /* |
2242 * Class: sun_awt_X11GraphicsDevice |
2242 * Class: sun_awt_X11GraphicsDevice |
2243 * Method: getNativeScaleFactor |
2243 * Method: getNativeScaleFactor |