Better colors in Form Setup
[fvwm.git] / libs / FEvent.h
blob598d9d199df8105fada5c81e39dce81a5d12d2c8
1 /* -*-c-*- */
3 #ifndef FEVENT_H
4 #define FEVENT_H
6 /* ---------------------------- included header files ---------------------- */
8 /* ---------------------------- global definitions ------------------------- */
10 /* ---------------------------- global macros ------------------------------ */
12 /* ---------------------------- type definitions --------------------------- */
14 /* ---------------------------- forward declarations ----------------------- */
16 /* ---------------------------- exported variables (globals) --------------- */
18 /* ---------------------------- interface functions (privileged access) ----- */
20 #ifdef FEVENT_PRIVILEGED_ACCESS
21 void fev_copy_last_event(XEvent *dest);
22 XEvent *fev_get_last_event_address(void);
23 #endif
25 /* ---------------------------- interface functions (normal_access) -------- */
27 /* get the latest event time */
28 Time fev_get_evtime(void);
30 /* This function determines the location of the mouse pointer from the event
31 * if possible, if not it queries the X server. Returns False if it had to
32 * query the server and the call failed because the pointer was on a
33 * different screen. */
34 Bool fev_get_evpos_or_query(
35 Display *dpy, Window w, const XEvent *e, int *ret_x, int *ret_y);
37 /* Sets the x_root/y_root position in the given event if it's of the proper
38 * type. Returns True if the position was set. */
39 Bool fev_set_evpos(XEvent *e, int x, int y);
41 /* announce a faked event to the FEvent module */
42 void fev_fake_event(XEvent *ev);
44 /* temporarily store the cached event in allocated memory */
45 void *fev_save_event(void);
47 /* restore an event saved with fev_save_event and free the memory it uses */
48 void fev_restore_event(void *ev);
50 /* fill the event structure *ev with a dummy event of no particular type */
51 void fev_make_null_event(XEvent *ev, Display *dpy);
53 /* return a copy of the last XEVent in *ev */
54 void fev_get_last_event(XEvent *ev);
56 /* ---------------------------- X event replacements ----------------------- */
58 /* Replacements for X functions */
59 XTimeCoord *FGetMotionEvents(
60 Display *display, Window w, Time start, Time stop, int *nevents_return);
61 int FAllowEvents(
62 Display *display, int event_mode, Time time);
63 Bool FCheckIfEvent(
64 Display *display, XEvent *event_return,
65 Bool (*predicate) (Display *display, XEvent *event, XPointer arg),
66 XPointer arg);
67 Bool FCheckMaskEvent(
68 Display *display, long event_mask, XEvent *event_return);
69 Bool FCheckPeekIfEvent(
70 Display *display, XEvent *event_return,
71 Bool (*predicate) (Display *display, XEvent *event, XPointer arg),
72 XPointer arg);
73 Bool FCheckTypedEvent(
74 Display *display, int event_type, XEvent *event_return);
75 Bool FCheckTypedWindowEvent(
76 Display *display, Window w, int event_type, XEvent *event_return);
77 Bool FCheckWindowEvent(
78 Display *display, Window w, long event_mask, XEvent *event_return);
79 int FEventsQueued(
80 Display *display, int mode);
81 int FIfEvent(
82 Display *display, XEvent *event_return,
83 Bool (*predicate) (Display *display, XEvent *event, XPointer arg),
84 XPointer arg);
85 int FMaskEvent(
86 Display *display, long event_mask, XEvent *event_return);
87 int FNextEvent(
88 Display *display, XEvent *event_return);
89 int FPeekEvent(
90 Display *display, XEvent *event_return);
91 int FPeekIfEvent(
92 Display *display, XEvent *event_return,
93 Bool (*predicate) (Display *display, XEvent *event, XPointer arg),
94 XPointer arg);
95 int FPending(
96 Display *display);
97 int FPutBackEvent(
98 Display *display, XEvent *event);
99 int FQLength(
100 Display *display);
101 Bool FQueryPointer(
102 Display *display, Window w, Window *root_return, Window *child_return,
103 int *root_x_return, int *root_y_return, int *win_x_return,
104 int *win_y_return, unsigned int *mask_return);
105 int FSelectInput(
106 Display *display, Window w, long event_mask);
107 Status FSendEvent(
108 Display *display, Window w, Bool propagate, long event_mask,
109 XEvent *event_send);
110 int FWarpPointer(
111 Display *display, Window src_w, Window dest_w, int src_x, int src_y,
112 unsigned int src_width, unsigned int src_height, int dest_x,
113 int dest_y);
114 int FWarpPointerUpdateEvpos(
115 XEvent *ev, Display *display, Window src_w, Window dest_w, int src_x,
116 int src_y, unsigned int src_width, unsigned int src_height,
117 int dest_x, int dest_y);
118 int FWindowEvent(
119 Display *display, Window w, long event_mask, XEvent *event_return);
121 /* ---------------------------- disable X symbols -------------------------- */
123 /* FEVENT_C must only be defined in FEvent.c! */
124 #ifndef FEVENT_C
125 #define XGetMotionEvents(a, b, c, d, e) use_FGetMotionEvents
126 #define XCheckIfEvent(a, b, c, d) use_FCheckIfEvent
127 #define XCheckMaskEvent(a, b, c) use_FCheckMaskEvent
128 #define XCheckTypedEvent(a, b, c) use_FCheckTypedEvent
129 #define XCheckTypedWindowEvent(a, b, c, d) use_FCheckTypedWindowEvent
130 #define XCheckWindowEvent(a, b, c, d) use_FCheckWindowEvent
131 #define XEventsQueued(a, b) use_FEventsQueued
132 #define XIfEvent(a, b, c, d) use_FIfEvent
133 #define XMaskEvent(a, b, c) use_FMaskEvent
134 #define XNextEvent(a, b) use_FNextEvent
135 #define XPeekEvent(a, b) use_FPeekEvent
136 #define XPeekIfEvent(a, b, c, d) use_FPeekIfEvent
137 #define XPending(a) use_FPending
138 #define XPutBackEvent(a, b) use_FPutBackEvent
139 #define XQueryPointer(a, b, c, d, e, f, g, h, i) use_FQueryPointer
140 #define XQLength(a) use_FQLength
141 #define XSendEvent(a, b, c, d, e) use_FSendEvent
142 #define XWarpPointer(a, b, c, d, e, f, g, h, i) use_FWarpPointer
143 #define XWindowEvent(a, b, c, d) use_FWindowEvent
144 #endif
146 #endif /* FEVENT_H */