aboutsummaryrefslogtreecommitdiffstats
path: root/src/newt/native
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2013-04-19 02:46:48 +0200
committerSven Gothel <[email protected]>2013-04-19 02:46:48 +0200
commit03a3f209aff955410e0f3133e73078529c23d3e1 (patch)
tree2ad0e5c23de042ee098c526915741ad37355f1da /src/newt/native
parent5eee4251b781e90ac66c33a2a1bcb7f2f6cf736a (diff)
Bug 721: NEWT/X11 RandR 1.3 Support - Part 2 - Rename impl class/files, start RandR13 coding.
Diffstat (limited to 'src/newt/native')
-rw-r--r--src/newt/native/X11Common.h3
-rw-r--r--src/newt/native/X11RandR11.c (renamed from src/newt/native/X11ScreenRandR11.c)73
-rw-r--r--src/newt/native/X11RandR13.c (renamed from src/newt/native/X11ScreenRandR13.c)94
-rw-r--r--src/newt/native/X11Screen.c21
-rw-r--r--src/newt/native/X11Screen.h2
5 files changed, 90 insertions, 103 deletions
diff --git a/src/newt/native/X11Common.h b/src/newt/native/X11Common.h
index 7f35216e3..e58cdb755 100644
--- a/src/newt/native/X11Common.h
+++ b/src/newt/native/X11Common.h
@@ -47,7 +47,8 @@
#include "jogamp_newt_driver_x11_DisplayDriver.h"
#include "jogamp_newt_driver_x11_ScreenDriver.h"
-#include "jogamp_newt_driver_x11_ScreenRandR11.h"
+#include "jogamp_newt_driver_x11_RandR11.h"
+#include "jogamp_newt_driver_x11_RandR13.h"
#include "jogamp_newt_driver_x11_WindowDriver.h"
#include "Window.h"
diff --git a/src/newt/native/X11ScreenRandR11.c b/src/newt/native/X11RandR11.c
index a457fd47b..cbf911a38 100644
--- a/src/newt/native/X11ScreenRandR11.c
+++ b/src/newt/native/X11RandR11.c
@@ -29,11 +29,11 @@
#include "X11Screen.h"
/*
- * Class: jogamp_newt_driver_x11_ScreenRandR11
+ * Class: jogamp_newt_driver_x11_RandR11
* Method: getAvailableScreenModeRotations0
* Signature: (JI)I
*/
-JNIEXPORT jintArray JNICALL Java_jogamp_newt_driver_x11_ScreenRandR11_getAvailableScreenModeRotations0
+JNIEXPORT jintArray JNICALL Java_jogamp_newt_driver_x11_RandR11_getAvailableScreenModeRotations0
(JNIEnv *env, jclass clazz, jlong display, jint scrn_idx)
{
Display *dpy = (Display *) (intptr_t) display;
@@ -43,11 +43,6 @@ JNIEXPORT jintArray JNICALL Java_jogamp_newt_driver_x11_ScreenRandR11_getAvailab
int rotations[4];
int major, minor;
- if(False == NewtScreen_getRANDRVersion(dpy, &major, &minor)) {
- fprintf(stderr, "RANDR not available\n");
- return (*env)->NewIntArray(env, 0);
- }
-
rotations_supported = XRRRotations (dpy, (int)scrn_idx, &cur_rotation);
if(0 != (rotations_supported & RR_Rotate_0)) {
@@ -79,11 +74,11 @@ JNIEXPORT jintArray JNICALL Java_jogamp_newt_driver_x11_ScreenRandR11_getAvailab
}
/*
- * Class: jogamp_newt_driver_x11_ScreenRandR11
+ * Class: jogamp_newt_driver_x11_RandR11
* Method: getNumScreenModeResolution0
* Signature: (JI)I
*/
-JNIEXPORT jint JNICALL Java_jogamp_newt_driver_x11_ScreenRandR11_getNumScreenModeResolutions0
+JNIEXPORT jint JNICALL Java_jogamp_newt_driver_x11_RandR11_getNumScreenModeResolutions0
(JNIEnv *env, jclass clazz, jlong display, jint scrn_idx)
{
Display *dpy = (Display *) (intptr_t) display;
@@ -93,11 +88,6 @@ JNIEXPORT jint JNICALL Java_jogamp_newt_driver_x11_ScreenRandR11_getNumScreenMod
timespec_now(&t0);
#endif
- if(False == NewtScreen_hasRANDR(dpy)) {
- DBG_PRINT("Java_jogamp_newt_driver_x11_ScreenRandR11_getNumScreenModeResolutions0: RANDR not available\n");
- return 0;
- }
-
#ifdef DBG_PERF
timespec_now(&t1); timespec_subtract(&td, &t1, &t0); td_ms = timespec_milliseconds(&td);
fprintf(stderr, "X11Screen_getNumScreenModeResolution0.1: %ld ms\n", td_ms); fflush(NULL);
@@ -117,20 +107,15 @@ JNIEXPORT jint JNICALL Java_jogamp_newt_driver_x11_ScreenRandR11_getNumScreenMod
}
/*
- * Class: jogamp_newt_driver_x11_ScreenRandR11
+ * Class: jogamp_newt_driver_x11_RandR11
* Method: getScreenModeResolutions0
* Signature: (JII)[I
*/
-JNIEXPORT jintArray JNICALL Java_jogamp_newt_driver_x11_ScreenRandR11_getScreenModeResolution0
+JNIEXPORT jintArray JNICALL Java_jogamp_newt_driver_x11_RandR11_getScreenModeResolution0
(JNIEnv *env, jclass clazz, jlong display, jint scrn_idx, jint resMode_idx)
{
Display *dpy = (Display *) (intptr_t) display;
- if(False == NewtScreen_hasRANDR(dpy)) {
- DBG_PRINT("Java_jogamp_newt_driver_x11_ScreenRandR11_getScreenModeResolution0: RANDR not available\n");
- return (*env)->NewIntArray(env, 0);
- }
-
int num_sizes;
XRRScreenSize *xrrs = XRRSizes(dpy, (int)scrn_idx, &num_sizes); //get possible screen resolutions
@@ -159,20 +144,15 @@ JNIEXPORT jintArray JNICALL Java_jogamp_newt_driver_x11_ScreenRandR11_getScreenM
}
/*
- * Class: jogamp_newt_driver_x11_ScreenRandR11
+ * Class: jogamp_newt_driver_x11_RandR11
* Method: getScreenModeRates0
* Signature: (JII)[I
*/
-JNIEXPORT jintArray JNICALL Java_jogamp_newt_driver_x11_ScreenRandR11_getScreenModeRates0
+JNIEXPORT jintArray JNICALL Java_jogamp_newt_driver_x11_RandR11_getScreenModeRates0
(JNIEnv *env, jclass clazz, jlong display, jint scrn_idx, jint resMode_idx)
{
Display *dpy = (Display *) (intptr_t) display;
- if(False == NewtScreen_hasRANDR(dpy)) {
- DBG_PRINT("Java_jogamp_newt_driver_x11_ScreenRandR11_getScreenModeRates0: RANDR not available\n");
- return (*env)->NewIntArray(env, 0);
- }
-
int num_sizes;
XRRScreenSize *xrrs = XRRSizes(dpy, (int)scrn_idx, &num_sizes); //get possible screen resolutions
@@ -202,11 +182,11 @@ JNIEXPORT jintArray JNICALL Java_jogamp_newt_driver_x11_ScreenRandR11_getScreenM
}
/*
- * Class: jogamp_newt_driver_x11_ScreenRandR11
+ * Class: jogamp_newt_driver_x11_RandR11
* Method: getScreenConfiguration0
* Signature: (JI)J
*/
-JNIEXPORT jlong JNICALL Java_jogamp_newt_driver_x11_ScreenRandR11_getScreenConfiguration0
+JNIEXPORT jlong JNICALL Java_jogamp_newt_driver_x11_RandR11_getScreenConfiguration0
(JNIEnv *env, jclass clazz, jlong display, jint screen_idx)
{
Display *dpy = (Display *) (intptr_t) display;
@@ -217,10 +197,6 @@ JNIEXPORT jlong JNICALL Java_jogamp_newt_driver_x11_ScreenRandR11_getScreenConfi
timespec_now(&t0);
#endif
- if(False == NewtScreen_hasRANDR(dpy)) {
- DBG_PRINT("Java_jogamp_newt_driver_x11_ScreenRandR11_getScreenConfiguration0: RANDR not available\n");
- return 0;
- }
#ifdef DBG_PERF
timespec_now(&t1); timespec_subtract(&td, &t1, &t0); td_ms = timespec_milliseconds(&td);
fprintf(stderr, "X11Screen_getScreenConfiguration0.1: %ld ms\n", td_ms); fflush(NULL);
@@ -237,22 +213,22 @@ JNIEXPORT jlong JNICALL Java_jogamp_newt_driver_x11_ScreenRandR11_getScreenConfi
}
/*
- * Class: jogamp_newt_driver_x11_ScreenRandR11
+ * Class: jogamp_newt_driver_x11_RandR11
* Method: freeScreenConfiguration0
* Signature: (J)V
*/
-JNIEXPORT void JNICALL Java_jogamp_newt_driver_x11_ScreenRandR11_freeScreenConfiguration0
+JNIEXPORT void JNICALL Java_jogamp_newt_driver_x11_RandR11_freeScreenConfiguration0
(JNIEnv *env, jclass clazz, jlong screenConfiguration)
{
XRRFreeScreenConfigInfo( (XRRScreenConfiguration *) (intptr_t) screenConfiguration );
}
/*
- * Class: jogamp_newt_driver_x11_ScreenRandR11
+ * Class: jogamp_newt_driver_x11_RandR11
* Method: getCurrentScreenRate0
* Signature: (J)I
*/
-JNIEXPORT jint JNICALL Java_jogamp_newt_driver_x11_ScreenRandR11_getCurrentScreenRate0
+JNIEXPORT jint JNICALL Java_jogamp_newt_driver_x11_RandR11_getCurrentScreenRate0
(JNIEnv *env, jclass clazz, jlong screenConfiguration)
{
XRRScreenConfiguration *conf = (XRRScreenConfiguration *) (intptr_t) screenConfiguration;
@@ -264,11 +240,11 @@ JNIEXPORT jint JNICALL Java_jogamp_newt_driver_x11_ScreenRandR11_getCurrentScree
}
/*
- * Class: jogamp_newt_driver_x11_ScreenRandR11
+ * Class: jogamp_newt_driver_x11_RandR11
* Method: getCurrentScreenRotation0
* Signature: (J)I
*/
-JNIEXPORT jint JNICALL Java_jogamp_newt_driver_x11_ScreenRandR11_getCurrentScreenRotation0
+JNIEXPORT jint JNICALL Java_jogamp_newt_driver_x11_RandR11_getCurrentScreenRotation0
(JNIEnv *env, jclass clazz, jlong screenConfiguration)
{
XRRScreenConfiguration *conf = (XRRScreenConfiguration *) (intptr_t) screenConfiguration;
@@ -281,11 +257,11 @@ JNIEXPORT jint JNICALL Java_jogamp_newt_driver_x11_ScreenRandR11_getCurrentScree
/*
- * Class: jogamp_newt_driver_x11_ScreenRandR11
+ * Class: jogamp_newt_driver_x11_RandR11
* Method: getCurrentScreenResolutionIndex0
* Signature: (J)I
*/
-JNIEXPORT jint JNICALL Java_jogamp_newt_driver_x11_ScreenRandR11_getCurrentScreenResolutionIndex0
+JNIEXPORT jint JNICALL Java_jogamp_newt_driver_x11_RandR11_getCurrentScreenResolutionIndex0
(JNIEnv *env, jclass clazz, jlong screenConfiguration)
{
XRRScreenConfiguration *conf = (XRRScreenConfiguration *) (intptr_t) screenConfiguration;
@@ -300,11 +276,11 @@ JNIEXPORT jint JNICALL Java_jogamp_newt_driver_x11_ScreenRandR11_getCurrentScree
}
/*
- * Class: jogamp_newt_driver_x11_ScreenRandR11
+ * Class: jogamp_newt_driver_x11_RandR11
* Method: setCurrentScreenModeStart0
* Signature: (JIJIII)Z
*/
-JNIEXPORT jboolean JNICALL Java_jogamp_newt_driver_x11_ScreenRandR11_setCurrentScreenModeStart0
+JNIEXPORT jboolean JNICALL Java_jogamp_newt_driver_x11_RandR11_setCurrentScreenModeStart0
(JNIEnv *env, jclass clazz, jlong display, jint screen_idx, jlong screenConfiguration, jint resMode_idx, jint freq, jint rotation)
{
Display *dpy = (Display *) (intptr_t) display;
@@ -349,11 +325,11 @@ JNIEXPORT jboolean JNICALL Java_jogamp_newt_driver_x11_ScreenRandR11_setCurrentS
}
/*
- * Class: jogamp_newt_driver_x11_ScreenRandR11
+ * Class: jogamp_newt_driver_x11_RandR11
* Method: setCurrentScreenModePollEnd0
* Signature: (J)Z
*/
-JNIEXPORT jboolean JNICALL Java_jogamp_newt_driver_x11_ScreenRandR11_setCurrentScreenModePollEnd0
+JNIEXPORT jboolean JNICALL Java_jogamp_newt_driver_x11_RandR11_setCurrentScreenModePollEnd0
(JNIEnv *env, jclass clazz, jlong display, jint screen_idx, jint resMode_idx, jint freq, jint rotation)
{
Display *dpy = (Display *) (intptr_t) display;
@@ -361,11 +337,6 @@ JNIEXPORT jboolean JNICALL Java_jogamp_newt_driver_x11_ScreenRandR11_setCurrentS
XEvent evt;
XRRScreenChangeNotifyEvent * scn_event = (XRRScreenChangeNotifyEvent *) &evt;
- if(False == NewtScreen_hasRANDR(dpy)) {
- DBG_PRINT("Java_jogamp_newt_driver_x11_ScreenRandR11_setCurrentScreenModePollEnd0: RANDR not available\n");
- return JNI_FALSE;
- }
-
int num_sizes;
XRRScreenSize *xrrs = XRRSizes(dpy, (int)screen_idx, &num_sizes); //get possible screen resolutions
XRRScreenConfiguration *conf;
diff --git a/src/newt/native/X11ScreenRandR13.c b/src/newt/native/X11RandR13.c
index da90d15c9..ea72cd35d 100644
--- a/src/newt/native/X11ScreenRandR13.c
+++ b/src/newt/native/X11RandR13.c
@@ -28,7 +28,48 @@
#include "X11Common.h"
-JNIEXPORT jintArray JNICALL Java_jogamp_newt_driver_x11_ScreenDriver_getOrigin0_RandR13
+/*
+ * Class: jogamp_newt_driver_x11_RandR13
+ * Method: getScreenResources0
+ * Signature: (JI)J
+ */
+JNIEXPORT jlong JNICALL Java_jogamp_newt_driver_x11_RandR13_getScreenResources0
+ (JNIEnv *env, jclass clazz, jlong display, jint screen_idx)
+{
+ Display *dpy = (Display *) (intptr_t) display;
+ Window root = RootWindow(dpy, (int)screen_idx);
+#ifdef DBG_PERF
+ struct timespec t0, t1, td;
+ long td_ms;
+ timespec_now(&t0);
+#endif
+
+#ifdef DBG_PERF
+ timespec_now(&t1); timespec_subtract(&td, &t1, &t0); td_ms = timespec_milliseconds(&td);
+ fprintf(stderr, "X11Screen_getScreenResources0.1: %ld ms\n", td_ms); fflush(NULL);
+#endif
+
+ XRRScreenResources *res = XRRGetScreenResourcesCurrent( dpy, root);
+#ifdef DBG_PERF
+ timespec_now(&t1); timespec_subtract(&td, &t1, &t0); td_ms = timespec_milliseconds(&td);
+ fprintf(stderr, "X11Screen_getScreenResources0.2 (XRRScreenResources): %ld ms\n", td_ms); fflush(NULL);
+#endif
+
+ return (jlong) (intptr_t) res;
+}
+
+/*
+ * Class: jogamp_newt_driver_x11_RandR13
+ * Method: freeScreenResources0
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_jogamp_newt_driver_x11_RandR13_freeScreenResources0
+ (JNIEnv *env, jclass clazz, jlong screenResources)
+{
+ XRRFreeScreenResources( (XRRScreenResources *) (intptr_t) screenResources );
+}
+
+JNIEXPORT jintArray JNICALL Java_jogamp_newt_driver_x11_RandR13_getOrigin0
(JNIEnv *env, jclass clazz, jlong display, jint scrn_idx)
{
Display * dpy = (Display *) (intptr_t) display;
@@ -55,7 +96,7 @@ JNIEXPORT jintArray JNICALL Java_jogamp_newt_driver_x11_ScreenDriver_getOrigin0_
return jpos;
}
-JNIEXPORT jintArray JNICALL Java_jogamp_newt_driver_x11_ScreenDriver_getAvailableScreenModeRotations0_RandR13
+JNIEXPORT jintArray JNICALL Java_jogamp_newt_driver_x11_RandR13_getAvailableScreenModeRotations0
(JNIEnv *env, jclass clazz, jlong display, jint scrn_idx)
{
Display *dpy = (Display *) (intptr_t) display;
@@ -65,11 +106,6 @@ JNIEXPORT jintArray JNICALL Java_jogamp_newt_driver_x11_ScreenDriver_getAvailabl
int rotations[4];
int major, minor;
- if(False == NewtScreen_getRANDRVersion(dpy, &major, &minor)) {
- fprintf(stderr, "RANDR not available\n");
- return (*env)->NewIntArray(env, 0);
- }
-
rotations_supported = XRRRotations (dpy, (int)scrn_idx, &cur_rotation);
if(0 != (rotations_supported & RR_Rotate_0)) {
@@ -100,7 +136,7 @@ JNIEXPORT jintArray JNICALL Java_jogamp_newt_driver_x11_ScreenDriver_getAvailabl
return properties;
}
-JNIEXPORT jint JNICALL Java_jogamp_newt_driver_x11_ScreenDriver_getNumScreenModeResolutions0_RandR13
+JNIEXPORT jint JNICALL Java_jogamp_newt_driver_x11_RandR13_getNumScreenModeResolutions0
(JNIEnv *env, jclass clazz, jlong display, jint scrn_idx)
{
Display *dpy = (Display *) (intptr_t) display;
@@ -131,11 +167,11 @@ JNIEXPORT jint JNICALL Java_jogamp_newt_driver_x11_ScreenDriver_getNumScreenMode
}
/*
- * Class: jogamp_newt_driver_x11_ScreenDriver
- * Method: getScreenModeResolutions0_RandR13
+ * Class: jogamp_newt_driver_x11_RandR13
+ * Method: getScreenModeResolutions0
* Signature: (JII)[I
*/
-JNIEXPORT jintArray JNICALL Java_jogamp_newt_driver_x11_ScreenDriver_getScreenModeResolution0_RandR13
+JNIEXPORT jintArray JNICALL Java_jogamp_newt_driver_x11_RandR13_getScreenModeResolution0
(JNIEnv *env, jclass clazz, jlong display, jint scrn_idx, jint resMode_idx)
{
Display *dpy = (Display *) (intptr_t) display;
@@ -168,11 +204,11 @@ JNIEXPORT jintArray JNICALL Java_jogamp_newt_driver_x11_ScreenDriver_getScreenMo
}
/*
- * Class: jogamp_newt_driver_x11_ScreenDriver
- * Method: getScreenModeRates0_RandR13
+ * Class: jogamp_newt_driver_x11_RandR13
+ * Method: getScreenModeRates0
* Signature: (JII)[I
*/
-JNIEXPORT jintArray JNICALL Java_jogamp_newt_driver_x11_ScreenDriver_getScreenModeRates0_RandR13
+JNIEXPORT jintArray JNICALL Java_jogamp_newt_driver_x11_RandR13_getScreenModeRates0
(JNIEnv *env, jclass clazz, jlong display, jint scrn_idx, jint resMode_idx)
{
Display *dpy = (Display *) (intptr_t) display;
@@ -206,11 +242,11 @@ JNIEXPORT jintArray JNICALL Java_jogamp_newt_driver_x11_ScreenDriver_getScreenMo
}
/*
- * Class: jogamp_newt_driver_x11_ScreenDriver
- * Method: getCurrentScreenRate0_RandR13
+ * Class: jogamp_newt_driver_x11_RandR13
+ * Method: getCurrentScreenRate0
* Signature: (JI)I
*/
-JNIEXPORT jint JNICALL Java_jogamp_newt_driver_x11_ScreenDriver_getCurrentScreenRate0_RandR13
+JNIEXPORT jint JNICALL Java_jogamp_newt_driver_x11_RandR13_getCurrentScreenRate0
(JNIEnv *env, jclass clazz, jlong display, jint scrn_idx)
{
Display *dpy = (Display *) (intptr_t) display;
@@ -229,11 +265,11 @@ JNIEXPORT jint JNICALL Java_jogamp_newt_driver_x11_ScreenDriver_getCurrentScreen
}
/*
- * Class: jogamp_newt_driver_x11_ScreenDriver
- * Method: getCurrentScreenRotation0_RandR13
+ * Class: jogamp_newt_driver_x11_RandR13
+ * Method: getCurrentScreenRotation0
* Signature: (JI)I
*/
-JNIEXPORT jint JNICALL Java_jogamp_newt_driver_x11_ScreenDriver_getCurrentScreenRotation0_RandR13
+JNIEXPORT jint JNICALL Java_jogamp_newt_driver_x11_RandR13_getCurrentScreenRotation0
(JNIEnv *env, jclass clazz, jlong display, jint scrn_idx)
{
Display *dpy = (Display *) (intptr_t) display;
@@ -253,11 +289,11 @@ JNIEXPORT jint JNICALL Java_jogamp_newt_driver_x11_ScreenDriver_getCurrentScreen
/*
- * Class: jogamp_newt_driver_x11_ScreenDriver
- * Method: getCurrentScreenResolutionIndex0_RandR13
+ * Class: jogamp_newt_driver_x11_RandR13
+ * Method: getCurrentScreenResolutionIndex0
* Signature: (JI)I
*/
-JNIEXPORT jint JNICALL Java_jogamp_newt_driver_x11_ScreenDriver_getCurrentScreenResolutionIndex0_RandR13
+JNIEXPORT jint JNICALL Java_jogamp_newt_driver_x11_RandR13_getCurrentScreenResolutionIndex0
(JNIEnv *env, jclass clazz, jlong display, jint scrn_idx)
{
Display *dpy = (Display *) (intptr_t) display;
@@ -278,11 +314,11 @@ JNIEXPORT jint JNICALL Java_jogamp_newt_driver_x11_ScreenDriver_getCurrentScreen
}
/*
- * Class: jogamp_newt_driver_x11_ScreenDriver
- * Method: setCurrentScreenModeStart0_RandR13
+ * Class: jogamp_newt_driver_x11_RandR13
+ * Method: setCurrentScreenModeStart0
* Signature: (JIIII)Z
*/
-JNIEXPORT jboolean JNICALL Java_jogamp_newt_driver_x11_ScreenDriver_setCurrentScreenModeStart0_RandR13
+JNIEXPORT jboolean JNICALL Java_jogamp_newt_driver_x11_RandR13_setCurrentScreenModeStart0
(JNIEnv *env, jclass clazz, jlong display, jint screen_idx, jint resMode_idx, jint freq, jint rotation)
{
Display *dpy = (Display *) (intptr_t) display;
@@ -318,11 +354,11 @@ JNIEXPORT jboolean JNICALL Java_jogamp_newt_driver_x11_ScreenDriver_setCurrentSc
}
/*
- * Class: jogamp_newt_driver_x11_ScreenDriver
- * Method: setCurrentScreenModePollEnd0_RandR13
+ * Class: jogamp_newt_driver_x11_RandR13
+ * Method: setCurrentScreenModePollEnd0
* Signature: (J)Z
*/
-JNIEXPORT jboolean JNICALL Java_jogamp_newt_driver_x11_ScreenDriver_setCurrentScreenModePollEnd0_RandR13
+JNIEXPORT jboolean JNICALL Java_jogamp_newt_driver_x11_RandR13_setCurrentScreenModePollEnd0
(JNIEnv *env, jclass clazz, jlong display, jint screen_idx, jint resMode_idx, jint freq, jint rotation)
{
Display *dpy = (Display *) (intptr_t) display;
diff --git a/src/newt/native/X11Screen.c b/src/newt/native/X11Screen.c
index 69a06aad0..3d4b2a26c 100644
--- a/src/newt/native/X11Screen.c
+++ b/src/newt/native/X11Screen.c
@@ -74,24 +74,6 @@ JNIEXPORT jint JNICALL Java_jogamp_newt_driver_x11_ScreenDriver_getHeight0
return (jint) DisplayHeight( dpy, scrn_idx);
}
-static int showedRandRVersion = 0;
-
-Bool NewtScreen_getRANDRVersion(Display *dpy, int *major, int *minor) {
- if( 0 == XRRQueryVersion(dpy, major, minor) ) {
- return False;
- }
- if(0 == showedRandRVersion) {
- DBG_PRINT("X11 RandR Version %d.%d\n", *major, *minor);
- showedRandRVersion = 1;
- }
- return True;
-}
-
-Bool NewtScreen_hasRANDR(Display *dpy) {
- int major, minor;
- return NewtScreen_getRANDRVersion(dpy, &major, &minor);
-}
-
int NewtScreen_XRotation2Degree(JNIEnv *env, int xrotation) {
int rot;
if(xrotation == RR_Rotate_0) {
@@ -121,8 +103,7 @@ JNIEXPORT jintArray JNICALL Java_jogamp_newt_driver_x11_ScreenDriver_getRandRVer
{
Display * dpy = (Display *)(intptr_t)display;
jint version[2];
- Bool res = NewtScreen_getRANDRVersion(dpy, &version[0], &version[1]);
- if( False == res ) {
+ if( 0 == XRRQueryVersion(dpy, &version[0], &version[1] ) ) {
version[0] = 0;
version[1] = 0;
}
diff --git a/src/newt/native/X11Screen.h b/src/newt/native/X11Screen.h
index a5b8e3e70..1a1440054 100644
--- a/src/newt/native/X11Screen.h
+++ b/src/newt/native/X11Screen.h
@@ -32,8 +32,6 @@
#include "X11Common.h"
-Bool NewtScreen_getRANDRVersion(Display *dpy, int *major, int *minor);
-Bool NewtScreen_hasRANDR(Display *dpy);
int NewtScreen_XRotation2Degree(JNIEnv *env, int xrotation);
#endif /* _X11SCREEN_H */