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;
82 /* Terminal Options */
83 /* custom login process */
85 /* argv for login process */
89 /* reset environment */
93 /* terminal scroll-back buffer size */
99 /* input KBD layout */
101 /* input KBD variant */
103 /* input KBD options */
105 /* input predefined KBD keymap */
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;
122 struct conf_grab *grab_zoom_in;
124 struct conf_grab *grab_zoom_out;
125 /* session-next grab */
126 struct conf_grab *grab_session_next;
127 /* session-prev grab */
128 struct conf_grab *grab_session_prev;
129 /* session-dummy grab */
130 struct conf_grab *grab_session_dummy;
131 /* session-close grab */
132 struct conf_grab *grab_session_close;
133 /* terminal-new grab */
134 struct conf_grab *grab_terminal_new;
137 /* use DRM if available */
139 /* use 3D hardware-acceleration if available */
141 /* gpu selection mode */
145 /* print render-engine timing information */
152 unsigned int font_size;
155 /* font ppi (overrides per monitor PPI) */
156 unsigned int font_ppi;
159 int kmscon_conf_new(struct conf_ctx **out);
160 void kmscon_conf_free(struct conf_ctx *ctx);
161 int kmscon_conf_load_main(struct conf_ctx *ctx, int argc, char **argv);
162 int kmscon_conf_load_seat(struct conf_ctx *ctx, const struct conf_ctx *main,
165 static inline bool kmscon_conf_is_current_seat(struct kmscon_conf_t *conf)
167 return conf && shl_string_list_is(conf->seats, "current");
170 static inline bool kmscon_conf_is_all_seats(struct kmscon_conf_t *conf)
172 return conf && shl_string_list_is(conf->seats, "all");
175 static inline bool kmscon_conf_is_single_seat(struct kmscon_conf_t *conf)
177 return conf && !kmscon_conf_is_all_seats(conf) &&
178 shl_string_list_count(conf->seats, true) == 1;
181 #endif /* KMSCON_MAIN_H */