i3
|
00001 /* 00002 * vim:ts=8:expandtab 00003 * 00004 * i3 - an improved dynamic tiling window manager 00005 * 00006 * © 2009-2010 Michael Stapelberg and contributors 00007 * 00008 * See file LICENSE for license information. 00009 * 00010 * include/config.h: Contains all structs/variables for the configurable 00011 * part of i3 as well as functions handling the configuration file (calling 00012 * the parser (src/cfgparse.y) with the correct path, switching key bindings 00013 * mode). 00014 * 00015 */ 00016 00017 #ifndef _CONFIG_H 00018 #define _CONFIG_H 00019 00020 #include <stdbool.h> 00021 #include "queue.h" 00022 #include "i3.h" 00023 00024 typedef struct Config Config; 00025 extern char *current_configpath; 00026 extern Config config; 00027 extern SLIST_HEAD(modes_head, Mode) modes; 00028 00034 struct context { 00035 bool has_errors; 00036 00037 int line_number; 00038 char *line_copy; 00039 const char *filename; 00040 00041 char *compact_error; 00042 00043 /* These are the same as in YYLTYPE */ 00044 int first_column; 00045 int last_column; 00046 }; 00047 00053 struct Colortriple { 00054 uint32_t border; 00055 uint32_t background; 00056 uint32_t text; 00057 }; 00058 00064 struct Variable { 00065 char *key; 00066 char *value; 00067 char *next_match; 00068 00069 SLIST_ENTRY(Variable) variables; 00070 }; 00071 00078 struct Mode { 00079 char *name; 00080 struct bindings_head *bindings; 00081 00082 SLIST_ENTRY(Mode) modes; 00083 }; 00084 00090 struct Config { 00091 const char *terminal; 00092 i3Font font; 00093 00094 char *ipc_socket_path; 00095 const char *restart_state_path; 00096 00097 int default_layout; 00098 int container_stack_limit; 00099 int container_stack_limit_value; 00100 00102 int default_orientation; 00103 00108 bool disable_focus_follows_mouse; 00109 00114 bool disable_workspace_bar; 00115 00124 bool force_focus_wrapping; 00125 00127 border_style_t default_border; 00128 00131 uint32_t floating_modifier; 00132 00133 /* Color codes are stored here */ 00134 struct config_client { 00135 uint32_t background; 00136 struct Colortriple focused; 00137 struct Colortriple focused_inactive; 00138 struct Colortriple unfocused; 00139 struct Colortriple urgent; 00140 } client; 00141 struct config_bar { 00142 struct Colortriple focused; 00143 struct Colortriple unfocused; 00144 struct Colortriple urgent; 00145 } bar; 00146 00148 enum { 00149 PDF_LEAVE_FULLSCREEN = 0, 00150 PDF_IGNORE = 1 00151 } popup_during_fullscreen; 00152 }; 00153 00161 void load_configuration(xcb_connection_t *conn, const char *override_configfile, bool reload); 00162 00167 void translate_keysyms(); 00168 00174 void ungrab_all_keys(xcb_connection_t *conn); 00175 00180 void grab_all_keys(xcb_connection_t *conn, bool bind_mode_switch); 00181 00186 void switch_mode(const char *new_mode); 00187 00193 Binding *get_binding(uint16_t modifiers, xcb_keycode_t keycode); 00194 00204 void kill_configerror_nagbar(bool wait_for_it); 00205 00206 /* prototype for src/cfgparse.y */ 00207 void parse_file(const char *f); 00208 00209 #endif