diff options
Diffstat (limited to 'src/newt/native')
-rw-r--r-- | src/newt/native/WindowsWindow.c | 44 | ||||
-rw-r--r-- | src/newt/native/X11Window.c | 58 |
2 files changed, 0 insertions, 102 deletions
diff --git a/src/newt/native/WindowsWindow.c b/src/newt/native/WindowsWindow.c index 46d710eda..b282ec9b2 100644 --- a/src/newt/native/WindowsWindow.c +++ b/src/newt/native/WindowsWindow.c @@ -118,13 +118,6 @@ #define STD_PRINT(...) fprintf(stderr, __VA_ARGS__); fflush(stderr) -static const char * const ClazzNamePoint = "javax/media/nativewindow/util/Point"; -static const char * const ClazzAnyCstrName = "<init>"; -static const char * const ClazzNamePointCstrSignature = "(II)V"; - -static jclass pointClz = NULL; -static jmethodID pointCstr = NULL; - static jmethodID insetsChangedID = NULL; static jmethodID sizeChangedID = NULL; static jmethodID positionChangedID = NULL; @@ -1333,23 +1326,6 @@ JNIEXPORT jboolean JNICALL Java_com_jogamp_newt_impl_windows_WindowsWindow_initI { NewtCommon_init(env); - if(NULL==pointClz) { - jclass c = (*env)->FindClass(env, ClazzNamePoint); - if(NULL==c) { - NewtCommon_FatalError(env, "NEWT WindowsWindows: can't find %s", ClazzNamePoint); - } - pointClz = (jclass)(*env)->NewGlobalRef(env, c); - (*env)->DeleteLocalRef(env, c); - if(NULL==pointClz) { - NewtCommon_FatalError(env, "NEWT WindowsWindows: can't use %s", ClazzNamePoint); - } - pointCstr = (*env)->GetMethodID(env, pointClz, ClazzAnyCstrName, ClazzNamePointCstrSignature); - if(NULL==pointCstr) { - NewtCommon_FatalError(env, "NEWT WindowsWindows: can't fetch %s.%s %s", - ClazzNamePoint, ClazzAnyCstrName, ClazzNamePointCstrSignature); - } - } - insetsChangedID = (*env)->GetMethodID(env, clazz, "insetsChanged", "(IIII)V"); sizeChangedID = (*env)->GetMethodID(env, clazz, "sizeChanged", "(IIZ)V"); positionChangedID = (*env)->GetMethodID(env, clazz, "positionChanged", "(II)V"); @@ -1708,24 +1684,4 @@ JNIEXPORT void JNICALL Java_com_jogamp_newt_impl_windows_WindowsWindow_requestFo NewtWindows_requestFocus ( env, obj, (HWND) (intptr_t) window, force) ; } -/* - * Class: com_jogamp_newt_impl_windows_WindowsWindows - * Method: getRelativeLocation0 - * Signature: (JJII)Ljavax/media/nativewindow/util/Point; - */ -JNIEXPORT jobject JNICALL Java_com_jogamp_newt_impl_windows_WindowsWindow_getRelativeLocation0 - (JNIEnv *env, jobject obj, jlong jsrc_win, jlong jdest_win, jint src_x, jint src_y) -{ - HWND src_win = (HWND) (intptr_t) jsrc_win; - HWND dest_win = (HWND) (intptr_t) jdest_win; - POINT dest = { src_x, src_y } ; - int res; - - res = MapWindowPoints(src_win, dest_win, &dest, 1); - - DBG_PRINT("*** WindowsWindow: getRelativeLocation0: %p %d/%d -> %p %d/%d - ok: %d\n", - (void*)src_win, src_x, src_y, (void*)dest_win, (int)dest.x, (int)dest.y, res); - - return (*env)->NewObject(env, pointClz, pointCstr, (jint)dest.x, (jint)dest.y); -} diff --git a/src/newt/native/X11Window.c b/src/newt/native/X11Window.c index becfa7596..7a19cf202 100644 --- a/src/newt/native/X11Window.c +++ b/src/newt/native/X11Window.c @@ -140,15 +140,8 @@ static jint X11KeySym2NewtVKey(KeySym keySym) { static const char * const ClazzNameNewtWindow = "com/jogamp/newt/Window"; -static const char * const ClazzNamePoint = "javax/media/nativewindow/util/Point"; -static const char * const ClazzAnyCstrName = "<init>"; -static const char * const ClazzNamePointCstrSignature = "(II)V"; - static jclass newtWindowClz=NULL; -static jclass pointClz = NULL; -static jmethodID pointCstr = NULL; - static jmethodID sizeChangedID = NULL; static jmethodID positionChangedID = NULL; static jmethodID focusChangedID = NULL; @@ -233,22 +226,6 @@ JNIEXPORT jboolean JNICALL Java_com_jogamp_newt_impl_x11_X11Display_initIDs0 } } - if(NULL==pointClz) { - c = (*env)->FindClass(env, ClazzNamePoint); - if(NULL==c) { - NewtCommon_FatalError(env, "NEWT X11Windows: can't find %s", ClazzNamePoint); - } - pointClz = (jclass)(*env)->NewGlobalRef(env, c); - (*env)->DeleteLocalRef(env, c); - if(NULL==pointClz) { - NewtCommon_FatalError(env, "NEWT X11Windows: can't use %s", ClazzNamePoint); - } - pointCstr = (*env)->GetMethodID(env, pointClz, ClazzAnyCstrName, ClazzNamePointCstrSignature); - if(NULL==pointCstr) { - NewtCommon_FatalError(env, "NEWT X11Windows: can't fetch %s.%s %s", - ClazzNamePoint, ClazzAnyCstrName, ClazzNamePointCstrSignature); - } - } return JNI_TRUE; } @@ -1596,38 +1573,3 @@ JNIEXPORT void JNICALL Java_com_jogamp_newt_impl_x11_X11Window_setTitle0 #endif } - - -/* - * Class: com_jogamp_newt_impl_x11_X11Window - * Method: getRelativeLocation0 - * Signature: (JIJJII)Ljavax/media/nativewindow/util/Point; - */ -JNIEXPORT jobject JNICALL Java_com_jogamp_newt_impl_x11_X11Window_getRelativeLocation0 - (JNIEnv *env, jobject obj, jlong jdisplay, jint screen_index, jlong jsrc_win, jlong jdest_win, jint src_x, jint src_y) -{ - Display * dpy = (Display *) (intptr_t) jdisplay; - Screen * scrn = ScreenOfDisplay(dpy, (int)screen_index); - Window root = XRootWindowOfScreen(scrn); - Window src_win = (Window)jsrc_win; - Window dest_win = (Window)jdest_win; - int dest_x=-1; - int dest_y=-1; - Window child; - Bool res; - - if( 0 == jdest_win ) { dest_win = root; } - if( 0 == jsrc_win ) { src_win = root; } - - displayDispatchErrorHandlerEnable(1, env); - - res = XTranslateCoordinates(dpy, src_win, dest_win, src_x, src_y, &dest_x, &dest_y, &child); - - displayDispatchErrorHandlerEnable(0, env); - - DBG_PRINT( "X11: getRelativeLocation0: %p %d/%d -> %p %d/%d - ok: %d\n", - (void*)src_win, src_x, src_y, (void*)dest_win, dest_x, dest_y, (int)res); - - return (*env)->NewObject(env, pointClz, pointCstr, (jint)dest_x, (jint)dest_y); -} - |