libxdo_sys/
lib.rs

1#![allow(non_camel_case_types)]
2
3extern crate libc;
4extern crate x11;
5
6use x11::xlib::*;
7use libc::{wchar_t, useconds_t};
8
9pub const CURRENTWINDOW: XID = 0;
10
11/* automatically generated by rust-bindgen */
12
13#[repr(C)]
14#[derive(Copy)]
15pub struct Struct_charcodemap {
16    pub key: wchar_t,
17    pub code: KeyCode,
18    pub symbol: KeySym,
19    pub group: ::libc::c_int,
20    pub modmask: ::libc::c_int,
21    pub needs_binding: ::libc::c_int,
22}
23impl ::std::clone::Clone for Struct_charcodemap {
24    fn clone(&self) -> Self { *self }
25}
26impl ::std::default::Default for Struct_charcodemap {
27    fn default() -> Self { unsafe { ::std::mem::zeroed() } }
28}
29pub type charcodemap_t = Struct_charcodemap;
30pub type Enum_Unnamed1 = ::libc::c_uint;
31pub const XDO_FEATURE_XTEST: ::libc::c_uint = 0;
32pub type XDO_FEATURES = Enum_Unnamed1;
33#[repr(C)]
34#[derive(Copy)]
35pub struct Struct_xdo {
36    pub xdpy: *mut Display,
37    pub display_name: *mut ::libc::c_char,
38    pub charcodes: *mut charcodemap_t,
39    pub charcodes_len: ::libc::c_int,
40    pub keycode_high: ::libc::c_int,
41    pub keycode_low: ::libc::c_int,
42    pub keysyms_per_keycode: ::libc::c_int,
43    pub close_display_when_freed: ::libc::c_int,
44    pub quiet: ::libc::c_int,
45    pub debug: ::libc::c_int,
46    pub features_mask: ::libc::c_int,
47}
48impl ::std::clone::Clone for Struct_xdo {
49    fn clone(&self) -> Self { *self }
50}
51impl ::std::default::Default for Struct_xdo {
52    fn default() -> Self { unsafe { ::std::mem::zeroed() } }
53}
54pub type Enum_Unnamed2 = ::libc::c_uint;
55pub const SEARCH_ANY: libc::c_uint = 0;
56pub const SEARCH_ALL: libc::c_uint = 1;
57pub type xdo_t = Struct_xdo;
58#[repr(C)]
59#[derive(Copy)]
60pub struct Struct_xdo_search {
61    pub title: *const ::libc::c_char,
62    pub winclass: *const ::libc::c_char,
63    pub winclassname: *const ::libc::c_char,
64    pub winname: *const ::libc::c_char,
65    pub pid: ::libc::c_int,
66    pub max_depth: ::libc::c_long,
67    pub only_visible: ::libc::c_int,
68    pub screen: ::libc::c_int,
69    pub require: Enum_Unnamed2,
70    pub searchmask: ::libc::c_uint,
71    pub desktop: ::libc::c_long,
72    pub limit: ::libc::c_uint,
73}
74impl ::std::clone::Clone for Struct_xdo_search {
75    fn clone(&self) -> Self { *self }
76}
77impl ::std::default::Default for Struct_xdo_search {
78    fn default() -> Self { unsafe { ::std::mem::zeroed() } }
79}
80pub type xdo_search_t = Struct_xdo_search;
81extern "C" {
82    pub fn xdo_new(display: *const ::libc::c_char) -> *mut xdo_t;
83    pub fn xdo_new_with_opened_display(xdpy: *mut Display,
84                                       display: *const ::libc::c_char,
85                                       close_display_when_freed:
86                                           ::libc::c_int) -> *mut xdo_t;
87    pub fn xdo_version() -> *const ::libc::c_char;
88    pub fn xdo_free(xdo: *mut xdo_t) -> ();
89    pub fn xdo_move_mouse(xdo: *const xdo_t, x: ::libc::c_int,
90                          y: ::libc::c_int, screen: ::libc::c_int)
91     -> ::libc::c_int;
92    pub fn xdo_move_mouse_relative_to_window(xdo: *const xdo_t,
93                                             window: Window, x: ::libc::c_int,
94                                             y: ::libc::c_int)
95     -> ::libc::c_int;
96    pub fn xdo_move_mouse_relative(xdo: *const xdo_t, x: ::libc::c_int,
97                                   y: ::libc::c_int) -> ::libc::c_int;
98    pub fn xdo_mouse_down(xdo: *const xdo_t, window: Window,
99                          button: ::libc::c_int) -> ::libc::c_int;
100    pub fn xdo_mouse_up(xdo: *const xdo_t, window: Window,
101                        button: ::libc::c_int) -> ::libc::c_int;
102    pub fn xdo_get_mouse_location(xdo: *const xdo_t, x: *mut ::libc::c_int,
103                                  y: *mut ::libc::c_int,
104                                  screen_num: *mut ::libc::c_int)
105     -> ::libc::c_int;
106    pub fn xdo_get_window_at_mouse(xdo: *const xdo_t, window_ret: *mut Window)
107     -> ::libc::c_int;
108    pub fn xdo_get_mouse_location2(xdo: *const xdo_t,
109                                   x_ret: *mut ::libc::c_int,
110                                   y_ret: *mut ::libc::c_int,
111                                   screen_num_ret: *mut ::libc::c_int,
112                                   window_ret: *mut Window) -> ::libc::c_int;
113    pub fn xdo_wait_for_mouse_move_from(xdo: *const xdo_t,
114                                        origin_x: ::libc::c_int,
115                                        origin_y: ::libc::c_int)
116     -> ::libc::c_int;
117    pub fn xdo_wait_for_mouse_move_to(xdo: *const xdo_t,
118                                      dest_x: ::libc::c_int,
119                                      dest_y: ::libc::c_int) -> ::libc::c_int;
120    pub fn xdo_click_window(xdo: *const xdo_t, window: Window,
121                            button: ::libc::c_int) -> ::libc::c_int;
122    pub fn xdo_click_window_multiple(xdo: *const xdo_t, window: Window,
123                                     button: ::libc::c_int,
124                                     repeat: ::libc::c_int, delay: useconds_t)
125     -> ::libc::c_int;
126    pub fn xdo_enter_text_window(xdo: *const xdo_t, window: Window,
127                                 string: *const ::libc::c_char,
128                                 delay: useconds_t) -> ::libc::c_int;
129    pub fn xdo_send_keysequence_window(xdo: *const xdo_t, window: Window,
130                                       keysequence: *const ::libc::c_char,
131                                       delay: useconds_t) -> ::libc::c_int;
132    pub fn xdo_send_keysequence_window_up(xdo: *const xdo_t, window: Window,
133                                          keysequence: *const ::libc::c_char,
134                                          delay: useconds_t) -> ::libc::c_int;
135    pub fn xdo_send_keysequence_window_down(xdo: *const xdo_t, window: Window,
136                                            keysequence:
137                                                *const ::libc::c_char,
138                                            delay: useconds_t)
139     -> ::libc::c_int;
140    pub fn xdo_send_keysequence_window_list_do(xdo: *const xdo_t,
141                                               window: Window,
142                                               keys: *mut charcodemap_t,
143                                               nkeys: ::libc::c_int,
144                                               pressed: ::libc::c_int,
145                                               modifier: *mut ::libc::c_int,
146                                               delay: useconds_t)
147     -> ::libc::c_int;
148    pub fn xdo_get_active_keys_to_keycode_list(xdo: *const xdo_t,
149                                               keys: *mut *mut charcodemap_t,
150                                               nkeys: *mut ::libc::c_int)
151     -> ::libc::c_int;
152    pub fn xdo_wait_for_window_map_state(xdo: *const xdo_t, wid: Window,
153                                         map_state: ::libc::c_int)
154     -> ::libc::c_int;
155    pub fn xdo_wait_for_window_size(xdo: *const xdo_t, window: Window,
156                                    width: ::libc::c_uint,
157                                    height: ::libc::c_uint,
158                                    flags: ::libc::c_int,
159                                    to_or_from: ::libc::c_int)
160     -> ::libc::c_int;
161    pub fn xdo_move_window(xdo: *const xdo_t, wid: Window, x: ::libc::c_int,
162                           y: ::libc::c_int) -> ::libc::c_int;
163    pub fn xdo_translate_window_with_sizehint(xdo: *const xdo_t,
164                                              window: Window,
165                                              width: ::libc::c_uint,
166                                              height: ::libc::c_uint,
167                                              width_ret: *mut ::libc::c_uint,
168                                              height_ret: *mut ::libc::c_uint)
169     -> ::libc::c_int;
170    pub fn xdo_set_window_size(xdo: *const xdo_t, wid: Window,
171                               w: ::libc::c_int, h: ::libc::c_int,
172                               flags: ::libc::c_int) -> ::libc::c_int;
173    pub fn xdo_set_window_property(xdo: *const xdo_t, wid: Window,
174                                   property: *const ::libc::c_char,
175                                   value: *const ::libc::c_char)
176     -> ::libc::c_int;
177    pub fn xdo_set_window_class(xdo: *const xdo_t, wid: Window,
178                                name: *const ::libc::c_char,
179                                _class: *const ::libc::c_char)
180     -> ::libc::c_int;
181    pub fn xdo_set_window_urgency(xdo: *const xdo_t, wid: Window,
182                                  urgency: ::libc::c_int) -> ::libc::c_int;
183    pub fn xdo_set_window_override_redirect(xdo: *const xdo_t, wid: Window,
184                                            override_redirect: ::libc::c_int)
185     -> ::libc::c_int;
186    pub fn xdo_focus_window(xdo: *const xdo_t, wid: Window) -> ::libc::c_int;
187    pub fn xdo_raise_window(xdo: *const xdo_t, wid: Window) -> ::libc::c_int;
188    pub fn xdo_get_focused_window(xdo: *const xdo_t, window_ret: *mut Window)
189     -> ::libc::c_int;
190    pub fn xdo_wait_for_window_focus(xdo: *const xdo_t, window: Window,
191                                     want_focus: ::libc::c_int)
192     -> ::libc::c_int;
193    pub fn xdo_get_pid_window(xdo: *const xdo_t, window: Window)
194     -> ::libc::c_int;
195    pub fn xdo_get_focused_window_sane(xdo: *const xdo_t,
196                                       window_ret: *mut Window)
197     -> ::libc::c_int;
198    pub fn xdo_activate_window(xdo: *const xdo_t, wid: Window)
199     -> ::libc::c_int;
200    pub fn xdo_wait_for_window_active(xdo: *const xdo_t, window: Window,
201                                      active: ::libc::c_int) -> ::libc::c_int;
202    pub fn xdo_map_window(xdo: *const xdo_t, wid: Window) -> ::libc::c_int;
203    pub fn xdo_unmap_window(xdo: *const xdo_t, wid: Window) -> ::libc::c_int;
204    pub fn xdo_minimize_window(xdo: *const xdo_t, wid: Window)
205     -> ::libc::c_int;
206    pub fn xdo_reparent_window(xdo: *const xdo_t, wid_source: Window,
207                               wid_target: Window) -> ::libc::c_int;
208    pub fn xdo_get_window_location(xdo: *const xdo_t, wid: Window,
209                                   x_ret: *mut ::libc::c_int,
210                                   y_ret: *mut ::libc::c_int,
211                                   screen_ret: *mut *mut Screen)
212     -> ::libc::c_int;
213    pub fn xdo_get_window_size(xdo: *const xdo_t, wid: Window,
214                               width_ret: *mut ::libc::c_uint,
215                               height_ret: *mut ::libc::c_uint)
216     -> ::libc::c_int;
217    pub fn xdo_get_active_window(xdo: *const xdo_t, window_ret: *mut Window)
218     -> ::libc::c_int;
219    pub fn xdo_select_window_with_click(xdo: *const xdo_t,
220                                        window_ret: *mut Window)
221     -> ::libc::c_int;
222    pub fn xdo_set_number_of_desktops(xdo: *const xdo_t,
223                                      ndesktops: ::libc::c_long)
224     -> ::libc::c_int;
225    pub fn xdo_get_number_of_desktops(xdo: *const xdo_t,
226                                      ndesktops: *mut ::libc::c_long)
227     -> ::libc::c_int;
228    pub fn xdo_set_current_desktop(xdo: *const xdo_t, desktop: ::libc::c_long)
229     -> ::libc::c_int;
230    pub fn xdo_get_current_desktop(xdo: *const xdo_t,
231                                   desktop: *mut ::libc::c_long)
232     -> ::libc::c_int;
233    pub fn xdo_set_desktop_for_window(xdo: *const xdo_t, wid: Window,
234                                      desktop: ::libc::c_long)
235     -> ::libc::c_int;
236    pub fn xdo_get_desktop_for_window(xdo: *const xdo_t, wid: Window,
237                                      desktop: *mut ::libc::c_long)
238     -> ::libc::c_int;
239    pub fn xdo_search_windows(xdo: *const xdo_t, search: *const xdo_search_t,
240                              windowlist_ret: *mut *mut Window,
241                              nwindows_ret: *mut ::libc::c_uint)
242     -> ::libc::c_int;
243    pub fn xdo_get_window_property_by_atom(xdo: *const xdo_t, window: Window,
244                                           atom: Atom,
245                                           nitems: *mut ::libc::c_long,
246                                           _type: *mut Atom,
247                                           size: *mut ::libc::c_int)
248     -> *mut ::libc::c_uchar;
249    pub fn xdo_get_window_property(xdo: *const xdo_t, window: Window,
250                                   property: *const ::libc::c_char,
251                                   value: *mut *mut ::libc::c_uchar,
252                                   nitems: *mut ::libc::c_long,
253                                   _type: *mut Atom, size: *mut ::libc::c_int)
254     -> ::libc::c_int;
255    pub fn xdo_get_input_state(xdo: *const xdo_t) -> ::libc::c_uint;
256    pub fn xdo_get_symbol_map() -> *mut *const ::libc::c_char;
257    pub fn xdo_get_active_modifiers(xdo: *const xdo_t,
258                                    keys: *mut *mut charcodemap_t,
259                                    nkeys: *mut ::libc::c_int)
260     -> ::libc::c_int;
261    pub fn xdo_clear_active_modifiers(xdo: *const xdo_t, window: Window,
262                                      active_mods: *mut charcodemap_t,
263                                      active_mods_n: ::libc::c_int)
264     -> ::libc::c_int;
265    pub fn xdo_set_active_modifiers(xdo: *const xdo_t, window: Window,
266                                    active_mods: *mut charcodemap_t,
267                                    active_mods_n: ::libc::c_int)
268     -> ::libc::c_int;
269    pub fn xdo_get_desktop_viewport(xdo: *const xdo_t,
270                                    x_ret: *mut ::libc::c_int,
271                                    y_ret: *mut ::libc::c_int)
272     -> ::libc::c_int;
273    pub fn xdo_set_desktop_viewport(xdo: *const xdo_t, x: ::libc::c_int,
274                                    y: ::libc::c_int) -> ::libc::c_int;
275    pub fn xdo_kill_window(xdo: *const xdo_t, window: Window)
276     -> ::libc::c_int;
277    pub fn xdo_find_window_client(xdo: *const xdo_t, window: Window,
278                                  window_ret: *mut Window,
279                                  direction: ::libc::c_int) -> ::libc::c_int;
280    pub fn xdo_get_window_name(xdo: *const xdo_t, window: Window,
281                               name_ret: *mut *mut ::libc::c_uchar,
282                               name_len_ret: *mut ::libc::c_int,
283                               name_type: *mut ::libc::c_int)
284     -> ::libc::c_int;
285    pub fn xdo_disable_feature(xdo: *mut xdo_t, feature: ::libc::c_int) -> ();
286    pub fn xdo_enable_feature(xdo: *mut xdo_t, feature: ::libc::c_int) -> ();
287    pub fn xdo_has_feature(xdo: *mut xdo_t, feature: ::libc::c_int)
288     -> ::libc::c_int;
289    pub fn xdo_get_viewport_dimensions(xdo: *mut xdo_t,
290                                       width: *mut ::libc::c_uint,
291                                       height: *mut ::libc::c_uint,
292                                       screen: ::libc::c_int)
293     -> ::libc::c_int;
294}