X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=parser-specs%2Fcommands.spec;h=e6480a35dca349271c3def7cc39f67f0be266d2b;hb=4c1ca3e29a336cd6b1613a9c2605bada2cfb85fc;hp=4407158cb6398c49fb358f48158c484190a80c64;hpb=78e99440f6ff144bb6842f3fb33c1f65faadc4df;p=i3%2Fi3 diff --git a/parser-specs/commands.spec b/parser-specs/commands.spec index 4407158c..e6480a35 100644 --- a/parser-specs/commands.spec +++ b/parser-specs/commands.spec @@ -1,7 +1,7 @@ # vim:ts=2:sw=2:expandtab # # i3 - an improved dynamic tiling window manager -# © 2009-2012 Michael Stapelberg and contributors (see also: LICENSE) +# © 2009 Michael Stapelberg and contributors (see also: LICENSE) # # parser-specs/commands.spec: Specification file for generate-command-parser.pl # which will generate the appropriate header files for our C parser. @@ -20,6 +20,7 @@ state INITIAL: 'restart' -> call cmd_restart() 'reload' -> call cmd_reload() 'shmlog' -> SHMLOG + 'debuglog' -> DEBUGLOG 'border' -> BORDER 'layout' -> LAYOUT 'append_layout' -> APPEND_LAYOUT @@ -28,25 +29,30 @@ state INITIAL: 'kill' -> KILL 'open' -> call cmd_open() 'fullscreen' -> FULLSCREEN + 'sticky' -> STICKY 'split' -> SPLIT 'floating' -> FLOATING 'mark' -> MARK + 'unmark' -> UNMARK 'resize' -> RESIZE 'rename' -> RENAME 'nop' -> NOP 'scratchpad' -> SCRATCHPAD + 'title_format' -> TITLE_FORMAT 'mode' -> MODE 'bar' -> BAR state CRITERIA: - ctype = 'class' -> CRITERION - ctype = 'instance' -> CRITERION + ctype = 'class' -> CRITERION + ctype = 'instance' -> CRITERION ctype = 'window_role' -> CRITERION - ctype = 'con_id' -> CRITERION - ctype = 'id' -> CRITERION - ctype = 'con_mark' -> CRITERION - ctype = 'title' -> CRITERION - ctype = 'urgent' -> CRITERION + ctype = 'con_id' -> CRITERION + ctype = 'id' -> CRITERION + ctype = 'window_type' -> CRITERION + ctype = 'con_mark' -> CRITERION + ctype = 'title' -> CRITERION + ctype = 'urgent' -> CRITERION + ctype = 'workspace' -> CRITERION ']' -> call cmd_criteria_match_windows(); INITIAL state CRITERION: @@ -69,7 +75,13 @@ state SHMLOG: argument = string -> call cmd_shmlog($argument) -# border normal|none|1pixel|toggle|1pixel +# debuglog toggle|on|off +state DEBUGLOG: + argument = 'toggle', 'on', 'off' + -> call cmd_debuglog($argument) + +# border normal|pixel [] +# border none|1pixel|toggle state BORDER: border_style = 'normal', 'pixel' -> BORDER_WIDTH @@ -105,9 +117,11 @@ state APPEND_LAYOUT: # workspace next|prev|next_on_output|prev_on_output # workspace back_and_forth -# workspace -# workspace number +# workspace [--no-auto-back-and-forth] +# workspace [--no-auto-back-and-forth] number state WORKSPACE: + no_auto_back_and_forth = '--no-auto-back-and-forth' + -> direction = 'next_on_output', 'prev_on_output', 'next', 'prev' -> call cmd_workspace($direction) 'back_and_forth' @@ -115,11 +129,11 @@ state WORKSPACE: 'number' -> WORKSPACE_NUMBER workspace = string - -> call cmd_workspace_name($workspace) + -> call cmd_workspace_name($workspace, $no_auto_back_and_forth) state WORKSPACE_NUMBER: workspace = string - -> call cmd_workspace_number($workspace) + -> call cmd_workspace_number($workspace, $no_auto_back_and_forth) # focus left|right|up|down # focus output @@ -149,16 +163,37 @@ state KILL: end -> call cmd_kill($kill_mode) +# fullscreen enable|toggle [global] +# fullscreen disable # fullscreen [global] state FULLSCREEN: - fullscreen_mode = 'global' - -> call cmd_fullscreen($fullscreen_mode) + action = 'disable' + -> call cmd_fullscreen($action, "output") + action = 'enable', 'toggle' + -> FULLSCREEN_MODE + action = '' + -> FULLSCREEN_COMPAT + +state FULLSCREEN_MODE: + mode = 'global' + -> call cmd_fullscreen($action, $mode) + end + -> call cmd_fullscreen($action, "output") + +state FULLSCREEN_COMPAT: + mode = 'global' + -> call cmd_fullscreen("toggle", $mode) end - -> call cmd_fullscreen($fullscreen_mode) + -> call cmd_fullscreen("toggle", "output") + +# sticky enable|disable|toggle +state STICKY: + action = 'enable', 'disable', 'toggle' + -> call cmd_sticky($action) -# split v|h|vertical|horizontal +# split v|h|t|vertical|horizontal|toggle state SPLIT: - direction = 'horizontal', 'vertical', 'v', 'h' + direction = 'horizontal', 'vertical', 'toggle', 'v', 'h', 't' -> call cmd_split($direction) # floating enable|disable|toggle @@ -166,25 +201,38 @@ state FLOATING: floating = 'enable', 'disable', 'toggle' -> call cmd_floating($floating) -# mark +# mark [--add|--replace] [--toggle] state MARK: + mode = '--add', '--replace' + -> + toggle = '--toggle' + -> + mark = string + -> call cmd_mark($mark, $mode, $toggle) + +# unmark [mark] +state UNMARK: + end + -> call cmd_unmark($mark) mark = string - -> call cmd_mark($mark) + -> call cmd_unmark($mark) # resize state RESIZE: way = 'grow', 'shrink' -> RESIZE_DIRECTION + set = 'set' + -> RESIZE_SET state RESIZE_DIRECTION: direction = 'up', 'down', 'left', 'right', 'width', 'height' -> RESIZE_PX state RESIZE_PX: - resize_px = word + resize_px = number -> RESIZE_TILING end - -> call cmd_resize($way, $direction, "10", "10") + -> call cmd_resize($way, $direction, 10, 10) state RESIZE_TILING: 'px' @@ -192,15 +240,29 @@ state RESIZE_TILING: 'or' -> RESIZE_TILING_OR end - -> call cmd_resize($way, $direction, $resize_px, "10") + -> call cmd_resize($way, $direction, &resize_px, 10) state RESIZE_TILING_OR: - 'ppt' - -> - resize_ppt = word + resize_ppt = number + -> RESIZE_TILING_FINAL + +state RESIZE_TILING_FINAL: + 'ppt', end + -> call cmd_resize($way, $direction, &resize_px, &resize_ppt) + +state RESIZE_SET: + width = number + -> RESIZE_WIDTH + +state RESIZE_WIDTH: + 'px' -> - end - -> call cmd_resize($way, $direction, $resize_px, $resize_ppt) + height = number + -> RESIZE_HEIGHT + +state RESIZE_HEIGHT: + 'px', end + -> call cmd_resize_set(&width, &height) # rename workspace to # rename workspace to @@ -233,10 +295,12 @@ state RENAME_WORKSPACE_NEW_NAME: # move [ [px]] # move [window|container] [to] workspace [|next|prev|next_on_output|prev_on_output|current] # move [window|container] [to] output +# move [window|container] [to] mark # move [window|container] [to] scratchpad # move workspace to [output] # move scratchpad # move [window|container] [to] [absolute] position [ [ [px] [px]] | center ] +# move [window|container] [to] position mouse|cursor|pointer state MOVE: 'window' -> @@ -244,10 +308,14 @@ state MOVE: -> 'to' -> + no_auto_back_and_forth = '--no-auto-back-and-forth' + -> 'workspace' -> MOVE_WORKSPACE 'output' -> MOVE_TO_OUTPUT + 'mark' + -> MOVE_TO_MARK 'scratchpad' -> call cmd_move_scratchpad() direction = 'left', 'right', 'up', 'down' @@ -258,16 +326,16 @@ state MOVE: -> MOVE_TO_ABSOLUTE_POSITION state MOVE_DIRECTION: - pixels = word + pixels = number -> MOVE_DIRECTION_PX end - -> call cmd_move_direction($direction, "10") + -> call cmd_move_direction($direction, 10) state MOVE_DIRECTION_PX: 'px' - -> call cmd_move_direction($direction, $pixels) + -> call cmd_move_direction($direction, &pixels) end - -> call cmd_move_direction($direction, $pixels) + -> call cmd_move_direction($direction, &pixels) state MOVE_WORKSPACE: 'to ' @@ -279,16 +347,20 @@ state MOVE_WORKSPACE: 'number' -> MOVE_WORKSPACE_NUMBER workspace = string - -> call cmd_move_con_to_workspace_name($workspace) + -> call cmd_move_con_to_workspace_name($workspace, $no_auto_back_and_forth) state MOVE_WORKSPACE_NUMBER: number = string - -> call cmd_move_con_to_workspace_number($number) + -> call cmd_move_con_to_workspace_number($number, $no_auto_back_and_forth) state MOVE_TO_OUTPUT: output = string -> call cmd_move_con_to_output($output) +state MOVE_TO_MARK: + mark = string + -> call cmd_move_con_to_mark($mark) + state MOVE_WORKSPACE_TO_OUTPUT: 'output' -> @@ -302,18 +374,20 @@ state MOVE_TO_ABSOLUTE_POSITION: state MOVE_TO_POSITION: 'center' -> call cmd_move_window_to_center($method) - coord_x = word + 'mouse', 'cursor', 'pointer' + -> call cmd_move_window_to_mouse() + coord_x = number -> MOVE_TO_POSITION_X state MOVE_TO_POSITION_X: 'px' -> - coord_y = word + coord_y = number -> MOVE_TO_POSITION_Y state MOVE_TO_POSITION_Y: 'px', end - -> call cmd_move_window_to_position($method, $coord_x, $coord_y) + -> call cmd_move_window_to_position($method, &coord_x, &coord_y) # mode state MODE: @@ -323,11 +397,17 @@ state MODE: state NOP: comment = string -> call cmd_nop($comment) + end + -> call cmd_nop(NULL) state SCRATCHPAD: 'show' -> call cmd_scratchpad_show() +state TITLE_FORMAT: + format = string + -> call cmd_title_format($format) + # bar (hidden_state hide|show|toggle)|(mode dock|hide|invisible|toggle) [] state BAR: bar_type = 'hidden_state'