i3
Macros | Functions | Variables
config_directives.c File Reference
#include <float.h>
#include <stdarg.h>
#include "all.h"
Include dependency graph for config_directives.c:

Go to the source code of this file.

Macros

#define I3__FILE__   "config_directives.c"
 
#define y(x,...)   yajl_gen_ ## x (cmd_output->json_gen, ##__VA_ARGS__)
 
#define ystr(str)   yajl_gen_string(cmd_output->json_gen, (unsigned char*)str, strlen(str))
 
#define ysuccess(success)
 
#define APPLY_COLORS(classname)
 
#define APPLY_COLORS(classname)
 

Functions

 CFGFUN (criteria_init, int _state)
 
 CFGFUN (criteria_pop_state)
 
 CFGFUN (criteria_add, const char *ctype, const char *cvalue)
 
static bool eval_boolstr (const char *str)
 
static uint32_t modifiers_from_str (const char *str)
 
 CFGFUN (font, const char *font)
 
 CFGFUN (binding, const char *bindtype, const char *modifiers, const char *key, const char *release, const char *command)
 
 CFGFUN (mode_binding, const char *bindtype, const char *modifiers, const char *key, const char *release, const char *command)
 
 CFGFUN (enter_mode, const char *modename)
 
 CFGFUN (exec, const char *exectype, const char *no_startup_id, const char *command)
 
 CFGFUN (for_window, const char *command)
 
 CFGFUN (floating_minimum_size, const long width, const long height)
 
 CFGFUN (floating_maximum_size, const long width, const long height)
 
 CFGFUN (floating_modifier, const char *modifiers)
 
 CFGFUN (default_orientation, const char *orientation)
 
 CFGFUN (workspace_layout, const char *layout)
 
 CFGFUN (new_window, const char *windowtype, const char *border, const long width)
 
 CFGFUN (hide_edge_borders, const char *borders)
 
 CFGFUN (focus_follows_mouse, const char *value)
 
 CFGFUN (force_xinerama, const char *value)
 
 CFGFUN (force_focus_wrapping, const char *value)
 
 CFGFUN (workspace_back_and_forth, const char *value)
 
 CFGFUN (fake_outputs, const char *outputs)
 
 CFGFUN (force_display_urgency_hint, const long duration_ms)
 
 CFGFUN (workspace, const char *workspace, const char *output)
 
 CFGFUN (ipc_socket, const char *path)
 
 CFGFUN (restart_state, const char *path)
 
 CFGFUN (popup_during_fullscreen, const char *value)
 
 CFGFUN (color_single, const char *colorclass, const char *color)
 
 CFGFUN (color, const char *colorclass, const char *border, const char *background, const char *text, const char *indicator)
 
 CFGFUN (assign, const char *workspace)
 
 CFGFUN (bar_font, const char *font)
 
 CFGFUN (bar_mode, const char *mode)
 
 CFGFUN (bar_output, const char *output)
 
 CFGFUN (bar_verbose, const char *verbose)
 
 CFGFUN (bar_modifier, const char *modifier)
 
 CFGFUN (bar_position, const char *position)
 
 CFGFUN (bar_i3bar_command, const char *i3bar_command)
 
 CFGFUN (bar_color, const char *colorclass, const char *border, const char *background, const char *text)
 
 CFGFUN (bar_socket_path, const char *socket_path)
 
 CFGFUN (bar_tray_output, const char *output)
 
 CFGFUN (bar_color_single, const char *colorclass, const char *color)
 
 CFGFUN (bar_status_command, const char *command)
 
 CFGFUN (bar_workspace_buttons, const char *value)
 
 CFGFUN (bar_finish)
 

Variables

static int criteria_next_state
 
static char * font_pattern
 
static struct bindings_head * current_bindings
 
static Barconfig current_bar
 

Macro Definition Documentation

#define APPLY_COLORS (   classname)
Value:
do { \
if (strcmp(colorclass, "client." #classname) == 0) { \
config.client.classname.border = get_colorpixel(border); \
config.client.classname.background = get_colorpixel(background); \
config.client.classname.text = get_colorpixel(text); \
if (indicator != NULL) { \
config.client. classname .indicator = get_colorpixel(indicator); \
} \
} \
} while (0)

Referenced by CFGFUN().

#define APPLY_COLORS (   classname)
Value:
do { \
if (strcmp(colorclass, #classname) == 0) { \
if (text != NULL) { \
/* New syntax: border, background, text */ \
current_bar.colors. classname ## _border = sstrdup(border); \
current_bar.colors. classname ## _bg = sstrdup(background); \
current_bar.colors. classname ## _text = sstrdup(text); \
} else { \
/* Old syntax: text, background */ \
current_bar.colors. classname ## _bg = sstrdup(background); \
current_bar.colors. classname ## _text = sstrdup(border); \
} \
} \
} while (0)
#define I3__FILE__   "config_directives.c"

Definition at line 2 of file config_directives.c.

#define y (   x,
  ... 
)    yajl_gen_ ## x (cmd_output->json_gen, ##__VA_ARGS__)

Definition at line 18 of file config_directives.c.

#define ystr (   str)    yajl_gen_string(cmd_output->json_gen, (unsigned char*)str, strlen(str))

Definition at line 19 of file config_directives.c.

#define ysuccess (   success)
Value:
do { \
y(map_open); \
ystr("success"); \
y(bool, success); \
y(map_close); \
} while (0)

Definition at line 20 of file config_directives.c.

Function Documentation

CFGFUN ( criteria_init  ,
int  _state 
)

Definition at line 38 of file config_directives.c.

References criteria_next_state, current_match, DLOG, and match_init().

Here is the call graph for this function:

CFGFUN ( criteria_pop_state  )

Definition at line 45 of file config_directives.c.

References criteria_next_state.

CFGFUN ( criteria_add  ,
const char *  ctype,
const char *  cvalue 
)

Definition at line 54 of file config_directives.c.

References Match::class, Match::con_id, current_match, DLOG, ELOG, Match::id, Match::instance, Match::mark, regex_new(), Match::role, Match::title, and Match::urgent.

Here is the call graph for this function:

CFGFUN ( font  ,
const char *  font 
)

Definition at line 171 of file config_directives.c.

References config, Config::font, font_pattern, FREE, load_font(), set_font(), and sstrdup().

Here is the call graph for this function:

CFGFUN ( binding  ,
const char *  bindtype,
const char *  modifiers,
const char *  key,
const char *  release,
const char *  command 
)
CFGFUN ( mode_binding  ,
const char *  bindtype,
const char *  modifiers,
const char *  key,
const char *  release,
const char *  command 
)
CFGFUN ( enter_mode  ,
const char *  modename 
)

Definition at line 226 of file config_directives.c.

References Mode::bindings, current_bindings, DLOG, ELOG, modes, Mode::name, scalloc(), SLIST_INSERT_HEAD, sstrdup(), and TAILQ_INIT.

Here is the call graph for this function:

CFGFUN ( exec  ,
const char *  exectype,
const char *  no_startup_id,
const char *  command 
)

Definition at line 240 of file config_directives.c.

References autostarts, autostarts_always, smalloc(), sstrdup(), and TAILQ_INSERT_TAIL.

Here is the call graph for this function:

CFGFUN ( for_window  ,
const char *  command 
)
CFGFUN ( floating_minimum_size  ,
const long  width,
const long  height 
)
CFGFUN ( floating_maximum_size  ,
const long  width,
const long  height 
)
CFGFUN ( floating_modifier  ,
const char *  modifiers 
)

Definition at line 274 of file config_directives.c.

References config, Config::floating_modifier, and modifiers_from_str().

Here is the call graph for this function:

CFGFUN ( default_orientation  ,
const char *  orientation 
)

Definition at line 278 of file config_directives.c.

References config, Config::default_orientation, HORIZ, NO_ORIENTATION, and VERT.

CFGFUN ( workspace_layout  ,
const char *  layout 
)

Definition at line 286 of file config_directives.c.

References config, and Config::default_layout.

CFGFUN ( new_window  ,
const char *  windowtype,
const char *  border,
const long  width 
)
CFGFUN ( hide_edge_borders  ,
const char *  borders 
)
CFGFUN ( focus_follows_mouse  ,
const char *  value 
)

Definition at line 339 of file config_directives.c.

References config, Config::disable_focus_follows_mouse, and eval_boolstr().

Here is the call graph for this function:

CFGFUN ( force_xinerama  ,
const char *  value 
)

Definition at line 343 of file config_directives.c.

References config, eval_boolstr(), and Config::force_xinerama.

Here is the call graph for this function:

CFGFUN ( force_focus_wrapping  ,
const char *  value 
)

Definition at line 347 of file config_directives.c.

References config, eval_boolstr(), and Config::force_focus_wrapping.

Here is the call graph for this function:

CFGFUN ( workspace_back_and_forth  ,
const char *  value 
)

Definition at line 351 of file config_directives.c.

References config, eval_boolstr(), and Config::workspace_auto_back_and_forth.

Here is the call graph for this function:

CFGFUN ( fake_outputs  ,
const char *  outputs 
)

Definition at line 355 of file config_directives.c.

References config, Config::fake_outputs, and sstrdup().

Here is the call graph for this function:

CFGFUN ( force_display_urgency_hint  ,
const long  duration_ms 
)

Definition at line 359 of file config_directives.c.

References config, and Config::workspace_urgency_timer.

CFGFUN ( workspace  ,
const char *  workspace,
const char *  output 
)

Definition at line 363 of file config_directives.c.

References DLOG, ELOG, Workspace_Assignment::name, Workspace_Assignment::output, scalloc(), sstrdup(), TAILQ_FOREACH, TAILQ_INSERT_TAIL, and ws_assignments.

Here is the call graph for this function:

CFGFUN ( ipc_socket  ,
const char *  path 
)

Definition at line 386 of file config_directives.c.

References config, Config::ipc_socket_path, and sstrdup().

Here is the call graph for this function:

CFGFUN ( restart_state  ,
const char *  path 
)

Definition at line 390 of file config_directives.c.

References config, Config::restart_state_path, and sstrdup().

Here is the call graph for this function:

CFGFUN ( popup_during_fullscreen  ,
const char *  value 
)

Definition at line 394 of file config_directives.c.

References config, and Config::popup_during_fullscreen.

CFGFUN ( color_single  ,
const char *  colorclass,
const char *  color 
)

Definition at line 399 of file config_directives.c.

References Config::config_client::background, Config::client, config, and get_colorpixel().

Here is the call graph for this function:

CFGFUN ( color  ,
const char *  colorclass,
const char *  border,
const char *  background,
const char *  text,
const char *  indicator 
)

Definition at line 404 of file config_directives.c.

References APPLY_COLORS, and focused.

CFGFUN ( assign  ,
const char *  workspace 
)
CFGFUN ( bar_font  ,
const char *  font 
)

Definition at line 444 of file config_directives.c.

References Barconfig::font, FREE, and sstrdup().

Here is the call graph for this function:

CFGFUN ( bar_mode  ,
const char *  mode 
)

Definition at line 449 of file config_directives.c.

References Barconfig::mode.

CFGFUN ( bar_output  ,
const char *  output 
)

Definition at line 453 of file config_directives.c.

References Barconfig::num_outputs, Barconfig::outputs, srealloc(), and sstrdup().

Here is the call graph for this function:

CFGFUN ( bar_verbose  ,
const char *  verbose 
)

Definition at line 460 of file config_directives.c.

References eval_boolstr(), and Barconfig::verbose.

Here is the call graph for this function:

CFGFUN ( bar_modifier  ,
const char *  modifier 
)

Definition at line 464 of file config_directives.c.

References Barconfig::modifier.

CFGFUN ( bar_position  ,
const char *  position 
)

Definition at line 482 of file config_directives.c.

References Barconfig::position.

CFGFUN ( bar_i3bar_command  ,
const char *  i3bar_command 
)

Definition at line 486 of file config_directives.c.

References FREE, Barconfig::i3bar_command, and sstrdup().

Here is the call graph for this function:

CFGFUN ( bar_color  ,
const char *  colorclass,
const char *  border,
const char *  background,
const char *  text 
)

Definition at line 491 of file config_directives.c.

References APPLY_COLORS.

CFGFUN ( bar_socket_path  ,
const char *  socket_path 
)

Definition at line 516 of file config_directives.c.

References FREE, Barconfig::socket_path, and sstrdup().

Here is the call graph for this function:

CFGFUN ( bar_tray_output  ,
const char *  output 
)

Definition at line 521 of file config_directives.c.

References FREE, sstrdup(), and Barconfig::tray_output.

Here is the call graph for this function:

CFGFUN ( bar_color_single  ,
const char *  colorclass,
const char *  color 
)

Definition at line 526 of file config_directives.c.

References Barconfig::bar_colors::background, Barconfig::colors, sstrdup(), and Barconfig::bar_colors::statusline.

Here is the call graph for this function:

CFGFUN ( bar_status_command  ,
const char *  command 
)

Definition at line 532 of file config_directives.c.

References FREE, sstrdup(), and Barconfig::status_command.

Here is the call graph for this function:

CFGFUN ( bar_workspace_buttons  ,
const char *  value 
)

Definition at line 537 of file config_directives.c.

References eval_boolstr(), and Barconfig::hide_workspace_buttons.

Here is the call graph for this function:

CFGFUN ( bar_finish  )

Definition at line 541 of file config_directives.c.

References barconfigs, DLOG, Barconfig::font, font_pattern, Barconfig::id, scalloc(), sstrdup(), TAILQ_INSERT_TAIL, and x.

Here is the call graph for this function:

static bool eval_boolstr ( const char *  str)
static

Definition at line 134 of file config_directives.c.

Referenced by CFGFUN().

static uint32_t modifiers_from_str ( const char *  str)
static

Definition at line 143 of file config_directives.c.

References BIND_CONTROL, BIND_MOD1, BIND_MOD2, BIND_MOD3, BIND_MOD4, BIND_MOD5, BIND_MODE_SWITCH, and BIND_SHIFT.

Referenced by CFGFUN().

Variable Documentation

int criteria_next_state
static

Definition at line 31 of file config_directives.c.

Referenced by CFGFUN().

Barconfig current_bar
static

Definition at line 442 of file config_directives.c.

struct bindings_head* current_bindings
static

Definition at line 205 of file config_directives.c.

Referenced by CFGFUN().

char* font_pattern
static

Definition at line 169 of file config_directives.c.

Referenced by CFGFUN().