]> git.sur5r.net Git - i3/i3/blobdiff - parser-specs/commands.spec
Merge pull request #1697 from Airblader/feature-1695
[i3/i3] / parser-specs / commands.spec
index a4a01a88d0668385bb5c154d4c058b016771953a..c3e6e4892ad9b6244c1bc383c87152cbf117da19 100644 (file)
@@ -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.
@@ -19,6 +19,8 @@ state INITIAL:
   'exit' -> call cmd_exit()
   'restart' -> call cmd_restart()
   'reload' -> call cmd_reload()
+  'shmlog' -> SHMLOG
+  'debuglog' -> DEBUGLOG
   'border' -> BORDER
   'layout' -> LAYOUT
   'append_layout' -> APPEND_LAYOUT
@@ -30,21 +32,24 @@ state INITIAL:
   'split' -> SPLIT
   'floating' -> FLOATING
   'mark' -> MARK
+  'unmark' -> UNMARK
   'resize' -> RESIZE
   'rename' -> RENAME
   'nop' -> NOP
   'scratchpad' -> SCRATCHPAD
   '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
   ']' -> call cmd_criteria_match_windows(); INITIAL
 
 state CRITERION:
@@ -61,7 +66,19 @@ state EXEC:
   command = string
       -> call cmd_exec($nosn, $command)
 
-# border normal|none|1pixel|toggle|1pixel
+# shmlog <size>|toggle|on|off
+state SHMLOG:
+  # argument may be a number
+  argument = string
+    -> call cmd_shmlog($argument)
+
+# debuglog toggle|on|off
+state DEBUGLOG:
+  argument = 'toggle', 'on', 'off'
+    -> call cmd_debuglog($argument)
+
+# border normal|pixel [<n>]
+# border none|1pixel|toggle
 state BORDER:
   border_style = 'normal', 'pixel'
     -> BORDER_WIDTH
@@ -141,12 +158,28 @@ 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")
 
 # split v|h|vertical|horizontal
 state SPLIT:
@@ -158,10 +191,19 @@ state FLOATING:
   floating = 'enable', 'disable', 'toggle'
       -> call cmd_floating($floating)
 
-# mark <mark>
+# mark [--toggle] <mark>
 state MARK:
+  toggle = '--toggle'
+      ->
   mark = string
-      -> call cmd_mark($mark)
+      -> call cmd_mark($mark, $toggle)
+
+# unmark [mark]
+state UNMARK:
+  end
+      -> call cmd_unmark($mark)
+  mark = string
+      -> call cmd_unmark($mark)
 
 # resize
 state RESIZE:
@@ -187,11 +229,11 @@ state RESIZE_TILING:
       -> call cmd_resize($way, $direction, $resize_px, "10")
 
 state RESIZE_TILING_OR:
-  'ppt'
-      ->
   resize_ppt = word
-      ->
-  end
+      -> RESIZE_TILING_FINAL
+
+state RESIZE_TILING_FINAL:
+  'ppt', end
       -> call cmd_resize($way, $direction, $resize_px, $resize_ppt)
 
 # rename workspace <name> to <name>
@@ -225,10 +267,12 @@ state RENAME_WORKSPACE_NEW_NAME:
 # move <direction> [<pixels> [px]]
 # move [window|container] [to] workspace [<str>|next|prev|next_on_output|prev_on_output|current]
 # move [window|container] [to] output <str>
+# move [window|container] [to] mark <str>
 # move [window|container] [to] scratchpad
 # move workspace to [output] <str>
 # move scratchpad
 # move [window|container] [to] [absolute] position [ [<pixels> [px] <pixels> [px]] | center ]
+# move [window|container] [to] position mouse|cursor|pointer
 state MOVE:
   'window'
       ->
@@ -240,6 +284,8 @@ state MOVE:
       -> MOVE_WORKSPACE
   'output'
       -> MOVE_TO_OUTPUT
+  'mark'
+      -> MOVE_TO_MARK
   'scratchpad'
       -> call cmd_move_scratchpad()
   direction = 'left', 'right', 'up', 'down'
@@ -281,6 +327,10 @@ 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'
       ->
@@ -294,6 +344,8 @@ state MOVE_TO_ABSOLUTE_POSITION:
 state MOVE_TO_POSITION:
   'center'
       -> call cmd_move_window_to_center($method)
+  'mouse', 'cursor', 'pointer'
+      -> call cmd_move_window_to_mouse()
   coord_x = word
       -> MOVE_TO_POSITION_X
 
@@ -315,7 +367,30 @@ state MODE:
 state NOP:
   comment = string
       -> call cmd_nop($comment)
+  end
+      -> call cmd_nop(NULL)
 
 state SCRATCHPAD:
   'show'
       -> call cmd_scratchpad_show()
+
+# bar (hidden_state hide|show|toggle)|(mode dock|hide|invisible|toggle) [<bar_id>]
+state BAR:
+  bar_type = 'hidden_state'
+      -> BAR_HIDDEN_STATE
+  bar_type = 'mode'
+      -> BAR_MODE
+
+state BAR_HIDDEN_STATE:
+  bar_value = 'hide', 'show', 'toggle'
+      -> BAR_W_ID
+
+state BAR_MODE:
+  bar_value = 'dock', 'hide', 'invisible', 'toggle'
+      -> BAR_W_ID
+
+state BAR_W_ID:
+  bar_id = word
+      ->
+  end
+      -> call cmd_bar($bar_type, $bar_value, $bar_id)