diff options
author | Thomas Fitzsimmons <fitzsim@redhat.com> | 2007-12-05 18:04:44 +0000 |
---|---|---|
committer | Thomas Fitzsimmons <fitzsim@gcc.gnu.org> | 2007-12-05 18:04:44 +0000 |
commit | 3898fe8e7cdf79c37a476c2169b4386f33a9bee3 (patch) | |
tree | 18361aa2bba3ec82f967a259c1fd72c45c7abf3c /libjava/classpath/native | |
parent | 0ec479dcfbcfb765a367fb63d1bcb1be72b940b8 (diff) | |
download | gcc-3898fe8e7cdf79c37a476c2169b4386f33a9bee3.zip gcc-3898fe8e7cdf79c37a476c2169b4386f33a9bee3.tar.gz gcc-3898fe8e7cdf79c37a476c2169b4386f33a9bee3.tar.bz2 |
2007-12-05 Thomas Fitzsimmons <fitzsim@redhat.com>
* gnu/java/awt/peer/gtk/GdkGraphicsEnvironment.java,
native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphicsEnvironment.c
(isWindowUnderMouse): New method.
* include/gnu_java_awt_peer_gtk_GdkGraphicsEnvironment.h:
Regenerate.
* gnu/java/awt/peer/gtk/GtkComponentPeer.java
(getLocationOnScreen): Move WindowPeer section to...
* gnu/java/awt/peer/gtk/GtkWindowPeer.java (getLocationOnScreen):
New method.
* gnu/java/awt/peer/gtk/GtkMouseInfoPeer.java
(isWindowUnderMouse): Implement.
* java/awt/Component.java (getMousePosition): New method.
(getMousePositionHelper): Likewise.
(mouseOverComponent): Likewise.
* java/awt/Container.java (getMousePosition): New method.
(mouseOverComponent): Likewise.
* classpath/lib/java/awt/Component.class,
classpath/lib/java/awt/Component$BltBufferStrategy.class,
classpath/lib/java/awt/Container$GfxPaintAllVisitor.class,
classpath/lib/java/awt/Component$AccessibleAWTComponent
$AccessibleAWTFocusHandler.class,
classpath/lib/java/awt/Component$FlipBufferStrategy.class,
classpath/lib/java/awt/Container$GfxVisitor.class,
classpath/lib/java/awt/Component$AccessibleAWTComponent
$AccessibleAWTComponentHandler.class,
classpath/lib/java/awt/Container$AccessibleAWTContainer
$AccessibleContainerHandler.class,
classpath/lib/java/awt/Container.class,
classpath/lib/java/awt/Container$AccessibleAWTContainer.class,
classpath/lib/java/awt/Container$GfxPrintAllVisitor.class,
classpath/lib/java/awt/Component$AccessibleAWTComponent.class,
classpath/lib/java/awt/Container$GfxPaintVisitor.class,
classpath/lib/java/awt/Container$GfxPrintVisitor.class,
classpath/lib/java/awt/Component$HeavyweightInLightweightListener.class,
classpath/lib/gnu/java/awt/peer/gtk/GtkComponentPeer.class,
classpath/lib/gnu/java/awt/peer/gtk/GdkGraphicsEnvironment.class,
classpath/lib/gnu/java/awt/peer/gtk/GtkMouseInfoPeer.class,
classpath/lib/gnu/java/awt/peer/gtk/GtkWindowPeer.class,
classpath/lib/gnu/java/awt/peer/gtk/GtkComponentPeer
$RepaintTimerTask.class:
Regenerate.
2007-12-05 Thomas Fitzsimmons <fitzsim@redhat.com>
* gnu/java/awt/peer/gtk/GdkGraphicsEnvironment.h: Regenerate.
* gnu/java/awt/peer/gtk/GtkWindowPeer.h: Likewise.
* java/awt/Component.h: Likewise.
* java/awt/Container.h: Likewise.
From-SVN: r130627
Diffstat (limited to 'libjava/classpath/native')
-rw-r--r-- | libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphicsEnvironment.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphicsEnvironment.c b/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphicsEnvironment.c index 1c88d1b..6066a6b 100644 --- a/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphicsEnvironment.c +++ b/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphicsEnvironment.c @@ -263,3 +263,37 @@ Java_gnu_java_awt_peer_gtk_GdkGraphicsEnvironment_getMouseCoordinates return retArray; } + +JNIEXPORT jboolean JNICALL +Java_gnu_java_awt_peer_gtk_GdkGraphicsEnvironment_isWindowUnderMouse +(JNIEnv *env, jobject obj, jobject windowPeer) +{ + GdkDisplay *display = NULL; + gint x = 0; + gint y = 0; + GtkWidget *windowToTest = NULL; + GdkWindow *windowAtPointer = NULL; + jboolean retVal = JNI_FALSE; + + display = (GdkDisplay *) gtkpeer_get_display (env, obj); + g_assert (display != NULL); + + windowToTest = (GtkWidget *) gtkpeer_get_widget (env, windowPeer); + + gdk_threads_enter (); + + windowAtPointer = gdk_display_get_window_at_pointer (display, &x, &y); + + while (windowAtPointer + && windowAtPointer != windowToTest->window) + windowAtPointer = gdk_window_get_parent (windowAtPointer); + + gdk_threads_leave (); + + if (windowAtPointer) + retVal = JNI_TRUE; + else + retVal = JNI_FALSE; + + return retVal; +} |