2 * uterm - Linux User-Space Terminal VT API
4 * Copyright (c) 2011-2013 David Herrmann <dh.herrmann@googlemail.com>
6 * Permission is hereby granted, free of charge, to any person obtaining
7 * a copy of this software and associated documentation files
8 * (the "Software"), to deal in the Software without restriction, including
9 * without limitation the rights to use, copy, modify, merge, publish,
10 * distribute, sublicense, and/or sell copies of the Software, and to
11 * permit persons to whom the Software is furnished to do so, subject to
12 * the following conditions:
14 * The above copyright notice and this permission notice shall be included
15 * in all copies or substantial portions of the Software.
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
20 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
21 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
22 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
23 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28 * Virtual terminals allow controlling multiple virtual terminals on one real
29 * terminal. It is multi-seat capable and fully asynchronous.
32 #ifndef UTERM_UTERM_VT_H
33 #define UTERM_UTERM_VT_H
39 #include <uterm_input.h>
42 struct uterm_vt_master;
44 enum uterm_vt_action {
51 UTERM_VT_FORCE = 0x01,
54 struct uterm_vt_event {
65 typedef int (*uterm_vt_cb) (struct uterm_vt *vt, struct uterm_vt_event *ev,
68 int uterm_vt_master_new(struct uterm_vt_master **out,
69 struct ev_eloop *eloop);
70 void uterm_vt_master_ref(struct uterm_vt_master *vtm);
71 void uterm_vt_master_unref(struct uterm_vt_master *vtm);
73 int uterm_vt_master_activate_all(struct uterm_vt_master *vtm);
74 int uterm_vt_master_deactivate_all(struct uterm_vt_master *vtm);
76 int uterm_vt_allocate(struct uterm_vt_master *vt, struct uterm_vt **out,
77 unsigned int allowed_types,
78 const char *seat, struct uterm_input *input,
79 const char *vt_name, uterm_vt_cb cb, void *data);
80 void uterm_vt_deallocate(struct uterm_vt *vt);
81 void uterm_vt_ref(struct uterm_vt *vt);
82 void uterm_vt_unref(struct uterm_vt *vt);
84 int uterm_vt_activate(struct uterm_vt *vt);
85 int uterm_vt_deactivate(struct uterm_vt *vt);
86 void uterm_vt_retry(struct uterm_vt *vt);
87 unsigned int uterm_vt_get_type(struct uterm_vt *vt);
88 unsigned int uterm_vt_get_num(struct uterm_vt *vt);
90 #endif /* UTERM_UTERM_VT_H */