aboutsummaryrefslogtreecommitdiff
path: root/libjava/gnu/awt/xlib/XEventLoop.java
diff options
context:
space:
mode:
authorScott Gilbertson <scottg@mantatest.com>2003-08-25 19:02:29 +0000
committerScott Gilbertson <sgilbertson@gcc.gnu.org>2003-08-25 19:02:29 +0000
commit81f7282f978588f883d8363e8cd5e69d090bc331 (patch)
treecf8eb4ec21e611ee7dbea198fd5f8dce39ee903d /libjava/gnu/awt/xlib/XEventLoop.java
parent1281fe11033eebaaa8a4fbc70770eca204c9c504 (diff)
downloadgcc-81f7282f978588f883d8363e8cd5e69d090bc331.zip
gcc-81f7282f978588f883d8363e8cd5e69d090bc331.tar.gz
gcc-81f7282f978588f883d8363e8cd5e69d090bc331.tar.bz2
Makefile.am: added gnu/awt/xlib/XOffScreenImage.java.
* Makefile.am: added gnu/awt/xlib/XOffScreenImage.java. * Makefile.in: re-generated. * gnu/awt/j2d/IntegerGraphicsState.java (ScreenCoupledImage): new interface. (drawImage): detect ScreenCoupledImage instances. * gnu/awt/xlib/XCanvasPeer.java (createImage) implemented. * gnu/awt/xlib/XEventLoop.java (createEvent): re-formatted, and rearranged to avoid null pointer. * gnu/awt/xlib/XGraphics.java (drawImage): added XOffScreenImage handling. * gnu/awt/xlib/XOffScreenImage.java: new file. * gnu/gcj/xlib/Drawable.java (getDepth): new native method. * gnu/gcj/xlib/GC.java (copyArea): new native method. * gnu/gcj/xlib/XAnyEvent.java (TYPE_KEY_PRESS): new constant. (TYPE_KEY_RELEASE): new constant. (TYPE_MOTION_NOTIFY): new constant. (TYPE_ENTER_NOTIFY): new constant. (TYPE_LEAVE_NOTIFY): new constant. (TYPE_FOCUS_IN): new constant. (TYPE_FOCUS_OUT): new constant. (TYPE_KEYMAP_NOTIFY): new constant. (TYPE_GRAPHICS_EXPOSE): new constant. (TYPE_NO_EXPOSE): new constant. (TYPE_VISIBILITY_NOTIFY): new constant. (TYPE_CREATE_NOTIFY): new constant. (TYPE_DESTROY_NOTIFY): new constant. (TYPE_MAP_REQUEST): new constant. (TYPE_CONFIGURE_REQUEST): new constant. (TYPE_GRAVITY_NOTIFY): new constant. (TYPE_RESIZE_REQUEST): new constant. (TYPE_CIRCULATE_NOTIFY): new constant. (TYPE_CIRCULATE_REQUEST): new constant. (TYPE_PROPERTY_NOTIFY): new constant. (TYPE_SELECTION_CLEAR): new constant. (TYPE_SELECTION_REQUEST): new constant. (TYPE_SELECTION_NOTIFY): new constant. (TYPE_COLORMAP_NOTIFY): new constant. (TYPE_MAPPING_NOTIFY): new constant. * gnu/gcj/xlib/natDrawable.cc (getDepth): new method. * gnu/gcj/xlib/natGC.cc (copyArea): new method * java/awt/Component.java (createImage): changed to use peer method. From-SVN: r70776
Diffstat (limited to 'libjava/gnu/awt/xlib/XEventLoop.java')
-rw-r--r--libjava/gnu/awt/xlib/XEventLoop.java75
1 files changed, 42 insertions, 33 deletions
diff --git a/libjava/gnu/awt/xlib/XEventLoop.java b/libjava/gnu/awt/xlib/XEventLoop.java
index ad5e963..5f5026b 100644
--- a/libjava/gnu/awt/xlib/XEventLoop.java
+++ b/libjava/gnu/awt/xlib/XEventLoop.java
@@ -118,57 +118,66 @@ public class XEventLoop implements Runnable
* AWT event.
*/
- AWTEvent createEvent()
+ AWTEvent createEvent ()
{
+ int type = anyEvent.getType ();
+ // Ignore some events without further processing
+ switch (type)
+ {
+ // ignore "no expose" events, which are generated whenever a pixmap
+ // is copied to copied to a window which is entirely unobscured
+ case XAnyEvent.TYPE_NO_EXPOSE:
+ case XAnyEvent.TYPE_UNMAP_NOTIFY: // ignore for now
+ case XAnyEvent.TYPE_MAP_NOTIFY: // ignore for now
+ case XAnyEvent.TYPE_REPARENT_NOTIFY: // ignore for now
+ return null;
+ default:
+ break; // continue processing events not in ignore list
+ }
/* avoid attempting to get client data before client data has
been set. */
Object peer;
synchronized (this)
- {
- peer = anyEvent.getWindow().getClientData();
- }
-
+ {
+ peer = anyEvent.getWindow ().getClientData ();
+ }
+
Component source = null;
-
+
// Try to identify source component
-
+
if (peer instanceof XCanvasPeer)
- {
- source = ((XCanvasPeer) peer).getComponent();
- }
-
+ {
+ source = ((XCanvasPeer) peer).getComponent ();
+ }
+
if (source == null)
- {
- String msg = "unable to locate source for event (" +
- anyEvent + ")";
- throw new RuntimeException(msg);
- }
-
+ {
+ String msg = "unable to locate source for event (" +
+ anyEvent + "): peer=" + peer;
+ throw new RuntimeException (msg);
+ }
+
/* if a mapping from anyEvent to AWTEvent is possible, construct a
new AWTEvent and return it. */
-
- int type = anyEvent.getType();
+
switch (type)
- {
+ {
case XAnyEvent.TYPE_EXPOSE:
- return createPaintEvent(source);
+ return createPaintEvent (source);
case XAnyEvent.TYPE_BUTTON_PRESS:
case XAnyEvent.TYPE_BUTTON_RELEASE:
- return createMouseEvent(type, source);
- case XAnyEvent.TYPE_UNMAP_NOTIFY:
- case XAnyEvent.TYPE_MAP_NOTIFY:
- case XAnyEvent.TYPE_REPARENT_NOTIFY:
- return null; // ignore for now
+ return createMouseEvent (type, source);
case XAnyEvent.TYPE_CONFIGURE_NOTIFY:
- configureNotify(peer);
- return null;
-
+ configureNotify (peer);
+ return null;
+
default:
- String msg = "Do no know how to handle event (" + anyEvent + ")";
- throw new RuntimeException(msg);
- }
+ String msg = "Do no know how to handle event (" + anyEvent + ")";
+ throw new RuntimeException (msg);
+ }
}
-
+
AWTEvent createPaintEvent(Component src)
{
XExposeEvent expose = new XExposeEvent(anyEvent);