* FvwmTheme/FvwmTheme.1: Language check, general edits,
[fvwm.git] / libs / FEvent.h
blobd9ed583915cf5244ce8ab8091e9068f688b5f741
1 /* -*-c-*- */
2 /* This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation; either version 2 of the License, or
5 * (at your option) any later version.
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 #ifndef FEVENT_H
18 #define FEVENT_H
20 /* ---------------------------- included header files ----------------------- */
22 /* ---------------------------- global definitions -------------------------- */
24 /* ---------------------------- global macros ------------------------------- */
26 /* ---------------------------- type definitions ---------------------------- */
28 /* ---------------------------- forward declarations ------------------------ */
30 /* ---------------------------- exported variables (globals) ---------------- */
32 /* ---------------------------- interface functions (privileged access) ----- */
34 #ifdef FEVENT_PRIVILEGED_ACCESS
35 void fev_copy_last_event(XEvent *dest);
36 XEvent *fev_get_last_event_address(void);
37 #endif
39 /* ---------------------------- interface functions (normal_access) --------- */
41 /* get the latest event time */
42 Time fev_get_evtime(void);
45 * This function determines the location of the mouse pointer from the event
46 * if possible, if not it queries the X server. Returns False if it had to
47 * query the server and the call failed because the pointer was on a
48 * different screen. */
49 Bool fev_get_evpos_or_query(
50 Display *dpy, Window w, const XEvent *e, int *ret_x, int *ret_y);
52 /* Sets the x_root/y_root position in the given event if it's of the proper
53 * type. Returns True if the position was set. */
54 Bool fev_set_evpos(XEvent *e, int x, int y);
56 /* announce a faked event to the FEvent module */
57 void fev_fake_event(XEvent *ev);
59 /* temporarily store the cached event in allocated memory */
60 void *fev_save_event(void);
62 /* restore an event saved with fev_save_event and free the memory it uses */
63 void fev_restore_event(void *ev);
65 /* fill the event structure *ev with a dummy event of no particular type */
66 void fev_make_null_event(XEvent *ev, Display *dpy);
68 /* ---------------------------- X event replacements ------------------------ */
70 /* Replacements for X functions */
71 XTimeCoord *FGetMotionEvents(
72 Display *display, Window w, Time start, Time stop, int *nevents_return);
73 int FAllowEvents(
74 Display *display, int event_mode, Time time);
75 Bool FCheckIfEvent(
76 Display *display, XEvent *event_return,
77 Bool (*predicate) (Display *display, XEvent *event, XPointer arg),
78 XPointer arg);
79 Bool FCheckMaskEvent(
80 Display *display, long event_mask, XEvent *event_return);
81 Bool FCheckTypedEvent(
82 Display *display, int event_type, XEvent *event_return);
83 Bool FCheckTypedWindowEvent(
84 Display *display, Window w, int event_type, XEvent *event_return);
85 Bool FCheckWindowEvent(
86 Display *display, Window w, long event_mask, XEvent *event_return);
87 int FEventsQueued(
88 Display *display, int mode);
89 int FIfEvent(
90 Display *display, XEvent *event_return,
91 Bool (*predicate) (Display *display, XEvent *event, XPointer arg),
92 XPointer arg);
93 int FMaskEvent(
94 Display *display, long event_mask, XEvent *event_return);
95 int FNextEvent(
96 Display *display, XEvent *event_return);
97 int FPeekEvent(
98 Display *display, XEvent *event_return);
99 int FPeekIfEvent(
100 Display *display, XEvent *event_return,
101 Bool (*predicate) (Display *display, XEvent *event, XPointer arg),
102 XPointer arg);
103 int FPending(
104 Display *display);
105 int FPutBackEvent(
106 Display *display, XEvent *event);
107 int FQLength(
108 Display *display);
109 Bool FQueryPointer(
110 Display *display, Window w, Window *root_return, Window *child_return,
111 int *root_x_return, int *root_y_return, int *win_x_return,
112 int *win_y_return, unsigned int *mask_return);
113 int FSelectInput(
114 Display *display, Window w, long event_mask);
115 Status FSendEvent(
116 Display *display, Window w, Bool propagate, long event_mask,
117 XEvent *event_send);
118 int FWarpPointer(
119 Display *display, Window src_w, Window dest_w, int src_x, int src_y,
120 unsigned int src_width, unsigned int src_height, int dest_x,
121 int dest_y);
122 int FWindowEvent(
123 Display *display, Window w, long event_mask, XEvent *event_return);
125 /* ---------------------------- disable X symbols --------------------------- */
127 /* FEVENT_C must only be defined in FEvent.c! */
128 #ifndef FEVENT_C
129 #define XGetMotionEvents(a, b, c, d, e) use_FGetMotionEvents
130 #define XCheckIfEvent(a, b, c, d) use_FCheckIfEvent
131 #define XCheckMaskEvent(a, b, c) use_FCheckMaskEvent
132 #define XCheckTypedEvent(a, b, c) use_FCheckTypedEvent
133 #define XCheckTypedWindowEvent(a, b, c, d) use_FCheckTypedWindowEvent
134 #define XCheckWindowEvent(a, b, c, d) use_FCheckWindowEvent
135 #define XEventsQueued(a, b) use_FEventsQueued
136 #define XIfEvent(a, b, c, d) use_FIfEvent
137 #define XMaskEvent(a, b, c) use_FMaskEvent
138 #define XNextEvent(a, b) use_FNextEvent
139 #define XPeekEvent(a, b) use_FPeekEvent
140 #define XPeekIfEvent(a, b, c, d) use_FPeekIfEvent
141 #define XPending(a) use_FPending
142 #define XPutBackEvent(a, b) use_FPutBackEvent
143 #define XQueryPointer(a, b, c, d, e, f, g, h, i) use_FQueryPointer
144 #define XQLength(a) use_FQLength
145 #define XSendEvent(a, b, c, d, e) use_FSendEvent
146 #define XWarpPointer(a, b, c, d, e, f, g, h, i) use_FWarpPointer
147 #define XWindowEvent(a, b, c, d) use_FWindowEvent
148 #endif
150 #endif /* FEVENT_H */