diff options
author | Sven Gothel <[email protected]> | 2010-11-17 10:38:19 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2010-11-17 10:38:19 +0100 |
commit | dd0038a68a9aa99646549644c3338266546b05f8 (patch) | |
tree | 4af6467b23aa30a5897a609f51c5e3cba0b5ece7 /src/newt | |
parent | db4d7d198cc826bba871fea39461c3c8a2a3b1c6 (diff) |
Move GDI GlueGen wrapping from JOGL -> NativeWindow (following X11). Moving NEWT WindowsWindow GetRelativeLocation() native implementation to GDI as well.
Diffstat (limited to 'src/newt')
-rw-r--r-- | src/newt/classes/com/jogamp/newt/impl/windows/WindowsWindow.java | 4 | ||||
-rw-r--r-- | src/newt/native/WindowsWindow.c | 44 |
2 files changed, 2 insertions, 46 deletions
diff --git a/src/newt/classes/com/jogamp/newt/impl/windows/WindowsWindow.java b/src/newt/classes/com/jogamp/newt/impl/windows/WindowsWindow.java index daa09b034..1691e4bf0 100644 --- a/src/newt/classes/com/jogamp/newt/impl/windows/WindowsWindow.java +++ b/src/newt/classes/com/jogamp/newt/impl/windows/WindowsWindow.java @@ -34,6 +34,7 @@ package com.jogamp.newt.impl.windows; +import com.jogamp.nativewindow.impl.windows.GDI; import javax.media.nativewindow.*; import com.jogamp.newt.impl.WindowImpl; import javax.media.nativewindow.util.Insets; @@ -168,7 +169,7 @@ public class WindowsWindow extends WindowImpl { } protected Point getLocationOnScreenImpl(int x, int y) { - return (Point) getRelativeLocation0( getWindowHandle(), 0 /*root win*/, x, y); + return (Point) GDI.GetRelativeLocation( getWindowHandle(), 0 /*root win*/, x, y); } //---------------------------------------------------------------------- @@ -190,7 +191,6 @@ public class WindowsWindow extends WindowImpl { boolean parentChange, int fullScreenChange, int decorationChange); private static native void setTitle0(long windowHandle, String title); private native void requestFocus0(long windowHandle, boolean force); - private native Object getRelativeLocation0(long src_win, long dest_win, int src_x, int src_y); private void insetsChanged(int left, int top, int right, int bottom) { if (left != -1 && top != -1 && right != -1 && bottom != -1) { 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); -} |