2 * kmscon - VT compatibility layer
4 * Copyright (c) 2011 David Herrmann <dh.herrmann@googlemail.com>
5 * Copyright (c) 2011 University of Tuebingen
7 * Permission is hereby granted, free of charge, to any person obtaining
8 * a copy of this software and associated documentation files
9 * (the "Software"), to deal in the Software without restriction, including
10 * without limitation the rights to use, copy, modify, merge, publish,
11 * distribute, sublicense, and/or sell copies of the Software, and to
12 * permit persons to whom the Software is furnished to do so, subject to
13 * the following conditions:
15 * The above copyright notice and this permission notice shall be included
16 * in all copies or substantial portions of the Software.
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
21 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
22 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 * If the kmscon application runs in a VT we need to react on VT switch events
30 * to allow other applications to access the DRM. This is only needed as long as
31 * we run in a VT. In the future we will be able to disable all VTs and run as
32 * service daemon. We then need another way to switch between graphical
33 * applications, though.
45 typedef bool (*kmscon_vt_cb) (struct kmscon_vt *vt, int action, void *data);
47 enum kmscon_vt_action {
57 int kmscon_vt_new(struct kmscon_vt **out, kmscon_vt_cb cb, void *data);
58 void kmscon_vt_ref(struct kmscon_vt *vt);
59 void kmscon_vt_unref(struct kmscon_vt *vt);
61 int kmscon_vt_open(struct kmscon_vt *vt, int id, struct ev_eloop *eloop);
62 void kmscon_vt_close(struct kmscon_vt *vt);
64 int kmscon_vt_enter(struct kmscon_vt *vt);
65 int kmscon_vt_leave(struct kmscon_vt *vt);
67 #endif /* KMSCON_VT_H */