root/trunk/xdotool/xdo.h

Revision 1105, 2.6 kB (checked in by dkg, 6 months ago)

moving to 20080716-1

Line 
1/*
2 * xdo library header
3 * - include this if you have code that uses xdo
4 *
5 * $Id: xdo.h 1947 2008-06-16 03:41:25Z 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_activate(xdo_t *xdo, Window wid);
67
68int xdo_window_map(xdo_t *xdo, Window wid);
69int xdo_window_unmap(xdo_t *xdo, Window wid);
70
71/* pager-like behaviors */
72int xdo_window_get_active(xdo_t *xdo, Window *window_ret);
73int xdo_set_number_of_desktops(xdo_t *xdo, long ndesktops);
74int xdo_get_number_of_desktops(xdo_t *xdo, long *ndesktops);
75int xdo_set_current_desktop(xdo_t *xdo, long desktop);
76int xdo_get_current_desktop(xdo_t *xdo, long *desktop);
77int xdo_set_desktop_for_window(xdo_t *xdo, Window wid, long desktop);
78int xdo_get_desktop_for_window(xdo_t *xdo, Window wid, long *desktop);
79
80/* Returns: windowlist and nwindows */
81int xdo_window_list_by_regex(xdo_t *xdo, char *regex, int flags,
82                             Window **windowlist, int *nwindows);
Note: See TracBrowser for help on using the browser.