#include <stdbool.h>
#include "queue.h"
#include "i3.h"
Go to the source code of this file.
Data Structures | |
struct | context |
Used during the config file lexing/parsing to keep the state of the lexer in order to provide useful error messages in yyerror(). More... | |
struct | Colortriple |
Part of the struct Config. More... | |
struct | Variable |
Holds a user-assigned variable for parsing the configuration file. More... | |
struct | Mode |
The configuration file can contain multiple sets of bindings. More... | |
struct | Config |
Holds part of the configuration (the part which is not already in dedicated structures in include/data.h). More... | |
struct | Config::config_client |
struct | Config::config_bar |
Typedefs | |
typedef struct Config | Config |
Functions | |
SLIST_HEAD (modes_head, Mode) modes | |
char * | glob_path (const char *path) |
This function resolves ~ in pathnames. | |
bool | path_exists (const char *path) |
Checks if the given path exists by calling stat(). | |
void | load_configuration (xcb_connection_t *conn, const char *override_configfile, bool reload) |
Reads the configuration from ~/.i3/config or /etc/i3/config if not found. | |
void | translate_keysyms () |
Translates keysymbols to keycodes for all bindings which use keysyms. | |
void | ungrab_all_keys (xcb_connection_t *conn) |
Ungrabs all keys, to be called before re-grabbing the keys because of a mapping_notify event or a configuration file reload. | |
void | grab_all_keys (xcb_connection_t *conn, bool bind_mode_switch) |
Grab the bound keys (tell X to send us keypress events for those keycodes). | |
void | switch_mode (xcb_connection_t *conn, const char *new_mode) |
Switches the key bindings to the given mode, if the mode exists. | |
Binding * | get_binding (uint16_t modifiers, xcb_keycode_t keycode) |
Returns a pointer to the Binding with the specified modifiers and keycode or NULL if no such binding exists. | |
void | parse_file (const char *f) |
Variables | |
Config | config |
Binding* get_binding | ( | uint16_t | modifiers, | |
xcb_keycode_t | keycode | |||
) |
Returns a pointer to the Binding with the specified modifiers and keycode or NULL if no such binding exists.
Definition at line 109 of file config.c.
References bindings, Binding::keycode, Binding::mods, Binding::number_keycodes, Binding::symbol, TAILQ_END, TAILQ_FOREACH, and Binding::translated_to.
Referenced by handle_key_press().
char* glob_path | ( | const char * | path | ) |
This function resolves ~ in pathnames.
Definition at line 44 of file config.c.
References die, and sstrdup().
Referenced by get_config_path(), and ipc_create_socket().
void grab_all_keys | ( | xcb_connection_t * | conn, | |
bool | bind_mode_switch | |||
) |
Grab the bound keys (tell X to send us keypress events for those keycodes).
Definition at line 188 of file config.c.
References BIND_MODE_SWITCH, bindings, grab_keycode_for_binding(), Binding::keycode, Binding::mods, Binding::number_keycodes, TAILQ_FOREACH, and Binding::translated_to.
Referenced by handle_mapping_notify(), load_configuration(), main(), switch_mode(), and xkb_got_event().
void load_configuration | ( | xcb_connection_t * | conn, | |
const char * | override_configfile, | |||
bool | reload | |||
) |
Reads the configuration from ~/.i3/config or /etc/i3/config if not found.
If you specify override_configpath, only this path is used to look for a configuration file.
Definition at line 307 of file config.c.
References assignments, Config::config_client::background, Config::bar, Mode::bindings, bindings, Config::client, Binding::command, Config::config_bar::focused, Config::config_client::focused, Config::config_client::focused_inactive, Config::font, FREE, get_colorpixel(), global_conn, grab_all_keys(), INIT_COLOR, modes, Workspace::name, Mode::name, Workspace::name_len, parse_configuration(), predict_text_width(), REQUIRED_OPTION, scalloc(), SLIST_EMPTY, SLIST_FIRST, SLIST_INIT, SLIST_INSERT_HEAD, SLIST_REMOVE, sstrdup(), TAILQ_EMPTY, TAILQ_FIRST, TAILQ_FOREACH, TAILQ_INIT, TAILQ_REMOVE, Workspace::text_width, translate_keysyms(), Binding::translated_to, Config::config_bar::unfocused, Config::config_client::unfocused, ungrab_all_keys(), Config::config_bar::urgent, Config::config_client::urgent, Assignment::windowclass_title, workspace_set_name(), and workspaces.
Referenced by main(), and parse_command().
void parse_file | ( | const char * | f | ) |
Definition at line 129 of file cfgparse.tab.c.
References die, DLOG, context::filename, FREE, Variable::key, context::line_copy, Variable::next_match, scalloc(), SLIST_EMPTY, SLIST_FIRST, SLIST_FOREACH, SLIST_HEAD, SLIST_HEAD_INITIALIZER, SLIST_INSERT_HEAD, SLIST_REMOVE_HEAD, smalloc(), sstrdup(), Variable::value, yy_scan_string(), and yyparse().
Referenced by parse_configuration().
bool path_exists | ( | const char * | path | ) |
Checks if the given path exists by calling stat().
Definition at line 70 of file config.c.
Referenced by get_config_path(), and ipc_create_socket().
SLIST_HEAD | ( | modes_head | , | |
Mode | ||||
) |
void switch_mode | ( | xcb_connection_t * | conn, | |
const char * | new_mode | |||
) |
Switches the key bindings to the given mode, if the mode exists.
Definition at line 211 of file config.c.
References Mode::bindings, bindings, ELOG, grab_all_keys(), LOG, modes, Mode::name, SLIST_FOREACH, translate_keysyms(), and ungrab_all_keys().
Referenced by parse_command().
void translate_keysyms | ( | ) |
Translates keysymbols to keycodes for all bindings which use keysyms.
Definition at line 138 of file config.c.
References bindings, DLOG, ELOG, global_conn, grab_keycode_for_binding(), Binding::keycode, keysyms, Binding::number_keycodes, smalloc(), Binding::symbol, TAILQ_FOREACH, and Binding::translated_to.
Referenced by handle_mapping_notify(), load_configuration(), main(), switch_mode(), and xkb_got_event().
void ungrab_all_keys | ( | xcb_connection_t * | conn | ) |
Ungrabs all keys, to be called before re-grabbing the keys because of a mapping_notify event or a configuration file reload.
Definition at line 80 of file config.c.
Referenced by handle_mapping_notify(), load_configuration(), switch_mode(), and xkb_got_event().
Definition at line 37 of file config.c.
Referenced by button_press_stackwin(), client_min_height(), decorate_window(), expand_table_cols(), expand_table_rows(), handle_button_press(), handle_configure_request(), handle_enter_notify(), handle_expose_event(), handle_signal(), initialize_output(), main(), new_container(), output_change_mode(), render_container(), render_internal_bar(), render_workspace(), reparent_window(), resize_client(), resize_graphical_handler(), toggle_floating_mode(), workspace_height(), workspace_set_name(), and yyparse().