1XAnyEvent(3X11) XLIB FUNCTIONS XAnyEvent(3X11)
2
3
4
6 XAnyEvent, XEvent - generic X event structures
7
9 All the event structures declared in <X11/Xlib.h> have the following
10 common members:
11 typedef struct {
12 int type;
13 unsigned long serial; /∗ # of last request processed by server */
14 Bool send_event; /∗ true if this came from a SendEvent request */
15 Display *display; /∗ Display the event was read from */
16 Window window;
17 } XAnyEvent;
18
19 The type member is set to the event type constant name that uniquely
20 identifies it. For example, when the X server reports a GraphicsExpose
21 event to a client application, it sends an XGraphicsExposeEvent struc‐
22 ture with the type member set to GraphicsExpose. The display member is
23 set to a pointer to the display the event was read on. The send_event
24 member is set to True if the event came from a SendEvent protocol
25 request. The serial member is set from the serial number reported in
26 the protocol but expanded from the 16-bit least-significant bits to a
27 full 32-bit value. The window member is set to the window that is most
28 useful to toolkit dispatchers.
29
30 The XEvent structure is a union of the individual structures declared
31 for each event type:
32 typedef union _XEvent {
33 int type; /∗ must not be changed */
34 XAnyEvent xany;
35 XKeyEvent xkey;
36 XButtonEvent xbutton;
37 XMotionEvent xmotion;
38 XCrossingEvent xcrossing;
39 XFocusChangeEvent xfocus;
40 XExposeEvent xexpose;
41 XGraphicsExposeEvent xgraphicsexpose;
42 XNoExposeEvent xnoexpose;
43 XVisibilityEvent xvisibility;
44 XCreateWindowEvent xcreatewindow;
45 XDestroyWindowEvent xdestroywindow;
46 XUnmapEvent xunmap;
47 XMapEvent xmap;
48 XMapRequestEvent xmaprequest;
49 XReparentEvent xreparent;
50 XConfigureEvent xconfigure;
51 XGravityEvent xgravity;
52 XResizeRequestEvent xresizerequest;
53 XConfigureRequestEvent xconfigurerequest;
54 XCirculateEvent xcirculate;
55 XCirculateRequestEvent xcirculaterequest;
56 XPropertyEvent xproperty;
57 XSelectionClearEvent xselectionclear;
58 XSelectionRequestEvent xselectionrequest;
59 XSelectionEvent xselection;
60 XColormapEvent xcolormap;
61 XClientMessageEvent xclient;
62 XMappingEvent xmapping;
63 XErrorEvent xerror;
64 XKeymapEvent xkeymap;
65 long pad[24];
66 } XEvent;
67
68 An XEvent structure's first entry always is the type member, which is
69 set to the event type. The second member always is the serial number
70 of the protocol request that generated the event. The third member
71 always is send_event, which is a Bool that indicates if the event was
72 sent by a different client. The fourth member always is a display,
73 which is the display that the event was read from. Except for keymap
74 events, the fifth member always is a window, which has been carefully
75 selected to be useful to toolkit dispatchers. To avoid breaking tool‐
76 kits, the order of these first five entries is not to change. Most
77 events also contain a time member, which is the time at which an event
78 occurred. In addition, a pointer to the generic event must be cast
79 before it is used to access any other information in the structure.
80
82 XButtonEvent(3X11), XCreateWindowEvent(3X11), XCirculateEvent(3X11),
83 XCirculateRequestEvent(3X11), XColormapEvent(3X11), XConfig‐
84 ureEvent(3X11), XConfigureRequestEvent(3X11), XCrossingEvent(3X11),
85 XDestroyWindowEvent(3X11), XErrorEvent(3X11), XExposeEvent(3X11), XFo‐
86 cusChangeEvent(3X11), XGraphicsExposeEvent(3X11), XGravityEvent(3X11),
87 XKeymapEvent(3X11), XMapEvent(3X11), XMapRequestEvent(3X11), XProper‐
88 tyEvent(3X11), XReparentEvent(3X11), XResizeRequestEvent(3X11), XSelec‐
89 tionClearEvent(3X11), XSelectionEvent(3X11), XSelectionRe‐
90 questEvent(3X11), XUnmapEvent(3X11), XVisibilityEvent(3X11)
91 Xlib - C Language X Interface
92
93
94
95X Version 11 libX11 1.0.3 XAnyEvent(3X11)