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
This commit is contained in:
Thomas Fitzsimmons 2007-12-05 18:04:44 +00:00 committed by Thomas Fitzsimmons
parent 0ec479dcfb
commit 3898fe8e7c
34 changed files with 196 additions and 19 deletions

View file

@ -155,6 +155,7 @@ public class GdkGraphicsEnvironment extends ClasspathGraphicsEnvironment
* Used by GtkMouseInfoPeer.
*/
native int[] getMouseCoordinates();
native boolean isWindowUnderMouse(GtkWindowPeer windowPeer);
public WritableRaster createRaster(ColorModel cm, SampleModel sm)
{

View file

@ -76,7 +76,6 @@ import java.awt.image.VolatileImage;
import java.awt.peer.ComponentPeer;
import java.awt.peer.ContainerPeer;
import java.awt.peer.LightweightPeer;
import java.awt.peer.WindowPeer;
import java.util.Timer;
import java.util.TimerTask;
@ -251,10 +250,7 @@ public class GtkComponentPeer extends GtkGenericPeer
public Point getLocationOnScreen ()
{
int point[] = new int[2];
if( this instanceof WindowPeer )
gtkWindowGetLocationOnScreen (point);
else
gtkWidgetGetLocationOnScreen (point);
gtkWidgetGetLocationOnScreen (point);
return new Point (point[0], point[1]);
}

View file

@ -60,17 +60,7 @@ public class GtkMouseInfoPeer implements MouseInfoPeer
public boolean isWindowUnderMouse(Window w)
{
int[] coords = gde.getMouseCoordinates();
GraphicsDevice[] gds = gde.getScreenDevices();
// Check if the screen of the Window and the cursor match
if( gds[ coords[0] ] != w.getGraphicsConfiguration().getDevice() )
return false;
// Return the bounds-check.
Point p = w.getLocationOnScreen();
return (coords[1] >= p.x && coords[1] < p.x + w.getWidth() &&
coords[2] >= p.y && coords[2] < p.y + w.getHeight() );
}
return gde.isWindowUnderMouse((GtkWindowPeer) w.getPeer());
}
}

View file

@ -45,6 +45,7 @@ import java.awt.Font;
import java.awt.Frame;
import java.awt.Graphics;
import java.awt.KeyboardFocusManager;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.Window;
import java.awt.event.ComponentEvent;
@ -392,6 +393,13 @@ public class GtkWindowPeer extends GtkContainerPeer
clickCount, popupTrigger);
}
public Point getLocationOnScreen()
{
int point[] = new int[2];
gtkWindowGetLocationOnScreen(point);
return new Point(point[0], point[1]);
}
// We override this to keep it in sync with our internal
// representation.
public Rectangle getBounds()