4 * Copyright (c) 2012 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.
27 * This includes global data for the whole kmscon application. For instance,
28 * global parameters can be accessed via this header.
38 #include "shl_dlist.h"
40 enum kmscon_conf_gpu_selection {
46 struct kmscon_conf_t {
47 /* header information */
51 /* show help/usage information */
53 /* exit application after parsing options */
55 /* enable verbose info messages */
57 /* enable debug messages */
59 /* disable notices and warnings */
61 /* config directory name */
67 /* VT number to run on */
69 /* enter new VT directly */
76 unsigned int session_max;
77 /* allow keyboard session control */
79 /* run terminal session */
80 bool terminal_session;
84 /* Terminal Options */
85 /* custom login process */
87 /* argv for login process */
91 /* reset environment */
95 /* terminal scroll-back buffer size */
101 /* input KBD layout */
103 /* input KBD variant */
105 /* input KBD options */
107 /* keyboard key-repeat delay */
108 unsigned int xkb_repeat_delay;
109 /* keyboard key-repeat rate */
110 unsigned int xkb_repeat_rate;
112 /* Grabs / Keyboard-Shortcuts */
114 struct conf_grab *grab_scroll_up;
115 /* scroll-down grab */
116 struct conf_grab *grab_scroll_down;
118 struct conf_grab *grab_page_up;
120 struct conf_grab *grab_page_down;
121 /* session-next grab */
122 struct conf_grab *grab_session_next;
123 /* session-prev grab */
124 struct conf_grab *grab_session_prev;
125 /* session-dummy grab */
126 struct conf_grab *grab_session_dummy;
127 /* session-close grab */
128 struct conf_grab *grab_session_close;
129 /* terminal-new grab */
130 struct conf_grab *grab_terminal_new;
133 /* use DRM if available */
135 /* use 3D hardware-acceleration if available */
137 /* gpu selection mode */
141 /* print render-engine timing information */
148 unsigned int font_size;
151 /* font ppi (overrides per monitor PPI) */
152 unsigned int font_ppi;
155 int kmscon_conf_new(struct conf_ctx **out);
156 void kmscon_conf_free(struct conf_ctx *ctx);
157 int kmscon_conf_load_main(struct conf_ctx *ctx, int argc, char **argv);
158 int kmscon_conf_load_seat(struct conf_ctx *ctx, const struct conf_ctx *main,
161 static inline bool kmscon_conf_is_current_seat(struct kmscon_conf_t *conf)
163 return conf && shl_string_list_is(conf->seats, "current");
166 static inline bool kmscon_conf_is_all_seats(struct kmscon_conf_t *conf)
168 return conf && shl_string_list_is(conf->seats, "all");
171 static inline bool kmscon_conf_is_single_seat(struct kmscon_conf_t *conf)
173 return conf && !kmscon_conf_is_all_seats(conf) &&
174 shl_string_list_count(conf->seats, true) == 1;
177 #endif /* KMSCON_MAIN_H */