* vim:ts=4:sw=4:expandtab
*
*/
+#undef I3__FILE__
+#define I3__FILE__ "cfgparse.y"
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/wait.h>
%token TOK_NONE "none"
%token TOK_1PIXEL "1pixel"
%token TOK_HIDE_EDGE_BORDERS "hide_edge_borders"
+%token TOK_BOTH "both"
%token TOKFOCUSFOLLOWSMOUSE "focus_follows_mouse"
%token TOK_FORCE_FOCUS_WRAPPING "force_focus_wrapping"
%token TOK_FORCE_XINERAMA "force_xinerama"
%token TOK_BAR_COLOR_INACTIVE_WORKSPACE "inactive_workspace"
%token TOK_BAR_COLOR_URGENT_WORKSPACE "urgent_workspace"
%token TOK_NO_STARTUP_ID "--no-startup-id"
+%token TOK_RELEASE "--release"
%token TOK_MARK "mark"
%token TOK_CLASS "class"
%type <number> layout_mode
%type <number> border_style
%type <number> new_window
+%type <number> hide_edge_borders
+%type <number> edge_hiding_mode
%type <number> new_float
%type <number> colorpixel
%type <number> bool
%type <number> bar_mode_mode
%type <number> bar_modifier_modifier
%type <number> optional_no_startup_id
+%type <number> optional_release
%type <string> command
%type <string> word_or_number
%type <string> qstring_or_number
;
bindcode:
- binding_modifiers NUMBER command
+ optional_release binding_modifiers NUMBER command
{
- printf("\tFound keycode binding mod%d with key %d and command %s\n", $1, $2, $3);
+ DLOG("bindcode: release = %d, mod = %d, key = %d, command = %s\n", $1, $2, $3, $4);
Binding *new = scalloc(sizeof(Binding));
- new->keycode = $2;
- new->mods = $1;
- new->command = $3;
+ new->release = $1;
+ new->keycode = $3;
+ new->mods = $2;
+ new->command = $4;
$$ = new;
}
;
bindsym:
- binding_modifiers word_or_number command
+ optional_release binding_modifiers word_or_number command
{
- printf("\tFound keysym binding mod%d with key %s and command %s\n", $1, $2, $3);
+ DLOG("bindsym: release = %d, mod = %d, key = %s, command = %s\n", $1, $2, $3, $4);
Binding *new = scalloc(sizeof(Binding));
- new->symbol = $2;
- new->mods = $1;
- new->command = $3;
+ new->release = $1;
+ new->symbol = $3;
+ new->mods = $2;
+ new->command = $4;
$$ = new;
}
;
+optional_release:
+ /* empty */ { $$ = false; }
+ | TOK_RELEASE { $$ = true; }
+ ;
+
for_window:
TOK_FOR_WINDOW match command
{
;
hide_edge_borders:
- TOK_HIDE_EDGE_BORDERS bool
+ TOK_HIDE_EDGE_BORDERS edge_hiding_mode
{
DLOG("hide edge borders = %d\n", $2);
config.hide_edge_borders = $2;
}
;
+edge_hiding_mode:
+ TOK_NONE { $$ = ADJ_NONE; }
+ | TOK_VERT { $$ = ADJ_LEFT_SCREEN_EDGE | ADJ_RIGHT_SCREEN_EDGE; }
+ | TOK_HORIZ { $$ = ADJ_UPPER_SCREEN_EDGE | ADJ_LOWER_SCREEN_EDGE; }
+ | TOK_BOTH { $$ = ADJ_LEFT_SCREEN_EDGE | ADJ_RIGHT_SCREEN_EDGE | ADJ_UPPER_SCREEN_EDGE | ADJ_LOWER_SCREEN_EDGE; }
+ | bool { $$ = ($1 ? ADJ_LEFT_SCREEN_EDGE | ADJ_RIGHT_SCREEN_EDGE : ADJ_NONE); }
+ ;
+
focus_follows_mouse:
TOKFOCUSFOLLOWSMOUSE bool
{