2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / libjava / gnu / gcj / xlib / XButtonEvent.java
blob032830b2c596987e2b83740586d40e35a050e9d1
1 /* Copyright (C) 2000 Free Software Foundation
3 This file is part of libgcj.
5 This software is copyrighted work licensed under the terms of the
6 Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
7 details. */
9 package gnu.gcj.xlib;
11 /**
12 * Interprets data from an Xlib XButtonEvent into members of java
13 * primitive types.
15 * @author Rolf W. Rasmussen <rolfwr@ii.uib.no>
17 public class XButtonEvent extends XEvent
20 // Must match the definition in X.h:
21 public static final int MASK_SHIFT = 1<<0,
22 MASK_LOCK = 1<<1,
23 MASK_CONTROL = 1<<2,
24 MASK_MOD1 = 1<<3,
25 MASK_MOD2 = 1<<4,
26 MASK_MOD3 = 1<<5,
27 MASK_MOD4 = 1<<6,
28 MASK_MOD5 = 1<<7;
30 public XButtonEvent(XAnyEvent event)
32 super(event);
34 // FIXME: Avoid double checking?
35 if ((event.getType() != XAnyEvent.TYPE_BUTTON_PRESS) &&
36 (event.getType() != XAnyEvent.TYPE_BUTTON_RELEASE))
38 throw new IllegalArgumentException("Wrong event type");
40 init();
43 native void init();
45 public long time;
46 public int x;
47 public int y;
48 public int state;
49 public int button;