source: liacs/mms/project/xdo.h@ 353

Last change on this file since 353 was 17, checked in by Rick van der Zwet, 15 years ago

Bit hacky, but uinput did not do the trick. Using the X11Test does the trick

File size: 2.6 KB
Line 
1/*
2 * xdo library header
3 * - include this if you have code that uses xdo
4 *
5 * $Id: xdo.h 2158 2009-01-26 11:05:03Z jordansissel $
6 */
7
8#include <X11/Xlib.h>
9
10#define SEARCH_VISIBLEONLY (1L << 0)
11#define SEARCH_TITLE (1L << 1)
12#define SEARCH_CLASS (1L << 2)
13#define SEARCH_NAME (1L << 3)
14
15#define SEARCH_IGNORE_TRANSIENTS (1L << 4)
16#define SEARCH_IGNORE_WINDOW_INPUTONLY (1L << 5)
17
18#define SIZE_USEHINTS (1L << 0)
19
20/* Map keysym name to actual ascii */
21typedef struct keysymcharmap {
22 const char *keysym;
23 char key;
24} keysymcharmap_t;
25
26/* map character to keycode */
27typedef struct charcodemap {
28 char key;
29 int code;
30 int shift;
31} charcodemap_t;
32
33typedef struct xdo {
34 Display *xdpy;
35 char *display_name;
36 charcodemap_t *charcodes;
37 int keycode_high; /* highest and lowest keycodes */
38 int keycode_low; /* used by this X server */
39
40 int close_display_when_freed;
41} xdo_t;
42
43xdo_t* xdo_new(char *display);
44xdo_t* xdo_new_with_opened_display(Display *xdpy, const char *display,
45 int close_display_when_freed);
46void xdo_free(xdo_t *xdo);
47
48int xdo_mousemove(xdo_t *xdo, int x, int y);
49int xdo_mousemove_relative(xdo_t *xdo, int x, int y);
50int xdo_mousedown(xdo_t *xdo, int button);
51int xdo_mouseup(xdo_t *xdo, int button);
52int xdo_mouselocation(xdo_t *xdo, int *x, int *y, int *screen_num);
53
54int xdo_click(xdo_t *xdo, int button);
55
56int xdo_type(xdo_t *xdo, char *string);
57int xdo_keysequence(xdo_t *xdo, char *keysequence);
58int xdo_keysequence_up(xdo_t *xdo, char *keysequence);
59int xdo_keysequence_down(xdo_t *xdo, char *keysequence);
60
61int xdo_window_move(xdo_t *xdo, Window wid, int x, int y);
62int xdo_window_setsize(xdo_t *xdo, Window wid, int w, int h, int flags);
63int xdo_window_focus(xdo_t *xdo, Window wid);
64int xdo_window_raise(xdo_t *xdo, Window wid);
65int xdo_window_get_focus(xdo_t *xdo, Window *window_ret);
66int xdo_window_sane_get_focus(xdo_t *xdo, Window *window_ret);
67int xdo_window_activate(xdo_t *xdo, Window wid);
68
69int xdo_window_map(xdo_t *xdo, Window wid);
70int xdo_window_unmap(xdo_t *xdo, Window wid);
71
72/* pager-like behaviors */
73int xdo_window_get_active(xdo_t *xdo, Window *window_ret);
74int xdo_set_number_of_desktops(xdo_t *xdo, long ndesktops);
75int xdo_get_number_of_desktops(xdo_t *xdo, long *ndesktops);
76int xdo_set_current_desktop(xdo_t *xdo, long desktop);
77int xdo_get_current_desktop(xdo_t *xdo, long *desktop);
78int xdo_set_desktop_for_window(xdo_t *xdo, Window wid, long desktop);
79int xdo_get_desktop_for_window(xdo_t *xdo, Window wid, long *desktop);
80
81/* Returns: windowlist and nwindows */
82int xdo_window_list_by_regex(xdo_t *xdo, char *regex, int flags,
83 Window **windowlist, int *nwindows);
Note: See TracBrowser for help on using the repository browser.